Compare commits

..

No commits in common. "e6221792a43286d31b76ff9852f5aefe18f87a25" and "a8248b16a6d358b4ea67daea793c5d31065dc21b" have entirely different histories.

41 changed files with 585 additions and 681 deletions

View File

@ -9,24 +9,12 @@ alias pronoun_ze_hir "impulse 27"
alias pronoun_ze_zir "impulse 28"
alias spectate "impulse 13"
alias reject_challenge "impulse 14"
set sc_cheats 0
set sc_lives 0
set sc_dist_ammo 0
set sc_challenge 0
bind p "reject_challenge"
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."
echo
echo "If the server supports it, you can also put (possessive) after your"
echo "name, and it will be automatically detected. Example:"
echo "_cl_name Marrub (their)"
echo
echo "To reject travel to another level while sc_challenge is set, you"
echo "may type 'reject_challenge' into the console, which by default is"
echo "bound to 'p'."
// EOF

View File

@ -56,7 +56,7 @@ set reps \
SUB_Remove sub_remove \
T_Heal ent_heal \
CanHeal can_heal \
CanDamage ent_can_damage \
CanDamage can_damage \
T_Damage ent_damage \
T_RadiusDamage ent_radius_damage \
T_MissileTouch ent_missile_touch \

Binary file not shown.

Binary file not shown.

View File

@ -1,38 +1,38 @@
progs.dat
source/c_defs.qc
source/c_common.qc
source/c_combat.qc
source/defs.qc
source/common.qc
source/fight.qc
source/subs.qc
source/ai.qc
source/ai_fight.qc
source/ai_monsters.qc
source/ai_subs.qc
source/buttons.qc
source/client.qc
source/combat.qc
source/doors.qc
source/items.qc
source/misc.qc
source/monsters.qc
source/plats.qc
source/player.qc
source/triggers.qc
source/weapons.qc
source/world.qc
source/p_client.qc
source/p_player.qc
source/p_weapons.qc
source/boss.qc
source/demon.qc
source/dog.qc
source/knight.qc
source/ogre.qc
source/shambler.qc
source/soldier.qc
source/wizard.qc
source/zombie.qc
source/w_buttons.qc
source/w_doors.qc
source/w_items.qc
source/w_misc.qc
source/w_plats.qc
source/w_triggers.qc
source/w_world.qc
source/m_army.qc
source/m_boss.qc
source/m_demon.qc
source/m_dog.qc
source/m_enforcer.qc
source/m_fish.qc
source/m_hknight.qc
source/m_knight.qc
source/m_ogre.qc
source/m_oldone.qc
source/m_shalrath.qc
source/m_shambler.qc
source/m_tarbaby.qc
source/m_wizard.qc
source/m_zombie.qc
source/enforcer.qc
source/fish.qc
source/hknight.qc
source/oldone.qc
source/shalrath.qc
source/tarbaby.qc

View File

