Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(data): a shot-down plane's crash spares its owner and allies
Olcay Seygan62f50fa0b544
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bb6211052..a7e59d307 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -111,7 +111,7 @@ found and fixed — EA's own, not port damage.**- A shot-down jet now hits the ground with a blast: 80 damage in a small radius. A B-52, a B-3, a cargo plane, the carpet bomber or a Spectre does 160 in a wider one.- The wreck leaves fire burning for about 6 seconds, and the fire sets infantry alight. A big plane leaves a line of fires along the length of the wreck.-- The blast and the fire do not pick sides. A bomber brought down over your own army hurts your own army.+- The blast and the fire spare the plane's owner and allies, and still hurt enemies and neutral buildings. A Supply Drop plane shot down over your own base used to wreck it; in a test the same crash that cost your own side 10 men and 136 health off two power plants now leaves them untouched, while the enemy beside them loses the same 10 men.- Bombers and cargo planes no longer vanish silently when they hit the ground. A jet destroyed while it sits parked is unchanged.## A tank shell kills the man it hitsdiff --git a/GeneralsMD/Code/Data/INI/BalanceReforged.ini b/GeneralsMD/Code/Data/INI/BalanceReforged.iniindex 98310fc80..012f4eb1e 100644--- a/GeneralsMD/Code/Data/INI/BalanceReforged.ini+++ b/GeneralsMD/Code/Data/INI/BalanceReforged.ini@@ -1963,8 +1963,9 @@ End; reskin may be a new name in this file where a plain Object may not. A reskin changes only the; draw module, so a second block under each name swaps the rest.;-; Reforged_JetCrashFire keeps EA's SmallFireFieldWeapon, 5 FLAME across 30 every quarter second,-; BURNED and hitting every side, and burns 6 seconds where the napalm field burns 2.5: 120 to a+; Reforged_JetCrashFire fires Reforged_JetCrashFireWeapon, EA's SmallFireFieldWeapon (5 FLAME+; across 30 every quarter second, BURNED) that spares the plane's own player and its allies, as+; the blasts do, and burns 6 seconds where the napalm field burns 2.5: 120 to a; tank's hull before armour, 180 to a man in HumanArmor who stays in it. Its flames are EA's; inferno burst for the first moments, then the burning-building fire and smoke for as long as it; stands; the smoke drifts off after it goes. Reforged_JetCrashImpact and Reforged_BigJetCrashImpact@@ -1990,6 +1991,11 @@ ObjectReskin Reforged_JetCrashFire FireFieldSmallEndObject Reforged_JetCrashFire+ ReplaceModule ModuleTag_03+ Behavior = FireWeaponUpdate ModuleTag_03_Crash+ Weapon = Reforged_JetCrashFireWeapon+ End+ EndReplaceModule ModuleTag_04Behavior = DeletionUpdate ModuleTag_04_CrashMinLifetime = 6000diff --git a/GeneralsMD/Code/Data/INI/ObjectCreationListReforged.ini b/GeneralsMD/Code/Data/INI/ObjectCreationListReforged.iniindex 8ab1a6bd1..e5b7b5761 100644--- a/GeneralsMD/Code/Data/INI/ObjectCreationListReforged.ini+++ b/GeneralsMD/Code/Data/INI/ObjectCreationListReforged.ini@@ -1996,7 +1996,8 @@ End; A plane shot down hit the ground with a flash and a few flying parts and hurt nobody. Where it; lands now it blows up and the spot burns on for six seconds, flames and smoke, setting alight-; whoever stands in it, whichever side. A fighter's crash is Reforged_JetCrashImpact (80 EXPLOSION+; any enemy or neutral that stands in it. The crash objects take the plane's team, so its own+; player and allies are spared. A fighter's crash is Reforged_JetCrashImpact (80 EXPLOSION; across 35) and one Reforged_JetCrashFire (EA's napalm fire field kept burning longer); a big; plane's is Reforged_BigJetCrashImpact (160 across 70) and four of those fires laid along its line; of flight, 30 apart. The objects are in BalanceReforged.ini, the blasts in WeaponReforged.ini.diff --git a/GeneralsMD/Code/Data/INI/WeaponReforged.ini b/GeneralsMD/Code/Data/INI/WeaponReforged.iniindex f3c3315b2..a8d1d66fb 100644--- a/GeneralsMD/Code/Data/INI/WeaponReforged.ini+++ b/GeneralsMD/Code/Data/INI/WeaponReforged.ini@@ -32,10 +32,12 @@ End; Where a shot-down plane hits the ground. BalanceReforged.ini's Reforged_JetCrashImpact and; Reforged_BigJetCrashImpact fire one of these once from the impact point and are gone; the fire-; that burns on after them is EA's SmallFireFieldWeapon on Reforged_JetCrashFire. A crash spares-; nobody, so allies and the plane's own side take it too. The fighter's blast plays-; FX_RaptorCrashExplosion, which EA named for a Raptor crash and never gave to anything. B-52s,-; B-3s, the cargo planes, the carpet bomber and the Spectre take the big one.+; that burns on after them is Reforged_JetCrashFireWeapon on Reforged_JetCrashFire. The crash+; objects belong to the plane's player (the OCL hands them its team), so a crash spares that+; player and its allies and hurts enemies and neutrals: a Supply Drop plane shot down over its own+; base used to wreck it. The fighter's blast plays FX_RaptorCrashExplosion, which EA named for a+; Raptor crash and never gave to anything. B-52s, B-3s, the cargo planes, the carpet bomber and+; the Spectre take the big one.Weapon Reforged_JetCrashBlastPrimaryDamage = 80.0PrimaryDamageRadius = 35.0@@ -45,7 +47,7 @@ Weapon Reforged_JetCrashBlastWeaponSpeed = 99999.0ProjectileObject = NONEFireFX = FX_RaptorCrashExplosion- RadiusDamageAffects = ALLIES ENEMIES NEUTRALS+ RadiusDamageAffects = ENEMIES NEUTRALSDelayBetweenShots = 0ClipSize = 1ClipReloadTime = 0@@ -61,13 +63,27 @@ Weapon Reforged_BigJetCrashBlastWeaponSpeed = 99999.0ProjectileObject = NONEFireFX = FX_SpectreHowitzerExplosion- RadiusDamageAffects = ALLIES ENEMIES NEUTRALS+ RadiusDamageAffects = ENEMIES NEUTRALSDelayBetweenShots = 0ClipSize = 1ClipReloadTime = 0AutoReloadsClip = NoEnd+; EA's SmallFireFieldWeapon with the friendly side left out. The napalm fire fields keep EA's,+; which still burns every side.+Weapon Reforged_JetCrashFireWeapon+ PrimaryDamage = 5.0+ PrimaryDamageRadius = 30.0+ AttackRange = 15.0+ MinimumAttackRange = 10.0+ DamageType = FLAME+ DeathType = BURNED+ WeaponSpeed = 600+ RadiusDamageAffects = ENEMIES NEUTRALS+ DelayBetweenShots = 250+End+; ---- EA's own, for a mod that dropped them ---------------------------------------------------------;; FixesReforged.ini replaces death modules on the GLA's Demolition and Toxin vehicles and traps withdiff --git a/GeneralsMD/Code/Data/Scenarios/cargocrash.txt b/GeneralsMD/Code/Data/Scenarios/cargocrash.txtnew file mode 100644index 000000000..965dfc967--- /dev/null+++ b/GeneralsMD/Code/Data/Scenarios/cargocrash.txt@@ -0,0 +1,50 @@+# A Supply Drop cargo plane shot down over its own side's base, for the rule that a crash spares the+# plane's player and allies (Reforged_BigJetCrashBlast and Reforged_JetCrashFireWeapon in+# WeaponReforged.ini). Seat 0 owns the plane, seat 1 the anti-air. jetcrash.txt's B-52 lane on+# Twilight Flame with an AmericaJetCargoPlane in it (same B52Locomotor, same 1000 health) and a row of+# power plants for each seat beside the strip.+#+# generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit+# -map "Maps\Twilight Flame\Twilight Flame.map" -autoskirmish 2 -takeover+# -side 0 FactionAmerica -side 1 FactionChina -seed 7 -maxframes 2000+# -scenario cargocrash -logPrefix cargocrash_+#+# Reading the log: the HEADLESS TALLY lines at 40 and 800. AmericaJetCargoPlane at 800 must read 0+# alive, or the plane got through and the deltas mean nothing. Seat 0's Hackers and power plants+# are the plane's own side and must keep every point of health; seat 1's lose some. Hackers carry+# no weapon and an Avenger's laser only shoots aircraft, so the crash is the only damage. The strip+# skips x 2350-2550, a cliff band on this line. Before the rule (seed 7) both seats lost 10 Hackers+# and seat 0's plants 136 health, seat 1's 160.++15 spawn 0 AmericaPowerPlant 1 2250 4020+15 spawn 0 AmericaPowerPlant 1 2700 4020+15 spawn 1 ChinaPowerPlant 1 2250 4180+15 spawn 1 ChinaPowerPlant 1 2700 4180++20 spawn 1 AmericaTankAvenger 8 2100 4100 40+20 spawn 0 ChinaInfantryHacker 4 2200 4080 20+20 spawn 1 ChinaInfantryHacker 4 2200 4120 20+20 spawn 0 ChinaInfantryHacker 4 2250 4080 20+20 spawn 1 ChinaInfantryHacker 4 2250 4120 20+20 spawn 0 ChinaInfantryHacker 4 2300 4080 20+20 spawn 1 ChinaInfantryHacker 4 2300 4120 20+20 spawn 0 ChinaInfantryHacker 4 2600 4080 20+20 spawn 1 ChinaInfantryHacker 4 2600 4120 20+20 spawn 0 ChinaInfantryHacker 4 2650 4080 20+20 spawn 1 ChinaInfantryHacker 4 2650 4120 20+20 spawn 0 ChinaInfantryHacker 4 2700 4080 20+20 spawn 1 ChinaInfantryHacker 4 2700 4120 20++30 spawn 0 AmericaJetCargoPlane 1 900 4100+31 move 0 AmericaJetCargoPlane 4400 4100++40 tally 0 ChinaInfantryHacker+40 tally 1 ChinaInfantryHacker+40 tally 0 AmericaPowerPlant+40 tally 1 ChinaPowerPlant++800 tally 0 AmericaJetCargoPlane+800 tally 0 ChinaInfantryHacker+800 tally 1 ChinaInfantryHacker+800 tally 0 AmericaPowerPlant+800 tally 1 ChinaPowerPlantdiff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex a1f50fe78..21d9368f8 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -770,6 +770,18 @@ TEST(weapon_reforged_ini_makes_the_paladin_infantry_laser_without_eas_weapons)CHECK_NEAR( laser->getUnmodifiedAttackRange(), 65.0f, 0.01f );CHECK_EQ( laser->getClipSize(), 2 );CHECK_STR( laser->getLaserName().str(), "PointDefenseLaserBeam" );++ /* a shot-down plane's crash spares its own player and allies, and still hits enemies */+ const char *crashWeapons[] = { "Reforged_JetCrashBlast", "Reforged_BigJetCrashBlast", "Reforged_JetCrashFireWeapon" };+ for( Int i = 0; i < 3; ++i )+ {+ const WeaponTemplate *crash = TheWeaponStore->findWeaponTemplate( crashWeapons[i] );+ CHECK( crash != NULL );+ if( crash == NULL )+ continue;+ CHECK( ( crash->getAffectsMask() & WEAPON_AFFECTS_ALLIES ) == 0 );+ CHECK( ( crash->getAffectsMask() & WEAPON_AFFECTS_ENEMIES ) != 0 );+ }}/* WeaponReforged.ini also keeps copies of EA weapons FixesReforged.ini hands out, under EA's names,