Skip to content

Commit

Permalink
Evocom dgun hotfix (#3713)
Browse files Browse the repository at this point in the history
* fix bitmasks now that I know how they actually work

* fix corcom being immortal to dgun attacks
  • Loading branch information
SethDGamre authored Sep 13, 2024
1 parent 11efb9a commit 233de7f
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 13 deletions.
15 changes: 11 additions & 4 deletions luarules/gadgets/unit_dgun_behaviour.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,17 @@ function gadget:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shie

local gameframe = spGetGameFrame()

if not modOptions.shieldsrework and hitX > 0 and lastShieldFrameCheck[shieldCarrierUnitID] ~= gameframe then
shieldPower = math.max(shieldPower - damage, 0)
spSetUnitShieldState(shieldCarrierUnitID, shieldEmitterWeaponNum, shieldEnabledState, shieldPower)
lastShieldFrameCheck[shieldCarrierUnitID] = gameframe
if not modOptions.shieldsrework then
local damageCooldownFrames = 10
if shieldPower < damage then return false end

lastShieldFrameCheck[shieldCarrierUnitID] = lastShieldFrameCheck[shieldCarrierUnitID] or gameframe

if hitX > 0 and lastShieldFrameCheck[shieldCarrierUnitID] <= gameframe then
shieldPower = math.max(shieldPower - damage, 0)
spSetUnitShieldState(shieldCarrierUnitID, shieldEmitterWeaponNum, shieldEnabledState, shieldPower)
lastShieldFrameCheck[shieldCarrierUnitID] = gameframe + damageCooldownFrames
end
end

-- Engine does not provide a way for shields to stop DGun projectiles, they will impact once and carry on through,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl10.lua
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 30000,
powerregen = 500,
powerregenenergy = 100,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 1000,
powerregen = 33,
powerregenenergy = 6.6,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 3300,
powerregen = 75,
powerregenenergy = 15,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 5500,
powerregen = 125,
powerregenenergy = 25,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 7000,
powerregen = 200,
powerregenenergy = 40,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl6.lua
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 10000,
powerregen = 250,
powerregenenergy = 50,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl7.lua
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 13000,
powerregen = 308,
powerregenenergy = 61,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl8.lua
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 17000,
powerregen = 366,
powerregenenergy = 72,
Expand Down
2 changes: 1 addition & 1 deletion units/other/evocom/corcomlvl9.lua
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ return {
alpha = 0.17,
armortype = "shields",
force = 2.5,
intercepttype = 11111,
intercepttype = 8191,
power = 23000,
powerregen = 424,
powerregenenergy = 84,
Expand Down

0 comments on commit 233de7f

Please sign in to comment.