set g_instagib_ammo_convert_cells 0 "convert normal cell ammo packs to insta cell ammo packs"
set g_instagib_ammo_convert_rockets 0 "convert rocket ammo packs to insta cell ammo packs"
set g_instagib_ammo_convert_shells 0 "convert shell ammo packs to insta cell ammo packs"
+set g_instagib_invisibility_time 30 "Time of ivisibility powerup in seconds."
set g_instagib_invis_alpha 0.15
+set g_instagib_speed_time 30 "Time of speed powerup in seconds."
set g_instagib_speed_highspeed 1.5 "speed-multiplier that applies while you carry the invincibility powerup"
set g_instagib_damagedbycontents 1 "allow damage from lava pits in instagib"
set g_instagib_blaster_keepdamage 0 "allow secondary fire to hurt players"
// generated file; do not modify
#include <common/mutators/mutator/instagib/items.qc>
+#ifdef SVQC
+ #include <common/mutators/mutator/instagib/sv_items.qc>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/instagib/sv_instagib.qc>
#endif
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(entity item);
+#endif
+
REGISTER_ITEM(Invisibility, Powerup) {
this.m_canonical_spawnfunc = "item_invisibility";
#ifdef GAMEQC
this.m_waypoint = _("Invisibility");
this.m_waypointblink = 2;
this.m_itemid = IT_STRENGTH;
+#ifdef SVQC
+ this.m_iteminit = powerup_invisibility_init;
+#endif
}
#ifdef GAMEQC
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(entity item);
+#endif
+
REGISTER_ITEM(Speed, Powerup) {
this.m_canonical_spawnfunc = "item_speed";
#ifdef GAMEQC
this.m_waypoint = _("Speed");
this.m_waypointblink = 2;
this.m_itemid = IT_INVINCIBLE;
+#ifdef SVQC
+ this.m_iteminit = powerup_speed_init;
+#endif
}
--- /dev/null
+#include "items.qh"
+
+/// \brief Time of ivisibility powerup in seconds.
+float autocvar_g_instagib_invisibility_time;
+/// \brief Time of speed powerup in seconds.
+float autocvar_g_instagib_speed_time;
+
+void powerup_invisibility_init(entity item)
+{
+ if(!item.strength_finished)
+ {
+ item.strength_finished = autocvar_g_instagib_invisibility_time;
+ }
+}
+
+
+void powerup_speed_init(entity item)
+{
+ if(!item.invincible_finished)
+ {
+ item.invincible_finished = autocvar_g_instagib_speed_time;
+ }
+}
// Expiring loot will have strength "ticking" will it's dropped.
// Not expiring will not tick.
// OTOH, do we really need expiring loot?
- if (this.classname == "droppedweapon")
- {
- this.strength_finished = max(0, this.strength_finished - time);
- this.invincible_finished = max(0, this.invincible_finished - time);
- this.superweapons_finished = max(0, this.superweapons_finished - time);
- }
+ //if (this.classname == "droppedweapon")
+ //{
+ // this.strength_finished = max(0, this.strength_finished - time);
+ // this.invincible_finished = max(0, this.invincible_finished - time);
+ // this.superweapons_finished = max(0, this.superweapons_finished - time);
+ //}
bool gave = ITEM_HANDLE(Pickup, this.itemdef, this, toucher);
if (!gave)
{
- if (Item_IsLoot(this))
- {
- // undo what we did above
- this.strength_finished += time;
- this.invincible_finished += time;
- this.superweapons_finished += time;
- }
+ //if (this.classname == "droppedweapon")
+ //{
+ // // undo what we did above
+ // this.strength_finished += time;
+ // this.invincible_finished += time;
+ // this.superweapons_finished += time;
+ //}
return;
}
#include "gamemode_lms.qh"
-#include <common/mutators/mutator/instagib/items.qc>
+#include <common/mutators/mutator/instagib/items.qh>
#include <server/campaign.qh>
#include <server/command/_mod.qh>