if(e.frozen)
return false;
if(!IS_PLAYER(e))
- return ((e.flags & FL_MONSTER) && e.health < e.max_health);
+ return (IS_MONSTER(e) && e.health < e.max_health);
if(e.items & IT_INVINCIBLE)
return false;
self.realowner.mage_spike = world;
- pointparticles(particleeffectnum("explosion_small"), self.origin, '0 0 0', 1);
+ Send_Effect("explosion_small", self.origin, '0 0 0', 1);
RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE, other);
remove (self);
break;
}
- pointparticles(particleeffectnum(fx), head.origin, '0 0 0', 1);
+ Send_Effect(fx, head.origin, '0 0 0', 1);
}
else
{
- pointparticles(particleeffectnum("healing_fx"), head.origin, '0 0 0', 1);
+ Send_Effect("healing_fx", head.origin, '0 0 0', 1);
head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), head.max_health);
if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE))
WaypointSprite_UpdateHealth(head.sprite, head.health);
{
sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy);
- pointparticles(particleeffectnum("TE_EXPLOSION"), self.origin, '0 0 0', 1);
+ Send_Effect("TE_EXPLOSION", self.origin, '0 0 0', 1);
self.frame = mage_anim_attack;
self.attack_finished_single = time + (autocvar_g_monster_mage_attack_push_delay);
if(trace_fraction < 1)
return;
- pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1);
+ Send_Effect("spawn_event_neutral", self.origin, '0 0 0', 1);
setorigin(self, self.enemy.origin + ((v_forward * -1) * 200));
self.attack_finished_single = time + 0.2;
e.monster_loot = self.monster_loot;
- other = e;
- MUTATOR_CALLHOOK(MonsterDropItem);
+ MUTATOR_CALLHOOK(MonsterDropItem, e);
e = other;
if(e && e.monster_loot)
//if(trace_ent != targ)
//return false;
- if(targ.vehicle_flags & VHF_ISVEHICLE)
+ if(IS_VEHICLE(targ))
if(!((get_monsterinfo(ent.monsterid)).spawnflags & MON_FLAG_RANGED))
return false; // melee attacks are useless against vehicles
if(IS_SPEC(targ) || IS_OBSERVER(targ))
return false; // enemy is a spectator
- if(!(targ.vehicle_flags & VHF_ISVEHICLE))
+ if(!IS_VEHICLE(targ))
if(targ.deadflag != DEAD_NO || ent.deadflag != DEAD_NO || targ.health <= 0 || ent.health <= 0)
return false; // enemy/self is dead
if(targ.monster_owner == ent)
return false; // don't attack our pet
- if(!(targ.vehicle_flags & VHF_ISVEHICLE))
+ if(!IS_VEHICLE(targ))
if(targ.flags & FL_NOTARGET)
return false; // enemy can't be targeted
return;
if(self.enemy != other)
- if(!(other.flags & FL_MONSTER))
+ if(!IS_MONSTER(other))
if(monster_isvalidtarget(other, self))
self.enemy = other;
}
{
other = ent;
if(ent.deadflag == DEAD_DEAD) // don't call when monster isn't dead
- if(MUTATOR_CALLHOOK(MonsterRespawn))
+ if(MUTATOR_CALLHOOK(MonsterRespawn, ent))
return true; // enabled by a mutator
if(ent.spawnflags & MONSTERFLAG_NORESPAWN)
{
float current_distance = vlen((('1 0 0' * to.x) + ('0 1 0' * to.y)) - (('1 0 0' * from.x) + ('0 1 0' * from.y))); // for the sake of this check, exclude Z axis
float initial_height = 0; //min(50, (targ_distance * tanh(20)));
- float current_height = (initial_height * min(1, (current_distance / self.pass_distance)));
+ float current_height = (initial_height * min(1, self.pass_distance ? (current_distance / self.pass_distance) : 0));
//print("current_height = ", ftos(current_height), ", initial_height = ", ftos(initial_height), ".\n");
vector targpos;
targ = self.goalentity;
- monster_target = targ;
- monster_speed_run = runspeed;
- monster_speed_walk = walkspeed;
-
- if(MUTATOR_CALLHOOK(MonsterMove) || gameover || self.draggedby != world || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < self.spawn_time)
+ if (MUTATOR_CALLHOOK(MonsterMove, runspeed, walkspeed, targ)
+ || gameover
+ || self.draggedby != world
+ || (round_handler_IsActive() && !round_handler_IsRoundStarted())
+ || time < game_starttime
+ || (autocvar_g_campaign && !campaign_bots_may_start)
+ || time < self.spawn_time)
{
runspeed = walkspeed = 0;
if(time >= self.spawn_time)
return;
}
- targ = monster_target;
runspeed = bound(0, monster_speed_run * Monster_SkillModifier(), runspeed * 2); // limit maxspeed to prevent craziness
walkspeed = bound(0, monster_speed_walk * Monster_SkillModifier(), walkspeed * 2); // limit maxspeed to prevent craziness
if(!mon)
return; // nothing to remove
- pointparticles(particleeffectnum("item_pickup"), mon.origin, '0 0 0', 1);
+ Send_Effect("item_pickup", mon.origin, '0 0 0', 1);
if(mon.weaponentity)
remove(mon.weaponentity);
WaypointSprite_Kill(self.sprite);
- frag_attacker = attacker;
frag_target = self;
- MUTATOR_CALLHOOK(MonsterDies);
+ MUTATOR_CALLHOOK(MonsterDies, attacker);
if(self.health <= -100 || deathtype == DEATH_KILL) // check if we're already gibbed
{
if ( WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max) )
{
- pointparticles( particleeffectnum("arc_overheat"),
+ Send_Effect("arc_overheat",
self.beam_start, self.beam_wantdir, 1 );
sound(self, CH_WEAPON_A, "weapons/arc_stop.wav", VOL_BASE, ATTN_NORM);
}
new_dir = WarpZone_TransformVelocity(WarpZone_trace_transform, new_dir);
float is_player = (
- trace_ent.classname == "player"
+ IS_PLAYER(trace_ent)
||
trace_ent.classname == "body"
||
- (trace_ent.flags & FL_MONSTER)
+ IS_MONSTER(trace_ent)
);
if(trace_ent && trace_ent.takedamage && (is_player || WEP_CVAR(arc, beam_nonplayerdamage)))
if ( self.arc_overheat > time )
{
if ( random() < self.arc_heat_percent )
- pointparticles( particleeffectnum("arc_smoke"), smoke_origin, '0 0 0', 1 );
+ Send_Effect("arc_smoke", smoke_origin, '0 0 0', 1 );
if ( self.BUTTON_ATCK || self.BUTTON_ATCK2 )
{
- pointparticles( particleeffectnum("arc_overheat_fire"), smoke_origin, w_shotdir, 1 );
+ Send_Effect("arc_overheat_fire", smoke_origin, w_shotdir, 1 );
if ( !self.arc_smoke_sound )
{
self.arc_smoke_sound = 1;
{
if ( random() < (self.arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) /
( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) )
- pointparticles( particleeffectnum("arc_smoke"), smoke_origin, '0 0 0', 1 );
+ Send_Effect("arc_smoke", smoke_origin, '0 0 0', 1 );
}
if ( self.arc_smoke_sound && ( self.arc_overheat <= time ||
for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN, 0);
- pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
+ Send_Effect("shotgun_muzzleflash", w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
// casing code
if(autocvar_g_casings >= 1)
//te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
//te_customflash(targpos, 40, 2, '1 1 1');
- is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || (trace_ent.flags & FL_MONSTER));
+ is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
if((trace_fraction < 1) // if trace is good, apply the damage and remove self
&& (trace_ent.takedamage == DAMAGE_AIM)
WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 100, MOVE_NORMAL, self);
if(!autocvar_g_monsters_edit) { sprint(self, "Monster property editing is not enabled.\n"); return; }
- if(trace_ent.flags & FL_MONSTER)
+ if(IS_MONSTER(trace_ent))
{
if(trace_ent.realowner != self) { sprint(self, "That monster does not belong to you.\n"); return; }
switch(argv(1))
makevectors(self.v_angle);
WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 100, MOVE_NORMAL, self);
- if(trace_ent.flags & FL_MONSTER)
+ if(IS_MONSTER(trace_ent))
{
if(trace_ent.realowner != self)
{
float argc = tokenize_console(command);
- // for the mutator hook system
- cmd_name = strtolower(argv(0));
- cmd_argc = argc;
- cmd_string = command;
-
// Guide for working with argc arguments by example:
// argc: 1 - 2 - 3 - 4
// argv: 0 - 1 - 2 - 3
return;
}
}
- else if(MUTATOR_CALLHOOK(SV_ParseClientCommand))
+ else if(MUTATOR_CALLHOOK(SV_ParseClientCommand, strtolower(argv(0)), argc, command))
{
return; // handled by a mutator
}
entity oldself;
oldself = self;
self = attacker;
- frag_attacker = attacker;
- frag_target = targ;
- frag_score = f;
- if(MUTATOR_CALLHOOK(GiveFragsForKill))
+ if(MUTATOR_CALLHOOK(GiveFragsForKill, attacker, targ, f))
{
f = frag_score;
self = oldself;
void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint)
{
- if(!IS_PLAYER(targ) && !(targ.flags & FL_MONSTER)) // only specified entities can be freezed
+ if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // only specified entities can be freezed
return;
if(targ.frozen)
return;
- float targ_maxhealth = ((targ.flags & FL_MONSTER) ? targ.max_health : start_health);
+ float targ_maxhealth = ((IS_MONSTER(targ)) ? targ.max_health : start_health);
targ.frozen = frozen_type;
targ.revive_progress = ((frozen_type == 3) ? 1 : 0);
}
// should this be changed at all? If so, in what way?
- frag_attacker = attacker;
- frag_target = targ;
- frag_damage = damage;
- frag_force = force;
- frag_deathtype = deathtype;
- frag_mirrordamage = mirrordamage;
- MUTATOR_CALLHOOK(PlayerDamage_Calculate);
+ MUTATOR_CALLHOOK(PlayerDamage_Calculate, attacker, targ, deathtype, damage, mirrordamage, force);
damage = frag_damage;
mirrordamage = frag_mirrordamage;
force = frag_force;
{
Unfreeze(targ);
targ.health = autocvar_g_freezetag_revive_falldamage_health;
- pointparticles(particleeffectnum("iceorglass"), targ.origin, '0 0 0', 3);
+ Send_Effect("iceorglass", targ.origin, '0 0 0', 3);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname);
Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF);
}
if(targ.frozen && deathtype == DEATH_HURTTRIGGER && !autocvar_g_freezetag_frozen_damage_trigger)
{
- pointparticles(particleeffectnum("teleport"), targ.origin, '0 0 0', 1);
+ Send_Effect("teleport", targ.origin, '0 0 0', 1);
entity oldself = self;
self = targ;
self.oldorigin = self.origin;
self.prevorigin = self.origin;
- pointparticles(particleeffectnum("teleport"), self.origin, '0 0 0', 1);
+ Send_Effect("teleport", self.origin, '0 0 0', 1);
}
self = oldself;
if(targ != attacker)
{
entity victim;
- if((targ.vehicle_flags & VHF_ISVEHICLE) && targ.owner)
+ if(IS_VEHICLE(targ) && targ.owner)
victim = targ.owner;
else
victim = targ;
- if(IS_PLAYER(victim) || (victim.turrcaps_flags & TFL_TURRCAPS_ISTURRET) || (victim.flags & FL_MONSTER))
+ if(IS_PLAYER(victim) || IS_TURRET(victim) || IS_MONSTER(victim))
{
if(DIFF_TEAM(victim, attacker) && !victim.frozen)
{
PlayerScore_Add(player, SP_CTF_CAPTIME, new_time - old_time);
// effects
- pointparticles(particleeffectnum(flag.capeffect), flag.origin, '0 0 0', 1);
+ Send_Effect(flag.capeffect, flag.origin, '0 0 0', 1);
//shockwave_spawn("models/ctf/shockwavetransring.md3", flag.origin - '0 0 15', -0.8, 0, 1);
// other
void ctf_Handle_Return(entity flag, entity player)
{
// messages and sounds
- if(player.flags & FL_MONSTER)
+ if(IS_MONSTER(player))
{
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(flag, INFO_CTF_RETURN_MONSTER_), player.monster_name);
}
}
// effects
- pointparticles(particleeffectnum(flag.toucheffect), player.origin, '0 0 0', 1);
+ Send_Effect(flag.toucheffect, player.origin, '0 0 0', 1);
// waypoints
if(pickuptype == PICKUP_DROPPED) { WaypointSprite_Kill(flag.wps_flagdropped); }
if(trace_dphitcontents & (DPCONTENTS_PLAYERCLIP | DPCONTENTS_MONSTERCLIP)) { return; }
entity toucher = other, tmp_entity;
- bool is_not_monster = (!(toucher.flags & FL_MONSTER)), num_perteam = 0;
+ bool is_not_monster = (!IS_MONSTER(toucher)), num_perteam = 0;
// automatically kill the flag and return it if it touched lava/slime/nodrop surfaces
if(ITEM_TOUCH_NEEDKILL())
// special touch behaviors
if(toucher.frozen) { return; }
- else if(toucher.vehicle_flags & VHF_ISVEHICLE)
+ else if(IS_VEHICLE(toucher))
{
if(autocvar_g_ctf_allow_vehicle_touch && toucher.owner)
toucher = toucher.owner; // the player is actually the vehicle owner, not other
else
return; // do nothing
}
- else if(toucher.flags & FL_MONSTER)
+ else if(IS_MONSTER(toucher))
{
if(!autocvar_g_ctf_allow_monster_touch)
return; // do nothing
{
if(time > self.wait) // if we haven't in a while, play a sound/effect
{
- pointparticles(particleeffectnum(self.toucheffect), self.origin, '0 0 0', 1);
+ Send_Effect(self.toucheffect, self.origin, '0 0 0', 1);
sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTEN_NORM);
self.wait = time + FLAG_TOUCHRATE;
}
if(time >= self.buff_effect_delay)
{
- pointparticles(particleeffectnum(eff), player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1);
+ Send_Effect(eff, player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1);
self.buff_effect_delay = time + 0.05; // prevent spam
}
}
if(autocvar_g_buffs_random_lifetime > 0)
ent.lifetime = time + autocvar_g_buffs_random_lifetime;
- pointparticles(particleeffectnum("electro_combo"), oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1);
- pointparticles(particleeffectnum("electro_combo"), CENTER_OR_VIEWOFS(ent), '0 0 0', 1);
+ Send_Effect("electro_combo", oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1);
+ Send_Effect("electro_combo", CENTER_OR_VIEWOFS(ent), '0 0 0', 1);
WaypointSprite_Ping(ent.buff_waypoint);
Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_GOT, buffid);
Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, buffid);
- pointparticles(particleeffectnum("item_pickup"), CENTER_OR_VIEWOFS(self), '0 0 0', 1);
+ Send_Effect("item_pickup", CENTER_OR_VIEWOFS(self), '0 0 0', 1);
sound(other, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM);
other.buffs |= (self.buffs);
}
{
self.buff_active = true;
sound(self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);
- pointparticles(particleeffectnum("item_respawn"), CENTER_OR_VIEWOFS(self), '0 0 0', 1);
+ Send_Effect("item_respawn", CENTER_OR_VIEWOFS(self), '0 0 0', 1);
}
}
if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC)
if(!ITEM_DAMAGE_NEEDKILL(frag_deathtype))
if(frag_target.deadflag == DEAD_NO)
- if(IS_PLAYER(frag_target) || (frag_target.flags & FL_MONSTER))
+ if(IS_PLAYER(frag_target) || IS_MONSTER(frag_target))
if(frag_attacker != frag_target)
if(!frag_target.frozen)
if(frag_target.takedamage)
if(closest.flagcarried) { ctf_Handle_Throw(closest, world, DROP_THROW); }
if(closest.nade) { toss_nade(closest, '0 0 0', time + 0.05); }
- MUTATOR_CALLHOOK(PortalTeleport); // initiate flag dropper
+ MUTATOR_CALLHOOK(PortalTeleport, self); // initiate flag dropper
setorigin(self, their_org);
setorigin(closest, my_org);
closest.pushltime = time + autocvar_g_maxpushtime;
closest.istypefrag = closest.BUTTON_CHAT;
- pointparticles(particleeffectnum("electro_combo"), their_org, '0 0 0', 1);
- pointparticles(particleeffectnum("electro_combo"), my_org, '0 0 0', 1);
+ Send_Effect("electro_combo", their_org, '0 0 0', 1);
+ Send_Effect("electro_combo", my_org, '0 0 0', 1);
sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM);
sound(closest, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM);
if(time < self.buff_disability_time)
if(time >= self.buff_disability_effect_time)
{
- pointparticles(particleeffectnum("smoking"), self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1);
+ Send_Effect("smoking", self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1);
self.buff_disability_effect_time = time + 0.5;
}
d = damage + (edgedamage - damage) * (d / dist);
Fire_AddDamage(RandomSelection_chosen_ent, self.realowner, d * burntime, burntime, self.projectiledeathtype | HITTYPE_BOUNCE);
//trailparticles(self, particleeffectnum("fireball_laser"), self.origin, RandomSelection_chosen_ent.fireball_impactvec);
- pointparticles(particleeffectnum("fireball_laser"), self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1);
+ Send_Effect("fireball_laser", self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1);
}
}
void nade_ice_freeze(entity freezefield, entity frost_target, float freeze_time)
{
frost_target.frozen_by = freezefield.realowner;
- pointparticles(particleeffectnum("electro_impact"), frost_target.origin, '0 0 0', 1);
+ Send_Effect("electro_impact", frost_target.origin, '0 0 0', 1);
Freeze(frost_target, 1/freeze_time, 3, false);
if(frost_target.ballcarried)
if(g_keepaway) { ka_DropEvent(frost_target); }
case NUM_TEAM_4: expef = "nade_pink_explode"; break;
default: expef = "nade_neutral_explode"; break;
}
- pointparticles(particleeffectnum(expef), self.origin + '0 0 1', '0 0 0', 1);
+ Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
RadiusDamage(self, self.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
randomp.x = randomr*cos(randomw);
randomp.y = randomr*sin(randomw);
randomp.z = 1;
- pointparticles(particleeffectnum("electro_muzzleflash"), self.origin + randomp, '0 0 0', 1);
+ Send_Effect("electro_muzzleflash", self.origin + randomp, '0 0 0', 1);
if(time >= self.nade_special_time)
{
self.nade_special_time = time+0.7;
- pointparticles(particleeffectnum("electro_impact"), self.origin, '0 0 0', 1);
- pointparticles(particleeffectnum("icefield"), self.origin, '0 0 0', 1);
+ Send_Effect("electro_impact", self.origin, '0 0 0', 1);
+ Send_Effect("icefield", self.origin, '0 0 0', 1);
}
makevectors(self.realowner.angles);
- entity oldself = self;
- self = self.realowner;
- MUTATOR_CALLHOOK(PortalTeleport);
- self.realowner = self;
- self = oldself;
+ MUTATOR_CALLHOOK(PortalTeleport, self.realowner);
TeleportPlayer(self, self.realowner, locout, self.realowner.angles, v_forward * vlen(self.realowner.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
}
{
float maxhealth;
float health_factor;
- if(IS_PLAYER(other) || (other.flags & FL_MONSTER))
+ if(IS_PLAYER(other) || IS_MONSTER(other))
if(other.deadflag == DEAD_NO)
if(!other.frozen)
{
}
if ( health_factor > 0 )
{
- maxhealth = (other.flags & FL_MONSTER) ? other.max_health : g_pickup_healthmega_max;
+ maxhealth = (IS_MONSTER(other)) ? other.max_health : g_pickup_healthmega_max;
if ( other.health < maxhealth )
{
if ( self.nade_show_particles )
- pointparticles(particleeffectnum("healing_fx"), other.origin, '0 0 0', 1);
+ Send_Effect("healing_fx", other.origin, '0 0 0', 1);
other.health = min(other.health+health_factor, maxhealth);
}
other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
}
- if ( IS_REAL_CLIENT(other) || (other.vehicle_flags & VHF_ISVEHICLE) )
+ if ( IS_REAL_CLIENT(other) || IS_VEHICLE(other) )
{
- entity show_red = (other.vehicle_flags & VHF_ISVEHICLE) ? other.owner : other;
+ entity show_red = (IS_VEHICLE(other)) ? other.owner : other;
show_red.stat_healing_orb = time+0.1;
show_red.stat_healing_orb_alpha = 0.75 * (self.ltime - time) / self.healer_lifetime;
}
}
if(expef != "")
- pointparticles(particleeffectnum(expef), findbetterlocation(self.origin, 8), '0 0 0', 1);
+ Send_Effect(expef, findbetterlocation(self.origin, 8), '0 0 0', 1);
sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
{
Unfreeze(frag_target);
frag_target.health = autocvar_g_freezetag_revive_nade_health;
- pointparticles(particleeffectnum("iceorglass"), frag_target.origin, '0 0 0', 3);
+ Send_Effect("iceorglass", frag_target.origin, '0 0 0', 3);
frag_damage = 0;
frag_force = '0 0 0';
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname);
return -5;
// Cant touch this
- if(e_target.vehicle_flags & VHF_ISVEHICLE)
+ if(IS_VEHICLE(e_target))
{
if (e_target.vehicle_health <= 0)
return -6;
e = nextent(world);
while (e)
{
- if (e.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
+ if(IS_TURRET(e))
{
load_unit_settings(e,e.cvar_basename,1);
if(e.turret_postthink)
self.health = 150;
// Game hooks
- if(MUTATOR_CALLHOOK(TurretSpawn))
+ if(MUTATOR_CALLHOOK(TurretSpawn, self))
return 0;
// End of default & sanety checks, start building the turret.
self.hud = HUD_NORMAL;
self.switchweapon = self.vehicle.switchweapon;
- vh_player = self;
- vh_vehicle = self.vehicle;
- MUTATOR_CALLHOOK(VehicleExit);
- self = vh_player;
- self.vehicle = vh_vehicle;
+ MUTATOR_CALLHOOK(VehicleExit, self, self.vehicle);
self.vehicle.vehicle_hudmodel.viewmodelforclient = self.vehicle;
CSQCVehicleSetup(other, other.hud);
- vh_player = other;
- vh_vehicle = _gun;
- MUTATOR_CALLHOOK(VehicleEnter);
- other = vh_player;
- _gun = vh_vehicle;
+ MUTATOR_CALLHOOK(VehicleEnter, other, _gun);
return true;
}
if((teamplay && trace_ent.team == pilot.team) || !teamplay)
{
- if(trace_ent.vehicle_flags & VHF_ISVEHICLE)
+ if(IS_VEHICLE(trace_ent))
{
if(autocvar_g_vehicle_bumblebee_healgun_sps && trace_ent.vehicle_health <= trace_ent.tur_health)
trace_ent.vehicle_shield = min(trace_ent.vehicle_shield + autocvar_g_vehicle_bumblebee_healgun_sps * frametime, trace_ent.tur_head.tur_health);
trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, autocvar_g_vehicle_bumblebee_healgun_hmax);
}
- else if(trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
+ else if(IS_TURRET(trace_ent))
{
if(trace_ent.health <= trace_ent.tur_health && autocvar_g_vehicle_bumblebee_healgun_hps)
trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, trace_ent.tur_health);
DEATH_VH_BUMB_DEATH, world);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+ Send_Effect("explosion_large", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
if(self.owner.deadflag == DEAD_DYING)
self.owner.deadflag = DEAD_DEAD;
if(random() < 0.1)
{
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+ Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
}
self.nextthink = time + 0.1;
_body.owner = self;
_body.enemy = self.enemy;
- pointparticles(particleeffectnum("explosion_medium"), findbetterlocation(self.origin, 16), '0 0 0', 1);
+ Send_Effect("explosion_medium", findbetterlocation(self.origin, 16), '0 0 0', 1);
self.health = 0;
self.event_damage = func_null;
self.health -= damage;
if(self.health <= 0)
{
- pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
+ Send_Effect("explosion_medium", self.origin, '0 0 0', 1);
if(!self.cnt)
remove(self);
if(trace_ent.deadflag != DEAD_NO)
trace_ent = world;
if(!(
- (trace_ent.vehicle_flags & VHF_ISVEHICLE) ||
- (trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET) ||
+ IS_VEHICLE(trace_ent) ||
+ IS_TURRET(trace_ent) ||
(trace_ent.takedamage == DAMAGE_TARGETDRONE)
)) { trace_ent = world; }
}
sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
if(_mzlfx)
- pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
+ Send_Effect(_mzlfx, proj.origin, proj.velocity, 1);
setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size);
self.angles = self.pos2;
setorigin(self, self.pos1 + '0 0 0');
// Show it
- pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
+ Send_Effect("teleport", self.origin + '0 0 64', '0 0 0', 1);
if(self.vehicle_controller)
self.team = self.vehicle_controller.team;
if(IS_PLAYER(e))
return true;
- if(e.flags & FL_MONSTER)
+ if(IS_MONSTER(e))
return true;
return false;
void vehicles_touch()
{
- if(MUTATOR_CALLHOOK(VehicleTouch))
+ if(MUTATOR_CALLHOOK(VehicleTouch, self, other))
return;
// Vehicle currently in use
CSQCVehicleSetup(self.owner, self.hud);
- vh_player = other;
- vh_vehicle = self;
- MUTATOR_CALLHOOK(VehicleEnter);
- other = vh_player;
- self = vh_vehicle;
+ MUTATOR_CALLHOOK(VehicleEnter, other, self);
self.vehicle_enter();
antilag_clear(other);
if(!teamplay)
_vehicle.team = 0;
- vh_player = _player;
- vh_vehicle = _vehicle;
- MUTATOR_CALLHOOK(VehicleExit);
- _player = vh_player;
- _vehicle = vh_vehicle;
+ MUTATOR_CALLHOOK(VehicleExit, _player, _vehicle);
_vehicle.team = _vehicle.tur_head.team;
float _ftmp;
_ftmp = self.owner.vehicle_health / 50;
self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
- pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+ Send_Effect("smoke_small", (self.origin + (randomvec() * 80)), '0 0 0', 1);
if(self.vehicle_flags & VHF_DMGSHAKE)
self.velocity += randomvec() * 30;
void vehicles_return()
{
- pointparticles(particleeffectnum("teleport"), self.wp00.origin + '0 0 64', '0 0 0', 1);
+ Send_Effect("teleport", self.wp00.origin + '0 0 64', '0 0 0', 1);
self.wp00.think = vehicles_spawn;
self.wp00.nextthink = time;
void vehicles_gib_explode()
{
sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+ Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
remove(self);
}