2 // attacker spawn point
3 void info_player_attacker() {
4 self.team = COLOR_TEAM1; // red, gets swapped every round
5 info_player_deathmatch();
8 // defender spawn point
9 void info_player_defender() {
10 self.team = COLOR_TEAM2; // blue, gets swapped every round
11 info_player_deathmatch();
14 // reset this objective. Used when spawning an objective
15 // and when a new round starts
16 void assault_objective_reset() {
17 if(self.spawnflags) { // first objective
19 self.nextthink = time + 0.1;
21 self.health = ASSAULT_VALUE_INACTIVE;
25 void assault_objective_use() {
28 self.nextthink = time + 0.1;
31 void assault_objective_think() {
35 ent = find(world, targetname, self.target);
39 self.nextthink = time + 0.1;
44 void target_objective() {
45 self.classname = "target_objective";
46 self.think = assault_objective_think;
47 self.use = assault_objective_use;
48 assault_objective_reset();
51 // decrease the health of targeted objectives
52 void assault_objective_decrease() {
56 ent = find(world, targetname, self.target);
58 ent.health = ent.health - self.dmg;
59 ent = find(ent, targetname, self.target);
63 // this entity should target an objective and be targeted by triggers
64 void target_objective_decrease() {
68 self.use = assault_objective_decrease;
72 // reset objectives, toggle spawnpoints, reset triggers, ...
73 void assault_new_round() {
75 // this assumes self.classname == "func_assault_roundend"!
76 self.cnt = self.cnt + 1;
78 // swap spawn point teams
82 ent = find(world, classname, "info_player_deathmatch");
87 if(self.team == COLOR_TEAM1) {
88 self.team = COLOR_TEAM2;
90 self.team = COLOR_TEAM1;
94 ent = find(ent, classname, "info_player_deathmatch");
97 // reset all objectives
99 ent = find(world, classname, "target_objective");
104 assault_objective_reset();
107 ent = find(ent, classname, "target_objective");
110 // actually restart round... how to do that?
113 void target_assault_roundend() {
114 self.cnt = 0; // round counter
115 self.classname = "target_assault_roundend";
116 self.use = assault_new_round;