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
{
missile.think = W_Blaster_Think;
missile.nextthink = time + atk_delay;
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
if(time >= missile.nextthink)
{
CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
- other = proj; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
if(WEP_CVAR_PRI(crylink, joinspread) != 0)
{
CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
- other = proj; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
if(WEP_CVAR_SEC(crylink, joinspread) != 0)
{
W_AttachToShotorg(flash, '5 0 0');
// common properties
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
bool W_Devastator(int req)
CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
- other = proj; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
void W_Electro_Orb_Touch(void)
CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
- other = proj; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
void W_Electro_CheckAttack(void)
CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
- other = proj; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
void W_Fireball_AttackEffect(float i, vector f_diff)
CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
- other = proj; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
bool W_Fireball(int req)
CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
void W_Hagar_Attack2(void)
CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
.float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, load_animtime), w_ready);
CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
void W_HLAC_Attack2(void)
CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
// weapon frames
CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true);
- other = gren; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, gren);
}
bool W_Hook(int req)
// common properties
- other = mine; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, mine);
self.minelayer_mines = W_MineLayer_Count(self);
}
else
CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
- other = gren; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, gren);
}
void W_Mortar_Attack2(void)
else
CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
- other = gren; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, gren);
}
.float bot_secondary_grenademooth;
else
CSQCProjectile(gren, true, PROJECTILE_PORTO_RED, true);
- other = gren; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, gren);
}
bool w_nexball_weapon(int req); // WEAPONTODO
W_AttachToShotorg(flash, '5 0 0');
missile.pos1 = missile.velocity;
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
bool W_RocketPropelledChainsaw(int req)
CSQCProjectile(missile, false, PROJECTILE_SEEKER, true);
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
// ============================
W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
// ============================
CSQCProjectile(missile, true, PROJECTILE_TAG, false); // has sound
- other = missile; MUTATOR_CALLHOOK(EditProjectile);
+ MUTATOR_CALLHOOK(EditProjectile, self, missile);
}
// ============================
if (f > 0)
s = strcat1(argv(f));
- get_cvars_f = f;
- get_cvars_s = s;
-
- MUTATOR_CALLHOOK(GetCvars);
+ MUTATOR_CALLHOOK(GetCvars, f, s);
Notification_GetCvars();
/**/
MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint);
+/**
+ * checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
+ * return error to request removal
+ */
MUTATOR_HOOKABLE(FilterItem, EV_NO_ARGS);
- // checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
- // return error to request removal
-MUTATOR_HOOKABLE(TurretSpawn, EV_NO_ARGS);
- // return error to request removal
- // INPUT: self - turret
+/** return error to request removal */
+#define EV_TurretSpawn(i, o) \
+ /** turret */ i(entity, self) \
+ /**/
+MUTATOR_HOOKABLE(TurretSpawn, EV_TurretSpawn);
+/** return error to prevent entity spawn, or modify the entity */
MUTATOR_HOOKABLE(OnEntityPreSpawn, EV_NO_ARGS);
- // return error to prevent entity spawn, or modify the entity
+/** runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators */
MUTATOR_HOOKABLE(PlayerPreThink, EV_NO_ARGS);
- // runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators
+/** TODO change this into a general PlayerPostThink hook? */
MUTATOR_HOOKABLE(GetPressedKeys, EV_NO_ARGS);
- // TODO change this into a general PlayerPostThink hook?
+/**
+ * called before any player physics, may adjust variables for movement,
+ * is run AFTER bot code and idle checking
+ */
MUTATOR_HOOKABLE(PlayerPhysics, EV_NO_ARGS);
- // called before any player physics, may adjust variables for movement,
- // is run AFTER bot code and idle checking
-MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS);
- // is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client
- // INPUT:
- float get_cvars_f;
- string get_cvars_s;
+/** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
+#define EV_GetCvars(i, o) \
+ /**/ i(float, get_cvars_f) \
+ /**/ i(string, get_cvars_s) \
+ /**/
+float get_cvars_f;
+string get_cvars_s;
+MUTATOR_HOOKABLE(GetCvars, EV_GetCvars);
-MUTATOR_HOOKABLE(EditProjectile, EV_NO_ARGS);
- // can edit any "just fired" projectile
- // INPUT:
-// entity self;
-// entity other;
+/** can edit any "just fired" projectile */
+#define EV_EditProjectile(i, o) \
+ /**/ i(entity, self) \
+ /**/ i(entity, other) \
+ /**/
+MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
+/** called when a monster spawns */
MUTATOR_HOOKABLE(MonsterSpawn, EV_NO_ARGS);
- // called when a monster spawns
-MUTATOR_HOOKABLE(MonsterDies, EV_NO_ARGS);
- // called when a monster dies
- // INPUT:
-// entity frag_attacker;
+/** called when a monster dies */
+#define EV_MonsterDies(i, o) \
+ /**/ i(entity, frag_attacker) \
+ /**/
+MUTATOR_HOOKABLE(MonsterDies, EV_MonsterDies);
MUTATOR_HOOKABLE(MonsterRespawn, EV_NO_ARGS);
// called when a monster wants to respawn
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.