precache_model("null");
precache_sound("misc/hit.wav");
precache_sound("misc/typehit.wav");
-
- generator_precache();
+
Projectile_Precache();
Hook_Precache();
GibSplash_Precache();
case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
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;
tturrets.qh
../server/tturrets/include/turrets_early.qh
../server/movelib.qc
-../server/generator.qh
-../server/controlpoint.qh
main.qh
vehicles/vehicles.qh
../common/csqcmodel_settings.qh
../warpzonelib/client.qc
tturrets.qc
-../server/generator.qc
-../server/controlpoint.qc
-
player_skeleton.qc
../common/animdecide.qc
const float ENT_CLIENT_AUXILIARYXHAIR = 50;
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;
+++ /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
+++ /dev/null
-#ifdef CSQC
-float generator_precached;
-.float count;
-
-vector randompos(vector m1, vector m2)
-{
- vector v;
- m2 = m2 - m1;
- v_x = m2_x * random() + m1_x;
- v_y = m2_y * random() + m1_y;
- v_z = m2_z * random() + m1_z;
- return v;
-}
-
-void generator_precache()
-{
- if(generator_precached)
- return; // already precached
-
- precache_model("models/onslaught/generator.md3");
- precache_model("models/onslaught/generator_dead.md3");
- precache_model("models/onslaught/generator_dmg1.md3");
- precache_model("models/onslaught/generator_dmg2.md3");
- precache_model("models/onslaught/generator_dmg3.md3");
- precache_model("models/onslaught/generator_dmg4.md3");
- precache_model("models/onslaught/generator_dmg5.md3");
- precache_model("models/onslaught/generator_dmg6.md3");
- precache_model("models/onslaught/generator_dmg7.md3");
- precache_model("models/onslaught/generator_dmg8.md3");
- precache_model("models/onslaught/generator_dmg9.md3");
- precache_model("models/onslaught/generator_dead.md3");
-
- precache_model("models/onslaught/ons_ray.md3");
- precache_sound("onslaught/shockwave.wav");
- precache_sound("weapons/grenade_impact.wav");
- precache_sound("weapons/rocket_impact.wav");
-
- precache_model("models/onslaught/gen_gib1.md3");
- precache_model("models/onslaught/gen_gib2.md3");
- precache_model("models/onslaught/gen_gib3.md3");
-
- generator_precached = TRUE;
-}
-
-void ons_gib_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
-{
- self.velocity = self.velocity + vforce;
-}
-
-.float giblifetime;
-
-void gib_draw_noburn()
-{
- if(time >= self.giblifetime)
- remove(self);
-}
-
-void gib_draw()
-{
- if(time >= self.move_time)
- return;
-
- self.move_time = time + 0.05;
-
- if(time > self.giblifetime)
- {
- remove(self);
- return;
- }
-
- self.alpha -= 0.05;
-
- if(self.alpha < 0.1)
- {
- remove(self);
- return;
- }
-
- if(random()<0.6)
- pointparticles(particleeffectnum("onslaught_generator_gib_flame"), self.origin, '0 0 0', 1);
-}
-
-void ons_throwgib(vector v_from, vector v_to, string smodel, float f_lifetime, float b_burn)
-{
- entity gib;
-
- gib = spawn();
-
- setmodel(gib, smodel);
- setorigin(gib, v_from);
- gib.solid = SOLID_CORPSE;
- gib.move_movetype = MOVETYPE_BOUNCE;
- gib.movetype = MOVETYPE_BOUNCE;
- gib.health = 255;
- gib.move_velocity = v_to;
- gib.move_origin = v_from;
- gib.velocity = v_to;
- gib.alpha = 1;
- gib.move_time = time;
- gib.drawmask = MASK_NORMAL;
- gib.giblifetime = time + f_lifetime;
-
- if(b_burn)
- gib.draw = gib_draw;
- else
- gib.draw = gib_draw_noburn;
-}
-
-void onslaught_generator_ray_think()
-{
- self.nextthink = time + 0.05;
- if(self.count > 10)
- {
- self.think = SUB_Remove;
- return;
- }
-
- if(self.count > 5)
- self.alpha -= 0.1;
- else
- self.alpha += 0.1;
-
- self.scale += 0.2;
- self.count +=1;
-}
-
-void onslaught_generator_ray_spawn(vector org)
-{
- entity e;
- e = spawn();
- setmodel(e, "models/onslaught/ons_ray.md3");
- setorigin(e, org);
- e.angles = randomvec() * 360;
- e.alpha = 0;
- e.scale = random() * 5 + 8;
- e.think = onslaught_generator_ray_think;
- e.nextthink = time + 0.05;
-}
-
-void generator_draw()
-{
- if(self.health > 0)
- return;
-
- if(time < self.move_time)
- return;
- if(self.count <= 0)
- return;
-
- vector org;
- float i;
-
- // White shockwave
- if(self.count==40||self.count==20)
- {
- sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 6);
- }
-
- // Throw some gibs
- if(random() < 0.3)
- {
- i = random();
- if(i < 0.3)
- ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 11 + '0 0 20', "models/onslaught/gen_gib1.md3", 6, TRUE);
- else if(i > 0.7)
- ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 12 + '0 0 20', "models/onslaught/gen_gib2.md3", 6, TRUE);
- else
- ons_throwgib(self.origin + '0 0 40', (100 * randomvec() - '1 1 1') * 13 + '0 0 20', "models/onslaught/gen_gib3.md3", 6, TRUE);
- }
-
- // Spawn fire balls
- for(i=0;i < 10;++i)
- {
- org = self.origin + randompos('-30 -30 -30' * i + '0 0 -20', '30 30 30' * i + '0 0 20');
- pointparticles(particleeffectnum("onslaught_generator_gib_explode"), org, '0 0 0', 1);
- }
-
- // Short explosion sound + small explosion
- if(random() < 0.25)
- {
- te_explosion(self.origin);
- sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
- }
-
- // Particles
- org = self.origin + randompos(self.mins + '8 8 8', self.maxs + '-8 -8 -8');
- pointparticles(particleeffectnum("onslaught_generator_smallexplosion"), org, '0 0 0', 1);
-
- // rays
- if(random() > 0.25 )
- {
- onslaught_generator_ray_spawn(self.origin);
- }
-
- // Final explosion
- if(self.count==1)
- {
- org = self.origin;
- te_explosion(org);
- pointparticles(particleeffectnum("onslaught_generator_finalexplosion"), org, '0 0 0', 1);
- sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
- }
-
- self.move_time = time + 0.05;
-
- self.count -= 1;
-}
-
-.float max_health;
-void generator_damage(float hp)
-{
- if(hp <= 0)
- setmodel(self, "models/onslaught/generator_dead.md3");
- else if(hp < self.max_health * 0.10)
- setmodel(self, "models/onslaught/generator_dmg9.md3");
- else if(hp < self.max_health * 0.20)
- setmodel(self, "models/onslaught/generator_dmg8.md3");
- else if(hp < self.max_health * 0.30)
- setmodel(self, "models/onslaught/generator_dmg7.md3");
- else if(hp < self.max_health * 0.40)
- setmodel(self, "models/onslaught/generator_dmg6.md3");
- else if(hp < self.max_health * 0.50)
- setmodel(self, "models/onslaught/generator_dmg5.md3");
- else if(hp < self.max_health * 0.60)
- setmodel(self, "models/onslaught/generator_dmg4.md3");
- else if(hp < self.max_health * 0.70)
- setmodel(self, "models/onslaught/generator_dmg3.md3");
- else if(hp < self.max_health * 0.80)
- setmodel(self, "models/onslaught/generator_dmg2.md3");
- else if(hp < self.max_health * 0.90)
- setmodel(self, "models/onslaught/generator_dmg1.md3");
- else if(hp <= self.max_health || hp >= self.max_health)
- setmodel(self, "models/onslaught/generator.md3");
-
- setsize(self, GENERATOR_MIN, GENERATOR_MAX);
-}
-
-void generator_construct()
-{
- self.netname = "Generator";
-
- setorigin(self, self.origin);
- setmodel(self, "models/onslaught/generator.md3");
- setsize(self, GENERATOR_MIN, GENERATOR_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 = generator_draw;
-}
-
-.vector glowmod;
-void generator_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;
- }
- else
- {
- self.colormap = 1024;
- self.glowmod = '1 1 0';
- self.teamradar_color = '1 1 0';
- }
-}
-
-void ent_generator()
-{
- float sf;
- sf = ReadByte();
-
- if(sf & GSF_SETUP)
- {
- self.origin_x = ReadCoord();
- self.origin_y = ReadCoord();
- self.origin_z = ReadCoord();
- setorigin(self, self.origin);
-
- self.health = ReadByte();
- self.max_health = ReadByte();
- self.count = ReadByte();
- self.team = ReadByte();
-
- if not(self.count)
- self.count = 40;
-
- generator_changeteam();
- generator_precache();
- generator_construct();
- }
-
- if(sf & GSF_STATUS)
- {
- float _tmp;
- _tmp = ReadByte();
- if(_tmp != self.team)
- {
- self.team = _tmp;
- generator_changeteam();
- }
-
- _tmp = ReadByte();
-
- if(_tmp != self.health)
- generator_damage(_tmp);
-
- self.health = _tmp;
- }
-}
-#endif // CSQC
-
-#ifdef SVQC
-float generator_send(entity to, float sf)
-{
- WriteByte(MSG_ENTITY, ENT_CLIENT_GENERATOR);
- WriteByte(MSG_ENTITY, sf);
- if(sf & GSF_SETUP)
- {
- WriteCoord(MSG_ENTITY, self.origin_x);
- WriteCoord(MSG_ENTITY, self.origin_y);
- WriteCoord(MSG_ENTITY, self.origin_z);
-
- WriteByte(MSG_ENTITY, self.health);
- WriteByte(MSG_ENTITY, self.max_health);
- WriteByte(MSG_ENTITY, self.count);
- WriteByte(MSG_ENTITY, self.team);
- }
-
- if(sf & GSF_STATUS)
- {
- WriteByte(MSG_ENTITY, self.team);
-
- if(self.health <= 0)
- WriteByte(MSG_ENTITY, 0);
- else
- WriteByte(MSG_ENTITY, ceil((self.health / self.max_health) * 255));
- }
-
- return TRUE;
-}
-
-void generator_link(void() spawnproc)
-{
- Net_LinkEntity(self, TRUE, 0, generator_send);
- self.think = spawnproc;
- self.nextthink = time;
-}
-#endif // SVQC
+++ /dev/null
-const vector GENERATOR_MIN = '-52 -52 -14';
-const vector GENERATOR_MAX = '52 52 75';
-
-float GSF_STATUS = 4;
-float GSF_SETUP = 8;
-
-#ifdef CSQC
-void ent_generator();
-void generator_precache();
-#endif
\ No newline at end of file
onslaught_updatelinks();
}
+ if(self.health <= 0)
+ setmodel(self, "models/onslaught/generator_dead.md3");
+ else if(self.health < self.max_health * 0.10)
+ setmodel(self, "models/onslaught/generator_dmg9.md3");
+ else if(self.health < self.max_health * 0.20)
+ setmodel(self, "models/onslaught/generator_dmg8.md3");
+ else if(self.health < self.max_health * 0.30)
+ setmodel(self, "models/onslaught/generator_dmg7.md3");
+ else if(self.health < self.max_health * 0.40)
+ setmodel(self, "models/onslaught/generator_dmg6.md3");
+ else if(self.health < self.max_health * 0.50)
+ setmodel(self, "models/onslaught/generator_dmg5.md3");
+ else if(self.health < self.max_health * 0.60)
+ setmodel(self, "models/onslaught/generator_dmg4.md3");
+ else if(self.health < self.max_health * 0.70)
+ setmodel(self, "models/onslaught/generator_dmg3.md3");
+ else if(self.health < self.max_health * 0.80)
+ setmodel(self, "models/onslaught/generator_dmg2.md3");
+ else if(self.health < self.max_health * 0.90)
+ setmodel(self, "models/onslaught/generator_dmg1.md3");
+ setsize(self, '-52 -52 -14', '52 52 75');
+
// Throw some flaming gibs on damage, more damage = more chance for gib
if(random() < damage/220)
{
if(random() < damage/200+0.2)
if(random() < 0.5)
ons_throwgib(hitloc + '0 0 20', randomvec()*360, "models/onslaught/gen_gib1.md3", 5, FALSE);
-
- self.SendFlags |= GSF_STATUS;
}
// update links after a delay
{
onslaught_updatelinks();
// now begin normal thinking
- generator_link(onslaught_generator_think);
-
- self.SendFlags = GSF_SETUP;
+ self.think = onslaught_generator_think;
+ self.nextthink = time;
}
string onslaught_generator_waypointsprite_for_team(entity e, float t)
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);
-
- self.SendFlags |= GSF_STATUS;
+ setmodel(self, "models/onslaught/generator.md3");
+ setsize(self, '-52 -52 -14', '52 52 75');
if(!self.noalign)
{
//entity e;
precache_model("models/onslaught/generator.md3");
precache_model("models/onslaught/generator_shield.md3");
+ precache_model("models/onslaught/generator_dmg1.md3");
+ precache_model("models/onslaught/generator_dmg2.md3");
+ precache_model("models/onslaught/generator_dmg3.md3");
+ precache_model("models/onslaught/generator_dmg4.md3");
+ precache_model("models/onslaught/generator_dmg5.md3");
+ precache_model("models/onslaught/generator_dmg6.md3");
+ precache_model("models/onslaught/generator_dmg7.md3");
+ precache_model("models/onslaught/generator_dmg8.md3");
+ precache_model("models/onslaught/generator_dmg9.md3");
+ precache_model("models/onslaught/generator_dead.md3");
precache_model("models/onslaught/shockwave.md3");
precache_model("models/onslaught/shockwavetransring.md3");
precache_model("models/onslaught/gen_gib1.md3");
precache_sound("onslaught/ons_hit1.wav");
precache_sound("onslaught/ons_hit2.wav");
precache_sound("onslaught/electricity_explode.wav");
- precache_sound("onslaught/generator_underattack.wav");
if (!self.team)
objerror("team must be set");
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");
- setsize(self, GENERATOR_MIN, GENERATOR_MAX);
+ setmodel(self, "models/onslaught/generator.md3");
+ setsize(self, '-52 -52 -14', '52 52 75');
setorigin(self, self.origin);
self.takedamage = DAMAGE_AIM;
self.bot_attack = TRUE;
self.owner.waslinked = self.owner.islinked;
- self.owner.SendFlags |= CPSF_STATUS;
- //if(self.owner.model != "models/onslaught/controlpoint_pad.md3")
- //setmodel(self.owner, "models/onslaught/controlpoint_pad.md3");
+ 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));
- self.owner.SendFlags |= CPSF_STATUS;
- //if(self.owner.model != "models/onslaught/controlpoint_pad2.md3")
- //setmodel(self.owner, "models/onslaught/controlpoint_pad2.md3");
+ 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, CONTROLPOINT_MIN, CONTROLPOINT_MAX);
+ setmodel(self, "models/onslaught/controlpoint_pad.md3");
+ //setsize(self, '-32 -32 0', '32 32 8');
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();
tturrets/include/turrets_early.qh
vehicles/vehicles_def.qh
-generator.qh
-controlpoint.qh
-
campaign.qh
../common/campaign_common.qh
../common/mapinfo.qh
portals.qc
-generator.qc
-controlpoint.qc
-
target_spawn.qc
func_breakable.qc
target_music.qc