set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
// }}}
// {{{ jetpack/hook
set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
// }}}
// {{{ jetpack/hook
set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
// }}}
// {{{ jetpack/hook
set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
// }}}
// {{{ jetpack/hook
float WEP_LAST;
#define WEP_MAXCOUNT 24
float WEPBIT_ALL;
+float WEPBIT_SUPERWEAPONS;
#define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
float id; \
float bit; \
{ \
WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \
WEPBIT_ALL |= (bit = power2of(WEP_COUNT)); \
+ if(ammotype & IT_SUPERWEAPON) \
+ WEPBIT_SUPERWEAPONS |= (bit = power2of(WEP_COUNT)); \
++WEP_COUNT; \
register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
} \
float autocvar_g_balance_powerup_strength_selfdamage;
float autocvar_g_balance_powerup_strength_selfforce;
float autocvar_g_balance_powerup_strength_time;
+float autocvar_g_balance_superweapons_time;
float autocvar_g_balance_rocketlauncher_ammo;
float autocvar_g_balance_rocketlauncher_animtime;
float autocvar_g_balance_rocketlauncher_damage;
self.pain_finished = 0;
self.strength_finished = 0;
self.invincible_finished = 0;
+ self.superweapons_finished = 0;
self.pushltime = 0;
self.think = SUB_Null;
self.nextthink = 0;
self.weapons = start_weapons;
}
+ if(self.weapons & WEPBIT_SUPERWEAPONS)
+ self.superweapons_finished = time + autocvar_g_balance_superweapons_time;
+ else
+ self.superweapons_finished = 0;
+
if(g_weaponarena_random)
{
if(g_weaponarena_random_with_laser)
sprint(self, "^3Shield surrounds you\n");
}
}
+ if (self.items & IT_SUPERWEAPON)
+ {
+ play_countdown(self.superweapons_finished, "misc/poweroff.wav");
+ self.effects = self.effects | EF_RED;
+ if (self.items & IT_UNLIMITED_SUPERWEAPONS)
+ {
+ // don't let them run out
+ }
+ else if (time > self.superweapons_finished)
+ {
+ self.items = self.items - (self.items & IT_SUPERWEAPON);
+ self.weapons &~= WEPBIT_SUPERWEAPONS;
+ sprint(self, "^3Superweapons have broken down\n");
+ }
+ }
+ else
+ {
+ if (time < self.superweapons_finished)
+ {
+ self.items = self.items | IT_SUPERWEAPON;
+ sprint(self, "^3You now have a superweapon\n");
+ }
+ else
+ self.weapons &~= WEPBIT_SUPERWEAPONS; // just in case
+ }
}
if(autocvar_g_nodepthtestplayers)
float W_AmmoItemCode(float wpn)
{
- return (get_weaponinfo(wpn)).items;
+ float f = (get_weaponinfo(wpn)).items;
+ f &~= IT_SUPERWEAPON;
+ return f;
}
void thrown_wep_think()
wep.colormap = own.colormap;
wa = W_AmmoItemCode(wpn);
- if(wa == IT_SUPERWEAPON || wa == 0)
+ if(wa == 0)
{
oldself = self;
self = wep;
wb = W_WeaponBit(w);
if(!wb)
return 0;
+ if(wb & WEPBIT_SUPERWEAPONS) // can't throw a superweapon, they don't work
+ return 0;
wa = W_AmmoItemCode(w);
if(start_weapons & wb)
{
- if(wa == IT_SUPERWEAPON && start_items & IT_UNLIMITED_SUPERWEAPONS)
- return 0;
- if(wa != IT_SUPERWEAPON && start_items & IT_UNLIMITED_WEAPON_AMMO)
- return 0;
// start weapons that take no ammo can't be dropped (this prevents dropping the laser, as long as it continues to use no ammo)
+ if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+ return 0;
if(wa == 0)
return 0;
}
.float crouch; // Crouching or not?
.float strength_finished;
-//.float speed_finished;
.float invincible_finished;
-//.float slowmo_finished;
+.float superweapons_finished;
.vector finaldest, finalangle; //plat.qc stuff
.void() think1;
void Item_ScheduleRespawnIn(entity e, float t)
{
- if((e.flags & FL_POWERUP) || (e.items & IT_SUPERWEAPON))
+ if((e.flags & FL_POWERUP) || (e.weapons & WEPBIT_SUPERWEAPONS))
{
e.think = Item_RespawnCountdown;
e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
if (item.strength_finished)
{
pickedup = TRUE;
- player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
+ player.strength_finished = max(player.strength_finished, time) + item.strength_finished;
}
if (item.invincible_finished)
{
pickedup = TRUE;
- player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
+ player.invincible_finished = max(player.invincible_finished, time) + item.invincible_finished;
+ }
+ if (item.superweapons_finished)
+ {
+ pickedup = TRUE;
+ player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished;
}
}
// replace with invis
if (itemid == IT_STRENGTH)
{
- self.strength_finished = 30;
+ if(!self.strength_finished)
+ self.strength_finished = autocvar_g_balance_powerup_strength_time;
StartItem ("models/items/g_strength.md3",
"misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
"Invisibility", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_MID);
// replace with speed
if (itemid == IT_INVINCIBLE)
{
- self.invincible_finished = 30;
+ if(!self.invincible_finished)
+ self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
StartItem ("models/items/g_invincible.md3",
"misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
"Speed", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_MID);
e = get_weaponinfo(wpn);
- if(e.items & IT_SUPERWEAPON)
- self.items |= IT_SUPERWEAPON;
-
if(!self.respawntime)
{
- if(self.items & IT_SUPERWEAPON)
+ if(self.weapons & WEPBIT_SUPERWEAPONS)
{
self.respawntime = g_pickup_respawntime_superweapon;
self.respawntimejitter = g_pickup_respawntimejitter_superweapon;
}
}
+ if(self.weapons & WEPBIT_SUPERWEAPONS)
+ if(!self.superweapons_finished)
+ self.superweapons_finished = autocvar_g_balance_superweapons_time;
+
if(e.items)
{
for(i = 0, j = 1; i < 24; ++i, j *= 2)
}
// no weapon-stay on superweapons
- if(self.items & IT_SUPERWEAPON)
+ if(self.weapons & WEPBIT_SUPERWEAPONS)
self.flags |= FL_NO_WEAPON_STAY;
// weapon stay isn't supported for teamed weapons
minstagib_items(IT_STRENGTH);
} else {
precache_sound("weapons/strength_fire.wav");
- self.strength_finished = 30;
+ if(!self.strength_finished)
+ self.strength_finished = autocvar_g_balance_powerup_strength_time;
StartItem ("models/items/g_strength.md3", "misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Strength Powerup", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
}
}
if(g_minstagib) {
minstagib_items(IT_INVINCIBLE);
} else {
- self.invincible_finished = 30;
+ if(!self.invincible_finished)
+ self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Shield", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
}
}