X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fvaporizer.qc;h=91042b613b7a425c8fc354a395a2392108a4697e;hp=f9cdc00e958ca93f9356a86d6c722f14dad9cd72;hb=530060820e0b8e30ab0841063d91b272fecc5bdb;hpb=f438b415278f56c0cf86e2018b45fb3e6972259c diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index f9cdc00e95..91042b613b 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -1,12 +1,13 @@ +#include "vaporizer.qh" #ifndef IMPLEMENTATION CLASS(Vaporizer, Weapon) -/* ammotype */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells) -/* impulse */ ATTRIB(Vaporizer, impulse, int, 7) +/* ammotype */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells); +/* impulse */ ATTRIB(Vaporizer, impulse, int, 7); /* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN); /* rating */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); /* color */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1'); /* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex"); -#ifndef MENUQC +#ifdef GAMEQC /* model */ ATTRIB(Vaporizer, m_model, Model, MDL_VAPORIZER_ITEM); #endif /* crosshair */ ATTRIB(Vaporizer, w_crosshair, string, "gfx/crosshairminstanex"); @@ -111,7 +112,7 @@ void VaporizerBeam_Draw(entity this) //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 @@ -124,22 +125,23 @@ void VaporizerBeam_Draw(entity this) Draw_VaporizerBeam_trace_callback_rnd = 0; Draw_VaporizerBeam_trace_callback_rgb = rgb; Draw_VaporizerBeam_trace_callback_a = bound(0, fail, 1); - WarpZone_TraceBox_ThroughZone(this.vorg1, '0 0 0', '0 0 0', this.vorg2, MOVE_NOTHING, world, world, Draw_VaporizerBeam_trace_callback); + WarpZone_TraceBox_ThroughZone(this.vorg1, '0 0 0', '0 0 0', this.vorg2, MOVE_NOTHING, NULL, NULL, Draw_VaporizerBeam_trace_callback); Draw_VaporizerBeam_trace_callback_tex = string_null; /*if(!MUTATOR_CALLHOOK(Particles_VaporizerBeam, this.vorg1, this.vorg2)) if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo())) - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); else - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);*/ + WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);*/ } NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew) { Net_Accept(vortex_beam); - this.think = SUB_Remove_self; + setthink(this, SUB_Remove); this.nextthink = time + bound(0, autocvar_cl_vaporizerbeam_lifetime, 10); this.draw = VaporizerBeam_Draw; + if (isNew) IL_PUSH(g_drawables, this); this.drawmask = MASK_NORMAL; this.vorg1_x = ReadCoord(); this.vorg1_y = ReadCoord(); this.vorg1_z = ReadCoord(); @@ -150,15 +152,16 @@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew) this.sv_entnum = myowner; this.team = ReadByte() - 1; + pointparticles(EFFECT_VORTEX_MUZZLEFLASH, this.vorg1, normalize(this.vorg2 - this.vorg1) * 1000, 1); + if(autocvar_cl_vaporizerbeam_particle) { - WarpZone_TrailParticles(world, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2); + WarpZone_TrailParticles(NULL, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2); this.draw = func_null; this.drawmask = MASK_NORMAL; - remove(this); + delete(this); } - pointparticles(EFFECT_VORTEX_MUZZLEFLASH, this.vorg1, normalize(this.vorg2 - this.vorg1) * 1000, 1); return true; } #endif @@ -167,82 +170,82 @@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew) spawnfunc(weapon_vaporizer) { weapon_defaultspawnfunc(this, WEP_VAPORIZER); } spawnfunc(weapon_minstanex) { spawnfunc_weapon_vaporizer(this); } -void W_RocketMinsta_Explosion(vector loc) -{SELFPARAM(); - if(accuracy_canbegooddamage(self)) - accuracy_add(self, WEP_DEVASTATOR.m_id, autocvar_g_rm_damage, 0); +void W_RocketMinsta_Explosion(entity actor, vector loc) +{ + if(accuracy_canbegooddamage(actor)) + accuracy_add(actor, WEP_DEVASTATOR.m_id, autocvar_g_rm_damage, 0); entity dmgent = spawn(); - dmgent.owner = dmgent.realowner = self; + dmgent.owner = dmgent.realowner = actor; setorigin(dmgent, loc); - RadiusDamage (dmgent, self, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, world, world, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other); - remove(dmgent); + RadiusDamage (dmgent, actor, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, NULL, NULL, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other); + delete(dmgent); } -void W_Vaporizer_Attack(Weapon thiswep) -{SELFPARAM(); - bool flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last +void W_Vaporizer_Attack(Weapon thiswep, entity actor, .entity weaponentity) +{ + bool flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last float vaporizer_damage = ((WEP_CVAR_PRI(vaporizer, damage) > 0) ? WEP_CVAR_PRI(vaporizer, damage) : 10000); - W_SetupShot(self, true, 0, SND_Null, CH_WEAPON_A, vaporizer_damage); + W_SetupShot(actor, weaponentity, true, 0, SND_Null, CH_WEAPON_A, vaporizer_damage); // handle sound separately so we can change the volume // added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway) - sound (self, CH_WEAPON_A, SND_MINSTANEXFIRE, VOL_BASE * 0.8, ATTEN_NORM); + sound (actor, CH_WEAPON_A, SND_MINSTANEXFIRE, VOL_BASE * 0.8, ATTEN_NORM); yoda = 0; damage_goodhits = 0; - FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id); + FireRailgunBullet(actor, 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(self, damage_goodhits); + SendCSQCVaporizerBeamParticle(actor, damage_goodhits); if(yoda && flying) - Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); - if(damage_goodhits && self.vaporizer_lasthit) + Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); + if(damage_goodhits && actor.vaporizer_lasthit) { - Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE); + Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE); damage_goodhits = 0; // only every second time } - self.vaporizer_lasthit = damage_goodhits; + actor.vaporizer_lasthit = damage_goodhits; if(autocvar_g_rm) if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT))) - W_RocketMinsta_Explosion(trace_endpos); + W_RocketMinsta_Explosion(actor, trace_endpos); - W_DecreaseAmmo(thiswep, self, ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo))); + W_DecreaseAmmo(thiswep, actor, ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo))); } -void W_RocketMinsta_Laser_Explode () -{SELFPARAM(); - if(other.takedamage == DAMAGE_AIM) - if(IS_PLAYER(other)) - if(DIFF_TEAM(self.realowner, other)) - if(!IS_DEAD(other)) - if(IsFlying(other)) - Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH); - - self.event_damage = func_null; - self.takedamage = DAMAGE_NO; - RadiusDamage (self, self.realowner, self.rm_damage, self.rm_edmg, autocvar_g_rm_laser_radius, world, world, self.rm_force, self.projectiledeathtype, other); - remove(self); +void W_RocketMinsta_Laser_Explode (entity this, entity directhitentity) +{ + if(directhitentity.takedamage == DAMAGE_AIM) + if(IS_PLAYER(directhitentity)) + if(DIFF_TEAM(this.realowner, directhitentity)) + if(!IS_DEAD(directhitentity)) + if(IsFlying(directhitentity)) + Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH); + + this.event_damage = func_null; + this.takedamage = DAMAGE_NO; + RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, directhitentity); + delete(this); } void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger) { - WITHSELF(this, W_RocketMinsta_Laser_Explode()); + W_RocketMinsta_Laser_Explode(this, trigger); // we probably don't want trigger used here, but this matches closest to old behaviour } -void W_RocketMinsta_Laser_Touch () -{SELFPARAM(); - PROJECTILE_TOUCH; +void W_RocketMinsta_Laser_Touch(entity this, entity toucher) +{ + PROJECTILE_TOUCH(this, toucher); //W_RocketMinsta_Laser_Explode (); - RadiusDamage (self, self.realowner, self.rm_damage, self.rm_edmg, autocvar_g_rm_laser_radius, world, world, self.rm_force, self.projectiledeathtype, other); - remove(self); + RadiusDamage(this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, toucher); + delete(this); } -void W_RocketMinsta_Attack2() -{SELFPARAM(); - makevectors(self.v_angle); +void W_RocketMinsta_Attack2(entity actor, .entity weaponentity) +{ + makevectors(actor.v_angle); entity proj; float counter = 0; @@ -250,21 +253,21 @@ void W_RocketMinsta_Attack2() float spread = autocvar_g_rm_laser_spread; float rndspread = autocvar_g_rm_laser_spread_random; - Weapon w = PS(self).m_weapon; - PS(self).m_weapon = WEP_ELECTRO; - W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND_CRYLINK_FIRE, CH_WEAPON_A, autocvar_g_rm_laser_damage); - PS(self).m_weapon = w; + Weapon w = PS(actor).m_weapon; + PS(actor).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; Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); while(counter < total) { proj = new(plasma_prim); - proj.owner = proj.realowner = self; + proj.owner = proj.realowner = actor; proj.bot_dodge = true; proj.bot_dodgerating = autocvar_g_rm_laser_damage; - proj.use1 = W_RocketMinsta_Laser_Explode_use; - proj.think = adaptor_think2use_hittype_splash; + proj.use = W_RocketMinsta_Laser_Explode_use; + setthink(proj, adaptor_think2use_hittype_splash); proj.nextthink = time + autocvar_g_rm_laser_lifetime; PROJECTILE_MAKETRIGGER(proj); proj.projectiledeathtype = WEP_ELECTRO.m_id; @@ -276,47 +279,49 @@ void W_RocketMinsta_Attack2() //W_SetupProjectileVelocity(proj, autocvar_g_rm_laser_speed, spread * (rndspread ? random() : 1) * autocvar_g_rm_laser_speed); - proj.movetype = MOVETYPE_BOUNCEMISSILE; + set_movetype(proj, MOVETYPE_BOUNCEMISSILE); //W_SETUPPROJECTILEVELOCITY(proj, g_balance_minstanex_laser); proj.velocity = (w_shotdir + (((counter + 0.5) / total) * 2 - 1) * v_right * (spread * (rndspread ? random() : 1))) * cvar("g_rm_laser_speed"); proj.velocity_z = proj.velocity_z + cvar("g_rm_laser_zspread") * (random() - 0.5); - proj.velocity = W_CalculateProjectileVelocity(proj.realowner.velocity, proj.velocity, true); + proj.velocity = W_CalculateProjectileVelocity(actor, actor.velocity, proj.velocity, true); proj.angles = vectoangles(proj.velocity); - proj.touch = W_RocketMinsta_Laser_Touch; + settouch(proj, W_RocketMinsta_Laser_Touch); 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); - MUTATOR_CALLHOOK(EditProjectile, self, proj); + MUTATOR_CALLHOOK(EditProjectile, actor, proj); counter++; } } -void W_RocketMinsta_Attack3 () -{SELFPARAM(); - makevectors(self.v_angle); +void W_RocketMinsta_Attack3 (entity actor, .entity weaponentity) +{ + makevectors(actor.v_angle); entity proj; float counter = 0; float total = 1; - Weapon w = PS(self).m_weapon; - PS(self).m_weapon = WEP_ELECTRO; - W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND_ELECTRO_FIRE2, CH_WEAPON_A, autocvar_g_rm_laser_damage); - PS(self).m_weapon = w; + Weapon w = PS(actor).m_weapon; + PS(actor).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; Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); while(counter < total) { proj = new(plasma_prim); - proj.owner = proj.realowner = self; + proj.owner = proj.realowner = actor; proj.bot_dodge = true; proj.bot_dodgerating = autocvar_g_rm_laser_damage; - proj.use1 = W_RocketMinsta_Laser_Explode_use; - proj.think = adaptor_think2use_hittype_splash; + proj.use = W_RocketMinsta_Laser_Explode_use; + setthink(proj, adaptor_think2use_hittype_splash); proj.nextthink = time + autocvar_g_rm_laser_lifetime; PROJECTILE_MAKETRIGGER(proj); proj.projectiledeathtype = WEP_ELECTRO.m_id; @@ -328,29 +333,30 @@ void W_RocketMinsta_Attack3 () //W_SetupProjectileVelocity(proj, autocvar_g_rm_laser_speed, spread * (rndspread ? random() : 1) * autocvar_g_rm_laser_speed); - proj.movetype = MOVETYPE_BOUNCEMISSILE; + set_movetype(proj, MOVETYPE_BOUNCEMISSILE); proj.velocity = w_shotdir * autocvar_g_rm_laser_speed; - proj.velocity = W_CalculateProjectileVelocity(proj.realowner.velocity, proj.velocity, true); + proj.velocity = W_CalculateProjectileVelocity(actor, actor.velocity, proj.velocity, true); proj.angles = vectoangles(proj.velocity); - proj.touch = W_RocketMinsta_Laser_Touch; + settouch(proj, W_RocketMinsta_Laser_Touch); 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); - MUTATOR_CALLHOOK(EditProjectile, self, proj); + MUTATOR_CALLHOOK(EditProjectile, actor, proj); counter++; } } -METHOD(Vaporizer, wr_aim, void(entity thiswep)) +METHOD(Vaporizer, wr_aim, void(entity thiswep, entity actor)) { - SELFPARAM(); - if(self.(thiswep.ammo_field) > 0) - PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 1, false); + if(actor.(thiswep.ammo_field) > 0) + PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, 1000000, 0, 1, false); else - PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars + PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars } METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) { @@ -365,7 +371,7 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent { if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(vaporizer, refire))) { - W_Vaporizer_Attack(thiswep); + W_Vaporizer_Attack(thiswep, actor, weaponentity); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready); } } @@ -381,20 +387,20 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent actor.jump_interval = time + autocvar_g_rm_laser_refire; actor.jump_interval2 = time + autocvar_g_rm_laser_rapid_delay; damage_goodhits = 0; - W_RocketMinsta_Attack2(); + W_RocketMinsta_Attack2(actor, weaponentity); } else if(rapid && actor.jump_interval2 <= time && actor.held_down) { actor.jump_interval2 = time + autocvar_g_rm_laser_rapid_refire; damage_goodhits = 0; - W_RocketMinsta_Attack3(); + W_RocketMinsta_Attack3(actor, weaponentity); //weapon_thinkf(actor, WFRAME_FIRE2, autocvar_g_rm_laser_rapid_animtime, w_ready); } } else if (actor.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.jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor(actor); // decrease ammo for the laser? if(WEP_CVAR_SEC(vaporizer, ammo)) @@ -406,6 +412,7 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent PS(actor).m_weapon = WEP_BLASTER; W_Blaster_Attack( actor, + weaponentity, WEP_BLASTER.m_id | HITTYPE_SECONDARY, WEP_CVAR_SEC(vaporizer, shotangle), WEP_CVAR_SEC(vaporizer, damage), @@ -426,37 +433,32 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent else actor.held_down = false; } -METHOD(Vaporizer, wr_setup, void(entity thiswep)) +METHOD(Vaporizer, wr_setup, void(entity thiswep, entity actor)) { - SELFPARAM(); - self.ammo_field = (thiswep.ammo_field); - self.vaporizer_lasthit = 0; + actor.ammo_field = (thiswep.ammo_field); + actor.vaporizer_lasthit = 0; } -METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep)) +METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep, entity actor)) { - SELFPARAM(); float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)); - float ammo_amount = self.(thiswep.ammo_field) >= vaporizer_ammo; - ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= 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)) +METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep, entity actor)) { - SELFPARAM(); if(!WEP_CVAR_SEC(vaporizer, ammo)) return true; - float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(vaporizer, ammo); - ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo); + float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(vaporizer, ammo); + ammo_amount += actor.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo); return ammo_amount; } -METHOD(Vaporizer, wr_resetplayer, void(entity thiswep)) +METHOD(Vaporizer, wr_resetplayer, void(entity thiswep, entity actor)) { - SELFPARAM(); - self.vaporizer_lasthit = 0; + actor.vaporizer_lasthit = 0; } METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - SELFPARAM(); float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)); float used_ammo; if(WEP_CVAR_SEC(vaporizer, ammo)) @@ -464,7 +466,7 @@ METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponen else used_ammo = vaporizer_ammo; - W_Reload(self, used_ammo, SND_RELOAD); + W_Reload(actor, weaponentity, used_ammo, SND_RELOAD); } METHOD(Vaporizer, wr_suicidemessage, Notification(entity thiswep)) { @@ -478,19 +480,18 @@ METHOD(Vaporizer, wr_killmessage, Notification(entity thiswep)) #endif #ifdef CSQC -METHOD(Vaporizer, wr_impacteffect, void(entity thiswep)) +METHOD(Vaporizer, wr_impacteffect, void(entity thiswep, entity actor)) { - SELFPARAM(); vector org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_SECONDARY) { pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1); - if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); } + if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); } } else { pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1); - if(!w_issilent) { sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); } + if(!w_issilent) { sound(actor, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); } } } METHOD(Vaporizer, wr_init, void(entity thiswep))