X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Finstagib%2Fitems.qh;h=3f8d087166353715a224acd0d7bbf4383cdb2154;hp=ac2761bd5e980909aefca5d62d399277bbbcdd6e;hb=4096ab0591cbd7fac803e022375cd3c221511d8b;hpb=5e3bdd5ef1f51dc082a3af2c1277ba82f81654a5 diff --git a/qcsrc/common/mutators/mutator/instagib/items.qh b/qcsrc/common/mutators/mutator/instagib/items.qh index ac2761bd5..3f8d08716 100644 --- a/qcsrc/common/mutators/mutator/instagib/items.qh +++ b/qcsrc/common/mutators/mutator/instagib/items.qh @@ -16,16 +16,16 @@ SOUND(VaporizerCells, Item_Sound("itempickup")); #ifdef SVQC int autocvar_g_instagib_ammo_drop; -void ammo_vaporizercells_init(entity item) +void ammo_vaporizercells_init(Pickup this, entity item) { - if(!item.ammo_cells) - item.ammo_cells = autocvar_g_instagib_ammo_drop; + if(!GetResourceAmount(item, RESOURCE_CELLS)) + SetResourceAmountExplicit(item, RESOURCE_CELLS, autocvar_g_instagib_ammo_drop); } #endif REGISTER_ITEM(VaporizerCells, Ammo) { this.m_canonical_spawnfunc = "item_vaporizer_cells"; - this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; #ifdef GAMEQC + this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; this.m_model = MDL_VaporizerCells_ITEM; this.m_sound = SND_VaporizerCells; #endif @@ -52,7 +52,7 @@ SOUND(ExtraLife, Item_Sound("megahealth")); REGISTER_ITEM(ExtraLife, Powerup) { this.m_canonical_spawnfunc = "item_extralife"; #ifdef GAMEQC - this.m_model = MDL_ExtraLife_ITEM; + this.m_model = MDL_ExtraLife_ITEM; this.m_sound = SND_ExtraLife; #endif this.netname = "extralife"; @@ -64,16 +64,28 @@ REGISTER_ITEM(ExtraLife, Powerup) { this.m_itemid = IT_NAILS; } +SPAWNFUNC_ITEM(item_extralife, ITEM_ExtraLife) + #ifdef GAMEQC MODEL(Invisibility_ITEM, Item_Model("g_strength.md3")); SOUND(Invisibility, Item_Sound("powerup")); #endif +#ifdef SVQC +/// \brief Initializes the invisibility powerup. +/// \param[in,out] item Item to initialize. +/// \return No return. +void powerup_invisibility_init(Pickup this, entity item); +#endif + REGISTER_ITEM(Invisibility, Powerup) { this.m_canonical_spawnfunc = "item_invisibility"; #ifdef GAMEQC + this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; this.m_model = MDL_Invisibility_ITEM; this.m_sound = SND_Invisibility; + this.m_glow = true; + this.m_respawnsound = SND_STRENGTH_RESPAWN; #endif this.netname = "invisibility"; this.m_name = "Invisibility"; @@ -82,18 +94,33 @@ REGISTER_ITEM(Invisibility, Powerup) { this.m_waypoint = _("Invisibility"); this.m_waypointblink = 2; this.m_itemid = IT_STRENGTH; +#ifdef SVQC + this.m_iteminit = powerup_invisibility_init; +#endif } +SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility) + #ifdef GAMEQC MODEL(Speed_ITEM, Item_Model("g_invincible.md3")); SOUND(Speed, Item_Sound("powerup_shield")); #endif +#ifdef SVQC +/// \brief Initializes the speed powerup. +/// \param[in,out] item Item to initialize. +/// \return No return. +void powerup_speed_init(Pickup this, entity item); +#endif + REGISTER_ITEM(Speed, Powerup) { this.m_canonical_spawnfunc = "item_speed"; #ifdef GAMEQC + this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; this.m_model = MDL_Speed_ITEM; this.m_sound = SND_Speed; + this.m_glow = true; + this.m_respawnsound = SND_SHIELD_RESPAWN; #endif this.netname = "speed"; this.m_name = "Speed"; @@ -102,4 +129,9 @@ REGISTER_ITEM(Speed, Powerup) { this.m_waypoint = _("Speed"); this.m_waypointblink = 2; this.m_itemid = IT_INVINCIBLE; +#ifdef SVQC + this.m_iteminit = powerup_speed_init; +#endif } + +SPAWNFUNC_ITEM(item_speed, ITEM_Speed)