Skip to content

Commit

Permalink
Disallow knight attacking frozen enemies, more consistent with other …
Browse files Browse the repository at this point in the history
…weapons
  • Loading branch information
KnightMiner committed Aug 24, 2022
1 parent 4af3ac7 commit ae6a8f0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/skills/knight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ local function getHealthEquivelent(pawn, useMax)
elseif pawn:IsArmor() then
health = health + 1
end
-- ice boosts damage by 1
if pawn:IsFrozen() then
health = health + 1
end

return health
end
Expand Down Expand Up @@ -122,17 +118,21 @@ local function pointValid(point, isAttack, maxDamage)
return true
end

-- no attacking pawns with a corpse (false for mechs oddly, so check that too)
if pawnAtPoint:IsMech() or _G[pawnAtPoint:GetType()]:GetCorpse() then
-- no attacking pawns with a corpse
if pawnAtPoint:IsCorpse() then
previewer:AddDesc(point, "knight_corpse")
return false
end

-- no attacking shielded enemies, that takes 2 hits
-- no attacking shielded or frozen enemies, that takes 2 hits
if pawnAtPoint:IsShield() then
previewer:AddDesc(point, "knight_shielded")
return false
end
if pawnAtPoint:IsFrozen() then
previewer:AddDesc(point, "knight_frozen")
return false
end

-- cap based on knight's and enemies health
if (maxDamage < getHealthEquivelent(pawnAtPoint, false)) then
Expand Down

0 comments on commit ae6a8f0

Please # to comment.