#endif
#ifdef SVQC
.entity arc_beam;
-.bool arc_BUTTON_ATCK_prev[MAX_WEAPONSLOTS]; // for better animation control
+.bool arc_BUTTON_ATCK_prev; // for better animation control
.float beam_prev;
.float beam_initialized;
.float beam_bursting;
Arc_Smoke(actor, weaponentity);
bool beam_fire2 = ((fire & 2) && !WEP_CVAR(arc, bolt));
- int slot = weaponslot(weaponentity);
if (time >= actor.arc_overheat)
if ((fire & 1) || beam_fire2 || actor.(weaponentity).arc_beam.beam_bursting)
{
- if(actor.arc_BUTTON_ATCK_prev[slot])
+ if(actor.(weaponentity).arc_BUTTON_ATCK_prev)
{
#if 0
if(actor.animstate_startframe == actor.anim_shoot.x && actor.animstate_numframes == actor.anim_shoot.y)
{
W_Arc_Beam(boolean(beam_fire2), actor, weaponentity);
- if(!actor.arc_BUTTON_ATCK_prev[slot])
+ if(!actor.(weaponentity).arc_BUTTON_ATCK_prev)
{
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, beam_animtime), w_ready);
- actor.arc_BUTTON_ATCK_prev[slot] = true;
+ actor.(weaponentity).arc_BUTTON_ATCK_prev = true;
}
}
}
}
}
- if(actor.arc_BUTTON_ATCK_prev[slot])
+ if(actor.(weaponentity).arc_BUTTON_ATCK_prev)
{
+ int slot = weaponslot(weaponentity);
sound(actor, CH_WEAPON_A, SND_ARC_STOP, VOL_BASE, ATTN_NORM);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(arc, beam_animtime), w_ready);
ATTACK_FINISHED(actor, slot) = time + WEP_CVAR(arc, beam_refire) * W_WeaponRateFactor(actor);
}
- actor.arc_BUTTON_ATCK_prev[slot] = false;
+ actor.(weaponentity).arc_BUTTON_ATCK_prev = false;
#if 0
if(fire & 2)
weapon_dropevent_item.arc_cooldown = actor.arc_cooldown;
actor.arc_overheat = 0;
actor.arc_cooldown = 0;
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
- actor.arc_BUTTON_ATCK_prev[slot] = false;
+ actor.(weaponentity).arc_BUTTON_ATCK_prev = false;
}
METHOD(Arc, wr_pickup, void(entity thiswep, entity actor, .entity weaponentity))
{
actor.arc_overheat = 0;
actor.arc_cooldown = 0;
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
- actor.arc_BUTTON_ATCK_prev[slot] = false;
+ {
+ .entity weaponentity = weaponentities[slot];
+ actor.(weaponentity).arc_BUTTON_ATCK_prev = false;
+ }
}
METHOD(Arc, wr_playerdeath, void(entity thiswep, entity actor, .entity weaponentity))
{
actor.arc_overheat = 0;
actor.arc_cooldown = 0;
- int slot = weaponslot(weaponentity);
- actor.arc_BUTTON_ATCK_prev[slot] = false;
+ actor.(weaponentity).arc_BUTTON_ATCK_prev = false;
}
#endif
#ifdef CSQC
REGISTER_WEAPON(DEVASTATOR, devastator, NEW(Devastator));
#ifdef SVQC
-.float rl_release[MAX_WEAPONSLOTS];
+.float rl_release;
.float rl_detonate_later;
#endif
#endif
.entity weaponentity = this.weaponentity_fld;
if(this.realowner.(weaponentity).m_weapon == WEP_DEVASTATOR)
{
- int slot = weaponslot(weaponentity);
-
if(this == this.realowner.(weaponentity).lastrocket)
- if(!this.realowner.rl_release[slot])
+ if(!this.realowner.(weaponentity).rl_release)
if(!PHYS_INPUT_BUTTON_ATCK2(this))
if(WEP_CVAR(devastator, guiderate))
if(time > this.pushltime)
if(WEP_CVAR(devastator, reload_ammo) && actor.(weaponentity).clip_load < WEP_CVAR(devastator, ammo)) { // forced reload
thiswep.wr_reload(thiswep, actor, weaponentity);
} else {
- int slot = weaponslot(weaponentity);
if(fire & 1)
{
- if(actor.rl_release[slot] || WEP_CVAR(devastator, guidestop))
+ if(actor.(weaponentity).rl_release || WEP_CVAR(devastator, guidestop))
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(devastator, refire)))
{
W_Devastator_Attack(thiswep, actor, weaponentity);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(devastator, animtime), w_ready);
- actor.rl_release[slot] = 0;
+ actor.(weaponentity).rl_release = 0;
}
}
else
- actor.rl_release[slot] = 1;
+ actor.(weaponentity).rl_release = 1;
if(fire & 2)
if(actor.(weaponentity).m_switchweapon == WEP_DEVASTATOR)
METHOD(Devastator, wr_setup, void(entity thiswep, entity actor))
{
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
- actor.rl_release[slot] = 1;
+ {
+ .entity weaponentity = weaponentities[slot];
+ actor.(weaponentity).rl_release = 1;
+ }
}
METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
{
{
.entity weaponentity = weaponentities[slot];
actor.(weaponentity).lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
- actor.rl_release[slot] = 0;
+ actor.(weaponentity).rl_release = 0;
}
}
METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
#ifdef SVQC
.float bot_primary_fireballmooth; // whatever a mooth is
.vector fireball_impactvec;
-.float fireball_primarytime[MAX_WEAPONSLOTS];
+.float fireball_primarytime;
#endif
#endif
#ifdef IMPLEMENTATION
{
if(fire & 1)
{
- int slot = weaponslot(weaponentity);
- if(time >= actor.fireball_primarytime[slot])
+ if(time >= actor.(weaponentity).fireball_primarytime)
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(fireball, refire)))
{
W_Fireball_Attack1_Frame0(thiswep, actor, weaponentity, fire);
- actor.fireball_primarytime[slot] = time + WEP_CVAR_PRI(fireball, refire2) * W_WeaponRateFactor(actor);
+ actor.(weaponentity).fireball_primarytime = time + WEP_CVAR_PRI(fireball, refire2) * W_WeaponRateFactor(actor);
}
}
else if(fire & 2)
METHOD(Fireball, wr_resetplayer, void(entity thiswep, entity actor))
{
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
- actor.fireball_primarytime[slot] = time;
+ {
+ .entity weaponentity = weaponentities[slot];
+ actor.(weaponentity).fireball_primarytime = time;
+ }
}
METHOD(Fireball, wr_suicidemessage, Notification(entity thiswep))
{
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame2);
}
-.float shotgun_primarytime[MAX_WEAPONSLOTS];
+.float shotgun_primarytime;
METHOD(Shotgun, wr_aim, void(entity thiswep, entity actor))
{
{
if(fire & 1)
{
- int slot = weaponslot(weaponentity);
- if(time >= actor.shotgun_primarytime[slot]) // handle refire separately so the secondary can be fired straight after a primary
+ if(time >= actor.(weaponentity).shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary
{
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(shotgun, animtime)))
{
W_Shotgun_Attack(thiswep, actor, weaponentity, true);
- actor.shotgun_primarytime[slot] = time + WEP_CVAR_PRI(shotgun, refire) * W_WeaponRateFactor(actor);
+ actor.(weaponentity).shotgun_primarytime = time + WEP_CVAR_PRI(shotgun, refire) * W_WeaponRateFactor(actor);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(shotgun, animtime), w_ready);
}
}
}
else if((fire & 2) && WEP_CVAR(shotgun, secondary) == 2)
{
- int slot = weaponslot(weaponentity);
- if(time >= actor.shotgun_primarytime[slot]) // handle refire separately so the secondary can be fired straight after a primary
+ if(time >= actor.(weaponentity).shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary
{
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_SEC(shotgun, alt_animtime)))
{
W_Shotgun_Attack(thiswep, actor, weaponentity, false);
- actor.shotgun_primarytime[slot] = time + WEP_CVAR_SEC(shotgun, alt_refire) * W_WeaponRateFactor(actor);
+ actor.(weaponentity).shotgun_primarytime = time + WEP_CVAR_SEC(shotgun, alt_refire) * W_WeaponRateFactor(actor);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), W_Shotgun_Attack3_Frame1);
}
}