X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fpowerup.qh;h=41b658c2fc5a25afe03eefcaeea7867e07f1a6de;hp=df9315e2c838e72d7153fbcc9e81450c16d8bd91;hb=5fb2f3c4e123910e6291d6337fadd61f5199f5a5;hpb=7f042267d93f57719b68f0725af14d444f5c8932 diff --git a/qcsrc/common/items/item/powerup.qh b/qcsrc/common/items/item/powerup.qh index df9315e2c..41b658c2f 100644 --- a/qcsrc/common/items/item/powerup.qh +++ b/qcsrc/common/items/item/powerup.qh @@ -10,7 +10,7 @@ CLASS(Powerup, Pickup) #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, 20000); 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)); @@ -19,9 +19,17 @@ 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_time; +void powerup_strength_init(entity item) +{ + if(!item.strength_finished) + item.strength_finished = autocvar_g_balance_powerup_strength_time; +} +#endif REGISTER_ITEM(Strength, Powerup) { #ifdef GAMEQC this.m_model = MDL_Strength_ITEM; @@ -29,19 +37,31 @@ REGISTER_ITEM(Strength, Powerup) { this.m_glow = true; this.m_respawnsound = SND_STRENGTH_RESPAWN; #endif + this.netname = "strength"; this.m_name = "Strength Powerup"; this.m_icon = "strength"; this.m_color = '0 0 1'; this.m_waypoint = _("Strength"); this.m_waypointblink = 2; this.m_itemid = IT_STRENGTH; +#ifdef SVQC + this.m_iteminit = powerup_strength_init; +#endif } #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_time; +void powerup_shield_init(entity item) +{ + if(!item.invincible_finished) + item.invincible_finished = autocvar_g_balance_powerup_invincible_time; +} +#endif REGISTER_ITEM(Shield, Powerup) { #ifdef GAMEQC this.m_model = MDL_Shield_ITEM; @@ -49,10 +69,14 @@ REGISTER_ITEM(Shield, Powerup) { this.m_glow = true; this.m_respawnsound = SND_SHIELD_RESPAWN; #endif + 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; this.m_itemid = IT_INVINCIBLE; +#ifdef SVQC + this.m_iteminit = powerup_shield_init; +#endif }