Compare commits
6 Commits
fa8592e377
...
8a8b6c6cc1
Author | SHA1 | Date | |
---|---|---|---|
8a8b6c6cc1 | |||
edb5ca9483 | |||
be61fb8b0e | |||
fd1888ab1c | |||
47d74c39cd | |||
5b34a34292 |
14
default_sc.cfg
Normal file
14
default_sc.cfg
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
alias pronoun_none "impulse 20"
|
||||||
|
alias pronoun_fae "impulse 21"
|
||||||
|
alias pronoun_he "impulse 22"
|
||||||
|
alias pronoun_it "impulse 23"
|
||||||
|
alias pronoun_she "impulse 24"
|
||||||
|
alias pronoun_they "impulse 25"
|
||||||
|
alias pronoun_xey "impulse 26"
|
||||||
|
alias pronoun_ze_hir "impulse 27"
|
||||||
|
alias pronoun_ze_zir "impulse 28"
|
||||||
|
|
||||||
|
echo "To change your pronouns in-game use one of the pronoun_ commands."
|
||||||
|
echo "You can get a list by typing 'pronoun_' and pressing tab."
|
||||||
|
|
||||||
|
// EOF
|
6
quake.rc
Normal file
6
quake.rc
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
exec default.cfg
|
||||||
|
exec default_sc.cfg
|
||||||
|
exec config.cfg
|
||||||
|
exec autoexec.cfg
|
||||||
|
stuffcmds
|
||||||
|
startdemos demo1 demo2 demo3
|
59
source/ai.qc
59
source/ai.qc
|
@ -101,44 +101,31 @@ void() HuntTarget = {
|
||||||
};
|
};
|
||||||
|
|
||||||
void() SightSound = {
|
void() SightSound = {
|
||||||
float rsnd;
|
string snd;
|
||||||
|
|
||||||
if(self.classname == "monster_ogre") {
|
switch(self.classname) {
|
||||||
sound(self, CHAN_VOICE, "ogre/ogwake.wav", 1, ATTN_NORM);
|
case "monster_enforcer":
|
||||||
} else if(self.classname == "monster_knight") {
|
switch(rint(random() * 3)) {
|
||||||
sound(self, CHAN_VOICE, "knight/ksight.wav", 1, ATTN_NORM);
|
case 0: snd = "enforcer/sight3.wav"; break;
|
||||||
} else if(self.classname == "monster_shambler") {
|
case 1: snd = "enforcer/sight1.wav"; break;
|
||||||
sound(self, CHAN_VOICE, "shambler/ssight.wav", 1, ATTN_NORM);
|
case 2: snd = "enforcer/sight2.wav"; break;
|
||||||
} else if(self.classname == "monster_demon1") {
|
case 3: snd = "enforcer/sight4.wav"; break;
|
||||||
sound(self, CHAN_VOICE, "demon/sight2.wav", 1, ATTN_NORM);
|
}
|
||||||
} else if(self.classname == "monster_wizard") {
|
break;
|
||||||
sound(self, CHAN_VOICE, "wizard/wsight.wav", 1, ATTN_NORM);
|
case "monster_army": snd = "soldier/sight1.wav"; break;
|
||||||
} else if(self.classname == "monster_zombie") {
|
case "monster_demon1": snd = "demon/sight2.wav"; break;
|
||||||
sound(self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_NORM);
|
case "monster_dog": snd = "dog/dsight.wav"; break;
|
||||||
} else if(self.classname == "monster_dog") {
|
case "monster_hell_knight": snd = "hknight/sight1.wav"; break;
|
||||||
sound(self, CHAN_VOICE, "dog/dsight.wav", 1, ATTN_NORM);
|
case "monster_knight": snd = "knight/ksight.wav"; break;
|
||||||
} else if(self.classname == "monster_hell_knight") {
|
case "monster_ogre": snd = "ogre/ogwake.wav"; break;
|
||||||
sound(self, CHAN_VOICE, "hknight/sight1.wav", 1, ATTN_NORM);
|
case "monster_shalrath": snd = "shalrath/sight.wav"; break;
|
||||||
} else if(self.classname == "monster_tarbaby") {
|
case "monster_shambler": snd = "shambler/ssight.wav"; break;
|
||||||
sound(self, CHAN_VOICE, "blob/sight1.wav", 1, ATTN_NORM);
|
case "monster_tarbaby": snd = "blob/sight1.wav"; break;
|
||||||
} else if(self.classname == "monster_vomit") {
|
case "monster_wizard": snd = "wizard/wsight.wav"; break;
|
||||||
sound(self, CHAN_VOICE, "vomitus/v_sight1.wav", 1, ATTN_NORM);
|
case "monster_zombie": snd = "zombie/z_idle.wav"; break;
|
||||||
} else if(self.classname == "monster_enforcer") {
|
|
||||||
rsnd = rint(random() * 3);
|
|
||||||
if(rsnd == 1) {
|
|
||||||
sound(self, CHAN_VOICE, "enforcer/sight1.wav", 1, ATTN_NORM);
|
|
||||||
} else if(rsnd == 2) {
|
|
||||||
sound(self, CHAN_VOICE, "enforcer/sight2.wav", 1, ATTN_NORM);
|
|
||||||
} else if(rsnd == 0) {
|
|
||||||
sound(self, CHAN_VOICE, "enforcer/sight3.wav", 1, ATTN_NORM);
|
|
||||||
} else {
|
|
||||||
sound(self, CHAN_VOICE, "enforcer/sight4.wav", 1, ATTN_NORM);
|
|
||||||
}
|
|
||||||
} else if(self.classname == "monster_army") {
|
|
||||||
sound(self, CHAN_VOICE, "soldier/sight1.wav", 1, ATTN_NORM);
|
|
||||||
} else if(self.classname == "monster_shalrath") {
|
|
||||||
sound(self, CHAN_VOICE, "shalrath/sight.wav", 1, ATTN_NORM);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sound(self, CHAN_VOICE, snd, 1, ATTN_NORM);
|
||||||
};
|
};
|
||||||
|
|
||||||
void() FoundTarget = {
|
void() FoundTarget = {
|
||||||
|
|
300
source/client.qc
300
source/client.qc
|
@ -44,6 +44,7 @@ void() SetChangeParms = {
|
||||||
parm7 = self.ammo_cells;
|
parm7 = self.ammo_cells;
|
||||||
parm8 = self.weapon;
|
parm8 = self.weapon;
|
||||||
parm9 = self.armortype * 100;
|
parm9 = self.armortype * 100;
|
||||||
|
parm10 = self.pronoun;
|
||||||
};
|
};
|
||||||
|
|
||||||
void() SetNewParms = {
|
void() SetNewParms = {
|
||||||
|
@ -74,6 +75,7 @@ void() DecodeLevelParms = {
|
||||||
self.ammo_cells = parm7;
|
self.ammo_cells = parm7;
|
||||||
self.weapon = parm8;
|
self.weapon = parm8;
|
||||||
self.armortype = parm9 * 0.01;
|
self.armortype = parm9 * 0.01;
|
||||||
|
self.pronoun = parm10;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -259,8 +261,7 @@ void() changelevel_touch = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(coop || deathmatch) {
|
if(coop || deathmatch) {
|
||||||
bprint(other.netname);
|
bprint(other.netname, " exited the level\n");
|
||||||
bprint(" exited the level\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nextmap = self.map;
|
nextmap = self.map;
|
||||||
|
@ -323,22 +324,6 @@ void() respawn = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
============
|
|
||||||
ClientKill
|
|
||||||
|
|
||||||
Player entered the suicide command
|
|
||||||
============
|
|
||||||
*/
|
|
||||||
void() ClientKill = {
|
|
||||||
bprint(self.netname);
|
|
||||||
bprint(" suicides\n");
|
|
||||||
set_suicide_frame();
|
|
||||||
self.modelindex = modelindex_player;
|
|
||||||
self.frags = self.frags - 2; // extra penalty
|
|
||||||
respawn();
|
|
||||||
};
|
|
||||||
|
|
||||||
float(vector v) CheckSpawnPoint = {
|
float(vector v) CheckSpawnPoint = {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
};
|
||||||
|
@ -1021,8 +1006,7 @@ called when a player connects to a server
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
void() ClientConnect = {
|
void() ClientConnect = {
|
||||||
bprint(self.netname);
|
bprint(self.netname, " entered the game\n");
|
||||||
bprint(" entered the game\n");
|
|
||||||
|
|
||||||
// a client connecting during an intermission can cause problems
|
// a client connecting during an intermission can cause problems
|
||||||
if(intermission_running) {
|
if(intermission_running) {
|
||||||
|
@ -1045,19 +1029,105 @@ void() ClientDisconnect = {
|
||||||
// since they aren't *really* leaving
|
// since they aren't *really* leaving
|
||||||
|
|
||||||
// let everyone else know
|
// let everyone else know
|
||||||
bprint(self.netname);
|
bprint(self.netname, " left the game with ", ftos(self.frags), " frags\n");
|
||||||
bprint(" left the game with ");
|
|
||||||
bprint(ftos(self.frags));
|
|
||||||
bprint(" frags\n");
|
|
||||||
sound(self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE);
|
sound(self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE);
|
||||||
set_suicide_frame();
|
set_suicide_frame();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void() cheat = {
|
||||||
|
if(deathmatch || coop) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.ammo_rockets = 100;
|
||||||
|
self.ammo_nails = 200;
|
||||||
|
self.ammo_shells = 100;
|
||||||
|
self.ammo_cells = 200;
|
||||||
|
|
||||||
|
self.items |= IT_AXE |
|
||||||
|
IT_SHOTGUN |
|
||||||
|
IT_SUPER_SHOTGUN |
|
||||||
|
IT_NAILGUN |
|
||||||
|
IT_SUPER_NAILGUN |
|
||||||
|
IT_GRENADE_LAUNCHER |
|
||||||
|
IT_ROCKET_LAUNCHER |
|
||||||
|
IT_LIGHTNING |
|
||||||
|
IT_KEY1 | IT_KEY2;
|
||||||
|
|
||||||
|
self.weapon = IT_ROCKET_LAUNCHER;
|
||||||
|
|
||||||
|
W_SetCurrentAmmo();
|
||||||
|
};
|
||||||
|
|
||||||
|
void() cheat_quad = {
|
||||||
|
if(deathmatch || coop) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.super_time = 1;
|
||||||
|
self.super_damage_finished = time + 30;
|
||||||
|
self.items = self.items | IT_QUAD;
|
||||||
|
};
|
||||||
|
|
||||||
|
string(float pro) pronoun_subject = {
|
||||||
|
switch(pro) {
|
||||||
|
case PRO_NONE: return "none";
|
||||||
|
case PRO_FAE: return "fae";
|
||||||
|
case PRO_HE: return "he";
|
||||||
|
case PRO_IT: return "it";
|
||||||
|
case PRO_SHE: return "she";
|
||||||
|
case PRO_THEY: return "they";
|
||||||
|
case PRO_XEY: return "xey";
|
||||||
|
case PRO_ZE_H: return "ze";
|
||||||
|
case PRO_ZE_Z: return "ze";
|
||||||
|
default: return "unknown";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
string(float pro) pronoun_possessive = {
|
||||||
|
switch(pro) {
|
||||||
|
case PRO_NONE: return "none";
|
||||||
|
case PRO_FAE: return "faer";
|
||||||
|
case PRO_HE: return "his";
|
||||||
|
case PRO_IT: return "its";
|
||||||
|
case PRO_SHE: return "her";
|
||||||
|
case PRO_THEY: return "their";
|
||||||
|
case PRO_XEY: return "xyr";
|
||||||
|
case PRO_ZE_H: return "hir";
|
||||||
|
case PRO_ZE_Z: return "zir";
|
||||||
|
default: return "unknown";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void(float pro) change_pronoun = {
|
||||||
|
pro = minmax(pro, PRO_NONE, PRO_MAX - 1);
|
||||||
|
|
||||||
|
self.pronoun = pro;
|
||||||
|
sprint(self, "pronoun set to ",
|
||||||
|
pronoun_subject(pro), "/",
|
||||||
|
pronoun_possessive(pro), "\n");
|
||||||
|
};
|
||||||
|
|
||||||
|
void() ImpulseCommands = {
|
||||||
|
if(self.impulse >= 1 && self.impulse <= 8) {
|
||||||
|
W_ChangeWeapon(self.impulse);
|
||||||
|
} else if(self.impulse >= 20 && self.impulse < 40) {
|
||||||
|
change_pronoun(self.impulse - 20);
|
||||||
|
} else {
|
||||||
|
switch(self.impulse) {
|
||||||
|
case 9: cheat(); break;
|
||||||
|
case 10: W_CycleWeapon(); break;
|
||||||
|
case 11: cheat_quad(); break;
|
||||||
|
case 12: W_CycleWeaponReverse(); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.impulse = 0;
|
||||||
|
};
|
||||||
|
|
||||||
float(entity targ, entity attacker) obit_teledeath = {
|
float(entity targ, entity attacker) obit_teledeath = {
|
||||||
attacker.owner.frags = attacker.owner.frags + 1;
|
attacker.owner.frags = attacker.owner.frags + 1;
|
||||||
bprint(" was telefragged by ");
|
bprint(" was telefragged by ", attacker.owner.netname, "\n");
|
||||||
bprint(attacker.owner.netname);
|
|
||||||
bprint("\n");
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1071,12 +1141,15 @@ float(entity targ, entity attacker) obit_suicide = {
|
||||||
targ.frags = targ.frags - 1;
|
targ.frags = targ.frags - 1;
|
||||||
|
|
||||||
if(targ.weapon == IT_LIGHTNING && targ.waterlevel > 1) {
|
if(targ.weapon == IT_LIGHTNING && targ.waterlevel > 1) {
|
||||||
bprint(" discharges into the water.\n");
|
bprint(" discharges into the water\n");
|
||||||
} else if(targ.weapon == IT_GRENADE_LAUNCHER) {
|
} else if(targ.weapon == IT_GRENADE_LAUNCHER) {
|
||||||
bprint(" tries to put the pin back in\n");
|
bprint(" tries to put the pin back in\n");
|
||||||
} else {
|
} else {
|
||||||
// FIXME
|
bprint(" becomes bored with ");
|
||||||
bprint(" becomes bored with life\n");
|
if(targ.pronoun != PRO_NONE) {
|
||||||
|
bprint(pronoun_possessive(targ.pronoun), " ");
|
||||||
|
}
|
||||||
|
bprint("life\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1091,8 +1164,13 @@ float(entity targ, entity attacker) obit_teamkill = {
|
||||||
if(rnum < 0.25) {
|
if(rnum < 0.25) {
|
||||||
bprint(" mows down a teammate\n");
|
bprint(" mows down a teammate\n");
|
||||||
} else if(rnum < 0.50) {
|
} else if(rnum < 0.50) {
|
||||||
// FIXME
|
if(attacker.pronoun == PRO_NONE) {
|
||||||
bprint(" checks his glasses\n");
|
bprint(" needs new glasses\n");
|
||||||
|
} else {
|
||||||
|
bprint(" checks ",
|
||||||
|
pronoun_possessive(attacker.pronoun),
|
||||||
|
" glasses\n");
|
||||||
|
}
|
||||||
} else if(rnum < 0.75) {
|
} else if(rnum < 0.75) {
|
||||||
bprint(" gets a frag for the other team\n");
|
bprint(" gets a frag for the other team\n");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1149,16 +1227,12 @@ float(entity targ, entity attacker) obit_pkill = {
|
||||||
if(attacker.waterlevel > 1) {
|
if(attacker.waterlevel > 1) {
|
||||||
deathstring2 = "'s discharge\n";
|
deathstring2 = "'s discharge\n";
|
||||||
} else {
|
} else {
|
||||||
// FIXME
|
deathstring2 = "'s hot lightning injection\n";
|
||||||
deathstring2 = "'s shaft\n";
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bprint(targ.netname);
|
bprint(targ.netname, deathstring, attacker.netname, deathstring2);
|
||||||
bprint(deathstring);
|
|
||||||
bprint(attacker.netname);
|
|
||||||
bprint(deathstring2);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
};
|
||||||
|
@ -1166,35 +1240,110 @@ float(entity targ, entity attacker) obit_pkill = {
|
||||||
float(entity targ, entity attacker) obit_monster = {
|
float(entity targ, entity attacker) obit_monster = {
|
||||||
switch(attacker.classname) {
|
switch(attacker.classname) {
|
||||||
case "monster_army":
|
case "monster_army":
|
||||||
bprint(" was shot by a Grunt\n"); break;
|
if(random() < 0.5) {
|
||||||
|
bprint(" was shot by a Grunt\n");
|
||||||
|
} else {
|
||||||
|
bprint(" was blasted by a Grunt\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_demon1":
|
case "monster_demon1":
|
||||||
bprint(" was eviscerated by a Fiend\n"); break;
|
if(targ.pronoun == PRO_NONE) {
|
||||||
|
bprint(" had a Fiend lobotomy\n");
|
||||||
|
} else {
|
||||||
|
bprint(" had ",
|
||||||
|
pronoun_possessive(targ.pronoun),
|
||||||
|
" head ripped off by a Fiend\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_dog":
|
case "monster_dog":
|
||||||
bprint(" was mauled by a Rottweiler\n"); break;
|
if(random() < 0.5) {
|
||||||
|
bprint(" was eaten by a Rottweiler\n");
|
||||||
|
} else {
|
||||||
|
bprint(" was mauled by a Rottweiler\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_enforcer":
|
case "monster_enforcer":
|
||||||
bprint(" was blasted by an Enforcer\n"); break;
|
if(random() < 0.5) {
|
||||||
|
bprint(" was lazed by an Enforcer\n");
|
||||||
|
} else {
|
||||||
|
bprint(" stood in an Enforcer's way\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_fish":
|
case "monster_fish":
|
||||||
bprint(" was fed to the Rotfish\n"); break;
|
if(targ.pronoun == PRO_NONE || random() < 0.5) {
|
||||||
|
bprint(" was fed to a Rotfish\n");
|
||||||
|
} else {
|
||||||
|
bprint(" enjoys ",
|
||||||
|
pronoun_possessive(targ.pronoun),
|
||||||
|
" new life under the sea\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_hell_knight":
|
case "monster_hell_knight":
|
||||||
bprint(" was slain by a Death Knight\n"); break;
|
if(random() < 0.5) {
|
||||||
|
bprint(" was killed to death by a Death Knight\n");
|
||||||
|
} else {
|
||||||
|
bprint(" was slain by a Death Knight\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_knight":
|
case "monster_knight":
|
||||||
bprint(" was slashed by a Knight\n"); break;
|
if(random() < 0.1) {
|
||||||
|
bprint(" was enamored by the Knight's intricate animations\n");
|
||||||
|
} else {
|
||||||
|
bprint(" was slashed by a Knight\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_ogre":
|
case "monster_ogre":
|
||||||
bprint(" was destroyed by an Ogre\n"); break;
|
if(random() < 0.05) {
|
||||||
|
bprint(" knows that it's all Ogre now\n");
|
||||||
|
} else {
|
||||||
|
bprint(" was destroyed by an Ogre\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_oldone":
|
case "monster_oldone":
|
||||||
bprint(" became one with Shub-Niggurath\n"); break;
|
if(targ.pronoun == PRO_NONE) {
|
||||||
|
bprint(" became one with Shub-Niggurath\n");
|
||||||
|
} else {
|
||||||
|
bprint(" accepted ", pronoun_possessive(targ.pronoun), " fate\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_shalrath":
|
case "monster_shalrath":
|
||||||
bprint(" was exploded by a Vore\n"); break;
|
if(random() < 0.5) {
|
||||||
|
bprint(" was merged with a Shalrath\n");
|
||||||
|
} else {
|
||||||
|
bprint(" couldn't evade the Vore\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_shambler":
|
case "monster_shambler":
|
||||||
bprint(" was smashed by a Shambler\n"); break;
|
if(random() < 0.5) {
|
||||||
|
bprint(" was Shambled off this mortal coil\n");
|
||||||
|
} else {
|
||||||
|
bprint(" was fried by a Shambler\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_tarbaby":
|
case "monster_tarbaby":
|
||||||
bprint(" was slimed by a Spawn\n"); break;
|
if(random() < 0.5) {
|
||||||
case "monster_vomit":
|
bprint(" was consumed by the Spawn\n");
|
||||||
bprint(" was vomited on by a Vomitus\n"); break;
|
} else {
|
||||||
|
bprint(" found ",
|
||||||
|
pronoun_possessive(targ.pronoun),
|
||||||
|
" place with the Spawn\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_wizard":
|
case "monster_wizard":
|
||||||
bprint(" was scragged by a Scrag\n"); break;
|
if(random() < 0.5) {
|
||||||
|
bprint(" wasn't ready for the Wizard\n");
|
||||||
|
} else {
|
||||||
|
bprint(" was scragged by a Scrag\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "monster_zombie":
|
case "monster_zombie":
|
||||||
bprint(" joins the Zombies\n"); break;
|
if(random() < 0.05) {
|
||||||
|
bprint(". You are the demons\nAnd then ",
|
||||||
|
targ.netname, " was a zombie.");
|
||||||
|
} else {
|
||||||
|
bprint(" joins the Zombies\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1205,8 +1354,11 @@ float(entity targ, entity attacker) obit_monster = {
|
||||||
float(entity targ, entity attacker) obit_falling = {
|
float(entity targ, entity attacker) obit_falling = {
|
||||||
if(targ.deathtype == "falling") {
|
if(targ.deathtype == "falling") {
|
||||||
targ.deathtype = "";
|
targ.deathtype = "";
|
||||||
// FIXME
|
if(targ.pronoun == PRO_NONE) {
|
||||||
bprint(" fell to his death\n");
|
bprint(" hit the ground too hard\n");
|
||||||
|
} else {
|
||||||
|
bprint(" fell to ", pronoun_possessive(targ.pronoun), " death\n");
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1215,22 +1367,24 @@ float(entity targ, entity attacker) obit_falling = {
|
||||||
|
|
||||||
float(entity targ, entity attacker) obit_water = {
|
float(entity targ, entity attacker) obit_water = {
|
||||||
switch(targ.watertype) {
|
switch(targ.watertype) {
|
||||||
case -3:
|
case CONTENT_SKY:
|
||||||
|
bprint(" tried to buy the sky and sell the sky\n");
|
||||||
|
break;
|
||||||
|
case CONTENT_WATER:
|
||||||
if(random() < 0.5) {
|
if(random() < 0.5) {
|
||||||
bprint(" sleeps with the fishes\n");
|
bprint(" sleeps with the fishes\n");
|
||||||
} else {
|
} else {
|
||||||
// FIXME
|
bprint(" was quite thirsty\n");
|
||||||
bprint(" sucks it down\n");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case -4:
|
case CONTENT_SLIME:
|
||||||
if(random() < 0.5) {
|
if(random() < 0.5) {
|
||||||
bprint(" gulped a load of slime\n");
|
bprint(" gulped a load of slime\n");
|
||||||
} else {
|
} else {
|
||||||
bprint(" can't exist on slime alone\n");
|
bprint(" can't exist on slime alone\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case -5:
|
case CONTENT_LAVA:
|
||||||
if(targ.health < -15) {
|
if(targ.health < -15) {
|
||||||
bprint(" burst into flames\n");
|
bprint(" burst into flames\n");
|
||||||
} else if(random() < 0.5) {
|
} else if(random() < 0.5) {
|
||||||
|
@ -1256,7 +1410,14 @@ float(entity targ, entity attacker) obit_trap = {
|
||||||
case "fireball":
|
case "fireball":
|
||||||
bprint(" ate a lavaball\n"); break;
|
bprint(" ate a lavaball\n"); break;
|
||||||
case "trigger_changelevel":
|
case "trigger_changelevel":
|
||||||
bprint(" tried to leave\n"); break;
|
if(targ.pronoun == PRO_NONE) {
|
||||||
|
bprint(" tried to leave\n");
|
||||||
|
} else {
|
||||||
|
bprint(" tried to leave, but ",
|
||||||
|
pronoun_subject(targ.pronoun),
|
||||||
|
" failed\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1321,3 +1482,18 @@ void(entity targ, entity attacker) ClientObituary = {
|
||||||
bprint(" died\n");
|
bprint(" died\n");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
============
|
||||||
|
ClientKill
|
||||||
|
|
||||||
|
Player entered the suicide command
|
||||||
|
============
|
||||||
|
*/
|
||||||
|
void() ClientKill = {
|
||||||
|
self.frags = self.frags - 1; // extra penalty
|
||||||
|
ClientObituary(self, self);
|
||||||
|
set_suicide_frame();
|
||||||
|
self.modelindex = modelindex_player;
|
||||||
|
respawn();
|
||||||
|
};
|
||||||
|
|
|
@ -4,17 +4,24 @@ float() crandom = {
|
||||||
return 2 * (random() - 0.5);
|
return 2 * (random() - 0.5);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
float(float x, float y) max = {
|
||||||
=============
|
return x < y ? y : x;
|
||||||
range
|
};
|
||||||
|
|
||||||
returns the range catagorization of an entity reletive to self
|
float(float x, float y) min = {
|
||||||
0 melee range, will become hostile even if back is turned
|
return x < y ? x : y;
|
||||||
1 visibility and infront, or visibility and show hostile
|
};
|
||||||
2 infront and show hostile
|
|
||||||
3 only triggered by damage
|
float(float x, float mi, float ma) minmax = {
|
||||||
=============
|
return min(max(x, mi), ma);
|
||||||
*/
|
};
|
||||||
|
|
||||||
|
/* returns the range catagorization of an entity reletive to self
|
||||||
|
* 0 melee range, will become hostile even if back is turned
|
||||||
|
* 1 visibility and infront, or visibility and show hostile
|
||||||
|
* 2 infront and show hostile
|
||||||
|
* 3 only triggered by damage
|
||||||
|
*/
|
||||||
float(entity targ) range = {
|
float(entity targ) range = {
|
||||||
vector spot1, spot2;
|
vector spot1, spot2;
|
||||||
float r;
|
float r;
|
||||||
|
@ -34,13 +41,7 @@ float(entity targ) range = {
|
||||||
return RANGE_FAR;
|
return RANGE_FAR;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
// returns 1 if the entity is visible to self, even if not infront()
|
||||||
=============
|
|
||||||
visible
|
|
||||||
|
|
||||||
returns 1 if the entity is visible to self, even if not infront()
|
|
||||||
=============
|
|
||||||
*/
|
|
||||||
float(entity targ) visible = {
|
float(entity targ) visible = {
|
||||||
vector spot1, spot2;
|
vector spot1, spot2;
|
||||||
|
|
||||||
|
@ -58,13 +59,7 @@ float(entity targ) visible = {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
// returns 1 if the entity is in front(in sight) of self
|
||||||
=============
|
|
||||||
infront
|
|
||||||
|
|
||||||
returns 1 if the entity is in front(in sight) of self
|
|
||||||
=============
|
|
||||||
*/
|
|
||||||
float(entity targ) infront = {
|
float(entity targ) infront = {
|
||||||
vector vec;
|
vector vec;
|
||||||
float dot;
|
float dot;
|
||||||
|
|
|
@ -218,7 +218,7 @@ void(entity client, string s) stuffcmd = #21;
|
||||||
entity(vector org, float rad) findradius = #22;
|
entity(vector org, float rad) findradius = #22;
|
||||||
void(string... s) bprint = #23;
|
void(string... s) bprint = #23;
|
||||||
void(entity client, string... s) sprint = #24;
|
void(entity client, string... s) sprint = #24;
|
||||||
void(string s) dprint = #25;
|
void(string... s) dprint = #25;
|
||||||
string(float f) ftos = #26;
|
string(float f) ftos = #26;
|
||||||
string(vector v) vtos = #27;
|
string(vector v) vtos = #27;
|
||||||
void() coredump = #28; // prints all edicts
|
void() coredump = #28; // prints all edicts
|
||||||
|
@ -473,6 +473,22 @@ enum {
|
||||||
WORLD_METAL,
|
WORLD_METAL,
|
||||||
WORLD_BASE,
|
WORLD_BASE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PRO_NONE,
|
||||||
|
|
||||||
|
// alphabetically sorted, based on pronoun.is and what i've seen used
|
||||||
|
PRO_FAE,
|
||||||
|
PRO_HE,
|
||||||
|
PRO_IT,
|
||||||
|
PRO_SHE,
|
||||||
|
PRO_THEY,
|
||||||
|
PRO_XEY,
|
||||||
|
PRO_ZE_H,
|
||||||
|
PRO_ZE_Z,
|
||||||
|
|
||||||
|
PRO_MAX,
|
||||||
|
};
|
||||||
#pragma noref 0
|
#pragma noref 0
|
||||||
|
|
||||||
// globals -------------------------------------------------------------------|
|
// globals -------------------------------------------------------------------|
|
||||||
|
@ -632,6 +648,9 @@ float sight_entity_time;
|
||||||
|
|
||||||
.float healamount, healtype;
|
.float healamount, healtype;
|
||||||
|
|
||||||
|
// super co-op additions
|
||||||
|
.float pronoun;
|
||||||
|
|
||||||
// functions -----------------------------------------------------------------|
|
// functions -----------------------------------------------------------------|
|
||||||
|
|
||||||
// subs.qc
|
// subs.qc
|
||||||
|
@ -656,6 +675,9 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
|
||||||
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
|
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
|
||||||
|
|
||||||
// weapons.qc
|
// weapons.qc
|
||||||
|
void(float wep) W_ChangeWeapon;
|
||||||
|
void() W_CycleWeaponReverse;
|
||||||
|
void() W_CycleWeapon;
|
||||||
void() W_FireAxe;
|
void() W_FireAxe;
|
||||||
void() W_FireShotgun;
|
void() W_FireShotgun;
|
||||||
void() W_FireSuperShotgun;
|
void() W_FireSuperShotgun;
|
||||||
|
@ -668,6 +690,10 @@ float() W_BestWeapon;
|
||||||
void() W_SetCurrentAmmo;
|
void() W_SetCurrentAmmo;
|
||||||
void() W_WeaponFrame;
|
void() W_WeaponFrame;
|
||||||
|
|
||||||
|
// items.qc
|
||||||
|
string() Key1Name;
|
||||||
|
string() Key2Name;
|
||||||
|
|
||||||
void() army_fire;
|
void() army_fire;
|
||||||
|
|
||||||
float() DemonCheckAttack;
|
float() DemonCheckAttack;
|
||||||
|
|
|
@ -52,9 +52,7 @@ void() SUB_regen = {
|
||||||
prints a warning message when spawned
|
prints a warning message when spawned
|
||||||
*/
|
*/
|
||||||
void() noclass = {
|
void() noclass = {
|
||||||
dprint("noclass spawned at");
|
dprint("noclass spawned at", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
remove(self);
|
remove(self);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -78,9 +76,7 @@ void() PlaceItem = {
|
||||||
self.origin_z = self.origin_z + 6;
|
self.origin_z = self.origin_z + 6;
|
||||||
oldz = self.origin_z;
|
oldz = self.origin_z;
|
||||||
if(!droptofloor()) {
|
if(!droptofloor()) {
|
||||||
dprint("Bonus item fell out of level at ");
|
dprint("Bonus item fell out of level at ", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
remove(self);
|
remove(self);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +170,6 @@ void() item_health = {
|
||||||
|
|
||||||
void() health_touch = {
|
void() health_touch = {
|
||||||
float amount;
|
float amount;
|
||||||
string s;
|
|
||||||
|
|
||||||
if(other.classname != "player") {
|
if(other.classname != "player") {
|
||||||
return;
|
return;
|
||||||
|
@ -193,10 +188,7 @@ void() health_touch = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprint(other, "You receive ");
|
sprint(other, "You receive ", ftos(self.healamount), " health\n");
|
||||||
s = ftos(self.healamount);
|
|
||||||
sprint(other, s);
|
|
||||||
sprint(other, " health\n");
|
|
||||||
|
|
||||||
// health touch sound
|
// health touch sound
|
||||||
sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
|
sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
|
||||||
|
@ -474,9 +466,7 @@ void() weapon_touch = {
|
||||||
objerror("weapon_touch: unknown classname");
|
objerror("weapon_touch: unknown classname");
|
||||||
}
|
}
|
||||||
|
|
||||||
sprint(other, "You got the ");
|
sprint(other, "You got the ", self.netname, "\n");
|
||||||
sprint(other, self.netname);
|
|
||||||
sprint(other, "\n");
|
|
||||||
// weapon touch sound
|
// weapon touch sound
|
||||||
sound(other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM);
|
sound(other, CHAN_ITEM, "weapons/pkup.wav", 1, ATTN_NORM);
|
||||||
stuffcmd(other, "bf\n");
|
stuffcmd(other, "bf\n");
|
||||||
|
@ -657,9 +647,7 @@ void() ammo_touch = {
|
||||||
|
|
||||||
bound_other_ammo();
|
bound_other_ammo();
|
||||||
|
|
||||||
sprint(other, "You got the ");
|
sprint(other, "You got the ", self.netname, "\n");
|
||||||
sprint(other, self.netname);
|
|
||||||
sprint(other, "\n");
|
|
||||||
// ammo touch sound
|
// ammo touch sound
|
||||||
sound(other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM);
|
sound(other, CHAN_ITEM, "weapons/lock4.wav", 1, ATTN_NORM);
|
||||||
stuffcmd(other, "bf\n");
|
stuffcmd(other, "bf\n");
|
||||||
|
@ -867,9 +855,7 @@ void() key_touch = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprint(other, "You got the ");
|
sprint(other, "You got the ", self.netname, "\n");
|
||||||
sprint(other, self.netname);
|
|
||||||
sprint(other, "\n");
|
|
||||||
|
|
||||||
sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
|
sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
|
||||||
stuffcmd(other, "bf\n");
|
stuffcmd(other, "bf\n");
|
||||||
|
@ -1058,9 +1044,7 @@ void() powerup_touch = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprint(other, "You got the ");
|
sprint(other, "You got the ", self.netname, "\n");
|
||||||
sprint(other, self.netname);
|
|
||||||
sprint(other, "\n");
|
|
||||||
|
|
||||||
if(deathmatch) {
|
if(deathmatch) {
|
||||||
self.mdl = self.model;
|
self.mdl = self.model;
|
||||||
|
@ -1190,7 +1174,6 @@ PLAYER BACKPACKS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void() BackpackTouch = {
|
void() BackpackTouch = {
|
||||||
string s;
|
|
||||||
float best, old, new;
|
float best, old, new;
|
||||||
entity stemp;
|
entity stemp;
|
||||||
float acount;
|
float acount;
|
||||||
|
@ -1204,8 +1187,7 @@ void() BackpackTouch = {
|
||||||
|
|
||||||
if(self.weapon && (other.items & self.weapon) == 0) {
|
if(self.weapon && (other.items & self.weapon) == 0) {
|
||||||
acount = 1;
|
acount = 1;
|
||||||
sprint(other, "the ");
|
sprint(other, "the ", self.netname);
|
||||||
sprint(other, self.netname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the player was using their best weapon, change up to the new one if better
|
// if the player was using their best weapon, change up to the new one if better
|
||||||
|
@ -1234,36 +1216,28 @@ void() BackpackTouch = {
|
||||||
sprint(other, ", ");
|
sprint(other, ", ");
|
||||||
}
|
}
|
||||||
acount = 1;
|
acount = 1;
|
||||||
s = ftos(self.ammo_shells);
|
sprint(other, ftos(self.ammo_shells), " shells");
|
||||||
sprint(other, s);
|
|
||||||
sprint(other, " shells");
|
|
||||||
}
|
}
|
||||||
if(self.ammo_nails) {
|
if(self.ammo_nails) {
|
||||||
if(acount) {
|
if(acount) {
|
||||||
sprint(other, ", ");
|
sprint(other, ", ");
|
||||||
}
|
}
|
||||||
acount = 1;
|
acount = 1;
|
||||||
s = ftos(self.ammo_nails);
|
sprint(other, ftos(self.ammo_nails), " nails");
|
||||||
sprint(other, s);
|
|
||||||
sprint(other, " nails");
|
|
||||||
}
|
}
|
||||||
if(self.ammo_rockets) {
|
if(self.ammo_rockets) {
|
||||||
if(acount) {
|
if(acount) {
|
||||||
sprint(other, ", ");
|
sprint(other, ", ");
|
||||||
}
|
}
|
||||||
acount = 1;
|
acount = 1;
|
||||||
s = ftos(self.ammo_rockets);
|
sprint(other, ftos(self.ammo_rockets), " rockets");
|
||||||
sprint(other, s);
|
|
||||||
sprint(other, " rockets");
|
|
||||||
}
|
}
|
||||||
if(self.ammo_cells) {
|
if(self.ammo_cells) {
|
||||||
if(acount) {
|
if(acount) {
|
||||||
sprint(other, ", ");
|
sprint(other, ", ");
|
||||||
}
|
}
|
||||||
acount = 1;
|
acount = 1;
|
||||||
s = ftos(self.ammo_cells);
|
sprint(other, ftos(self.ammo_cells), " cells");
|
||||||
sprint(other, s);
|
|
||||||
sprint(other, " cells");
|
|
||||||
}
|
}
|
||||||
if(self.items & IT_KEY1) {
|
if(self.items & IT_KEY1) {
|
||||||
if(acount) {
|
if(acount) {
|
||||||
|
|
|
@ -226,9 +226,7 @@ void() misc_explobox = {
|
||||||
oldz = self.origin_z;
|
oldz = self.origin_z;
|
||||||
droptofloor();
|
droptofloor();
|
||||||
if(oldz - self.origin_z > 250) {
|
if(oldz - self.origin_z > 250) {
|
||||||
dprint("item fell out of level at ");
|
dprint("item fell out of level at ", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
remove(self);
|
remove(self);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -255,9 +253,7 @@ void() misc_explobox2 = {
|
||||||
oldz = self.origin_z;
|
oldz = self.origin_z;
|
||||||
droptofloor();
|
droptofloor();
|
||||||
if(oldz - self.origin_z > 250) {
|
if(oldz - self.origin_z > 250) {
|
||||||
dprint("item fell out of level at ");
|
dprint("item fell out of level at ", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
remove(self);
|
remove(self);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -80,9 +80,7 @@ void() walkmonster_start_go = {
|
||||||
droptofloor();
|
droptofloor();
|
||||||
|
|
||||||
if(!walkmove(0, 0)) {
|
if(!walkmove(0, 0)) {
|
||||||
dprint("walkmonster in wall at: ");
|
dprint("walkmonster in wall at: ", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.takedamage = DAMAGE_AIM;
|
self.takedamage = DAMAGE_AIM;
|
||||||
|
@ -100,9 +98,7 @@ void() walkmonster_start_go = {
|
||||||
self.goalentity = self.movetarget = find(world, targetname, self.target);
|
self.goalentity = self.movetarget = find(world, targetname, self.target);
|
||||||
self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
|
self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
|
||||||
if(!self.movetarget) {
|
if(!self.movetarget) {
|
||||||
dprint("Monster can't find target at ");
|
dprint("Monster can't find target at ", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
}
|
}
|
||||||
// this used to be an objerror
|
// this used to be an objerror
|
||||||
if(self.movetarget.classname == "path_corner") {
|
if(self.movetarget.classname == "path_corner") {
|
||||||
|
@ -143,17 +139,13 @@ void() flymonster_start_go = {
|
||||||
self.flags = self.flags | FL_MONSTER;
|
self.flags = self.flags | FL_MONSTER;
|
||||||
|
|
||||||
if(!walkmove(0, 0)) {
|
if(!walkmove(0, 0)) {
|
||||||
dprint("flymonster in wall at: ");
|
dprint("flymonster in wall at: ", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(self.target) {
|
if(self.target) {
|
||||||
self.goalentity = self.movetarget = find(world, targetname, self.target);
|
self.goalentity = self.movetarget = find(world, targetname, self.target);
|
||||||
if(!self.movetarget) {
|
if(!self.movetarget) {
|
||||||
dprint("Monster can't find target at ");
|
dprint("Monster can't find target at ", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
}
|
}
|
||||||
// this used to be an objerror
|
// this used to be an objerror
|
||||||
if(self.movetarget.classname == "path_corner") {
|
if(self.movetarget.classname == "path_corner") {
|
||||||
|
@ -197,9 +189,7 @@ void() swimmonster_start_go = {
|
||||||
if(self.target) {
|
if(self.target) {
|
||||||
self.goalentity = self.movetarget = find(world, targetname, self.target);
|
self.goalentity = self.movetarget = find(world, targetname, self.target);
|
||||||
if(!self.movetarget) {
|
if(!self.movetarget) {
|
||||||
dprint("Monster can't find target at ");
|
dprint("Monster can't find target at ", vtos(self.origin), "\n");
|
||||||
dprint(vtos(self.origin));
|
|
||||||
dprint("\n");
|
|
||||||
}
|
}
|
||||||
// this used to be an objerror
|
// this used to be an objerror
|
||||||
self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
|
self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
|
||||||
|
|
|
@ -830,53 +830,60 @@ W_ChangeWeapon
|
||||||
|
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
void() W_ChangeWeapon = {
|
void(float wep) W_ChangeWeapon = {
|
||||||
float it, am, fl;
|
float it, am, fl;
|
||||||
|
|
||||||
it = self.items;
|
it = self.items;
|
||||||
am = 0;
|
am = 0;
|
||||||
|
|
||||||
if(self.impulse == 1) {
|
switch(wep) {
|
||||||
fl = IT_AXE;
|
case 1:
|
||||||
} else if(self.impulse == 2) {
|
fl = IT_AXE;
|
||||||
fl = IT_SHOTGUN;
|
break;
|
||||||
if(self.ammo_shells < 1) {
|
case 2:
|
||||||
am = 1;
|
fl = IT_SHOTGUN;
|
||||||
}
|
if(self.ammo_shells < 1) {
|
||||||
} else if(self.impulse == 3) {
|
am = 1;
|
||||||
fl = IT_SUPER_SHOTGUN;
|
}
|
||||||
if(self.ammo_shells < 2) {
|
break;
|
||||||
am = 1;
|
case 3:
|
||||||
}
|
fl = IT_SUPER_SHOTGUN;
|
||||||
} else if(self.impulse == 4) {
|
if(self.ammo_shells < 2) {
|
||||||
fl = IT_NAILGUN;
|
am = 1;
|
||||||
if(self.ammo_nails < 1) {
|
}
|
||||||
am = 1;
|
break;
|
||||||
}
|
case 4:
|
||||||
} else if(self.impulse == 5) {
|
fl = IT_NAILGUN;
|
||||||
fl = IT_SUPER_NAILGUN;
|
if(self.ammo_nails < 1) {
|
||||||
if(self.ammo_nails < 2) {
|
am = 1;
|
||||||
am = 1;
|
}
|
||||||
}
|
break;
|
||||||
} else if(self.impulse == 6) {
|
case 5:
|
||||||
fl = IT_GRENADE_LAUNCHER;
|
fl = IT_SUPER_NAILGUN;
|
||||||
if(self.ammo_rockets < 1) {
|
if(self.ammo_nails < 2) {
|
||||||
am = 1;
|
am = 1;
|
||||||
}
|
}
|
||||||
} else if(self.impulse == 7) {
|
break;
|
||||||
fl = IT_ROCKET_LAUNCHER;
|
case 6:
|
||||||
if(self.ammo_rockets < 1) {
|
fl = IT_GRENADE_LAUNCHER;
|
||||||
am = 1;
|
if(self.ammo_rockets < 1) {
|
||||||
}
|
am = 1;
|
||||||
} else if(self.impulse == 8) {
|
}
|
||||||
fl = IT_LIGHTNING;
|
break;
|
||||||
if(self.ammo_cells < 1) {
|
case 7:
|
||||||
am = 1;
|
fl = IT_ROCKET_LAUNCHER;
|
||||||
}
|
if(self.ammo_rockets < 1) {
|
||||||
|
am = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
fl = IT_LIGHTNING;
|
||||||
|
if(self.ammo_cells < 1) {
|
||||||
|
am = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.impulse = 0;
|
|
||||||
|
|
||||||
if(!(self.items & fl)) {
|
if(!(self.items & fl)) {
|
||||||
// don't have the weapon or the ammo
|
// don't have the weapon or the ammo
|
||||||
sprint(self, "no weapon.\n");
|
sprint(self, "no weapon.\n");
|
||||||
|
@ -889,96 +896,71 @@ void() W_ChangeWeapon = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// set weapon, set ammo
|
// set weapon, set ammo
|
||||||
//
|
|
||||||
self.weapon = fl;
|
self.weapon = fl;
|
||||||
W_SetCurrentAmmo();
|
W_SetCurrentAmmo();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
CheatCommand
|
W_CycleWeapon
|
||||||
============
|
|
||||||
*/
|
|
||||||
void() CheatCommand = {
|
|
||||||
if(deathmatch || coop) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.ammo_rockets = 100;
|
|
||||||
self.ammo_nails = 200;
|
|
||||||
self.ammo_shells = 100;
|
|
||||||
self.items = self.items |
|
|
||||||
IT_AXE |
|
|
||||||
IT_SHOTGUN |
|
|
||||||
IT_SUPER_SHOTGUN |
|
|
||||||
IT_NAILGUN |
|
|
||||||
IT_SUPER_NAILGUN |
|
|
||||||
IT_GRENADE_LAUNCHER |
|
|
||||||
IT_ROCKET_LAUNCHER |
|
|
||||||
IT_KEY1 | IT_KEY2;
|
|
||||||
|
|
||||||
self.ammo_cells = 200;
|
|
||||||
self.items = self.items | IT_LIGHTNING;
|
|
||||||
|
|
||||||
self.weapon = IT_ROCKET_LAUNCHER;
|
|
||||||
self.impulse = 0;
|
|
||||||
W_SetCurrentAmmo();
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
============
|
|
||||||
CycleWeaponCommand
|
|
||||||
|
|
||||||
Go to the next weapon with ammo
|
Go to the next weapon with ammo
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
void() CycleWeaponCommand = {
|
void() W_CycleWeapon = {
|
||||||
float it, am;
|
float it, am;
|
||||||
|
|
||||||
it = self.items;
|
it = self.items;
|
||||||
self.impulse = 0;
|
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
am = 0;
|
am = 0;
|
||||||
if(self.weapon == IT_LIGHTNING) {
|
switch(self.weapon) {
|
||||||
self.weapon = IT_AXE;
|
case IT_LIGHTNING:
|
||||||
} else if(self.weapon == IT_AXE) {
|
self.weapon = IT_AXE;
|
||||||
self.weapon = IT_SHOTGUN;
|
break;
|
||||||
if(self.ammo_shells < 1) {
|
case IT_AXE:
|
||||||
am = 1;
|
self.weapon = IT_SHOTGUN;
|
||||||
}
|
if(self.ammo_shells < 1) {
|
||||||
} else if(self.weapon == IT_SHOTGUN) {
|
am = 1;
|
||||||
self.weapon = IT_SUPER_SHOTGUN;
|
}
|
||||||
if(self.ammo_shells < 2) {
|
break;
|
||||||
am = 1;
|
case IT_SHOTGUN:
|
||||||
}
|
self.weapon = IT_SUPER_SHOTGUN;
|
||||||
} else if(self.weapon == IT_SUPER_SHOTGUN) {
|
if(self.ammo_shells < 2) {
|
||||||
self.weapon = IT_NAILGUN;
|
am = 1;
|
||||||
if(self.ammo_nails < 1) {
|
}
|
||||||
am = 1;
|
break;
|
||||||
}
|
case IT_SUPER_SHOTGUN:
|
||||||
} else if(self.weapon == IT_NAILGUN) {
|
self.weapon = IT_NAILGUN;
|
||||||
self.weapon = IT_SUPER_NAILGUN;
|
if(self.ammo_nails < 1) {
|
||||||
if(self.ammo_nails < 2) {
|
am = 1;
|
||||||
am = 1;
|
}
|
||||||
}
|
break;
|
||||||
} else if(self.weapon == IT_SUPER_NAILGUN) {
|
case IT_NAILGUN:
|
||||||
self.weapon = IT_GRENADE_LAUNCHER;
|
self.weapon = IT_SUPER_NAILGUN;
|
||||||
if(self.ammo_rockets < 1) {
|
if(self.ammo_nails < 2) {
|
||||||
am = 1;
|
am = 1;
|
||||||
}
|
}
|
||||||
} else if(self.weapon == IT_GRENADE_LAUNCHER) {
|
break;
|
||||||
self.weapon = IT_ROCKET_LAUNCHER;
|
case IT_SUPER_NAILGUN:
|
||||||
if(self.ammo_rockets < 1) {
|
self.weapon = IT_GRENADE_LAUNCHER;
|
||||||
am = 1;
|
if(self.ammo_rockets < 1) {
|
||||||
}
|
am = 1;
|
||||||
} else if(self.weapon == IT_ROCKET_LAUNCHER) {
|
}
|
||||||
self.weapon = IT_LIGHTNING;
|
break;
|
||||||
if(self.ammo_cells < 1) {
|
case IT_GRENADE_LAUNCHER:
|
||||||
am = 1;
|
self.weapon = IT_ROCKET_LAUNCHER;
|
||||||
}
|
if(self.ammo_rockets < 1) {
|
||||||
|
am = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case IT_ROCKET_LAUNCHER:
|
||||||
|
self.weapon = IT_LIGHTNING;
|
||||||
|
if(self.ammo_cells < 1) {
|
||||||
|
am = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if((it & self.weapon) && am == 0) {
|
if((it & self.weapon) && am == 0) {
|
||||||
W_SetCurrentAmmo();
|
W_SetCurrentAmmo();
|
||||||
|
@ -990,56 +972,64 @@ void() CycleWeaponCommand = {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
CycleWeaponReverseCommand
|
W_CycleWeaponReverse
|
||||||
|
|
||||||
Go to the prev weapon with ammo
|
Go to the prev weapon with ammo
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
void() CycleWeaponReverseCommand = {
|
void() W_CycleWeaponReverse = {
|
||||||
float it, am;
|
float it, am;
|
||||||
|
|
||||||
it = self.items;
|
it = self.items;
|
||||||
self.impulse = 0;
|
|
||||||
|
|
||||||
while(1) {
|
for(;;) {
|
||||||
am = 0;
|
am = 0;
|
||||||
if(self.weapon == IT_LIGHTNING) {
|
switch(self.weapon) {
|
||||||
self.weapon = IT_ROCKET_LAUNCHER;
|
case IT_LIGHTNING:
|
||||||
if(self.ammo_rockets < 1) {
|
self.weapon = IT_ROCKET_LAUNCHER;
|
||||||
am = 1;
|
if(self.ammo_rockets < 1) {
|
||||||
}
|
am = 1;
|
||||||
} else if(self.weapon == IT_ROCKET_LAUNCHER) {
|
}
|
||||||
self.weapon = IT_GRENADE_LAUNCHER;
|
break;
|
||||||
if(self.ammo_rockets < 1) {
|
case IT_ROCKET_LAUNCHER:
|
||||||
am = 1;
|
self.weapon = IT_GRENADE_LAUNCHER;
|
||||||
}
|
if(self.ammo_rockets < 1) {
|
||||||
} else if(self.weapon == IT_GRENADE_LAUNCHER) {
|
am = 1;
|
||||||
self.weapon = IT_SUPER_NAILGUN;
|
}
|
||||||
if(self.ammo_nails < 2) {
|
break;
|
||||||
am = 1;
|
case IT_GRENADE_LAUNCHER:
|
||||||
}
|
self.weapon = IT_SUPER_NAILGUN;
|
||||||
} else if(self.weapon == IT_SUPER_NAILGUN) {
|
if(self.ammo_nails < 2) {
|
||||||
self.weapon = IT_NAILGUN;
|
am = 1;
|
||||||
if(self.ammo_nails < 1) {
|
}
|
||||||
am = 1;
|
break;
|
||||||
}
|
case IT_SUPER_NAILGUN:
|
||||||
} else if(self.weapon == IT_NAILGUN) {
|
self.weapon = IT_NAILGUN;
|
||||||
self.weapon = IT_SUPER_SHOTGUN;
|
if(self.ammo_nails < 1) {
|
||||||
if(self.ammo_shells < 2) {
|
am = 1;
|
||||||
am = 1;
|
}
|
||||||
}
|
break;
|
||||||
} else if(self.weapon == IT_SUPER_SHOTGUN) {
|
case IT_NAILGUN:
|
||||||
self.weapon = IT_SHOTGUN;
|
self.weapon = IT_SUPER_SHOTGUN;
|
||||||
if(self.ammo_shells < 1) {
|
if(self.ammo_shells < 2) {
|
||||||
am = 1;
|
am = 1;
|
||||||
}
|
}
|
||||||
} else if(self.weapon == IT_SHOTGUN) {
|
break;
|
||||||
self.weapon = IT_AXE;
|
case IT_SUPER_SHOTGUN:
|
||||||
} else if(self.weapon == IT_AXE) {
|
self.weapon = IT_SHOTGUN;
|
||||||
self.weapon = IT_LIGHTNING;
|
if(self.ammo_shells < 1) {
|
||||||
if(self.ammo_cells < 1) {
|
am = 1;
|
||||||
am = 1;
|
}
|
||||||
}
|
break;
|
||||||
|
case IT_SHOTGUN:
|
||||||
|
self.weapon = IT_AXE;
|
||||||
|
break;
|
||||||
|
case IT_AXE:
|
||||||
|
self.weapon = IT_LIGHTNING;
|
||||||
|
if(self.ammo_cells < 1) {
|
||||||
|
am = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if((it & self.weapon) && am == 0) {
|
if((it & self.weapon) && am == 0) {
|
||||||
W_SetCurrentAmmo();
|
W_SetCurrentAmmo();
|
||||||
|
@ -1049,49 +1039,6 @@ void() CycleWeaponReverseCommand = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
============
|
|
||||||
ServerflagsCommand
|
|
||||||
|
|
||||||
Just for development
|
|
||||||
============
|
|
||||||
*/
|
|
||||||
void() ServerflagsCommand = {
|
|
||||||
serverflags = serverflags * 2 + 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
void() QuadCheat = {
|
|
||||||
if(deathmatch || coop) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
self.super_time = 1;
|
|
||||||
self.super_damage_finished = time + 30;
|
|
||||||
self.items = self.items | IT_QUAD;
|
|
||||||
dprint("quad cheat\n");
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
============
|
|
||||||
ImpulseCommands
|
|
||||||
|
|
||||||
============
|
|
||||||
*/
|
|
||||||
void() ImpulseCommands = {
|
|
||||||
if(self.impulse >= 1 && self.impulse <= 8) {
|
|
||||||
W_ChangeWeapon();
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(self.impulse) {
|
|
||||||
case 9: CheatCommand(); break;
|
|
||||||
case 10: CycleWeaponCommand(); break;
|
|
||||||
case 11: ServerflagsCommand(); break;
|
|
||||||
case 12: CycleWeaponReverseCommand(); break;
|
|
||||||
case 255: QuadCheat(); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.impulse = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
W_WeaponFrame
|
W_WeaponFrame
|
||||||
|
|
Loading…
Reference in New Issue
Block a user