@@ -28,6 +28,19 @@ include "constants.lua"
2828local manualTarget_p1 = false
2929local manualTarget_p2 = false
3030local manualTarget_p3 = false
31+ local rangeChanged = false
32+ local THERMITE_BOMB_ID
33+ local FAKE_WEAPON_ID
34+ for i = 1 , # UnitDefs [unitDefID ].weapons do
35+ local weaponName = WeaponDefs [UnitDefs [unitDefID ].weapons [i ].weaponDef ].name
36+ if weaponName == " bomberassault_thermite_bomb" then
37+ THERMITE_BOMB_ID = i
38+ end
39+ if weaponName == " bomberassault_zeppelin_bomb" then
40+ FAKE_WEAPON_ID = i
41+ end
42+ end
43+ local THERMITE_BOMB_RANGE = Spring .GetUnitWeaponState (unitID , FAKE_WEAPON_ID , " range" )
3144
3245function ReammoComplete ()
3346 Show (bomb )
@@ -129,10 +142,23 @@ function script.FireWeapon(num)
129142end
130143
131144function script .BlockShot (num , targetID )
132- if num == 1 or (num == manualfireWeapon and not IsManualFireTargetValid ()) then
145+ if num == 1 or
146+ (num == manualfireWeapon and not IsManualFireTargetValid ()) or
147+ (GetUnitValue (COB .CRASHING ) == 1 ) or RearmBlockShot () then
133148 return true
134149 end
135- return (GetUnitValue (COB .CRASHING ) == 1 ) or RearmBlockShot ()
150+ if num == THERMITE_BOMB_ID then
151+ rangeChanged = true
152+ Spring .SetUnitWeaponState (unitID , THERMITE_BOMB_ID , " range" , 9001 ) -- large so noExplode doesn't remove projectile due to vertical drop distance
153+ end
154+ return false
155+ end
156+
157+ function script .EndBurst ()
158+ if rangeChanged then
159+ rangeChanged = false
160+ Spring .SetUnitWeaponState (unitID , THERMITE_BOMB_ID , " range" , THERMITE_BOMB_RANGE )
161+ end
136162end
137163
138164function script .Killed (recentDamage , maxHealth )
0 commit comments