I know we reference MoO and its sequels quite a lot, hope it doesn't bother devs too much, MoO II had planetary shields that had increased shield_damage_negation compared to ship shields
this change can accomplish that (I top shield_damage_negation at 10 for Aegis (MoO II Class X Shields), Planetary Barrier Shields were negating 20 damage), so SiS planetary Aegis is 20 damage negation
Code: Select all
-- *** Shield damage negation ***
function ShipProperty.shield_damage_negation(ship)
local max_negation = 0
for s in systems(ship)
if (s.health > s.damage) and s.shield_damage_negation
max_negation=max(max_negation, s.shield_damage_negation)
end
end
if ship.is_planet then max_negation=max_negation*2 end
return max_negation
end
Code: Select all
function deal_damage(weapon, damage, ship, shield)
damage = damage - ship.shield_damage_negation
this will apply 30% reduction of weapon damage to planetary defenses for any weapon (I want to reduce damage after damage negation, just to make sure damage reduction is not too much)
Code: Select all
function deal_damage(weapon, damage, ship, shield)
damage = damage - ship.shield_damage_negation
if ship.is_planet then damage=damage*.7 end
Code: Select all
if ship.is_planet and weapon.is_direct then damage=damage*.7 end