EMP (and Leech) Bombers
Posted: Mon Mar 23, 2020 3:26 am
sorry no time to make it work from Mods folder, this will add two new bomber types, one for delivering EMP Missiles, one for Leech Missiles ... if requested technology is not known, they will be equipped with best known missile tech
add this to WEAPONS.lua, I made them as fast and durable as Strike Fighters, and a bit cheaper (change as you please)
then change function _G.get_fighter_weapon(craft_type,empire,target) from tech.lua to this
now change tech 'Multirole Fighters' to unlock your new bombers (file ~TECHNOLOGY.lua)
add this to WEAPONS.lua, I made them as fast and durable as Strike Fighters, and a bit cheaper (change as you please)
Code: Select all
define_weapon "EMP Bomber" {
tier=2,
motion_sound = 'FIGHTER_ENGINE_LOOP',
launch_sound = 'FIGHTER_LAUNCHED_SINGLE',
multi_launch_sound = 'FIGHTER_LAUNCHED_MULTI',
type= "fighter",
loadout = {type = 'emp_bombs', n=1},
cant_attack_trackers=true,
cost_mult=3,
health = 30,
speed=12,
desc = "Small craft designed to deliver EMP warheads at point blank range.",
fighter_drawers = {
default = 'BladeBomber',
Hawk='HawkBomber',
Hammer='HammerBomber',
Blade='BladeBomber',
Manta='MantaBomber',
Star='StarBomber',
Box='BoxBomber',
Hat='HawkBomber',
}
}
define_weapon "Leech Bomber" {
tier=2,
motion_sound = 'FIGHTER_ENGINE_LOOP',
launch_sound = 'FIGHTER_LAUNCHED_SINGLE',
multi_launch_sound = 'FIGHTER_LAUNCHED_MULTI',
type= "fighter",
loadout = {type = 'leech_bombs', n=1},
cant_attack_trackers=true,
cost_mult=3,
health = 30,
speed=12,
desc = "Small craft designed to deliver Leech warheads at point blank range.",
fighter_drawers = {
default = 'BladeBomber',
Hawk='HawkBomber',
Hammer='HammerBomber',
Blade='BladeBomber',
Manta='MantaBomber',
Star='StarBomber',
Box='BoxBomber',
Hat='HawkBomber',
}
}
Code: Select all
function _G.get_fighter_weapon(craft_type,empire,target)
local _TRACE_INFO = craft_type
local type in empire.part_info![craft_type]!.loadout!
local alt_type
if (type == 'energy_or_bombs')
if target
if is_tracking_object(target)
type='energy'
else
type='strike'
end
else
type='bombs'
alt_type='energy'
end
end
if (type == 'emp_bombs')
if (empire:known 'EMP Warhead')
return 'EMP Missiles'
else
type='bombs'
end
end
if (type == 'leech_bombs')
if (empire:known 'Leech Warheads')
return 'Leech Missiles'
else
type='bombs'
end
end
local best_weapon = fighter_weapon_fun![type](empire:available_part_info()!)
if alt_type
return best_weapon,fighter_weapon_fun![alt_type](empire:available_part_info()!)
end
return best_weapon
end
Code: Select all
--unlocks_parts='Strike Fighter',
unlocks_parts={'Strike Fighter','EMP Bomber','Leech Bomber'},