5 .float isgenneighbor_red;
6 .float isgenneighbor_blue;
7 .float iscpneighbor_red;
8 .float iscpneighbor_blue;
12 float ons_sprite_cp_red, ons_sprite_cp_blue, ons_sprite_cp_neut;
13 float ons_sprite_cp_atck_red, ons_sprite_cp_atck_blue, ons_sprite_cp_atck_neut;
14 float ons_sprite_cp_dfnd_red, ons_sprite_cp_dfnd_blue;
15 float ons_sprite_gen_red, ons_sprite_gen_blue, ons_sprite_gen_shielded;
17 void onslaught_updatelinks()
19 local entity l, links;
20 local float stop, t1, t2, t3, t4;
21 // first check if the game has ended
22 dprint("--- updatelinks ---\n");
23 links = findchain(classname, "onslaught_link");
24 // mark generators as being shielded and networked
25 l = findchain(classname, "onslaught_generator");
29 dprint(etos(l), " (generator) belongs to team ", ftos(l.team), "\n");
31 dprint(etos(l), " (generator) is destroyed\n");
32 l.islinked = l.iscaptured;
33 l.isshielded = l.iscaptured;
36 // mark points as shielded and not networked
37 l = findchain(classname, "onslaught_controlpoint");
42 l.isgenneighbor_red = FALSE;
43 l.isgenneighbor_blue = FALSE;
44 l.iscpneighbor_red = FALSE;
45 l.iscpneighbor_blue = FALSE;
46 dprint(etos(l), " (point) belongs to team ", ftos(l.team), "\n");
49 // flow power outward from the generators through the network
53 dprint(etos(l), " (link) connects ", etos(l.goalentity), " with ", etos(l.enemy), "\n");
63 // if both points are captured by the same team, and only one of
64 // them is powered, mark the other one as powered as well
65 if (l.enemy.iscaptured && l.goalentity.iscaptured)
66 if (l.enemy.islinked != l.goalentity.islinked)
67 if (l.enemy.team == l.goalentity.team)
69 if (!l.goalentity.islinked)
72 l.goalentity.islinked = TRUE;
73 dprint(etos(l), " (link) is marking ", etos(l.goalentity), " (point) because its team matches ", etos(l.enemy), " (point)\n");
75 else if (!l.enemy.islinked)
78 l.enemy.islinked = TRUE;
79 dprint(etos(l), " (link) is marking ", etos(l.enemy), " (point) because its team matches ", etos(l.goalentity), " (point)\n");
85 // now that we know which points are powered we can mark their neighbors
86 // as unshielded if team differs
90 if (l.goalentity.team != l.enemy.team)
92 if (l.goalentity.islinked)
94 dprint(etos(l), " (link) is unshielding ", etos(l.enemy), " (point) because its team does not match ", etos(l.goalentity), " (point)\n");
95 l.enemy.isshielded = FALSE;
96 if(l.goalentity.classname == "onslaught_generator")
98 if(l.goalentity.team == COLOR_TEAM1)
99 l.enemy.isgenneighbor_red = TRUE;
100 else if(l.goalentity.team == COLOR_TEAM2)
101 l.enemy.isgenneighbor_blue = TRUE;
105 if(l.goalentity.team == COLOR_TEAM1)
106 l.enemy.iscpneighbor_red = TRUE;
107 else if(l.goalentity.team == COLOR_TEAM2)
108 l.enemy.iscpneighbor_blue = TRUE;
111 if (l.enemy.islinked)
113 dprint(etos(l), " (link) is unshielding ", etos(l.goalentity), " (point) because its team does not match ", etos(l.enemy), " (point)\n");
114 l.goalentity.isshielded = FALSE;
115 if(l.enemy.classname == "onslaught_generator")
117 if(l.enemy.team == COLOR_TEAM1)
118 l.goalentity.isgenneighbor_red = TRUE;
119 else if(l.enemy.team == COLOR_TEAM2)
120 l.goalentity.isgenneighbor_blue = TRUE;
124 if(l.enemy.team == COLOR_TEAM1)
125 l.goalentity.iscpneighbor_red = TRUE;
126 else if(l.enemy.team == COLOR_TEAM2)
127 l.goalentity.iscpneighbor_blue = TRUE;
133 // now update the takedamage and alpha variables on generator shields
134 l = findchain(classname, "onslaught_generator");
139 dprint(etos(l), " (generator) is shielded\n");
141 l.takedamage = DAMAGE_NO;
142 l.bot_attack = FALSE;
146 dprint(etos(l), " (generator) is not shielded\n");
148 l.takedamage = DAMAGE_AIM;
153 // now update the takedamage and alpha variables on control point icons
154 l = findchain(classname, "onslaught_controlpoint");
159 dprint(etos(l), " (point) is shielded\n");
163 l.goalentity.takedamage = DAMAGE_NO;
164 l.goalentity.bot_attack = FALSE;
169 dprint(etos(l), " (point) is not shielded\n");
173 l.goalentity.takedamage = DAMAGE_AIM;
174 l.goalentity.bot_attack = TRUE;
179 // count generators owned by each team
180 t1 = t2 = t3 = t4 = 0;
181 l = findchain(classname, "onslaught_generator");
186 if (l.team == COLOR_TEAM1) t1 = 1;
187 if (l.team == COLOR_TEAM2) t2 = 1;
188 if (l.team == COLOR_TEAM3) t3 = 1;
189 if (l.team == COLOR_TEAM4) t4 = 1;
193 // see if multiple teams remain (if not, it's game over)
194 if (t1 + t2 + t3 + t4 < 2)
195 dprint("--- game over ---\n");
197 dprint("--- done updating links ---\n");
200 float onslaught_controlpoint_can_be_linked(entity cp, float t)
204 if(cp.isgenneighbor_red)
206 if(cp.iscpneighbor_red)
209 else if(t == COLOR_TEAM2)
211 if(cp.isgenneighbor_blue)
213 if(cp.iscpneighbor_blue)
219 // check to see if this player has a legitimate claim to capture this
220 // control point - more specifically that there is a captured path of
221 // points leading back to the team generator
222 e = findchain(classname, "onslaught_link");
225 if (e.goalentity == cp)
227 dprint(etos(e), " (link) connects to ", etos(e.enemy), " (point)");
228 if (e.enemy.islinked)
230 dprint(" which is linked");
231 if (e.enemy.team == t)
233 dprint(" and has the correct team!\n");
237 dprint(" but has the wrong team\n");
242 else if (e.enemy == cp)
244 dprint(etos(e), " (link) connects to ", etos(e.goalentity), " (point)");
245 if (e.goalentity.islinked)
247 dprint(" which is linked");
248 if (e.goalentity.team == t)
250 dprint(" and has a team!\n");
254 dprint(" but has the wrong team\n");
265 float onslaught_controlpoint_attackable(entity cp, float t)
266 // -2: SAME TEAM, attackable by enemy!
271 // 3: attack it (HIGH PRIO)
272 // 4: touch it (HIGH PRIO)
280 else if(cp.goalentity)
282 // if there's already an icon built, nothing happens
285 a = onslaught_controlpoint_can_be_linked(cp, COLOR_TEAM1 + COLOR_TEAM2 - t);
286 if(a) // attackable by enemy?
287 return -2; // EMERGENCY!
290 // we know it can be linked, so no need to check
292 a = onslaught_controlpoint_can_be_linked(cp, t);
293 if(a == 2) // near our generator?
294 return 3; // EMERGENCY!
300 if(onslaught_controlpoint_can_be_linked(cp, t))
302 a = onslaught_controlpoint_can_be_linked(cp, COLOR_TEAM1 + COLOR_TEAM2 - t);
304 return 4; // GET THIS ONE NOW!
306 return 2; // TOUCH ME
312 void onslaught_generator_think()
316 self.nextthink = ceil(time + 1);
317 if (cvar("timelimit"))
318 if (time > cvar("timelimit") * 60 - 60)
320 // self.max_health / 300 gives 5 minutes of overtime.
321 // control points reduce the overtime duration.
322 sound(self, CHAN_TRIGGER, "sound/onslaught/generator_decay.wav", VOL_BASE, ATTN_NORM);
324 e = findchain(classname, "onslaught_controlpoint");
327 if (e.team != self.team)
332 d = d * self.max_health / 300;
333 Damage(self, self, self, d, DEATH_HURTTRIGGER, self.origin, '0 0 0');
337 void onslaught_generator_deaththink()
342 self.nextthink = time + 0.1;
343 self.count = self.count - 1;
344 org = randompos(self.origin + self.mins + '8 8 8', self.origin + self.maxs + '-8 -8 -8');
345 pointparticles(particleeffectnum("onslaught_generator_smallexplosion"), org, '0 0 0', 1);
346 sound(self, CHAN_TRIGGER, "sound/weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
351 pointparticles(particleeffectnum("onslaught_generator_finalexplosion"), org, '0 0 0', 1);
352 sound(self, CHAN_TRIGGER, "sound/weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
356 void onslaught_generator_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
360 if (attacker != self)
364 // this is protected by a shield, so ignore the damage
365 if (time > self.pain_finished)
366 if (attacker.classname == "player")
368 play2(attacker, "sound/onslaught/damageblockedbyshield.wav");
369 self.pain_finished = time + 1;
373 if (time > self.pain_finished)
375 self.pain_finished = time + 5;
376 bprint(ColoredTeamName(self.team), " generator under attack!\n");
377 play2team(self.team, "sound/onslaught/generator_underattack.wav");
380 self.health = self.health - damage;
381 // choose an animation frame based on health
382 self.frame = 10 * bound(0, (1 - self.health / self.max_health), 1);
383 // see if the generator is still functional, or dying
387 lh = ceil(self.lasthealth / 100) * 100;
388 h = ceil(self.health / 100) * 100;
390 bprint(ColoredTeamName(self.team), " generator has less than ", ftos(h), " health remaining\n");
391 self.lasthealth = self.health;
395 if (attacker == self)
396 bprint(ColoredTeamName(self.team), " generator spontaneously exploded due to overtime!\n");
400 t = ColoredTeamName(attacker.team);
401 bprint(ColoredTeamName(self.team), " generator destroyed by ", t, "!\n");
403 self.iscaptured = FALSE;
404 self.islinked = FALSE;
405 self.isshielded = FALSE;
406 self.takedamage = DAMAGE_NO; // can't be hurt anymore
407 self.event_damage = SUB_Null; // won't do anything if hurt
408 self.count = 30; // 30 explosions
409 self.think = onslaught_generator_deaththink; // explosion sequence
410 self.nextthink = time; // start exploding immediately
411 self.think(); // do the first explosion now
412 onslaught_updatelinks();
416 // update links after a delay
417 void onslaught_generator_delayed()
419 onslaught_updatelinks();
420 // now begin normal thinking
421 self.think = onslaught_generator_think;
422 self.nextthink = time;
425 #ifdef YOU_HAVE_FIXED_ONSLAUGHT_WAYPOINTS
426 float onslaught_generator_waypointsprite_for_player(entity e)
428 if(e.classname == "player")
429 if(e.team == self.owner.team)
431 if(self.owner.team == COLOR_TEAM1)
432 return ons_sprite_gen_red;
433 else if(self.owner.team == COLOR_TEAM2)
434 return ons_sprite_gen_blue;
436 if(self.owner.isshielded)
437 return ons_sprite_gen_shielded;
438 if(self.owner.team == COLOR_TEAM1)
439 return ons_sprite_gen_red;
440 else if(self.owner.team == COLOR_TEAM2)
441 return ons_sprite_gen_blue;
445 float onslaught_controlpoint_waypointsprite_for_player(entity e)
448 if(e.classname == "player")
450 a = onslaught_controlpoint_attackable(self.owner, e.team);
451 if(a == 3 || a == 4) // ATTACK/TOUCH THIS ONE NOW
453 if(self.owner.team == COLOR_TEAM1)
454 return ons_sprite_cp_atck_red;
455 else if(self.owner.team == COLOR_TEAM2)
456 return ons_sprite_cp_atck_blue;
458 return ons_sprite_cp_atck_neut;
460 else if(a == -2) // DEFEND THIS ONE NOW
462 if(self.owner.team == COLOR_TEAM1)
463 return ons_sprite_cp_dfnd_red;
464 else if(self.owner.team == COLOR_TEAM2)
465 return ons_sprite_cp_dfnd_blue;
467 else if(self.owner.team == e.team || a == -1 || a == 1) // own point, or fire at it
469 if(self.owner.team == COLOR_TEAM1)
470 return ons_sprite_cp_red;
471 else if(self.owner.team == COLOR_TEAM2)
472 return ons_sprite_cp_blue;
474 else if(a == 2) // touch it
475 return ons_sprite_cp_neut;
479 if(self.owner.team == COLOR_TEAM1)
480 return ons_sprite_cp_red;
481 else if(self.owner.team == COLOR_TEAM2)
482 return ons_sprite_cp_blue;
484 return ons_sprite_cp_neut;
490 /*QUAKED spawnfunc_onslaught_generator (0 .5 .8) (-32 -32 -24) (32 32 64)
493 spawnfunc_onslaught_link entities can target this.
496 "team" - team that owns this generator (5 = red, 14 = blue, etc), MUST BE SET.
497 "targetname" - name that spawnfunc_onslaught_link entities will use to target this.
499 void spawnfunc_onslaught_generator()
507 #ifdef YOU_HAVE_FIXED_ONSLAUGHT_WAYPOINTS
508 if(!ons_sprite_cp_blue)
510 precache_model("models/sprites/ons-cp-blue.sp2");
511 setmodel(self, "models/sprites/ons-cp-blue.sp2");
512 ons_sprite_cp_blue = self.modelindex;
513 precache_model("models/sprites/ons-cp-red.sp2");
514 setmodel(self, "models/sprites/ons-cp-red.sp2");
515 ons_sprite_cp_red = self.modelindex;
516 precache_model("models/sprites/ons-cp-neut.sp2");
517 setmodel(self, "models/sprites/ons-cp-neut.sp2");
518 ons_sprite_cp_neut = self.modelindex;
519 precache_model("models/sprites/ons-cp-dfnd-blue.sp2");
520 setmodel(self, "models/sprites/ons-cp-dfnd-blue.sp2");
521 ons_sprite_cp_dfnd_blue = self.modelindex;
522 precache_model("models/sprites/ons-cp-dfnd-red.sp2");
523 setmodel(self, "models/sprites/ons-cp-dfnd-red.sp2");
524 ons_sprite_cp_dfnd_red = self.modelindex;
525 precache_model("models/sprites/ons-cp-atck-blue.sp2");
526 setmodel(self, "models/sprites/ons-cp-atck-blue.sp2");
527 ons_sprite_cp_atck_blue = self.modelindex;
528 precache_model("models/sprites/ons-cp-atck-red.sp2");
529 setmodel(self, "models/sprites/ons-cp-atck-red.sp2");
530 ons_sprite_cp_atck_red = self.modelindex;
531 precache_model("models/sprites/ons-cp-atck-neut.sp2");
532 setmodel(self, "models/sprites/ons-cp-atck-neut.sp2");
533 ons_sprite_cp_atck_neut = self.modelindex;
534 precache_model("models/sprites/ons-gen-blue.sp2");
535 setmodel(self, "models/sprites/ons-gen-blue.sp2");
536 ons_sprite_gen_blue = self.modelindex;
537 precache_model("models/sprites/ons-gen-red.sp2");
538 setmodel(self, "models/sprites/ons-gen-red.sp2");
539 ons_sprite_gen_red = self.modelindex;
540 precache_model("models/sprites/ons-gen-shielded.sp2");
541 setmodel(self, "models/sprites/ons-gen-shielded.sp2");
542 ons_sprite_gen_shielded = self.modelindex;
547 precache_model("models/onslaught/generator.md3");
548 precache_model("models/onslaught/generator_shield.md3");
549 precache_sound("sound/onslaught/generator_decay.wav");
550 precache_sound("sound/weapons/grenade_impact.wav");
551 precache_sound("sound/weapons/rocket_impact.wav");
552 precache_sound("sound/onslaught/generator_underattack.wav");
554 objerror("team must be set");
555 self.team_saved = self.team;
556 self.colormap = 1024 + (self.team - 1) * 17;
557 self.solid = SOLID_BSP;
558 self.movetype = MOVETYPE_NONE;
559 self.lasthealth = self.max_health = self.health = cvar("g_onslaught_gen_health");
560 setmodel(self, "models/onslaught/generator.md3");
561 //setsize(self, '-32 -32 -24', '32 32 64');
562 setorigin(self, self.origin);
563 self.takedamage = DAMAGE_AIM;
564 self.bot_attack = TRUE;
565 self.event_damage = onslaught_generator_damage;
566 self.iscaptured = TRUE;
567 self.islinked = TRUE;
568 self.isshielded = TRUE;
569 // spawn shield model which indicates whether this can be damaged
570 self.enemy = e = spawn();
572 e.movetype = MOVETYPE_NONE;
573 e.effects = EF_ADDITIVE;
574 setmodel(e, "models/onslaught/generator_shield.md3");
575 //setsize(e, '-32 -32 0', '32 32 128');
576 setorigin(e, self.origin);
577 e.colormap = self.colormap;
579 self.think = onslaught_generator_delayed;
580 self.nextthink = time + 0.2;
582 #ifdef YOU_HAVE_FIXED_ONSLAUGHT_WAYPOINTS
583 WaypointSprite_SpawnFixed(string_null, e.origin + '0 0 1' * e.maxs_z, self, sprite);
584 self.sprite.waypointsprite_for_player = onslaught_generator_waypointsprite_for_player;
588 void onslaught_generator_reset()
590 self.team = self.team_saved;
591 self.lasthealth = self.max_health = self.health = cvar("g_onslaught_gen_health");
592 self.takedamage = DAMAGE_AIM;
593 self.bot_attack = TRUE;
594 self.iscaptured = TRUE;
595 self.islinked = TRUE;
596 self.isshielded = TRUE;
597 self.enemy.solid = SOLID_NOT;
598 self.think = onslaught_generator_delayed;
599 self.nextthink = time + 0.2;
602 void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
607 if (self.owner.isshielded)
609 // this is protected by a shield, so ignore the damage
610 if (time > self.pain_finished)
611 if (attacker.classname == "player")
613 play2(attacker, "sound/onslaught/damageblockedbyshield.wav");
614 self.pain_finished = time + 1;
618 if (time > self.pain_finished)
619 if (attacker.classname == "player")
621 play2team(self.team, "sound/onslaught/controlpoint_underattack.wav");
622 self.pain_finished = time + 5;
624 self.health = self.health - damage;
625 self.alpha = self.health / self.max_health;
626 self.pain_finished = time + 1;
627 // colormod flash when shot
628 self.colormod = '2 2 2';
631 sound(self, CHAN_TRIGGER, "sound/weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
632 pointparticles(particleeffectnum("onslaught_controlpoint_explosion"), self.origin, '0 0 0', 1);
635 t = ColoredTeamName(attacker.team);
636 bprint(ColoredTeamName(self.team), " ", self.message, " control point destroyed by ", t, "\n");
638 self.owner.goalentity = world;
639 self.owner.islinked = FALSE;
640 self.owner.iscaptured = FALSE;
642 self.owner.colormap = 1024;
643 onslaught_updatelinks();
645 // Use targets now (somebody make sure this is in the right place..)
648 activator = self.owner;
656 void onslaught_controlpoint_icon_think()
658 self.nextthink = time + 0.1;
659 if (time > self.pain_finished + 1)
661 self.health = self.health + self.count;
662 if (self.health >= self.max_health)
663 self.health = self.max_health;
665 self.alpha = self.health / self.max_health;
666 // colormod flash when shot
667 self.colormod = '1 1 1' * (2 - bound(0, (self.pain_finished - time) / 10, 1));
670 void onslaught_controlpoint_icon_buildthink()
674 self.nextthink = time + 0.1;
675 self.health = self.health + self.count;
676 if (self.health >= self.max_health)
678 self.health = self.max_health;
679 self.count = self.count * 0.2; // slow repair rate from now on
680 self.think = onslaught_controlpoint_icon_think;
681 sound(self, CHAN_TRIGGER, "sound/onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
682 bprint(ColoredTeamName(self.team), " captured ", self.owner.message, " control point\n");
683 self.owner.iscaptured = TRUE;
684 onslaught_updatelinks();
686 // Use targets now (somebody make sure this is in the right place..)
693 self.alpha = self.health / self.max_health;
694 // colormod flash when shot
695 self.colormod = '1 1 1' * (2 - bound(0, (self.pain_finished - time) / 10, 1));
698 void onslaught_controlpoint_touch()
702 if (other.classname != "player")
704 a = onslaught_controlpoint_attackable(self, other.team);
707 // we've verified that this player has a legitimate claim to this point,
708 // so start building the captured point icon (which only captures this
709 // point if it successfully builds without being destroyed first)
710 self.goalentity = e = spawn();
712 e.max_health = cvar("g_onslaught_cp_health");
713 e.health = e.max_health * 0.1;
714 e.alpha = e.health / e.max_health;
715 e.solid = SOLID_BBOX;
716 e.movetype = MOVETYPE_NONE;
717 setmodel(e, "models/onslaught/controlpoint_icon.md3");
718 setsize(e, '-32 -32 -32', '32 32 32');
719 setorigin(e, self.origin + '0 0 96');
720 e.takedamage = DAMAGE_AIM;
722 e.event_damage = onslaught_controlpoint_icon_damage;
724 e.colormap = 1024 + (e.team - 1) * 17;
725 e.think = onslaught_controlpoint_icon_buildthink;
726 e.nextthink = time + 0.1;
727 e.count = e.max_health / 50; // how long it takes to build
728 sound(e, CHAN_TRIGGER, "sound/onslaught/controlpoint_build.wav", VOL_BASE, ATTN_NORM);
730 self.colormap = e.colormap;
733 /*QUAKED spawnfunc_onslaught_controlpoint (0 .5 .8) (-32 -32 0) (32 32 128)
734 Control point. Be sure to give this enough clearance so that the shootable part has room to exist
736 This should link to an spawnfunc_onslaught_controlpoint entity or spawnfunc_onslaught_generator entity.
739 "targetname" - name that spawnfunc_onslaught_link entities will use to target this.
740 "target" - target any entities that are tied to this control point, such as vehicles and buildable structure entities.
741 "message" - name of this control point (should reflect the location in the map, such as "center bridge", "north tower", etc)
743 void spawnfunc_onslaught_controlpoint()
751 precache_model("models/onslaught/controlpoint_pad.md3");
752 precache_model("models/onslaught/controlpoint_shield.md3");
753 precache_model("models/onslaught/controlpoint_icon.md3");
754 precache_sound("sound/onslaught/controlpoint_build.wav");
755 precache_sound("sound/onslaught/controlpoint_built.wav");
756 precache_sound("sound/weapons/grenade_impact.wav");
757 precache_sound("sound/onslaught/damageblockedbyshield.wav");
758 precache_sound("sound/onslaught/controlpoint_underattack.wav");
759 self.solid = SOLID_BSP;
760 self.movetype = MOVETYPE_NONE;
761 setmodel(self, "models/onslaught/controlpoint_pad.md3");
762 //setsize(self, '-32 -32 0', '32 32 8');
763 setorigin(self, self.origin);
764 self.touch = onslaught_controlpoint_touch;
766 self.colormap = 1024;
767 self.iscaptured = FALSE;
768 self.islinked = FALSE;
769 self.isshielded = TRUE;
770 // spawn shield model which indicates whether this can be damaged
771 self.enemy = e = spawn();
773 e.movetype = MOVETYPE_NONE;
774 e.effects = EF_ADDITIVE;
775 setmodel(e, "models/onslaught/controlpoint_shield.md3");
776 //setsize(e, '-32 -32 0', '32 32 128');
777 setorigin(e, self.origin);
778 e.colormap = self.colormap;
779 onslaught_updatelinks();
781 waypoint_spawnforitem(self);
783 #ifdef YOU_HAVE_FIXED_ONSLAUGHT_WAYPOINTS
784 WaypointSprite_SpawnFixed(string_null, e.origin + '0 0 1' * e.maxs_z, self, sprite);
785 self.sprite.waypointsprite_for_player = onslaught_controlpoint_waypointsprite_for_player;
789 void onslaught_controlpoint_reset()
791 if(self.goalentity && self.goalentity != world)
792 remove(self.goalentity);
793 self.goalentity = world;
795 self.colormap = 1024;
796 self.iscaptured = FALSE;
797 self.islinked = FALSE;
798 self.isshielded = TRUE;
799 self.enemy.solid = SOLID_NOT;
800 self.enemy.colormap = self.colormap;
801 self.think = self.enemy.think = SUB_Null;
802 self.nextthink = 0; // don't like SUB_Null :P
804 onslaught_updatelinks();
807 SUB_UseTargets(); // to reset the structures, playerspawns etc.
810 void onslaught_link_delayed()
812 self.goalentity = find(world, targetname, self.target);
813 self.enemy = find(world, targetname, self.target2);
814 if (!self.goalentity)
815 objerror("can not find target\n");
817 objerror("can not find target2\n");
818 dprint(etos(self.goalentity), " linked with ", etos(self.enemy), "\n");
821 /*QUAKED spawnfunc_onslaught_link (0 .5 .8) (-16 -16 -16) (16 16 16)
822 Link between control points.
824 This entity targets two different spawnfunc_onslaught_controlpoint or spawnfunc_onslaught_generator entities, and suppresses shielding on both if they are owned by different teams.
827 "target" - first control point.
828 "target2" - second control point.
830 void spawnfunc_onslaught_link()
837 if (self.target == "" || self.target2 == "")
838 objerror("target and target2 must be set\n");
839 self.think = onslaught_link_delayed;
840 self.nextthink = time + 0.1;