#ifdef SVQC
// For FL_POWERUP
- #include <server/constants.qh>
+ #include <common/constants.qh>
#endif
#include "pickup.qh"
#ifdef SVQC
ATTRIB(Powerup, m_mins, vector, '-16 -16 0');
ATTRIB(Powerup, m_maxs, vector, '16 16 80');
- ATTRIB(Powerup, m_botvalue, int, 100000);
+ ATTRIB(Powerup, m_botvalue, int, 11000);
ATTRIB(Powerup, m_itemflags, int, FL_POWERUP);
ATTRIB(Powerup, m_respawntime, float(), GET(g_pickup_respawntime_powerup));
ATTRIB(Powerup, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_powerup));
+ ATTRIB(Powerup, count, float);
#endif
ENDCLASS(Powerup)
#ifdef GAMEQC
MODEL(Strength_ITEM, Item_Model("g_strength.md3"));
-SOUND(Strength, "misc/powerup");
+SOUND(Strength, Item_Sound("powerup"));
#endif
+#ifdef SVQC
+float autocvar_g_balance_powerup_strength_damage;
+float autocvar_g_balance_powerup_strength_force;
+float autocvar_g_balance_powerup_strength_selfdamage;
+float autocvar_g_balance_powerup_strength_selfforce;
+float autocvar_g_balance_powerup_strength_time;
+void powerup_strength_init(Pickup this, entity item)
+{
+ if(!item.strength_finished)
+ item.strength_finished = (item.count) ? item.count : autocvar_g_balance_powerup_strength_time;
+}
+#endif
REGISTER_ITEM(Strength, Powerup) {
+ this.m_canonical_spawnfunc = "item_strength";
#ifdef GAMEQC
+ this.spawnflags = ITEM_FLAG_NORMAL;
this.m_model = MDL_Strength_ITEM;
this.m_sound = SND_Strength;
this.m_glow = true;
this.m_respawnsound = SND_STRENGTH_RESPAWN;
#endif
- this.m_name = "Strength Powerup";
+ this.netname = "strength";
+ this.m_name = _("Strength");
this.m_icon = "strength";
this.m_color = '0 0 1';
this.m_waypoint = _("Strength");
this.m_waypointblink = 2;
+#ifdef GAMEQC
this.m_itemid = IT_STRENGTH;
+#endif
+#ifdef SVQC
+ this.m_iteminit = powerup_strength_init;
+#endif
}
+SPAWNFUNC_ITEM(item_strength, ITEM_Strength)
+
#ifdef GAMEQC
MODEL(Shield_ITEM, Item_Model("g_invincible.md3"));
-SOUND(Shield, "misc/powerup_shield");
+SOUND(Shield, Item_Sound("powerup_shield"));
#endif
+#ifdef SVQC
+float autocvar_g_balance_powerup_invincible_takedamage;
+float autocvar_g_balance_powerup_invincible_takeforce = 0.33;
+float autocvar_g_balance_powerup_invincible_time;
+void powerup_shield_init(Pickup this, entity item)
+{
+ if(!item.invincible_finished)
+ item.invincible_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invincible_time;
+}
+#endif
REGISTER_ITEM(Shield, Powerup) {
+ this.m_canonical_spawnfunc = "item_shield";
#ifdef GAMEQC
+ this.spawnflags = ITEM_FLAG_NORMAL;
this.m_model = MDL_Shield_ITEM;
this.m_sound = SND_Shield;
this.m_glow = true;
this.m_respawnsound = SND_SHIELD_RESPAWN;
#endif
- this.m_name = "Shield";
+ this.netname = "invincible";
+ this.m_name = _("Shield");
this.m_icon = "shield";
this.m_color = '1 0 1';
this.m_waypoint = _("Shield");
this.m_waypointblink = 2;
+#ifdef GAMEQC
this.m_itemid = IT_INVINCIBLE;
+#endif
+#ifdef SVQC
+ this.m_iteminit = powerup_shield_init;
+#endif
}
+
+SPAWNFUNC_ITEM(item_shield, ITEM_Shield)
+SPAWNFUNC_ITEM(item_invincible, ITEM_Shield)