}
MUTATOR_HOOKFUNCTION(ons, MonsterMove)
-{SELFPARAM();
- entity e = find(world, targetname, self.target);
- if (e != world)
- self.team = e.team;
+{
+ entity mon = M_ARGV(0, entity);
- return false;
+ entity e = find(world, targetname, mon.target);
+ if (e != world)
+ mon.team = e.team;
}
void ons_MonsterSpawn_Delayed(entity this)
{
- entity own = self.owner;
+ entity own = this.owner;
if(!own) { remove(this); return; }
}
MUTATOR_HOOKFUNCTION(ons, MonsterSpawn)
-{SELFPARAM();
+{
+ entity mon = M_ARGV(0, entity);
+
entity e = spawn();
- e.owner = self;
+ e.owner = mon;
InitializeEntity(e, ons_MonsterSpawn_Delayed, INITPRIO_FINDTARGET);
-
- return false;
}
void ons_TurretSpawn_Delayed(entity this)
MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove)
{
- SELFPARAM();
- if(time < self.spider_slowness)
+ entity mon = M_ARGV(0, entity);
+
+ if(time < mon.spider_slowness)
{
- monster_speed_run *= 0.5;
- monster_speed_walk *= 0.5;
+ M_ARGV(1, float) *= 0.5; // run speed
+ M_ARGV(2, float) *= 0.5; // walk speed
}
- return false;
}
MUTATOR_HOOKFUNCTION(spiderweb, PlayerSpawn)
MUTATOR_HOOKFUNCTION(spiderweb, MonsterSpawn)
{
- SELFPARAM();
- self.spider_slowness = 0;
- return false;
+ entity mon = M_ARGV(0, entity);
+
+ mon.spider_slowness = 0;
}
SOUND(SpiderAttack_FIRE, W_Sound("electro_fire"));
return;
}
- targ = monster_target;
- runspeed = bound(0, monster_speed_run * MONSTER_SKILLMOD(this), runspeed * 2.5); // limit maxspeed to prevent craziness
- walkspeed = bound(0, monster_speed_walk * MONSTER_SKILLMOD(this), walkspeed * 2.5); // limit maxspeed to prevent craziness
+ targ = M_ARGV(3, entity);
+ runspeed = bound(0, M_ARGV(1, float) * MONSTER_SKILLMOD(this), runspeed * 2.5); // limit maxspeed to prevent craziness
+ walkspeed = bound(0, M_ARGV(2, float) * MONSTER_SKILLMOD(this), walkspeed * 2.5); // limit maxspeed to prevent craziness
if(teamplay)
if(autocvar_g_monsters_teams)
MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 6)
MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 7)
MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 8)
+MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 9)
+MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 10)
#undef MUTATOR_TYPES
#undef MUTATOR_NEWGLOBAL
}
MUTATOR_HOOKFUNCTION(buffs, MonsterMove)
-{SELFPARAM();
- if(time < self.buff_disability_time)
+{
+ entity mon = M_ARGV(0, entity);
+
+ if(time < mon.buff_disability_time)
{
- monster_speed_walk *= autocvar_g_buffs_disability_speed;
- monster_speed_run *= autocvar_g_buffs_disability_speed;
+ M_ARGV(1, float) *= autocvar_g_buffs_disability_speed; // run speed
+ M_ARGV(2, float) *= autocvar_g_buffs_disability_speed; // walk speed
}
-
- return false;
}
MUTATOR_HOOKFUNCTION(buffs, PlayerDies)
}
MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterSpawn)
-{SELFPARAM();
+{
+ entity mon = M_ARGV(0, entity);
+
// always refill ammo
- if(self.monsterid == MON_MAGE.monsterid)
- self.skin = 1;
+ if(mon.monsterid == MON_MAGE.monsterid)
+ mon.skin = 1;
return false;
}
}
MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups)
-{SELFPARAM();
- if (!(self.effects & EF_FULLBRIGHT))
- self.effects |= EF_FULLBRIGHT;
+{
+ entity player = M_ARGV(0, entity);
- if (self.items & ITEM_Invisibility.m_itemid)
+ if (!(player.effects & EF_FULLBRIGHT))
+ player.effects |= EF_FULLBRIGHT;
+
+ if (player.items & ITEM_Invisibility.m_itemid)
{
- play_countdown(self.strength_finished, SND_POWEROFF);
- if (time > self.strength_finished)
+ play_countdown(player.strength_finished, SND_POWEROFF);
+ if (time > player.strength_finished)
{
- self.alpha = default_player_alpha;
- self.exteriorweaponentity.alpha = default_weapon_alpha;
- self.items &= ~ITEM_Invisibility.m_itemid;
- Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
+ player.alpha = default_player_alpha;
+ player.exteriorweaponentity.alpha = default_weapon_alpha;
+ player.items &= ~ITEM_Invisibility.m_itemid;
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
}
}
else
{
- if (time < self.strength_finished)
+ if (time < player.strength_finished)
{
- self.alpha = autocvar_g_instagib_invis_alpha;
- self.exteriorweaponentity.alpha = autocvar_g_instagib_invis_alpha;
- self.items |= ITEM_Invisibility.m_itemid;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_INVISIBILITY, self.netname);
- Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_INVISIBILITY);
+ player.alpha = autocvar_g_instagib_invis_alpha;
+ player.exteriorweaponentity.alpha = autocvar_g_instagib_invis_alpha;
+ player.items |= ITEM_Invisibility.m_itemid;
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_INVISIBILITY, player.netname);
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERUP_INVISIBILITY);
}
}
- if (self.items & ITEM_Speed.m_itemid)
+ if (player.items & ITEM_Speed.m_itemid)
{
- play_countdown(self.invincible_finished, SND_POWEROFF);
- if (time > self.invincible_finished)
+ play_countdown(player.invincible_finished, SND_POWEROFF);
+ if (time > player.invincible_finished)
{
- self.items &= ~ITEM_Speed.m_itemid;
- Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SPEED);
+ player.items &= ~ITEM_Speed.m_itemid;
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERDOWN_SPEED);
}
}
else
{
- if (time < self.invincible_finished)
+ if (time < player.invincible_finished)
{
- self.items |= ITEM_Speed.m_itemid;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SPEED, self.netname);
- Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERUP_SPEED);
+ player.items |= ITEM_Speed.m_itemid;
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SPEED, player.netname);
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERUP_SPEED);
}
}
- return false;
}
.float stat_sv_maxspeed;
}
MUTATOR_HOOKFUNCTION(midair, PlayerPowerups)
-{SELFPARAM();
+{
+ entity player = M_ARGV(0, entity);
+
if(time >= game_starttime)
- if(IS_ONGROUND(self))
+ if(IS_ONGROUND(player))
{
- self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
- self.midair_shieldtime = max(self.midair_shieldtime, time + autocvar_g_midair_shieldtime);
+ player.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
+ player.midair_shieldtime = max(player.midair_shieldtime, time + autocvar_g_midair_shieldtime);
}
return false;
/** called when a monster spawns */
#define EV_MonsterSpawn(i, o) \
- /**/ i(entity, __self) \
+ /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
MUTATOR_HOOKABLE(MonsterSpawn, EV_MonsterSpawn);
/** called when a monster dies */
#define EV_MonsterRemove(i, o) \
- /**/ i(entity, rem_mon) \
+ /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
-entity rem_mon; // avoiding ovewriting self & other
MUTATOR_HOOKABLE(MonsterRemove, EV_MonsterRemove);
/** called when a monster wants to respawn */
#define EV_MonsterRespawn(i, o) \
- /**/ i(entity, other) \
+ /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
MUTATOR_HOOKABLE(MonsterRespawn, EV_MonsterRespawn);
/** called when a monster is dropping loot */
#define EV_MonsterDropItem(i, o) \
- /* monster */ i(entity, MUTATOR_ARGV_0_entity) \
+ /* monster */ i(entity, MUTATOR_ARGV_0_entity) \
/* item (can be removed or changed) */ i(entity, MUTATOR_ARGV_1_entity) \
- /**/ o(entity, MUTATOR_ARGV_1_entity) \
- /* attacker */ i(entity, MUTATOR_ARGV_2_entity) \
+ /**/ o(entity, MUTATOR_ARGV_1_entity) \
+ /* attacker */ i(entity, MUTATOR_ARGV_2_entity) \
/**/
.void(entity this) monster_loot;
MUTATOR_HOOKABLE(MonsterDropItem, EV_MonsterDropItem);
* returning true makes the monster stop
*/
#define EV_MonsterMove(i, o) \
- /**/ i(entity, __self) \
- /**/ i(float, monster_speed_run) \
- /**/ o(float, monster_speed_run) \
- /**/ i(float, monster_speed_walk) \
- /**/ o(float, monster_speed_walk) \
- /**/ i(entity, monster_target) \
- /**/
-float monster_speed_run;
-float monster_speed_walk;
-entity monster_target;
+ /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** run speed */ i(float, MUTATOR_ARGV_1_float) \
+ /**/ o(float, MUTATOR_ARGV_1_float) \
+ /** walk speed */ i(float, MUTATOR_ARGV_2_float) \
+ /**/ o(float, MUTATOR_ARGV_2_float) \
+ /** move target */ i(entity, MUTATOR_ARGV_3_entity) \
+ /**/
MUTATOR_HOOKABLE(MonsterMove, EV_MonsterMove);
/** called when a monster looks for another target */
/** called to change a random monster to a miniboss */
#define EV_MonsterCheckBossFlag(i, o) \
- /**/ i(entity, __self) \
+ /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
/**/
MUTATOR_HOOKABLE(MonsterCheckBossFlag, EV_MonsterCheckBossFlag);
/** called at the end of player_powerups() in cl_client.qc, used for manipulating the values which are set by powerup items. */
#define EV_PlayerPowerups(i, o) \
- /**/ i(entity, __self) \
- /**/ i(int, olditems) \
+ /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+ /** old items */ i(int, MUTATOR_ARGV_1_int) \
/**/
-int olditems;
MUTATOR_HOOKABLE(PlayerPowerups, EV_PlayerPowerups);
/**
}
MUTATOR_HOOKFUNCTION(inv, MonsterSpawn)
-{SELFPARAM();
- if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
+{
+ entity mon = M_ARGV(0, entity);
+
+ if(!(mon.spawnflags & MONSTERFLAG_SPAWNED))
return true;
- if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
+ if(!(mon.spawnflags & MONSTERFLAG_RESPAWNED))
{
inv_numspawned += 1;
inv_maxcurrent += 1;
}
- self.monster_skill = inv_monsterskill;
+ mon.monster_skill = inv_monsterskill;
- if((get_monsterinfo(self.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, self.monster_name);
+ if((get_monsterinfo(mon.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name);
- self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
+ mon.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
return false;
}
}
MUTATOR_HOOKFUNCTION(ka, PlayerPowerups)
-{SELFPARAM();
+{
+ entity player = M_ARGV(0, entity);
+
// In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
// So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player()
- self.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
+ player.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
- if(self.ballcarried)
- self.effects |= autocvar_g_keepaway_ballcarrier_effects;
-
- return false;
+ if(player.ballcarried)
+ player.effects |= autocvar_g_keepaway_ballcarrier_effects;
}
.float stat_sv_airspeedlimit_nonqw;