@ -38,6 +38,24 @@ The number of seconds to spend standing or bowing for path_stand or path_bow
==============================================================================
*/
void() movetarget_f = {
if(!self.targetname) {
error_obj("monster_movetarget: no targetname");
}
self.solid = SOLID_TRIGGER;
self.touch = t_movetarget;
set_size(self, '-8 -8 -8', '8 8 8');
};
/*QUAKED path_corner(0.5 0.3 0) (-8 -8 -8) (8 8 8)
Monsters will continue walking towards the next target corner.
*/
void() path_corner = {
movetarget_f();
};
/*
=============
t_movetarget
@ -65,6 +83,7 @@ void() t_movetarget = {
sound(self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE); // play chainsaw drag sound
}
//print_dbg("t_movetarget\n");
self.goalentity = self.movetarget = find(world, targetname, other.target);
self.ideal_yaw = vec_yaw(self.goalentity.origin - self.origin);
if(!self.movetarget) {
@ -74,24 +93,6 @@ void() t_movetarget = {
}
};
void() movetarget_f = {
if(!self.targetname) {
error_obj("monster_movetarget: no targetname");
}
self.solid = SOLID_TRIGGER;
self.touch = t_movetarget;
set_size(self, '-8 -8 -8', '8 8 8');
};
/*QUAKED path_corner(0.5 0.3 0) (-8 -8 -8) (8 8 8)
Monsters will continue walking towards the next target corner.
*/
void() path_corner = {
movetarget_f();
};
//============================================================================
@ -323,6 +324,32 @@ void() ai_turn = {
//=============================================================================
/*
=============
choose_turn
=============
*/
void(vector dest3) choose_turn = {
vector dir, newdir;
dir = self.origin - dest3;
newdir_x = trace_plane_normal_y;
newdir_y = 0 - trace_plane_normal_x;
newdir_z = 0;
if(dir * newdir > 0) {
dir_x = 0 - trace_plane_normal_y;
dir_y = trace_plane_normal_x;
} else {
dir_x = trace_plane_normal_y;
dir_y = 0 - trace_plane_normal_x;
}
dir_z = 0;
self.ideal_yaw = vec_yaw(dir);
};
/*
============
facing_ideal

View File

@ -1,4 +1,4 @@
// m_boss.qc: Chthon, boss of E1
// boss.qc: Chthon, boss of E1
$cd id1 / models / boss1
$origin 0 0 - 15
@ -29,8 +29,6 @@ $frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6
$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8
$frame shockc9 shockc10
void(vector p) boss_missile;
void() boss_face = {
// go for another player if multi player
if(enemy_is_gone(self.enemy) || random() < 0.02) {
@ -176,7 +174,7 @@ void() boss_death9 = [$death9, boss_death10] {
void() boss_death10 = [$death9, boss_death10] {
killed_monsters = killed_monsters + 1;
write_byte(MSG_ALL, SVC_KILLEDMONSTER);
write_byte(MSG_ALL, SVC_KILLEDMONSTER); // FIXME: reliable broadcast
sub_use_targets();
remove(self);
};

View File

@ -1,6 +1,4 @@
// w_buttons.qc: button and multiple button
void() button_return, button_wait;
// buttons.qc: button and multiple button
void() button_wait = {
self.state = STATE_TOP;

View File

@ -1,44 +1,4 @@
// p_client.qc: player-adjacent functions
void() impulse_commands;
/*
=============================================================================
QUAKED FUNCTIONS
=============================================================================
*/
/*QUAKED info_player_start(1 0 0) (-16 -16 -24) (16 16 24)
The normal starting point for a level.
*/
void() info_player_start = {
};
/*QUAKED info_player_start2(1 0 0) (-16 -16 -24) (16 16 24)
Only used on start map for the return point from an episode.
*/
void() info_player_start2 = {
};
/*
saved out by quaked in region mode
*/
void() testplayerstart = {
};
/*QUAKED info_player_deathmatch(1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for deathmatch games
*/
void() info_player_deathmatch = {
};
/*QUAKED info_player_coop(1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for coop games
*/
void() info_player_coop = {
};
// client.qc: player-adjacent functions
string(float pro) pronoun_subject = {
switch(pro) {
@ -125,8 +85,10 @@ void() SetNewParms = {
void() decode_level_parms = {
float ofs, ofs2, pro;
if(!deathmatch && world.model == "maps/start.bsp") {
SetNewParms(); // take away all stuff on starting new episode
if(serverflags) {
if(world.model == "maps/start.bsp") {
SetNewParms(); // take away all stuff on starting new episode
}
}
self.items = parm1;
@ -295,7 +257,7 @@ void() intermission_exit = {
}
intermission_exittime = time + 1;
intermission_running++;
intermission_running = intermission_running + 1;
//
// run some text if at the end of an episode
@ -409,7 +371,22 @@ void() execute_changelevel = {
write_byte(MSG_ALL, SVC_INTERMISSION);
};
void() changelevel_finish = {
void() changelevel_touch = {
entity pos;
if(other.classname != "player") {
return;
}
if(cvar("noexit") == 1 || (cvar("noexit") == 2 && mapname != "start")) {
ent_damage(other, self, self, 50000);
return;
}
if(coop || deathmatch) {
print_all(other.netname, " exited the level\n");
}
nextmap = self.map;
sub_use_targets();
@ -427,75 +404,6 @@ void() changelevel_finish = {
self.nextthink = time + 0.1;
};
void() set_challenge_reject = {
if(changelevel_challenge == CHALLENGE_ACTIVE) {
changelevel_challenge = CHALLENGE_REJECTED;
challenge_rejecter = self.netname;
}
};
void() changelevel_think = {
entity pl;
if(changelevel_challenge == CHALLENGE_REJECTED) {
pl = find(world, classname, "player");
while(pl != world) {
print_center(pl, "The travel was canceled by\n", challenge_rejecter);
pl = find(pl, classname, "player");
}
changelevel_challenge = CHALLENGE_NONE;
self.netname = string_null;
self.aflag = 0;
return;
}
if(self.aflag == 0) {
changelevel_finish();
return;
}
pl = find(world, classname, "player");
while(pl != world) {
print_center(pl,
self.netname,
"\ninitiated travel to\n",
self.map, "\n\n",
ftos(self.aflag), " seconds to travel");
pl = find(pl, classname, "player");
}
sound(self, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NONE);
self.aflag--;
self.nextthink = time + 1;
};
void() changelevel_touch = {
entity pos;
if(other.classname != "player" || changelevel_challenge) {
return;
}
if(cvar("noexit") == 1 || (cvar("noexit") == 2 && mapname != "start")) {
ent_damage(other, self, self, 50000);
return;
}
if(sc_challenge) {
changelevel_challenge = CHALLENGE_ACTIVE;
self.netname = other.netname;
self.aflag = 10;
self.think = changelevel_think;
self.nextthink = time + 0.1;
} else {
if(coop || deathmatch) {
print_all(other.netname, " exited the level\n");
}
changelevel_finish();
}
};
/*QUAKED trigger_changelevel(0.5 0.5 0.5) ? NO_INTERMISSION
When the player touches this, they get sent to the map listed in the "map" variable. Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats.
*/
@ -534,6 +442,7 @@ void() become_spectator = {
self.solid = SOLID_NOT;
self.movetype = MOVETYPE_NOCLIP;
self.flags |= FL_NOTARGET;
self.deadflag = DEAD_DEAD;
self.view_ofs = VEC_ORIGIN;
self.frame = 0;
self.modelindex = modelindex_eyes;
@ -616,7 +525,7 @@ entity() select_spawn_point = {
thing = find_radius(spot.origin, 32);
while(thing) {
if(thing.classname == "player") {
pcount++;
pcount = pcount + 1;
}
thing = thing.chain;
}
@ -658,7 +567,7 @@ void() PutClientInServer = {
respawned = player_respawned;
player_respawned = FALSE;
if(sc_lives) {
if(sf_lives) {
if(respawned) {
self.lives--;
print_all(self.netname, " has ");
@ -672,8 +581,8 @@ void() PutClientInServer = {
print_all(ftos(self.lives), " lives left\n");
}
} else if(self.lives == 0) {
self.lives = sc_lives;
print_dbg("lives reset to ", ftos(sc_lives), "\n");
self.lives = sf_lives;
print_dbg("lives reset to ", ftos(sf_lives), "\n");
}
} else {
self.lives = 1;
@ -712,10 +621,9 @@ void() PutClientInServer = {
// pausetime is set by teleporters to keep the player from moving for a bit
self.pausetime = 0;
self.origin = spot.origin + '0 0 1';
self.oldorigin = self.origin;
self.angles = spot.angles;
self.fixangle = TRUE; // turn this way immediately
self.origin = spot.origin + '0 0 1';
self.angles = spot.angles;
self.fixangle = TRUE; // turn this way immediately
// oh, this is a hack!
set_model(self, "progs/eyes.mdl");
@ -727,7 +635,6 @@ void() PutClientInServer = {
set_size(self, '-16 -16 -24', '16 16 32');
self.view_ofs = '0 0 22';
self.velocity = VEC_ORIGIN;
player_stand1();
@ -739,6 +646,44 @@ void() PutClientInServer = {
spawn_tdeath(self.origin, self);
};
/*
=============================================================================
QUAKED FUNCTIONS
=============================================================================
*/
/*QUAKED info_player_start(1 0 0) (-16 -16 -24) (16 16 24)
The normal starting point for a level.
*/
void() info_player_start = {
};
/*QUAKED info_player_start2(1 0 0) (-16 -16 -24) (16 16 24)
Only used on start map for the return point from an episode.
*/
void() info_player_start2 = {
};
/*
saved out by quaked in region mode
*/
void() testplayerstart = {
};
/*QUAKED info_player_deathmatch(1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for deathmatch games
*/
void() info_player_deathmatch = {
};
/*QUAKED info_player_coop(1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for coop games
*/
void() info_player_coop = {
};
/*
===============================================================================
@ -1182,7 +1127,7 @@ Called every frame after physics are run
================
*/
void() PlayerPostThink = {
if(time >= self.attack_finished && self.impulse) {
if(time >= self.attack_finished) {
impulse_commands();
}
@ -1256,7 +1201,7 @@ void() ClientDisconnect = {
};
void() cheat = {
if(((deathmatch || coop) && !sc_cheats) || self.spectating) {
if(((deathmatch || coop) && !sf_cheats) || self.spectating) {
return;
}
@ -1281,7 +1226,7 @@ void() cheat = {
};
void() cheat_quad = {
if(((deathmatch || coop) && !sc_cheats) || self.spectating) {
if(((deathmatch || coop) && !sf_cheats) || self.spectating) {
return;
}
@ -1334,12 +1279,11 @@ void() impulse_commands = {
change_pronoun(self.impulse - 20);
} else {
switch(self.impulse) {
case 9: cheat(); break;
case 10: wep_cycle_weapon(); break;
case 11: cheat_quad(); break;
case 9: cheat(); break;
case 10: wep_cycle_weapon(); break;
case 11: cheat_quad(); break;
case 12: wep_cycle_weapon_reverse(); break;
case 13: spectate(); break;
case 14: set_challenge_reject(); break;
case 13: spectate(); break;
}
}
@ -1347,7 +1291,7 @@ void() impulse_commands = {
};
float(entity targ, entity attacker) obit_teledeath = {
attacker.owner.frags++;
attacker.owner.frags = attacker.owner.frags + 1;
print_all(" was telefragged by ", attacker.owner.netname, "\n");
return TRUE;
};
@ -1358,15 +1302,6 @@ float(entity targ, entity attacker) obit_teledeath2 = {
return TRUE;
};
float(entity targ, entity attacker) obit_teledeath3 = {
targ.frags--;
attacker.owner.frags++;
print_all(" was telefragged by ",
attacker.owner.netname,
"'s satanic powers\n");
return TRUE;
};
float(entity targ, entity attacker) obit_suicide = {
targ.frags--;
@ -1413,7 +1348,7 @@ float(entity targ, entity attacker) obit_teamkill = {
float(entity targ, entity attacker) obit_pkill = {
string deathstring, deathstring2;
attacker.frags++;
attacker.frags = attacker.frags + 1;
switch(attacker.weapon) {
case IT_AXE:
@ -1693,9 +1628,6 @@ void(entity targ, entity attacker) client_obituary = {
case "teledeath2":
did_message = obit_teledeath2(targ, attacker);
break;
case "teledeath3":
did_message = obit_teledeath3(targ, attacker);
break;
case "player":
if(targ == attacker) {
did_message = obit_suicide(targ, attacker);

View File

@ -1,4 +1,4 @@
// c_combat.qc: entity-entity damage functions
// combat.qc: entity-entity damage functions
float(entity targ, entity attacker) is_same_team = {
return targ != attacker &&
@ -14,13 +14,13 @@ float(entity targ, entity attacker) are_both_players = {
/*
============
ent_can_damage
can_damage
Returns true if the inflictor can directly damage the target. Used for
explosions and melee attacks.
============
*/
float(entity targ, entity inflictor) ent_can_damage = {
float(entity targ, entity inflictor) can_damage = {
// bmodels need special checking because their origin is 0,0,0
if(targ.movetype == MOVETYPE_PUSH) {
trace_line(inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, self);
@ -219,39 +219,35 @@ void(entity inflictor, entity attacker, float damage, entity ignore) ent_radius_
float points;
entity head;
vector org;
float attacker_damaged;
float attacker_points;
head = find_radius(inflictor.origin, damage + 40);
while(head) {
if(head != ignore && head.takedamage) {
org = head.origin + (head.mins + head.maxs) * 0.5;
points = 0.5 * vec_len(inflictor.origin - org);
if(points < 0) {
points = 0;
}
points = damage - points;
if(points > 0 && ent_can_damage(head, inflictor)) {
if(head != attacker) {
// shambler takes half damage from all explosions
if(head.classname == "monster_shambler") {
ent_damage(head, inflictor, attacker, points * 0.5);
} else {
ent_damage(head, inflictor, attacker, points);
if(head != ignore) {
if(head.takedamage) {
org = head.origin + (head.mins + head.maxs) * 0.5;
points = 0.5 * vec_len(inflictor.origin - org);
if(points < 0) {
points = 0;
}
points = damage - points;
if(head == attacker) {
points = points * 0.5;
}
if(points > 0) {
if(can_damage(head, inflictor)) {
// shambler takes half damage from all explosions
if(head.classname == "monster_shambler") {
ent_damage(head, inflictor, attacker, points * 0.5);
} else {
ent_damage(head, inflictor, attacker, points);
}
}
} else {
attacker_damaged = TRUE;
attacker_points = points * 0.5;
}
}
}
head = head.chain;
}
if(attacker_damaged) {
ent_damage(attacker, inflictor, attacker, attacker_points);
}
};
/*
@ -276,7 +272,7 @@ void(entity attacker, float damage) beam_damage = {
points = points * 0.5;
}
if(points > 0) {
if(ent_can_damage(head, attacker)) {
if(can_damage(head, attacker)) {
if(head.classname == "monster_shambler") {
ent_damage(head, attacker, attacker, points * 0.5);
} else {

View File

@ -1,4 +1,4 @@
// c_common.qc: common functions
// common.qc: common functions
const float PO2_LUT[25] = {
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768,
@ -42,15 +42,16 @@ float(entity targ) range = {
spot2 = targ.origin + targ.view_ofs;
r = vec_len(spot1 - spot2);
if(r < AI_RANGE_MELEE) {
if(r < 120) {
return RANGE_MELEE;
} else if(r < AI_RANGE_NEAR) {
return RANGE_NEAR;
} else if(r < AI_RANGE_MID) {
return RANGE_MID;
} else {
return RANGE_FAR;
}
if(r < 500) {
return RANGE_NEAR;
}
if(r < 1000) {
return RANGE_MID;
}
return RANGE_FAR;
};
// returns 1 if the entity is visible to self, even if not infront()

View File

@ -1,4 +1,4 @@
// c_defs.qc: global definitions
// defs.qc: global definitions
// system globals ------------------------------------------------------------|
#pragma noref 1
@ -417,41 +417,13 @@ enum {
// protocol bytes
enum {
SVC_BAD,
SVC_NOP,
SVC_DISCONNECT,
SVC_UPDATESTAT,
SVC_VERSION,
SVC_SETVIEW,
SVC_SOUND,
SVC_TIME,
SVC_PRINT,
SVC_STUFFTEXT,
SVC_SETANGLE,
SVC_SERVERINFO,
SVC_LIGHTSTYLE,
SVC_UPDATENAME,
SVC_UPDATEFRAGS,
SVC_CLIENTDATA,
SVC_STOPSOUND,
SVC_UPDATECOLORS,
SVC_PARTICLE,
SVC_DAMAGE,
SVC_SPAWNSTATIC,
SVC_SPAWNBINARY,
SVC_SPAWNBASELINE,
SVC_TEMPENTITY,
SVC_SETPAUSE,
SVC_SIGNONNUM,
SVC_CENTERPRINT,
SVC_KILLEDMONSTER,
SVC_FOUNDSECRET,
SVC_SPAWNSTATICSOUND,
SVC_INTERMISSION,
SVC_FINALE,
SVC_CDTRACK,
SVC_SELLSCREEN,
SVC_CUTSCENE,
SVC_TEMPENTITY = 23,
SVC_KILLEDMONSTER = 27,
SVC_FOUNDSECRET = 28,
SVC_INTERMISSION = 30,
SVC_FINALE = 31,
SVC_CDTRACK = 32,
SVC_SELLSCREEN = 33,
};
enum {
@ -601,13 +573,6 @@ enum {
CHANGELEVEL_NO_INTERMISSION = 1,
};
enum {
AI_RANGE_MELEE = 120,
AI_RANGE_NEAR = 500,
AI_RANGE_MID = 1000,
AI_MONSTER_HIGH = 48,
};
// super co-op additions
enum {
PRO_NONE,
@ -626,12 +591,11 @@ enum {
};
enum {
SC_CHEATS = 1,
SC_LIVES_BEG = 1,
SC_LIVES_END = 3,
SC_LIVES_MSK = 14,
SC_DIST_AMMO = 16,
SC_CHALLENGE = 32,
SF_CHEATS = 1,
SF_LIVES_BEG = 1,
SF_LIVES_END = 3,
SF_LIVES_MSK = 14,
SF_DIST_AMMO = 16,
};
enum {
@ -641,12 +605,6 @@ enum {
SPECTATING_INTERMISSION,
SPECTATING_FINALE,
};
enum {
CHALLENGE_NONE,
CHALLENGE_ACTIVE,
CHALLENGE_REJECTED,
};
#pragma noref 0
// globals -------------------------------------------------------------------|
@ -693,17 +651,13 @@ entity sight_entity;
float sight_entity_time;
// super co-op additions
float sc_cheats;
float sc_lives;
float sc_dist_ammo;
float sc_challenge;
float sf_cheats;
float sf_lives;
float sf_dist_ammo;
float player_respawned;
float all_players_are_dead;
float changelevel_challenge;
string challenge_rejecter;
float ext_con_set;
float ext_strings;
@ -826,98 +780,171 @@ float ext_strings;
.float lives;
.float spectating;
.float hurt_together_time;
.float hurt_nextthink;
// functions -----------------------------------------------------------------|
void() sub_calc_angle_move_done;
void() sub_calc_move_done;
void() sub_null;
void() sub_remove;
void() sub_use_targets;
void(entity attacker, float damage) sub_pain_null;
void(entity ent, vector tdest, float tspeed, void() func) sub_calc_move_ent;
void(float normal) sub_attack_finished;
void(vector destangle, float tspeed, void() func) sub_calc_angle_move;
void(vector tdest, float tspeed, void() func) sub_calc_move;
void(entity ent, vector tdest, float tspeed, void() func) sub_calc_move_ent;
void(vector destangle, float tspeed, void() func) sub_calc_angle_move;
void() sub_calc_move_done;
void() sub_calc_angle_move_done;
void(void() thinkst) sub_check_refire;
float() check_attack;
void() found_target;
entity() drop_backpack;
void() sub_null;
void(entity attacker, float damage) sub_pain_null;
void() sub_use_targets;
void() sub_remove;
float(entity e, float healamount, float ignore) ent_heal;
float(entity targ, entity inflictor) ent_can_damage;
float(entity targ, entity inflictor) can_damage;
void() ent_missile_touch;
void(entity bomb, entity attacker, float rad, entity ignore) ent_radius_damage;
void(entity targ, entity inflictor, entity attacker, float damage) ent_damage;
float() wep_best_weapon;
void() wep_cycle_weapon;
void(float wep) wep_change_weapon;
void() wep_cycle_weapon_reverse;
void() wep_cycle_weapon;
void() wep_fire_axe;
void() wep_fire_grenade;
void() wep_fire_lightning;
void() wep_fire_rocket;
void() wep_fire_shotgun;
void() wep_fire_super_nail;
void() wep_fire_super_shotgun;
void() wep_fire_rocket;
void() wep_fire_lightning;
void() wep_fire_grenade;
void(float ox) wep_fire_nail;
void() wep_fire_super_nail;
float() wep_best_weapon;
void() wep_set_current_ammo;
void() wep_weapon_frame;
void(float ox) wep_fire_nail;
void(float wep) wep_change_weapon;
string() key_1_name, key_2_name;
string() key_1_name;
string() key_2_name;
void() army_fire;
float() army_check_attack;
float() demon_check_attack;
void() demon_jump_touch;
void(float side) demon_melee;
float() dog_check_attack;
void() dog_leap1;
void() dog_run1;
void() shalrath_home;
void() shalrath_missile;
void() shalrath_missile_touch;
float(entity targ, entity attacker) is_same_team;
void() decode_level_parms;
void(entity ent) copy_to_body_queue;
void() init_body_queue;
void() super_damage_sound;
void() ai_face;
void() armor_touch;
void() bubble_bob;
void() bubble_remove;
void() button_return;
void() button_wait;
void() door_go_down;
void() door_go_up;
void() fd_secret_done;
void() fd_secret_move1;
void() fd_secret_move2;
void() fd_secret_move3;
void() fd_secret_move4;
void() fd_secret_move5;
void() fd_secret_move6;
void() finale_1;
void() finale_2;
void() finale_3;
void() finale_4;
void() fire_fly;
void() fire_touch;
void() health_touch;
void() item_megahealth_rot;
void() make_bubbles;
void() monster_death_use;
void() movetarget_f;
void() powerup_touch;
void() set_suicide_frame;
void(vector org, vector dir) launch_spike;
void() superspike_touch;
void() spike_touch;
void() superspike_touch;
void() swimmonster_start;
void() t_movetarget;
void() train_next;
void(entity targ, entity attacker) client_obituary;
void(float num_bubbles) death_bubbles;
void(vector dest) choose_turn;
void(vector org, vector vec) launch_laser;
void(vector org, vector vel, float damage) spawn_blood;
void() become_explosion;
float() army_check_attack;
float() demon_check_attack;
float() dog_check_attack;
void() hknight_char_a1;
void() hknight_run1;
void() ogre_smash1;
void() ogre_swing1;
float() ogre_check_attack;
float() sham_check_attack;
float() wiz_check_attack;
void() knight_attack;
void() plat_center_touch;
void() plat_crush;
void() plat_go_down;
void() plat_go_up;
void() plat_outside_touch;
void() plat_trigger_use;
void() knight_atk1;
void() knight_bow1;
void() knight_bow6;
void() knight_runatk1;
void() knight_walk1;
void() player_die;
void() player_axe1;
void() player_axeb1;
void() player_axec1;
void() player_axed1;
void() player_die;
void() player_die_ax1;
void() player_diea1;
void() player_dieb1;
void() player_diec1;
void() player_died1;
void() player_diee1;
void() player_light1;
void() player_nail1;
void(entity attacker, float damage) player_pain;
void() player_rocket1;
void() player_run;
void() player_run;
void() player_shot1;
void() player_stand1;
void(entity attacker, float damage) player_pain;
void() sham_smash1;
void() sham_swingl1;
void() sham_swingr1;
void() sham_swingr1;
float() sham_check_attack;
void() tbaby_jump1;
void() tbaby_jump5;
float() wiz_check_attack;
void() wiz_run1;
void() wiz_side1;
void(vector org) spawn_tfog;
void(vector org, entity death_owner) spawn_tdeath;
void() info_player_start;
void() func_train_find;
void(vector p) boss_missile;
void() impulse_commands;
// EOF

View File

@ -1,4 +1,4 @@
// m_demon.qc: Fiend
// demon.qc: Fiend
$cd id1 / models / demon3
$scale 0.8
@ -23,9 +23,6 @@ $frame death1 death2 death3 death4 death5 death6 death7 death8 death9
$frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8
$frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15
void() demon_jump_touch;
void(float side) demon_melee;
//============================================================================
void() demon1_stand1 = [ $stand1, demon1_stand2 ] {ai_stand();};
@ -222,12 +219,12 @@ Returns TRUE if a melee attack would hit right now
==============
*/
float() demon_check_melee = {
if(enemy_range == RANGE_MELEE && !enemy_is_high()) {
if(enemy_range == RANGE_MELEE) {
// FIXME: check canreach
self.attack_state = AS_MELEE;
return TRUE;
} else {
return FALSE;
}
return FALSE;
};
/*
@ -240,10 +237,13 @@ float() demon_check_jump = {
vector dist;
float d;
if(self.origin_z + self.mins_z >
self.enemy.origin_z + self.enemy.mins_z + 0.75 * self.enemy.size_z ||
self.origin_z + self.maxs_z <
self.enemy.origin_z + self.enemy.mins_z + 0.25 * self.enemy.size_z) {
if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z
+ 0.75 * self.enemy.size_z) {
return FALSE;
}
if(self.origin_z + self.maxs_z < self.enemy.origin_z + self.enemy.mins_z
+ 0.25 * self.enemy.size_z) {
return FALSE;
}
@ -252,7 +252,17 @@ float() demon_check_jump = {
d = vec_len(dist);
return !(d < 100 || (d > 200 && random() < 0.9));
if(d < 100) {
return FALSE;
}
if(d > 200) {
if(random() < 0.9) {
return FALSE;
}
}
return TRUE;
};
float() demon_check_attack = {
@ -287,7 +297,7 @@ void(float side) demon_melee = {
if(vec_len(delta) > 100) {
return;
}
if(!ent_can_damage(self.enemy, self)) {
if(!can_damage(self.enemy, self)) {
return;
}

View File

@ -1,4 +1,4 @@
// m_dog.qc: Rottweiler
// dog.qc: Rottweiler
$cd id1 / models / dog
$origin 0 0 24
@ -25,8 +25,6 @@ $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9
$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8
void() dog_leap1, dog_run1;
/*
================
dog_bite
@ -43,7 +41,7 @@ void() dog_bite = {
ai_charge(10);
if(!ent_can_damage(self.enemy, self)) {
if(!can_damage(self.enemy, self)) {
return;
}
@ -252,12 +250,12 @@ Returns TRUE if a melee attack would hit right now
==============
*/
float() dog_check_melee = {
if(enemy_range == RANGE_MELEE && !enemy_is_high()) {
if(enemy_range == RANGE_MELEE) {
// FIXME: check canreach
self.attack_state = AS_MELEE;
return TRUE;
} else {
return FALSE;
}
return FALSE;
};
/*

View File

@ -1,10 +1,4 @@
// w_doors.qc: player-triggered moving brush entities
void() door_go_up;
void() fd_secret_done, fd_secret_move1, fd_secret_move2, fd_secret_move3,
fd_secret_move4, fd_secret_move5, fd_secret_move6;
// doors.qc: player-triggered moving brush entities
/*
@ -104,7 +98,7 @@ void() door_fire = {
// play use key sound
if(self.items) {
sound(self, CHAN_ITEM, self.noise4, 1, ATTN_NORM);
sound(self, CHAN_VOICE, self.noise4, 1, ATTN_NORM);
}
self.message = string_null; // no more message

View File

@ -1,4 +1,4 @@
// m_enforcer.qc: Enforcer
// enforcer.qc: Enforcer
$cd id1 / models / enforcer
$origin 0 - 6 24

View File

@ -1,4 +1,4 @@
// ai_fight.qc: monster attack functions
// fight.qc: monster attack functions
/*
@ -9,6 +9,19 @@ When it decides it can't attack, it goes into hunt mode.
*/
void() knight_attack = {
float len;
// decide if now is a good swing time
len = vec_len(self.enemy.origin + self.enemy.view_ofs - (self.origin + self.view_ofs));
if(len < 80) {
knight_atk1();
} else {
knight_runatk1();
}
};
//=============================================================================
/*
@ -172,7 +185,7 @@ void() ai_melee_side = {
if(vec_len(delta) > 60) {
return;
}
if(!ent_can_damage(self.enemy, self)) {
if(!can_damage(self.enemy, self)) {
return;
}
ldmg = (random() + random() + random()) * 3;

View File

@ -1,4 +1,4 @@
// m_fish.qc: Rotfish
// fish.qc: Rotfish
$cd id1 / models / fish
$origin 0 0 24
@ -114,7 +114,7 @@ void() f_death1 = [ $death1, f_death2 ] {
sound(self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM);
};
void() f_death2 = [ $death2, f_death3 ] {};
void() f_death3 = [ $death3, f_death4 ] {self.solid = SOLID_NOT;};
void() f_death3 = [ $death3, f_death4 ] {};
void() f_death4 = [ $death4, f_death5 ] {};
void() f_death5 = [ $death5, f_death6 ] {};
void() f_death6 = [ $death6, f_death7 ] {};
@ -132,7 +132,7 @@ void() f_death17 = [ $death17, f_death18 ] {};
void() f_death18 = [ $death18, f_death19 ] {};
void() f_death19 = [ $death19, f_death20 ] {};
void() f_death20 = [ $death20, f_death21 ] {};
void() f_death21 = [ $death21, f_death21 ] {};
void() f_death21 = [ $death21, f_death21 ] {self.solid = SOLID_NOT;};
void() f_pain1 = [ $pain1, f_pain2 ] {};
void() f_pain2 = [ $pain2, f_pain3 ] {ai_pain(6);};
@ -145,20 +145,11 @@ void() f_pain8 = [ $pain8, f_pain9 ] {ai_pain(6);};
void() f_pain9 = [ $pain9, f_run1 ] {ai_pain(6);};
void(entity attacker, float damage) fish_pain = {
// fish allways do pain frames
f_pain1();
};
void() f_die = {
if(self.health < -35) {
sound(self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
throw_head("progs/gib3.mdl", self.health);
throw_gib("progs/gib3.mdl", self.health);
return;
}
f_death1();
};
/*QUAKED monster_fish(1 0 0) (-16 -16 -24) (16 16 24) Ambush
*/
@ -184,7 +175,7 @@ void() monster_fish = {
self.th_stand = f_stand1;
self.th_walk = f_walk1;
self.th_run = f_run1;
self.th_die = f_die;
self.th_die = f_death1;
self.th_pain = fish_pain;
self.th_melee = f_attack1;

View File

@ -1,4 +1,4 @@
// m_hknight.qc: Death Knight
// hknight.qc: Death Knight
$cd id1 / models / knight2
$origin 0 0 24
@ -45,8 +45,6 @@ $frame w_attack21 w_attack22
$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8
$frame magicc9 magicc10 magicc11
void() hknight_char_a1, hknight_run1;
void() hknight_idle_sound = {
if(random() < 0.2) {
sound(self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM);

View File

@ -1,4 +1,4 @@
// w_items.qc: items the player can pick up
// items.qc: items the player can pick up
string() key_1_name = {
switch(world.worldtype) {
@ -113,25 +113,43 @@ float(entity e, float healamount, float ignore) ent_heal = {
return 1;
};
void() item_megahealth_rot = {
other = self.owner;
/*QUAKED item_health(.3 .3 1) (0 0 0) (32 32 32) rotten megahealth
Health box. Normally gives 25 points.
Rotten box heals 15 points,
Megahealth will add 100 health, then rot you down to your maximum health limit,
one point per second.
*/
if(other.health > other.max_health) {
other.health = other.health - 1;
self.nextthink = time + 1;
return;
}
// it is possible for a player to die and respawn between rots, so don't
// just blindly subtract the flag off
other.items = other.items - (other.items & IT_SUPERHEALTH);
if(deathmatch == 1) { // deathmatch 2 is silly old rules
self.nextthink = time + 20;
self.think = sub_regen;
void() item_health = {
self.touch = health_touch;
if(self.spawnflags & HEALTH_ROTTEN) {
precache_model("maps/b_bh10.bsp");
precache_sound("items/r_item1.wav");
set_model(self, "maps/b_bh10.bsp");
self.noise = "items/r_item1.wav";
self.healamount = 15;
self.healtype = 0;
} else if(self.spawnflags & HEALTH_MEGA) {
precache_model("maps/b_bh100.bsp");
precache_sound("items/r_item2.wav");
set_model(self, "maps/b_bh100.bsp");
self.noise = "items/r_item2.wav";
self.healamount = 100;
self.healtype = 2;
} else {
precache_model("maps/b_bh25.bsp");
precache_sound("items/health1.wav");
set_model(self, "maps/b_bh25.bsp");
self.noise = "items/health1.wav";
self.healamount = 25;
self.healtype = 1;
}
set_size(self, VEC_ORIGIN, '32 32 56');
start_item();
};
void() health_touch = {
float amount;
@ -176,40 +194,23 @@ void() health_touch = {
sub_use_targets(); // fire all targets / killtargets
};
/*QUAKED item_health(.3 .3 1) (0 0 0) (32 32 32) rotten megahealth
Health box. Normally gives 25 points.
Rotten box heals 15 points,
Megahealth will add 100 health, then rot you down to your maximum health limit,
one point per second.
*/
void() item_megahealth_rot = {
other = self.owner;
void() item_health = {
self.touch = health_touch;
if(self.spawnflags & HEALTH_ROTTEN) {
precache_model("maps/b_bh10.bsp");
precache_sound("items/r_item1.wav");
set_model(self, "maps/b_bh10.bsp");
self.noise = "items/r_item1.wav";
self.healamount = 15;
self.healtype = 0;
} else if(self.spawnflags & HEALTH_MEGA) {
precache_model("maps/b_bh100.bsp");
precache_sound("items/r_item2.wav");
set_model(self, "maps/b_bh100.bsp");
self.noise = "items/r_item2.wav";
self.healamount = 100;
self.healtype = 2;
} else {
precache_model("maps/b_bh25.bsp");
precache_sound("items/health1.wav");
set_model(self, "maps/b_bh25.bsp");
self.noise = "items/health1.wav";
self.healamount = 25;
self.healtype = 1;
if(other.health > other.max_health) {
other.health = other.health - 1;
self.nextthink = time + 1;
return;
}
// it is possible for a player to die and respawn between rots, so don't
// just blindly subtract the flag off
other.items = other.items - (other.items & IT_SUPERHEALTH);
if(deathmatch == 1) { // deathmatch 2 is silly old rules
self.nextthink = time + 20;
self.think = sub_regen;
}
set_size(self, VEC_ORIGIN, '32 32 56');
start_item();
};
/*
@ -332,10 +333,7 @@ void(entity e) bound_ammo = {
float(float w) wep_rank_for_weapon = {
switch(w) {
case IT_LIGHTNING:
if(self.waterlevel <= 1) {
return 1;
}
case IT_LIGHTNING: return 1;
case IT_ROCKET_LAUNCHER: return 2;
case IT_SUPER_NAILGUN: return 3;
case IT_GRENADE_LAUNCHER: return 4;
@ -453,7 +451,11 @@ void() weapon_touch = {
stemp = self;
self = other;
wep_deathmatch_weapon(old, new);
if(!deathmatch) {
self.weapon = new;
} else {
wep_deathmatch_weapon(old, new);
}
wep_set_current_ammo();
@ -567,7 +569,7 @@ AMMO
void(.float ammo, float max) distribute_ammo = {
entity pl, stemp;
if(sc_dist_ammo) {
if(sf_dist_ammo) {
pl = find(world, classname, "player");
while(pl != world) {
pl.ammo += self.aflag;
@ -1154,7 +1156,11 @@ void() backpack_touch = {
self = other;
// change to the weapon
wep_deathmatch_weapon(old, new);
if(!deathmatch) {
self.weapon = new;
} else {
wep_deathmatch_weapon(old, new);
}
wep_set_current_ammo();
};

View File

@ -1,4 +1,4 @@
// m_knight.qc: Knight
// knight.qc: Knight
$cd id1 / models / knight
$origin 0 0 24
@ -221,19 +221,6 @@ void() knight_die = {
}
};
void() knight_attack = {
float len;
// decide if now is a good swing time
len = vec_len(self.enemy.origin + self.enemy.view_ofs - (self.origin + self.view_ofs));
if(len < 80) {
knight_atk1();
} else {
knight_runatk1();
}
};
/*QUAKED monster_knight(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/
void() monster_knight = {

View File

@ -1,4 +1,4 @@
// w_misc.qc: various useful brushes
// misc.qc: various useful brushes
/*QUAKED info_null(0 0.5 0) (-4 -4 -4) (4 4 4)
Used as a positional target for spotlights, etc.
@ -146,8 +146,6 @@ void() light_flame_small_white = {
//============================================================================
void() fire_fly, fire_touch;
/*QUAKED misc_fireball(0 .5 .8) (-8 -8 -8) (8 8 8)
Lava Balls
*/
@ -155,7 +153,7 @@ Lava Balls
void() misc_fireball = {
precache_model("progs/lavaball.mdl");
self.classname = "fireball";
self.nextthink = time + 0.1 + (random() * 5);
self.nextthink = time + (random() * 5);
self.think = fire_fly;
if(!self.speed) {
self.speed = 1000;
@ -191,7 +189,10 @@ void() fire_touch = {
//============================================================================
void() barrel_damage = {
void() barrel_explode = {
self.takedamage = DAMAGE_NO;
self.classname = "explo_box";
// did say self.owner
ent_radius_damage(self, self, 160, world);
sound(self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
particle(self.origin, VEC_ORIGIN, 75, 255);
@ -200,13 +201,6 @@ void() barrel_damage = {
become_explosion();
};
void() barrel_explode = {
self.takedamage = DAMAGE_NO;
self.classname = "explo_box";
self.nextthink = time + 0.1;
self.think = barrel_damage;
};
/*QUAKED misc_explobox(0 .5 .8) (0 0 0) (32 32 64)
TESTING THING
@ -321,8 +315,6 @@ void() trap_shooter = {
===============================================================================
*/
void() bubble_remove, make_bubbles;
/*QUAKED air_bubbles(0 .5 .8) (-8 -8 -8) (8 8 8)
testing air bubbles

View File

@ -1,4 +1,4 @@
// v_models.qc: model information
// models.qc: model information
/*
===============================================================================

View File

@ -1,4 +1,4 @@
// ai_monsters.qc: basic monster functions
// monsters.qc: basic monster functions
/* ALL MONSTERS SHOULD BE 1 0 0 IN COLOR */
@ -12,11 +12,6 @@
// <code>
// };
float() enemy_is_high = {
return !self.enemy ||
fabs(self.enemy.origin_z - self.origin_z) >= AI_MONSTER_HIGH;
};
/*
================
monster_use
@ -118,13 +113,13 @@ void() walkmonster_start_go = {
}
// spread think times so they don't all happen at same time
self.nextthink = time + 0.1 + random() * 0.5;
self.nextthink = self.nextthink + random() * 0.5;
};
void() walkmonster_start = {
// delay drop to floor to make sure all doors have been spawned
// spread think times so they don't all happen at same time
self.nextthink = time + 0.1 + random() * 0.5;
self.nextthink = self.nextthink + random() * 0.5;
self.think = walkmonster_start_go;
total_monsters = total_monsters + 1;
};
@ -163,13 +158,11 @@ void() flymonster_start_go = {
self.pausetime = 99999999;
self.th_stand();
}
self.nextthink = time + 0.1 + random() * 0.5;
};
void() flymonster_start = {
// spread think times so they don't all happen at same time
self.flags |= FL_FLY;
self.nextthink = time + 0.1 + random() * 0.5;
self.nextthink = self.nextthink + random() * 0.5;
self.think = flymonster_start_go;
total_monsters = total_monsters + 1;
};
@ -181,6 +174,7 @@ void() swimmonster_start_go = {
}
self.takedamage = DAMAGE_AIM;
total_monsters = total_monsters + 1;
self.ideal_yaw = self.angles * '0 1 0';
if(!self.yaw_speed) {
@ -206,13 +200,12 @@ void() swimmonster_start_go = {
}
// spread think times so they don't all happen at same time
self.nextthink = time + 0.1 + random() * 0.5;
self.nextthink = self.nextthink + random() * 0.5;
};
void() swimmonster_start = {
// spread think times so they don't all happen at same time
self.flags |= FL_SWIM;
self.nextthink = time + 0.1 + random() * 0.5;
self.nextthink = self.nextthink + random() * 0.5;
self.think = swimmonster_start_go;
total_monsters = total_monsters + 1;
};

View File

@ -1,4 +1,4 @@
// m_ogre.qc: Ogre
// ogre.qc: Ogre
$cd id1 / models / ogre_c
$origin 0 0 24
@ -57,7 +57,7 @@ float() ogre_check_attack = {
float chance;
if(enemy_range == RANGE_MELEE) {
if(ent_can_damage(self.enemy, self)) {
if(can_damage(self.enemy, self)) {
self.attack_state = AS_MELEE;
return TRUE;
}
@ -198,7 +198,7 @@ void(float side) chainsaw = {
if(!self.enemy) {
return;
}
if(!ent_can_damage(self.enemy, self)) {
if(!can_damage(self.enemy, self)) {
return;
}
@ -295,10 +295,9 @@ void() ogre_swing12 = [ $swing12, ogre_swing13 ] {ai_charge(3);};
void() ogre_swing13 = [ $swing13, ogre_swing14 ] {ai_charge(8);};
void() ogre_swing14 = [ $swing14, ogre_run1 ] {ai_charge(9);};
void() ogre_smash1 = [ $smash1, ogre_smash2 ] {
ai_charge(6);
sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
};
void() ogre_smash1 = [ $smash1, ogre_smash2 ] {ai_charge(6);
sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
};
void() ogre_smash2 = [ $smash2, ogre_smash3 ] {ai_charge(0);};
void() ogre_smash3 = [ $smash3, ogre_smash4 ] {ai_charge(0);};
void() ogre_smash4 = [ $smash4, ogre_smash5 ] {ai_charge(1);};
@ -308,11 +307,10 @@ void() ogre_smash7 = [ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0);};
void() ogre_smash8 = [ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);};
void() ogre_smash9 = [ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);};
void() ogre_smash10 = [ $smash10, ogre_smash11 ] {chainsaw(1);};
void() ogre_smash11 = [ $smash11, ogre_smash12 ] {
ai_charge(2);
chainsaw(0);
self.nextthink = time + 0.1 + random() * 0.2;
}; // slight variation
void() ogre_smash11 = [ $smash11, ogre_smash12 ] {ai_charge(2);
chainsaw(0);
self.nextthink = self.nextthink + random() * 0.2;
}; // slight variation
void() ogre_smash12 = [ $smash12, ogre_smash13 ] {ai_charge(0);};
void() ogre_smash13 = [ $smash13, ogre_smash14 ] {ai_charge(4);};
void() ogre_smash14 = [ $smash14, ogre_run1 ] {ai_charge(12);};

View File

@ -1,4 +1,4 @@
// m_oldone.qc: Shub-Niggurath
// oldone.qc: Shub-Niggurath
$cd id1 / models / old_one
$origin 0 0 24
@ -16,7 +16,7 @@ $frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8
$frame shake9 shake10 shake11 shake12 shake13 shake14
$frame shake15 shake16 shake17 shake18 shake19 shake20
void() finale_1, finale_2, finale_3, finale_4;
//void() old_stand =[ $old1, old_stand ] {};
void() old_idle1 = [ $old1, old_idle2 ] {};
void() old_idle2 = [ $old2, old_idle3 ] {};
@ -79,13 +79,12 @@ void() old_thrash11 = [ $shake11, old_thrash12 ] {light_style(0, "g");};
void() old_thrash12 = [ $shake12, old_thrash13 ] {light_style(0, "i");};
void() old_thrash13 = [ $shake13, old_thrash14 ] {light_style(0, "k");};
void() old_thrash14 = [ $shake14, old_thrash15 ] {light_style(0, "m");};
void() old_thrash15 = [ $shake15, old_thrash16 ] {
light_style(0, "m");
self.cnt = self.cnt + 1;
if(self.cnt != 3) {
self.think = old_thrash1;
}
};
void() old_thrash15 = [ $shake15, old_thrash16 ] {light_style(0, "m");
self.cnt = self.cnt + 1;
if(self.cnt != 3) {
self.think = old_thrash1;
}
};
void() old_thrash16 = [ $shake16, old_thrash17 ] {light_style(0, "g");};
void() old_thrash17 = [ $shake17, old_thrash18 ] {light_style(0, "c");};
void() old_thrash18 = [ $shake18, old_thrash19 ] {light_style(0, "b");};
@ -98,9 +97,6 @@ void() finale_1 = {
entity pos, pl;
entity timer;
killed_monsters++;
write_byte(MSG_ALL, SVC_KILLEDMONSTER);
intermission_exittime = time + 10000000; // never allow exit
intermission_running = 1;

View File

@ -1,9 +1,4 @@
// w_plats.qc: moving platforms
void() plat_center_touch, plat_crush, plat_go_down, plat_go_up,
plat_outside_touch, plat_trigger_use;
void() train_wait;
// plats.qc: moving platforms
void() plat_spawn_inside_trigger = {
entity trigger;
@ -211,6 +206,23 @@ void() train_blocked = {
self.attack_finished = time + 0.5;
ent_damage(other, self, self, self.dmg);
};
void() train_use = {
if(self.think != func_train_find) {
return; // already activated
}
train_next();
};
void() train_wait = {
if(self.wait) {
self.nextthink = self.ltime + self.wait;
sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
} else {
self.nextthink = self.ltime + 0.1;
}
self.think = train_next;
};
void() train_next = {
entity targ;
@ -242,24 +254,6 @@ void() func_train_find = {
}
};
void() train_use = {
if(self.think != func_train_find) {
return; // already activated
}
train_next();
};
void() train_wait = {
if(self.wait) {
self.nextthink = self.ltime + self.wait;
sound(self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
} else {
self.nextthink = self.ltime + 0.1;
}
self.think = train_next;
};
/*QUAKED func_train(0 .5 .8) ?
Trains are moving platforms that players can ride.
The targets origin specifies the min point of the train at each corner.

View File

@ -1,4 +1,4 @@
// p_player.qc: the player entity
// player.qc: the player entity
$cd id1 / models / player_4
$origin 0 - 6 24
@ -68,11 +68,6 @@ $frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6
$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
void() player_die_ax1, player_diea1, player_dieb1, player_diec1, player_died1,
player_diee1;
void(float num_bubbles) death_bubbles;
/*
==============================================================================
PLAYER
@ -254,9 +249,7 @@ void() player_pain_sound = {
// slime pain sounds
if(self.watertype == CONTENT_SLIME) {
if(self.waterlevel == 3) {
death_bubbles(1);
}
// FIX ME put in some steam here
if(random() > 0.5) {
sound(self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
} else {
@ -342,8 +335,7 @@ void(entity attacker, float damage) player_pain = {
void() player_death_bubbles_spawn = {
entity bubble;
if(self.owner.waterlevel != 3 && self.owner.health > 0) {
remove(self);
if(self.owner.waterlevel != 3) {
return;
}
bubble = spawn();
@ -358,7 +350,7 @@ void() player_death_bubbles_spawn = {
bubble.frame = 0;
bubble.cnt = 0;
set_size(bubble, '-8 -8 -8', '8 8 8');
self.nextthink = time + 0.01;
self.nextthink = time + 0.1;
self.think = player_death_bubbles_spawn;
self.air_finished = self.air_finished + 1;
if(self.air_finished >= self.bubble_count) {
@ -373,11 +365,12 @@ void(float num_bubbles) death_bubbles = {
set_origin(bubble_spawner, self.origin);
bubble_spawner.movetype = MOVETYPE_NONE;
bubble_spawner.solid = SOLID_NOT;
bubble_spawner.nextthink = time + 0.01;
bubble_spawner.nextthink = time + 0.1;
bubble_spawner.think = player_death_bubbles_spawn;
bubble_spawner.air_finished = 0;
bubble_spawner.owner = self;
bubble_spawner.bubble_count = num_bubbles;
return;
};
void() player_death_sound = {
@ -500,12 +493,11 @@ void() player_gib = {
void() player_die = {
float i;
self.items &= ~(IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD);
self.items = self.items - (self.items & IT_INVISIBILITY);
self.invisible_finished = 0; // don't die as eyes
self.invincible_finished = 0;
self.super_damage_finished = 0;
self.radsuit_finished = 0;
self.effects = 0;
self.modelindex = modelindex_player; // don't use eyes
if(deathmatch || coop) {

View File

@ -1,4 +1,4 @@
// m_shalrath.qc: Vore
// shalrath.qc: Vore
$cd id1 / models / shalrath
$origin 0 0 24
@ -16,8 +16,6 @@ $frame death1 death2 death3 death4 death5 death6 death7
$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10
$frame walk11 walk12
void() shalrath_home, shalrath_missile, shalrath_missile_touch;
void() shal_stand = [ $walk1, shal_stand ] {ai_stand();};
void() shal_walk1 = [ $walk2, shal_walk2 ] {

View File

@ -1,4 +1,4 @@
// m_shambler.qc: Shambler
// shambler.qc: Shambler
$cd id1 / models / shams
$origin 0 0 24
@ -30,7 +30,6 @@ $frame pain1 pain2 pain3 pain4 pain5 pain6
$frame death1 death2 death3 death4 death5 death6
$frame death7 death8 death9 death10 death11
void() sham_smash1, sham_swingl1, sham_swingr1;
/*
===========
sham_check_attack
@ -46,7 +45,7 @@ float() sham_check_attack = {
float enemy_yaw;
if(enemy_range == RANGE_MELEE) {
if(ent_can_damage(self.enemy, self)) {
if(can_damage(self.enemy, self)) {
self.attack_state = AS_MELEE;
return TRUE;
}
@ -162,7 +161,7 @@ void() sham_smash10 = [ $smash10, sham_smash11 ] {
if(vec_len(delta) > 100) {
return;
}
if(!ent_can_damage(self.enemy, self)) {
if(!can_damage(self.enemy, self)) {
return;
}
@ -279,27 +278,24 @@ void() sham_cast_lightning = {
lightning_damage(org, trace_endpos, self, 10);
};
void() sham_magic1 = [ $magic1, sham_magic2 ] {
ai_face();
sound(self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);
};
void() sham_magic1 = [ $magic1, sham_magic2 ] {ai_face();
sound(self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);
};
void() sham_magic2 = [ $magic2, sham_magic3 ] {ai_face();};
void() sham_magic3 = [ $magic3, sham_magic4 ] {
entity o;
void() sham_magic3 = [ $magic3, sham_magic4 ] {ai_face();
self.nextthink = self.nextthink + 0.2;
entity o;
ai_face();
self.nextthink = time + 0.2;
self.effects = self.effects | EF_MUZZLEFLASH;
ai_face();
self.owner = spawn();
o = self.owner;
set_model(o, "progs/s_light.mdl");
set_origin(o, self.origin);
o.angles = self.angles;
o.nextthink = time + 0.7;
o.think = sub_remove;
};
self.effects = self.effects | EF_MUZZLEFLASH;
ai_face();
self.owner = spawn();
o = self.owner;
set_model(o, "progs/s_light.mdl");
set_origin(o, self.origin);
o.angles = self.angles;
o.nextthink = time + 0.7;
o.think = sub_remove;
};
void() sham_magic4 = [ $magic4, sham_magic5 ] {
self.effects = self.effects | EF_MUZZLEFLASH;
self.owner.frame = 1;

View File

@ -1,4 +1,4 @@
// m_army.qc: Grunt
// soldier.qc: Grunt
$cd id1 / models / soldier3
$origin 0 - 6 24
@ -31,8 +31,6 @@ $frame prowl_1 prowl_2 prowl_3 prowl_4 prowl_5 prowl_6 prowl_7 prowl_8
$frame prowl_9 prowl_10 prowl_11 prowl_12 prowl_13 prowl_14 prowl_15 prowl_16
$frame prowl_17 prowl_18 prowl_19 prowl_20 prowl_21 prowl_22 prowl_23 prowl_24
void() army_fire;
//=============================================================================
/*

View File

@ -1,4 +1,4 @@
// v_sprites.qc: sprite information
// sprites.qc: sprite information
$spritename s_explod
$type vp_parallel

View File

@ -1,4 +1,4 @@
// ai_subs.qc: subroutines for think frames
// subs.qc: subroutines for think frames
void() sub_null = {};
void(entity attacker, float damage) sub_pain_null = {};

View File

@ -1,4 +1,4 @@
// m_tarbaby.qc: Spawn
// tarbaby.qc: Spawn
$cd id1 / models / tarbaby
$origin 0 0 24
@ -20,8 +20,6 @@ $frame fly1 fly2 fly3 fly4
$frame exp
void() tbaby_jump1, tbaby_jump5;
void() tbaby_stand1 = [ $walk1, tbaby_stand1 ] {ai_stand();};
void() tbaby_hang1 = [ $walk1, tbaby_hang1 ] {ai_stand();};

View File

@ -1,4 +1,4 @@
// w_triggers.qc: triggerable entities
// triggers.qc: triggerable entities
void() trigger_reactivate = {
self.solid = SOLID_TRIGGER;
@ -286,19 +286,12 @@ void() tdeath_touch = {
// frag anyone who teleports in on top of an invincible player
if(other.classname == "player") {
if(self.owner.classname != "player") {
ent_damage(self.owner, self, self, 50000);
return;
}
if(other.invincible_finished > time) {
if(self.owner.invincible_finished > time) {
self.classname = "teledeath3";
other.invincible_finished = 0;
ent_damage(other, self, self, 50000);
} else {
self.classname = "teledeath2";
ent_damage(self.owner, self, self, 50000);
}
self.classname = "teledeath2";
}
if(self.owner.classname != "player") {
// other monsters explode themselves
ent_damage(self.owner, self, self, 50000);
return;
}
}
@ -349,17 +342,14 @@ void() teleport_touch = {
sub_use_targets();
t = find(world, targetname, self.target);
if(!t ||
t.classname != "info_teleport_destination" &&
t.classname != "misc_teleporttrain") {
print_dbg("object error in teleport_touch: no target\n");
return;
}
// put a tfog where the player was
spawn_tfog(other.origin);
t = find(world, targetname, self.target);
if(!t) {
error_obj("couldn't find target");
}
// spawn a tfog flash in front of the destination
make_vectors(t.mangle);
org = t.origin + 32 * v_forward;
@ -495,14 +485,17 @@ void() trigger_onlyregistered = {
//============================================================================
void() hurt_on = {
self.solid = SOLID_TRIGGER;
self.nextthink = -1;
};
void() hurt_touch = {
if(other.takedamage) {
if(time != self.hurt_together_time && time < self.hurt_nextthink) {
return;
}
self.solid = SOLID_NOT;
ent_damage(other, self, self, self.dmg);
self.hurt_together_time = time;
self.hurt_nextthink = time + 1;
self.think = hurt_on;
self.nextthink = time + 1;
}
return;

View File

@ -1,4 +1,4 @@
// p_weapons.qc: weapon functions
// weapons.qc: weapon functions
// called by worldspawn
void() wep_precache = {
@ -533,43 +533,6 @@ void() wep_fire_grenade = {
//=============================================================================
void() spike_touch = {
float rand;
if(other == self.owner) {
return;
}
if(other.solid == SOLID_TRIGGER) {
return; // trigger field, do nothing
}
if(point_contents(self.origin) == CONTENT_SKY) {
remove(self);
return;
}
// hit something that bleeds
if(other.takedamage) {
spawn_touchblood(9);
ent_damage(other, self, self.owner, 9);
} else {
write_byte(MSG_BROADCAST, SVC_TEMPENTITY);
if(self.classname == "wizspike") {
write_byte(MSG_BROADCAST, TE_WIZSPIKE);
} else if(self.classname == "knightspike") {
write_byte(MSG_BROADCAST, TE_KNIGHTSPIKE);
} else {
write_byte(MSG_BROADCAST, TE_SPIKE);
}
write_coord(MSG_BROADCAST, self.origin_x);
write_coord(MSG_BROADCAST, self.origin_y);
write_coord(MSG_BROADCAST, self.origin_z);
}
remove(self);
};
/*
===============
launch_spike
@ -637,6 +600,43 @@ void(float ox) wep_fire_nail = {
self.punchangle_x = -2;
};
void() spike_touch = {
float rand;
if(other == self.owner) {
return;
}
if(other.solid == SOLID_TRIGGER) {
return; // trigger field, do nothing
}
if(point_contents(self.origin) == CONTENT_SKY) {
remove(self);
return;
}
// hit something that bleeds
if(other.takedamage) {
spawn_touchblood(9);
ent_damage(other, self, self.owner, 9);
} else {
write_byte(MSG_BROADCAST, SVC_TEMPENTITY);
if(self.classname == "wizspike") {
write_byte(MSG_BROADCAST, TE_WIZSPIKE);
} else if(self.classname == "knightspike") {
write_byte(MSG_BROADCAST, TE_KNIGHTSPIKE);
} else {
write_byte(MSG_BROADCAST, TE_SPIKE);
}
write_coord(MSG_BROADCAST, self.origin_x);
write_coord(MSG_BROADCAST, self.origin_y);
write_coord(MSG_BROADCAST, self.origin_z);
}
remove(self);
};
void() superspike_touch = {
float rand;
if(other == self.owner) {

View File

@ -1,4 +1,4 @@
// m_wizard.qc: Scrag
// wizard.qc: Scrag
$cd id1 / models / a_wizard
$origin 0 0 24
@ -18,8 +18,6 @@ $frame pain1 pain2 pain3 pain4
$frame death1 death2 death3 death4 death5 death6 death7 death8
void() wiz_run1, wiz_side1;
/*
==============================================================================

View File

@ -1,6 +1,4 @@
// w_world.qc: basic entry point functions
void() init_body_queue;
// world.qc: basic entry point functions
void() main = {
};
@ -194,16 +192,14 @@ void() StartFrame = {
framecount = framecount + 1;
if(ext_con_set) {
sc_cheats = cvar("sc_cheats");
sc_lives = cvar("sc_lives");
sc_dist_ammo = cvar("sc_dist_ammo");
sc_challenge = cvar("sc_challenge");
sf_cheats = cvar("sc_cheats");
sf_lives = cvar("sc_lives");
sf_dist_ammo = cvar("sc_dist_ammo");
} else {
temp1flag = cvar("temp1");
sc_cheats = (temp1flag & SC_CHEATS) != 0;
sc_lives = bit_shift_right(temp1flag & SC_LIVES_MSK, SC_LIVES_BEG);
sc_dist_ammo = (temp1flag & SC_DIST_AMMO) != 0;
sc_challenge = (temp1flag & SC_CHALLENGE) != 0;
sf_cheats = (temp1flag & SF_CHEATS) != 0;
sf_lives = bit_shift_right(temp1flag & SF_LIVES_MSK, SF_LIVES_BEG);
sf_dist_ammo = (temp1flag & SF_DIST_AMMO) != 0;
}
if(all_players_are_dead) {

View File

@ -1,4 +1,4 @@
// m_zombie.qc: Zombie
// zombie.qc: Zombie
$cd id1 / models / zombie
@ -345,7 +345,7 @@ void() zombie_paine10 = [ $paine10, zombie_paine11 ] {
sound(self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM);
self.solid = SOLID_NOT;
};
void() zombie_paine11 = [ $paine11, zombie_paine12 ] {self.nextthink = time + 5; self.health = 60;};
void() zombie_paine11 = [ $paine11, zombie_paine12 ] {self.nextthink = self.nextthink + 5; self.health = 60;};
void() zombie_paine12 = [ $paine12, zombie_paine13 ] {
// see if ok to stand up
self.health = 60;
@ -424,8 +424,7 @@ void(entity attacker, float take) zombie_pain = {
}
if(self.inpain) {
// if hit again in next three seconds while not in pain frames,
// definitely drop
// if hit again in next gre seconds while not in pain frames, definately drop
self.pain_finished = time + 3;
return; // currently going through an animation, don't change
}

5
todo
View File

@ -4,7 +4,7 @@ none
refactoring:
all done
add expansion pack entities
core features:
@ -14,10 +14,10 @@ useful features:
configurable enemy stats
indicators for where other players are
users can cancel map ends ("<name> initiated travel to <mapname>")
extraneous features:
add expansion pack entities
emotes
player sound effect option
players shoot through eachother (teamplay 4?)
@ -37,4 +37,3 @@ lives counting
no friendly fire
rename all functions to be lower_underscore
restart map after 10 seconds when everyone is dead
users can cancel map ends ("<name> initiated travel to <mapname>")