mirror of
https://git.code.sf.net/p/quake/game-source
synced 2024-11-28 14:42:05 +00:00
bringback.qc moved respawn_enabled to defs.qc and made a float, whitespace fixes
defs.qc added respawn_enabled world.qc added setup for respawn_enabled. Is only checked on map load.
This commit is contained in:
parent
9da852c80f
commit
029ab404b5
3 changed files with 55 additions and 57 deletions
|
@ -3,65 +3,63 @@
|
||||||
// void bringback (); declared in ogre.qc ( first file its referanced in);
|
// void bringback (); declared in ogre.qc ( first file its referanced in);
|
||||||
// void savecritter (); ""
|
// void savecritter (); ""
|
||||||
|
|
||||||
integer respawn_enabled = 1;
|
|
||||||
|
|
||||||
@static {
|
@static {
|
||||||
|
|
||||||
void () hes_dead_jim = [ self.frame, im_alive, 10 ] { }
|
void () hes_dead_jim = [ self.frame, im_alive, 10 ] { }
|
||||||
|
|
||||||
void () im_alive = [ 0, (self.th_walk), 0.2 ]
|
void () im_alive = [ 0, (self.th_walk), 0.2 ]
|
||||||
{
|
{
|
||||||
self.solid = SOLID_SLIDEBOX;
|
self.solid = SOLID_SLIDEBOX;
|
||||||
self.movetype = MOVETYPE_STEP;
|
self.movetype = MOVETYPE_STEP;
|
||||||
self.takedamage = DAMAGE_AIM;
|
self.takedamage = DAMAGE_AIM;
|
||||||
|
|
||||||
if ((mapname != "end") && (random() < 0.5))
|
if ((mapname != "end") && (random() < 0.5))
|
||||||
self.origin = self.oldorigin;
|
self.origin = self.oldorigin;
|
||||||
|
|
||||||
setmodel(self, self.weaponmodel);
|
setmodel(self, self.weaponmodel);
|
||||||
self.health = self.max_health;
|
self.health = self.max_health;
|
||||||
|
|
||||||
switch (self.classname) {
|
switch (self.classname) {
|
||||||
case "monster_demon1":
|
case "monster_demon1":
|
||||||
case "monster_ogre":
|
case "monster_ogre":
|
||||||
case "monster_shalrath":
|
case "monster_shalrath":
|
||||||
case "monster_shambler":
|
case "monster_shambler":
|
||||||
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
||||||
break;
|
break;
|
||||||
case "monster_dog":
|
case "monster_dog":
|
||||||
setsize (self, '-32 -32 -24', '32 32 40');
|
setsize (self, '-32 -32 -24', '32 32 40');
|
||||||
break;
|
break;
|
||||||
case "monster_fish":
|
case "monster_fish":
|
||||||
setsize (self, '-16 -16 -24', '16 16 24');
|
setsize (self, '-16 -16 -24', '16 16 24');
|
||||||
self.flags = self.flags + FL_SWIM;
|
self.flags = self.flags + FL_SWIM;
|
||||||
break;
|
break;
|
||||||
case "monster_wizard":
|
case "monster_wizard":
|
||||||
setsize (self, '-16 -16 -24', '16 16 40');
|
setsize (self, '-16 -16 -24', '16 16 40');
|
||||||
self.flags = self.flags + FL_FLY;
|
self.flags = self.flags + FL_FLY;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// about 3/4 of quakes critters use this size
|
// about 3/4 of quakes critters use this size
|
||||||
setsize (self, '-16 -16 -24', '16 16 40');
|
setsize (self, '-16 -16 -24', '16 16 40');
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
spawn_tdeath (self.origin, self);
|
||||||
|
spawn_tfog (self.origin);
|
||||||
|
|
||||||
|
//Don't stay angry at everyone.
|
||||||
|
//Side note. NIL is the same as WORLD.
|
||||||
|
self.enemy = NIL;
|
||||||
|
|
||||||
|
//We have to set the origin no matter what kind of creature it is, so the
|
||||||
|
//thing becomes solid again. (Maybe, maybe not? Can't hurt anyway...)
|
||||||
|
if (!(self.flags & FL_FLY) && !(self.flags & FL_SWIM)) {
|
||||||
|
setorigin (self, self.origin + '0 0 1');
|
||||||
|
droptofloor ();
|
||||||
|
} else {
|
||||||
|
//Flyer/Fish
|
||||||
|
setorigin (self, self.origin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spawn_tdeath (self.origin, self);
|
|
||||||
spawn_tfog (self.origin);
|
|
||||||
|
|
||||||
//Don't stay angry at everyone.
|
|
||||||
self.enemy = NIL;
|
|
||||||
|
|
||||||
//We have to set the origin no matter what kind of creature it is, so the
|
|
||||||
//thing becomes solid again. (Maybe, maybe not? Can't hurt anyway...)
|
|
||||||
if (!(self.flags & FL_FLY) && !(self.flags & FL_SWIM)) {
|
|
||||||
setorigin (self, self.origin + '0 0 1');
|
|
||||||
droptofloor ();
|
|
||||||
} else {
|
|
||||||
//Flyer/Fish
|
|
||||||
setorigin (self, self.origin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void () savecritter =
|
void () savecritter =
|
||||||
|
|
|
@ -38,7 +38,7 @@ float total_monsters;
|
||||||
|
|
||||||
float found_secrets; // number of secrets found
|
float found_secrets; // number of secrets found
|
||||||
float killed_monsters; // number of monsters killed
|
float killed_monsters; // number of monsters killed
|
||||||
|
float respawn_enabled; // is respawn allowed
|
||||||
|
|
||||||
// spawnparms are used to encode information about clients across server
|
// spawnparms are used to encode information about clients across server
|
||||||
// level changes
|
// level changes
|
||||||
|
@ -692,5 +692,3 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
|
||||||
float (entity e, float healamount, float ignore) T_Heal; // health function
|
float (entity e, float healamount, float ignore) T_Heal; // health function
|
||||||
|
|
||||||
float(entity targ, entity inflictor) CanDamage;
|
float(entity targ, entity inflictor) CanDamage;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -333,6 +333,8 @@ void() worldspawn =
|
||||||
|
|
||||||
// 63 testing
|
// 63 testing
|
||||||
lightstyle(63, "a");
|
lightstyle(63, "a");
|
||||||
|
respawn_enabled = cvar ("respawn_enabled");
|
||||||
|
localcmd ("set respawn_enabled " + ftos (respawn_enabled) + "\n");
|
||||||
};
|
};
|
||||||
|
|
||||||
void() StartFrame =
|
void() StartFrame =
|
||||||
|
|
Loading…
Reference in a new issue