Zero-K
Zero-K copied to clipboard
Turn hardcoded gadget defs into presets
Some things don't fit in a unit def customparam and have to be defined in a dedicated config file, e.g. the definition of dirtbag mound:
https://github.com/ZeroK-RTS/Zero-K/blob/0b2bfbbcbd77c1feee67dc93656e3c39d07f500a/LuaRules/Configs/unit_terraform_defs.lua#L2-L8
But it's defined per-unitdef, so if a modder copies Dirtbag then it won't have the feature. Similar things happen with drones and perhaps others (part of the task is to find the others).
Change this so it's a named preset, e.g. small_mound = { ... } in the config and then Dirtbag gets death_terraform = "small_mound" customparam. Then a ModdedDirtbag (or generally any unit) can also get the customparam to get the behaviour.