Random items mutator and item system revamp
This mutator randomly replaces items on the map and adds random loot from killing players. Detailed description is here.
Unfortunately, the code didn't have proper support for spawning items so TimePath and I had to refactor a lot.
New stuff
-
m_canonical_spawnfunc
- weird name. Specifies the classname which will be forced for that item. So all items now obey it. -
m_spawnfunc_hookreplace
- Function that is used to replace item definitions. -
SPAWNFUNC_ITEM
- new way to define spawnfunc for items. CallsStartItem
with specified item definition. -
SPAWNFUNC_WEAPON
- new way to define spawnfunc for weapons. Callsweapon_defaultspawnfunc
with specified item definition. -
ITEM_FLAG_*
enum. -
ITEM_FLAG_NORMAL
- indicates that item is usable during normal gameplay. Some items, such as new toys, have this flag too. -
ITEM_FLAG_INSTAGIB
- indicates that item is usable during instagib. -
ITEM_FLAG_OVERKILL
- indicates that item is usable during overkill. -
ITEM_FLAG_MUTATORBLOCKED
- if set, items with this flag will not be spawned. -
Item_Create
- spawns a new map item. -
Item_Initialize
- initializes already spawned entity as item. -
Item_CreateLoot
- creates loot. -
Item_InitializeLoot
- initializes already spawned entity as loot. -
Item_IsLoot
- checks if item is loot. Replaces olddroppedweapon
check. -
Item_SetLoot
- sets the item loot status. -
Item_IsExpiring
- checks if item is expiring, i.e. it's superweapon, strength and shield time ticking while it is on the ground. -
Item_SetExpiring
- sets item expiring status. -
ItemTouched
hook - called after item has been touched. -
m_isreplaced
- holds whether weapon has been replaced. Replaces oldreplacedweapon
check.
Item renaming
- Devastator now has
weapon_devastator
classname. - HLAC now has
weapon_hlac
classname. - Mine Layer now has
weapon_minelayer
classname. - Mortar now has
weapon_mortar
classname. - Rifle now has
weapon_rifle
classname. - TAG Seeker now has
weapon_seeker
classname. - Vortex now has
weapon_vortex
classname. - Shield now has
item_shield
classname. -
droppedweapon
classname was completely removed. -
replacedweapon
classname was completely removed.
Instagib
-
g_instagib_invisibility_time
- time in seconds of the invisibility powerup. -
g_instagib_speed_time
- time in seconds of the speed powerup. - Vaporizer cells now have
item_vaporizer_cells
classname. - Extra life now has
item_extralife
classname. - Invisibility now has
item_invisibility
classname. - Speed now has
item_speed
classname. - Invisibility and Speed now glow and have correct sounds as their vanilla counterparts.
Overkill
- Overkill now uses
ITEM_FLAG_MUTATORBLOCKED
to disable items. - Loot from dead players uses new loot API.
Edited by Ghost User