# how to add "daemon_killer = true" to EMP

## Recommended Posts

Quote

\invisible inc moded\scripts\sim\abilities\prime_emp

is this place right to add ?

daemon_killer = true,

##### Share on other sites

i tired this but not working

via @invisible inc moded\sim\unitdefs

	item_emp_pack = util.extend(commondefs.item_template)
{
type = "simemppack",
name = STRINGS.ITEMS.EMP_1,
desc = STRINGS.ITEMS.EMP_1_TOOLTIP,
flavor = STRINGS.ITEMS.EMP_1_FLAVOR,
icon = "itemrigs/FloorProp_emp.png",
--profile_icon = "gui/items/icon-emp.png",
profile_icon = "gui/icons/item_icons/items_icon_small/icon-item_emp_small.png",
profile_icon_100 = "gui/icons/item_icons/icon-item_emp.png",
abilities = { "carryable","recharge","prime_emp", },
requirements = { hacking = 2 },
traits = { cooldown = 0, cooldownMax = 8, range = 3, emp_duration = 2,daemon_killer = true , },
value = 500,
floorWeight = 1,
notSoldAfter = 48,
},

##### Share on other sites
Posted (edited)

Actually, if you want to make an EMP that kills daemons, you'll need to change or copy/paste/edit the actual detonation "function simunit:processEMP" found in sim\simunit.lua

There's a cascade of abilities for EMP such that the agent uses the item, item spawns a unit, unit triggers itself "TRG_END_TURN" and finds targets, and targets are then dealt the function "processEMP".  It's one of the more complicated items in the game.  I recommend creating new abilities and functions for the whole set to minimize conflicts.

As for the actual killing of Daemons, the lines from Hunter are what you need.  I used them to create a Buster Chip style daemon-killer.

Edited by SteelCrow