From dbaac505b368e204d38c0f598290f5065333052d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 22 Oct 2003 21:54:29 +0000 Subject: [PATCH] s/self/@self/g in the eventual hope of using Objective-QC features :) --- ParoxysmII/source/buttons.r | 96 ++--- ParoxysmII/source/client.r | 722 +++++++++++++++++------------------ ParoxysmII/source/combat.r | 74 ++-- ParoxysmII/source/defs.r | 9 +- ParoxysmII/source/doors.r | 482 +++++++++++------------ ParoxysmII/source/dynlight.r | 72 ++-- ParoxysmII/source/flash.r | 30 +- ParoxysmII/source/items.r | 676 ++++++++++++++++---------------- ParoxysmII/source/misc.r | 384 +++++++++---------- ParoxysmII/source/observe.r | 220 +++++------ ParoxysmII/source/plats.r | 274 ++++++------- ParoxysmII/source/player.r | 512 ++++++++++++------------- ParoxysmII/source/poxdefs.r | 2 +- ParoxysmII/source/sectrig.r | 420 ++++++++++---------- ParoxysmII/source/server.r | 60 +-- ParoxysmII/source/shields.r | 42 +- ParoxysmII/source/specfx.r | 174 ++++----- ParoxysmII/source/spectate.r | 28 +- ParoxysmII/source/subs.r | 150 ++++---- ParoxysmII/source/targid.r | 34 +- ParoxysmII/source/triggers.r | 280 +++++++------- ParoxysmII/source/wall.r | 164 ++++---- ParoxysmII/source/weapons.r | 644 +++++++++++++++---------------- ParoxysmII/source/world.r | 2 +- 24 files changed, 2775 insertions(+), 2776 deletions(-) diff --git a/ParoxysmII/source/buttons.r b/ParoxysmII/source/buttons.r index aef61fa..8d6c724 100644 --- a/ParoxysmII/source/buttons.r +++ b/ParoxysmII/source/buttons.r @@ -9,26 +9,26 @@ void() button_return; void() button_wait = { - self.state = STATE_TOP; - self.nextthink = self.ltime + self.wait; - self.think = button_return; - activator = self.enemy; + @self.state = STATE_TOP; + @self.nextthink = @self.ltime + @self.wait; + @self.think = button_return; + activator = @self.enemy; SUB_UseTargets(); - self.frame = 1; // use alternate textures + @self.frame = 1; // use alternate textures }; void() button_done = { - self.state = STATE_BOTTOM; + @self.state = STATE_BOTTOM; }; void() button_return = { - self.state = STATE_DOWN; - SUB_CalcMove (self.pos1, self.speed, button_done); - self.frame = 0; // use normal textures - if (self.health) - self.takedamage = DAMAGE_YES; // can be shot again + @self.state = STATE_DOWN; + SUB_CalcMove (@self.pos1, @self.speed, button_done); + @self.frame = 0; // use normal textures + if (@self.health) + @self.takedamage = DAMAGE_YES; // can be shot again }; @@ -39,19 +39,19 @@ void() button_blocked = // do nothing, just don't come all the way back out void() button_fire = { - if (self.state == STATE_UP || self.state == STATE_TOP) + if (@self.state == STATE_UP || @self.state == STATE_TOP) return; - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NORM); - self.state = STATE_UP; - SUB_CalcMove (self.pos2, self.speed, button_wait); + @self.state = STATE_UP; + SUB_CalcMove (@self.pos2, @self.speed, button_wait); }; void() button_use = { - self.enemy = activator; + @self.enemy = activator; button_fire (); }; @@ -59,15 +59,15 @@ void() button_touch = { if (other.classname != "player") return; - self.enemy = other; + @self.enemy = other; button_fire (); }; void() button_killed = { - self.enemy = damage_attacker; - self.health = self.max_health; - self.takedamage = DAMAGE_NO; // wil be reset upon return + @self.enemy = damage_attacker; + @self.health = @self.max_health; + @self.takedamage = DAMAGE_NO; // wil be reset upon return button_fire (); }; @@ -89,51 +89,51 @@ When a button is touched, it moves some distance in the direction of it's angle, */ void() func_button = { - if (self.sounds == 0) { + if (@self.sounds == 0) { precache_sound ("buttons/airbut1.wav"); - self.noise = "buttons/airbut1.wav"; + @self.noise = "buttons/airbut1.wav"; } - if (self.sounds == 1) { + if (@self.sounds == 1) { precache_sound ("buttons/switch21.wav"); - self.noise = "buttons/switch21.wav"; + @self.noise = "buttons/switch21.wav"; } - if (self.sounds == 2) { + if (@self.sounds == 2) { precache_sound ("buttons/switch02.wav"); - self.noise = "buttons/switch02.wav"; + @self.noise = "buttons/switch02.wav"; } - if (self.sounds == 3) { + if (@self.sounds == 3) { precache_sound ("buttons/switch04.wav"); - self.noise = "buttons/switch04.wav"; + @self.noise = "buttons/switch04.wav"; } SetMovedir (); - self.movetype = MOVETYPE_PUSH; - self.solid = SOLID_BSP; - setmodel (self, self.model); + @self.movetype = MOVETYPE_PUSH; + @self.solid = SOLID_BSP; + setmodel (@self, @self.model); - self.blocked = button_blocked; - self.use = button_use; + @self.blocked = button_blocked; + @self.use = button_use; - if (self.health) { - self.max_health = self.health; - self.th_die = button_killed; - self.takedamage = DAMAGE_YES; + if (@self.health) { + @self.max_health = @self.health; + @self.th_die = button_killed; + @self.takedamage = DAMAGE_YES; - self.nobleed = TRUE; // + POX + @self.nobleed = TRUE; // + POX } else - self.touch = button_touch; + @self.touch = button_touch; - if (!self.speed) - self.speed = 40; - if (!self.wait) - self.wait = 1; - if (!self.lip) - self.lip = 4; + if (!@self.speed) + @self.speed = 40; + if (!@self.wait) + @self.wait = 1; + if (!@self.lip) + @self.lip = 4; - self.state = STATE_BOTTOM; + @self.state = STATE_BOTTOM; - self.pos1 = self.origin; - self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + @self.pos1 = @self.origin; + @self.pos2 = @self.pos1 + @self.movedir*(fabs(@self.movedir*@self.size) - @self.lip); }; diff --git a/ParoxysmII/source/client.r b/ParoxysmII/source/client.r index 7c6786d..1710816 100644 --- a/ParoxysmII/source/client.r +++ b/ParoxysmII/source/client.r @@ -34,7 +34,7 @@ Use mangle instead of angle, so you can set pitch or roll as well as yaw. 'pitc */ void() info_intermission = { - self.angles = self.mangle; // so C can get at it + @self.angles = @self.mangle; // so C can get at it }; //POX v1.2 @@ -45,7 +45,7 @@ void() SetChangeParms = //POX v1.1 - fresh start for everyone on changelevel //POX v1.2 - parms are used to store the Taget ID toggle, and to prevent running autoexec.cfg more than once per session - parm1 = self.target_id_toggle; + parm1 = @self.target_id_toggle; parm2 = TRUE; }; @@ -58,15 +58,15 @@ void() DecodeLevelParms = { localcmd ("serverinfo playerfly 1"); //POX v1.2 - parms are used to store the Taget ID toggle, and to prevent running autoexec.cfg more than once per session - if(!self.target_id_toggle && !self.target_id_temp) - self.target_id_toggle = parm1; + if(!@self.target_id_toggle && !@self.target_id_temp) + @self.target_id_toggle = parm1; - self.configed = parm2; + @self.configed = parm2; //POX v1.2 - run autoexec.cfg ONCE when first joining server only! - if (!self.configed) { - self.configed = TRUE; - stuffcmd(self, "exec autoexec.cfg\n"); + if (!@self.configed) { + @self.configed = TRUE; + stuffcmd(@self, "exec autoexec.cfg\n"); } }; /* @@ -129,7 +129,7 @@ void() IntermissionThink = if (time < intermission_exittime) return; - if (!self.button0 && !self.button1 && !self.button2) + if (!@self.button0 && !@self.button1 && !@self.button2) return; GotoNextMap (); @@ -182,19 +182,19 @@ void() changelevel_touch = // if ((cvar("noexit") == 1) || ((cvar("noexit") == 2) && (mapname != "start"))) if ((cvar("samelevel") == 2) || ((cvar("samelevel") == 3) && (mapname != "start"))) { - T_Damage (other, self, self, 50000); + T_Damage (other, @self, @self, 50000); return; } BPRINT (PRINT_HIGH, other.netname); BPRINT (PRINT_HIGH," exited the level\n"); - nextmap = self.map; + nextmap = @self.map; SUB_UseTargets (); - self.touch = SUB_Null; + @self.touch = SUB_Null; // we can't move people right now, because touch functions are called // in the middle of C movement code, so set a think time to do it - self.think = execute_changelevel; - self.nextthink = time + 0.1; + @self.think = execute_changelevel; + @self.nextthink = time + 0.1; }; /*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION @@ -202,11 +202,11 @@ When the player touches this, he gets sent to the map listed in the "map" variab */ void() trigger_changelevel = { - if (!self.map) + if (!@self.map) objerror ("chagnelevel trigger doesn't have map"); InitTrigger (); - self.touch = changelevel_touch; + @self.touch = changelevel_touch; }; /* ============================================================================= @@ -219,7 +219,7 @@ void() set_suicide_frame; void() respawn = { // make a copy of the dead body for appearances sake - CopyToBodyQue (self); + CopyToBodyQue (@self); // set default spawn parms //SetNewParms (); //POX v1.12 // respawn @@ -237,31 +237,31 @@ void() NextLevel; //POX v1.12 void() ClientKill = { //POX v1.12 - don't let LMS observers suicide! - if (self.classname == "LMSobserver") { - sprint (self, PRINT_HIGH, "Observers can't suicide!\n"); + if (@self.classname == "LMSobserver") { + sprint (@self, PRINT_HIGH, "Observers can't suicide!\n"); return; } - BPRINT (PRINT_MEDIUM, self.netname); + BPRINT (PRINT_MEDIUM, @self.netname); BPRINT (PRINT_MEDIUM, " suicides\n"); set_suicide_frame (); - self.modelindex = modelindex_player; - LOGFRAG (self, self); - self.frags -= 2; // extra penalty + @self.modelindex = modelindex_player; + LOGFRAG (@self, @self); + @self.frags -= 2; // extra penalty //POX v1.12 - forgot about stink'n suicides - if ((deathmatch & DM_LMS) && (self.LMS_registered)) { - if (self.frags <= 0) { + if ((deathmatch & DM_LMS) && (@self.LMS_registered)) { + if (@self.frags <= 0) { lms_plrcount = lms_plrcount - 1; - self.frags = 0; - self.LMS_registered = 0; - self.LMS_observer = 2; + @self.frags = 0; + @self.LMS_registered = 0; + @self.LMS_observer = 2; - BPRINT(PRINT_HIGH, self.netname); + BPRINT(PRINT_HIGH, @self.netname); BPRINT(PRINT_HIGH, " is eliminated!\n"); - sound (self, CHAN_BODY, "nar/n_elim.wav", 1, ATTN_NONE); + sound (@self, CHAN_BODY, "nar/n_elim.wav", 1, ATTN_NONE); if (lms_plrcount <= 1) //1 player left so end the game NextLevel (); @@ -411,84 +411,84 @@ void() PutClientInServer = local entity spot; // remove items - self.items &= ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD); + @self.items &= ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD); - if (deathmatch & DM_LMS && self.LMS_observer) { + if (deathmatch & DM_LMS && @self.LMS_observer) { SpawnObserver (); return; } - self.classname = "player"; - self.health = 100; - self.takedamage = DAMAGE_AIM; - self.solid = SOLID_SLIDEBOX; - self.movetype = MOVETYPE_WALK; - self.show_hostile = 0; - self.max_health = 100; - self.flags = FL_CLIENT; - self.air_finished = time + 12; - self.dmg = 2; // initial water damage - self.super_damage_finished = 0; - self.radsuit_finished = 0; - self.invisible_finished = 0; - self.invincible_finished = 0; - self.effects = 0; - self.invincible_time = 0; + @self.classname = "player"; + @self.health = 100; + @self.takedamage = DAMAGE_AIM; + @self.solid = SOLID_SLIDEBOX; + @self.movetype = MOVETYPE_WALK; + @self.show_hostile = 0; + @self.max_health = 100; + @self.flags = FL_CLIENT; + @self.air_finished = time + 12; + @self.dmg = 2; // initial water damage + @self.super_damage_finished = 0; + @self.radsuit_finished = 0; + @self.invisible_finished = 0; + @self.invincible_finished = 0; + @self.effects = 0; + @self.invincible_time = 0; // Give player some stuff - self.items = IT_AXE | IT_TSHOT; - self.ammo_shells = 25; - self.ammo_nails = 0; - self.ammo_rockets = 0; - self.ammo_cells = 0; - self.weapon = IT_TSHOT; + @self.items = IT_AXE | IT_TSHOT; + @self.ammo_shells = 25; + @self.ammo_nails = 0; + @self.ammo_rockets = 0; + @self.ammo_cells = 0; + @self.weapon = IT_TSHOT; // Give player 50 points of blue armor - self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); - self.items |= IT_ARMOR1; - self.armorvalue = 50; - self.armortype = 0.9; + @self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); + @self.items |= IT_ARMOR1; + @self.armorvalue = 50; + @self.armortype = 0.9; DecodeLevelParms (); // exec autoconfig if needed, restore Target ID value W_SetCurrentAmmo (); - self.attack_finished = time; - self.th_pain = player_pain; - self.th_die = PlayerDie; + @self.attack_finished = time; + @self.th_pain = player_pain; + @self.th_die = PlayerDie; - self.deadflag = DEAD_NO; + @self.deadflag = DEAD_NO; // paustime is set by teleporters to keep the player from moving a while - self.pausetime = 0; + @self.pausetime = 0; // reset reload_rocket after death - self.reload_rocket = 0; + @self.reload_rocket = 0; // reset T-Shot after death - self.prime_tshot = FALSE; + @self.prime_tshot = FALSE; spot = SelectSpawnPoint (); - self.origin = spot.origin + '0 0 1'; - self.angles = spot.angles; - self.fixangle = TRUE; // turn this way immediately + @self.origin = spot.origin + '0 0 1'; + @self.angles = spot.angles; + @self.fixangle = TRUE; // turn this way immediately // oh, this is a hack! - setmodel (self, "progs/eyes.mdl"); - modelindex_eyes = self.modelindex; - setmodel (self, "progs/player.mdl"); - modelindex_player = self.modelindex; - setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); + setmodel (@self, "progs/eyes.mdl"); + modelindex_eyes = @self.modelindex; + setmodel (@self, "progs/player.mdl"); + modelindex_player = @self.modelindex; + setsize (@self, VEC_HULL_MIN, VEC_HULL_MAX); - self.view_ofs = '0 0 22'; + @self.view_ofs = '0 0 22'; // Mod - Xian (May.20.97) // Bug where player would have velocity from their last kill - self.velocity = '0 0 0'; + @self.velocity = '0 0 0'; player_stand1 (); - makevectors (self.angles); - spawn_tfog (self.origin + v_forward * 20); - spawn_tdeath (self.origin, self); + makevectors (@self.angles); + spawn_tfog (@self.origin + v_forward * 20); + spawn_tdeath (@self.origin, @self); // Set Rocket Jump Modifiers if (stof (infokey (world, "rj"))) { @@ -501,65 +501,65 @@ void() PutClientInServer = New deathmatch modes */ // Last Man Standing - if ((deathmatch & DM_LMS) && !self.LMS_registered) { + if ((deathmatch & DM_LMS) && !@self.LMS_registered) { if (!fraglimit_LMS) - self.frags = 5; + @self.frags = 5; else - self.frags = fraglimit_LMS; + @self.frags = fraglimit_LMS; - self.LMS_registered = TRUE; + @self.LMS_registered = TRUE; lms_plrcount++; } // Dark Mode - more stuff in Player_PostThink - doesn't work here (?) if (deathmatch & DM_DARK) - flash_on (self); + flash_on (@self); // just in case a player dies in a colour_light field -// stuffcmd (self, "v_cshift 1 1 1 0\n"); +// stuffcmd (@self, "v_cshift 1 1 1 0\n"); // Free For All mode if (deathmatch & DM_FFA) { - self.ammo_nails = 200; - self.ammo_shells = 200; - self.ammo_rockets = 100; - self.ammo_cells = 200; - self.items |= IT_PLASMAGUN; - self.items |= IT_SUPER_NAILGUN; - self.items |= IT_COMBOGUN; - self.items |= IT_ROCKET_LAUNCHER; - self.items |= IT_GRENADE_LAUNCHER; + @self.ammo_nails = 200; + @self.ammo_shells = 200; + @self.ammo_rockets = 100; + @self.ammo_cells = 200; + @self.items |= IT_PLASMAGUN; + @self.items |= IT_SUPER_NAILGUN; + @self.items |= IT_COMBOGUN; + @self.items |= IT_ROCKET_LAUNCHER; + @self.items |= IT_GRENADE_LAUNCHER; - self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); - self.items |= IT_ARMOR3; + @self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); + @self.items |= IT_ARMOR3; - self.armorvalue = 250; - self.armortype = 0.9; - self.health = 200; - self.items |= IT_INVULNERABILITY; - self.invincible_time = 1; - self.invincible_finished = time + 3; + @self.armorvalue = 250; + @self.armortype = 0.9; + @self.health = 200; + @self.items |= IT_INVULNERABILITY; + @self.invincible_time = 1; + @self.invincible_finished = time + 3; - self.weapon = IT_ROCKET_LAUNCHER; - self.currentammo = self.ammo_rockets; - self.weaponmodel = "progs/v_rhino.mdl"; - self.weaponframe = 0; - self.items |= IT_ROCKETS; + @self.weapon = IT_ROCKET_LAUNCHER; + @self.currentammo = @self.ammo_rockets; + @self.weaponmodel = "progs/v_rhino.mdl"; + @self.weaponframe = 0; + @self.items |= IT_ROCKETS; - self.max_health = 200; - sound (self, CHAN_AUTO, "items/protect.wav", 1, ATTN_NORM); - stuffcmd (self, "bf\n"); + @self.max_health = 200; + sound (@self, CHAN_AUTO, "items/protect.wav", 1, ATTN_NORM); + stuffcmd (@self, "bf\n"); } // + POX - Predator mode if (deathmatch & DM_PREDATOR) { - sound (self, CHAN_AUTO, "items/inv1.wav", 1, ATTN_NORM); - stuffcmd (self, "bf\n"); + sound (@self, CHAN_AUTO, "items/inv1.wav", 1, ATTN_NORM); + stuffcmd (@self, "bf\n"); - self.items |= IT_INVISIBILITY; - self.invisible_time = 1; - self.invisible_finished = time + 9999999999; + @self.items |= IT_INVISIBILITY; + @self.invisible_time = 1; + @self.invisible_finished = time + 9999999999; } }; @@ -666,7 +666,7 @@ void() CheckRules = if (timelimit && time >= timelimit) NextLevel (); - if (fraglimit && self.frags >= fraglimit) + if (fraglimit && @self.frags >= fraglimit) NextLevel (); }; @@ -675,87 +675,87 @@ void() PlayerDeathThink = { local float forward; - if ((self.flags & FL_ONGROUND)) { - forward = vlen (self.velocity); + if ((@self.flags & FL_ONGROUND)) { + forward = vlen (@self.velocity); forward -= 20; if (forward <= 0) - self.velocity = '0 0 0'; + @self.velocity = '0 0 0'; else - self.velocity = forward * normalize (self.velocity); + @self.velocity = forward * normalize (@self.velocity); } // wait for all buttons released - if (self.deadflag == DEAD_DEAD) { - if (self.button2 || self.button1 || self.button0) + if (@self.deadflag == DEAD_DEAD) { + if (@self.button2 || @self.button1 || @self.button0) return; - self.deadflag = DEAD_RESPAWNABLE; + @self.deadflag = DEAD_RESPAWNABLE; return; } // don't let players lay around as dead guys during a Last Man Standing game if (deathmatch & DM_LMS) { - if (!(self.button2 || self.button1 || self.button0)) + if (!(@self.button2 || @self.button1 || @self.button0)) return; - stuffcmd (self, "wait;wait;wait;wait;wait;wait\n"); + stuffcmd (@self, "wait;wait;wait;wait;wait;wait\n"); } // wait for any button down - if (!(self.button2 || self.button1 || self.button0)) + if (!(@self.button2 || @self.button1 || @self.button0)) return; - self.button0 = self.button1 = self.button2 = 0; + @self.button0 = @self.button1 = @self.button2 = 0; respawn (); }; void() PlayerJump = { - if (self.flags & FL_WATERJUMP) + if (@self.flags & FL_WATERJUMP) return; // + POX - Removed (new water sounds handled in WaterMove) #if 0 - if (self.waterlevel >= 2) { // play swimming sound - if (self.swim_flag < time) { - self.swim_flag = time + 1; + if (@self.waterlevel >= 2) { // play swimming sound + if (@self.swim_flag < time) { + @self.swim_flag = time + 1; if (random() < 0.5) - sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM); else - sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); } return; } #endif // + POX - velocities changed in fluids - if (self.waterlevel >= 2) { - switch (self.watertype) { + if (@self.waterlevel >= 2) { + switch (@self.watertype) { case CONTENT_WATER: - self.velocity_z = 100; + @self.velocity_z = 100; break; case CONTENT_SLIME: - self.velocity_z = 80; + @self.velocity_z = 80; break; default: - self.velocity_z = 50; + @self.velocity_z = 50; } return; } // - POX - if (!(self.flags & FL_ONGROUND)) + if (!(@self.flags & FL_ONGROUND)) return; - if (!(self.flags & FL_JUMPRELEASED) ) + if (!(@self.flags & FL_JUMPRELEASED) ) return; // don't pogo stick - self.flags -= FL_JUMPRELEASED; - self.button2 = 0; + @self.flags -= FL_JUMPRELEASED; + @self.button2 = 0; // player jumping sound - sound (self, CHAN_VOICE, "player/plyrjmp8.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/plyrjmp8.wav", 1, ATTN_NORM); }; /* @@ -766,124 +766,124 @@ WaterMove .float dmgtime; void() WaterMove = { -// dprint (ftos(self.waterlevel)); - if (self.movetype == MOVETYPE_NOCLIP) +// dprint (ftos(@self.waterlevel)); + if (@self.movetype == MOVETYPE_NOCLIP) return; - if (self.health < 0) + if (@self.health < 0) return; - if (self.waterlevel != 3) { - if (self.air_finished < time) - sound (self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM); - else if (self.air_finished < time + 9) - sound (self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM); - self.air_finished = time + 12; - self.dmg = 2; - } else if (self.air_finished < time) { // drown! - if (self.pain_finished < time) { - self.dmg += 2; + if (@self.waterlevel != 3) { + if (@self.air_finished < time) + sound (@self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM); + else if (@self.air_finished < time + 9) + sound (@self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM); + @self.air_finished = time + 12; + @self.dmg = 2; + } else if (@self.air_finished < time) { // drown! + if (@self.pain_finished < time) { + @self.dmg += 2; - if (self.dmg > 15) - self.dmg = 10; + if (@self.dmg > 15) + @self.dmg = 10; - T_Damage (self, world, world, self.dmg); - self.pain_finished = time + 1; + T_Damage (@self, world, world, @self.dmg); + @self.pain_finished = time + 1; } } - if (!self.waterlevel) { - if (self.flags & FL_INWATER) { // play leave water sound - sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM); - self.flags = self.flags - FL_INWATER; + if (!@self.waterlevel) { + if (@self.flags & FL_INWATER) { // play leave water sound + sound (@self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM); + @self.flags = @self.flags - FL_INWATER; //POX v1.2 - fixed rare cases of underwater sound not cancelling out - if (self.outwsound == 1) { - sound (self, CHAN_BODY, "misc/owater2.wav", 0.5, ATTN_NORM); - self.outwsound = 0; - self.inwsound = 1; - self.uwmuffle = time; + if (@self.outwsound == 1) { + sound (@self, CHAN_BODY, "misc/owater2.wav", 0.5, ATTN_NORM); + @self.outwsound = 0; + @self.inwsound = 1; + @self.uwmuffle = time; } } return; } - switch (self.watertype) { + switch (@self.watertype) { case CONTENT_LAVA: // do damage - if (self.dmgtime < time) { - if (self.radsuit_finished > time) - self.dmgtime = time + 1; + if (@self.dmgtime < time) { + if (@self.radsuit_finished > time) + @self.dmgtime = time + 1; else - self.dmgtime = time + 0.2; + @self.dmgtime = time + 0.2; - T_Damage (self, world, world, 10*self.waterlevel); + T_Damage (@self, world, world, 10*@self.waterlevel); } break; case CONTENT_SLIME: // do damage - if (self.dmgtime < time && self.radsuit_finished < time) { - self.dmgtime = time + 1; - T_Damage (self, world, world, 4*self.waterlevel); + if (@self.dmgtime < time && @self.radsuit_finished < time) { + @self.dmgtime = time + 1; + T_Damage (@self, world, world, 4*@self.waterlevel); } break; default: break; } - if (!(self.flags & FL_INWATER)) { // player enter water sound - switch (self.watertype) { + if (!(@self.flags & FL_INWATER)) { // player enter water sound + switch (@self.watertype) { case CONTENT_LAVA: - sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM); case CONTENT_SLIME: - sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM); case CONTENT_WATER: - sound (self, CHAN_VOICE, "player/inh2o.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/inh2o.wav", 1, ATTN_NORM); default: - self.flags |= FL_INWATER; - self.dmgtime = 0; + @self.flags |= FL_INWATER; + @self.dmgtime = 0; } } // + POX - New water movement sounds -if (self.waterlevel >= 3) +if (@self.waterlevel >= 3) { - self.onwsound = time; - self.outwsound = 1; + @self.onwsound = time; + @self.outwsound = 1; - if (self.inwsound == 1) + if (@self.inwsound == 1) { - sound (self, CHAN_VOICE, "misc/inh2ob.wav", 1, ATTN_NORM); - self.inwsound = 0; + sound (@self, CHAN_VOICE, "misc/inh2ob.wav", 1, ATTN_NORM); + @self.inwsound = 0; } - if (self.uwmuffle < time) + if (@self.uwmuffle < time) { - sound (self, CHAN_BODY, "misc/uwater.wav", 1, ATTN_STATIC); - self.uwmuffle = time + 3.58; + sound (@self, CHAN_BODY, "misc/uwater.wav", 1, ATTN_STATIC); + @self.uwmuffle = time + 3.58; } } - if (self.waterlevel == 2) + if (@self.waterlevel == 2) { - if (self.outwsound == 1) + if (@self.outwsound == 1) { - sound (self, CHAN_BODY, "misc/owater2.wav", 1, ATTN_NORM); - self.outwsound = 0; - self.inwsound = 1; - //self.onwsound = time + 1.9; + sound (@self, CHAN_BODY, "misc/owater2.wav", 1, ATTN_NORM); + @self.outwsound = 0; + @self.inwsound = 1; + //@self.onwsound = time + 1.9; } //POXnote //CheckWaterJump (); Not used in QW? - self.uwmuffle = time; + @self.uwmuffle = time; /* POX - now done in footstep routine - if (self.onwsound < time) + if (@self.onwsound < time) { if (random() < 0.5) - sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM); else - sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM); - self.onwsound = time + random()*2; + @self.onwsound = time + random()*2; } */ } @@ -893,25 +893,25 @@ void() CheckWaterJump = { local vector start, end; // check for a jump-out-of-water - makevectors (self.angles); - start = self.origin; + makevectors (@self.angles); + start = @self.origin; start_z = start_z + 8; v_forward_z = 0; normalize(v_forward); end = start + v_forward*24; - traceline (start, end, TRUE, self); + traceline (start, end, TRUE, @self); if (trace_fraction < 1) { // solid at waist - start_z = start_z + self.maxs_z - 8; + start_z = start_z + @self.maxs_z - 8; end = start + v_forward*24; - self.movedir = trace_plane_normal * -50; - traceline (start, end, TRUE, self); + @self.movedir = trace_plane_normal * -50; + traceline (start, end, TRUE, @self); if (trace_fraction == 1) { // open at eye level - self.flags = self.flags | FL_WATERJUMP; - self.velocity_z = 225; - self.flags = self.flags - (self.flags & FL_JUMPRELEASED); - self.teleport_time = time + 2; // safety net + @self.flags = @self.flags | FL_WATERJUMP; + @self.velocity_z = 225; + @self.flags = @self.flags - (@self.flags & FL_JUMPRELEASED); + @self.teleport_time = time + 2; // safety net return; } } @@ -929,17 +929,17 @@ void() PlayerPreThink = IntermissionThink (); // otherwise a button could be missed between return; // the think tics } - if (self.view_ofs == '0 0 0') + if (@self.view_ofs == '0 0 0') return; // intermission or finale - makevectors (self.v_angle); // is this still used - self.deathtype = ""; + makevectors (@self.v_angle); // is this still used + @self.deathtype = ""; CheckRules (); // + POX - for LMS observer - POX 1.2 moved above WaterMove(); - if (deathmatch & DM_LMS && self.LMS_observer) + if (deathmatch & DM_LMS && @self.LMS_observer) { - if (self.deadflag >= DEAD_DEAD) + if (@self.deadflag >= DEAD_DEAD) { PlayerDeathThink (); return; @@ -949,35 +949,35 @@ void() PlayerPreThink = // - POX WaterMove (); /* - if (self.waterlevel == 2) + if (@self.waterlevel == 2) CheckWaterJump (); */ - if (self.deadflag >= DEAD_DEAD) + if (@self.deadflag >= DEAD_DEAD) { PlayerDeathThink (); return; } - if (self.deadflag == DEAD_DYING) + if (@self.deadflag == DEAD_DYING) return; // dying, so do nothing - if (self.button2) + if (@self.button2) { PlayerJump (); } else - self.flags = self.flags | FL_JUMPRELEASED; + @self.flags = @self.flags | FL_JUMPRELEASED; // teleporters can force a non-moving pause time - if (time < self.pausetime) - self.velocity = '0 0 0'; + if (time < @self.pausetime) + @self.velocity = '0 0 0'; // POX if (deathmatch & DM_AUTOSWITCH) { - if(time > self.attack_finished && self.currentammo == 0 && self.weapon != IT_AXE) + if(time > @self.attack_finished && @self.currentammo == 0 && @self.weapon != IT_AXE) { - self.weapon = W_BestWeapon (); + @self.weapon = W_BestWeapon (); W_SetCurrentAmmo (); } } @@ -991,165 +991,165 @@ Check for turning off powerups */ void() CheckPowerups = { - if (self.health <= 0) + if (@self.health <= 0) return; // + POX - Rot armour down to 150 (max 250) - if (self.armorvalue > 150 && self.armor_rot < time) { - self.armorvalue = self.armorvalue - 1; - self.armor_rot = time + 1; + if (@self.armorvalue > 150 && @self.armor_rot < time) { + @self.armorvalue = @self.armorvalue - 1; + @self.armor_rot = time + 1; // change armour to Yellow - if (self.armorvalue == 150) { - self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); - self.items |= IT_ARMOR2; + if (@self.armorvalue == 150) { + @self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); + @self.items |= IT_ARMOR2; } } // - POX // invisibility - if (self.invisible_finished) + if (@self.invisible_finished) { // sound and screen flash when items starts to run out - if (self.invisible_sound < time) + if (@self.invisible_sound < time) { - sound (self, CHAN_AUTO, "items/inv3.wav", 0.5, ATTN_IDLE); - self.invisible_sound = time + ((random() * 3) + 1); + sound (@self, CHAN_AUTO, "items/inv3.wav", 0.5, ATTN_IDLE); + @self.invisible_sound = time + ((random() * 3) + 1); } - if (self.invisible_finished < time + 3) + if (@self.invisible_finished < time + 3) { - if (self.invisible_time == 1) + if (@self.invisible_time == 1) { - sprint (self, PRINT_HIGH, "Cloak is failing...\n"); - stuffcmd (self, "bf\n"); - sound (self, CHAN_AUTO, "items/inv2.wav", 1, ATTN_NORM); - self.invisible_time = time + 1; + sprint (@self, PRINT_HIGH, "Cloak is failing...\n"); + stuffcmd (@self, "bf\n"); + sound (@self, CHAN_AUTO, "items/inv2.wav", 1, ATTN_NORM); + @self.invisible_time = time + 1; } - if (self.invisible_time < time) + if (@self.invisible_time < time) { - self.invisible_time = time + 1; - stuffcmd (self, "bf\n"); + @self.invisible_time = time + 1; + stuffcmd (@self, "bf\n"); } } - if (self.invisible_finished < time) + if (@self.invisible_finished < time) { // just stopped - self.items -= IT_INVISIBILITY; - self.invisible_finished = 0; - self.invisible_time = 0; + @self.items -= IT_INVISIBILITY; + @self.invisible_finished = 0; + @self.invisible_time = 0; } // use the eyes - self.frame = 0; - self.modelindex = modelindex_eyes; + @self.frame = 0; + @self.modelindex = modelindex_eyes; } else - self.modelindex = modelindex_player; // don't use eyes + @self.modelindex = modelindex_player; // don't use eyes // invincibility - if (self.invincible_finished) + if (@self.invincible_finished) { // sound and screen flash when items starts to run out - if (self.invincible_finished < time + 3) + if (@self.invincible_finished < time + 3) { - if (self.invincible_time == 1) + if (@self.invincible_time == 1) { - sprint (self, PRINT_HIGH, "MegaShields are almost burned out...\n"); - stuffcmd (self, "bf\n"); - sound (self, CHAN_AUTO, "items/protect2.wav", 1, ATTN_NORM); - self.invincible_time = time + 1; + sprint (@self, PRINT_HIGH, "MegaShields are almost burned out...\n"); + stuffcmd (@self, "bf\n"); + sound (@self, CHAN_AUTO, "items/protect2.wav", 1, ATTN_NORM); + @self.invincible_time = time + 1; } - if (self.invincible_time < time) + if (@self.invincible_time < time) { - self.invincible_time = time + 1; - stuffcmd (self, "bf\n"); + @self.invincible_time = time + 1; + stuffcmd (@self, "bf\n"); } } - if (self.invincible_finished < time) + if (@self.invincible_finished < time) { // just stopped - self.items -= IT_INVULNERABILITY; - self.invincible_time = 0; - self.invincible_finished = 0; + @self.items -= IT_INVULNERABILITY; + @self.invincible_time = 0; + @self.invincible_finished = 0; } // + POX - ignore light effects in Dark Mode - if (self.invincible_finished > time && !(deathmatch & DM_DARK)) + if (@self.invincible_finished > time && !(deathmatch & DM_DARK)) { - self.effects = self.effects | EF_DIMLIGHT; - self.effects = self.effects | EF_RED; + @self.effects = @self.effects | EF_DIMLIGHT; + @self.effects = @self.effects | EF_RED; } else { - self.effects = self.effects - (self.effects & EF_DIMLIGHT); - self.effects = self.effects - (self.effects & EF_RED); + @self.effects = @self.effects - (@self.effects & EF_DIMLIGHT); + @self.effects = @self.effects - (@self.effects & EF_RED); } } // super damage - if (self.super_damage_finished) + if (@self.super_damage_finished) { // sound and screen flash when items starts to run out - if (self.super_damage_finished < time + 3) + if (@self.super_damage_finished < time + 3) { - if (self.super_time == 1) + if (@self.super_time == 1) { //if (deathmatch == 4) - // sprint (self, PRINT_HIGH, "OctaPower is wearing off\n"); + // sprint (@self, PRINT_HIGH, "OctaPower is wearing off\n"); //else - sprint (self, PRINT_HIGH, "Quad Damage is wearing off\n"); - stuffcmd (self, "bf\n"); - sound (self, CHAN_AUTO, "items/damage2.wav", 1, ATTN_NORM); - self.super_time = time + 1; + sprint (@self, PRINT_HIGH, "Quad Damage is wearing off\n"); + stuffcmd (@self, "bf\n"); + sound (@self, CHAN_AUTO, "items/damage2.wav", 1, ATTN_NORM); + @self.super_time = time + 1; } - if (self.super_time < time) + if (@self.super_time < time) { - self.super_time = time + 1; - stuffcmd (self, "bf\n"); + @self.super_time = time + 1; + stuffcmd (@self, "bf\n"); } } - if (self.super_damage_finished < time) + if (@self.super_damage_finished < time) { // just stopped - self.items &= ~IT_QUAD; + @self.items &= ~IT_QUAD; /*if (deathmatch == 4) { - self.ammo_cells = 255; - self.armorvalue = 1; - self.armortype = 0.8; - self.health = 100; + @self.ammo_cells = 255; + @self.armorvalue = 1; + @self.armortype = 0.8; + @self.health = 100; }*/ - self.super_damage_finished = 0; - self.super_time = 0; + @self.super_damage_finished = 0; + @self.super_time = 0; } - if (self.super_damage_finished > time) { - self.effects |= EF_DIMLIGHT; - self.effects |= EF_BLUE; + if (@self.super_damage_finished > time) { + @self.effects |= EF_DIMLIGHT; + @self.effects |= EF_BLUE; } else { - self.effects &= ~EF_DIMLIGHT; - self.effects &= ~EF_BLUE; + @self.effects &= ~EF_DIMLIGHT; + @self.effects &= ~EF_BLUE; } } // suit - if (self.radsuit_finished) { - self.air_finished = time + 12; // don't drown + if (@self.radsuit_finished) { + @self.air_finished = time + 12; // don't drown - if (self.radsuit_finished < time + 3) { // sound and flash when running out - if (self.rad_time == 1) { - sprint (self, PRINT_HIGH, "Air supply in Biosuit expiring\n"); - stuffcmd (self, "bf\n"); - sound (self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_NORM); - self.rad_time = time + 1; + if (@self.radsuit_finished < time + 3) { // sound and flash when running out + if (@self.rad_time == 1) { + sprint (@self, PRINT_HIGH, "Air supply in Biosuit expiring\n"); + stuffcmd (@self, "bf\n"); + sound (@self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_NORM); + @self.rad_time = time + 1; } - if (self.rad_time < time) { - self.rad_time = time + 1; - stuffcmd (self, "bf\n"); + if (@self.rad_time < time) { + @self.rad_time = time + 1; + stuffcmd (@self, "bf\n"); } } - if (self.radsuit_finished < time) { // just stopped - self.items &= ~IT_SUIT; - self.rad_time = 0; - self.radsuit_finished = 0; + if (@self.radsuit_finished < time) { // just stopped + @self.items &= ~IT_SUIT; + @self.rad_time = 0; + @self.radsuit_finished = 0; } } }; @@ -1162,25 +1162,25 @@ void () PlayerRegen = local float type, bit; local string snd; - if (self.armorvalue >= self.armregen) { - self.regen_finished = time; + if (@self.armorvalue >= @self.armregen) { + @self.regen_finished = time; return; // already have max armour that station can give } - self.armorvalue += 3; + @self.armorvalue += 3; // Cap armour - if (self.armorvalue > self.armregen) - self.armorvalue = self.armregen; - if (self.armorvalue > 150) { // Equivalent to Red (level 3) Armour + if (@self.armorvalue > @self.armregen) + @self.armorvalue = @self.armregen; + if (@self.armorvalue > 150) { // Equivalent to Red (level 3) Armour type = 0.8; snd = "items/shield3.wav"; bit = IT_ARMOR3; - } else if (self.armorvalue > 50) { // Equivlent to Yellow (level 2) Armour + } else if (@self.armorvalue > 50) { // Equivlent to Yellow (level 2) Armour type = 0.8; snd = "items/shield2.wav"; bit = IT_ARMOR2; - } else if (self.armorvalue > 1) { // Equivlent to Blue (level 1) Armour + } else if (@self.armorvalue > 1) { // Equivlent to Blue (level 1) Armour type = 0.8; snd = "items/shield1.wav"; bit = IT_ARMOR1; @@ -1191,13 +1191,13 @@ void () PlayerRegen = } // set armour type - self.armortype = type; - self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); - self.items |= bit; - sound (self, CHAN_AUTO, snd, 1, ATTN_NORM); + @self.armortype = type; + @self.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3); + @self.items |= bit; + sound (@self, CHAN_AUTO, snd, 1, ATTN_NORM); //POX - 1.01b - Don't allow armour to rot while recharging - self.armor_rot = time + 5; + @self.armor_rot = time + 5; }; /* @@ -1210,53 +1210,53 @@ void () PlayerPostThink = { //POX v1.2 - clear overrun v_cshifts! if (time < 1.5) - stuffcmd (self, "bf\n"); + stuffcmd (@self, "bf\n"); //POX v1.2 - cshift auto reset for colour_light - if (self.cshift_finished < time) { - if (!self.cshift_off) { - stuffcmd (self, "v_cshift 0 0 0 0\n"); - self.cshift_off = TRUE; + if (@self.cshift_finished < time) { + if (!@self.cshift_off) { + stuffcmd (@self, "v_cshift 0 0 0 0\n"); + @self.cshift_off = TRUE; } } - if (self.view_ofs == '0 0 0') + if (@self.view_ofs == '0 0 0') return; // intermission or finale - if (self.deadflag) + if (@self.deadflag) return; //+POX TESTING //local string howmanyplayers; //howmanyplayers = ftos(lms_plrcount); - //sprint (self, PRINT_HIGH, howmanyplayers); + //sprint (@self, PRINT_HIGH, howmanyplayers); //-POX TESTING // + POX - for LMS observer - if (deathmatch & DM_LMS && self.LMS_observer) { + if (deathmatch & DM_LMS && @self.LMS_observer) { ObserverThink (); return; } // - POX // check to see if player landed and play landing sound - if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND)) { - if (self.jump_flag < -650) { + if ((@self.jump_flag < -300) && (@self.flags & FL_ONGROUND)) { + if (@self.jump_flag < -650) { local float d; - self.deathtype = "falling"; + @self.deathtype = "falling"; - d = (self.jump_flag + 625) * -0.1; // scale damage by fall height - T_Damage (self, world, world, d); - sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM); + d = (@self.jump_flag + 625) * -0.1; // scale damage by fall height + T_Damage (@self, world, world, d); + sound (@self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM); } else { - sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM); } } - self.jump_flag = self.velocity_z; + @self.jump_flag = @self.velocity_z; //POX v1.2 - better regen touch handling - if (self.regen_finished > time) + if (@self.regen_finished > time) PlayerRegen (); CheckPowerups (); @@ -1273,36 +1273,36 @@ void() ClientConnect = // + POX - I hard coded some environmental changes to prevent tampering.... // NOTE: autoexec.cfg is called at DecodeLevelParms (QW ignores it when called from quake.rc - which is also ignored) // POX v1.12 added 'fov 90' (mostly for lms_observer additions) - stuffcmd (self, "alias rules impulse 253;alias secondtrigger impulse 15;alias idtarget impulse 16;alias gllight impulse 17;wait;fov 90;v_idlescale 0.54;v_ipitch_cycle 3.5;v_ipitch_level 0.4;v_iroll_level 0.1;v_iyaw_level 0;v_kickpitch 0.8;v_kickroll 0.8;scr_conspeed 900;cl_bobcycle 0.8;cl_bobup 0;cl_bob 0.015\n"); + stuffcmd (@self, "alias rules impulse 253;alias secondtrigger impulse 15;alias idtarget impulse 16;alias gllight impulse 17;wait;fov 90;v_idlescale 0.54;v_ipitch_cycle 3.5;v_ipitch_level 0.4;v_iroll_level 0.1;v_iyaw_level 0;v_kickpitch 0.8;v_kickroll 0.8;scr_conspeed 900;cl_bobcycle 0.8;cl_bobup 0;cl_bob 0.015\n"); // - POX // + POX LMS late joiners get booted to spectate if (!(deathmatch & DM_LMS)) { - BPRINT (PRINT_HIGH, self.netname); + BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, " entered the game\n"); - centerprint (self, "Paroxysm II v1.2.0\n"); + centerprint (@self, "Paroxysm II v1.2.0\n"); } else if (time < 40) { // Allow entrants for up to 40 secs after changelevel - BPRINT (PRINT_HIGH, self.netname); + BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, " entered the game\n"); if (!lms_plrcount) - centerprint(self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.\n\nWaiting for players..."); + centerprint(@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.\n\nWaiting for players..."); else - centerprint(self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply."); + centerprint(@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply."); } else { //After 40 secs, If there are two or more players, go into observer mode if (!lms_plrcount) { //First player arrived, let him wait around - BPRINT (PRINT_HIGH, self.netname); + BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, " entered the game\n"); - centerprint(self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.\n\nWaiting for players..."); + centerprint(@self, "Paroxysm II v1.2.0\nLast Man Standing Rules Apply.\n\nWaiting for players..."); } else if (lms_plrcount == 1) { // second player arrived, so go to the next map (for a fair start) - BPRINT (PRINT_HIGH, self.netname); + BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, " entered the game\n"); NextLevel (); } else { // LMS Game allready started so boot to observe - BPRINT (PRINT_HIGH, self.netname); + BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, " entered the game late!"); //LMS reconnect as spectator - self.LMS_observer = 1; + @self.LMS_observer = 1; } } @@ -1320,13 +1320,13 @@ called when a player disconnects from a server void() ClientDisconnect = { // let everyone else know - BPRINT (PRINT_HIGH, self.netname); + BPRINT (PRINT_HIGH, @self.netname); BPRINT (PRINT_HIGH, " left the game with "); - BPRINT (PRINT_HIGH, ftos (self.frags)); + BPRINT (PRINT_HIGH, ftos (@self.frags)); BPRINT (PRINT_HIGH, " frags\n"); - sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); + sound (@self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE); // + POX - if ((deathmatch & DM_LMS) && (self.LMS_registered)) + if ((deathmatch & DM_LMS) && (@self.LMS_registered)) { lms_plrcount = lms_plrcount - 1; @@ -1467,7 +1467,7 @@ void(entity targ, entity attacker) ClientObituary = } if (attacker.classname == "player") { - if (targ == attacker) { // killed self (dumbass!) + if (targ == attacker) { // killed @self (dumbass!) LOGFRAG (attacker, attacker); if (!(deathmatch & DM_LMS)) @@ -1629,7 +1629,7 @@ void(entity targ, entity attacker) ClientObituary = LOGFRAG (targ, targ); if (!(deathmatch & DM_LMS)) //POX 1.2 - do regular obituary taunts in LMS mode - targ.frags = targ.frags - 1; // killed self + targ.frags = targ.frags - 1; // killed @self if (attacker.classname == "explo_box" || attacker.classname == "explo_bsp") { deathstring = " blew up\n"; diff --git a/ParoxysmII/source/combat.r b/ParoxysmII/source/combat.r index 5977adf..4d25026 100644 --- a/ParoxysmII/source/combat.r +++ b/ParoxysmII/source/combat.r @@ -23,7 +23,7 @@ float (entity targ, entity inflictor) CanDamage = { // bmodels need special checking because their origin is 0,0,0 if (targ.movetype == MOVETYPE_PUSH) { - traceline (inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, self); + traceline (inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, @self); if (trace_fraction == 1) return TRUE; @@ -34,24 +34,24 @@ float (entity targ, entity inflictor) CanDamage = return FALSE; } - traceline (inflictor.origin, targ.origin, TRUE, self); + traceline (inflictor.origin, targ.origin, TRUE, @self); if (trace_fraction == 1) return TRUE; - traceline (inflictor.origin, targ.origin + '15 15 0', TRUE, self); + traceline (inflictor.origin, targ.origin + '15 15 0', TRUE, @self); if (trace_fraction == 1) return TRUE; - traceline (inflictor.origin, targ.origin + '-15 -15 0', TRUE, self); + traceline (inflictor.origin, targ.origin + '-15 -15 0', TRUE, @self); if (trace_fraction == 1) return TRUE; - traceline (inflictor.origin, targ.origin + '-15 15 0', TRUE, self); + traceline (inflictor.origin, targ.origin + '-15 15 0', TRUE, @self); if (trace_fraction == 1) return TRUE; - traceline (inflictor.origin, targ.origin + '15 -15 0', TRUE, self); + traceline (inflictor.origin, targ.origin + '15 -15 0', TRUE, @self); if (trace_fraction == 1) return TRUE; @@ -65,38 +65,38 @@ Killed */ void (entity targ, entity attacker) Killed = { - local entity oself = self; + local entity oself = @self; - self = targ; + @self = targ; - if (self.health < -99) - self.health = -99; // don't let sbar get funky + if (@self.health < -99) + @self.health = -99; // don't let sbar get funky - if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE) { // doors, triggers, etc - self.th_die (); - self = oself; + if (@self.movetype == MOVETYPE_PUSH || @self.movetype == MOVETYPE_NONE) { // doors, triggers, etc + @self.th_die (); + @self = oself; return; } - self.enemy = attacker; + @self.enemy = attacker; // bump the monster counter - if (self.flags & FL_MONSTER) { + if (@self.flags & FL_MONSTER) { killed_monsters++; WriteByte (MSG_ALL, SVC_KILLEDMONSTER); } - ClientObituary (self, attacker); + ClientObituary (@self, attacker); - self.takedamage = DAMAGE_NO; - self.touch = NIL; - self.effects = 0; + @self.takedamage = DAMAGE_NO; + @self.touch = NIL; + @self.effects = 0; /*SERVER monster_death_use(); */ - self.th_die (); + @self.th_die (); - self = oself; + @self = oself; }; @@ -131,9 +131,9 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = if (targ.flags & FL_GODMODE) return; - if (targ.invincible_finished >= time && self.invincible_sound < time) { + if (targ.invincible_finished >= time && @self.invincible_sound < time) { sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM); - self.invincible_sound = time + 2; + @self.invincible_sound = time + 2; return; } @@ -179,7 +179,7 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5; dir = normalize (dir); - if ((damage < 60) // player-player damage (not self-inflicted) + if ((damage < 60) // player-player damage (not @self-inflicted) && (attacker.classname == "player") && (targ.classname == "player") && (attacker != targ)) @@ -193,7 +193,7 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = } // team play damage avoidance - //ZOID 12-13-96: self.team doesn't work in QW. Use keys + //ZOID 12-13-96: @self.team doesn't work in QW. Use keys attackerteam = infokey (attacker, "team"); targteam = infokey (targ, "team"); @@ -211,28 +211,28 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = } // react to the damage - oldself = self; - self = targ; + oldself = @self; + @self = targ; #if 0 - if ((self.flags & FL_MONSTER) && attacker != world) { // get mad unless of the same class (except for soldiers) - if (self != attacker && attacker != self.enemy) { - if ((self.classname != attacker.classname) - || (self.classname == "monster_army" )) { - if (self.enemy.classname == "player") - self.oldenemy = self.enemy; + if ((@self.flags & FL_MONSTER) && attacker != world) { // get mad unless of the same class (except for soldiers) + if (@self != attacker && attacker != @self.enemy) { + if ((@self.classname != attacker.classname) + || (@self.classname == "monster_army" )) { + if (@self.enemy.classname == "player") + @self.oldenemy = @self.enemy; - self.enemy = attacker; + @self.enemy = attacker; FoundTarget (); } } } #endif - if (self.th_pain) - self.th_pain (); + if (@self.th_pain) + @self.th_pain (); - self = oldself; + @self = oldself; }; /* diff --git a/ParoxysmII/source/defs.r b/ParoxysmII/source/defs.r index 55d3ac1..9257da8 100644 --- a/ParoxysmII/source/defs.r +++ b/ParoxysmII/source/defs.r @@ -10,7 +10,6 @@ // // system globals // -entity self; entity other; entity world; float time; @@ -80,7 +79,7 @@ void() SetNewParms; // called when a client first connects to // a server. sets parms so they can be // saved off for restarts -void() SetChangeParms; // call to set parms for self so they can +void() SetChangeParms; // call to set parms for @self so they can // be saved for a level transition @@ -538,15 +537,15 @@ float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE float() droptofloor= #34; // TRUE if landed on floor void(float style, string value) lightstyle = #35; // #39 was removed -float(entity e) checkbottom = #40; // true if self is on ground +float(entity e) checkbottom = #40; // true if @self is on ground float(vector v) pointcontents = #41; // returns a CONTENT_* // #42 was removed vector(entity e, float speed) aim = #44; // returns the shooting vector void(string s) localcmd = #46; // put string into local que entity(entity e) nextent = #47; // for looping through all ents // #48 was removed -void() ChangeYaw = #49; // turn towards self.ideal_yaw - // at self.yaw_speed +void() ChangeYaw = #49; // turn towards @self.ideal_yaw + // at @self.yaw_speed // #50 was removed // diff --git a/ParoxysmII/source/doors.r b/ParoxysmII/source/doors.r index 5c3a0bb..aa1c9e2 100644 --- a/ParoxysmII/source/doors.r +++ b/ParoxysmII/source/doors.r @@ -26,12 +26,12 @@ void() door_go_up; void() door_blocked = { other.deathtype = "squish"; - T_Damage (other, self, self.goalentity, self.dmg); + T_Damage (other, @self, @self.goalentity, @self.dmg); // if a door has a negative wait, it would never come back if blocked, // so let it just squash the object to death real fast - if (self.wait >= 0) + if (@self.wait >= 0) { - if (self.state == STATE_DOWN) + if (@self.state == STATE_DOWN) door_go_up (); else door_go_down (); @@ -39,43 +39,43 @@ void() door_blocked = }; void() door_hit_top = { - sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM); - self.state = STATE_TOP; - if (self.spawnflags & DOOR_TOGGLE) + sound (@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise1, 1, ATTN_NORM); + @self.state = STATE_TOP; + if (@self.spawnflags & DOOR_TOGGLE) return; // don't come down automatically - self.think = door_go_down; - self.nextthink = self.ltime + self.wait; + @self.think = door_go_down; + @self.nextthink = @self.ltime + @self.wait; }; void() door_hit_bottom = { - sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM); - self.state = STATE_BOTTOM; + sound (@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise1, 1, ATTN_NORM); + @self.state = STATE_BOTTOM; }; void() door_go_down = { - sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - if (self.max_health) + sound (@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM); + if (@self.max_health) { - self.takedamage = DAMAGE_YES; - self.health = self.max_health; + @self.takedamage = DAMAGE_YES; + @self.health = @self.max_health; } - self.state = STATE_DOWN; - SUB_CalcMove (self.pos1, self.speed, door_hit_bottom); + @self.state = STATE_DOWN; + SUB_CalcMove (@self.pos1, @self.speed, door_hit_bottom); }; void() door_go_up = { - if (self.state == STATE_UP) + if (@self.state == STATE_UP) return; // allready going up - if (self.state == STATE_TOP) + if (@self.state == STATE_TOP) { // reset top wait time - self.nextthink = self.ltime + self.wait; + @self.nextthink = @self.ltime + @self.wait; return; } - sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - self.state = STATE_UP; - SUB_CalcMove (self.pos2, self.speed, door_hit_top); + sound (@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM); + @self.state = STATE_UP; + SUB_CalcMove (@self.pos2, @self.speed, door_hit_top); SUB_UseTargets(); }; /* @@ -87,71 +87,71 @@ void() door_fire = { local entity oself; local entity starte; - if (self.owner != self) - objerror ("door_fire: self.owner != self"); + if (@self.owner != @self) + objerror ("door_fire: @self.owner != @self"); // play use key sound - if (self.items) - sound (self, CHAN_VOICE, self.noise4, 1, ATTN_NORM); - self.message = string_null; // no more message - oself = self; - if (self.spawnflags & DOOR_TOGGLE) + if (@self.items) + sound (@self, CHAN_VOICE, @self.noise4, 1, ATTN_NORM); + @self.message = string_null; // no more message + oself = @self; + if (@self.spawnflags & DOOR_TOGGLE) { - if (self.state == STATE_UP || self.state == STATE_TOP) + if (@self.state == STATE_UP || @self.state == STATE_TOP) { - starte = self; + starte = @self; do { door_go_down (); - self = self.enemy; - } while ( (self != starte) && (self != world) ); - self = oself; + @self = @self.enemy; + } while ( (@self != starte) && (@self != world) ); + @self = oself; return; } } // trigger all paired doors - starte = self; + starte = @self; do { - self.goalentity = activator; // Who fired us + @self.goalentity = activator; // Who fired us door_go_up (); - self = self.enemy; - } while ( (self != starte) && (self != world) ); - self = oself; + @self = @self.enemy; + } while ( (@self != starte) && (@self != world) ); + @self = oself; }; void() door_use = { local entity oself; - self.message = ""; // door message are for touch only - self.owner.message = ""; - self.enemy.message = ""; - oself = self; - self = self.owner; + @self.message = ""; // door message are for touch only + @self.owner.message = ""; + @self.enemy.message = ""; + oself = @self; + @self = @self.owner; door_fire (); - self = oself; + @self = oself; }; void() door_trigger_touch = { if (other.health <= 0) return; - if (time < self.attack_finished) + if (time < @self.attack_finished) return; - self.attack_finished = time + 1; + @self.attack_finished = time + 1; activator = other; - self = self.owner; + @self = @self.owner; door_use (); }; void() door_killed = { local entity oself; - oself = self; - self = self.owner; - self.health = self.max_health; - self.takedamage = DAMAGE_NO; // wil be reset upon return + oself = @self; + @self = @self.owner; + @self.health = @self.max_health; + @self.takedamage = DAMAGE_NO; // wil be reset upon return door_use (); - self = oself; + @self = oself; }; /* ================ @@ -163,40 +163,40 @@ void() door_touch = { if (other.classname != "player") return; - if (self.owner.attack_finished > time) + if (@self.owner.attack_finished > time) return; - self.owner.attack_finished = time + 2; - if (self.owner.message != "") + @self.owner.attack_finished = time + 2; + if (@self.owner.message != "") { - self.target_id_finished = time + 4;//POX don't let TargetID override centerprints - centerprint (other, self.owner.message); + @self.target_id_finished = time + 4;//POX don't let TargetID override centerprints + centerprint (other, @self.owner.message); sound (other, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); } // key door stuff - if (!self.items) + if (!@self.items) return; // FIXME: blink key on player's status bar - if ( (self.items & other.items) != self.items ) + if ( (@self.items & other.items) != @self.items ) { - self.target_id_finished = time + 4;//POX don't let TargetID override centerprints + @self.target_id_finished = time + 4;//POX don't let TargetID override centerprints - if (self.owner.items == IT_KEY1) + if (@self.owner.items == IT_KEY1) { if (world.worldtype == 2) { centerprint (other, "You need the silver keycard"); - sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); } else if (world.worldtype == 1) { centerprint (other, "You need the silver runekey"); - sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); } else if (world.worldtype == 0) { centerprint (other, "You need the silver key"); - sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); } } else @@ -204,25 +204,25 @@ void() door_touch = if (world.worldtype == 2) { centerprint (other, "You need the gold keycard"); - sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); } else if (world.worldtype == 1) { centerprint (other, "You need the gold runekey"); - sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); } else if (world.worldtype == 0) { centerprint (other, "You need the gold key"); - sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); } } return; } - other.items = other.items - self.items; - self.touch = SUB_Null; - if (self.enemy) - self.enemy.touch = SUB_Null; // get paired door + other.items = other.items - @self.items; + @self.touch = SUB_Null; + if (@self.enemy) + @self.enemy.touch = SUB_Null; // get paired door door_use (); }; /* @@ -237,7 +237,7 @@ entity(vector fmins, vector fmaxs) spawn_field = trigger = spawn(); trigger.movetype = MOVETYPE_NONE; trigger.solid = SOLID_TRIGGER; - trigger.owner = self; + trigger.owner = @self; trigger.touch = door_trigger_touch; t1 = fmins; t2 = fmaxs; @@ -269,52 +269,52 @@ void() LinkDoors = { local entity t, starte; local vector cmins, cmaxs; - if (self.enemy) + if (@self.enemy) return; // already linked by another door - if (self.spawnflags & 4) + if (@self.spawnflags & 4) { - self.owner = self.enemy = self; + @self.owner = @self.enemy = @self; return; // don't want to link this door } - cmins = self.mins; - cmaxs = self.maxs; + cmins = @self.mins; + cmaxs = @self.maxs; - starte = self; - t = self; + starte = @self; + t = @self; do { - self.owner = starte; // master door - if (self.health) - starte.health = self.health; - if (self.targetname) - starte.targetname = self.targetname; - if (self.message != "") - starte.message = self.message; - t = find (t, classname, self.classname); + @self.owner = starte; // master door + if (@self.health) + starte.health = @self.health; + if (@self.targetname) + starte.targetname = @self.targetname; + if (@self.message != "") + starte.message = @self.message; + t = find (t, classname, @self.classname); if (!t) { - self.enemy = starte; // make the chain a loop + @self.enemy = starte; // make the chain a loop // shootable, fired, or key doors just needed the owner/enemy links, // they don't spawn a field - self = self.owner; - if (self.health) + @self = @self.owner; + if (@self.health) return; - if (self.targetname) + if (@self.targetname) return; - if (self.items) + if (@self.items) return; - self.owner.trigger_field = spawn_field(cmins, cmaxs); + @self.owner.trigger_field = spawn_field(cmins, cmaxs); return; } - if (EntitiesTouching(self,t)) + if (EntitiesTouching(@self,t)) { if (t.enemy) objerror ("cross connected doors"); - self.enemy = t; - self = t; + @self.enemy = t; + @self = t; if (t.mins_x < cmins_x) cmins_x = t.mins_x; if (t.mins_y < cmins_y) @@ -356,110 +356,110 @@ void() func_door = { precache_sound ("doors/medtry.wav"); precache_sound ("doors/meduse.wav"); - self.noise3 = "doors/medtry.wav"; - self.noise4 = "doors/meduse.wav"; + @self.noise3 = "doors/medtry.wav"; + @self.noise4 = "doors/meduse.wav"; } else if (world.worldtype == 1) { precache_sound ("doors/runetry.wav"); precache_sound ("doors/runeuse.wav"); - self.noise3 = "doors/runetry.wav"; - self.noise4 = "doors/runeuse.wav"; + @self.noise3 = "doors/runetry.wav"; + @self.noise4 = "doors/runeuse.wav"; } else if (world.worldtype == 2) { precache_sound ("doors/basetry.wav"); precache_sound ("doors/baseuse.wav"); - self.noise3 = "doors/basetry.wav"; - self.noise4 = "doors/baseuse.wav"; + @self.noise3 = "doors/basetry.wav"; + @self.noise4 = "doors/baseuse.wav"; } else { dprint ("no worldtype set!\n"); } - if (self.sounds == 0) + if (@self.sounds == 0) { precache_sound ("misc/null.wav"); precache_sound ("misc/null.wav"); - self.noise1 = "misc/null.wav"; - self.noise2 = "misc/null.wav"; + @self.noise1 = "misc/null.wav"; + @self.noise2 = "misc/null.wav"; } - if (self.sounds == 1) + if (@self.sounds == 1) { precache_sound ("doors/drclos4.wav"); precache_sound ("doors/doormv1.wav"); - self.noise1 = "doors/drclos4.wav"; - self.noise2 = "doors/doormv1.wav"; + @self.noise1 = "doors/drclos4.wav"; + @self.noise2 = "doors/doormv1.wav"; } - if (self.sounds == 2) + if (@self.sounds == 2) { precache_sound ("doors/hydro1.wav"); precache_sound ("doors/hydro2.wav"); - self.noise2 = "doors/hydro1.wav"; - self.noise1 = "doors/hydro2.wav"; + @self.noise2 = "doors/hydro1.wav"; + @self.noise1 = "doors/hydro2.wav"; } - if (self.sounds == 3) + if (@self.sounds == 3) { precache_sound ("doors/stndr1.wav"); precache_sound ("doors/stndr2.wav"); - self.noise2 = "doors/stndr1.wav"; - self.noise1 = "doors/stndr2.wav"; + @self.noise2 = "doors/stndr1.wav"; + @self.noise1 = "doors/stndr2.wav"; } - if (self.sounds == 4) + if (@self.sounds == 4) { precache_sound ("doors/ddoor1.wav"); precache_sound ("doors/ddoor2.wav"); - self.noise1 = "doors/ddoor2.wav"; - self.noise2 = "doors/ddoor1.wav"; + @self.noise1 = "doors/ddoor2.wav"; + @self.noise2 = "doors/ddoor1.wav"; } SetMovedir (); - self.max_health = self.health; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - setorigin (self, self.origin); - setmodel (self, self.model); - self.classname = "door"; - self.blocked = door_blocked; - self.use = door_use; + @self.max_health = @self.health; + @self.solid = SOLID_BSP; + @self.movetype = MOVETYPE_PUSH; + setorigin (@self, @self.origin); + setmodel (@self, @self.model); + @self.classname = "door"; + @self.blocked = door_blocked; + @self.use = door_use; - if (self.spawnflags & DOOR_SILVER_KEY) - self.items = IT_KEY1; - if (self.spawnflags & DOOR_GOLD_KEY) - self.items = IT_KEY2; + if (@self.spawnflags & DOOR_SILVER_KEY) + @self.items = IT_KEY1; + if (@self.spawnflags & DOOR_GOLD_KEY) + @self.items = IT_KEY2; - if (!self.speed) - self.speed = 100; - if (!self.wait) - self.wait = 3; - if (!self.lip) - self.lip = 8; - if (!self.dmg) - self.dmg = 2; - self.pos1 = self.origin; - self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); + if (!@self.speed) + @self.speed = 100; + if (!@self.wait) + @self.wait = 3; + if (!@self.lip) + @self.lip = 8; + if (!@self.dmg) + @self.dmg = 2; + @self.pos1 = @self.origin; + @self.pos2 = @self.pos1 + @self.movedir*(fabs(@self.movedir*@self.size) - @self.lip); // DOOR_START_OPEN is to allow an entity to be lighted in the closed position // but spawn in the open position - if (self.spawnflags & DOOR_START_OPEN) + if (@self.spawnflags & DOOR_START_OPEN) { - setorigin (self, self.pos2); - self.pos2 = self.pos1; - self.pos1 = self.origin; + setorigin (@self, @self.pos2); + @self.pos2 = @self.pos1; + @self.pos1 = @self.origin; } - self.state = STATE_BOTTOM; - if (self.health) + @self.state = STATE_BOTTOM; + if (@self.health) { - self.takedamage = DAMAGE_YES; - self.th_die = door_killed; + @self.takedamage = DAMAGE_YES; + @self.th_die = door_killed; } - if (self.items) - self.wait = -1; + if (@self.items) + @self.wait = -1; - self.touch = door_touch; + @self.touch = door_touch; // LinkDoors can't be done until all of the doors have been spawned, so // the sizes can be detected properly. - self.think = LinkDoors; - self.nextthink = self.ltime + 0.1; + @self.think = LinkDoors; + @self.nextthink = @self.ltime + 0.1; }; /* ============================================================================= @@ -482,105 +482,105 @@ void () fd_secret_use = { local float temp; - self.health = 10000; + @self.health = 10000; // exit if still moving around... - if (self.origin != self.oldorigin) + if (@self.origin != @self.oldorigin) return; - self.message = string_null; // no more message + @self.message = string_null; // no more message SUB_UseTargets(); // fire all targets / killtargets - if (!(self.spawnflags & SECRET_NO_SHOOT)) + if (!(@self.spawnflags & SECRET_NO_SHOOT)) { - self.th_pain = SUB_Null; - self.takedamage = DAMAGE_NO; + @self.th_pain = SUB_Null; + @self.takedamage = DAMAGE_NO; } - self.velocity = '0 0 0'; + @self.velocity = '0 0 0'; // Make a sound, wait a little... - sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); - self.nextthink = self.ltime + 0.1; - temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 - makevectors(self.mangle); + sound(@self, CHAN_VOICE, @self.noise1, 1, ATTN_NORM); + @self.nextthink = @self.ltime + 0.1; + temp = 1 - (@self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 + makevectors(@self.mangle); - if (!self.t_width) + if (!@self.t_width) { - if (self.spawnflags & SECRET_1ST_DOWN) - self. t_width = fabs(v_up * self.size); + if (@self.spawnflags & SECRET_1ST_DOWN) + @self. t_width = fabs(v_up * @self.size); else - self. t_width = fabs(v_right * self.size); + @self. t_width = fabs(v_right * @self.size); } - if (!self.t_length) - self. t_length = fabs(v_forward * self.size); - if (self.spawnflags & SECRET_1ST_DOWN) - self.dest1 = self.origin - v_up * self.t_width; + if (!@self.t_length) + @self. t_length = fabs(v_forward * @self.size); + if (@self.spawnflags & SECRET_1ST_DOWN) + @self.dest1 = @self.origin - v_up * @self.t_width; else - self.dest1 = self.origin + v_right * (self.t_width * temp); + @self.dest1 = @self.origin + v_right * (@self.t_width * temp); - self.dest2 = self.dest1 + v_forward * self.t_length; - SUB_CalcMove(self.dest1, self.speed, fd_secret_move1); - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + @self.dest2 = @self.dest1 + v_forward * @self.t_length; + SUB_CalcMove(@self.dest1, @self.speed, fd_secret_move1); + sound(@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM); }; // Wait after first movement... void () fd_secret_move1 = { - self.nextthink = self.ltime + 1.0; - self.think = fd_secret_move2; - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + @self.nextthink = @self.ltime + 1.0; + @self.think = fd_secret_move2; + sound(@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); }; // Start moving sideways w/sound... void () fd_secret_move2 = { - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - SUB_CalcMove(self.dest2, self.speed, fd_secret_move3); + sound(@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM); + SUB_CalcMove(@self.dest2, @self.speed, fd_secret_move3); }; // Wait here until time to go back... void () fd_secret_move3 = { - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); - if (!(self.spawnflags & SECRET_OPEN_ONCE)) + sound(@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); + if (!(@self.spawnflags & SECRET_OPEN_ONCE)) { - self.nextthink = self.ltime + self.wait; - self.think = fd_secret_move4; + @self.nextthink = @self.ltime + @self.wait; + @self.think = fd_secret_move4; } }; // Move backward... void () fd_secret_move4 = { - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - SUB_CalcMove(self.dest1, self.speed, fd_secret_move5); + sound(@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM); + SUB_CalcMove(@self.dest1, @self.speed, fd_secret_move5); }; // Wait 1 second... void () fd_secret_move5 = { - self.nextthink = self.ltime + 1.0; - self.think = fd_secret_move6; - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + @self.nextthink = @self.ltime + 1.0; + @self.think = fd_secret_move6; + sound(@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM); }; void () fd_secret_move6 = { - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done); + sound(@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM); + SUB_CalcMove(@self.oldorigin, @self.speed, fd_secret_done); }; void () fd_secret_done = { - if (!self.targetname || self.spawnflags&SECRET_YES_SHOOT) + if (!@self.targetname || @self.spawnflags&SECRET_YES_SHOOT) { - self.health = 10000; - self.takedamage = DAMAGE_YES; - self.th_pain = fd_secret_use; - self.th_die = fd_secret_use; + @self.health = 10000; + @self.takedamage = DAMAGE_YES; + @self.th_pain = fd_secret_use; + @self.th_die = fd_secret_use; } - sound(self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise3, 1, ATTN_NORM); + sound(@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise3, 1, ATTN_NORM); }; void () secret_blocked = { - if (time < self.attack_finished) + if (time < @self.attack_finished) return; - self.attack_finished = time + 0.5; + @self.attack_finished = time + 0.5; other.deathtype = "squish"; - T_Damage (other, self, self, self.dmg); + T_Damage (other, @self, @self, @self.dmg); }; /* ================ @@ -592,15 +592,15 @@ void() secret_touch = { if (other.classname != "player") return; - if (self.attack_finished > time) + if (@self.attack_finished > time) return; - self.attack_finished = time + 2; + @self.attack_finished = time + 2; - if (self.message) + if (@self.message) { - self.target_id_finished = time + 4;//POX don't let TargetID override centerprints + @self.target_id_finished = time + 4;//POX don't let TargetID override centerprints - centerprint (other, self.message); + centerprint (other, @self.message); sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM); } }; @@ -621,60 +621,60 @@ If a secret door has a targetname, it will only be opened by it's botton or trig */ void () func_door_secret = { - if (self.sounds == 0) - self.sounds = 3; - if (self.sounds == 1) + if (@self.sounds == 0) + @self.sounds = 3; + if (@self.sounds == 1) { precache_sound ("doors/latch2.wav"); precache_sound ("doors/winch2.wav"); precache_sound ("doors/drclos4.wav"); - self.noise1 = "doors/latch2.wav"; - self.noise2 = "doors/winch2.wav"; - self.noise3 = "doors/drclos4.wav"; + @self.noise1 = "doors/latch2.wav"; + @self.noise2 = "doors/winch2.wav"; + @self.noise3 = "doors/drclos4.wav"; } - if (self.sounds == 2) + if (@self.sounds == 2) { precache_sound ("doors/airdoor1.wav"); precache_sound ("doors/airdoor2.wav"); - self.noise2 = "doors/airdoor1.wav"; - self.noise1 = "doors/airdoor2.wav"; - self.noise3 = "doors/airdoor2.wav"; + @self.noise2 = "doors/airdoor1.wav"; + @self.noise1 = "doors/airdoor2.wav"; + @self.noise3 = "doors/airdoor2.wav"; } - if (self.sounds == 3) + if (@self.sounds == 3) { precache_sound ("doors/basesec1.wav"); precache_sound ("doors/basesec2.wav"); - self.noise2 = "doors/basesec1.wav"; - self.noise1 = "doors/basesec2.wav"; - self.noise3 = "doors/basesec2.wav"; + @self.noise2 = "doors/basesec1.wav"; + @self.noise1 = "doors/basesec2.wav"; + @self.noise3 = "doors/basesec2.wav"; } - if (!self.dmg) - self.dmg = 2; + if (!@self.dmg) + @self.dmg = 2; // Magic formula... - self.mangle = self.angles; - self.angles = '0 0 0'; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - self.classname = "door"; - setmodel (self, self.model); - setorigin (self, self.origin); + @self.mangle = @self.angles; + @self.angles = '0 0 0'; + @self.solid = SOLID_BSP; + @self.movetype = MOVETYPE_PUSH; + @self.classname = "door"; + setmodel (@self, @self.model); + setorigin (@self, @self.origin); - self.touch = secret_touch; - self.blocked = secret_blocked; - self.speed = 50; - self.use = fd_secret_use; - if ( !self.targetname || self.spawnflags&SECRET_YES_SHOOT) + @self.touch = secret_touch; + @self.blocked = secret_blocked; + @self.speed = 50; + @self.use = fd_secret_use; + if ( !@self.targetname || @self.spawnflags&SECRET_YES_SHOOT) { - self.health = 10000; - self.takedamage = DAMAGE_YES; - self.th_pain = fd_secret_use; + @self.health = 10000; + @self.takedamage = DAMAGE_YES; + @self.th_pain = fd_secret_use; // + POX - self.nobleed = TRUE; + @self.nobleed = TRUE; // - POX } - self.oldorigin = self.origin; - if (!self.wait) - self.wait = 5; // 5 seconds before closing + @self.oldorigin = @self.origin; + if (!@self.wait) + @self.wait = 5; // 5 seconds before closing }; diff --git a/ParoxysmII/source/dynlight.r b/ParoxysmII/source/dynlight.r index f007e7d..3783a44 100644 --- a/ParoxysmII/source/dynlight.r +++ b/ParoxysmII/source/dynlight.r @@ -26,80 +26,80 @@ void() start_dynlight = { //POX v1.1 - changed this for QW support //No EF_BRIGHTFIELD in QW - defaults to EF_DIMLIGHT - if (self.dynlight_style == 2) - self.effects = self.effects | EF_BRIGHTLIGHT; + if (@self.dynlight_style == 2) + @self.effects = @self.effects | EF_BRIGHTLIGHT; - else if (self.dynlight_style == 4) - self.effects = self.effects | EF_BLUE; + else if (@self.dynlight_style == 4) + @self.effects = @self.effects | EF_BLUE; - else if (self.dynlight_style == 5) - self.effects = self.effects | EF_RED; + else if (@self.dynlight_style == 5) + @self.effects = @self.effects | EF_RED; else - self.effects = self.effects | EF_DIMLIGHT; + @self.effects = @self.effects | EF_DIMLIGHT; dynlight_next(); }; void() dynlight_wait = { - if (self.wait) - self.nextthink = self.ltime + self.wait; + if (@self.wait) + @self.nextthink = @self.ltime + @self.wait; else - self.nextthink = self.ltime + 0.1; + @self.nextthink = @self.ltime + 0.1; - self.think = dynlight_next; + @self.think = dynlight_next; }; void() dynlight_next = { local entity targ; - targ = find (world, targetname, self.target); - self.target = targ.target; - if (!self.target) + targ = find (world, targetname, @self.target); + @self.target = targ.target; + if (!@self.target) objerror ("dynlight_next: no next target"); if (targ.wait) - self.wait = targ.wait; + @self.wait = targ.wait; else - self.wait = 0; - SUB_CalcMove (targ.origin - self.mins, self.speed, dynlight_wait); + @self.wait = 0; + SUB_CalcMove (targ.origin - @self.mins, @self.speed, dynlight_wait); }; void() dynlight_find = { local entity targ; - targ = find (world, targetname, self.target); - self.target = targ.target; - setorigin (self, targ.origin - self.mins); - if (!self.targetname) + targ = find (world, targetname, @self.target); + @self.target = targ.target; + setorigin (@self, targ.origin - @self.mins); + if (!@self.targetname) { // not triggered, so start immediately - self.nextthink = self.ltime + 0.1; - self.think = start_dynlight; + @self.nextthink = @self.ltime + 0.1; + @self.think = start_dynlight; } }; void() dynlight_use = { - if (self.think != dynlight_find) + if (@self.think != dynlight_find) return; // already activated start_dynlight(); }; void() dyn_light = { precache_model ("progs/null.spr"); - if (!self.speed) - self.speed = 100; + if (!@self.speed) + @self.speed = 100; - if (!self.target) + if (!@self.target) objerror ("dyn_light without a target"); - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_PUSH; - self.use = dynlight_use; - self.classname = "dynlight"; + @self.solid = SOLID_NOT; + @self.movetype = MOVETYPE_PUSH; + @self.use = dynlight_use; + @self.classname = "dynlight"; - setmodel (self, "progs/null.spr"); - setsize (self, '0 0 0', '0 0 0'); - setorigin (self, self.origin); + setmodel (@self, "progs/null.spr"); + setsize (@self, '0 0 0', '0 0 0'); + setorigin (@self, @self.origin); // start trains on the second frame, to make sure their targets have had // a chance to spawn - self.nextthink = self.ltime + 0.1; - self.think = dynlight_find; + @self.nextthink = @self.ltime + 0.1; + @self.think = dynlight_find; }; diff --git a/ParoxysmII/source/flash.r b/ParoxysmII/source/flash.r index 5df628b..d24506f 100644 --- a/ParoxysmII/source/flash.r +++ b/ParoxysmII/source/flash.r @@ -5,24 +5,24 @@ /* POX - Flashlight code from the Flashlight Tutorial at the Inside3D website Created by ShockMan eMail: shockman@brutality.com -Added an entity attribute to the spawn function for bot support (since self is only the bot at respwan) +Added an entity attribute to the spawn function for bot support (since @self is only the bot at respwan) */ void() flash_update = { // The Player is dead so turn the Flashlight off - if (self.owner.deadflag != DEAD_NO) - self.effects = 0; + if (@self.owner.deadflag != DEAD_NO) + @self.effects = 0; // The Player is alive so turn On the Flashlight else - self.effects = EF_DIMLIGHT; + @self.effects = EF_DIMLIGHT; // Find out which direction player facing - makevectors (self.owner.v_angle); + makevectors (@self.owner.v_angle); // Check if there is any things infront of the flashlight - traceline (self.owner.origin , (self.owner.origin+(v_forward * 500)) , FALSE , self); + traceline (@self.owner.origin , (@self.owner.origin+(v_forward * 500)) , FALSE , @self); // Set the Flashlight's position - setorigin (self, trace_endpos+(v_forward * -5)); + setorigin (@self, trace_endpos+(v_forward * -5)); // Repeat it in 0.02 seconds... - self.nextthink = time + 0.02; + @self.nextthink = time + 0.02; }; void(entity me) flash_on = { @@ -48,8 +48,8 @@ void(entity me) flash_on = myflash.effects = EF_DIMLIGHT; // Set Start Position - makevectors (self.v_angle); - traceline (self.origin , (self.origin+(v_forward * 500)) , FALSE , self); + makevectors (@self.v_angle); + traceline (@self.origin , (@self.origin+(v_forward * 500)) , FALSE , @self); setorigin (myflash, trace_endpos); // Start Flashlight Update myflash.think = flash_update; @@ -61,18 +61,18 @@ void(entity me) flash_on = void () flash_toggle = { // If Off, Turn On - if (self.flash_flag == FALSE) + if (@self.flash_flag == FALSE) { - self.flash_flag = TRUE; + @self.flash_flag = TRUE; flash_on(); } // If On, Turn Off else { - self.flash_flag = FALSE; + @self.flash_flag = FALSE; W_SetCurrentAmmo (); - self.flash.think = SUB_Remove; - self.flash.nextthink = time + 0.1; + @self.flash.think = SUB_Remove; + @self.flash.nextthink = time + 0.1; } }; diff --git a/ParoxysmII/source/items.r b/ParoxysmII/source/items.r index 1e920b9..d1338c8 100644 --- a/ParoxysmII/source/items.r +++ b/ParoxysmII/source/items.r @@ -8,15 +8,15 @@ BE .8 .3 .4 IN COLOR */ .entity quadcore; // + POX - used by the dual model quad void() SUB_regen = { - self.model = self.mdl; // restore original model - self.solid = SOLID_TRIGGER; // allow it to be touched again - sound (self, CHAN_VOICE, "items/itembk2.wav", 1, ATTN_NORM); // play respawn sound - setorigin (self, self.origin); + @self.model = @self.mdl; // restore original model + @self.solid = SOLID_TRIGGER; // allow it to be touched again + sound (@self, CHAN_VOICE, "items/itembk2.wav", 1, ATTN_NORM); // play respawn sound + setorigin (@self, @self.origin); // + POX - dual model quad... - if (self.classname == "item_artifact_super_damage") { - self.quadcore.model = self.quadcore.mdl; - setorigin (self.quadcore, self.quadcore.origin); + if (@self.classname == "item_artifact_super_damage") { + @self.quadcore.model = @self.quadcore.mdl; + setorigin (@self.quadcore, @self.quadcore.origin); } // - POX }; @@ -26,9 +26,9 @@ prints a warning message when spawned void() noclass = { dprint ("noclass spawned at"); - dprint (vtos(self.origin)); + dprint (vtos(@self.origin)); dprint ("\n"); - remove (self); + remove (@self); }; void() q_touch; void() q_touch = @@ -39,12 +39,12 @@ void() q_touch = return; if (other.health <= 0) return; - self.mdl = self.model; - sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + @self.mdl = @self.model; + sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM); stuffcmd (other, "bf\n"); - self.solid = SOLID_NOT; + @self.solid = SOLID_NOT; other.items = other.items | IT_QUAD; - self.model = string_null; + @self.model = string_null; //if (deathmatch == 4) //{ // other.armortype = 0; @@ -53,7 +53,7 @@ void() q_touch = //} // do the apropriate action other.super_time = 1; - other.super_damage_finished = self.cnt; + other.super_damage_finished = @self.cnt; s=ftos(rint(other.super_damage_finished - time)); bprint (PRINT_LOW, other.netname); //if (deathmatch == 4) @@ -71,7 +71,7 @@ void(float timeleft) DropQuad = local entity item; item = spawn (); - item.origin = self.origin; + item.origin = @self.origin; item.velocity_z = 300; item.velocity_x = -100 + (random() * 200); @@ -99,15 +99,15 @@ void() r_touch = return; if (other.health <= 0) return; - self.mdl = self.model; - sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + @self.mdl = @self.model; + sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM); stuffcmd (other, "bf\n"); - self.solid = SOLID_NOT; + @self.solid = SOLID_NOT; other.items = other.items | IT_INVISIBILITY; - self.model = string_null; + @self.model = string_null; // do the apropriate action other.invisible_time = 1; - other.invisible_finished = self.cnt; + other.invisible_finished = @self.cnt; s=ftos(rint(other.invisible_finished - time)); bprint (PRINT_LOW, other.netname); bprint (PRINT_LOW, " recovered a Ring with "); @@ -121,7 +121,7 @@ void(float timeleft) DropRing = { local entity item; item = spawn(); - item.origin = self.origin; + item.origin = @self.origin; item.velocity_z = 300; item.velocity_x = -100 + (random() * 200); @@ -147,19 +147,19 @@ plants the object on the floor void() PlaceItem = { local float oldz; - self.mdl = self.model; // so it can be restored on respawn - self.flags = FL_ITEM; // make extra wide - self.solid = SOLID_TRIGGER; - self.movetype = MOVETYPE_TOSS; - self.velocity = '0 0 0'; - self.origin_z = self.origin_z + 6; - oldz = self.origin_z; + @self.mdl = @self.model; // so it can be restored on respawn + @self.flags = FL_ITEM; // make extra wide + @self.solid = SOLID_TRIGGER; + @self.movetype = MOVETYPE_TOSS; + @self.velocity = '0 0 0'; + @self.origin_z = @self.origin_z + 6; + oldz = @self.origin_z; if (!droptofloor()) { dprint ("Bonus item fell out of level at "); - dprint (vtos(self.origin)); + dprint (vtos(@self.origin)); dprint ("\n"); - remove(self); + remove(@self); return; } }; @@ -171,8 +171,8 @@ Sets the clipping size and plants the object on the floor */ void() StartItem = { - self.nextthink = time + 0.2; // items start after other solids - self.think = PlaceItem; + @self.nextthink = time + 0.2; // items start after other solids + @self.think = PlaceItem; }; /* ========================================================================= @@ -215,40 +215,40 @@ void() item_health = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } - self.touch = health_touch; - if (self.spawnflags & H_ROTTEN) + @self.touch = health_touch; + if (@self.spawnflags & H_ROTTEN) { precache_model("maps/b_bh10.bsp"); precache_sound("items/health1.wav"); - setmodel(self, "maps/b_bh10.bsp"); - self.noise = "items/health1.wav"; - self.healamount = 15; - self.healtype = 0; + setmodel(@self, "maps/b_bh10.bsp"); + @self.noise = "items/health1.wav"; + @self.healamount = 15; + @self.healtype = 0; } else - if (self.spawnflags & H_MEGA) + if (@self.spawnflags & H_MEGA) { precache_model("maps/b_bh100.bsp"); precache_sound("items/r_item2.wav"); - setmodel(self, "maps/b_bh100.bsp"); - self.noise = "items/r_item2.wav"; - self.healamount = 100; - self.healtype = 2; + setmodel(@self, "maps/b_bh100.bsp"); + @self.noise = "items/r_item2.wav"; + @self.healamount = 100; + @self.healtype = 2; } else { precache_model("maps/b_bh25.bsp"); precache_sound("items/health1.wav"); - setmodel(self, "maps/b_bh25.bsp"); - self.noise = "items/health1.wav"; - self.healamount = 25; - self.healtype = 1; + setmodel(@self, "maps/b_bh25.bsp"); + @self.noise = "items/health1.wav"; + @self.healamount = 25; + @self.healtype = 1; } - setsize (self, '0 0 0', '32 32 56'); + setsize (@self, '0 0 0', '32 32 56'); StartItem (); }; void() health_touch = @@ -261,47 +261,47 @@ void() health_touch = if (other.classname != "player") return; - if (self.healtype == 2) // Megahealth? Ignore max_health... + if (@self.healtype == 2) // Megahealth? Ignore max_health... { if (other.health >= 250) return; - if (!T_Heal(other, self.healamount, 1)) + if (!T_Heal(other, @self.healamount, 1)) return; } else { - if (!T_Heal(other, self.healamount, 0)) + if (!T_Heal(other, @self.healamount, 0)) return; } sprint(other, PRINT_LOW, "You receive "); - s = ftos(self.healamount); + s = ftos(@self.healamount); sprint(other, PRINT_LOW, s); sprint(other, PRINT_LOW, " health\n"); // health touch sound - sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + sound(other, CHAN_ITEM, @self.noise, 1, ATTN_NORM); stuffcmd (other, "bf\n"); - self.model = string_null; - self.solid = SOLID_NOT; + @self.model = string_null; + @self.solid = SOLID_NOT; // Megahealth = rot down the player's super health - if (self.healtype == 2) + if (@self.healtype == 2) { other.items = other.items | IT_SUPERHEALTH; //if (deathmatch != 4) //{ - self.nextthink = time + 5; - self.think = item_megahealth_rot; + @self.nextthink = time + 5; + @self.think = item_megahealth_rot; //} - self.owner = other; + @self.owner = other; } else { //if (deathmatch != 2) // deathmatch 2 is the silly old rules //{ - self.nextthink = time + 20; - self.think = SUB_regen; + @self.nextthink = time + 20; + @self.think = SUB_regen; //} } @@ -310,12 +310,12 @@ void() health_touch = }; void() item_megahealth_rot = { - other = self.owner; + other = @self.owner; if (other.health > other.max_health) { other.health = other.health - 1; - self.nextthink = time + 1; + @self.nextthink = time + 1; return; } // it is possible for a player to die and respawn between rots, so don't @@ -324,8 +324,8 @@ void() item_megahealth_rot = //if (deathmatch != 2) // deathmatch 2 is silly old rules //{ - self.nextthink = time + 20; - self.think = SUB_regen; + @self.nextthink = time + 20; + @self.think = SUB_regen; //} }; /* + POX - see sheilds.qc @@ -390,11 +390,11 @@ Deathmatch weapon change rules for picking up a weapon void(float old, float new) Deathmatch_Weapon = { local float or, nr; -// change self.weapon if desired - or = RankForWeapon (self.weapon); +// change @self.weapon if desired + or = RankForWeapon (@self.weapon); nr = RankForWeapon (new); if ( nr < or ) - self.weapon = new; + @self.weapon = new; }; /* ============= @@ -417,24 +417,24 @@ void() weapon_touch = w_switch = stof(infokey(other,"w_switch")); // if the player was using his best weapon, change up to the new one if better - stemp = self; - self = other; + stemp = @self; + @self = other; best = W_BestWeapon(); - self = stemp; + @self = stemp; // POX - leave is useless in POX since weapons are never allowed to be picked up if posessed //if (deathmatch == 2 || deathmatch == 3 || deathmatch == 5) // leave = 1; //else // leave = 0; // POX - Don't bother checking if weapon is in inventory - if (other.items & self.weapon) + if (other.items & @self.weapon) { activator = other; SUB_UseTargets(); //Just in case it's required to get out of somewhere return; } // POX- changed classnames to constants - switch (self.weapon) { + switch (@self.weapon) { case IT_PLASMAGUN: hadammo = other.ammo_rockets; new = IT_PLASMAGUN; @@ -467,7 +467,7 @@ void() weapon_touch = } sprint (other, PRINT_LOW, "You got the "); - sprint (other, PRINT_LOW, self.netname); + sprint (other, PRINT_LOW, @self.netname); sprint (other, PRINT_LOW, "\n"); // weapon touch sound sound (other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM); @@ -477,14 +477,14 @@ void() weapon_touch = old = other.items; other.items = other.items | new; - stemp = self; - self = other; + stemp = @self; + @self = other; //POX - check for autoswitch if (deathmatch & DM_AUTOSWITCH) { if ( WeaponCode(new) <= w_switch ) { - if (self.flags & FL_INWATER) + if (@self.flags & FL_INWATER) { if (new != IT_LIGHTNING) { @@ -498,19 +498,19 @@ void() weapon_touch = } } else - self.weapon = new; + @self.weapon = new; W_SetCurrentAmmo(); - self = stemp; + @self = stemp; if (leave) return; //if (deathmatch!=3 || deathmatch !=5) //{ // remove it in single player, or setup for respawning in deathmatch - self.model = string_null; - self.solid = SOLID_NOT; + @self.model = string_null; + @self.solid = SOLID_NOT; //if (deathmatch != 2) - self.nextthink = time + 30; - self.think = SUB_regen; + @self.nextthink = time + 30; + @self.think = SUB_regen; //} activator = other; SUB_UseTargets(); // fire all targets / killtargets @@ -523,16 +523,16 @@ void() weapon_supershotgun = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } precache_model ("progs/g_combo.mdl"); - setmodel (self, "progs/g_combo.mdl"); - self.weapon = IT_COMBOGUN; - self.netname = "Combo Gun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); + setmodel (@self, "progs/g_combo.mdl"); + @self.weapon = IT_COMBOGUN; + @self.netname = "Combo Gun"; + @self.touch = weapon_touch; + setsize (@self, '-16 -16 0', '16 16 56'); StartItem (); }; /*QUAKED weapon_nailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -542,16 +542,16 @@ void() weapon_nailgun = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } precache_model ("progs/g_plasma.mdl"); - setmodel (self, "progs/g_plasma.mdl"); - self.weapon = IT_PLASMAGUN; - self.netname = "Plasma Gun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); + setmodel (@self, "progs/g_plasma.mdl"); + @self.weapon = IT_PLASMAGUN; + @self.netname = "Plasma Gun"; + @self.touch = weapon_touch; + setsize (@self, '-16 -16 0', '16 16 56'); StartItem (); }; /*QUAKED weapon_supernailgun (0 .5 .8) (-16 -16 0) (16 16 32) @@ -561,16 +561,16 @@ void() weapon_supernailgun = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } precache_model ("progs/g_nailg.mdl"); - setmodel (self, "progs/g_nailg.mdl"); - self.weapon = IT_SUPER_NAILGUN; - self.netname = "Nailgun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); + setmodel (@self, "progs/g_nailg.mdl"); + @self.weapon = IT_SUPER_NAILGUN; + @self.netname = "Nailgun"; + @self.touch = weapon_touch; + setsize (@self, '-16 -16 0', '16 16 56'); StartItem (); }; /*QUAKED weapon_grenadelauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -580,16 +580,16 @@ void() weapon_grenadelauncher = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } precache_model ("progs/g_gren.mdl"); - setmodel (self, "progs/g_gren.mdl"); - self.weapon = IT_GRENADE_LAUNCHER; - self.netname = "Grenade Launcher"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); + setmodel (@self, "progs/g_gren.mdl"); + @self.weapon = IT_GRENADE_LAUNCHER; + @self.netname = "Grenade Launcher"; + @self.touch = weapon_touch; + setsize (@self, '-16 -16 0', '16 16 56'); StartItem (); }; /*QUAKED weapon_rocketlauncher (0 .5 .8) (-16 -16 0) (16 16 32) @@ -599,16 +599,16 @@ void() weapon_rocketlauncher = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } precache_model ("progs/g_rhino.mdl"); - setmodel (self, "progs/g_rhino.mdl"); - self.weapon = IT_ROCKET_LAUNCHER; - self.netname = "Anihilator"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); + setmodel (@self, "progs/g_rhino.mdl"); + @self.weapon = IT_ROCKET_LAUNCHER; + @self.netname = "Anihilator"; + @self.touch = weapon_touch; + setsize (@self, '-16 -16 0', '16 16 56'); StartItem (); }; // + POX - PlasmaGun also replaces Thunderbolt in existing levels @@ -617,16 +617,16 @@ void() weapon_lightning = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } precache_model ("progs/g_plasma.mdl"); - setmodel (self, "progs/g_plasma.mdl"); - self.weapon = IT_PLASMAGUN; - self.netname = "Plasma Gun"; - self.touch = weapon_touch; - setsize (self, '-16 -16 0', '16 16 56'); + setmodel (@self, "progs/g_plasma.mdl"); + @self.weapon = IT_PLASMAGUN; + @self.netname = "Plasma Gun"; + @self.touch = weapon_touch; + setsize (@self, '-16 -16 0', '16 16 56'); StartItem (); }; /* @@ -643,45 +643,45 @@ local float best; if (other.health <= 0) return; // if the player was using his best weapon, change up to the new one if better - stemp = self; - self = other; + stemp = @self; + @self = other; best = W_BestWeapon(); - self = stemp; + @self = stemp; // shotgun - if (self.weapon == 1) + if (@self.weapon == 1) { if (other.ammo_shells >= 100) return; - other.ammo_shells = other.ammo_shells + self.aflag; + other.ammo_shells = other.ammo_shells + @self.aflag; //+ POX - switch ammo to shells for ComboGun other.which_ammo = 0; } // spikes - if (self.weapon == 2) + if (@self.weapon == 2) { if (other.ammo_nails >= 200) return; - other.ammo_nails = other.ammo_nails + self.aflag; + other.ammo_nails = other.ammo_nails + @self.aflag; } // rockets - if (self.weapon == 3) + if (@self.weapon == 3) { if (other.ammo_rockets >= 100) return; - other.ammo_rockets = other.ammo_rockets + self.aflag; + other.ammo_rockets = other.ammo_rockets + @self.aflag; } // cells - if (self.weapon == 4) + if (@self.weapon == 4) { // + POX - changed max cells to 200 if (other.ammo_cells >= 200) return; - other.ammo_cells = other.ammo_cells + self.aflag; + other.ammo_cells = other.ammo_cells + @self.aflag; } bound_other_ammo (); sprint (other, PRINT_LOW, "You got the "); - sprint (other, PRINT_LOW, self.netname); + sprint (other, PRINT_LOW, @self.netname); sprint (other, PRINT_LOW, "\n"); // ammo touch sound sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); @@ -691,27 +691,27 @@ if (deathmatch & DM_AUTOSWITCH) { if ( other.weapon == best ) { - stemp = self; - self = other; - self.weapon = W_BestWeapon(); + stemp = @self; + @self = other; + @self.weapon = W_BestWeapon(); W_SetCurrentAmmo (); - self = stemp; + @self = stemp; } } // if changed current ammo, update it - stemp = self; - self = other; + stemp = @self; + @self = other; W_SetCurrentAmmo(); - self = stemp; + @self = stemp; // remove it in single player, or setup for respawning in deathmatch - self.model = string_null; - self.solid = SOLID_NOT; + @self.model = string_null; + @self.solid = SOLID_NOT; //if (deathmatch != 2) - self.nextthink = time + 30; + @self.nextthink = time + 30; // Xian -- If playing in DM 3.0 mode, halve the time ammo respawns // if (deathmatch == 3 || deathmatch == 5) -// self.nextthink = time + 15; - self.think = SUB_regen; +// @self.nextthink = time + 15; + @self.think = SUB_regen; activator = other; SUB_UseTargets(); // fire all targets / killtargets }; @@ -726,26 +726,26 @@ void() item_shells = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } - self.touch = ammo_touch; - if (self.spawnflags & WEAPON_BIG2) + @self.touch = ammo_touch; + if (@self.spawnflags & WEAPON_BIG2) { precache_model ("maps/bspmdls/b_shell1.bsp"); - setmodel (self, "maps/bspmdls/b_shell1.bsp"); - self.aflag = 40; + setmodel (@self, "maps/bspmdls/b_shell1.bsp"); + @self.aflag = 40; } else { precache_model ("maps/bspmdls/b_shell0.bsp"); - setmodel (self, "maps/bspmdls/b_shell0.bsp"); - self.aflag = 20; + setmodel (@self, "maps/bspmdls/b_shell0.bsp"); + @self.aflag = 20; } - self.weapon = 1; - self.netname = "shells"; - setsize (self, '0 0 0', '32 32 56'); + @self.weapon = 1; + @self.netname = "shells"; + setsize (@self, '0 0 0', '32 32 56'); StartItem (); }; /*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) big @@ -758,25 +758,25 @@ void() item_spikes = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } - self.touch = ammo_touch; - if (self.spawnflags & WEAPON_BIG2) + @self.touch = ammo_touch; + if (@self.spawnflags & WEAPON_BIG2) { precache_model ("maps/bspmdls/b_nail1.bsp"); - setmodel (self, "maps/bspmdls/b_nail1.bsp"); - self.aflag = 50; + setmodel (@self, "maps/bspmdls/b_nail1.bsp"); + @self.aflag = 50; } else { precache_model ("maps/bspmdls/b_nail0.bsp"); - setmodel (self, "maps/bspmdls/b_nail0.bsp"); - self.aflag = 25; + setmodel (@self, "maps/bspmdls/b_nail0.bsp"); + @self.aflag = 25; } - self.weapon = 2; - self.netname = "nails"; - setsize (self, '0 0 0', '32 32 56'); + @self.weapon = 2; + @self.netname = "nails"; + setsize (@self, '0 0 0', '32 32 56'); StartItem (); }; /*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) big @@ -789,25 +789,25 @@ void() item_rockets = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } - self.touch = ammo_touch; - if (self.spawnflags & WEAPON_BIG2) + @self.touch = ammo_touch; + if (@self.spawnflags & WEAPON_BIG2) { precache_model ("maps/bspmdls/b_rock1.bsp"); - setmodel (self, "maps/bspmdls/b_rock1.bsp"); - self.aflag = 10; + setmodel (@self, "maps/bspmdls/b_rock1.bsp"); + @self.aflag = 10; } else { precache_model ("maps/bspmdls/b_rock0.bsp"); - setmodel (self, "maps/bspmdls/b_rock0.bsp"); - self.aflag = 5; + setmodel (@self, "maps/bspmdls/b_rock0.bsp"); + @self.aflag = 5; } - self.weapon = 3; - self.netname = "rockets"; - setsize (self, '0 0 0', '32 32 56'); + @self.weapon = 3; + @self.netname = "rockets"; + setsize (@self, '0 0 0', '32 32 56'); StartItem (); }; /*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) big @@ -820,25 +820,25 @@ void() item_cells = // + POX - no items in FFA mode if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } - self.touch = ammo_touch; - if (self.spawnflags & WEAPON_BIG2) + @self.touch = ammo_touch; + if (@self.spawnflags & WEAPON_BIG2) { precache_model ("maps/bspmdls/b_batt1.bsp"); - setmodel (self, "maps/bspmdls/b_batt1.bsp"); - self.aflag = 12; + setmodel (@self, "maps/bspmdls/b_batt1.bsp"); + @self.aflag = 12; } else { precache_model ("maps/bspmdls/b_batt0.bsp"); - setmodel (self, "maps/bspmdls/b_batt0.bsp"); - self.aflag = 6; + setmodel (@self, "maps/bspmdls/b_batt0.bsp"); + @self.aflag = 6; } - self.weapon = 4; - self.netname = "cells"; - setsize (self, '0 0 0', '32 32 56'); + @self.weapon = 4; + @self.netname = "cells"; + setsize (@self, '0 0 0', '32 32 56'); StartItem (); }; /*QUAKED item_weapon (0 .5 .8) (0 0 0) (32 32 32) shotgun rocket spikes big @@ -853,64 +853,64 @@ void() item_weapon = // + POX - no items in FFA mode (just in case, for older maps) if (deathmatch & DM_FFA) { - remove(self); + remove(@self); return; } - self.touch = ammo_touch; - if (self.spawnflags & WEAPON_SHOTGUN) + @self.touch = ammo_touch; + if (@self.spawnflags & WEAPON_SHOTGUN) { - if (self.spawnflags & WEAPON_BIG) + if (@self.spawnflags & WEAPON_BIG) { precache_model ("maps/bspmdls/b_shell1.bsp"); - setmodel (self, "maps/bspmdls/b_shell1.bsp"); - self.aflag = 40; + setmodel (@self, "maps/bspmdls/b_shell1.bsp"); + @self.aflag = 40; } else { precache_model ("maps/bspmdls/b_shell0.bsp"); - setmodel (self, "maps/bspmdls/b_shell0.bsp"); - self.aflag = 20; + setmodel (@self, "maps/bspmdls/b_shell0.bsp"); + @self.aflag = 20; } - self.weapon = 1; - self.netname = "shells"; + @self.weapon = 1; + @self.netname = "shells"; } - if (self.spawnflags & WEAPON_SPIKES) + if (@self.spawnflags & WEAPON_SPIKES) { - if (self.spawnflags & WEAPON_BIG) + if (@self.spawnflags & WEAPON_BIG) { precache_model ("maps/bspmdls/b_nail1.bsp"); - setmodel (self, "maps/bspmdls/b_nail1.bsp"); - self.aflag = 40; + setmodel (@self, "maps/bspmdls/b_nail1.bsp"); + @self.aflag = 40; } else { precache_model ("maps/bspmdls/b_nail0.bsp"); - setmodel (self, "maps/bspmdls/b_nail0.bsp"); - self.aflag = 20; + setmodel (@self, "maps/bspmdls/b_nail0.bsp"); + @self.aflag = 20; } - self.weapon = 2; - self.netname = "spikes"; + @self.weapon = 2; + @self.netname = "spikes"; } - if (self.spawnflags & WEAPON_ROCKET) + if (@self.spawnflags & WEAPON_ROCKET) { - if (self.spawnflags & WEAPON_BIG) + if (@self.spawnflags & WEAPON_BIG) { precache_model ("maps/bspmdls/b_rock1.bsp"); - setmodel (self, "maps/bspmdls/b_rock1.bsp"); - self.aflag = 10; + setmodel (@self, "maps/bspmdls/b_rock1.bsp"); + @self.aflag = 10; } else { precache_model ("maps/bspmdls/b_rock0.bsp"); - setmodel (self, "maps/bspmdls/b_rock0.bsp"); - self.aflag = 5; + setmodel (@self, "maps/bspmdls/b_rock0.bsp"); + @self.aflag = 5; } - self.weapon = 3; - self.netname = "rockets"; + @self.weapon = 3; + @self.netname = "rockets"; } - setsize (self, '0 0 0', '32 32 56'); + setsize (@self, '0 0 0', '32 32 56'); StartItem (); }; /* @@ -924,16 +924,16 @@ void() key_touch = return; if (other.health <= 0) return; - if (other.items & self.items) + if (other.items & @self.items) return; sprint (other, PRINT_LOW, "You got the "); - sprint (other, PRINT_LOW, self.netname); + sprint (other, PRINT_LOW, @self.netname); sprint (other,PRINT_LOW, "\n"); - sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + sound (other, CHAN_ITEM, @self.noise, 1, ATTN_NORM); stuffcmd (other, "bf\n"); - other.items = other.items | self.items; - self.solid = SOLID_NOT; - self.model = string_null; + other.items = other.items | @self.items; + @self.solid = SOLID_NOT; + @self.model = string_null; activator = other; SUB_UseTargets(); // fire all targets / killtargets }; @@ -942,17 +942,17 @@ void() key_setsounds = if (world.worldtype == 0) { precache_sound ("misc/medkey.wav"); - self.noise = "misc/medkey.wav"; + @self.noise = "misc/medkey.wav"; } if (world.worldtype == 1) { precache_sound ("misc/runekey.wav"); - self.noise = "misc/runekey.wav"; + @self.noise = "misc/runekey.wav"; } if (world.worldtype == 2) { precache_sound2 ("misc/basekey.wav"); - self.noise = "misc/basekey.wav"; + @self.noise = "misc/basekey.wav"; } }; /*QUAKED item_key1 (0 .5 .8) (-16 -16 -24) (16 16 32) @@ -970,25 +970,25 @@ void() item_key1 = if (world.worldtype == 0) { precache_model ("progs/w_s_key.mdl"); - setmodel (self, "progs/w_s_key.mdl"); - self.netname = "silver key"; + setmodel (@self, "progs/w_s_key.mdl"); + @self.netname = "silver key"; } else if (world.worldtype == 1) { precache_model ("progs/m_s_key.mdl"); - setmodel (self, "progs/m_s_key.mdl"); - self.netname = "silver runekey"; + setmodel (@self, "progs/m_s_key.mdl"); + @self.netname = "silver runekey"; } else if (world.worldtype == 2) { precache_model2 ("progs/b_s_key.mdl"); - setmodel (self, "progs/b_s_key.mdl"); - self.netname = "silver keycard"; + setmodel (@self, "progs/b_s_key.mdl"); + @self.netname = "silver keycard"; } key_setsounds(); - self.touch = key_touch; - self.items = IT_KEY1; - setsize (self, '-16 -16 -24', '16 16 32'); + @self.touch = key_touch; + @self.items = IT_KEY1; + setsize (@self, '-16 -16 -24', '16 16 32'); StartItem (); }; /*QUAKED item_key2 (0 .5 .8) (-16 -16 -24) (16 16 32) @@ -1006,25 +1006,25 @@ void() item_key2 = if (world.worldtype == 0) { precache_model ("progs/w_g_key.mdl"); - setmodel (self, "progs/w_g_key.mdl"); - self.netname = "gold key"; + setmodel (@self, "progs/w_g_key.mdl"); + @self.netname = "gold key"; } if (world.worldtype == 1) { precache_model ("progs/m_g_key.mdl"); - setmodel (self, "progs/m_g_key.mdl"); - self.netname = "gold runekey"; + setmodel (@self, "progs/m_g_key.mdl"); + @self.netname = "gold runekey"; } if (world.worldtype == 2) { precache_model2 ("progs/b_g_key.mdl"); - setmodel (self, "progs/b_g_key.mdl"); - self.netname = "gold keycard"; + setmodel (@self, "progs/b_g_key.mdl"); + @self.netname = "gold keycard"; } key_setsounds(); - self.touch = key_touch; - self.items = IT_KEY2; - setsize (self, '-16 -16 -24', '16 16 32'); + @self.touch = key_touch; + @self.items = IT_KEY2; + setsize (@self, '-16 -16 -24', '16 16 32'); StartItem (); }; /* @@ -1039,15 +1039,15 @@ void() sigil_touch = if (other.health <= 0) return; - self.target_id_finished = time + 4;//POX don't let TargetID override centerprints + @self.target_id_finished = time + 4;//POX don't let TargetID override centerprints centerprint (other, "You got the rune!"); - sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); + sound (other, CHAN_ITEM, @self.noise, 1, ATTN_NORM); stuffcmd (other, "bf\n"); - self.solid = SOLID_NOT; - self.model = string_null; - serverflags = serverflags | (self.spawnflags & 15); - self.classname = ""; // so rune doors won't find it + @self.solid = SOLID_NOT; + @self.model = string_null; + serverflags = serverflags | (@self.spawnflags & 15); + @self.classname = ""; // so rune doors won't find it activator = other; SUB_UseTargets(); // fire all targets / killtargets @@ -1058,27 +1058,27 @@ End of level sigil, pick up to end episode and return to jrstart. */ void() item_sigil = { - if (!self.spawnflags) + if (!@self.spawnflags) objerror ("no spawnflags"); precache_sound ("misc/runekey.wav"); - self.noise = "misc/runekey.wav"; - if (self.spawnflags & 1) { + @self.noise = "misc/runekey.wav"; + if (@self.spawnflags & 1) { precache_model ("progs/end1.mdl"); - setmodel (self, "progs/end1.mdl"); - } if (self.spawnflags & 2) { + setmodel (@self, "progs/end1.mdl"); + } if (@self.spawnflags & 2) { precache_model2 ("progs/end2.mdl"); - setmodel (self, "progs/end2.mdl"); - } if (self.spawnflags & 4) { + setmodel (@self, "progs/end2.mdl"); + } if (@self.spawnflags & 4) { precache_model2 ("progs/end3.mdl"); - setmodel (self, "progs/end3.mdl"); - } if (self.spawnflags & 8) { + setmodel (@self, "progs/end3.mdl"); + } if (@self.spawnflags & 8) { precache_model2 ("progs/end4.mdl"); - setmodel (self, "progs/end4.mdl"); + setmodel (@self, "progs/end4.mdl"); } - self.touch = sigil_touch; - setsize (self, '-16 -16 -24', '16 16 32'); + @self.touch = sigil_touch; + setsize (@self, '-16 -16 -24', '16 16 32'); StartItem (); }; /* @@ -1094,44 +1094,44 @@ void() powerup_touch = if (other.health <= 0) return; sprint (other, PRINT_LOW, "You got the "); - sprint (other,PRINT_LOW, self.netname); + sprint (other,PRINT_LOW, @self.netname); sprint (other,PRINT_LOW, "\n"); - self.mdl = self.model; + @self.mdl = @self.model; - if ((self.classname == "item_artifact_invulnerability") || - (self.classname == "item_artifact_invisibility")) - self.nextthink = time + 75; // POX - 5 minutes was way too long (not that these are in any maps) + if ((@self.classname == "item_artifact_invulnerability") || + (@self.classname == "item_artifact_invisibility")) + @self.nextthink = time + 75; // POX - 5 minutes was way too long (not that these are in any maps) else - self.nextthink = time + 60; + @self.nextthink = time + 60; - self.think = SUB_regen; - sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); + @self.think = SUB_regen; + sound (other, CHAN_VOICE, @self.noise, 1, ATTN_NORM); stuffcmd (other, "bf\n"); - self.solid = SOLID_NOT; - other.items = other.items | self.items; - self.model = string_null; + @self.solid = SOLID_NOT; + other.items = other.items | @self.items; + @self.model = string_null; // do the apropriate action - if (self.classname == "item_artifact_envirosuit") + if (@self.classname == "item_artifact_envirosuit") { other.rad_time = 1; other.radsuit_finished = time + 30; } - if (self.classname == "item_artifact_invulnerability") + if (@self.classname == "item_artifact_invulnerability") { other.invincible_time = 1; other.invincible_finished = time + 30; } - if (self.classname == "item_artifact_invisibility") + if (@self.classname == "item_artifact_invisibility") { other.invisible_time = 1; other.invisible_finished = time + 30; } - if (self.classname == "item_artifact_super_damage") + if (@self.classname == "item_artifact_super_damage") { - self.quadcore.mdl = self.quadcore.model; - self.quadcore.model = string_null; + @self.quadcore.mdl = @self.quadcore.model; + @self.quadcore.model = string_null; other.super_time = 1; other.super_damage_finished = time + 30; @@ -1146,17 +1146,17 @@ Player is invulnerable for 30 seconds */ void() item_artifact_invulnerability = { - self.touch = powerup_touch; + @self.touch = powerup_touch; precache_model ("progs/poxmegs.mdl"); precache_sound ("items/protect.wav"); precache_sound ("items/protect2.wav"); precache_sound ("items/protect3.wav"); - self.noise = "items/protect.wav"; - setmodel (self, "progs/poxmegs.mdl"); - self.netname = "MegaShields"; - self.effects = self.effects | EF_RED; - self.items = IT_INVULNERABILITY; - setsize (self, '-16 -16 -24', '16 16 32'); + @self.noise = "items/protect.wav"; + setmodel (@self, "progs/poxmegs.mdl"); + @self.netname = "MegaShields"; + @self.effects = @self.effects | EF_RED; + @self.items = IT_INVULNERABILITY; + setsize (@self, '-16 -16 -24', '16 16 32'); StartItem (); }; @@ -1165,15 +1165,15 @@ Player takes no damage from water or slime for 30 seconds */ void() item_artifact_envirosuit = { - self.touch = powerup_touch; + @self.touch = powerup_touch; precache_model ("progs/suit.mdl"); precache_sound ("items/suit.wav"); precache_sound ("items/suit2.wav"); - self.noise = "items/suit.wav"; - setmodel (self, "progs/suit.mdl"); - self.netname = "Biosuit"; - self.items = IT_SUIT; - setsize (self, '-16 -16 -24', '16 16 32'); + @self.noise = "items/suit.wav"; + setmodel (@self, "progs/suit.mdl"); + @self.netname = "Biosuit"; + @self.items = IT_SUIT; + setsize (@self, '-16 -16 -24', '16 16 32'); StartItem (); }; @@ -1184,18 +1184,18 @@ void() item_artifact_invisibility = { // + POX - Everyone's already invisible in DM_PREDATOR if (deathmatch & DM_PREDATOR) - remove(self); + remove(@self); - self.touch = powerup_touch; + @self.touch = powerup_touch; precache_model ("progs/cloak.mdl"); precache_sound ("items/inv1.wav"); precache_sound ("items/inv2.wav"); precache_sound ("items/inv3.wav"); - self.noise = "items/inv1.wav"; - setmodel (self, "progs/cloak.mdl"); - self.netname = "Cloaking Device"; - self.items = IT_INVISIBILITY; - setsize (self, '-16 -16 -24', '16 16 32'); + @self.noise = "items/inv1.wav"; + setmodel (@self, "progs/cloak.mdl"); + @self.netname = "Cloaking Device"; + @self.items = IT_INVISIBILITY; + setsize (@self, '-16 -16 -24', '16 16 32'); StartItem (); }; @@ -1205,7 +1205,7 @@ void() Spawn_QuadCore = local entity qcore; qcore = spawn (); - qcore.owner = self; + qcore.owner = @self; qcore.solid = SOLID_TRIGGER; qcore.movetype = MOVETYPE_TOSS; @@ -1213,10 +1213,10 @@ void() Spawn_QuadCore = setsize (qcore, '-16 -16 -24', '16 16 32'); qcore.velocity = '0 0 0'; - setorigin(qcore, self.origin); + setorigin(qcore, @self.origin); qcore.origin_z = qcore.origin_z + 6; - self.quadcore = qcore; + @self.quadcore = qcore; qcore.nextthink = time + 999999999; qcore.think = NIL; @@ -1227,7 +1227,7 @@ The next attack from the player will do 4x damage */ void() item_artifact_super_damage = { - self.touch = powerup_touch; + @self.touch = powerup_touch; precache_model ("progs/poxquad.mdl"); precache_model ("progs/poxquad2.mdl"); @@ -1235,12 +1235,12 @@ void() item_artifact_super_damage = precache_sound ("items/damage2.wav"); precache_sound ("items/damage3.wav"); - self.noise = "items/damage.wav"; - setmodel (self, "progs/poxquad.mdl"); - self.netname = "Quad Damage"; - self.items = IT_QUAD; - self.effects |= EF_BLUE; - setsize (self, '-16 -16 -24', '16 16 32'); + @self.noise = "items/damage.wav"; + setmodel (@self, "progs/poxquad.mdl"); + @self.netname = "Quad Damage"; + @self.items = IT_QUAD; + @self.effects |= EF_BLUE; + setsize (@self, '-16 -16 -24', '16 16 32'); Spawn_QuadCore (); @@ -1285,7 +1285,7 @@ void() BackpackTouch = else sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); stuffcmd (other, "bf\n"); - remove(self); + remove(@self); if (other.health >299) { if (other.invincible_time != 1) @@ -1306,61 +1306,61 @@ void() BackpackTouch = bprint (PRINT_HIGH, " attains bonus powers!!!\n"); } } - self = other; + @self = other; return; }*/ - if (self.items) - if ((other.items & self.items) == 0) { + if (@self.items) + if ((other.items & @self.items) == 0) { acount = 1; sprint (other, PRINT_LOW, "the "); - sprint (other, PRINT_LOW, self.netname); + sprint (other, PRINT_LOW, @self.netname); } // if the player was using his best weapon, change up to the new one if better - stemp = self; - self = other; + stemp = @self; + @self = other; best = W_BestWeapon (); - self = stemp; + @self = stemp; // change weapons - other.ammo_shells += self.ammo_shells; - other.ammo_nails += self.ammo_nails; - other.ammo_rockets += self.ammo_rockets; - other.ammo_cells += self.ammo_cells; + other.ammo_shells += @self.ammo_shells; + other.ammo_nails += @self.ammo_nails; + other.ammo_rockets += @self.ammo_rockets; + other.ammo_cells += @self.ammo_cells; - new = self.items; + new = @self.items; if (!new) new = other.weapon; old = other.items; - other.items = other.items | self.items; + other.items = other.items | @self.items; bound_other_ammo (); - if (self.ammo_shells) { + if (@self.ammo_shells) { if (acount) sprint(other, PRINT_LOW, ", "); acount = 1; - s = ftos(self.ammo_shells); + s = ftos(@self.ammo_shells); sprint (other, PRINT_LOW, s); sprint (other, PRINT_LOW, " shells"); - } if (self.ammo_nails) { + } if (@self.ammo_nails) { if (acount) sprint(other, PRINT_LOW, ", "); acount = 1; - s = ftos(self.ammo_nails); + s = ftos(@self.ammo_nails); sprint (other, PRINT_LOW, s); sprint (other, PRINT_LOW, " nails"); - } if (self.ammo_rockets) { + } if (@self.ammo_rockets) { if (acount) sprint(other, PRINT_LOW, ", "); acount = 1; - s = ftos(self.ammo_rockets); + s = ftos(@self.ammo_rockets); sprint (other, PRINT_LOW, s); sprint (other, PRINT_LOW, " rockets"); - } if (self.ammo_cells) { + } if (@self.ammo_cells) { if (acount) sprint(other, PRINT_LOW, ", "); acount = 1; - s = ftos(self.ammo_cells); + s = ftos(@self.ammo_cells); sprint (other, PRINT_LOW, s); sprint (other,PRINT_LOW, " cells"); } @@ -1369,15 +1369,15 @@ void() BackpackTouch = // other.ammo_rockets = 5; // + POX - Health in packs for FFA mode - if (self.healamount) + if (@self.healamount) { - if (!T_Heal(other, self.healamount, 0)) { + if (!T_Heal(other, @self.healamount, 0)) { SUB_Null (); } else { if (acount) sprint(other, PRINT_LOW, ", "); - s = ftos(self.healamount); + s = ftos(@self.healamount); sprint(other, PRINT_LOW, " "); sprint(other, PRINT_LOW, s); sprint(other, PRINT_LOW, " health"); @@ -1389,8 +1389,8 @@ void() BackpackTouch = // backpack touch sound sound (other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM); stuffcmd (other, "bf\n"); - remove(self); - self = other; + remove(@self); + @self = other; // change to the weapon @@ -1399,7 +1399,7 @@ if (deathmatch & DM_AUTOSWITCH) { if ( WeaponCode(new) <= b_switch ) { - if (self.flags & FL_INWATER) + if (@self.flags & FL_INWATER) { if (new != IT_LIGHTNING) { @@ -1424,14 +1424,14 @@ void() DropBackpack = local entity item; // + POX - DM_FFA check - if (!(self.ammo_shells + self.ammo_nails + self.ammo_rockets + self.ammo_cells) && !(deathmatch & DM_FFA)) + if (!(@self.ammo_shells + @self.ammo_nails + @self.ammo_rockets + @self.ammo_cells) && !(deathmatch & DM_FFA)) return; // nothing in it item = spawn(); - item.origin = self.origin - '0 0 24'; + item.origin = @self.origin - '0 0 24'; // + POX - DM_FFA (Only health in packs) if (!(deathmatch & DM_FFA)) { - item.items = self.weapon; + item.items = @self.weapon; if (item.items == IT_AXE) item.netname = "Axe"; else if (item.items == IT_TSHOT) @@ -1453,13 +1453,13 @@ void() DropBackpack = item.healtype = 1; } - item.ammo_shells = self.ammo_shells; - item.ammo_nails = self.ammo_nails; - item.ammo_rockets = self.ammo_rockets; + item.ammo_shells = @self.ammo_shells; + item.ammo_nails = @self.ammo_nails; + item.ammo_rockets = @self.ammo_rockets; // round rockets up to nearest integer incase someone died between rhino barrel fires item.ammo_rockets = rint (item.ammo_rockets); - item.ammo_cells = self.ammo_cells; + item.ammo_cells = @self.ammo_cells; item.velocity_z = 300; item.velocity_x = -100 + (random() * 200); item.velocity_y = -100 + (random() * 200); diff --git a/ParoxysmII/source/misc.r b/ParoxysmII/source/misc.r index c991c6a..2ccc6e1 100644 --- a/ParoxysmII/source/misc.r +++ b/ParoxysmII/source/misc.r @@ -7,7 +7,7 @@ Used as a positional target for spotlights, etc. */ void() info_null = { - remove(self); + remove(@self); }; /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) Used as a positional target for lightning. @@ -19,15 +19,15 @@ void() info_notnull = float START_OFF = 1; void() light_use = { - if (self.spawnflags & START_OFF) + if (@self.spawnflags & START_OFF) { - lightstyle(self.style, "m"); - self.spawnflags = self.spawnflags - START_OFF; + lightstyle(@self.style, "m"); + @self.spawnflags = @self.spawnflags - START_OFF; } else { - lightstyle(self.style, "a"); - self.spawnflags = self.spawnflags + START_OFF; + lightstyle(@self.style, "a"); + @self.spawnflags = @self.spawnflags + START_OFF; } }; /*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF @@ -41,22 +41,22 @@ void() light = // + POX - Dark Mode (dim the lights) if (deathmatch & DM_DARK) { - lightstyle(self.style, "c"); + lightstyle(@self.style, "c"); return; } - if (!self.targetname) + if (!@self.targetname) { // inert light - remove(self); + remove(@self); return; } - if (self.style >= 32) + if (@self.style >= 32) { - self.use = light_use; - if (self.spawnflags & START_OFF) - lightstyle(self.style, "a"); + @self.use = light_use; + if (@self.spawnflags & START_OFF) + lightstyle(@self.style, "a"); else - lightstyle(self.style, "m"); + lightstyle(@self.style, "m"); } }; /*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF @@ -71,21 +71,21 @@ void() light_fluoro = // + POX - Dark Mode (dim the lights) if (deathmatch & DM_DARK) { - lightstyle(self.style, "c"); + lightstyle(@self.style, "c"); return; } - if (self.style >= 32) + if (@self.style >= 32) { - self.use = light_use; - if (self.spawnflags & START_OFF) - lightstyle(self.style, "a"); + @self.use = light_use; + if (@self.spawnflags & START_OFF) + lightstyle(@self.style, "a"); else - lightstyle(self.style, "m"); + lightstyle(@self.style, "m"); } precache_sound ("ambience/fl_hum1.wav"); - ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC); }; /*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8) Non-displayed light. @@ -98,14 +98,14 @@ void() light_fluorospark = // + POX - Dark Mode (dim the lights) if (deathmatch & DM_DARK) { - lightstyle(self.style, "c"); + lightstyle(@self.style, "c"); return; } - if (!self.style) - self.style = 10; + if (!@self.style) + @self.style = 10; precache_sound ("ambience/buzz1.wav"); - ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC); }; /*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8) Sphere globe light. @@ -117,19 +117,19 @@ void() light_globe = // + POX - Dark Mode (dim the lights) if (deathmatch & DM_DARK) { - lightstyle(self.style, "c"); + lightstyle(@self.style, "c"); return; } precache_model ("progs/s_light.spr"); - setmodel (self, "progs/s_light.spr"); - makestatic (self); + setmodel (@self, "progs/s_light.spr"); + makestatic (@self); }; void() FireAmbient = { precache_sound ("ambience/fire1.wav"); // attenuate fast - ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC); }; /*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20) Short wall torch @@ -141,14 +141,14 @@ void() light_torch_small_walltorch = // + POX - Dark Mode (dim the lights) if (deathmatch & DM_DARK) { - lightstyle(self.style, "c"); + lightstyle(@self.style, "c"); return; } precache_model ("progs/flame.mdl"); - setmodel (self, "progs/flame.mdl"); + setmodel (@self, "progs/flame.mdl"); FireAmbient (); - makestatic (self); + makestatic (@self); }; /*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18) Large yellow flame ball @@ -158,15 +158,15 @@ void() light_flame_large_yellow = // + POX - Dark Mode (dim the lights) if (deathmatch & DM_DARK) { - lightstyle(self.style, "c"); + lightstyle(@self.style, "c"); return; } precache_model ("progs/flame2.mdl"); - setmodel (self, "progs/flame2.mdl"); - self.frame = 1; + setmodel (@self, "progs/flame2.mdl"); + @self.frame = 1; FireAmbient (); - makestatic (self); + makestatic (@self); }; /*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF Small yellow flame ball @@ -176,14 +176,14 @@ void() light_flame_small_yellow = // + POX - Dark Mode (dim the lights) if (deathmatch & DM_DARK) { - lightstyle(self.style, "c"); + lightstyle(@self.style, "c"); return; } precache_model ("progs/flame2.mdl"); - setmodel (self, "progs/flame2.mdl"); + setmodel (@self, "progs/flame2.mdl"); FireAmbient (); - makestatic (self); + makestatic (@self); }; /*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF Small white flame ball @@ -193,14 +193,14 @@ void() light_flame_small_white = // + POX - Dark Mode (dim the lights) if (deathmatch & DM_DARK) { - lightstyle(self.style, "c"); + lightstyle(@self.style, "c"); return; } precache_model ("progs/flame2.mdl"); - setmodel (self, "progs/flame2.mdl"); + setmodel (@self, "progs/flame2.mdl"); FireAmbient (); - makestatic (self); + makestatic (@self); }; //============================================================================ /*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8) @@ -212,11 +212,11 @@ void() misc_fireball = { precache_model ("progs/lavaball.mdl"); - self.classname = "fireball"; - self.nextthink = time + (random() * 5); - self.think = fire_fly; - if (!self.speed) - self.speed = 1000; + @self.classname = "fireball"; + @self.nextthink = time + (random() * 5); + @self.think = fire_fly; + if (!@self.speed) + @self.speed = 1000; }; void() fire_fly = { @@ -227,39 +227,39 @@ local entity fireball; fireball.velocity = '0 0 1000'; fireball.velocity_x = (random() * 100) - 50; fireball.velocity_y = (random() * 100) - 50; - fireball.velocity_z = self.speed + (random() * 200); + fireball.velocity_z = @self.speed + (random() * 200); fireball.classname = "fireball"; setmodel (fireball, "progs/lavaball.mdl"); setsize (fireball, '0 0 0', '0 0 0'); - setorigin (fireball, self.origin); + setorigin (fireball, @self.origin); fireball.nextthink = time + 5; fireball.think = SUB_Remove; fireball.touch = fire_touch; - self.nextthink = time + (random() * 5) + 3; - self.think = fire_fly; + @self.nextthink = time + (random() * 5) + 3; + @self.think = fire_fly; }; void() fire_touch = { - T_Damage (other, self, self, 20); - remove(self); + T_Damage (other, @self, @self, 20); + remove(@self); }; //============================================================================ void() barrel_explode = { - self.takedamage = DAMAGE_NO; - self.classname = "explo_box"; - // did say self.owner - T_RadiusDamage (self, self, 160, world, ""); - sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); + @self.takedamage = DAMAGE_NO; + @self.classname = "explo_box"; + // did say @self.owner + T_RadiusDamage (@self, @self, 160, world, ""); + sound (@self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z+32); - multicast (self.origin, MULTICAST_PHS); - remove (self); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z+32); + multicast (@self.origin, MULTICAST_PHS); + remove (@self); }; /*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64) TESTING THING @@ -268,27 +268,27 @@ void() misc_explobox = { local float oldz; - self.solid = SOLID_BBOX; - self.movetype = MOVETYPE_NONE; + @self.solid = SOLID_BBOX; + @self.movetype = MOVETYPE_NONE; precache_model ("maps/b_explob.bsp"); - setmodel (self, "maps/b_explob.bsp"); - setsize (self, '0 0 0', '32 32 64'); + setmodel (@self, "maps/b_explob.bsp"); + setsize (@self, '0 0 0', '32 32 64'); precache_sound ("weapons/r_exp3.wav"); - self.health = 20; - self.th_die = barrel_explode; - self.takedamage = DAMAGE_AIM; - self.origin_z = self.origin_z + 2; - oldz = self.origin_z; + @self.health = 20; + @self.th_die = barrel_explode; + @self.takedamage = DAMAGE_AIM; + @self.origin_z = @self.origin_z + 2; + oldz = @self.origin_z; droptofloor(); - if (oldz - self.origin_z > 250) + if (oldz - @self.origin_z > 250) { dprint ("item fell out of level at "); - dprint (vtos(self.origin)); + dprint (vtos(@self.origin)); dprint ("\n"); - remove(self); + remove(@self); } - self.nobleed = TRUE; + @self.nobleed = TRUE; }; /*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64) Smaller exploding box, REGISTERED ONLY @@ -297,27 +297,27 @@ void() misc_explobox2 = { local float oldz; - self.solid = SOLID_BBOX; - self.movetype = MOVETYPE_NONE; + @self.solid = SOLID_BBOX; + @self.movetype = MOVETYPE_NONE; precache_model2 ("maps/b_exbox2.bsp"); - setmodel (self, "maps/b_exbox2.bsp"); - setsize (self, '0 0 0', '32 32 32'); + setmodel (@self, "maps/b_exbox2.bsp"); + setsize (@self, '0 0 0', '32 32 32'); precache_sound ("weapons/r_exp3.wav"); - self.health = 20; - self.th_die = barrel_explode; - self.takedamage = DAMAGE_AIM; - self.origin_z = self.origin_z + 2; - oldz = self.origin_z; + @self.health = 20; + @self.th_die = barrel_explode; + @self.takedamage = DAMAGE_AIM; + @self.origin_z = @self.origin_z + 2; + oldz = @self.origin_z; droptofloor(); - if (oldz - self.origin_z > 250) + if (oldz - @self.origin_z > 250) { dprint ("item fell out of level at "); - dprint (vtos(self.origin)); + dprint (vtos(@self.origin)); dprint ("\n"); - remove(self); + remove(@self); } - self.nobleed = TRUE; + @self.nobleed = TRUE; }; //============================================================================ float SPAWNFLAG_SUPERSPIKE = 1; @@ -326,21 +326,21 @@ void() Laser_Touch = { local vector org; - if (other == self.owner) + if (other == @self.owner) return; // don't explode on owner - if (pointcontents(self.origin) == CONTENT_SKY) + if (pointcontents(@self.origin) == CONTENT_SKY) { - remove(self); + remove(@self); return; } - sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); - org = self.origin - 8*normalize(self.velocity); + sound (@self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC); + org = @self.origin - 8*normalize(@self.velocity); if (other.health) { SpawnBlood (org, 15); other.deathtype = "laser"; - T_Damage (other, self, self.owner, 15); + T_Damage (other, @self, @self.owner, 15); } else { @@ -353,18 +353,18 @@ void() Laser_Touch = multicast (org, MULTICAST_PVS); } - remove(self); + remove(@self); }; void(vector org, vector vec) LaunchLaser = { local vector v; - if (self.classname == "monster_enforcer") - sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); + if (@self.classname == "monster_enforcer") + sound (@self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); v = normalize (vec); newmis = spawn(); - newmis.owner = self; + newmis.owner = @self; newmis.movetype = MOVETYPE_FLY; newmis.solid = SOLID_BBOX; newmis.effects = EF_DIMLIGHT; @@ -379,25 +379,25 @@ void(vector org, vector vec) LaunchLaser = }; void() spikeshooter_use = { - if (self.spawnflags & SPAWNFLAG_LASER) + if (@self.spawnflags & SPAWNFLAG_LASER) { - sound (self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM); - LaunchLaser (self.origin, self.movedir); + sound (@self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM); + LaunchLaser (@self.origin, @self.movedir); } else { - sound (self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM); - launch_spike (self.origin, self.movedir); - newmis.velocity = self.movedir * 500; - if (self.spawnflags & SPAWNFLAG_SUPERSPIKE) + sound (@self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM); + launch_spike (@self.origin, @self.movedir); + newmis.velocity = @self.movedir * 500; + if (@self.spawnflags & SPAWNFLAG_SUPERSPIKE) newmis.touch = superspike_touch; } }; void() shooter_think = { spikeshooter_use (); - self.nextthink = time + self.wait; - newmis.velocity = self.movedir * 500; + @self.nextthink = time + @self.wait; + newmis.velocity = @self.movedir * 500; }; /*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser When triggered, fires a spike in the direction set in QuakeEd. @@ -406,8 +406,8 @@ Laser is only for REGISTERED. void() trap_spikeshooter = { SetMovedir (); - self.use = spikeshooter_use; - if (self.spawnflags & SPAWNFLAG_LASER) + @self.use = spikeshooter_use; + if (@self.spawnflags & SPAWNFLAG_LASER) { precache_model2 ("progs/laser.mdl"); @@ -426,10 +426,10 @@ void() trap_shooter = { trap_spikeshooter (); - if (self.wait == 0) - self.wait = 1; - self.nextthink = self.nextthink + self.wait + self.ltime; - self.think = shooter_think; + if (@self.wait == 0) + @self.wait = 1; + @self.nextthink = @self.nextthink + @self.wait + @self.ltime; + @self.think = shooter_think; }; /* =============================================================================== @@ -443,14 +443,14 @@ testing air bubbles */ void() air_bubbles = { - remove (self); + remove (@self); }; void() make_bubbles = { local entity bubble; bubble = spawn(); setmodel (bubble, "progs/s_bubble.spr"); - setorigin (bubble, self.origin); + setorigin (bubble, @self.origin); bubble.movetype = MOVETYPE_NOCLIP; bubble.solid = SOLID_NOT; bubble.velocity = '0 0 15'; @@ -461,18 +461,18 @@ local entity bubble; bubble.frame = 0; bubble.cnt = 0; setsize (bubble, '-8 -8 -8', '8 8 8'); - self.nextthink = time + random() + 0.5; - self.think = make_bubbles; + @self.nextthink = time + random() + 0.5; + @self.think = make_bubbles; }; void() bubble_split = { local entity bubble; bubble = spawn(); setmodel (bubble, "progs/s_bubble.spr"); - setorigin (bubble, self.origin); + setorigin (bubble, @self.origin); bubble.movetype = MOVETYPE_NOCLIP; bubble.solid = SOLID_NOT; - bubble.velocity = self.velocity; + bubble.velocity = @self.velocity; bubble.nextthink = time + 0.5; bubble.think = bubble_bob; bubble.touch = bubble_remove; @@ -480,41 +480,41 @@ local entity bubble; bubble.frame = 1; bubble.cnt = 10; setsize (bubble, '-8 -8 -8', '8 8 8'); - self.frame = 1; - self.cnt = 10; - if (self.waterlevel != 3) - remove (self); + @self.frame = 1; + @self.cnt = 10; + if (@self.waterlevel != 3) + remove (@self); }; void() bubble_remove = { - if (other.classname == self.classname) + if (other.classname == @self.classname) { // dprint ("bump"); return; } - remove(self); + remove(@self); }; void() bubble_bob = { local float rnd1, rnd2, rnd3; - (self.cnt)++; + (@self.cnt)++; - if (self.classname == "bubble") { - if (self.cnt == 4) + if (@self.classname == "bubble") { + if (@self.cnt == 4) bubble_split(); - if (self.cnt == 20) - remove(self); + if (@self.cnt == 20) + remove(@self); } else { - if ((self.classname != "player") && (self.classname != "bodyque") - && (self.cnt == 50)) - remove (self); + if ((@self.classname != "player") && (@self.classname != "bodyque") + && (@self.cnt == 50)) + remove (@self); } - rnd1 = self.velocity_x + (-10 + (random () * 20)); - rnd2 = self.velocity_y + (-10 + (random () * 20)); - rnd3 = self.velocity_z + (10 + (random () * 10)); + rnd1 = @self.velocity_x + (-10 + (random () * 20)); + rnd2 = @self.velocity_y + (-10 + (random () * 20)); + rnd3 = @self.velocity_z + (10 + (random () * 10)); if (rnd1 > 10) rnd1 = 5; @@ -531,23 +531,23 @@ void() bubble_bob = if (rnd3 > 30) rnd3 = 25; - self.velocity_x = rnd1; - self.velocity_y = rnd2; - self.velocity_z = rnd3; + @self.velocity_x = rnd1; + @self.velocity_y = rnd2; + @self.velocity_z = rnd3; - self.nextthink = time + 0.5; - self.think = bubble_bob; + @self.nextthink = time + 0.5; + @self.think = bubble_bob; // let some objects bob around at the surface - if (self.classname != "bubble") { // cut down on the speed + if (@self.classname != "bubble") { // cut down on the speed - self.velocity_x *= 0.5; - self.velocity_y *= 0.5; - self.velocity_z *= 0.5; + @self.velocity_x *= 0.5; + @self.velocity_y *= 0.5; + @self.velocity_z *= 0.5; // send it back down if origin clears the water - if (pointcontents (self.origin) != CONTENT_WATER) - self.velocity_z = -(self.velocity_z); + if (pointcontents (@self.origin) != CONTENT_WATER) + @self.velocity_z = -(@self.velocity_z); } }; @@ -558,10 +558,10 @@ Just for the debugging level. Don't use */ void() viewthing = { - self.movetype = MOVETYPE_NONE; - self.solid = SOLID_NOT; + @self.movetype = MOVETYPE_NONE; + @self.solid = SOLID_NOT; precache_model ("progs/player.mdl"); - setmodel (self, "progs/player.mdl"); + setmodel (@self, "progs/player.mdl"); }; /* ============================================================================== @@ -570,42 +570,42 @@ SIMPLE BMODELS */ void() func_wall_use = { // change to alternate textures - self.frame = 1 - self.frame; + @self.frame = 1 - @self.frame; }; /*QUAKED func_wall (0 .5 .8) ? This is just a solid wall if not inhibitted */ void() func_wall = { - self.angles = '0 0 0'; - self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything - self.solid = SOLID_BSP; - self.use = func_wall_use; - setmodel (self, self.model); + @self.angles = '0 0 0'; + @self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything + @self.solid = SOLID_BSP; + @self.use = func_wall_use; + setmodel (@self, @self.model); }; /*QUAKED func_illusionary (0 .5 .8) ? A simple entity that looks solid but lets you walk through it. */ void() func_illusionary = { - self.angles = '0 0 0'; - self.movetype = MOVETYPE_NONE; - self.solid = SOLID_NOT; - setmodel (self, self.model); - makestatic (self); + @self.angles = '0 0 0'; + @self.movetype = MOVETYPE_NONE; + @self.solid = SOLID_NOT; + setmodel (@self, @self.model); + makestatic (@self); }; /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 This bmodel will appear if the episode has allready been completed, so players can't reenter it. */ void() func_episodegate = { - if (!(serverflags & self.spawnflags)) + if (!(serverflags & @self.spawnflags)) return; // can still enter episode - self.angles = '0 0 0'; - self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything - self.solid = SOLID_BSP; - self.use = func_wall_use; - setmodel (self, self.model); + @self.angles = '0 0 0'; + @self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything + @self.solid = SOLID_BSP; + @self.use = func_wall_use; + setmodel (@self, @self.model); }; /*QUAKED func_bossgate (0 .5 .8) ? This bmodel appears unless players have all of the episode sigils. @@ -614,11 +614,11 @@ void() func_bossgate = { if ( (serverflags & 15) == 15) return; // all episodes completed - self.angles = '0 0 0'; - self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything - self.solid = SOLID_BSP; - self.use = func_wall_use; - setmodel (self, self.model); + @self.angles = '0 0 0'; + @self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything + @self.solid = SOLID_BSP; + @self.use = func_wall_use; + setmodel (@self, @self.model); }; //============================================================================ /*QUAKED ambient_suck_wind (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) @@ -626,75 +626,75 @@ void() func_bossgate = void() ambient_suck_wind = { precache_sound ("ambience/suck1.wav"); - ambientsound (self.origin, "ambience/suck1.wav", 1, ATTN_STATIC); + ambientsound (@self.origin, "ambience/suck1.wav", 1, ATTN_STATIC); }; /*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ void() ambient_drone = { precache_sound ("ambience/drone6.wav"); - ambientsound (self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC); }; /*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ void() ambient_flouro_buzz = { precache_sound ("ambience/buzz1.wav"); - ambientsound (self.origin, "ambience/buzz1.wav", 1, ATTN_STATIC); + ambientsound (@self.origin, "ambience/buzz1.wav", 1, ATTN_STATIC); }; /*QUAKED ambient_drip (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ void() ambient_drip = { precache_sound ("ambience/drip1.wav"); - ambientsound (self.origin, "ambience/drip1.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/drip1.wav", 0.5, ATTN_STATIC); }; /*QUAKED ambient_comp_hum (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ void() ambient_comp_hum = { precache_sound ("ambience/comp1.wav"); - ambientsound (self.origin, "ambience/comp1.wav", 1, ATTN_STATIC); + ambientsound (@self.origin, "ambience/comp1.wav", 1, ATTN_STATIC); }; /*QUAKED ambient_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ void() ambient_thunder = { precache_sound ("ambience/thunder1.wav"); - ambientsound (self.origin, "ambience/thunder1.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/thunder1.wav", 0.5, ATTN_STATIC); }; /*QUAKED ambient_light_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ void() ambient_light_buzz = { precache_sound ("ambience/fl_hum1.wav"); - ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC); }; /*QUAKED ambient_swamp1 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ void() ambient_swamp1 = { precache_sound ("ambience/swamp1.wav"); - ambientsound (self.origin, "ambience/swamp1.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/swamp1.wav", 0.5, ATTN_STATIC); }; /*QUAKED ambient_swamp2 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8) */ void() ambient_swamp2 = { precache_sound ("ambience/swamp2.wav"); - ambientsound (self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC); }; //============================================================================ void() noise_think = { - self.nextthink = time + 0.5; - sound (self, 1, "enforcer/enfire.wav", 1, ATTN_NORM); - sound (self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM); - sound (self, 3, "enforcer/sight1.wav", 1, ATTN_NORM); - sound (self, 4, "enforcer/sight2.wav", 1, ATTN_NORM); - sound (self, 5, "enforcer/sight3.wav", 1, ATTN_NORM); - sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM); - sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM); + @self.nextthink = time + 0.5; + sound (@self, 1, "enforcer/enfire.wav", 1, ATTN_NORM); + sound (@self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM); + sound (@self, 3, "enforcer/sight1.wav", 1, ATTN_NORM); + sound (@self, 4, "enforcer/sight2.wav", 1, ATTN_NORM); + sound (@self, 5, "enforcer/sight3.wav", 1, ATTN_NORM); + sound (@self, 6, "enforcer/sight4.wav", 1, ATTN_NORM); + sound (@self, 7, "enforcer/pain1.wav", 1, ATTN_NORM); }; /*QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10) For optimzation testing, starts a lot of sounds. @@ -711,6 +711,6 @@ void() misc_noisemaker = precache_sound2 ("enforcer/pain2.wav"); precache_sound2 ("enforcer/death1.wav"); precache_sound2 ("enforcer/idle1.wav"); - self.nextthink = time + 0.1 + random(); - self.think = noise_think; + @self.nextthink = time + 0.1 + random(); + @self.think = noise_think; }; diff --git a/ParoxysmII/source/observe.r b/ParoxysmII/source/observe.r index a55b5ec..9521897 100644 --- a/ParoxysmII/source/observe.r +++ b/ParoxysmII/source/observe.r @@ -18,11 +18,11 @@ void() SetObserverFOV = { local string ob_fov; - ob_fov = ftos(self.LMS_observer_fov); + ob_fov = ftos(@self.LMS_observer_fov); - stuffcmd (self, "fov "); - stuffcmd (self, ob_fov); - stuffcmd (self, "\n"); + stuffcmd (@self, "fov "); + stuffcmd (@self, ob_fov); + stuffcmd (@self, "\n"); }; //POX v1.12 - Allows observers to use teleporters /*------------------ @@ -32,7 +32,7 @@ void (string destination) ObserverTeleportTouch = { local entity t; - if (self.teleport_time > time) + if (@self.teleport_time > time) return; t = find (world, targetname, destination); @@ -40,14 +40,14 @@ void (string destination) ObserverTeleportTouch = if (!t) objerror ("couldn't find target"); - setorigin (self, t.origin); - self.angles = t.mangle; - self.fixangle = 1; // turn this way immediately - self.teleport_time = time + 1.7;//POX v1.2 increased this - if (self.flags & FL_ONGROUND) - self.flags = self.flags - FL_ONGROUND; - self.velocity = v_forward * 300; - self.flags = self.flags - self.flags & FL_ONGROUND; + setorigin (@self, t.origin); + @self.angles = t.mangle; + @self.fixangle = 1; // turn this way immediately + @self.teleport_time = time + 1.7;//POX v1.2 increased this + if (@self.flags & FL_ONGROUND) + @self.flags = @self.flags - FL_ONGROUND; + @self.velocity = v_forward * 300; + @self.flags = @self.flags - @self.flags & FL_ONGROUND; }; /*------------------ ObserverImpulses @@ -56,90 +56,90 @@ Handels observer controls void() ObserverImpulses = { //Jump to a dm start point (Fire Button) - if (self.button0) + if (@self.button0) { - self.goalentity = find(self.goalentity, classname, "info_player_deathmatch"); + @self.goalentity = find(@self.goalentity, classname, "info_player_deathmatch"); - if (self.goalentity == world) - self.goalentity = find(self.goalentity, classname, "info_player_deathmatch"); + if (@self.goalentity == world) + @self.goalentity = find(@self.goalentity, classname, "info_player_deathmatch"); - if (self.goalentity != world) + if (@self.goalentity != world) { - setorigin(self, self.goalentity.origin); - self.angles = self.goalentity.angles; - self.fixangle = TRUE; // turn this way immediately + setorigin(@self, @self.goalentity.origin); + @self.angles = @self.goalentity.angles; + @self.fixangle = TRUE; // turn this way immediately } } //Jump into a player's position (Jump Button) - if (self.button2) + if (@self.button2) { - self.goalentity = find(self.goalentity, classname, "player"); + @self.goalentity = find(@self.goalentity, classname, "player"); - if (self.goalentity == world) - self.goalentity = find(self.goalentity, classname, "player"); + if (@self.goalentity == world) + @self.goalentity = find(@self.goalentity, classname, "player"); - if (self.goalentity != world) + if (@self.goalentity != world) { - setorigin(self, self.goalentity.origin + '0 0 1'); - self.angles = self.goalentity.angles; - self.fixangle = TRUE; // turn this way immediately + setorigin(@self, @self.goalentity.origin + '0 0 1'); + @self.angles = @self.goalentity.angles; + @self.fixangle = TRUE; // turn this way immediately } } // POX v1.2 - added auto fov increase/decrease and reset impulses - if (self.impulse == 1) + if (@self.impulse == 1) { - if (self.LMS_zoom == 1) - self.LMS_zoom = FALSE; + if (@self.LMS_zoom == 1) + @self.LMS_zoom = FALSE; else - self.LMS_zoom = 1; + @self.LMS_zoom = 1; } - if (self.impulse == 2) + if (@self.impulse == 2) { - if (self.LMS_zoom == 2) - self.LMS_zoom = FALSE; + if (@self.LMS_zoom == 2) + @self.LMS_zoom = FALSE; else - self.LMS_zoom = 2; + @self.LMS_zoom = 2; } - if (self.impulse == 3) + if (@self.impulse == 3) { - self.LMS_observer_fov = 90; - self.LMS_zoom = FALSE; + @self.LMS_observer_fov = 90; + @self.LMS_zoom = FALSE; SetObserverFOV (); } //Allow TargetId to be turned off - if (self.impulse == 16) + if (@self.impulse == 16) { - if (self.target_id_toggle) + if (@self.target_id_toggle) { - self.target_id_toggle = FALSE; + @self.target_id_toggle = FALSE; //POX v1.12 - don't centerprint if a message is up - if (self.target_id_finished < time) - centerprint (self, "Target Identifier OFF\n"); + if (@self.target_id_finished < time) + centerprint (@self, "Target Identifier OFF\n"); else - sprint (self, PRINT_HIGH, "Target Identifier OFF\n"); + sprint (@self, PRINT_HIGH, "Target Identifier OFF\n"); } else { - self.target_id_toggle = TRUE; + @self.target_id_toggle = TRUE; //POX v1.12 - don't centerprint if a message is up - if (self.target_id_finished < time) - centerprint (self, "Target Identifier ON\n"); + if (@self.target_id_finished < time) + centerprint (@self, "Target Identifier ON\n"); else - sprint (self, PRINT_HIGH, "Target Identifier ON\n"); + sprint (@self, PRINT_HIGH, "Target Identifier ON\n"); - self.target_id_finished = time + 3; + @self.target_id_finished = time + 3; } } - self.impulse = 0; - self.button0 = 0; - self.button1 = 0; + @self.impulse = 0; + @self.button0 = 0; + @self.button1 = 0; }; /*------------------ ObserverThink @@ -150,22 +150,22 @@ void() ObserverThink = local entity tele; //POX v1.12 // POX v1.12 - display observer control instructions - if (self.LMS_observer_time > time) + if (@self.LMS_observer_time > time) { - if (self.LMS_observer == 1) - centerprint(self, "Last Man Standing game in progress...\n\nObserving till next round."); + if (@self.LMS_observer == 1) + centerprint(@self, "Last Man Standing game in progress...\n\nObserving till next round."); else //was eliminated - centerprint (self, "You have been eliminated!\n\nObserving till next round."); - self.target_id_finished = time + 0.1; + centerprint (@self, "You have been eliminated!\n\nObserving till next round."); + @self.target_id_finished = time + 0.1; } - else if (self.LMS_observer_time + 7 > time) + else if (@self.LMS_observer_time + 7 > time) { - centerprint(self, "[FIRE] cycles through spawn points\n\n[JUMP] cycles through players\n\n[1] [2] zooms in/out, [3] resets zoom."); - self.target_id_finished = time + 0.1; + centerprint(@self, "[FIRE] cycles through spawn points\n\n[JUMP] cycles through players\n\n[1] [2] zooms in/out, [3] resets zoom."); + @self.target_id_finished = time + 0.1; } //POX v1.12 if touching a teleporter, go through it... - tele = findradius(self.origin, 80); + tele = findradius(@self.origin, 80); while(tele) { @@ -176,30 +176,30 @@ void() ObserverThink = } //Update target identifier - if (self.target_id_toggle && (time > self.target_id_finished)) + if (@self.target_id_toggle && (time > @self.target_id_finished)) ID_CheckTarget (); //POX v1.2 - Better fov control - first impulse starts to zoom, second stops it - if (self.LMS_zoom == 1) + if (@self.LMS_zoom == 1) { - self.LMS_observer_fov = self.LMS_observer_fov - 1; + @self.LMS_observer_fov = @self.LMS_observer_fov - 1; - if (self.LMS_observer_fov < 30) + if (@self.LMS_observer_fov < 30) { - self.LMS_zoom = FALSE; - self.LMS_observer_fov = 30; + @self.LMS_zoom = FALSE; + @self.LMS_observer_fov = 30; } SetObserverFOV (); } - else if (self.LMS_zoom == 2) + else if (@self.LMS_zoom == 2) { - self.LMS_observer_fov = self.LMS_observer_fov + 1; + @self.LMS_observer_fov = @self.LMS_observer_fov + 1; - if (self.LMS_observer_fov > 135) + if (@self.LMS_observer_fov > 135) { - self.LMS_zoom = FALSE; - self.LMS_observer_fov = 135; + @self.LMS_zoom = FALSE; + @self.LMS_observer_fov = 135; } SetObserverFOV (); @@ -214,50 +214,50 @@ void() SpawnObserver = { local entity spot; - self.classname = "LMSobserver"; - self.health = 111; + @self.classname = "LMSobserver"; + @self.health = 111; - self.takedamage = DAMAGE_NO; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NOCLIP; //I think this is cheat protected.... - //self.flags = FL_CLIENT; - self.super_damage_finished = 0; - self.radsuit_finished = 0; - self.invisible_finished = 0; - self.invincible_finished = 0; - self.effects = 0; - self.invincible_time = 0; - self.items = 0; - self.ammo_shells = 0; - self.ammo_nails = 0; - self.ammo_rockets = 0; - self.ammo_cells = 0; - self.weapon = 0; - self.armorvalue = 0; - self.armortype = 0; - self.deadflag = DEAD_NO; + @self.takedamage = DAMAGE_NO; + @self.solid = SOLID_NOT; + @self.movetype = MOVETYPE_NOCLIP; //I think this is cheat protected.... + //@self.flags = FL_CLIENT; + @self.super_damage_finished = 0; + @self.radsuit_finished = 0; + @self.invisible_finished = 0; + @self.invincible_finished = 0; + @self.effects = 0; + @self.invincible_time = 0; + @self.items = 0; + @self.ammo_shells = 0; + @self.ammo_nails = 0; + @self.ammo_rockets = 0; + @self.ammo_cells = 0; + @self.weapon = 0; + @self.armorvalue = 0; + @self.armortype = 0; + @self.deadflag = DEAD_NO; spot = SelectSpawnPoint (); - self.origin = spot.origin + '0 0 1'; - self.angles = spot.angles; - self.fixangle = TRUE; // turn this way immediately - setmodel (self, string_null); - self.weaponmodel = string_null; - setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); - self.view_ofs = '0 0 22'; - self.velocity = '0 0 0'; + @self.origin = spot.origin + '0 0 1'; + @self.angles = spot.angles; + @self.fixangle = TRUE; // turn this way immediately + setmodel (@self, string_null); + @self.weaponmodel = string_null; + setsize (@self, VEC_HULL_MIN, VEC_HULL_MAX); + @self.view_ofs = '0 0 22'; + @self.velocity = '0 0 0'; //POX v1.2 - had this as '==' (worked anyway :P) - self.goalentity = world; + @self.goalentity = world; //POX v1.12 - if (self.LMS_registered) //This shouldn't happen but... + if (@self.LMS_registered) //This shouldn't happen but... { - self.LMS_registered = 0; + @self.LMS_registered = 0; lms_plrcount = lms_plrcount - 1; } - self.LMS_observer_time = time + 3; - self.LMS_observer_fov = 100; - stuffcmd (self, "fov 100\n"); - self.target_id_toggle = TRUE; //POX v1.12 default to on + @self.LMS_observer_time = time + 3; + @self.LMS_observer_fov = 100; + stuffcmd (@self, "fov 100\n"); + @self.target_id_toggle = TRUE; //POX v1.12 default to on }; diff --git a/ParoxysmII/source/plats.r b/ParoxysmII/source/plats.r index 8ebd5a1..72c9c82 100644 --- a/ParoxysmII/source/plats.r +++ b/ParoxysmII/source/plats.r @@ -20,22 +20,22 @@ void() plat_spawn_inside_trigger = trigger.touch = plat_center_touch; trigger.movetype = MOVETYPE_NONE; trigger.solid = SOLID_TRIGGER; - trigger.enemy = self; + trigger.enemy = @self; - tmin = self.mins + '25 25 0'; - tmax = self.maxs - '25 25 -8'; - tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8); - if (self.spawnflags & PLAT_LOW_TRIGGER) + tmin = @self.mins + '25 25 0'; + tmax = @self.maxs - '25 25 -8'; + tmin_z = tmax_z - (@self.pos1_z - @self.pos2_z + 8); + if (@self.spawnflags & PLAT_LOW_TRIGGER) tmax_z = tmin_z + 8; - if (self.size_x <= 50) + if (@self.size_x <= 50) { - tmin_x = (self.mins_x + self.maxs_x) / 2; + tmin_x = (@self.mins_x + @self.maxs_x) / 2; tmax_x = tmin_x + 1; } - if (self.size_y <= 50) + if (@self.size_y <= 50) { - tmin_y = (self.mins_y + self.maxs_y) / 2; + tmin_y = (@self.mins_y + @self.maxs_y) / 2; tmax_y = tmin_y + 1; } @@ -43,27 +43,27 @@ void() plat_spawn_inside_trigger = }; void() plat_hit_top = { - sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM); - self.state = STATE_TOP; - self.think = plat_go_down; - self.nextthink = self.ltime + 3; + sound (@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise1, 1, ATTN_NORM); + @self.state = STATE_TOP; + @self.think = plat_go_down; + @self.nextthink = @self.ltime + 3; }; void() plat_hit_bottom = { - sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM); - self.state = STATE_BOTTOM; + sound (@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise1, 1, ATTN_NORM); + @self.state = STATE_BOTTOM; }; void() plat_go_down = { - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - self.state = STATE_DOWN; - SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom); + sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NORM); + @self.state = STATE_DOWN; + SUB_CalcMove (@self.pos2, @self.speed, plat_hit_bottom); }; void() plat_go_up = { - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - self.state = STATE_UP; - SUB_CalcMove (self.pos1, self.speed, plat_hit_top); + sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NORM); + @self.state = STATE_UP; + SUB_CalcMove (@self.pos1, @self.speed, plat_hit_top); }; void() plat_center_touch = { @@ -72,11 +72,11 @@ void() plat_center_touch = if (other.health <= 0) return; - self = self.enemy; - if (self.state == STATE_BOTTOM) + @self = @self.enemy; + if (@self.state == STATE_BOTTOM) plat_go_up (); - else if (self.state == STATE_TOP) - self.nextthink = self.ltime + 1; // delay going down + else if (@self.state == STATE_TOP) + @self.nextthink = @self.ltime + 1; // delay going down }; void() plat_outside_touch = { @@ -86,13 +86,13 @@ void() plat_outside_touch = return; //dprint ("plat_outside_touch\n"); - self = self.enemy; - if (self.state == STATE_TOP) + @self = @self.enemy; + if (@self.state == STATE_TOP) plat_go_down (); }; void() plat_trigger_use = { - if (self.think) + if (@self.think) return; // allready activated plat_go_down(); }; @@ -100,19 +100,19 @@ void() plat_crush = { //dprint ("plat_crush\n"); other.deathtype = "squish"; - T_Damage (other, self, self, 1); + T_Damage (other, @self, @self, 1); - if (self.state == STATE_UP) + if (@self.state == STATE_UP) plat_go_down (); - else if (self.state == STATE_DOWN) + else if (@self.state == STATE_DOWN) plat_go_up (); else - objerror ("plat_crush: bad self.state\n"); + objerror ("plat_crush: bad @self.state\n"); }; void() plat_use = { - self.use = SUB_Null; - if (self.state != STATE_UP) + @self.use = SUB_Null; + if (@self.state != STATE_UP) objerror ("plat_use: not in up state"); plat_go_down(); }; @@ -127,79 +127,79 @@ Set "sounds" to one of the following: */ void() func_plat = { - if (!self.t_length) - self.t_length = 80; - if (!self.t_width) - self.t_width = 10; - if (self.sounds == 0) - self.sounds = 3;// + POX - changed from 2 + if (!@self.t_length) + @self.t_length = 80; + if (!@self.t_width) + @self.t_width = 10; + if (@self.sounds == 0) + @self.sounds = 3;// + POX - changed from 2 // FIX THIS TO LOAD A GENERIC PLAT SOUND - if (self.sounds == 1) + if (@self.sounds == 1) { precache_sound ("plats/plat1.wav"); precache_sound ("plats/plat2.wav"); - self.noise = "plats/plat1.wav"; - self.noise1 = "plats/plat2.wav"; + @self.noise = "plats/plat1.wav"; + @self.noise1 = "plats/plat2.wav"; } - if (self.sounds == 2) + if (@self.sounds == 2) { precache_sound ("plats/medplat1.wav"); precache_sound ("plats/medplat2.wav"); - self.noise = "plats/medplat1.wav"; - self.noise1 = "plats/medplat2.wav"; + @self.noise = "plats/medplat1.wav"; + @self.noise1 = "plats/medplat2.wav"; } // + POX - more sounds - if (self.sounds == 3) + if (@self.sounds == 3) { precache_sound ("doors/hydro1.wav"); precache_sound ("doors/hydro2.wav"); - self.noise = "doors/hydro1.wav"; - self.noise1 = "doors/hydro2.wav"; + @self.noise = "doors/hydro1.wav"; + @self.noise1 = "doors/hydro2.wav"; } - if (self.sounds == 4) + if (@self.sounds == 4) { precache_sound ("doors/stndr1.wav"); precache_sound ("doors/stndr2.wav"); - self.noise = "doors/stndr1.wav"; - self.noise1 = "doors/stndr2.wav"; + @self.noise = "doors/stndr1.wav"; + @self.noise1 = "doors/stndr2.wav"; } - if (self.sounds == 5) + if (@self.sounds == 5) { precache_sound ("doors/ddoor1.wav"); precache_sound ("doors/ddoor2.wav"); - self.noise = "doors/ddoor2.wav"; - self.noise1 = "doors/ddoor1.wav"; + @self.noise = "doors/ddoor2.wav"; + @self.noise1 = "doors/ddoor1.wav"; } // - POX - self.mangle = self.angles; - self.angles = '0 0 0'; - self.classname = "plat"; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - setorigin (self, self.origin); - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); - self.blocked = plat_crush; - if (!self.speed) - self.speed = 150; + @self.mangle = @self.angles; + @self.angles = '0 0 0'; + @self.classname = "plat"; + @self.solid = SOLID_BSP; + @self.movetype = MOVETYPE_PUSH; + setorigin (@self, @self.origin); + setmodel (@self, @self.model); + setsize (@self, @self.mins , @self.maxs); + @self.blocked = plat_crush; + if (!@self.speed) + @self.speed = 150; // pos1 is the top position, pos2 is the bottom - self.pos1 = self.origin; - self.pos2 = self.origin; - if (self.height) - self.pos2_z = self.origin_z - self.height; + @self.pos1 = @self.origin; + @self.pos2 = @self.origin; + if (@self.height) + @self.pos2_z = @self.origin_z - @self.height; else - self.pos2_z = self.origin_z - self.size_z + 8; - self.use = plat_trigger_use; + @self.pos2_z = @self.origin_z - @self.size_z + 8; + @self.use = plat_trigger_use; plat_spawn_inside_trigger (); // the "start moving" trigger - if (self.targetname) + if (@self.targetname) { - self.state = STATE_UP; - self.use = plat_use; + @self.state = STATE_UP; + @self.use = plat_use; } else { - setorigin (self, self.pos2); - self.state = STATE_BOTTOM; + setorigin (@self, @self.pos2); + @self.state = STATE_BOTTOM; } }; //============================================================================ @@ -207,54 +207,54 @@ void() train_next; void() func_train_find; void() train_blocked = { - if (time < self.attack_finished) + if (time < @self.attack_finished) return; - self.attack_finished = time + 0.5; + @self.attack_finished = time + 0.5; other.deathtype = "squish"; - T_Damage (other, self, self, self.dmg); + T_Damage (other, @self, @self, @self.dmg); }; void() train_use = { - if (self.think != func_train_find) + if (@self.think != func_train_find) return; // already activated train_next(); }; void() train_wait = { - if (self.wait) + if (@self.wait) { - self.nextthink = self.ltime + self.wait; - sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise, 1, ATTN_NORM); + @self.nextthink = @self.ltime + @self.wait; + sound (@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise, 1, ATTN_NORM); } else - self.nextthink = self.ltime + 0.1; + @self.nextthink = @self.ltime + 0.1; - self.think = train_next; + @self.think = train_next; }; void() train_next = { local entity targ; - targ = find (world, targetname, self.target); - self.target = targ.target; - if (!self.target) + targ = find (world, targetname, @self.target); + @self.target = targ.target; + if (!@self.target) objerror ("train_next: no next target"); if (targ.wait) - self.wait = targ.wait; + @self.wait = targ.wait; else - self.wait = 0; - sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); - SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait); + @self.wait = 0; + sound (@self, CHAN_VOICE, @self.noise1, 1, ATTN_NORM); + SUB_CalcMove (targ.origin - @self.mins, @self.speed, train_wait); }; void() func_train_find = { local entity targ; - targ = find (world, targetname, self.target); - self.target = targ.target; - setorigin (self, targ.origin - self.mins); - if (!self.targetname) + targ = find (world, targetname, @self.target); + @self.target = targ.target; + setorigin (@self, targ.origin - @self.mins); + if (!@self.targetname) { // not triggered, so start immediately - self.nextthink = self.ltime + 0.1; - self.think = train_next; + @self.nextthink = @self.ltime + 0.1; + @self.think = train_next; } }; /*QUAKED func_train (0 .5 .8) ? @@ -269,65 +269,65 @@ sounds */ void() func_train = { - if (!self.speed) - self.speed = 100; - if (!self.target) + if (!@self.speed) + @self.speed = 100; + if (!@self.target) objerror ("func_train without a target"); - if (!self.dmg) - self.dmg = 2; - if (self.sounds == 0) + if (!@self.dmg) + @self.dmg = 2; + if (@self.sounds == 0) { - self.noise = ("misc/null.wav"); + @self.noise = ("misc/null.wav"); precache_sound ("misc/null.wav"); - self.noise1 = ("misc/null.wav"); + @self.noise1 = ("misc/null.wav"); precache_sound ("misc/null.wav"); } - if (self.sounds == 1) + if (@self.sounds == 1) { - self.noise = ("plats/train2.wav"); + @self.noise = ("plats/train2.wav"); precache_sound ("plats/train2.wav"); - self.noise1 = ("plats/train1.wav"); + @self.noise1 = ("plats/train1.wav"); precache_sound ("plats/train1.wav"); } - self.cnt = 1; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - self.blocked = train_blocked; - self.use = train_use; - self.classname = "train"; - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); - setorigin (self, self.origin); + @self.cnt = 1; + @self.solid = SOLID_BSP; + @self.movetype = MOVETYPE_PUSH; + @self.blocked = train_blocked; + @self.use = train_use; + @self.classname = "train"; + setmodel (@self, @self.model); + setsize (@self, @self.mins , @self.maxs); + setorigin (@self, @self.origin); // start trains on the second frame, to make sure their targets have had // a chance to spawn - self.nextthink = self.ltime + 0.1; - self.think = func_train_find; + @self.nextthink = @self.ltime + 0.1; + @self.think = func_train_find; }; /*QUAKED misc_teleporttrain (0 .5 .8) (-8 -8 -8) (8 8 8) This is used for the final bos */ void() misc_teleporttrain = { - if (!self.speed) - self.speed = 100; - if (!self.target) + if (!@self.speed) + @self.speed = 100; + if (!@self.target) objerror ("func_train without a target"); - self.cnt = 1; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_PUSH; - self.blocked = train_blocked; - self.use = train_use; - self.avelocity = '100 200 300'; - self.noise = ("misc/null.wav"); + @self.cnt = 1; + @self.solid = SOLID_NOT; + @self.movetype = MOVETYPE_PUSH; + @self.blocked = train_blocked; + @self.use = train_use; + @self.avelocity = '100 200 300'; + @self.noise = ("misc/null.wav"); precache_sound ("misc/null.wav"); - self.noise1 = ("misc/null.wav"); + @self.noise1 = ("misc/null.wav"); precache_sound ("misc/null.wav"); precache_model2 ("progs/teleport.mdl"); - setmodel (self, "progs/teleport.mdl"); - setsize (self, self.mins , self.maxs); - setorigin (self, self.origin); + setmodel (@self, "progs/teleport.mdl"); + setsize (@self, @self.mins , @self.maxs); + setorigin (@self, @self.origin); // start trains on the second frame, to make sure their targets have had // a chance to spawn - self.nextthink = self.ltime + 0.1; - self.think = func_train_find; + @self.nextthink = @self.ltime + 0.1; + @self.think = func_train_find; }; diff --git a/ParoxysmII/source/player.r b/ParoxysmII/source/player.r index 0602d7e..121110c 100644 --- a/ParoxysmII/source/player.r +++ b/ParoxysmII/source/player.r @@ -78,70 +78,70 @@ PLAYER void() player_run; void() player_stand1 = [$axstnd1, player_stand1] { - self.weaponframe = 0; - if (self.velocity_x || self.velocity_y) { - self.walkframe = 0; + @self.weaponframe = 0; + if (@self.velocity_x || @self.velocity_y) { + @self.walkframe = 0; player_run (); return; } - if (self.weapon == IT_AXE) { - if (self.walkframe >= 12) - self.walkframe = 0; - self.frame = $axstnd1 + self.walkframe; + if (@self.weapon == IT_AXE) { + if (@self.walkframe >= 12) + @self.walkframe = 0; + @self.frame = $axstnd1 + @self.walkframe; } else { - if (self.walkframe >= 5) - self.walkframe = 0; - self.frame = $stand1 + self.walkframe; + if (@self.walkframe >= 5) + @self.walkframe = 0; + @self.frame = $stand1 + @self.walkframe; } - self.walkframe++; + @self.walkframe++; }; void() player_run = [$rockrun1, player_run] { - self.weaponframe = 0; - if (!self.velocity_x && !self.velocity_y) { - self.walkframe = 0; + @self.weaponframe = 0; + if (!@self.velocity_x && !@self.velocity_y) { + @self.walkframe = 0; player_stand1 (); return; } - if (self.weapon == IT_AXE) { - if (self.walkframe == 6) - self.walkframe = 0; - self.frame = $axrun1 + self.walkframe; + if (@self.weapon == IT_AXE) { + if (@self.walkframe == 6) + @self.walkframe = 0; + @self.frame = $axrun1 + @self.walkframe; } else { - if (self.walkframe == 6) - self.walkframe = 0; - self.frame = self.frame + self.walkframe; + if (@self.walkframe == 6) + @self.walkframe = 0; + @self.frame = @self.frame + @self.walkframe; } // footstep sounds - self.spawnsilent += vlen (self.origin - self.old_velocity); - self.old_velocity = self.origin; + @self.spawnsilent += vlen (@self.origin - @self.old_velocity); + @self.old_velocity = @self.origin; - if (self.waterlevel < 3 && self.classname == "player") { // no footsteps underwater or for observer - if (self.spawnsilent > 95) { + if (@self.waterlevel < 3 && @self.classname == "player") { // no footsteps underwater or for observer + if (@self.spawnsilent > 95) { local float r; - if (self.spawnsilent > 190) - self.spawnsilent = 0; + if (@self.spawnsilent > 190) + @self.spawnsilent = 0; else - self.spawnsilent = 0.5 * (self.spawnsilent - 95); + @self.spawnsilent = 0.5 * (@self.spawnsilent - 95); r = random (); - if (self.waterlevel) { + if (@self.waterlevel) { if (r < 0.25) - sound (self, CHAN_AUTO, "misc/water1.wav", 1, ATTN_NORM); + sound (@self, CHAN_AUTO, "misc/water1.wav", 1, ATTN_NORM); else if (r < 0.5) - sound (self, CHAN_AUTO, "misc/water2.wav", 1, ATTN_NORM); + sound (@self, CHAN_AUTO, "misc/water2.wav", 1, ATTN_NORM); else if (r < 0.75) - sound (self, CHAN_AUTO, "misc/owater2.wav", 0.75, ATTN_NORM); - } else if (self.flags & FL_ONGROUND) { + sound (@self, CHAN_AUTO, "misc/owater2.wav", 0.75, ATTN_NORM); + } else if (@self.flags & FL_ONGROUND) { local float speed, vol; - speed = vlen (self.velocity); + speed = vlen (@self.velocity); vol = speed * 0.002; // Scale footstep volume by speed if (vol > 1) vol = 1; @@ -149,244 +149,244 @@ void() player_run = [$rockrun1, player_run] return; // don't make a sound if (r < 0.25) - sound (self, CHAN_AUTO, "misc/foot1.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "misc/foot1.wav", vol, ATTN_NORM); else if (r < 0.5) - sound (self, CHAN_AUTO, "misc/foot2.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "misc/foot2.wav", vol, ATTN_NORM); else if (r < 0.75) - sound (self, CHAN_AUTO, "misc/foot3.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "misc/foot3.wav", vol, ATTN_NORM); else - sound (self, CHAN_AUTO, "misc/foot4.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "misc/foot4.wav", vol, ATTN_NORM); } } } - self.walkframe++; + @self.walkframe++; }; void () muzzleflash = { WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH); - WriteEntity (MSG_MULTICAST, self); - multicast (self.origin, MULTICAST_PVS); + WriteEntity (MSG_MULTICAST, @self); + multicast (@self.origin, MULTICAST_PVS); }; // POX - used for tShot and ComboGun primary triggers void() player_shot1 = [$shotatt1, player_shot2] { - self.weaponframe = 1; + @self.weaponframe = 1; muzzleflash (); }; -void() player_shot2 = [$shotatt2, player_shot3] {self.weaponframe = 2;}; -void() player_shot3 = [$shotatt3, player_shot4] {self.weaponframe = 3;}; -void() player_shot4 = [$shotatt4, player_shot5] {self.weaponframe = 4;}; -void() player_shot5 = [$shotatt5, player_shot6] {self.weaponframe = 5;}; -void() player_shot6 = [$shotatt6, player_run] {self.weaponframe = 6;}; +void() player_shot2 = [$shotatt2, player_shot3] {@self.weaponframe = 2;}; +void() player_shot3 = [$shotatt3, player_shot4] {@self.weaponframe = 3;}; +void() player_shot4 = [$shotatt4, player_shot5] {@self.weaponframe = 4;}; +void() player_shot5 = [$shotatt5, player_shot6] {@self.weaponframe = 5;}; +void() player_shot6 = [$shotatt6, player_run] {@self.weaponframe = 6;}; // POX - New Frame Macro For tShot 3 barrel fire -void() player_tshot1 = [$shotatt1, player_tshot2] {self.weaponframe = 1; muzzleflash();}; -void() player_tshot2 = [$shotatt2, player_tshot3] {self.weaponframe = 16;}; // triple flare frame -void() player_tshot3 = [$shotatt3, player_tshot4] {self.weaponframe = 3;}; -void() player_tshot4 = [$shotatt4, player_tshot5] {self.weaponframe = 4;}; -void() player_tshot5 = [$shotatt5, player_tshot6] {self.weaponframe = 5;}; -void() player_tshot6 = [$shotatt6, player_run] {self.weaponframe = 6;}; +void() player_tshot1 = [$shotatt1, player_tshot2] {@self.weaponframe = 1; muzzleflash();}; +void() player_tshot2 = [$shotatt2, player_tshot3] {@self.weaponframe = 16;}; // triple flare frame +void() player_tshot3 = [$shotatt3, player_tshot4] {@self.weaponframe = 3;}; +void() player_tshot4 = [$shotatt4, player_tshot5] {@self.weaponframe = 4;}; +void() player_tshot5 = [$shotatt5, player_tshot6] {@self.weaponframe = 5;}; +void() player_tshot6 = [$shotatt6, player_run] {@self.weaponframe = 6;}; // POX - New Frame Macro For tShot 3 barrel prime -void() player_reshot1 = [$shotatt1, player_reshot2] {self.weaponframe = 7;}; -void() player_reshot2 = [$shotatt3, player_reshot3] {self.weaponframe = 8;}; -void() player_reshot3 = [$shotatt4, player_reshot4] {self.weaponframe = 9;}; -void() player_reshot4 = [$shotatt5, player_reshot5] {self.weaponframe = 10;}; -void() player_reshot5 = [$shotatt6, player_reshot6] {self.weaponframe = 11;}; -void() player_reshot6 = [$shotatt5, player_reshot7] {self.weaponframe = 12;}; -void() player_reshot7 = [$shotatt4, player_reshot8] {self.weaponframe = 13;}; -void() player_reshot8 = [$shotatt3, player_reshot9] {self.weaponframe = 14;}; -void() player_reshot9 = [$shotatt1, player_run] {self.weaponframe = 15;}; +void() player_reshot1 = [$shotatt1, player_reshot2] {@self.weaponframe = 7;}; +void() player_reshot2 = [$shotatt3, player_reshot3] {@self.weaponframe = 8;}; +void() player_reshot3 = [$shotatt4, player_reshot4] {@self.weaponframe = 9;}; +void() player_reshot4 = [$shotatt5, player_reshot5] {@self.weaponframe = 10;}; +void() player_reshot5 = [$shotatt6, player_reshot6] {@self.weaponframe = 11;}; +void() player_reshot6 = [$shotatt5, player_reshot7] {@self.weaponframe = 12;}; +void() player_reshot7 = [$shotatt4, player_reshot8] {@self.weaponframe = 13;}; +void() player_reshot8 = [$shotatt3, player_reshot9] {@self.weaponframe = 14;}; +void() player_reshot9 = [$shotatt1, player_run] {@self.weaponframe = 15;}; // POX - New Frame Macro For ComboGun Second Trigger (Impact Grenades) -void() player_gshot1 = [$shotatt1, player_gshot2] {self.weaponframe = 2; muzzleflash();}; -void() player_gshot2 = [$shotatt2, player_gshot3] {self.weaponframe = 3;}; -void() player_gshot3 = [$shotatt3, player_gshot4] {self.weaponframe = 4;}; -void() player_gshot4 = [$shotatt4, player_gshot5] {self.weaponframe = 5;}; -void() player_gshot5 = [$shotatt5, player_run] {self.weaponframe = 6;}; +void() player_gshot1 = [$shotatt1, player_gshot2] {@self.weaponframe = 2; muzzleflash();}; +void() player_gshot2 = [$shotatt2, player_gshot3] {@self.weaponframe = 3;}; +void() player_gshot3 = [$shotatt3, player_gshot4] {@self.weaponframe = 4;}; +void() player_gshot4 = [$shotatt4, player_gshot5] {@self.weaponframe = 5;}; +void() player_gshot5 = [$shotatt5, player_run] {@self.weaponframe = 6;}; // POX - New Frame Macro For Nailgun Second Trigger (Shrapnel Bomb) void() player_shrap1 = [$nailatt1, player_shrap2] {muzzleflash ();}; void() player_shrap2 = [$nailatt2, player_run] {}; -void() player_axe1 = [$axatt1, player_axe2] {self.weaponframe=1;}; -void() player_axe2 = [$axatt2, player_axe3] {self.weaponframe=2;}; -void() player_axe3 = [$axatt3, player_axe4] {self.weaponframe=3;W_FireAxe();}; -void() player_axe4 = [$axatt4, player_run] {self.weaponframe=4;}; +void() player_axe1 = [$axatt1, player_axe2] {@self.weaponframe=1;}; +void() player_axe2 = [$axatt2, player_axe3] {@self.weaponframe=2;}; +void() player_axe3 = [$axatt3, player_axe4] {@self.weaponframe=3;W_FireAxe();}; +void() player_axe4 = [$axatt4, player_run] {@self.weaponframe=4;}; -void() player_axeb1 = [$axattb1, player_axeb2] {self.weaponframe=5;}; -void() player_axeb2 = [$axattb2, player_axeb3] {self.weaponframe=6;}; -void() player_axeb3 = [$axattb3, player_axeb4] {self.weaponframe=7;W_FireAxe();}; -void() player_axeb4 = [$axattb4, player_run] {self.weaponframe=8;}; +void() player_axeb1 = [$axattb1, player_axeb2] {@self.weaponframe=5;}; +void() player_axeb2 = [$axattb2, player_axeb3] {@self.weaponframe=6;}; +void() player_axeb3 = [$axattb3, player_axeb4] {@self.weaponframe=7;W_FireAxe();}; +void() player_axeb4 = [$axattb4, player_run] {@self.weaponframe=8;}; -void() player_axec1 = [$axattc1, player_axec2] {self.weaponframe=1;}; -void() player_axec2 = [$axattc2, player_axec3] {self.weaponframe=2;}; -void() player_axec3 = [$axattc3, player_axec4] {self.weaponframe=3;W_FireAxe();}; -void() player_axec4 = [$axattc4, player_run] {self.weaponframe=4;}; +void() player_axec1 = [$axattc1, player_axec2] {@self.weaponframe=1;}; +void() player_axec2 = [$axattc2, player_axec3] {@self.weaponframe=2;}; +void() player_axec3 = [$axattc3, player_axec4] {@self.weaponframe=3;W_FireAxe();}; +void() player_axec4 = [$axattc4, player_run] {@self.weaponframe=4;}; -void() player_axed1 = [$axattd1, player_axed2] {self.weaponframe=5;}; -void() player_axed2 = [$axattd2, player_axed3] {self.weaponframe=6;}; -void() player_axed3 = [$axattd3, player_axed4] {self.weaponframe=7;W_FireAxe();}; -void() player_axed4 = [$axattd4, player_run] {self.weaponframe=8;}; +void() player_axed1 = [$axattd1, player_axed2] {@self.weaponframe=5;}; +void() player_axed2 = [$axattd2, player_axed3] {@self.weaponframe=6;}; +void() player_axed3 = [$axattd3, player_axed4] {@self.weaponframe=7;W_FireAxe();}; +void() player_axed4 = [$axattd4, player_run] {@self.weaponframe=8;}; // NailGun animation void() player_nail1 = [$nailatt1, player_nail2] { - if (self.st_nailgun > time) + if (@self.st_nailgun > time) return; - if (self.ammo_nails < 1) { - sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); - self.st_nailgun = time + 0.4; + if (@self.ammo_nails < 1) { + sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); + @self.st_nailgun = time + 0.4; player_run (); return; } muzzleflash (); - if (!self.button0) { + if (!@self.button0) { player_run (); return; } - if (++self.weaponframe == 9) - self.weaponframe = 1; + if (++@self.weaponframe == 9) + @self.weaponframe = 1; SuperDamageSound (); W_FireNails (3); - if (self.flags & FL_ONGROUND) - self.velocity += v_forward * -20; + if (@self.flags & FL_ONGROUND) + @self.velocity += v_forward * -20; - self.st_nailgun = time + 0.1; + @self.st_nailgun = time + 0.1; }; void() player_nail2 = [$nailatt2, player_nail1] { - if (self.st_nailgun > time) + if (@self.st_nailgun > time) return; - if (self.ammo_nails < 1) { - sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); - self.st_nailgun = time + 0.4; + if (@self.ammo_nails < 1) { + sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); + @self.st_nailgun = time + 0.4; player_run (); return; } muzzleflash (); - if (!self.button0) { + if (!@self.button0) { player_run (); return; } - if (++self.weaponframe == 9) - self.weaponframe = 1; + if (++@self.weaponframe == 9) + @self.weaponframe = 1; SuperDamageSound(); W_FireNails (-3); - if (self.flags & FL_ONGROUND) - self.velocity += v_forward * -20; + if (@self.flags & FL_ONGROUND) + @self.velocity += v_forward * -20; - self.st_nailgun = time + 0.1; + @self.st_nailgun = time + 0.1; }; //============================================================================ // POX - PlasmaGun animation - In sync with Paroxysm v1.1 void() player_plasma1 =[$nailatt1, player_plasma2 ] { - if (self.st_plasma > time) + if (@self.st_plasma > time) return; - if (self.ammo_cells < 1) { - sound (self, CHAN_WEAPON, "weapons/mfire2.wav", 1, ATTN_NORM); + if (@self.ammo_cells < 1) { + sound (@self, CHAN_WEAPON, "weapons/mfire2.wav", 1, ATTN_NORM); player_run (); - self.st_plasma = time + 0.4; + @self.st_plasma = time + 0.4; return; } muzzleflash (); - if (!self.button0) { + if (!@self.button0) { player_run (); return; } - self.weaponframe = 1; - self.LorR = 1; + @self.weaponframe = 1; + @self.LorR = 1; SuperDamageSound (); W_FirePlasma (6); - if (self.flags & FL_ONGROUND) - self.velocity += v_forward * -20; + if (@self.flags & FL_ONGROUND) + @self.velocity += v_forward * -20; - self.st_plasma = time + 0.1; + @self.st_plasma = time + 0.1; }; void() player_plasma2 =[$nailatt2, player_plasma1 ] { - if (self.st_plasma > time) + if (@self.st_plasma > time) return; - if (self.ammo_cells < 1) { - sound (self, CHAN_WEAPON, "weapons/mfire2.wav", 1, ATTN_NORM); + if (@self.ammo_cells < 1) { + sound (@self, CHAN_WEAPON, "weapons/mfire2.wav", 1, ATTN_NORM); player_run (); - self.st_plasma = time + 0.4; + @self.st_plasma = time + 0.4; return; } muzzleflash (); - if (!self.button0) { + if (!@self.button0) { player_run (); return; } - self.weaponframe = 2; - self.LorR = 0; + @self.weaponframe = 2; + @self.LorR = 0; SuperDamageSound(); W_FirePlasma (-7); - if (self.flags & FL_ONGROUND) - self.velocity += v_forward * -20; + if (@self.flags & FL_ONGROUND) + @self.velocity += v_forward * -20; - self.st_plasma = time + 0.1; + @self.st_plasma = time + 0.1; }; //============================================================================ // POX - MegaPlasma Burst -void() player_mplasma1 =[$rockatt1, player_mplasma2 ] {self.weaponframe=0;}; +void() player_mplasma1 =[$rockatt1, player_mplasma2 ] {@self.weaponframe=0;}; void() player_mplasma2 =[$rockatt2, player_mplasma3 ] {}; void() player_mplasma3 =[$rockatt3, player_run ] {}; // POX - Grenadelauncher Animation -void() player_grenade1 =[$rockatt1, player_grenade2 ] {self.weaponframe=1;muzzleflash();}; -void() player_grenade2 =[$rockatt2, player_grenade3 ] {self.weaponframe=2;}; -void() player_grenade3 =[$rockatt3, player_grenade4 ] {self.weaponframe=3;}; -void() player_grenade4 =[$rockatt4, player_grenade5 ] {self.weaponframe=4;}; -void() player_grenade5 =[$rockatt5, player_grenade6 ] {self.weaponframe=5;}; -void() player_grenade6 =[$rockatt6, player_run ] {self.weaponframe=6;}; +void() player_grenade1 =[$rockatt1, player_grenade2 ] {@self.weaponframe=1;muzzleflash();}; +void() player_grenade2 =[$rockatt2, player_grenade3 ] {@self.weaponframe=2;}; +void() player_grenade3 =[$rockatt3, player_grenade4 ] {@self.weaponframe=3;}; +void() player_grenade4 =[$rockatt4, player_grenade5 ] {@self.weaponframe=4;}; +void() player_grenade5 =[$rockatt5, player_grenade6 ] {@self.weaponframe=5;}; +void() player_grenade6 =[$rockatt6, player_run ] {@self.weaponframe=6;}; // POX - Annihilator firing sequence void() player_rocket1 = [$rockatt1, player_rocket2] { - self.weaponframe = 1; + @self.weaponframe = 1; W_FireRocket ('0 0 16'); // sound is timed for double shot (two single shot sounds had inconsistant results) - sound (self, CHAN_WEAPON, "weapons/rhino.wav", 1, ATTN_NORM); + sound (@self, CHAN_WEAPON, "weapons/rhino.wav", 1, ATTN_NORM); - if (self.flags & FL_ONGROUND) - self.velocity = v_forward * -25; + if (@self.flags & FL_ONGROUND) + @self.velocity = v_forward * -25; - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_BIGKICK); @@ -395,19 +395,19 @@ void() player_rocket1 = [$rockatt1, player_rocket2] void() player_rocket2 = [$rockatt2, player_rocket3] { - self.weaponframe = 2; + @self.weaponframe = 2; W_FireRocket('0 0 24'); }; -void() player_rocket3 = [$rockatt3, player_run ] {self.weaponframe=3;}; +void() player_rocket3 = [$rockatt3, player_run ] {@self.weaponframe=3;}; // POX - Annihilator Reload sequence -void() player_rocketload1 = [$rockatt1, player_rocketload2] {self.weaponframe = 4;}; -void() player_rocketload2 = [$rockatt3, player_rocketload3] {self.weaponframe = 5;}; -void() player_rocketload3 = [$rockatt4, player_rocketload4] {self.weaponframe = 6;}; -void() player_rocketload4 = [$rockatt5, player_rocketload5] {self.weaponframe = 7;}; -void() player_rocketload5 = [$rockatt6, player_rocketload6] {self.weaponframe = 8;}; -void() player_rocketload6 = [$rockatt4, player_run] {self.weaponframe = 9;}; +void() player_rocketload1 = [$rockatt1, player_rocketload2] {@self.weaponframe = 4;}; +void() player_rocketload2 = [$rockatt3, player_rocketload3] {@self.weaponframe = 5;}; +void() player_rocketload3 = [$rockatt4, player_rocketload4] {@self.weaponframe = 6;}; +void() player_rocketload4 = [$rockatt5, player_rocketload5] {@self.weaponframe = 7;}; +void() player_rocketload5 = [$rockatt6, player_rocketload6] {@self.weaponframe = 8;}; +void() player_rocketload6 = [$rockatt4, player_run] {@self.weaponframe = 9;}; void (float num_bubbles) DeathBubbles; @@ -415,85 +415,85 @@ void() PainSound = { local float rs = random (); - if (self.health < 0) + if (@self.health < 0) return; if (damage_attacker.classname == "teledeath") { - sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + sound (@self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); return; } // water pain sounds - if (self.watertype == CONTENT_WATER && self.waterlevel == 3) { + if (@self.watertype == CONTENT_WATER && @self.waterlevel == 3) { DeathBubbles (1); if (rs > 0.5) - sound (self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM); else - sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM); return; } - if (self.watertype == CONTENT_SLIME) { // slime pain sounds + if (@self.watertype == CONTENT_SLIME) { // slime pain sounds // FIXME: put in some steam here if (rs > 0.5) - sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); else - sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); return; } - if (self.watertype == CONTENT_LAVA) { + if (@self.watertype == CONTENT_LAVA) { if (rs > 0.5) - sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); else - sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); return; } - if (self.pain_finished > time) { - self.axhitme = 0; + if (@self.pain_finished > time) { + @self.axhitme = 0; return; } - self.pain_finished = time + 0.5; + @self.pain_finished = time + 0.5; // don't make multiple pain sounds right after each other - if (self.axhitme == 1) { // axe pain sound - self.axhitme = 0; - sound (self, CHAN_VOICE, "player/axhit1.wav", 1, ATTN_NORM); + if (@self.axhitme == 1) { // axe pain sound + @self.axhitme = 0; + sound (@self, CHAN_VOICE, "player/axhit1.wav", 1, ATTN_NORM); return; } rs = rint ((random () * 5) + 1); - self.noise = ""; + @self.noise = ""; if (rs == 1) - self.noise = "player/pain1.wav"; + @self.noise = "player/pain1.wav"; else if (rs == 2) - self.noise = "player/pain2.wav"; + @self.noise = "player/pain2.wav"; else if (rs == 3) - self.noise = "player/pain3.wav"; + @self.noise = "player/pain3.wav"; else if (rs == 4) - self.noise = "player/pain4.wav"; + @self.noise = "player/pain4.wav"; else if (rs == 5) - self.noise = "player/pain5.wav"; + @self.noise = "player/pain5.wav"; else - self.noise = "player/pain6.wav"; + @self.noise = "player/pain6.wav"; - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NORM); return; }; -void() player_pain1 = [$pain1, player_pain2] {PainSound (); self.weaponframe = 0;}; +void() player_pain1 = [$pain1, player_pain2] {PainSound (); @self.weaponframe = 0;}; void() player_pain2 = [$pain2, player_pain3] {}; void() player_pain3 = [$pain3, player_pain4] {}; void() player_pain4 = [$pain4, player_pain5] {}; void() player_pain5 = [$pain5, player_pain6] {}; void() player_pain6 = [$pain6, player_run] {}; -void() player_axpain1 = [$axpain1, player_axpain2] {PainSound (); self.weaponframe = 0;}; +void() player_axpain1 = [$axpain1, player_axpain2] {PainSound (); @self.weaponframe = 0;}; void() player_axpain2 = [$axpain2, player_axpain3] {}; void() player_axpain3 = [$axpain3, player_axpain4] {}; void() player_axpain4 = [$axpain4, player_axpain5] {}; @@ -502,13 +502,13 @@ void() player_axpain6 = [$axpain6, player_run] {}; void() player_pain = { - if (self.weaponframe) + if (@self.weaponframe) return; - if (self.invisible_finished > time) + if (@self.invisible_finished > time) return; // eyes don't have pain frames - if (self.weapon == IT_AXE) + if (@self.weapon == IT_AXE) player_axpain1 (); else player_pain1 (); @@ -525,13 +525,13 @@ void() DeathBubblesSpawn = { local entity bubble; - if (self.owner.waterlevel != 3) + if (@self.owner.waterlevel != 3) return; bubble = spawn (); setmodel (bubble, "progs/s_bubble.spr"); - setorigin (bubble, self.owner.origin + '0 0 24'); + setorigin (bubble, @self.owner.origin + '0 0 24'); setsize (bubble, '-8 -8 -8', '8 8 8'); bubble.movetype = MOVETYPE_NOCLIP; @@ -545,11 +545,11 @@ void() DeathBubblesSpawn = bubble.nextthink = time + 0.5; bubble.think = bubble_bob; - self.think = DeathBubblesSpawn; - self.nextthink = time + 0.1; + @self.think = DeathBubblesSpawn; + @self.nextthink = time + 0.1; - if (++self.air_finished >= self.bubble_count) - remove (self); + if (++@self.air_finished >= @self.bubble_count) + remove (@self); }; void (float num_bubbles) DeathBubbles = @@ -557,9 +557,9 @@ void (float num_bubbles) DeathBubbles = local entity bubble_spawner; bubble_spawner = spawn (); - setorigin (bubble_spawner, self.origin); + setorigin (bubble_spawner, @self.origin); - bubble_spawner.owner = self; + bubble_spawner.owner = @self; bubble_spawner.air_finished = 0; bubble_spawner.bubble_count = num_bubbles; @@ -576,31 +576,31 @@ void() DeathSound = { local float rs; - if (self.waterlevel == 3) { // water death sounds + if (@self.waterlevel == 3) { // water death sounds DeathBubbles (5); - sound (self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE); + sound (@self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE); return; } rs = rint ((random() * 4) + 1); if (rs == 1) - self.noise = "player/death1.wav"; + @self.noise = "player/death1.wav"; if (rs == 2) - self.noise = "player/death2.wav"; + @self.noise = "player/death2.wav"; if (rs == 3) - self.noise = "player/death3.wav"; + @self.noise = "player/death3.wav"; if (rs == 4) - self.noise = "player/death4.wav"; + @self.noise = "player/death4.wav"; if (rs == 5) - self.noise = "player/death5.wav"; - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE); + @self.noise = "player/death5.wav"; + sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NONE); return; }; void() PlayerDead = { - self.nextthink = -1; // allow respawn after a certain time - self.deadflag = DEAD_DEAD; + @self.nextthink = -1; // allow respawn after a certain time + @self.deadflag = DEAD_DEAD; }; vector(float dm) VelocityForDamage = @@ -609,7 +609,7 @@ vector(float dm) VelocityForDamage = if (vlen (damage_inflictor.velocity) > 0) { v = 0.5 * damage_inflictor.velocity; - v += 25 * normalize (self.origin - damage_inflictor.origin); + v += 25 * normalize (@self.origin - damage_inflictor.origin); v_x += 200 * crandom (); v_y += 200 * crandom (); v_z = 100 + 240 * random(); @@ -643,14 +643,14 @@ void (string gibname, float dm) ThrowGib = local entity new; new = spawn (); - new.origin = self.origin; + new.origin = @self.origin; setmodel (new, gibname); setsize (new, '0 0 0', '0 0 0'); // wind tunnels new.solid = SOLID_TRIGGER; - if (self.waterlevel > 0) { // make gibs float in water + if (@self.waterlevel > 0) { // make gibs float in water new.classname = "gib"; new.movetype = MOVETYPE_FLY; new.velocity = '100 3 15'; @@ -677,63 +677,63 @@ void (string gibname, float dm) ThrowGib = void (string gibname, float dm) ThrowHead = { - setmodel (self, gibname); - self.frame = 0; - self.takedamage = DAMAGE_NO; + setmodel (@self, gibname); + @self.frame = 0; + @self.takedamage = DAMAGE_NO; // wind tunnels - self.solid = SOLID_TRIGGER; + @self.solid = SOLID_TRIGGER; - if (self.waterlevel > 0) { // float 'em - self.movetype = MOVETYPE_FLY; + if (@self.waterlevel > 0) { // float 'em + @self.movetype = MOVETYPE_FLY; - self.velocity = '100 3 15'; + @self.velocity = '100 3 15'; - self.think = bubble_bob; - self.nextthink = time + 0.5; - self.cnt = 0; + @self.think = bubble_bob; + @self.nextthink = time + 0.5; + @self.cnt = 0; } else { - self.movetype = MOVETYPE_BOUNCE; + @self.movetype = MOVETYPE_BOUNCE; - self.velocity = VelocityForDamage (dm); - self.avelocity = crandom () * '0 600 0'; + @self.velocity = VelocityForDamage (dm); + @self.avelocity = crandom () * '0 600 0'; - self.nextthink = -1; + @self.nextthink = -1; } - self.view_ofs = '0 0 8'; - setsize (self, '-16 -16 0', '16 16 56'); - self.origin_z -= 24; + @self.view_ofs = '0 0 8'; + setsize (@self, '-16 -16 0', '16 16 56'); + @self.origin_z -= 24; - self.flags &= ~FL_ONGROUND; + @self.flags &= ~FL_ONGROUND; }; void() GibPlayer = { // make a nice gib in Gib mode if (deathmatch & DM_GIB) - self.health -= 40; + @self.health -= 40; - ThrowHead ("progs/h_player.mdl", self.health); - ThrowGib ("progs/gib1.mdl", self.health); - ThrowGib ("progs/gib2.mdl", self.health); - ThrowGib ("progs/gib3.mdl", self.health); + ThrowHead ("progs/h_player.mdl", @self.health); + ThrowGib ("progs/gib1.mdl", @self.health); + ThrowGib ("progs/gib2.mdl", @self.health); + ThrowGib ("progs/gib3.mdl", @self.health); - self.deadflag = DEAD_DEAD; + @self.deadflag = DEAD_DEAD; if (damage_attacker.classname == "teledeath") { - sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + sound (@self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); return; } if (damage_attacker.classname == "teledeath2") { - sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); + sound (@self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE); return; } if (random () < 0.5) - sound (self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE); + sound (@self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE); else - sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE); + sound (@self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE); }; void() PlayerDie = @@ -741,14 +741,14 @@ void() PlayerDie = local float i; local string s; - self.items &= ~IT_INVISIBILITY; + @self.items &= ~IT_INVISIBILITY; if (stof (infokey (world, "dq"))) { // drop quad? - if (self.super_damage_finished > 0) { - DropQuad (self.super_damage_finished - time); - s = self.netname + if (@self.super_damage_finished > 0) { + DropQuad (@self.super_damage_finished - time); + s = @self.netname + " lost a Quad with " - + ftos (rint (self.super_damage_finished - time)) + + ftos (rint (@self.super_damage_finished - time)) + " seconds remaining!\n"; BPRINT (PRINT_MEDIUM, s); @@ -756,41 +756,41 @@ void() PlayerDie = } if (stof (infokey (world, "dc"))) { - if (self.invisible_finished > 0) { - DropRing (self.invisible_finished - time); - s = self.netname + if (@self.invisible_finished > 0) { + DropRing (@self.invisible_finished - time); + s = @self.netname + " lost a Cloaking Device with " - + ftos (rint (self.invisible_finished - time)) + + ftos (rint (@self.invisible_finished - time)) + " seconds remaining!\n"; BPRINT (PRINT_LOW, s); } } - self.invisible_finished = 0; // don't die as eyes - self.invincible_finished = 0; - self.super_damage_finished = 0; - self.radsuit_finished = 0; - self.modelindex = modelindex_player; // don't use eyes + @self.invisible_finished = 0; // don't die as eyes + @self.invincible_finished = 0; + @self.super_damage_finished = 0; + @self.radsuit_finished = 0; + @self.modelindex = modelindex_player; // don't use eyes // + POX - moved below gib check (no packs when gibbed!) //DropBackpack(); // + POX v1.11 - clear the target print so it doesn't obscure the scoreboard - if (self.target_id_toggle) - centerprint (self, ""); + if (@self.target_id_toggle) + centerprint (@self, ""); - self.weaponmodel = ""; - self.view_ofs = '0 0 -8'; - self.deadflag = DEAD_DYING; - self.solid = SOLID_NOT; - self.flags &= ~FL_ONGROUND; - self.movetype = MOVETYPE_TOSS; + @self.weaponmodel = ""; + @self.view_ofs = '0 0 -8'; + @self.deadflag = DEAD_DYING; + @self.solid = SOLID_NOT; + @self.flags &= ~FL_ONGROUND; + @self.movetype = MOVETYPE_TOSS; - if (self.velocity_z < 10) - self.velocity_z = self.velocity_z + random () * 300; + if (@self.velocity_z < 10) + @self.velocity_z = @self.velocity_z + random () * 300; // + POX check for gib mode as well as regular gib - if (self.health < -40 || (deathmatch & DM_GIB)) { + if (@self.health < -40 || (deathmatch & DM_GIB)) { GibPlayer (); return; } @@ -799,10 +799,10 @@ void() PlayerDie = DeathSound (); - self.angles_x = 0; - self.angles_z = 0; + @self.angles_x = 0; + @self.angles_z = 0; - if (self.weapon == IT_AXE) { + if (@self.weapon == IT_AXE) { player_die_ax1 (); return; } @@ -828,14 +828,14 @@ void() PlayerDie = void() set_suicide_frame = { // used by kill command and diconnect command - if (self.model != "progs/player.mdl") + if (@self.model != "progs/player.mdl") return; // allready gibbed - self.frame = $deatha11; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_TOSS; - self.deadflag = DEAD_DEAD; - self.nextthink = -1; + @self.frame = $deatha11; + @self.solid = SOLID_NOT; + @self.movetype = MOVETYPE_TOSS; + @self.deadflag = DEAD_DEAD; + @self.nextthink = -1; }; void() player_diea1 = [$deatha1, player_diea2] {}; diff --git a/ParoxysmII/source/poxdefs.r b/ParoxysmII/source/poxdefs.r index 4ae9a09..dfa0f2b 100644 --- a/ParoxysmII/source/poxdefs.r +++ b/ParoxysmII/source/poxdefs.r @@ -28,7 +28,7 @@ .float spawnsilent; .vector old_velocity; //POX v1.2 REMOVED EARTHQUAKE! (not suitable for DM) -void() func_earthquake = {remove(self);}; +void() func_earthquake = {remove(@self);}; //Water Movement .float uwmuffle; //underwater muffle sound timeout .float onwsound; //on water sound timeout diff --git a/ParoxysmII/source/sectrig.r b/ParoxysmII/source/sectrig.r index 80718dc..04ef5e5 100644 --- a/ParoxysmII/source/sectrig.r +++ b/ParoxysmII/source/sectrig.r @@ -47,7 +47,7 @@ vector() wall_velocity = { local vector vel; - vel = normalize (self.velocity); + vel = normalize (@self.velocity); vel = normalize(vel + v_up*(random()- 0.5) + v_right*(random()- 0.5)); vel = vel + 2*trace_plane_normal; vel = vel * 200; @@ -64,17 +64,17 @@ void() W_FireTShot = { local vector dir; - sound (self ,CHAN_WEAPON, "weapons/ts3fire.wav", 1, ATTN_NORM); + sound (@self ,CHAN_WEAPON, "weapons/ts3fire.wav", 1, ATTN_NORM); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_BIGKICK); //Added weapon kickback (as long as you're not in mid air) - if (self.flags & FL_ONGROUND) - self.velocity = self.velocity + v_forward* -80; + if (@self.flags & FL_ONGROUND) + @self.velocity = @self.velocity + v_forward* -80; - self.currentammo = self.ammo_shells = self.ammo_shells - 3; - dir = aim (self, 100000); + @self.currentammo = @self.ammo_shells = @self.ammo_shells - 3; + dir = aim (@self, 100000); //POX - 1.01b2 - increased spread, reduced amount //POX - 1.1 - made FireBullets2 (twice the damge, half the pellets + 1 :) FireBullets2 (12, dir, '0.16 0.1 0'); //make priming this thing worth while! @@ -88,33 +88,33 @@ void() T_MplasmaTouch = { local float damg; - if (other == self.owner) + if (other == @self.owner) return; // don't explode on owner - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; - if (pointcontents(self.origin) == CONTENT_SKY) { - remove(self); + if (pointcontents(@self.origin) == CONTENT_SKY) { + remove(@self); return; } damg = 120 + random()*20; - T_RadiusDamage (self, self.owner, damg, world, "megaplasma"); + T_RadiusDamage (@self, @self.owner, damg, world, "megaplasma"); - sound (self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM); - self.origin = self.origin - 8*normalize(self.velocity); + sound (@self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM); + @self.origin = @self.origin - 8*normalize(@self.velocity); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); - remove(self); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); + remove(@self); }; //launch_megaplasma @@ -122,26 +122,26 @@ void() launch_megaplasma = { local vector dir; - self.currentammo = self.ammo_cells = self.ammo_cells - 9; + @self.currentammo = @self.ammo_cells = @self.ammo_cells - 9; - sound (self, CHAN_WEAPON, "weapons/mplasma.wav", 1, ATTN_NORM); - msg_entity = self; + sound (@self, CHAN_WEAPON, "weapons/mplasma.wav", 1, ATTN_NORM); + msg_entity = @self; WriteByte (MSG_ONE, SVC_BIGKICK); //Added weapon kickback (as long as you're not in mid air) - if (self.flags & FL_ONGROUND) - self.velocity = self.velocity + v_forward* -270; + if (@self.flags & FL_ONGROUND) + @self.velocity = @self.velocity + v_forward* -270; newmis = spawn (); newmis.voided = 0; - newmis.owner = self; + newmis.owner = @self; newmis.movetype = MOVETYPE_FLYMISSILE; newmis.solid = SOLID_BBOX; newmis.classname = "megaplasma"; newmis.effects = newmis.effects | EF_BLUE; // set speed - dir = aim ( self, 1000 ); + dir = aim ( @self, 1000 ); newmis.velocity = dir * 0.01; newmis.avelocity = '300 300 300'; newmis.angles = vectoangles(newmis.velocity); @@ -155,7 +155,7 @@ void() launch_megaplasma = newmis.nextthink = time + 5; setmodel (newmis, "progs/plasma.mdl"); setsize (newmis, '0 0 0', '0 0 0'); - setorigin (newmis, self.origin + v_forward*12 + '0 0 12'); + setorigin (newmis, @self.origin + v_forward*12 + '0 0 12'); }; //End MegaPlasmaBurst //================================================================================= @@ -167,34 +167,34 @@ void() launch_megaplasma = void() T_PballTouch = { local float damg; - if (other == self.owner) + if (other == @self.owner) return; // don't explode on owner - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; - if (pointcontents(self.origin) == CONTENT_SKY) + if (pointcontents(@self.origin) == CONTENT_SKY) { - remove(self); + remove(@self); return; } damg = 100 + random()*20; - T_RadiusDamage (self, self.owner, damg, world, "impactgrenade"); + T_RadiusDamage (@self, @self.owner, damg, world, "impactgrenade"); -// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); - self.origin = self.origin - 8*normalize(self.velocity); +// sound (@self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + @self.origin = @self.origin - 8*normalize(@self.velocity); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); - remove(self); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); + remove(@self); }; /* ================ @@ -203,25 +203,25 @@ W_FirePball */ void() W_FirePball = { - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + @self.currentammo = @self.ammo_rockets = @self.ammo_rockets - 1; - sound (self, CHAN_AUTO, "weapons/gren2.wav", 1, ATTN_NORM); - msg_entity = self; + sound (@self, CHAN_AUTO, "weapons/gren2.wav", 1, ATTN_NORM); + msg_entity = @self; WriteByte (MSG_ONE, SVC_BIGKICK); //Added weapon kickback (as long as you're not in mid air) - if (self.flags & FL_ONGROUND) - self.velocity = self.velocity + v_forward* -150; + if (@self.flags & FL_ONGROUND) + @self.velocity = @self.velocity + v_forward* -150; newmis = spawn (); newmis.voided = 0; - newmis.owner = self; + newmis.owner = @self; newmis.movetype = MOVETYPE_TOSS; newmis.solid = SOLID_BBOX; newmis.classname = "impactgrenade"; // set newmis speed - makevectors (self.v_angle); + makevectors (@self.v_angle); newmis.velocity = v_forward*700 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; newmis.angles = vectoangles(newmis.velocity); @@ -232,7 +232,7 @@ void() W_FirePball = newmis.nextthink = time + 5; setmodel (newmis, "progs/grenade.mdl"); setsize (newmis, '0 0 0', '0 0 0'); - setorigin (newmis, self.origin + v_forward*4); + setorigin (newmis, @self.origin + v_forward*4); }; // END PumkinBall CODE @@ -248,20 +248,20 @@ void() W_FirePball = //============================================================================= void() M_DamExplode = { - if (self.voided) + if (@self.voided) return; - self.voided = 1; + @self.voided = 1; - T_RadiusDamage (self, self.owner, 95, world, "mine"); + T_RadiusDamage (@self, @self.owner, 95, world, "mine"); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); - remove (self); + remove (@self); }; /* ================ @@ -271,19 +271,19 @@ MineExplode //explode immediately! (for doors, plats and breakable objects void() MineImExplode = { - self.takedamage = DAMAGE_NO; - self.deathtype = "mine"; - self.owner = self.lastowner; + @self.takedamage = DAMAGE_NO; + @self.deathtype = "mine"; + @self.owner = @self.lastowner; M_DamExplode(); }; void() MineExplode = { - self.takedamage = DAMAGE_NO; - self.deathtype = "mine"; - self.nextthink = time + random()*0.15; //gives a more organic explosion when multiple mines explode at once - self.owner = self.lastowner; - self.think = M_DamExplode; + @self.takedamage = DAMAGE_NO; + @self.deathtype = "mine"; + @self.nextthink = time + random()*0.15; //gives a more organic explosion when multiple mines explode at once + @self.owner = @self.lastowner; + @self.think = M_DamExplode; }; /* @@ -293,56 +293,56 @@ MineTouch */ void() MineTouch = { - if (other == self) + if (other == @self) return; if (other.solid == SOLID_TRIGGER) { - sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM); + sound (@self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM); return; } if (other.classname == "grenade") { - sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); - self.nextthink = time + 1; + sound (@self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); + @self.nextthink = time + 1; return; } if (other.classname == "mine") { - sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); - self.nextthink = time + 1; + sound (@self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); + @self.nextthink = time + 1; return; } if (other.classname == "minearm") { - sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); - self.nextthink = time + 1; + sound (@self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM); + @self.nextthink = time + 1; return; } if (other.classname == "minearmed") { - sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM); - self.classname = "minearm"; - self.nextthink = time + 1; + sound (@self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM); + @self.classname = "minearm"; + @self.nextthink = time + 1; return; } if (other.classname == "player") { - sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); MineExplode(); - self.nextthink = time + 0.4; + @self.nextthink = time + 0.4; return; } if (other.takedamage == DAMAGE_AIM) { MineExplode(); - self.think(); + @self.think(); return; } - self.movetype = MOVETYPE_NONE; - self.classname = "minearm"; - self.spawnmaster = other; - self.nextthink = time + 0.1; + @self.movetype = MOVETYPE_NONE; + @self.classname = "minearm"; + @self.spawnmaster = other; + @self.nextthink = time + 0.1; }; /* ================ @@ -354,26 +354,26 @@ void() MineArm = local entity head; local float detonate; - if (self.classname == "minearm") { - sound (self, CHAN_WEAPON, "weapons/armed.wav", 1, ATTN_NORM); - setsize (self, '-3 -3 -3', '3 3 3'); - self.owner = world; - self.takedamage = DAMAGE_YES; - self.skin = 1; - self.classname = "minearmed"; + if (@self.classname == "minearm") { + sound (@self, CHAN_WEAPON, "weapons/armed.wav", 1, ATTN_NORM); + setsize (@self, '-3 -3 -3', '3 3 3'); + @self.owner = world; + @self.takedamage = DAMAGE_YES; + @self.skin = 1; + @self.classname = "minearmed"; muzzleflash(); //Will this work? } - if ((time > self.delay) || (self.spawnmaster.no_obj == TRUE)) + if ((time > @self.delay) || (@self.spawnmaster.no_obj == TRUE)) { - sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); MineImExplode(); - //self.nextthink = time + 0.4; + //@self.nextthink = time + 0.4; return; } // No click or delay when velocity triggers mine (so they don't float when doors open) // Although the 'organic' explosion' part in the detonate code might leave it hanging... - if (vlen(self.spawnmaster.velocity) > 0) + if (vlen(@self.spawnmaster.velocity) > 0) { MineImExplode(); return; @@ -382,29 +382,29 @@ void() MineArm = // Mines explode on touch, but for some reason most monsters don't detonate them (?) // So had to use a findradius function to look for monsters, it's a small radius though // Ogres still don't always detonate mines (?) - head = findradius(self.origin, 39); + head = findradius(@self.origin, 39); detonate = 0; - if (self.health < 0) + if (@self.health < 0) detonate = 1; while (head) { - if ((head != self) && (head.health > 0) && ((head.flags & (FL_CLIENT|FL_MONSTER)) || (head.classname == "bot")) && (head.classname!=self.classname)) + if ((head != @self) && (head.health > 0) && ((head.flags & (FL_CLIENT|FL_MONSTER)) || (head.classname == "bot")) && (head.classname!=@self.classname)) detonate = 1; - traceline(self.origin, head.origin, TRUE, self); + traceline(@self.origin, head.origin, TRUE, @self); if (trace_fraction != 1.0) detonate = 0; if (detonate==1) { - sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); + sound (@self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); MineExplode(); - self.nextthink = time + 0.25; + @self.nextthink = time + 0.25; return; } head = head.chain; } - self.nextthink = time + 0.1; + @self.nextthink = time + 0.1; }; /* ================ @@ -413,20 +413,20 @@ W_FireMine */ void() W_FireMine = { - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; - sound (self, CHAN_AUTO, "weapons/gren.wav", 1, ATTN_NORM); + @self.currentammo = @self.ammo_rockets = @self.ammo_rockets - 1; + sound (@self, CHAN_AUTO, "weapons/gren.wav", 1, ATTN_NORM); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_SMALLKICK); //Added weapon kickback (as long as you're not in mid air) - if (self.flags & FL_ONGROUND) - self.velocity = self.velocity + v_forward* -100; + if (@self.flags & FL_ONGROUND) + @self.velocity = @self.velocity + v_forward* -100; newmis = spawn (); newmis.voided = 0; - newmis.owner = self; - newmis.lastowner = self; + newmis.owner = @self; + newmis.lastowner = @self; newmis.movetype = MOVETYPE_TOSS; newmis.solid = SOLID_BBOX; newmis.classname = "mine"; @@ -437,11 +437,11 @@ void() W_FireMine = newmis.nobleed = TRUE; // set missile speed - makevectors (self.v_angle); - if (self.v_angle_x) { + makevectors (@self.v_angle); + if (@self.v_angle_x) { newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; } else { - newmis.velocity = aim(self, 10000); + newmis.velocity = aim(@self, 10000); newmis.velocity = newmis.velocity * 600; newmis.velocity_z = 200; } @@ -457,7 +457,7 @@ void() W_FireMine = newmis.th_die = MineExplode; setmodel (newmis, "progs/grenade.mdl"); - setorigin (newmis, self.origin + v_forward*4); + setorigin (newmis, @self.origin + v_forward*4); setsize (newmis, '-1 -1 -1', '0 0 0'); }; // END MINE CODE @@ -474,15 +474,15 @@ void() W_FireMine = //These functions launch a single spike in a random direction void() spikenal_touch = { - if (pointcontents(self.origin) == CONTENT_SKY) { - remove(self); + if (pointcontents(@self.origin) == CONTENT_SKY) { + remove(@self); return; } - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing @@ -491,18 +491,18 @@ void() spikenal_touch = if (other.takedamage) { spawn_touchblood (12); other.deathtype = "shrapnel"; - T_Damage (other, self, self.owner, 12); - remove(self); + T_Damage (other, @self, @self.owner, 12); + remove(@self); } else if (random() > 0.9) { WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); - remove(self); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); + remove(@self); } }; @@ -527,7 +527,7 @@ void(vector org) launch_shrapnel = newmis = spawn (); newmis.voided = 0; - newmis.owner = self.owner; + newmis.owner = @self.owner; newmis.movetype = MOVETYPE_BOUNCE; newmis.solid = SOLID_BBOX; @@ -554,68 +554,68 @@ void() ShrapnelExplode = local vector direction; - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; // Toss the nails (this function is with the spike stuff since it uses the same touch) for (i = 0; i < 10; i++) - launch_shrapnel(self.origin); + launch_shrapnel(@self.origin); for (i = 0; i < 60; i++) { // Toss some spikes direction_x = (4096 * random ()) - 2048; direction_y = (4096 * random ()) - 2048; direction_z = (4096 * random ()) - 2048; - launch_spike (self.origin, direction); - newmis.owner = self.owner; + launch_spike (@self.origin, direction); + newmis.owner = @self.owner; }; - T_RadiusDamage (self, self.owner, 160, world, "shrapnel"); + T_RadiusDamage (@self, @self.owner, 160, world, "shrapnel"); - if (self.owner != world) - self.owner.shrap_detonate = FALSE; // Enable next launch + if (@self.owner != world) + @self.owner.shrap_detonate = FALSE; // Enable next launch WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); - remove (self); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); + remove (@self); }; void() ShrapnelDetonate = { - sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); - self.think = ShrapnelExplode; - self.nextthink = time + 0.1; + sound (@self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM); + @self.think = ShrapnelExplode; + @self.nextthink = time + 0.1; }; // Wait for a detonation impulse or time up void() ShrapnelThink = { - if (self.shrap_time < time) + if (@self.shrap_time < time) ShrapnelDetonate(); - if (self.owner == world) + if (@self.owner == world) return; // Owner died so change to world and wait for detonate - if (self.owner.health <= 0) { - self.owner.shrap_detonate = FALSE;//Enable next launch - self.owner = world; - self.nextthink = self.shrap_time; - self.think = ShrapnelDetonate; + if (@self.owner.health <= 0) { + @self.owner.shrap_detonate = FALSE;//Enable next launch + @self.owner = world; + @self.nextthink = @self.shrap_time; + @self.think = ShrapnelDetonate; return; } - if (self.owner.shrap_detonate == 2) + if (@self.owner.shrap_detonate == 2) ShrapnelDetonate(); else - self.nextthink = time + 0.1; + @self.nextthink = time + 0.1; }; @@ -625,7 +625,7 @@ void() ShrapnelTouch = r = random(); - if (other == self.owner) + if (other == @self.owner) return; // don't explode on owner if (other.takedamage == DAMAGE_AIM) @@ -636,12 +636,12 @@ void() ShrapnelTouch = //pick a bounce sound if (r < 0.75) - sound (self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); else - sound (self, CHAN_VOICE, "weapons/bounce2.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "weapons/bounce2.wav", 1, ATTN_NORM); - if (self.velocity == '0 0 0') - self.avelocity = '0 0 0'; + if (@self.velocity == '0 0 0') + @self.avelocity = '0 0 0'; }; // End shrapnel bomb @@ -654,19 +654,19 @@ W_FireShrapnel */ void() W_FireShrapnel = { - self.ammo_rockets = self.ammo_rockets - 1; - self.currentammo = self.ammo_nails = self.ammo_nails - 30; - sound (self, CHAN_WEAPON, "weapons/gren2.wav", 1, ATTN_NORM); + @self.ammo_rockets = @self.ammo_rockets - 1; + @self.currentammo = @self.ammo_nails = @self.ammo_nails - 30; + sound (@self, CHAN_WEAPON, "weapons/gren2.wav", 1, ATTN_NORM); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_SMALLKICK); //Added weapon kickback (as long as you're not in mid air) - if (self.flags & FL_ONGROUND) - self.velocity = self.velocity + v_forward* -115; + if (@self.flags & FL_ONGROUND) + @self.velocity = @self.velocity + v_forward* -115; newmis = spawn (); newmis.voided = 0; - newmis.owner = self; + newmis.owner = @self; newmis.movetype = MOVETYPE_BOUNCE; newmis.solid = SOLID_BBOX; newmis.classname = "shrapnel"; @@ -674,11 +674,11 @@ void() W_FireShrapnel = newmis.shrap_time = time + 120; // set newmis speed - makevectors (self.v_angle); - if (self.v_angle_x) { + makevectors (@self.v_angle); + if (@self.v_angle_x) { newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; } else { - newmis.velocity = aim(self, 10000); + newmis.velocity = aim(@self, 10000); newmis.velocity = newmis.velocity * 600; newmis.velocity_z = 200; } @@ -692,7 +692,7 @@ void() W_FireShrapnel = setmodel (newmis, "progs/grenade.mdl"); newmis.skin = 2; setsize (newmis, '0 0 0', '0 0 0'); - setorigin (newmis, self.origin); + setorigin (newmis, @self.origin); }; /* ============ @@ -704,114 +704,114 @@ POX v1.1 - seperated this from weapons.qc - cleaned it up a bit void() W_SecondTrigger = { if (intermission_running) { // Don't fire during intermission - self.impulse = 0; + @self.impulse = 0; return; } - switch (self.weapon) { + switch (@self.weapon) { case IT_TSHOT: // T-Shot (prime) // do it only if it hasn't already been primed and has 3 or more shells - if ((!self.prime_tshot) && (self.ammo_shells >= 3)) { - self.st_tshotload = time + 0.9; //give the reload a chance to happen + if ((!@self.prime_tshot) && (@self.ammo_shells >= 3)) { + @self.st_tshotload = time + 0.9; //give the reload a chance to happen // make a reload sound - sound (self, CHAN_WEAPON, "weapons/tsload.wav", 1, ATTN_NORM); + sound (@self, CHAN_WEAPON, "weapons/tsload.wav", 1, ATTN_NORM); player_reshot1(); // play prime animation - self.prime_tshot = TRUE; // set the prime bit + @self.prime_tshot = TRUE; // set the prime bit } break; case IT_COMBOGUN: // impact grenade - if (self.ammo_rockets > 0) { // check for rockets - if (self.st_pball < time) { - self.items &= ~IT_SHELLS; - self.items |= IT_ROCKETS; - self.currentammo = self.ammo_rockets; - self.which_ammo = 1; + if (@self.ammo_rockets > 0) { // check for rockets + if (@self.st_pball < time) { + @self.items &= ~IT_SHELLS; + @self.items |= IT_ROCKETS; + @self.currentammo = @self.ammo_rockets; + @self.which_ammo = 1; player_gshot1(); SuperDamageSound(); W_FirePball(); - self.st_pball = time + 0.9; + @self.st_pball = time + 0.9; } else { // misfire if it hasn't been long enough - sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); + sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); } } else { - self.items &= ~IT_SHELLS; - self.items |= IT_ROCKETS; - self.currentammo = self.ammo_rockets; - self.which_ammo = 1; - sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); + @self.items &= ~IT_SHELLS; + @self.items |= IT_ROCKETS; + @self.currentammo = @self.ammo_rockets; + @self.which_ammo = 1; + sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); } break; case IT_PLASMAGUN: // plasma burst - if (self.ammo_cells >= 9 && self.st_mplasma < time) { // check for cells and time - if (self.waterlevel > 1) { // explode under water - sound (self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM); - self.ammo_cells = 0; + if (@self.ammo_cells >= 9 && @self.st_mplasma < time) { // check for cells and time + if (@self.waterlevel > 1) { // explode under water + sound (@self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM); + @self.ammo_cells = 0; W_SetCurrentAmmo (); - T_RadiusDamage (self, self, 250, world, "waterplasma"); + T_RadiusDamage (@self, @self, 250, world, "waterplasma"); break; } - self.weaponframe = 0; + @self.weaponframe = 0; SuperDamageSound (); - self.st_mplasma = time + 1.9; + @self.st_mplasma = time + 1.9; player_mplasma1 (); launch_megaplasma (); break; } - sound (self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM); + sound (@self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM); break; case IT_SUPER_NAILGUN: // shrapnel bomb - if (self.shrap_detonate) { // bomb is already set - sound (self, CHAN_WEAPON, "weapons/shrapdet.wav", 1, ATTN_NORM); + if (@self.shrap_detonate) { // bomb is already set + sound (@self, CHAN_WEAPON, "weapons/shrapdet.wav", 1, ATTN_NORM); SuperDamageSound (); - self.st_shrapnel = time + 0.7; // Time out before next launch - self.shrap_detonate = 2; // Tell the bomb to blow! + @self.st_shrapnel = time + 0.7; // Time out before next launch + @self.shrap_detonate = 2; // Tell the bomb to blow! break; } - if (self.ammo_nails >= 30 && self.ammo_rockets > 0) { // toss one - self.weaponframe = 0; + if (@self.ammo_nails >= 30 && @self.ammo_rockets > 0) { // toss one + @self.weaponframe = 0; SuperDamageSound (); - self.st_shrapnel = time + 0.1; // Allow a fast detonate + @self.st_shrapnel = time + 0.1; // Allow a fast detonate player_shrap1 (); W_FireShrapnel (); - self.shrap_detonate = TRUE; + @self.shrap_detonate = TRUE; break; } - sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); - sprint (self, PRINT_HIGH, "Not enough ammo...\n"); + sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); + sprint (@self, PRINT_HIGH, "Not enough ammo...\n"); break; case IT_GRENADE_LAUNCHER: // phase mine - if (self.ammo_rockets >= 1 && self.st_mine < time) { + if (@self.ammo_rockets >= 1 && @self.st_mine < time) { player_grenade1 (); W_FireMine (); // big delay between refires helps keep the # of mines down in a deathmatch game - self.st_mine = time + 1.25; + @self.st_mine = time + 1.25; break; } - sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); + sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM); break; case IT_ROCKET_LAUNCHER: // reload the rhino - if (self.reload_rocket && self.ammo_rockets >= 1) { - self.st_rocketload = time + 0.6; - sound (self, CHAN_WEAPON, "weapons/rhinore.wav", 1, ATTN_NORM); + if (@self.reload_rocket && @self.ammo_rockets >= 1) { + @self.st_rocketload = time + 0.6; + sound (@self, CHAN_WEAPON, "weapons/rhinore.wav", 1, ATTN_NORM); player_rocketload1 (); // play reload animation - self.reload_rocket = FALSE; + @self.reload_rocket = FALSE; } break; default: break; } - self.impulse = 0; + @self.impulse = 0; }; diff --git a/ParoxysmII/source/server.r b/ParoxysmII/source/server.r index d3b575a..199772c 100644 --- a/ParoxysmII/source/server.r +++ b/ParoxysmII/source/server.r @@ -1,20 +1,20 @@ -void() monster_ogre = {remove(self);}; -void() monster_demon1 = {remove(self);}; -void() monster_shambler = {remove(self);}; -void() monster_knight = {remove(self);}; -void() monster_army = {remove(self);}; -void() monster_wizard = {remove(self);}; -void() monster_dog = {remove(self);}; -void() monster_zombie = {remove(self);}; -void() monster_boss = {remove(self);}; -void() monster_tarbaby = {remove(self);}; -void() monster_hell_knight = {remove(self);}; -void() monster_fish = {remove(self);}; -void() monster_shalrath = {remove(self);}; -void() monster_enforcer = {remove(self);}; -void() monster_oldone = {remove(self);}; -void() event_lightning = {remove(self);}; +void() monster_ogre = {remove(@self);}; +void() monster_demon1 = {remove(@self);}; +void() monster_shambler = {remove(@self);}; +void() monster_knight = {remove(@self);}; +void() monster_army = {remove(@self);}; +void() monster_wizard = {remove(@self);}; +void() monster_dog = {remove(@self);}; +void() monster_zombie = {remove(@self);}; +void() monster_boss = {remove(@self);}; +void() monster_tarbaby = {remove(@self);}; +void() monster_hell_knight = {remove(@self);}; +void() monster_fish = {remove(@self);}; +void() monster_shalrath = {remove(@self);}; +void() monster_enforcer = {remove(@self);}; +void() monster_oldone = {remove(@self);}; +void() event_lightning = {remove(@self);}; /* ============================================================================== MOVETARGET CODE @@ -37,34 +37,34 @@ moving towards it, change the next destination and continue. void() t_movetarget = { local entity temp; - if (other.movetarget != self) + if (other.movetarget != @self) return; if (other.enemy) return; // fighting, not following a path - temp = self; - self = other; + temp = @self; + @self = other; other = temp; - if (self.classname == "monster_ogre") - sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound + if (@self.classname == "monster_ogre") + sound (@self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound //dprint ("t_movetarget\n"); - self.goalentity = self.movetarget = find (world, targetname, other.target); - self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); - if (!self.movetarget) + @self.goalentity = @self.movetarget = find (world, targetname, other.target); + @self.ideal_yaw = vectoyaw(@self.goalentity.origin - @self.origin); + if (!@self.movetarget) { - self.pausetime = time + 999999; - self.th_stand (); + @self.pausetime = time + 999999; + @self.th_stand (); return; } }; void() movetarget_f = { - if (!self.targetname) + if (!@self.targetname) objerror ("monster_movetarget: no targetname"); - self.solid = SOLID_TRIGGER; - self.touch = t_movetarget; - setsize (self, '-8 -8 -8', '8 8 8'); + @self.solid = SOLID_TRIGGER; + @self.touch = t_movetarget; + setsize (@self, '-8 -8 -8', '8 8 8'); }; /*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8) diff --git a/ParoxysmII/source/shields.r b/ParoxysmII/source/shields.r index 6706b4d..4c9831e 100644 --- a/ParoxysmII/source/shields.r +++ b/ParoxysmII/source/shields.r @@ -23,7 +23,7 @@ WEB: http://www.planetquake.com/paroxysm/ // Regen Station default ambient sound void() regen_ambientsound = { - ambientsound (self.origin, "ambience/regen1.wav", 0.5, ATTN_STATIC); + ambientsound (@self.origin, "ambience/regen1.wav", 0.5, ATTN_STATIC); }; // Particle stream replaced by a model with client side animation @@ -31,9 +31,9 @@ void() regen_ambientsound = // A particle effect for regen stations void (void) regen_make_smoke = { - particle (self.origin + '0 0 +6', '1 1 36', self.clr, 12); - particle (self.origin + '0 0 +6', '-1 -1 36', self.clr, 12); - self.nextthink = time + 0.1; + particle (@self.origin + '0 0 +6', '1 1 36', @self.clr, 12); + particle (@self.origin + '0 0 +6', '-1 -1 36', @self.clr, 12); + @self.nextthink = time + 0.1; }; #endif @@ -49,7 +49,7 @@ void (float color) regen_streamer = setmodel (streamer, "progs/stream.mdl"); setsize (streamer, '-16 -16 0', '16 16 56'); streamer.velocity = '0 0 0'; - setorigin (streamer, self.origin); + setorigin (streamer, @self.origin); streamer.skin = color; @@ -64,12 +64,12 @@ void () regen_touch = if (other.regen_finished > time) // already touched return; - if (other.armorvalue >= self.armregen) { // Station can't give more + if (other.armorvalue >= @self.armregen) { // Station can't give more other.regen_finished = time; return; } - other.armregen = self.armregen; + other.armregen = @self.armregen; other.regen_finished = time + 0.2; }; @@ -77,11 +77,11 @@ void () regen_touch = // Regen triggers for custom maps - can be BIG (whole rooms) void () regen_station = { - if (self.armregen <= 0) - self.armregen = 50; + if (@self.armregen <= 0) + @self.armregen = 50; InitTrigger (); - self.touch = regen_touch; - //self.netname = "regen station"; + @self.touch = regen_touch; + //@self.netname = "regen station"; }; void (float type, float value) item_armor = @@ -94,19 +94,19 @@ void (float type, float value) item_armor = precache_model ("progs/regen.mdl"); precache_model ("progs/stream.mdl"); - self.touch = regen_touch; - setmodel (self, "progs/regen.mdl"); - self.skin = type; - setsize (self, '-16 -16 0', '16 16 56'); - self.solid = SOLID_TRIGGER; + @self.touch = regen_touch; + setmodel (@self, "progs/regen.mdl"); + @self.skin = type; + setsize (@self, '-16 -16 0', '16 16 56'); + @self.solid = SOLID_TRIGGER; // Some existing DM maps rely on Droptofloor for proper placement - self.movetype = MOVETYPE_TOSS; - self.velocity = '0 0 0'; - self.origin_z = self.origin_z + 6; - //self.netname = "regen station"; + @self.movetype = MOVETYPE_TOSS; + @self.velocity = '0 0 0'; + @self.origin_z = @self.origin_z + 6; + //@self.netname = "regen station"; - self.armregen = value; + @self.armregen = value; regen_streamer (type); }; diff --git a/ParoxysmII/source/specfx.r b/ParoxysmII/source/specfx.r index 522b1a4..02e1cf8 100644 --- a/ParoxysmII/source/specfx.r +++ b/ParoxysmII/source/specfx.r @@ -15,11 +15,11 @@ Feel free to use this code in anyway. .float spark_freq; // To avoid 'not a feild' server errors void() e_spark = { - remove (self); + remove (@self); }; void() a_drip = { - remove (self); + remove (@self); }; /* @@ -64,44 +64,44 @@ void() play_sound; void() sound_wait = { // hang around until next use - self.nextthink = time + 60*10; - self.think = sound_wait; + @self.nextthink = time + 60*10; + @self.think = sound_wait; }; void() stop_sound = { // if sound is set to toggle, silence it and set use to play - if (self.spawnflags & TOGGLE_SND) + if (@self.spawnflags & TOGGLE_SND) { - sound (self, CHAN_VOICE, "misc/null.wav", 0, self.snd_attn); - self.use = play_sound; + sound (@self, CHAN_VOICE, "misc/null.wav", 0, @self.snd_attn); + @self.use = play_sound; sound_wait(); } // sound doesn't toggle so kill it else { - sound (self, CHAN_VOICE, "misc/null.wav", 0, self.snd_attn); - remove (self); + sound (@self, CHAN_VOICE, "misc/null.wav", 0, @self.snd_attn); + remove (@self); } }; void() play_sound = { //infinite repeat - if (self.snd_rep == -2) + if (@self.snd_rep == -2) { - sound (self, CHAN_VOICE, self.the_snd, self.snd_volume, self.snd_attn); + sound (@self, CHAN_VOICE, @self.the_snd, @self.snd_volume, @self.snd_attn); sound_think(); } // sound is done - else if (self.snd_rep == 0) - remove (self); + else if (@self.snd_rep == 0) + remove (@self); // play the sound and reduce repititions by 1 - if (self.snd_rep >= 1) + if (@self.snd_rep >= 1) { - sound (self, CHAN_VOICE, self.the_snd, self.snd_volume, self.snd_attn); - self.snd_rep = self.snd_rep - 1; + sound (@self, CHAN_VOICE, @self.the_snd, @self.snd_volume, @self.snd_attn); + @self.snd_rep = @self.snd_rep - 1; sound_think(); } @@ -109,43 +109,43 @@ void() play_sound = void() sound_think = { // if sound is toggled, set next use to stop - if (self.spawnflags & TOGGLE_SND) - self.use = stop_sound; + if (@self.spawnflags & TOGGLE_SND) + @self.use = stop_sound; // determine user-defined loop time then play the sound - self.nextthink = time + (random()*self.snd_rand) + self.snd_loop; - self.think = play_sound; + @self.nextthink = time + (random()*@self.snd_rand) + @self.snd_loop; + @self.think = play_sound; }; void() cust_sound = { - precache_sound (self.the_snd); + precache_sound (@self.the_snd); precache_sound ("misc/null.wav"); //default attenuation to NORM if not specified - if(!self.snd_attn) - self.snd_attn = 2; + if(!@self.snd_attn) + @self.snd_attn = 2; - self.snd_attn = self.snd_attn - 1;// needed so the default to NORM works (since 0 = NONE) + @self.snd_attn = @self.snd_attn - 1;// needed so the default to NORM works (since 0 = NONE) //default volume to one if not specified - if(self.snd_volume <= 0) - self.snd_volume = 1; + if(@self.snd_volume <= 0) + @self.snd_volume = 1; // start sound if not triggered - if (!self.targetname) + if (!@self.targetname) play_sound(); // start sound if initially on, set use to stop_sound - if (self.strt_onoff == 0) + if (@self.strt_onoff == 0) { - self.use = stop_sound; + @self.use = stop_sound; play_sound(); } // start sound when triggered - if (self.strt_onoff == 1) + if (@self.strt_onoff == 1) { - self.use = play_sound; + @self.use = play_sound; } }; @@ -159,33 +159,33 @@ void() cust_sound = //CoolEdit 1.5 (for Windows) is the only editor that can create these looping wavs (to my knowledge) void() ambientsound_go = { - ambientsound (self.origin, self.the_snd, self.snd_volume, self.snd_attn); + ambientsound (@self.origin, @self.the_snd, @self.snd_volume, @self.snd_attn); }; void() ambient_sound = { - precache_sound (self.the_snd); + precache_sound (@self.the_snd); //default volume to one if not specified - if(self.snd_volume <= 0) - self.snd_volume = 1; + if(@self.snd_volume <= 0) + @self.snd_volume = 1; //default attenuation to NORM if not specified - if(!self.snd_attn) - self.snd_attn = 2; + if(!@self.snd_attn) + @self.snd_attn = 2; - self.snd_attn = self.snd_attn - 1;// needed so the default to NORM works (since 0 = NONE) + @self.snd_attn = @self.snd_attn - 1;// needed so the default to NORM works (since 0 = NONE) //start right away if not triggered - if(!self.targetname) + if(!@self.targetname) { //Needs to start on the second frame since that's when entities not called in world_spawn are created - self.nextthink = time + 0.1; - self.think = ambientsound_go; + @self.nextthink = time + 0.1; + @self.think = ambientsound_go; } //wait for trigger else - self.use = ambientsound_go; + @self.use = ambientsound_go; }; /* colour_light is a small hack to try and simulate coloured lighting. @@ -214,14 +214,14 @@ void() colourlight_off = //turn it off and reset stuffcmd (other, "v_cshift 0 0 0 0\n"); - self.use = colourlight_wait; - self.touch = SUB_Null; + @self.use = colourlight_wait; + @self.touch = SUB_Null; }; void() colourlight_toggle = { //called after light is triggered a second time - self.touch = colourlight_off; + @self.touch = colourlight_off; }; void() colourlight_use = @@ -233,21 +233,21 @@ void() colourlight_use = if(other.cshift_finished > time) return; - stuffcmd (other, self.colourvalue); + stuffcmd (other, @self.colourvalue); //POX v1.2 - better clearing of v_cshift (in PostThink) other.cshift_off = FALSE; other.cshift_finished = time + 0.1; //check every frame //if targetted, alow it to be shut down - if(self.targetname) - self.use = colourlight_toggle; + if(@self.targetname) + @self.use = colourlight_toggle; }; void() colourlight_wait = { //activated by a trigger so wait for touch - self.touch = colourlight_use; + @self.touch = colourlight_use; }; void() colour_light = { @@ -256,11 +256,11 @@ void() colour_light = //Can be made active by use of a targetname //Must be triggered by touch - if(!self.targetname || !(self.spawnflags & CLSTART_OFF)) { - self.touch = colourlight_use; + if(!@self.targetname || !(@self.spawnflags & CLSTART_OFF)) { + @self.touch = colourlight_use; } else { - self.use = colourlight_wait; - self.touch = SUB_Null; + @self.use = colourlight_wait; + @self.touch = SUB_Null; } }; /* @@ -277,20 +277,20 @@ void() particle_stream = precache_sound("ambience/regen1.wav"); precache_model ("progs/stream.mdl"); - self.angles = '0 0 0'; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NONE; - setmodel(self, "progs/stream.mdl"); + @self.angles = '0 0 0'; + @self.solid = SOLID_NOT; + @self.movetype = MOVETYPE_NONE; + setmodel(@self, "progs/stream.mdl"); //POX v1.2 - just in case - if(self.clr > 2 || self.clr < 0) - self.clr = 0; + if(@self.clr > 2 || @self.clr < 0) + @self.clr = 0; - self.skin = self.clr; + @self.skin = @self.clr; //POX v1.2 Fixed sound orign (makestatic messed it up?) regen_ambientsound (); - makestatic (self); + makestatic (@self); }; /* @@ -301,52 +301,52 @@ Try to use rectangular objects, since entites use bounding box collision detecti */ void() bsp_explode = { - self.takedamage = DAMAGE_NO; - self.trigger_field.classname = "explo_box"; + @self.takedamage = DAMAGE_NO; + @self.trigger_field.classname = "explo_box"; - // did say self.owner - T_RadiusDamage (self.trigger_field, self.trigger_field, self.dmg, world, ""); - sound (self.trigger_field, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); + // did say @self.owner + T_RadiusDamage (@self.trigger_field, @self.trigger_field, @self.dmg, world, ""); + sound (@self.trigger_field, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); - WriteCoord (MSG_MULTICAST, self.trigger_field.origin_x); - WriteCoord (MSG_MULTICAST, self.trigger_field.origin_y); - WriteCoord (MSG_MULTICAST, self.trigger_field.origin_z); - multicast (self.origin, MULTICAST_PHS); + WriteCoord (MSG_MULTICAST, @self.trigger_field.origin_x); + WriteCoord (MSG_MULTICAST, @self.trigger_field.origin_y); + WriteCoord (MSG_MULTICAST, @self.trigger_field.origin_z); + multicast (@self.origin, MULTICAST_PHS); - remove (self); - remove (self.trigger_field); + remove (@self); + remove (@self.trigger_field); }; void() misc_explobsp = { local entity spot; - self.solid = SOLID_BBOX; - self.movetype = MOVETYPE_NONE; + @self.solid = SOLID_BBOX; + @self.movetype = MOVETYPE_NONE; - setmodel (self, self.model); - setsize( self, self.mins, self.maxs ); + setmodel (@self, @self.model); + setsize( @self, @self.mins, @self.maxs ); precache_sound ("weapons/r_exp3.wav"); - if (!self.health) - self.health = 20; + if (!@self.health) + @self.health = 20; - if (!self.dmg) - self.dmg = 160; + if (!@self.dmg) + @self.dmg = 160; - self.th_die = bsp_explode; - self.takedamage = DAMAGE_AIM; - self.nobleed = TRUE; + @self.th_die = bsp_explode; + @self.takedamage = DAMAGE_AIM; + @self.nobleed = TRUE; //POX 1.2 - HACK! //put a null entity at the center of the model to hold the explosion position spot = spawn(); setmodel (spot, string_null); - spot.origin_x = self.absmin_x + (self.size_x * 0.5); - spot.origin_y = self.absmin_y + (self.size_y * 0.5); - spot.origin_z = self.absmin_z + (self.size_z * 0.5); + spot.origin_x = @self.absmin_x + (@self.size_x * 0.5); + spot.origin_y = @self.absmin_y + (@self.size_y * 0.5); + spot.origin_z = @self.absmin_z + (@self.size_z * 0.5); setsize (spot, '0 0 0', '0 0 0'); - self.trigger_field = spot; + @self.trigger_field = spot; }; diff --git a/ParoxysmII/source/spectate.r b/ParoxysmII/source/spectate.r index 34d1255..c35e60d 100644 --- a/ParoxysmII/source/spectate.r +++ b/ParoxysmII/source/spectate.r @@ -21,9 +21,9 @@ called when a spectator connects to a server void() SpectatorConnect = { bprint (PRINT_MEDIUM, "Spectator "); - bprint (PRINT_MEDIUM, self.netname); + bprint (PRINT_MEDIUM, @self.netname); bprint (PRINT_MEDIUM, " entered the game\n"); - self.goalentity = world; // used for impulse 1 below + @self.goalentity = world; // used for impulse 1 below }; /* =========== @@ -34,7 +34,7 @@ called when a spectator disconnects from a server void() SpectatorDisconnect = { bprint (PRINT_MEDIUM, "Spectator "); - bprint (PRINT_MEDIUM, self.netname); + bprint (PRINT_MEDIUM, @self.netname); bprint (PRINT_MEDIUM, " left the game\n"); }; /* @@ -45,20 +45,20 @@ Called by SpectatorThink if the spectator entered an impulse */ void() SpectatorImpulseCommand = { - if (self.impulse == 1) { + if (@self.impulse == 1) { // teleport the spectator to the next spawn point // note that if the spectator is tracking, this doesn't do // much - self.goalentity = find(self.goalentity, classname, "info_player_deathmatch"); - if (self.goalentity == world) - self.goalentity = find(self.goalentity, classname, "info_player_deathmatch"); - if (self.goalentity != world) { - setorigin(self, self.goalentity.origin); - self.angles = self.goalentity.angles; - self.fixangle = TRUE; // turn this way immediately + @self.goalentity = find(@self.goalentity, classname, "info_player_deathmatch"); + if (@self.goalentity == world) + @self.goalentity = find(@self.goalentity, classname, "info_player_deathmatch"); + if (@self.goalentity != world) { + setorigin(@self, @self.goalentity.origin); + @self.angles = @self.goalentity.angles; + @self.fixangle = TRUE; // turn this way immediately } } - self.impulse = 0; + @self.impulse = 0; }; /* ================ @@ -68,8 +68,8 @@ Called every frame after physics are run */ void() SpectatorThink = { - // self.origin, etc contains spectator position, so you could + // @self.origin, etc contains spectator position, so you could // do some neat stuff here - if (self.impulse) + if (@self.impulse) SpectatorImpulseCommand(); }; diff --git a/ParoxysmII/source/subs.r b/ParoxysmII/source/subs.r index 4b6b4ad..9c847eb 100644 --- a/ParoxysmII/source/subs.r +++ b/ParoxysmII/source/subs.r @@ -3,24 +3,24 @@ #include "paroxysm.rh" void() SUB_Null = {}; -void() SUB_Remove = {remove(self);}; +void() SUB_Remove = {remove(@self);}; /* QuakeEd only writes a single float for angles (bad idea), so up and down are just constant angles. */ vector() SetMovedir = { - if (self.angles == '0 -1 0') - self.movedir = '0 0 1'; - else if (self.angles == '0 -2 0') - self.movedir = '0 0 -1'; + if (@self.angles == '0 -1 0') + @self.movedir = '0 0 1'; + else if (@self.angles == '0 -2 0') + @self.movedir = '0 0 -1'; else { - makevectors (self.angles); - self.movedir = v_forward; + makevectors (@self.angles); + @self.movedir = v_forward; } - self.angles = '0 0 0'; + @self.angles = '0 0 0'; }; /* ================ @@ -31,28 +31,28 @@ void() InitTrigger = { // trigger angles are used for one-way touches. An angle of 0 is assumed // to mean no restrictions, so use a yaw of 360 instead. - if (self.angles != '0 0 0') + if (@self.angles != '0 0 0') SetMovedir (); - self.solid = SOLID_TRIGGER; - setmodel (self, self.model); // set size and link into world - self.movetype = MOVETYPE_NONE; - self.modelindex = 0; - self.model = ""; + @self.solid = SOLID_TRIGGER; + setmodel (@self, @self.model); // set size and link into world + @self.movetype = MOVETYPE_NONE; + @self.modelindex = 0; + @self.model = ""; }; /* ============= SUB_CalcMove -calculate self.velocity and self.nextthink to reach dest from -self.origin traveling at speed +calculate @self.velocity and @self.nextthink to reach dest from +@self.origin traveling at speed =============== */ void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt = { local entity stemp; - stemp = self; - self = ent; + stemp = @self; + @self = ent; SUB_CalcMove (tdest, tspeed, func); - self = stemp; + @self = stemp; }; void(vector tdest, float tspeed, void() func) SUB_CalcMove = @@ -61,18 +61,18 @@ local vector vdestdelta; local float len, traveltime; if (!tspeed) objerror("No speed is defined!"); - self.think1 = func; - self.finaldest = tdest; - self.think = SUB_CalcMoveDone; - if (tdest == self.origin) + @self.think1 = func; + @self.finaldest = tdest; + @self.think = SUB_CalcMoveDone; + if (tdest == @self.origin) { - self.velocity = '0 0 0'; - self.nextthink = self.ltime + 0.1; + @self.velocity = '0 0 0'; + @self.nextthink = @self.ltime + 0.1; return; } // set destdelta to the vector needed to move - vdestdelta = tdest - self.origin; + vdestdelta = tdest - @self.origin; // calculate length of vector len = vlen (vdestdelta); @@ -83,9 +83,9 @@ local float len, traveltime; traveltime = 0.03; // set nextthink to trigger a think when dest is reached - self.nextthink = self.ltime + traveltime; + @self.nextthink = @self.ltime + traveltime; // scale the destdelta vector by the time spent traveling to get velocity - self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float + @self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float }; /* @@ -93,28 +93,28 @@ local float len, traveltime; */ void() SUB_CalcMoveDone = { - setorigin (self, self.finaldest); - self.velocity = '0 0 0'; - self.nextthink = -1; - if (self.think1) - self.think1 (); + setorigin (@self, @self.finaldest); + @self.velocity = '0 0 0'; + @self.nextthink = -1; + if (@self.think1) + @self.think1 (); }; /* ============= SUB_CalcAngleMove -calculate self.avelocity and self.nextthink to reach destangle from -self.angles rotating -The calling function should make sure self.think is valid +calculate @self.avelocity and @self.nextthink to reach destangle from +@self.angles rotating +The calling function should make sure @self.think is valid =============== */ void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt = { local entity stemp; - stemp = self; - self = ent; + stemp = @self; + @self = ent; SUB_CalcAngleMove (destangle, tspeed, func); - self = stemp; + @self = stemp; }; void (vector destangle, float tspeed, void() func) SUB_CalcAngleMove = @@ -126,7 +126,7 @@ void (vector destangle, float tspeed, void() func) SUB_CalcAngleMove = objerror ("No speed is defined!"); // set destdelta to the vector needed to move - destdelta = destangle - self.angles; + destdelta = destangle - @self.angles; // calculate length of vector len = vlen (destdelta); @@ -135,14 +135,14 @@ void (vector destangle, float tspeed, void() func) SUB_CalcAngleMove = traveltime = len / tspeed; // set nextthink to trigger a think when dest is reached - self.nextthink = self.ltime + traveltime; + @self.nextthink = @self.ltime + traveltime; // scale the destdelta vector by the time spent traveling to get velocity - self.avelocity = destdelta * (1 / traveltime); + @self.avelocity = destdelta * (1 / traveltime); - self.think1 = func; - self.finalangle = destangle; - self.think = SUB_CalcAngleMoveDone; + @self.think1 = func; + @self.finalangle = destangle; + @self.think = SUB_CalcAngleMoveDone; }; /* @@ -152,30 +152,30 @@ After rotating, set angle to exact final angle */ void() SUB_CalcAngleMoveDone = { - self.angles = self.finalangle; - self.avelocity = '0 0 0'; - self.nextthink = -1; - if (self.think1) - self.think1(); + @self.angles = @self.finalangle; + @self.avelocity = '0 0 0'; + @self.nextthink = -1; + if (@self.think1) + @self.think1(); }; //============================================================================= void() DelayThink = { - activator = self.enemy; + activator = @self.enemy; SUB_UseTargets (); - remove(self); + remove(@self); }; /* ============================== SUB_UseTargets the global "activator" should be set to the entity that initiated the firing. -If self.delay is set, a DelayedUse entity will be created that will actually +If @self.delay is set, a DelayedUse entity will be created that will actually do the SUB_UseTargets after that many seconds have passed. -Centerprints any self.message to the activator. -Removes all entities with a targetname that match self.killtarget, +Centerprints any @self.message to the activator. +Removes all entities with a targetname that match @self.killtarget, and removes them, so some events can remove other triggers. Search for (string)targetname in all entities that -match (string)self.target and call their .use function +match (string)@self.target and call their .use function ============================== */ void() SUB_UseTargets = @@ -186,32 +186,32 @@ void() SUB_UseTargets = /* check for a delay */ - if (self.delay) { // create a temp object to fire at a later time + if (@self.delay) { // create a temp object to fire at a later time t = spawn(); t.classname = "DelayedUse"; - t.nextthink = time + self.delay; + t.nextthink = time + @self.delay; t.think = DelayThink; t.enemy = activator; - t.message = self.message; - t.killtarget = self.killtarget; - t.target = self.target; + t.message = @self.message; + t.killtarget = @self.killtarget; + t.target = @self.target; return; } // print the message - if ((activator.classname == "player") && (self.message != "")) { - self.target_id_finished = time + 4; // don't let TargetID override centerprints + if ((activator.classname == "player") && (@self.message != "")) { + @self.target_id_finished = time + 4; // don't let TargetID override centerprints - centerprint (activator, self.message); - if (!self.noise) + centerprint (activator, @self.message); + if (!@self.noise) sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); } // kill the killtagets - if (self.killtarget) { + if (@self.killtarget) { t = world; do { - if (!(t = find (t, targetname, self.killtarget))) + if (!(t = find (t, targetname, @self.killtarget))) return; remove (t); @@ -219,25 +219,25 @@ void() SUB_UseTargets = } // fire targets - if (self.target) { + if (@self.target) { act = activator; t = world; do { - if (!(t = find (t, targetname, self.target))) + if (!(t = find (t, targetname, @self.target))) return; - stemp = self; + stemp = @self; otemp = other; - self = t; + @self = t; other = stemp; - if (self.use != SUB_Null) { - if (self.use) - self.use (); + if (@self.use != SUB_Null) { + if (@self.use) + @self.use (); } - self = stemp; + @self = stemp; other = otemp; activator = act; } while ( 1 ); diff --git a/ParoxysmII/source/targid.r b/ParoxysmII/source/targid.r index d0e0fa7..123478e 100644 --- a/ParoxysmII/source/targid.r +++ b/ParoxysmII/source/targid.r @@ -7,16 +7,16 @@ /* POX - from original Quake ai.qc ============= visible -returns 1 if the entity is visible to self, even if not infront () +returns 1 if the entity is visible to @self, even if not infront () ============= */ float (entity targ) visible = { local vector spot1, spot2; - spot1 = self.origin + self.view_ofs; + spot1 = @self.origin + @self.view_ofs; spot2 = targ.origin + targ.view_ofs; - traceline (spot1, spot2, TRUE, self); // see through other monsters + traceline (spot1, spot2, TRUE, @self); // see through other monsters if (trace_inopen && trace_inwater) return FALSE; // sight line crossed contents @@ -33,10 +33,10 @@ void() ID_CheckTarget = local string idfrags; //POX v1.12 //Lost target, or target died - if (self.target_id_same < time || self.last_target_id.health < 1 || !visible(self.last_target_id)) - self.last_target_id = world; + if (@self.target_id_same < time || @self.last_target_id.health < 1 || !visible(@self.last_target_id)) + @self.last_target_id = world; - traceline (self.origin , (self.origin+(v_forward * 800)) , FALSE , self); + traceline (@self.origin , (@self.origin+(v_forward * 800)) , FALSE , @self); org = trace_endpos; spot = findradius(org, 200); @@ -45,26 +45,26 @@ void() ID_CheckTarget = if ((spot.classname == "player") && spot.takedamage) { //Same target as last time - if (self.target_id_same > time && spot == self.last_target_id) + if (@self.target_id_same > time && spot == @self.last_target_id) { - self.target_id_finished = time + 1.5; - self.target_id_same = time + 3; + @self.target_id_finished = time + 1.5; + @self.target_id_same = time + 3; return; } - else if (spot != self && visible (spot) )//Found new Target + else if (spot != @self && visible (spot) )//Found new Target { - self.last_target_id = spot; - self.target_id_finished = time + 1.5; - self.target_id_same = time + 3; + @self.last_target_id = spot; + @self.target_id_finished = time + 1.5; + @self.target_id_same = time + 3; //POX v1.12 print the target's frags is observing - if (self.classname == "LMSobserver") + if (@self.classname == "LMSobserver") { - idfrags = ftos (self.last_target_id.frags); - centerprint4 (self, self.last_target_id.netname, "\n\n", idfrags, " frags remaining"); + idfrags = ftos (@self.last_target_id.frags); + centerprint4 (@self, @self.last_target_id.netname, "\n\n", idfrags, " frags remaining"); } else - centerprint (self, self.last_target_id.netname); + centerprint (@self, @self.last_target_id.netname); return; } diff --git a/ParoxysmII/source/triggers.r b/ParoxysmII/source/triggers.r index 41bc813..d8acb70 100644 --- a/ParoxysmII/source/triggers.r +++ b/ParoxysmII/source/triggers.r @@ -5,7 +5,7 @@ entity stemp, otemp, s, old; void() trigger_reactivate = { - self.solid = SOLID_TRIGGER; + @self.solid = SOLID_TRIGGER; }; //============================================================================= @@ -15,60 +15,60 @@ void() trigger_reactivate = // the wait time has passed, so set back up for another activation void() multi_wait = { - if (self.max_health) { - self.health = self.max_health; - self.takedamage = DAMAGE_YES; - self.solid = SOLID_BBOX; + if (@self.max_health) { + @self.health = @self.max_health; + @self.takedamage = DAMAGE_YES; + @self.solid = SOLID_BBOX; } }; // the trigger was just touched/killed/used -// self.enemy should be set to the activator so it can be held through a delay +// @self.enemy should be set to the activator so it can be held through a delay // so wait for the delay time before firing void() multi_trigger = { - if (self.nextthink > time) { + if (@self.nextthink > time) { return; // allready been triggered } - if (self.classname == "trigger_secret") { - if (self.enemy.classname != "player") + if (@self.classname == "trigger_secret") { + if (@self.enemy.classname != "player") return; found_secrets++; WriteByte (MSG_ALL, SVC_FOUNDSECRET); } - if (self.noise) - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); + if (@self.noise) + sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NORM); // don't trigger again until reset - self.takedamage = DAMAGE_NO; - activator = self.enemy; + @self.takedamage = DAMAGE_NO; + activator = @self.enemy; SUB_UseTargets (); - if (self.wait > 0) { - self.think = multi_wait; - self.nextthink = time + self.wait; + if (@self.wait > 0) { + @self.think = multi_wait; + @self.nextthink = time + @self.wait; } else { - // we can't just remove (self) here, because this is a touch function + // we can't just remove (@self) here, because this is a touch function // called wheil C code is looping through area links... - self.touch = NIL; - self.nextthink = time + 0.1; - self.think = SUB_Remove; + @self.touch = NIL; + @self.nextthink = time + 0.1; + @self.think = SUB_Remove; } }; void() multi_killed = { - self.enemy = damage_attacker; + @self.enemy = damage_attacker; multi_trigger (); }; void() multi_use = { - self.enemy = activator; + @self.enemy = activator; multi_trigger (); }; @@ -78,13 +78,13 @@ void() multi_touch = return; // if the trigger has an angles field, check player's facing direction - if (self.movedir != '0 0 0') { + if (@self.movedir != '0 0 0') { makevectors (other.angles); - if (v_forward * self.movedir < 0) + if (v_forward * @self.movedir < 0) return; // not facing the right way } - self.enemy = other; + @self.enemy = other; multi_trigger (); }; /*QUAKED trigger_multiple (.5 .5 .5) ? notouch @@ -102,46 +102,46 @@ set "message" to text string */ void() trigger_multiple = { - if (self.sounds == 1) + if (@self.sounds == 1) { precache_sound ("misc/secret.wav"); - self.noise = "misc/secret.wav"; + @self.noise = "misc/secret.wav"; } - else if (self.sounds == 2) + else if (@self.sounds == 2) { precache_sound ("misc/talk.wav"); - self.noise = "misc/talk.wav"; + @self.noise = "misc/talk.wav"; } - else if (self.sounds == 3) + else if (@self.sounds == 3) { precache_sound ("misc/trigger1.wav"); - self.noise = "misc/trigger1.wav"; + @self.noise = "misc/trigger1.wav"; } - if (!self.wait) - self.wait = 0.2; - self.use = multi_use; + if (!@self.wait) + @self.wait = 0.2; + @self.use = multi_use; InitTrigger (); - if (self.health) + if (@self.health) { - if (self.spawnflags & SPAWNFLAG_NOTOUCH) + if (@self.spawnflags & SPAWNFLAG_NOTOUCH) objerror ("health and notouch don't make sense\n"); - self.max_health = self.health; - self.th_die = multi_killed; - self.takedamage = DAMAGE_YES; - self.solid = SOLID_BBOX; - setorigin (self, self.origin); // make sure it links into the world + @self.max_health = @self.health; + @self.th_die = multi_killed; + @self.takedamage = DAMAGE_YES; + @self.solid = SOLID_BBOX; + setorigin (@self, @self.origin); // make sure it links into the world // + POX - self.nobleed = TRUE; + @self.nobleed = TRUE; // - POX } else { - if ( !(self.spawnflags & SPAWNFLAG_NOTOUCH) ) + if ( !(@self.spawnflags & SPAWNFLAG_NOTOUCH) ) { - self.touch = multi_touch; + @self.touch = multi_touch; } } }; @@ -160,7 +160,7 @@ set "message" to text string */ void() trigger_once = { - self.wait = -1; + @self.wait = -1; trigger_multiple(); }; //============================================================================= @@ -169,7 +169,7 @@ This fixed size trigger cannot be touched, it can only be fired by other events. */ void() trigger_relay = { - self.use = SUB_UseTargets; + @self.use = SUB_UseTargets; }; //============================================================================= /*QUAKED trigger_secret (.5 .5 .5) ? @@ -184,21 +184,21 @@ set "message" to text string void() trigger_secret = { total_secrets = total_secrets + 1; - self.wait = -1; - if (!self.message) - self.message = "You found a secret area!"; - if (!self.sounds) - self.sounds = 1; + @self.wait = -1; + if (!@self.message) + @self.message = "You found a secret area!"; + if (!@self.sounds) + @self.sounds = 1; - if (self.sounds == 1) + if (@self.sounds == 1) { precache_sound ("misc/secret.wav"); - self.noise = "misc/secret.wav"; + @self.noise = "misc/secret.wav"; } - else if (self.sounds == 2) + else if (@self.sounds == 2) { precache_sound ("misc/talk.wav"); - self.noise = "misc/talk.wav"; + @self.noise = "misc/talk.wav"; } trigger_multiple (); }; @@ -206,15 +206,15 @@ void() trigger_secret = void() counter_use = { - (self.count)--; - if (self.count < 0) + (@self.count)--; + if (@self.count < 0) return; - if (self.count != 0) { - if (activator.classname == "player" && !(self.spawnflags & SPAWNFLAG_NOMESSAGE)) { - self.target_id_finished = time + 4;//POX v1.12 don't let TargetID override centerprints + if (@self.count != 0) { + if (activator.classname == "player" && !(@self.spawnflags & SPAWNFLAG_NOMESSAGE)) { + @self.target_id_finished = time + 4;//POX v1.12 don't let TargetID override centerprints - switch (self.count) { + switch (@self.count) { case 1: centerprint (activator, "Only 1 more to go..."); break; @@ -232,12 +232,12 @@ void() counter_use = return; } - if (activator.classname == "player" && !(self.spawnflags & SPAWNFLAG_NOMESSAGE)) { - self.target_id_finished = time + 4;//POX don't let TargetID override centerprints + if (activator.classname == "player" && !(@self.spawnflags & SPAWNFLAG_NOMESSAGE)) { + @self.target_id_finished = time + 4;//POX don't let TargetID override centerprints centerprint (activator, "Sequence completed!"); } - self.enemy = activator; + @self.enemy = activator; multi_trigger (); }; @@ -248,12 +248,12 @@ After the counter has been triggered "count" times (default 2), it will fire all */ void() trigger_counter = { - self.wait = -1; + @self.wait = -1; - if (!self.count) - self.count = 2; + if (!@self.count) + @self.count = 2; - self.use = counter_use; + @self.use = counter_use; }; /* @@ -275,8 +275,8 @@ void() play_teleport = else tmpstr = "misc/r_tele2.wav"; - sound (self, CHAN_VOICE, tmpstr, 1, ATTN_NORM); - remove (self); + sound (@self, CHAN_VOICE, tmpstr, 1, ATTN_NORM); + remove (@self); }; void (vector org) spawn_tfog = @@ -296,33 +296,33 @@ void (vector org) spawn_tfog = void() tdeath_touch = { local entity other2; - if (other == self.owner) + if (other == @self.owner) return; // frag anyone who teleports in on top of an invincible player if (other.classname == "player") { if (other.invincible_finished > time && - self.owner.invincible_finished > time) { - self.classname = "teledeath3"; + @self.owner.invincible_finished > time) { + @self.classname = "teledeath3"; other.invincible_finished = 0; - self.owner.invincible_finished = 0; - T_Damage (other, self, self, 50000); - other2 = self.owner; - self.owner = other; - T_Damage (other2, self, self, 50000); + @self.owner.invincible_finished = 0; + T_Damage (other, @self, @self, 50000); + other2 = @self.owner; + @self.owner = other; + T_Damage (other2, @self, @self, 50000); } if (other.invincible_finished > time) { - self.classname = "teledeath2"; - T_Damage (self.owner, self, self, 50000); + @self.classname = "teledeath2"; + T_Damage (@self.owner, @self, @self, 50000); return; } } if (other.health) { - T_Damage (other, self, self, 50000); + T_Damage (other, @self, @self, 50000); } }; @@ -362,13 +362,13 @@ void() teleport_touch = } #endif - if (self.targetname) { - if (self.nextthink < time) { + if (@self.targetname) { + if (@self.nextthink < time) { return; // not fired yet } } - if (self.spawnflags & PLAYER_ONLY) { + if (@self.spawnflags & PLAYER_ONLY) { if (other.classname != "player") return; } @@ -383,7 +383,7 @@ void() teleport_touch = // put a tfog where the player was spawn_tfog (other.origin); - t = find (world, targetname, self.target); + t = find (world, targetname, @self.target); if (!t) objerror ("couldn't find target"); @@ -428,19 +428,19 @@ This is the destination marker for a teleporter. It should have a "targetname" void() info_teleport_destination = { // this does nothing, just serves as a target spot - self.mangle = self.angles; - self.angles = '0 0 0'; - self.model = ""; - self.origin = self.origin + '0 0 27'; - if (!self.targetname) + @self.mangle = @self.angles; + @self.angles = '0 0 0'; + @self.model = ""; + @self.origin = @self.origin + '0 0 27'; + if (!@self.targetname) objerror ("no targetname"); }; void() teleport_use = { - self.nextthink = time + 0.2; + @self.nextthink = time + 0.2; force_retouch = 2; // make sure even still objects get hit - self.think = SUB_Null; + @self.think = SUB_Null; }; /*QUAKED trigger_teleport (.5 .5 .5) ? PLAYER_ONLY SILENT @@ -456,21 +456,21 @@ void() trigger_teleport = local vector o; InitTrigger (); - self.touch = teleport_touch; + @self.touch = teleport_touch; // make the target bigger - self.flags |= FL_ITEM; + @self.flags |= FL_ITEM; // find the destination - if (!self.target) + if (!@self.target) objerror ("no target"); - self.use = teleport_use; - if (self.spawnflags & SILENT) + @self.use = teleport_use; + if (@self.spawnflags & SILENT) return; precache_sound ("ambience/hum1.wav"); - o = (self.mins + self.maxs) * 0.5; + o = (@self.mins + @self.maxs) * 0.5; ambientsound (o, "ambience/hum1.wav", 0.5, ATTN_STATIC); }; @@ -485,7 +485,7 @@ Only used on start map. */ void() trigger_setskill = { - remove (self); + remove (@self); }; /* @@ -498,20 +498,20 @@ void() trigger_onlyregistered_touch = if (other.classname != "player") return; - if (self.attack_finished > time) + if (@self.attack_finished > time) return; - self.attack_finished = time + 2; + @self.attack_finished = time + 2; if (cvar ("registered")) { - self.message = ""; + @self.message = ""; SUB_UseTargets (); - remove (self); + remove (@self); } else { - if (self.message != "") { - self.target_id_finished = time + 4;//POX don't let TargetID override centerprints + if (@self.message != "") { + @self.target_id_finished = time + 4;//POX don't let TargetID override centerprints - centerprint (other, self.message); + centerprint (other, @self.message); sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM); } } @@ -524,23 +524,23 @@ void() trigger_onlyregistered = { precache_sound ("misc/talk.wav"); InitTrigger (); - self.touch = trigger_onlyregistered_touch; + @self.touch = trigger_onlyregistered_touch; }; //============================================================================ void() hurt_on = { - self.solid = SOLID_TRIGGER; - self.nextthink = -1; + @self.solid = SOLID_TRIGGER; + @self.nextthink = -1; }; void() hurt_touch = { if (other.takedamage) { - self.solid = SOLID_NOT; - T_Damage (other, self, self, self.dmg); - self.think = hurt_on; - self.nextthink = time + 1; + @self.solid = SOLID_NOT; + T_Damage (other, @self, @self, @self.dmg); + @self.think = hurt_on; + @self.nextthink = time + 1; } return; }; @@ -553,9 +553,9 @@ defalt dmg = 5 void() trigger_hurt = { InitTrigger (); - self.touch = hurt_touch; - if (!self.dmg) - self.dmg = 5; + @self.touch = hurt_touch; + if (!@self.dmg) + @self.dmg = 5; }; //============================================================================ @@ -564,9 +564,9 @@ void() trigger_hurt = void() trigger_push_touch = { if (other.classname == "grenade") - other.velocity = self.speed * self.movedir * 10; + other.velocity = @self.speed * @self.movedir * 10; else if (other.health > 0) { - other.velocity = self.speed * self.movedir * 10; + other.velocity = @self.speed * @self.movedir * 10; if (other.classname == "player") { if (other.fly_sound < time) { other.fly_sound = time + 1.5; @@ -575,8 +575,8 @@ void() trigger_push_touch = } } - if (self.spawnflags & PUSH_ONCE) - remove (self); + if (@self.spawnflags & PUSH_ONCE) + remove (@self); }; /*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE @@ -586,9 +586,9 @@ void() trigger_push = { InitTrigger (); precache_sound ("ambience/windfly.wav"); - self.touch = trigger_push_touch; - if (!self.speed) - self.speed = 1000; + @self.touch = trigger_push_touch; + if (!@self.speed) + @self.speed = 1000; }; .float bounce_time; @@ -599,7 +599,7 @@ void() trigger_bounce_touch = return; if ((other.classname == "player") && (other.health > 0)) { - other.velocity = self.angles; + other.velocity = @self.angles; other.bounce_time = time + 0.8; sound (other, CHAN_AUTO, "misc/menu2.wav", 1, ATTN_NORM); @@ -613,12 +613,12 @@ x is east, y is north, z is vertical. A value of '0 40 800' is a vertical bounce */ void() trigger_bouncepad = { - self.solid = SOLID_TRIGGER; - setmodel (self, self.model); // set size and link into world - self.movetype = MOVETYPE_NONE; - self.modelindex = 0; - self.model = ""; - self.touch = trigger_bounce_touch; + @self.solid = SOLID_TRIGGER; + setmodel (@self, @self.model); // set size and link into world + @self.movetype = MOVETYPE_NONE; + @self.modelindex = 0; + @self.model = ""; + @self.touch = trigger_bounce_touch; }; //============================================================================ @@ -629,14 +629,14 @@ void() trigger_monsterjump_touch = return; // set XY even if not on ground, so the jump will clear lips - other.velocity_x = self.movedir_x * self.speed; - other.velocity_y = self.movedir_y * self.speed; + other.velocity_x = @self.movedir_x * @self.speed; + other.velocity_y = @self.movedir_y * @self.speed; if (!(other.flags & FL_ONGROUND)) return; other.flags &= ~FL_ONGROUND; - other.velocity_z = self.height; + other.velocity_z = @self.height; }; /*QUAKED trigger_monsterjump (.5 .5 .5) ? @@ -646,16 +646,16 @@ Walking monsters that touch this will jump in the direction of the trigger's ang */ void() trigger_monsterjump = { - if (!self.speed) - self.speed = 200; + if (!@self.speed) + @self.speed = 200; - if (!self.height) - self.height = 200; + if (!@self.height) + @self.height = 200; - if (self.angles == '0 0 0') - self.angles = '0 360 0'; + if (@self.angles == '0 0 0') + @self.angles = '0 360 0'; InitTrigger (); - self.touch = trigger_monsterjump_touch; + @self.touch = trigger_monsterjump_touch; }; diff --git a/ParoxysmII/source/wall.r b/ParoxysmII/source/wall.r index 67f3674..f9c3c7c 100644 --- a/ParoxysmII/source/wall.r +++ b/ParoxysmII/source/wall.r @@ -40,58 +40,58 @@ void () brik_touch = vol = random (); - if (self.velocity == '0 0 0') { - self.avelocity = '0 0 0'; - self.solid = SOLID_NOT; - self.touch = NIL; - self.think = SUB_Remove; - self.nextthink = time + (2 * random()); + if (@self.velocity == '0 0 0') { + @self.avelocity = '0 0 0'; + @self.solid = SOLID_NOT; + @self.touch = NIL; + @self.think = SUB_Remove; + @self.nextthink = time + (2 * random()); return; } - if (self.gib_caught > 4) { - remove (self); + if (@self.gib_caught > 4) { + remove (@self); return; } // Gib already bounced twice, so remove damage (too easy to get killed) - if (self.gib_caught > 1) - self.dmg = 0; + if (@self.gib_caught > 1) + @self.dmg = 0; - if (self.dmg) { // do damage if set + if (@self.dmg) { // do damage if set if (other.takedamage) { - T_Damage (other, self, self.owner, self.dmg); - remove (self); + T_Damage (other, @self, @self.owner, @self.dmg); + remove (@self); } } - self.gib_caught++; + @self.gib_caught++; - if (!(self.cnt)) + if (!(@self.cnt)) return; if (vol < 0.3) // mute low volume return; - if (pointcontents(self.origin) == CONTENT_SOLID) { // bounce sound - switch (self.cnt) { + if (pointcontents(@self.origin) == CONTENT_SOLID) { // bounce sound + switch (@self.cnt) { case 1: - sound (self, CHAN_AUTO, "ambience/brik_hit.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "ambience/brik_hit.wav", vol, ATTN_NORM); break; case 2: - sound (self, CHAN_AUTO, "ambience/brikhit2.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "ambience/brikhit2.wav", vol, ATTN_NORM); break; case 3: - sound (self, CHAN_AUTO, "ambience/methit1.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "ambience/methit1.wav", vol, ATTN_NORM); break; case 4: - sound (self, CHAN_AUTO, "ambience/woodhit1.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "ambience/woodhit1.wav", vol, ATTN_NORM); break; case 6: - sound (self, CHAN_AUTO, "ambience/methit2.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "ambience/methit2.wav", vol, ATTN_NORM); break; case 8: - sound (self, CHAN_AUTO, "ambience/woodhit2.wav", vol, ATTN_NORM); + sound (@self, CHAN_AUTO, "ambience/woodhit2.wav", vol, ATTN_NORM); break; } } @@ -105,11 +105,11 @@ void (string gibname, float dm, vector ddir) ThrowRubble = new = spawn (); sndrnd = random (); - // new.origin = self.origin doesnt work because the origin + // new.origin = @self.origin doesnt work because the origin // is at world (0,0,0). - new.origin_x = self.absmin_x + (random() * self.size_x); - new.origin_y = self.absmin_y + (random() * self.size_y); - new.origin_z = self.absmin_z + (random() * self.size_z); + new.origin_x = @self.absmin_x + (random() * @self.size_x); + new.origin_y = @self.absmin_y + (random() * @self.size_y); + new.origin_z = @self.absmin_z + (random() * @self.size_z); setmodel (new, gibname); setsize (new, '0 0 0', '0 0 0'); @@ -120,13 +120,13 @@ void (string gibname, float dm, vector ddir) ThrowRubble = new.cnt = 2; // No bounce sound for glass since initial sound drags on for a bit - if (self.spawnflags & SPAWN_GLASS) + if (@self.spawnflags & SPAWN_GLASS) new.cnt = 0; - if (self.spawnflags & SPAWN_METAL) + if (@self.spawnflags & SPAWN_METAL) new.cnt *= 3; // Play metal bounce on 3 & 6 - if (self.spawnflags & SPAWN_WOOD) { + if (@self.spawnflags & SPAWN_WOOD) { new.cnt *= 4; // Play wood bounce on 4 & 8 new.skin = 1; // Change skin to wood if wood gib } @@ -142,7 +142,7 @@ void (string gibname, float dm, vector ddir) ThrowRubble = new.think = SUB_Remove; new.ltime = time; new.nextthink = time + 10 + random () * 10; - new.dmg = self.dmg; + new.dmg = @self.dmg; new.frame = 0; new.flags = 0; }; @@ -159,14 +159,14 @@ void () wall_killed = local string md1, md2, md3, md4; sndspot = spawn(); - sndspot.origin = self.absmin; + sndspot.origin = @self.absmin; setorigin (sndspot, sndspot.origin); - if (self.spawnflags & SPAWN_GLASS) + if (@self.spawnflags & SPAWN_GLASS) sound (sndspot, CHAN_AUTO, "ambience/glassbrk.wav", 1, ATTN_NORM); - else if (self.spawnflags & SPAWN_METAL) + else if (@self.spawnflags & SPAWN_METAL) sound (sndspot, CHAN_AUTO, "ambience/metbrk.wav", 1, ATTN_NORM); - else if (self.spawnflags & SPAWN_WOOD) + else if (@self.spawnflags & SPAWN_WOOD) sound (sndspot, CHAN_AUTO, "ambience/woodbrk.wav", 1, ATTN_NORM); else // New rubble sound sound (sndspot, CHAN_AUTO, "ambience/wall01.wav", 1, ATTN_NORM); @@ -174,32 +174,32 @@ void () wall_killed = remove (sndspot); // determine volume of destroyed wall and throw rubble accordingly - rubble_count = (self.size_x * self.size_y * self.size_z) / 64000; + rubble_count = (@self.size_x * @self.size_y * @self.size_z) / 64000; if (rubble_count > 5) rubble_count = 6; - if (self.spawnflags & SPAWN_GLASS) { + if (@self.spawnflags & SPAWN_GLASS) { md4 = md3 = md2 = md1 = "progs/glassrub.md"; while (rubble_count > -1) { - self.dest_x = (random () * 100) - 50; - self.dest_y = (random () * 100) - 50; - self.dest_z = (random () * 100); + @self.dest_x = (random () * 100) - 50; + @self.dest_y = (random () * 100) - 50; + @self.dest_z = (random () * 100); // This was cut down by 1/5 to deal with packet overflow errors - ThrowRubble (md1, -100, self.dest); - ThrowRubble (md2, -100, self.dest); - ThrowRubble (md3, -100, self.dest); - ThrowRubble (md4, -100, self.dest); + ThrowRubble (md1, -100, @self.dest); + ThrowRubble (md2, -100, @self.dest); + ThrowRubble (md3, -100, @self.dest); + ThrowRubble (md4, -100, @self.dest); rubble_count--; } } else { - if (self.spawnflags & SPAWN_METAL) { + if (@self.spawnflags & SPAWN_METAL) { md1 = "progs/mwrub1.mdl"; md2 = "progs/mwrub2.mdl"; md4 = md3 = "progs/mwrub3.mdl"; - } else if (self.spawnflags & SPAWN_WOOD) { + } else if (@self.spawnflags & SPAWN_WOOD) { md1 = "progs/mwrub1.mdl"; md4 = md2 = "progs/mwrub2.mdl"; md3 = "progs/mwrub3.mdl"; @@ -210,37 +210,37 @@ void () wall_killed = } while (rubble_count > -1) { - self.dest_x = (random () * 100) - 50; - self.dest_y = (random () * 100) - 50; - self.dest_z = (random () * 100); + @self.dest_x = (random () * 100) - 50; + @self.dest_y = (random () * 100) - 50; + @self.dest_z = (random () * 100); - ThrowRubble (md1, self.health, self.dest); - ThrowRubble (md2, self.health, self.dest); - ThrowRubble (md3, self.health, self.dest); - ThrowRubble (md4, self.health, self.dest); + ThrowRubble (md1, @self.health, @self.dest); + ThrowRubble (md2, @self.health, @self.dest); + ThrowRubble (md3, @self.health, @self.dest); + ThrowRubble (md4, @self.health, @self.dest); rubble_count--; } } - activator = self; + activator = @self; SUB_UseTargets (); - self.no_obj = TRUE; // mine fix - mines will detonate if spawnmaster.no_obj = TRUE (blown up) - remove (self); + @self.no_obj = TRUE; // mine fix - mines will detonate if spawnmaster.no_obj = TRUE (blown up) + remove (@self); }; void() wall_pain = { - if (self.health > 0) - self.health = self.max_health; + if (@self.health > 0) + @self.health = @self.max_health; }; void() wall_use = { - self.health = -100; - self.dest_x = (random () * 10) - 5; - self.dest_y = (random () * 10) - 5; - self.dest_z = (random () * 10); + @self.health = -100; + @self.dest_x = (random () * 10) - 5; + @self.dest_y = (random () * 10) - 5; + @self.dest_z = (random () * 10); wall_killed (); }; @@ -269,23 +269,23 @@ wood spawnflag is set. */ void() exploding_wall = { - setmodel (self, self.model); + setmodel (@self, @self.model); // New precache routine precache_sound("zombie/z_hit.wav"); // for damage - if (self.spawnflags & SPAWN_GLASS) { + if (@self.spawnflags & SPAWN_GLASS) { precache_model("progs/glassrub.mdl"); precache_sound("ambience/glassbrk.wav"); - } else if (self.spawnflags & SPAWN_METAL) { + } else if (@self.spawnflags & SPAWN_METAL) { precache_model("progs/mwrub1.mdl"); precache_model("progs/mwrub2.mdl"); precache_model("progs/mwrub3.mdl"); precache_sound("ambience/metbrk.wav"); precache_sound("ambience/methit1.wav"); precache_sound("ambience/methit2.wav"); - } else if (self.spawnflags & SPAWN_WOOD) { + } else if (@self.spawnflags & SPAWN_WOOD) { precache_model("progs/mwrub1.mdl"); precache_model("progs/mwrub2.mdl"); precache_model("progs/mwrub3.mdl"); @@ -301,29 +301,29 @@ void() exploding_wall = precache_sound("ambience/brikhit2.wav"); } - self.solid = SOLID_BBOX; - self.movetype = MOVETYPE_NONE; + @self.solid = SOLID_BBOX; + @self.movetype = MOVETYPE_NONE; // POX v1.2 - default gib damage to 1 - if (!self.dmg) - self.dmg = 1; + if (!@self.dmg) + @self.dmg = 1; - self.nobleed = TRUE; + @self.nobleed = TRUE; - if (self.health) { - self.max_health = self.health; - self.th_die = wall_killed; - self.takedamage = DAMAGE_YES; + if (@self.health) { + @self.max_health = @self.health; + @self.th_die = wall_killed; + @self.takedamage = DAMAGE_YES; } else { - self.max_health = 100; - self.th_die = wall_killed; - self.takedamage = DAMAGE_YES; + @self.max_health = 100; + @self.th_die = wall_killed; + @self.takedamage = DAMAGE_YES; } - self.th_pain = wall_pain; + @self.th_pain = wall_pain; - if (self.targetname) { - self.use = wall_use; - self.max_health = 10000; + if (@self.targetname) { + @self.use = wall_use; + @self.max_health = 10000; } }; diff --git a/ParoxysmII/source/weapons.r b/ParoxysmII/source/weapons.r index a920c4f..7647c33 100644 --- a/ParoxysmII/source/weapons.r +++ b/ParoxysmII/source/weapons.r @@ -85,9 +85,9 @@ void() W_FireAxe = local vector source; local vector org; - makevectors (self.v_angle); - source = self.origin + '0 0 16'; - traceline (source, source + v_forward*64, FALSE, self); + makevectors (@self.v_angle); + source = @self.origin + '0 0 16'; + traceline (source, source + v_forward*64, FALSE, @self); if (trace_fraction == 1.0) return; @@ -97,11 +97,11 @@ void() W_FireAxe = trace_ent.axhitme = 1; SpawnBlood (org, 20); //if (deathmatch > 3) - // T_Damage (trace_ent, self, self, 75); + // T_Damage (trace_ent, @self, @self, 75); //else - T_Damage (trace_ent, self, self, 20); + T_Damage (trace_ent, @self, @self, 20); } else { // hit wall - sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); + sound (@self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_GUNSHOT); @@ -126,11 +126,11 @@ void(vector org, vector vel) SpawnMeatSpray = local entity missile; missile = spawn (); - missile.owner = self; + missile.owner = @self; missile.movetype = MOVETYPE_BOUNCE; missile.solid = SOLID_NOT; - makevectors (self.angles); + makevectors (@self.angles); missile.velocity = vel; missile.velocity_z = missile.velocity_z + 250 + 50*random(); @@ -180,7 +180,7 @@ void(float damage) spawn_touchblood = vel = wall_velocity () * 0.2; - SpawnBlood (self.origin + vel*0.01, damage); + SpawnBlood (@self.origin + vel*0.01, damage); }; /* @@ -214,7 +214,7 @@ void() ApplyMultiDamage = { if (!multi_ent) return; - T_Damage (multi_ent, self, self, multi_damage); + T_Damage (multi_ent, @self, @self, multi_damage); }; void(entity hit, float damage) AddMultiDamage = @@ -313,20 +313,20 @@ void(float shotcount, vector dir, vector spread) FireBullets2 = local vector direction; local vector src; - makevectors(self.v_angle); + makevectors(@self.v_angle); - src = self.origin + v_forward*10; - src_z = self.absmin_z + self.size_z * 0.7; + src = @self.origin + v_forward*10; + src_z = @self.absmin_z + @self.size_z * 0.7; ClearMultiDamage (); - traceline (src, src + dir*2048, FALSE, self); + traceline (src, src + dir*2048, FALSE, @self); puff_org = trace_endpos - dir*4; while (shotcount > 0) { direction = dir + crandom()*spread_x*v_right + crandom()*spread_y*v_up; - traceline (src, src + direction*2048, FALSE, self); + traceline (src, src + direction*2048, FALSE, @self); if (trace_fraction != 1.0) TraceAttack (8, direction); //POX 4*2 @@ -349,20 +349,20 @@ void(float shotcount, vector dir, vector spread) FireBullets = local vector direction; local vector src; - makevectors(self.v_angle); + makevectors(@self.v_angle); - src = self.origin + v_forward*10; - src_z = self.absmin_z + self.size_z * 0.7; + src = @self.origin + v_forward*10; + src_z = @self.absmin_z + @self.size_z * 0.7; ClearMultiDamage (); - traceline (src, src + dir*2048, FALSE, self); + traceline (src, src + dir*2048, FALSE, @self); puff_org = trace_endpos - dir*4; while (shotcount > 0) { direction = dir + crandom()*spread_x*v_right + crandom()*spread_y*v_up; - traceline (src, src + direction*2048, FALSE, self); + traceline (src, src + direction*2048, FALSE, @self); if (trace_fraction != 1.0) TraceAttack (4, direction); @@ -381,18 +381,18 @@ void() W_FireShotgun = { local vector dir; - sound (self, CHAN_WEAPON, "weapons/tsfire.wav", 1, ATTN_NORM); + sound (@self, CHAN_WEAPON, "weapons/tsfire.wav", 1, ATTN_NORM); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_SMALLKICK); //POX - May not need this (SVC_SMALLKICK?) - if (self.flags & FL_ONGROUND) - self.velocity = self.velocity + v_forward* -35; + if (@self.flags & FL_ONGROUND) + @self.velocity = @self.velocity + v_forward* -35; - self.currentammo = self.ammo_shells = self.ammo_shells - 1; + @self.currentammo = @self.ammo_shells = @self.ammo_shells - 1; - dir = aim (self, 100000); + dir = aim (@self, 100000); FireBullets (6, dir, '0.04 0.04 0'); }; @@ -411,24 +411,24 @@ void() W_FireSuperShotgun = used = 2; //POX v1.1 don't plat tShot sound... - if (self.currentammo == 1) + if (@self.currentammo == 1) { bullets = 6; used = 1; } - sound (self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM); + sound (@self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_BIGKICK); - if (self.flags & FL_ONGROUND) - self.velocity = self.velocity + v_forward* -60; + if (@self.flags & FL_ONGROUND) + @self.velocity = @self.velocity + v_forward* -60; //if (deathmatch != 4) - self.currentammo = self.ammo_shells = self.ammo_shells - used; + @self.currentammo = @self.ammo_shells = @self.ammo_shells - used; - dir = aim (self, 100000); + dir = aim (@self, 100000); FireBullets (14, dir, '0.14 0.08 0'); }; @@ -445,17 +445,17 @@ void() T_MissileTouch = { local float damg; - if (other == self.owner) + if (other == @self.owner) return; // don't explode on owner - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; - if (pointcontents(self.origin) == CONTENT_SKY) + if (pointcontents(@self.origin) == CONTENT_SKY) { - remove(self); + remove(@self); return; } @@ -464,26 +464,26 @@ void() T_MissileTouch = if (other.health) { other.deathtype = "rocket"; - T_Damage (other, self, self.owner, damg ); + T_Damage (other, @self, @self.owner, damg ); } // don't do radius damage to the other, because all the damage // was done in the impact - T_RadiusDamage (self, self.owner, 90, other, "rocket"); + T_RadiusDamage (@self, @self.owner, 90, other, "rocket"); -// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); - self.origin = self.origin - 8 * normalize(self.velocity); +// sound (@self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); + @self.origin = @self.origin - 8 * normalize(@self.velocity); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); - remove(self); + remove(@self); }; @@ -495,22 +495,22 @@ W_FireRocket */ void(vector barrel) W_FireRocket = { - self.currentammo = self.ammo_rockets = self.ammo_rockets - 0.5; + @self.currentammo = @self.ammo_rockets = @self.ammo_rockets - 0.5; //if player fired last rocket reset the reload bit - if (self.ammo_rockets == 0) - self.reload_rocket = 0; + if (@self.ammo_rockets == 0) + @self.reload_rocket = 0; else //player has rockets left so ad 1 to reload count - self.reload_rocket = self.reload_rocket + 1; + @self.reload_rocket = @self.reload_rocket + 1; newmis = spawn (); - newmis.owner = self; + newmis.owner = @self; newmis.movetype = MOVETYPE_TOSS; newmis.solid = SOLID_BBOX; // set newmis speed - makevectors (self.v_angle); + makevectors (@self.v_angle); newmis.velocity = v_forward*1100 + v_up * 220 + v_right* -22; @@ -527,7 +527,7 @@ void(vector barrel) W_FireRocket = setmodel (newmis, "progs/grenade.mdl"); setsize (newmis, '0 0 0', '0 0 0'); - setorigin (newmis, self.origin + v_forward* 8 + v_right* 12 + barrel); + setorigin (newmis, @self.origin + v_forward* 8 + v_right* 12 + barrel); }; //============================================================================= @@ -535,21 +535,21 @@ void(vector barrel) W_FireRocket = void() GrenadeExplode = { - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; - T_RadiusDamage (self, self.owner, 120, world, "grenade"); + T_RadiusDamage (@self, @self.owner, 120, world, "grenade"); WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_EXPLOSION); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); - remove (self); + remove (@self); }; void() GrenadeTouch = @@ -558,7 +558,7 @@ void() GrenadeTouch = r=random(); - if (other == self.owner) + if (other == @self.owner) return; // don't explode on owner if (other.takedamage == DAMAGE_AIM) { @@ -568,12 +568,12 @@ void() GrenadeTouch = //pick a bounce sound if (r < 0.75) - sound (self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); else - sound (self, CHAN_VOICE, "weapons/bounce2.wav", 1, ATTN_NORM); + sound (@self, CHAN_VOICE, "weapons/bounce2.wav", 1, ATTN_NORM); - if (self.velocity == '0 0 0') - self.avelocity = '0 0 0'; + if (@self.velocity == '0 0 0') + @self.avelocity = '0 0 0'; }; /* @@ -583,32 +583,32 @@ W_FireGrenade */ void() W_FireGrenade = { - self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; + @self.currentammo = @self.ammo_rockets = @self.ammo_rockets - 1; - sound (self, CHAN_WEAPON, "weapons/gren.wav", 1, ATTN_NORM); + sound (@self, CHAN_WEAPON, "weapons/gren.wav", 1, ATTN_NORM); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_SMALLKICK); - if (self.flags & FL_ONGROUND) - self.velocity = self.velocity + v_forward* -75; + if (@self.flags & FL_ONGROUND) + @self.velocity = @self.velocity + v_forward* -75; newmis = spawn (); newmis.voided=0; - newmis.owner = self; + newmis.owner = @self; newmis.movetype = MOVETYPE_BOUNCE; newmis.solid = SOLID_BBOX; newmis.classname = "grenade"; // set newmis speed - makevectors (self.v_angle); + makevectors (@self.v_angle); - if (self.v_angle_x) + if (@self.v_angle_x) newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10; else { - newmis.velocity = aim(self, 10000); + newmis.velocity = aim(@self, 10000); newmis.velocity = newmis.velocity * 600; newmis.velocity_z = 200; } @@ -626,7 +626,7 @@ void() W_FireGrenade = setmodel (newmis, "progs/grenade.mdl"); setsize (newmis, '0 0 0', '0 0 0'); - setorigin (newmis, self.origin); + setorigin (newmis, @self.origin); }; @@ -635,20 +635,20 @@ void() W_FireGrenade = void() plasma_touch = { - if (other == self.owner) + if (other == @self.owner) return; - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing - if (pointcontents(self.origin) == CONTENT_SKY) + if (pointcontents(@self.origin) == CONTENT_SKY) { - remove(self); + remove(@self); return; } @@ -657,19 +657,19 @@ void() plasma_touch = { spawn_touchblood (7); other.deathtype = "plasma"; - T_Damage (other, self, self.owner, 7); + T_Damage (other, @self, @self.owner, 7); } else { WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); } - remove(self); + remove(@self); }; @@ -677,7 +677,7 @@ void(vector org, vector dir) launch_plasma = { newmis = spawn (); newmis.voided=0; - newmis.owner = self; + newmis.owner = @self; newmis.movetype = MOVETYPE_FLYMISSILE; newmis.solid = SOLID_BBOX; @@ -698,17 +698,17 @@ void(float ox) W_FirePlasma = { local vector dir; - makevectors (self.v_angle); + makevectors (@self.v_angle); - sound (self, CHAN_WEAPON, "weapons/plasma.wav", 1, ATTN_NORM); + sound (@self, CHAN_WEAPON, "weapons/plasma.wav", 1, ATTN_NORM); - self.currentammo = self.ammo_cells = self.ammo_cells - 1; + @self.currentammo = @self.ammo_cells = @self.ammo_cells - 1; - dir = aim (self, 1000); + dir = aim (@self, 1000); - launch_plasma (self.origin + v_forward*12 + '0 0 12' + v_right*ox, dir); + launch_plasma (@self.origin + v_forward*12 + '0 0 12' + v_right*ox, dir); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_SMALLKICK); }; @@ -717,16 +717,16 @@ void(float ox) W_FirePlasma = void() spike_touch = { - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing - if (pointcontents (self.origin) == CONTENT_SKY) { - remove (self); + if (pointcontents (@self.origin) == CONTENT_SKY) { + remove (@self); return; } @@ -734,31 +734,31 @@ void() spike_touch = if (other.takedamage) { spawn_touchblood (9); other.deathtype = "nail"; - T_Damage (other, self, self.owner, 9); + T_Damage (other, @self, @self.owner, 9); } else { WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_SPIKE); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); } - remove (self); + remove (@self); }; void() superspike_touch = { - if (self.voided) { + if (@self.voided) { return; } - self.voided = 1; + @self.voided = 1; if (other.solid == SOLID_TRIGGER) return; // trigger field, do nothing - if (pointcontents (self.origin) == CONTENT_SKY) { - remove (self); + if (pointcontents (@self.origin) == CONTENT_SKY) { + remove (@self); return; } @@ -766,17 +766,17 @@ void() superspike_touch = if (other.takedamage) { spawn_touchblood (18); other.deathtype = "supernail"; - T_Damage (other, self, self.owner, 18); + T_Damage (other, @self, @self.owner, 18); } else { WriteByte (MSG_MULTICAST, SVC_TEMPENTITY); WriteByte (MSG_MULTICAST, TE_SUPERSPIKE); - WriteCoord (MSG_MULTICAST, self.origin_x); - WriteCoord (MSG_MULTICAST, self.origin_y); - WriteCoord (MSG_MULTICAST, self.origin_z); - multicast (self.origin, MULTICAST_PHS); + WriteCoord (MSG_MULTICAST, @self.origin_x); + WriteCoord (MSG_MULTICAST, @self.origin_y); + WriteCoord (MSG_MULTICAST, @self.origin_z); + multicast (@self.origin, MULTICAST_PHS); } - remove (self); + remove (@self); }; @@ -792,7 +792,7 @@ void(vector org, vector dir) launch_spike = { newmis = spawn (); newmis.voided=0; - newmis.owner = self; + newmis.owner = @self; newmis.movetype = MOVETYPE_FLYMISSILE; newmis.solid = SOLID_BBOX; @@ -813,18 +813,18 @@ void(float ox) W_FireNails = { local vector dir; - makevectors (self.v_angle); + makevectors (@self.v_angle); - self.weaponmodel = "progs/v_nailgl.mdl"; // light up nailgun barrels + @self.weaponmodel = "progs/v_nailgl.mdl"; // light up nailgun barrels - sound (self, CHAN_WEAPON, "weapons/hog.wav", 0.8, ATTN_NORM); + sound (@self, CHAN_WEAPON, "weapons/hog.wav", 0.8, ATTN_NORM); - self.currentammo = self.ammo_nails = self.ammo_nails - 1; + @self.currentammo = @self.ammo_nails = @self.ammo_nails - 1; - dir = aim (self, 1000); - launch_spike (self.origin + '0 0 16' + v_right*ox, dir); + dir = aim (@self, 1000); + launch_spike (@self.origin + '0 0 16' + v_right*ox, dir); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_SMALLKICK); }; @@ -833,16 +833,16 @@ void() W_FireSuperSpikes = { local vector dir; - sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); - self.attack_finished = time + 0.2; + sound (@self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); + @self.attack_finished = time + 0.2; //if (deathmatch != 4) - self.currentammo = self.ammo_nails = self.ammo_nails - 2; - dir = aim (self, 1000); - launch_spike (self.origin + '0 0 16', dir); + @self.currentammo = @self.ammo_nails = @self.ammo_nails - 2; + dir = aim (@self, 1000); + launch_spike (@self.origin + '0 0 16', dir); newmis.touch = superspike_touch; setmodel (newmis, "progs/s_spike.mdl"); setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_SMALLKICK); }; @@ -850,28 +850,28 @@ void(float ox) W_FireSpikes = { local vector dir; - makevectors (self.v_angle); + makevectors (@self.v_angle); - if (self.ammo_nails >= 2 && self.weapon == IT_SUPER_NAILGUN) { + if (@self.ammo_nails >= 2 && @self.weapon == IT_SUPER_NAILGUN) { W_FireSuperSpikes (); return; } - if (self.ammo_nails < 1) { - self.weapon = W_BestWeapon (); + if (@self.ammo_nails < 1) { + @self.weapon = W_BestWeapon (); W_SetCurrentAmmo (); return; } - sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); - self.attack_finished = time + 0.2; + sound (@self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); + @self.attack_finished = time + 0.2; - self.currentammo = --self.ammo_nails; + @self.currentammo = --@self.ammo_nails; - dir = aim (self, 1000); - launch_spike (self.origin + '0 0 16' + v_right * ox, dir); + dir = aim (@self, 1000); + launch_spike (@self.origin + '0 0 16' + v_right * ox, dir); - msg_entity = self; + msg_entity = @self; WriteByte (MSG_ONE, SVC_SMALLKICK); }; @@ -891,78 +891,78 @@ void() W_SetCurrentAmmo = { player_run (); // get out of any weapon firing states - self.items &= ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS); - self.weaponframe = 0; + @self.items &= ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS); + @self.weaponframe = 0; - switch (self.weapon) { + switch (@self.weapon) { case IT_AXE: - self.weaponmodel = "progs/v_axe.mdl"; - self.currentammo = 0; + @self.weaponmodel = "progs/v_axe.mdl"; + @self.currentammo = 0; break; case IT_TSHOT: - self.weaponmodel = "progs/v_tshot.mdl"; - self.currentammo = self.ammo_shells; - self.items |= IT_SHELLS; + @self.weaponmodel = "progs/v_tshot.mdl"; + @self.currentammo = @self.ammo_shells; + @self.items |= IT_SHELLS; break; case IT_COMBOGUN: - self.weaponmodel = "progs/v_combo.mdl"; + @self.weaponmodel = "progs/v_combo.mdl"; // ammo depends on last active trigger - if (self.which_ammo == 1 && self.ammo_rockets > 0) { - self.currentammo = self.ammo_rockets; - self.items |= IT_ROCKETS; + if (@self.which_ammo == 1 && @self.ammo_rockets > 0) { + @self.currentammo = @self.ammo_rockets; + @self.items |= IT_ROCKETS; } else { - self.which_ammo = 0; - self.currentammo = self.ammo_shells; - self.items |= IT_SHELLS; + @self.which_ammo = 0; + @self.currentammo = @self.ammo_shells; + @self.items |= IT_SHELLS; } break; case IT_PLASMAGUN: - self.weaponmodel = "progs/v_plasma.mdl"; - self.currentammo = self.ammo_cells; - self.items |= IT_CELLS; + @self.weaponmodel = "progs/v_plasma.mdl"; + @self.currentammo = @self.ammo_cells; + @self.items |= IT_CELLS; break; case IT_SUPER_NAILGUN: - self.weaponmodel = "progs/v_nailg.mdl"; - self.currentammo = self.ammo_nails; - self.items |= IT_NAILS; + @self.weaponmodel = "progs/v_nailg.mdl"; + @self.currentammo = @self.ammo_nails; + @self.items |= IT_NAILS; break; case IT_GRENADE_LAUNCHER: - self.weaponmodel = "progs/v_gren.mdl"; - self.currentammo = self.ammo_rockets; - self.items |= IT_ROCKETS; + @self.weaponmodel = "progs/v_gren.mdl"; + @self.currentammo = @self.ammo_rockets; + @self.items |= IT_ROCKETS; break; case IT_ROCKET_LAUNCHER: - self.weaponmodel = "progs/v_rhino.mdl"; - self.currentammo = self.ammo_rockets; - self.items |= IT_ROCKETS; + @self.weaponmodel = "progs/v_rhino.mdl"; + @self.currentammo = @self.ammo_rockets; + @self.items |= IT_ROCKETS; break; default: - self.weaponmodel = ""; - self.currentammo = 0; + @self.weaponmodel = ""; + @self.currentammo = 0; } }; float() W_BestWeapon = { - local float it = self.items; + local float it = @self.items; // A hacky way to keep Super Shotgun active when out of rockets - if ((self.weapon == IT_COMBOGUN) && (self.ammo_shells >= 2 && (self.ammo_rockets < 1))) + if ((@self.weapon == IT_COMBOGUN) && (@self.ammo_shells >= 2 && (@self.ammo_rockets < 1))) return IT_COMBOGUN; - if (self.ammo_rockets > 0 && (it & IT_ROCKET_LAUNCHER)) + if (@self.ammo_rockets > 0 && (it & IT_ROCKET_LAUNCHER)) return IT_ROCKET_LAUNCHER; - if (self.ammo_cells > 0 && (it & IT_PLASMAGUN)) + if (@self.ammo_cells > 0 && (it & IT_PLASMAGUN)) return IT_PLASMAGUN; - if (self.ammo_nails > 0 && (it & IT_SUPER_NAILGUN)) + if (@self.ammo_nails > 0 && (it & IT_SUPER_NAILGUN)) return IT_SUPER_NAILGUN; - if (self.ammo_shells > 1 && (it & IT_COMBOGUN)) + if (@self.ammo_shells > 1 && (it & IT_COMBOGUN)) return IT_COMBOGUN; - if (self.ammo_shells > 0 && (it & IT_TSHOT)) + if (@self.ammo_shells > 0 && (it & IT_TSHOT)) return IT_TSHOT; return IT_AXE; @@ -970,13 +970,13 @@ float() W_BestWeapon = float() W_CheckNoAmmo = { - if (self.currentammo > 0) + if (@self.currentammo > 0) return TRUE; - if (self.weapon == IT_AXE) + if (@self.weapon == IT_AXE) return TRUE; - self.weapon = W_BestWeapon (); + @self.weapon = W_BestWeapon (); W_SetCurrentAmmo (); @@ -1004,13 +1004,13 @@ void() W_Attack = return; } - makevectors (self.v_angle); // calculate forward angle for velocity - self.show_hostile = time + 1; // wake monsters up + makevectors (@self.v_angle); // calculate forward angle for velocity + @self.show_hostile = time + 1; // wake monsters up - switch (self.weapon) { + switch (@self.weapon) { case IT_AXE: - self.attack_finished = time + 0.5; - sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM); + @self.attack_finished = time + 0.5; + sound (@self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM); r = random (); if (r < 0.25) @@ -1024,60 +1024,60 @@ void() W_Attack = return; case IT_TSHOT: - if (self.ammo_shells < 1) { - sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); - self.attack_finished = time + 0.5; + if (@self.ammo_shells < 1) { + sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); + @self.attack_finished = time + 0.5; return; } - if (self.st_tshotload > time) // T-Shot still priming + if (@self.st_tshotload > time) // T-Shot still priming return; - if ((self.prime_tshot) && (self.ammo_shells > 2)) { // OK for triple + if ((@self.prime_tshot) && (@self.ammo_shells > 2)) { // OK for triple player_tshot1 (); W_FireTShot (); - self.attack_finished = time + 0.7; + @self.attack_finished = time + 0.7; } else { // Normal shot player_shot1 (); W_FireShotgun (); - self.attack_finished = time + 0.5; + @self.attack_finished = time + 0.5; } // reset prime - self.prime_tshot = FALSE; + @self.prime_tshot = FALSE; return; case IT_COMBOGUN: - if (self.st_sshotgun > time) + if (@self.st_sshotgun > time) return; - self.items &= ~IT_ROCKETS; - self.items |= IT_SHELLS; + @self.items &= ~IT_ROCKETS; + @self.items |= IT_SHELLS; - self.currentammo = self.ammo_shells; - self.which_ammo = 0; + @self.currentammo = @self.ammo_shells; + @self.which_ammo = 0; - if (self.ammo_shells < 1) { // misfire - sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); - self.st_sshotgun = time + 0.7; + if (@self.ammo_shells < 1) { // misfire + sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); + @self.st_sshotgun = time + 0.7; return; } player_shot1 (); W_FireSuperShotgun (); - self.st_sshotgun = time + 0.7; + @self.st_sshotgun = time + 0.7; return; case IT_PLASMAGUN: - if ((self.st_plasma > time) || (self.st_mplasma > time)) + if ((@self.st_plasma > time) || (@self.st_mplasma > time)) return; - if (self.ammo_cells < 1) { - sound (self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM); + if (@self.ammo_cells < 1) { + sound (@self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM); return; } - if (!self.LorR) // which barrel is supposed to fire? + if (!@self.LorR) // which barrel is supposed to fire? player_plasma1 (); else player_plasma2 (); @@ -1085,11 +1085,11 @@ void() W_Attack = return; case IT_SUPER_NAILGUN: - if (self.st_nailgun > time) + if (@self.st_nailgun > time) return; - if (self.ammo_nails < 1) { - sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); + if (@self.ammo_nails < 1) { + sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); return; } @@ -1097,38 +1097,38 @@ void() W_Attack = return; case IT_GRENADE_LAUNCHER: - if (self.st_grenade > time) + if (@self.st_grenade > time) return; - if (self.ammo_rockets < 1) { - sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); - self.st_grenade = time + 0.6; + if (@self.ammo_rockets < 1) { + sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); + @self.st_grenade = time + 0.6; return; } player_grenade1 (); W_FireGrenade (); - self.st_grenade = time + 0.6; + @self.st_grenade = time + 0.6; return; case IT_ROCKET_LAUNCHER: - if (self.st_rocketload > time) // still reloading + if (@self.st_rocketload > time) // still reloading return; - if (self.ammo_rockets < 1) { // no ammo - sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); - self.attack_finished = time + 0.4; + if (@self.ammo_rockets < 1) { // no ammo + sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM); + @self.attack_finished = time + 0.4; return; } - if (self.reload_rocket > 6) { - sound (self, CHAN_AUTO, "weapons/error.wav", 1, ATTN_NORM); - self.attack_finished = time + 0.42; + if (@self.reload_rocket > 6) { + sound (@self, CHAN_AUTO, "weapons/error.wav", 1, ATTN_NORM); + @self.attack_finished = time + 0.42; return; } player_rocket1 (); - self.attack_finished = time + 0.4; + @self.attack_finished = time + 0.4; return; } }; @@ -1143,66 +1143,66 @@ void() W_ChangeWeapon = local float no_ammo = 0; local float selected = NIL; - self.which_ammo = 0; // Default ammo to shells for SuperShotgun + @self.which_ammo = 0; // Default ammo to shells for SuperShotgun - switch (self.impulse) { + switch (@self.impulse) { case 1: selected = IT_AXE; break; case 2: selected = IT_TSHOT; - if (self.ammo_shells < 1) + if (@self.ammo_shells < 1) no_ammo = 1; break; case 3: selected = IT_COMBOGUN; - if (self.ammo_shells < 2) { + if (@self.ammo_shells < 2) { no_ammo = 1; // allow player to still select SuperShotgun if he has rockets - if (self.ammo_rockets > 0 && (!(deathmatch & DM_AUTOSWITCH))) { - self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets, not shells + if (@self.ammo_rockets > 0 && (!(deathmatch & DM_AUTOSWITCH))) { + @self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets, not shells no_ammo = 0; } } break; case 4: selected = IT_PLASMAGUN; - if (self.ammo_cells < 1) + if (@self.ammo_cells < 1) no_ammo = 1; break; case 5: selected = IT_SUPER_NAILGUN; - if (self.ammo_nails < 2) + if (@self.ammo_nails < 2) no_ammo = 1; break; case 6: selected = IT_GRENADE_LAUNCHER; - if (self.ammo_rockets < 1) + if (@self.ammo_rockets < 1) no_ammo = 1; break; case 7: selected = IT_ROCKET_LAUNCHER; - if (self.ammo_rockets < 1) + if (@self.ammo_rockets < 1) no_ammo = 1; break; } - self.impulse = 0; + @self.impulse = 0; - if (!(self.items & selected)) { // don't have the weapon or the ammo - sprint (self, PRINT_HIGH, "no weapon.\n"); + if (!(@self.items & selected)) { // don't have the weapon or the ammo + sprint (@self, PRINT_HIGH, "no weapon.\n"); return; } if (no_ammo) { // don't have the ammo - sprint (self, PRINT_HIGH, "not enough ammo.\n"); + sprint (@self, PRINT_HIGH, "not enough ammo.\n"); return; } // // set weapon, set ammo // - self.weapon = selected; + @self.weapon = selected; W_SetCurrentAmmo (); }; @@ -1228,55 +1228,55 @@ void () CycleWeaponCommand = { local float am; - self.impulse = 0; + @self.impulse = 0; while (1) { am = 0; - self.which_ammo = 0; // Default ammo to shells for SuperShotgun + @self.which_ammo = 0; // Default ammo to shells for SuperShotgun - switch (self.weapon) { + switch (@self.weapon) { case IT_ROCKET_LAUNCHER: - self.weapon = IT_AXE; + @self.weapon = IT_AXE; break; case IT_AXE: - self.weapon = IT_TSHOT; - if (self.ammo_shells < 1) + @self.weapon = IT_TSHOT; + if (@self.ammo_shells < 1) am = 1; break; case IT_TSHOT: - self.weapon = IT_COMBOGUN; - if (self.ammo_shells < 2) { + @self.weapon = IT_COMBOGUN; + if (@self.ammo_shells < 2) { am = 1; // allow player to select SuperShotgun if he has rockets - if (self.ammo_rockets > 0 && (!(deathmatch & DM_AUTOSWITCH))) { - self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets, not shells + if (@self.ammo_rockets > 0 && (!(deathmatch & DM_AUTOSWITCH))) { + @self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets, not shells am = 0; } } break; case IT_COMBOGUN: - self.weapon = IT_PLASMAGUN; - if (self.ammo_cells < 1) + @self.weapon = IT_PLASMAGUN; + if (@self.ammo_cells < 1) am = 1; break; case IT_PLASMAGUN: - self.weapon = IT_SUPER_NAILGUN; - if (self.ammo_nails < 2) + @self.weapon = IT_SUPER_NAILGUN; + if (@self.ammo_nails < 2) am = 1; break; case IT_SUPER_NAILGUN: - self.weapon = IT_GRENADE_LAUNCHER; - if (self.ammo_rockets < 1) + @self.weapon = IT_GRENADE_LAUNCHER; + if (@self.ammo_rockets < 1) am = 1; break; case IT_GRENADE_LAUNCHER: - self.weapon = IT_ROCKET_LAUNCHER; - if (self.ammo_rockets < 1) + @self.weapon = IT_ROCKET_LAUNCHER; + if (@self.ammo_rockets < 1) am = 1; break; } - if ((self.items & self.weapon) && am == 0) { + if ((@self.items & @self.weapon) && am == 0) { W_SetCurrentAmmo (); return; } @@ -1295,49 +1295,49 @@ void() CycleWeaponReverseCommand = { local float am; - self.impulse = 0; + @self.impulse = 0; while (1) { am = 0; - self.which_ammo = 0; // Default ammo to shells for SuperShotgun + @self.which_ammo = 0; // Default ammo to shells for SuperShotgun - if (self.weapon == IT_ROCKET_LAUNCHER) { - self.weapon = IT_GRENADE_LAUNCHER; - if (self.ammo_rockets < 1) + if (@self.weapon == IT_ROCKET_LAUNCHER) { + @self.weapon = IT_GRENADE_LAUNCHER; + if (@self.ammo_rockets < 1) am = 1; - } else if (self.weapon == IT_GRENADE_LAUNCHER) { - self.weapon = IT_SUPER_NAILGUN; - if (self.ammo_nails < 2) + } else if (@self.weapon == IT_GRENADE_LAUNCHER) { + @self.weapon = IT_SUPER_NAILGUN; + if (@self.ammo_nails < 2) am = 1; - } else if (self.weapon == IT_SUPER_NAILGUN) { - self.weapon = IT_PLASMAGUN; - if (self.ammo_cells < 1) + } else if (@self.weapon == IT_SUPER_NAILGUN) { + @self.weapon = IT_PLASMAGUN; + if (@self.ammo_cells < 1) am = 1; - } else if (self.weapon == IT_PLASMAGUN) { - self.weapon = IT_COMBOGUN; + } else if (@self.weapon == IT_PLASMAGUN) { + @self.weapon = IT_COMBOGUN; // allow player to select ComboGun if he has rockets // BUT NOT IF DM_AUTOSWITCH!! - if (self.ammo_shells < 2) { + if (@self.ammo_shells < 2) { am = 1; - if (self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) { - self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells + if (@self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) { + @self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells am = 0; } } - } else if (self.weapon == IT_COMBOGUN) { - self.weapon = IT_TSHOT; - if (self.ammo_shells < 1) + } else if (@self.weapon == IT_COMBOGUN) { + @self.weapon = IT_TSHOT; + if (@self.ammo_shells < 1) am = 1; - } else if (self.weapon == IT_TSHOT) { - self.weapon = IT_AXE; - } else if (self.weapon == IT_AXE) { - self.weapon = IT_ROCKET_LAUNCHER; - if (self.ammo_rockets < 1) + } else if (@self.weapon == IT_TSHOT) { + @self.weapon = IT_AXE; + } else if (@self.weapon == IT_AXE) { + @self.weapon = IT_ROCKET_LAUNCHER; + if (@self.ammo_rockets < 1) am = 1; } - if ((self.items & self.weapon) && am == 0) { + if ((@self.items & @self.weapon) && am == 0) { W_SetCurrentAmmo (); return; } @@ -1361,37 +1361,37 @@ void() ServerflagsCommand = // + POX - Displays the server rules void() DisplayRules = { - sprint (self, PRINT_HIGH, "\nÓåòöåò Òõìåó\n----------------------\n |\n"); + sprint (@self, PRINT_HIGH, "\nÓåòöåò Òõìåó\n----------------------\n |\n"); if (deathmatch & DM_PREDATOR) - sprint (self, PRINT_HIGH, "on | Predator Mode\n"); + sprint (@self, PRINT_HIGH, "on | Predator Mode\n"); else - sprint (self, PRINT_HIGH, "ÏÆÆ | Predator Mode\n"); + sprint (@self, PRINT_HIGH, "ÏÆÆ | Predator Mode\n"); if (deathmatch & DM_DARK) - sprint (self, PRINT_HIGH, "on | Dark Mode\n"); + sprint (@self, PRINT_HIGH, "on | Dark Mode\n"); else - sprint (self, PRINT_HIGH, "ÏÆÆ | Dark Mode\n"); + sprint (@self, PRINT_HIGH, "ÏÆÆ | Dark Mode\n"); if (deathmatch & DM_LMS) - sprint (self, PRINT_HIGH, "on | Last Man Standing\n"); + sprint (@self, PRINT_HIGH, "on | Last Man Standing\n"); else - sprint (self, PRINT_HIGH, "ÏÆÆ | Last Man Standing\n"); + sprint (@self, PRINT_HIGH, "ÏÆÆ | Last Man Standing\n"); if (deathmatch & DM_FFA) - sprint (self, PRINT_HIGH, "on | Free For All\n"); + sprint (@self, PRINT_HIGH, "on | Free For All\n"); else - sprint (self, PRINT_HIGH, "ÏÆÆ | Free For All\n"); + sprint (@self, PRINT_HIGH, "ÏÆÆ | Free For All\n"); if (deathmatch & DM_GIB) - sprint (self, PRINT_HIGH, "on | Gib\n"); + sprint (@self, PRINT_HIGH, "on | Gib\n"); else - sprint (self, PRINT_HIGH, "ÏÆÆ | Gib\n"); + sprint (@self, PRINT_HIGH, "ÏÆÆ | Gib\n"); if (deathmatch & DM_AUTOSWITCH) - sprint (self, PRINT_HIGH, "on | Weapon Autoswitch\n |\n----------------------\n\n"); + sprint (@self, PRINT_HIGH, "on | Weapon Autoswitch\n |\n----------------------\n\n"); else - sprint (self, PRINT_HIGH, "ÏÆÆ | Weapon Autoswitch\n |\n----------------------\n\n"); + sprint (@self, PRINT_HIGH, "ÏÆÆ | Weapon Autoswitch\n |\n----------------------\n\n"); }; @@ -1405,7 +1405,7 @@ ImpulseCommands */ void() ImpulseCommands = { - switch (self.impulse) { + switch (@self.impulse) { case 1: case 2: case 3: @@ -1429,36 +1429,36 @@ void() ImpulseCommands = CycleWeaponReverseCommand (); break; case 16: // target identifier - self.target_id_temp = TRUE; // Make it work across level change - stuffcmd (self, "play misc/talk.wav\n"); // audio confirmation + @self.target_id_temp = TRUE; // Make it work across level change + stuffcmd (@self, "play misc/talk.wav\n"); // audio confirmation - if (self.target_id_toggle) { - self.target_id_toggle = FALSE; + if (@self.target_id_toggle) { + @self.target_id_toggle = FALSE; // don't centerprint if a message is up - if (self.target_id_finished < time) - centerprint (self, "Target Identifier OFF\n"); + if (@self.target_id_finished < time) + centerprint (@self, "Target Identifier OFF\n"); else - sprint (self, PRINT_HIGH, "Target Identifier OFF\n"); + sprint (@self, PRINT_HIGH, "Target Identifier OFF\n"); } else { - self.target_id_toggle = TRUE; + @self.target_id_toggle = TRUE; // don't centerprint if a message is up - if (self.target_id_finished < time) - centerprint (self, "Target Identifier ON\n"); + if (@self.target_id_finished < time) + centerprint (@self, "Target Identifier ON\n"); else - sprint (self, PRINT_HIGH, "Target Identifier ON\n"); + sprint (@self, PRINT_HIGH, "Target Identifier ON\n"); - self.target_id_finished = time + 3; + @self.target_id_finished = time + 3; } break; case 17: // FIXME - Toggle dlights vs lightglows - if(self.gl_fix) { - stuffcmd (self, "gl_flashblend 1\n"); - self.gl_fix = FALSE; + if(@self.gl_fix) { + stuffcmd (@self, "gl_flashblend 1\n"); + @self.gl_fix = FALSE; } else { - stuffcmd (self, "gl_flashblend 0\n"); - self.gl_fix = TRUE; + stuffcmd (@self, "gl_flashblend 0\n"); + @self.gl_fix = TRUE; } break; @@ -1467,7 +1467,7 @@ void() ImpulseCommands = break; } - self.impulse = 0; + @self.impulse = 0; }; /* @@ -1479,27 +1479,27 @@ Called every frame so impulse events can be handled as well as possible */ void() W_WeaponFrame = { - if (time < self.attack_finished) + if (time < @self.attack_finished) return; //POX - v1.1 target identifier - if (self.target_id_toggle && (time > self.target_id_finished)) + if (@self.target_id_toggle && (time > @self.target_id_finished)) ID_CheckTarget (); //POX - Don't swap nailgun skins if player is invisible or chascam is active! - if (self.weapon == IT_SUPER_NAILGUN && self.st_nailgun < time) - self.weaponmodel = "progs/v_nailg.mdl"; // cool off nailgun barrels + if (@self.weapon == IT_SUPER_NAILGUN && @self.st_nailgun < time) + @self.weaponmodel = "progs/v_nailg.mdl"; // cool off nailgun barrels // + POX - only check these if necessary (thanks to URQW patch) // 1998-08-14 Constantly checking all impulses fix by Perged - if (self.impulse == SECOND_TRIGGER) + if (@self.impulse == SECOND_TRIGGER) W_SecondTrigger (); - else if (self.impulse) + else if (@self.impulse) ImpulseCommands (); // - POX // check for attack - if (self.button0) + if (@self.button0) { SuperDamageSound (); W_Attack (); @@ -1515,12 +1515,12 @@ Plays sound if needed */ void() SuperDamageSound = { - if (self.super_damage_finished > time) + if (@self.super_damage_finished > time) { - if (self.super_sound < time) + if (@self.super_sound < time) { - self.super_sound = time + 1; - sound (self, CHAN_BODY, "items/damage3.wav", 1, ATTN_NORM); + @self.super_sound = time + 1; + sound (@self, CHAN_BODY, "items/damage3.wav", 1, ATTN_NORM); } } return; diff --git a/ParoxysmII/source/world.r b/ParoxysmII/source/world.r index d526b06..85723ce 100644 --- a/ParoxysmII/source/world.r +++ b/ParoxysmII/source/world.r @@ -180,7 +180,7 @@ void() worldspawn = #endif // custom map attributes - if (self.model == "maps/e1m8.bsp") + if (@self.model == "maps/e1m8.bsp") cvar_set ("sv_gravity", "100"); else cvar_set ("sv_gravity", "790");