case ENT_CLIENT_TURRET: ent_turret(); break;
case ENT_CLIENT_MONSTER: ent_monster(); break;
case ENT_CLIENT_GENERATOR: ent_generator(); break;
+ case ENT_CLIENT_CONTROLPOINT: ent_controlpoint(); break;
case ENT_CLIENT_MODEL: CSQCModel_Read(bIsNewEntity); break;
case ENT_CLIENT_ITEM: ItemRead(bIsNewEntity); break;
case ENT_CLIENT_BUMBLE_RAYGUN: bumble_raygun_read(bIsNewEntity); break;
../server/tturrets/include/turrets_early.qh
../server/movelib.qc
../server/generator.qh
+../server/controlpoint.qh
main.qh
vehicles/vehicles.qh
../common/csqcmodel_settings.qh
tturrets.qc
../server/generator.qc
+../server/controlpoint.qc
player_skeleton.qc
../common/animdecide.qc
const float ENT_CLIENT_VEHICLE = 60;
const float ENT_CLIENT_MONSTER = 70;
const float ENT_CLIENT_GENERATOR = 80;
+const float ENT_CLIENT_CONTROLPOINT = 90;
const float SPRITERULE_DEFAULT = 0;
const float SPRITERULE_TEAMPLAY = 1;
else if not(autocvar_g_monsters) { Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_MONSTERS_DISABLED); }
else if(self.vehicle) { sprint(self, "You can't spawn monsters while driving a vehicle.\n"); }
else if(autocvar_g_campaign) { sprint(self, "You can't spawn monsters in campaign mode.\n"); }
- else if(self.deadflag) { sprint(self, "You can't spawn monsters while dead.\n"); }
+ else if(self.deadflag != DEAD_NO) { sprint(self, "You can't spawn monsters while dead.\n"); }
else if(self.monstercount >= autocvar_g_monsters_max_perplayer) { sprint(self, "You have spawned too many monsters, kill some before trying to spawn any more.\n"); }
else if(totalspawned >= autocvar_g_monsters_max) { sprint(self, "The global maximum monster count has been reached, kill some before trying to spawn any more.\n"); }
else // all worked out, so continue
--- /dev/null
+#ifdef CSQC
+float controlpoint_precached;
+
+void controlpoint_precache()
+{
+ if(controlpoint_precached)
+ return; // already precached
+
+ precache_model("models/onslaught/controlpoint_pad.md3");
+ precache_model("models/onslaught/controlpoint_pad2.md3");
+
+ controlpoint_precached = TRUE;
+}
+
+void controlpoint_draw()
+{
+}
+
+void controlpoint_construct()
+{
+ self.netname = "Control Point";
+
+ setorigin(self, self.origin);
+ setmodel(self, "models/onslaught/controlpoint_pad.md3");
+ setsize(self, CONTROLPOINT_MIN, CONTROLPOINT_MAX);
+
+ self.move_movetype = MOVETYPE_NOCLIP;
+ self.solid = SOLID_BBOX;
+ self.movetype = MOVETYPE_NOCLIP;
+ self.move_origin = self.origin;
+ self.move_time = time;
+ self.drawmask = MASK_NORMAL;
+ self.alpha = 1;
+ self.draw = controlpoint_draw;
+ self.health = 255;
+}
+
+.vector glowmod;
+void controlpoint_changeteam()
+{
+ if(self.team)
+ {
+ self.glowmod = Team_ColorRGB(self.team - 1);
+ self.teamradar_color = Team_ColorRGB(self.team - 1);
+ self.colormap = 1024 + (self.team - 1) * 17;
+ setmodel(self, "models/onslaught/controlpoint_pad2.md3");
+ setsize(self, CONTROLPOINT_MIN, CONTROLPOINT_MAX);
+ }
+ else
+ {
+ self.colormap = 1024;
+ self.glowmod = '1 1 0';
+ self.teamradar_color = '1 1 0';
+ setmodel(self, "models/onslaught/controlpoint_pad.md3");
+ setsize(self, CONTROLPOINT_MIN, CONTROLPOINT_MAX);
+ }
+}
+
+void ent_controlpoint()
+{
+ float sf;
+ sf = ReadByte();
+
+ if(sf & CPSF_SETUP)
+ {
+ self.origin_x = ReadCoord();
+ self.origin_y = ReadCoord();
+ self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
+
+ self.team = ReadByte();
+
+ if not(self.count)
+ self.count = 40;
+
+ controlpoint_changeteam();
+ controlpoint_precache();
+ controlpoint_construct();
+ }
+
+ if(sf & CPSF_STATUS)
+ {
+ float _tmp;
+ _tmp = ReadByte();
+ if(_tmp != self.team)
+ {
+ self.team = _tmp;
+ controlpoint_changeteam();
+ }
+ }
+}
+#endif // CSQC
+
+#ifdef SVQC
+float controlpoint_send(entity to, float sf)
+{
+ WriteByte(MSG_ENTITY, ENT_CLIENT_CONTROLPOINT);
+ WriteByte(MSG_ENTITY, sf);
+ if(sf & CPSF_SETUP)
+ {
+ WriteCoord(MSG_ENTITY, self.origin_x);
+ WriteCoord(MSG_ENTITY, self.origin_y);
+ WriteCoord(MSG_ENTITY, self.origin_z);
+
+ WriteByte(MSG_ENTITY, self.team);
+ }
+
+ if(sf & CPSF_STATUS)
+ {
+ WriteByte(MSG_ENTITY, self.team);
+ }
+
+ return TRUE;
+}
+
+void controlpoint_link()
+{
+ Net_LinkEntity(self, TRUE, 0, controlpoint_send);
+}
+#endif // SVQC
--- /dev/null
+const vector CONTROLPOINT_MIN = '-63 -63 -9';
+const vector CONTROLPOINT_MAX = '65 63 26';
+
+float CPSF_STATUS = 4;
+float CPSF_SETUP = 8;
+
+#ifdef CSQC
+void ent_controlpoint();
+void controlpoint_precache();
+#endif
\ No newline at end of file
self.enemy.solid = SOLID_NOT;
self.think = onslaught_generator_delayed;
self.nextthink = time + 0.2;
- setmodel(self, "models/onslaught/generator.md3");
- setsize(self, GENERATOR_MIN, GENERATOR_MAX);
+ //setmodel(self, "models/onslaught/generator.md3");
+ //setsize(self, GENERATOR_MIN, GENERATOR_MAX);
self.SendFlags |= GSF_STATUS;
self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_NONE;
self.lasthealth = self.max_health = self.health = autocvar_g_onslaught_gen_health;
- setmodel(self, "models/onslaught/generator.md3");
+ //setmodel(self, "models/onslaught/generator.md3");
setsize(self, GENERATOR_MIN, GENERATOR_MAX);
setorigin(self, self.origin);
self.takedamage = DAMAGE_AIM;
self.owner.waslinked = self.owner.islinked;
- if(self.owner.model != "models/onslaught/controlpoint_pad.md3")
- setmodel(self.owner, "models/onslaught/controlpoint_pad.md3");
+ self.owner.SendFlags |= CPSF_STATUS;
+ //if(self.owner.model != "models/onslaught/controlpoint_pad.md3")
+ //setmodel(self.owner, "models/onslaught/controlpoint_pad.md3");
//setsize(self, '-32 -32 0', '32 32 8');
remove(self);
self.alpha = self.health / self.max_health;
// colormod flash when shot
self.colormod = '1 1 1' * (2 - bound(0, (self.pain_finished - time) / 10, 1));
- if(self.owner.model != "models/onslaught/controlpoint_pad2.md3")
- setmodel(self.owner, "models/onslaught/controlpoint_pad2.md3");
+ self.owner.SendFlags |= CPSF_STATUS;
+ //if(self.owner.model != "models/onslaught/controlpoint_pad2.md3")
+ //setmodel(self.owner, "models/onslaught/controlpoint_pad2.md3");
//setsize(self, '-32 -32 0', '32 32 8');
if(random() < 0.9 - self.health / self.max_health)
self.enemy.colormap = self.colormap;
self.think = self.enemy.think = func_null;
self.nextthink = 0; // don't like func_null :P
- setmodel(self, "models/onslaught/controlpoint_pad.md3");
+ //setmodel(self, "models/onslaught/controlpoint_pad.md3");
//setsize(self, '-32 -32 0', '32 32 8');
WaypointSprite_UpdateMaxHealth(self.sprite, 0);
onslaught_updatelinks();
+
+ self.SendFlags |= CPSF_STATUS;
activator = self;
SUB_UseTargets(); // to reset the structures, playerspawns etc.
remove(self);
return;
}
- precache_model("models/onslaught/controlpoint_pad.md3");
- precache_model("models/onslaught/controlpoint_pad2.md3");
+ //precache_model("models/onslaught/controlpoint_pad.md3");
+ //precache_model("models/onslaught/controlpoint_pad2.md3");
precache_model("models/onslaught/controlpoint_shield.md3");
precache_model("models/onslaught/controlpoint_icon.md3");
precache_model("models/onslaught/controlpoint_icon_dmg1.md3");
self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_NONE;
- setmodel(self, "models/onslaught/controlpoint_pad.md3");
- //setsize(self, '-32 -32 0', '32 32 8');
+ //setmodel(self, "models/onslaught/controlpoint_pad.md3");
+ setsize(self, CONTROLPOINT_MIN, CONTROLPOINT_MAX);
if(!self.noalign)
{
setorigin(self, self.origin + '0 0 20');
WaypointSprite_SpawnFixed(string_null, self.origin + '0 0 128', self, sprite, RADARICON_NONE, '0 0 0');
WaypointSprite_UpdateRule(self.sprite, NUM_TEAM_2, SPRITERULE_TEAMPLAY);
+
+ controlpoint_link();
onslaught_updatelinks();
vehicles/vehicles_def.qh
generator.qh
+controlpoint.qh
campaign.qh
../common/campaign_common.qh
portals.qc
generator.qc
+controlpoint.qc
target_spawn.qc
func_breakable.qc