1 float MAGIC_VALUE_INACTIVE = 1000;
3 // attacker spawn point
4 void info_player_attacker() {
5 self.team = COLOR_TEAM1; // red, gets swapped every round
6 info_player_deathmatch();
9 // defender spawn point
10 void info_player_defender() {
11 self.team = COLOR_TEAM2; // blue, gets swapped every round
12 info_player_deathmatch();
15 // reset this objective. Used when spawning an objective
16 // and when a new round starts
17 void assault_objective_reset() {
18 if(self.spawnflags) { // first objective
20 self.nextthink = time + 0.1;
22 self.health = MAGIC_VALUE_INACTIVE;
26 void assault_objective_use() {
29 self.nextthink = time + 0.1;
32 void assault_objective_think() {
36 ent = find(world, targetname, self.target);
40 self.nextthink = time + 0.1;
45 void func_objective() {
46 self.classname = "func_objective";
47 self.think = assault_objective_think;
48 self.use = assault_objective_use;
49 assault_objective_reset();
53 void assault_new_round() {
55 // swap spawn point teams
59 ent = find(world, classname, "info_player_deathmatch");
64 if(self.team == COLOR_TEAM1) {
65 self.team = COLOR_TEAM2;
67 self.team = COLOR_TEAM1;
71 ent = find(ent, classname, "info_player_deathmatch");
74 // reset all objectives
76 ent = find(world, classname, "func_objective");
81 assault_objective_reset();
84 ent = find(ent, classname, "func_objective");
87 // actually restart round... how to do that?