+#include "vaporizer.qh"
#ifndef IMPLEMENTATION
CLASS(Vaporizer, Weapon)
/* ammotype */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells);
//entity e = CSQCModel_server2csqc(this.sv_entnum - 1);
//if (e == NULL)
//{
- rgb = colormapPaletteColor(stof(getplayerkeyvalue(this.sv_entnum - 1, "colors")) & 0x0F, true);
+ rgb = colormapPaletteColor(entcs_GetClientColors(this.sv_entnum - 1) & 0x0F, true);
//rgb = '1 1 1';
//}
//else
yoda = 0;
damage_goodhits = 0;
- FireRailgunBullet(actor, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id);
+ FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id);
// do this now, as goodhits is disabled below
SendCSQCVaporizerBeamParticle(actor, damage_goodhits);
if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
W_RocketMinsta_Explosion(actor, trace_endpos);
- W_DecreaseAmmo(thiswep, actor, ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)));
+ W_DecreaseAmmo(thiswep, actor, ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)), weaponentity);
}
void W_RocketMinsta_Laser_Explode (entity this)
float spread = autocvar_g_rm_laser_spread;
float rndspread = autocvar_g_rm_laser_spread_random;
- Weapon w = PS(actor).m_weapon;
- PS(actor).m_weapon = WEP_ELECTRO;
+ Weapon w = actor.(weaponentity).m_weapon;
+ actor.(weaponentity).m_weapon = WEP_ELECTRO;
W_SetupShot_ProjectileSize (actor, weaponentity, '0 0 -3', '0 0 -3', false, 2, SND_CRYLINK_FIRE, CH_WEAPON_A, autocvar_g_rm_laser_damage);
- PS(actor).m_weapon = w;
+ actor.(weaponentity).m_weapon = w;
Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
setsize(proj, '0 0 -3', '0 0 -3');
proj.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, proj);
+ IL_PUSH(g_bot_dodge, proj);
proj.missile_flags = MIF_SPLASH;
CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
float counter = 0;
float total = 1;
- Weapon w = PS(actor).m_weapon;
- PS(actor).m_weapon = WEP_ELECTRO;
+ Weapon w = actor.(weaponentity).m_weapon;
+ actor.(weaponentity).m_weapon = WEP_ELECTRO;
W_SetupShot_ProjectileSize (actor, weaponentity, '0 0 -3', '0 0 -3', false, 2, SND_ELECTRO_FIRE2, CH_WEAPON_A, autocvar_g_rm_laser_damage);
- PS(actor).m_weapon = w;
+ actor.(weaponentity).m_weapon = w;
Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
setsize(proj, '0 0 -3', '0 0 -3');
proj.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, proj);
+ IL_PUSH(g_bot_dodge, proj);
proj.missile_flags = MIF_SPLASH;
CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
if((autocvar_g_rm && autocvar_g_rm_laser) || autocvar_g_rm_laser == 2)
{
bool rapid = autocvar_g_rm_laser_rapid;
- if(actor.jump_interval <= time && !actor.held_down)
+ if(actor.(weaponentity).jump_interval <= time && !actor.(weaponentity).held_down)
{
if(rapid)
- actor.held_down = true;
- actor.jump_interval = time + autocvar_g_rm_laser_refire;
- actor.jump_interval2 = time + autocvar_g_rm_laser_rapid_delay;
+ actor.(weaponentity).held_down = true;
+ actor.(weaponentity).jump_interval = time + autocvar_g_rm_laser_refire;
+ actor.(weaponentity).jump_interval2 = time + autocvar_g_rm_laser_rapid_delay;
damage_goodhits = 0;
W_RocketMinsta_Attack2(actor, weaponentity);
}
- else if(rapid && actor.jump_interval2 <= time && actor.held_down)
+ else if(rapid && actor.(weaponentity).jump_interval2 <= time && actor.(weaponentity).held_down)
{
- actor.jump_interval2 = time + autocvar_g_rm_laser_rapid_refire;
+ actor.(weaponentity).jump_interval2 = time + autocvar_g_rm_laser_rapid_refire;
damage_goodhits = 0;
W_RocketMinsta_Attack3(actor, weaponentity);
//weapon_thinkf(actor, WFRAME_FIRE2, autocvar_g_rm_laser_rapid_animtime, w_ready);
}
}
- else if (actor.jump_interval <= time)
+ else if (actor.(weaponentity).jump_interval <= time)
{
// handle refire manually, so that primary and secondary can be fired without conflictions (important for instagib)
- actor.jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor(actor);
+ actor.(weaponentity).jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor(actor);
// decrease ammo for the laser?
if(WEP_CVAR_SEC(vaporizer, ammo))
- W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(vaporizer, ammo));
+ W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(vaporizer, ammo), weaponentity);
// ugly instagib hack to reuse the fire mode of the laser
makevectors(actor.v_angle);
- Weapon oldwep = PS(actor).m_weapon; // we can't avoid this hack
- PS(actor).m_weapon = WEP_BLASTER;
+ Weapon oldwep = actor.(weaponentity).m_weapon; // we can't avoid this hack
+ actor.(weaponentity).m_weapon = WEP_BLASTER;
W_Blaster_Attack(
actor,
weaponentity,
WEP_CVAR_SEC(vaporizer, delay),
WEP_CVAR_SEC(vaporizer, lifetime)
);
- PS(actor).m_weapon = oldwep;
+ actor.(weaponentity).m_weapon = oldwep;
// now do normal refire
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);
}
}
else
- actor.held_down = false;
+ actor.(weaponentity).held_down = false;
}
METHOD(Vaporizer, wr_setup, void(entity thiswep, entity actor))
{
actor.ammo_field = (thiswep.ammo_field);
actor.vaporizer_lasthit = 0;
}
-METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep, entity actor))
+METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
{
float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
float ammo_amount = actor.(thiswep.ammo_field) >= vaporizer_ammo;
ammo_amount += actor.(weapon_load[WEP_VAPORIZER.m_id]) >= vaporizer_ammo;
return ammo_amount;
}
-METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep, entity actor))
+METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
{
if(!WEP_CVAR_SEC(vaporizer, ammo))
return true;