#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;
missile.damageforcescale = WEP_CVAR(arc, bolt_damageforcescale);
missile.event_damage = W_Arc_Bolt_Damage;
missile.damagedbycontents = true;
+ IL_PUSH(g_damagedbycontents, missile);
settouch(missile, W_Arc_Bolt_Touch);
missile.use = W_Arc_Bolt_Explode_use;
||
forbidWeaponUse(this.owner)
||
+ this.owner.(weaponentity).m_switchweapon != WEP_ARC
+ ||
(!PHYS_INPUT_BUTTON_ATCK(this.owner) && !burst )
||
this.owner.vehicle
}
}
-METHOD(Arc, wr_aim, void(entity thiswep, entity actor))
+METHOD(Arc, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
{
if(WEP_CVAR(arc, beam_botaimspeed))
{
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(
actor,
+ weaponentity,
WEP_CVAR(arc, beam_botaimspeed),
0,
WEP_CVAR(arc, beam_botaimlifetime),
{
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(
actor,
+ weaponentity,
1000000,
0,
0.001,
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)
if(WEP_CVAR(arc, bolt))
{
float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(arc, bolt_ammo);
- ammo_amount += actor.(weapon_load[WEP_ARC.m_id]) >= WEP_CVAR(arc, bolt_ammo);
+ ammo_amount += actor.(weaponentity).(weapon_load[WEP_ARC.m_id]) >= WEP_CVAR(arc, bolt_ammo);
return ammo_amount;
}
else
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
if(isnew)
{
- int gunalign = W_GunAlign(NULL, STAT(GUNALIGN));
+ int gunalign = W_GunAlign(viewmodels[slot], STAT(GUNALIGN)) - 1;
- this.beam_shotorigin = arc_shotorigin[gunalign]; // quick
- for(int j = 1; j < 5; ++j)
- {
- if(gunaligns[j] == viewmodels[slot])
- {
- this.beam_shotorigin = arc_shotorigin[j - 1]; // accurate
- break;
- }
- }
+ this.beam_shotorigin = arc_shotorigin[gunalign];
// set other main attributes of the beam
this.draw = Draw_ArcBeam;