it.team = NUM_TEAM_1;
// Dubbles as teamchange
- WITHSELF(it, turret_respawn());
+ WITHSELF(it, turret_respawn(it));
));
}
void assault_roundstart_use_this(entity this)
{
assault_roundstart_use(this, NULL, NULL);
}
-void assault_roundstart_use_self()
-{
- SELFPARAM();
- assault_roundstart_use(this, NULL, NULL);
-}
-void assault_wall_think()
-{SELFPARAM();
+void assault_wall_think(entity this)
+{
if(self.enemy.health < 0)
{
self.model = "";
// trigger new round
// reset objectives, toggle spawnpoints, reset triggers, ...
void vehicles_clearreturn(entity veh);
-void vehicles_spawn();
-void assault_new_round()
-{SELFPARAM();
+void vehicles_spawn(entity this);
+void assault_new_round(entity this)
+{
//bprint("ASSAULT: new round\n");
// Eject players from vehicles
- FOREACH_CLIENT(IS_PLAYER(it) && it.vehicle, WITHSELF(it, vehicles_exit(VHEF_RELEASE)));
+ FOREACH_CLIENT(IS_PLAYER(it) && it.vehicle, vehicles_exit(it.vehicle, VHEF_RELEASE));
FOREACH_ENTITY_FLAGS(vehicle_flags, VHF_ISVEHICLE, LAMBDA(
vehicles_clearreturn(it);
- WITHSELF(it, vehicles_spawn());
+ WITHSELF(it, vehicles_spawn(it));
));
// up round counter
- self.winning = self.winning + 1;
+ this.winning = this.winning + 1;
// swap attacker/defender roles
if(assault_attacker_team == NUM_TEAM_1)
// they win. Otherwise the defending team wins once the timelimit passes.
int WinningCondition_Assault()
{
- SELFPARAM();
- WinningConditionHelper(); // set worldstatus
+ WinningConditionHelper(NULL); // set worldstatus
int status = WINNING_NO;
// as the timelimit has not yet passed just assume the defending team will win
}
else
{
- WITHSELF(ent, assault_new_round());
+ assault_new_round(ent);
}
}
}
this.mdl = this.model;
_setmodel(this, this.mdl);
this.solid = SOLID_BSP;
- this.think = assault_wall_think;
+ setthink(this, assault_wall_think);
this.nextthink = time;
InitializeEntity(this, assault_setenemytoobjective, INITPRIO_FINDTARGET);
}
assault_attacker_team = NUM_TEAM_1;
this.classname = "target_assault_roundstart";
this.use = assault_roundstart_use;
- this.reset2 = assault_roundstart_use_self;
+ this.reset2 = assault_roundstart_use_this;
InitializeEntity(this, assault_roundstart_use_this, INITPRIO_FINDTARGET);
}
// mutator hooks
MUTATOR_HOOKFUNCTION(as, PlayerSpawn)
-{SELFPARAM();
- if(self.team == assault_attacker_team)
- Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_ATTACKING);
- else
- Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_DEFENDING);
+{
+ entity player = M_ARGV(0, entity);
- return false;
+ if(player.team == assault_attacker_team)
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ASSAULT_ATTACKING);
+ else
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ASSAULT_DEFENDING);
}
MUTATOR_HOOKFUNCTION(as, TurretSpawn)
-{SELFPARAM();
- if(!self.team || self.team == MAX_SHOT_DISTANCE)
- self.team = 5; // this gets reversed when match starts?
+{
+ entity turret = M_ARGV(0, entity);
- return false;
+ if(!turret.team || turret.team == MAX_SHOT_DISTANCE)
+ turret.team = 5; // this gets reversed when match starts?
}
MUTATOR_HOOKFUNCTION(as, VehicleSpawn)
-{SELFPARAM();
- self.nextthink = time + 0.5;
+{
+ entity veh = M_ARGV(0, entity);
- return false;
+ veh.nextthink = time + 0.5;
}
MUTATOR_HOOKFUNCTION(as, HavocBot_ChooseRole)
-{SELFPARAM();
- havocbot_ast_reset_role(self);
+{
+ entity bot = M_ARGV(0, entity);
+
+ havocbot_ast_reset_role(bot);
return true;
}
MUTATOR_HOOKFUNCTION(as, PlayHitsound)
{
+ entity frag_victim = M_ARGV(0, entity);
+
return (frag_victim.classname == "func_assault_destructible");
}
MUTATOR_HOOKFUNCTION(as, CheckRules_World)
{
- ret_float = WinningCondition_Assault();
+ M_ARGV(0, float) = WinningCondition_Assault();
return true;
}
{
// no assault warmups
warmup_stage = 0;
- return false;
}
MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn)
{
- SELFPARAM();
- switch(self.classname)
+ entity ent = M_ARGV(0, entity);
+
+ switch(ent.classname)
{
case "info_player_team1":
case "info_player_team2":
case "info_player_team4":
return true;
}
-
- return false;
}
// scoreboard setup