From a51bbbdbcbfd7499b27f90b3727a226c4a9c8612 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Fri, 24 Jun 2005 00:26:14 +0000 Subject: [PATCH] monsters change git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1114 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/basemod/defs.qc | 19 +- quakec/basemod/items.qc | 4 - quakec/basemod/misc.qc | 40 +-- quakec/basemod/models.qc | 585 -------------------------------------- quakec/basemod/nomonst.qc | 20 ++ quakec/basemod/progs.src | 6 +- quakec/basemod/server.qc | 99 ------- quakec/basemod/weapons.qc | 5 +- 8 files changed, 41 insertions(+), 737 deletions(-) delete mode 100644 quakec/basemod/models.qc create mode 100644 quakec/basemod/nomonst.qc delete mode 100644 quakec/basemod/server.qc diff --git a/quakec/basemod/defs.qc b/quakec/basemod/defs.qc index e83218371..20860766d 100644 --- a/quakec/basemod/defs.qc +++ b/quakec/basemod/defs.qc @@ -3,7 +3,7 @@ #define TRUE 1 #ifdef FTE -// use real floats if using FTE type progs +// use real int if using FTE type progs #define INTEGER int #else #define INTEGER float @@ -386,7 +386,7 @@ float TE_LIGHTNINGBLOOD = 13; #define ATTN_NONE 0.0 // no volume fall off due to range #define ATTN_NORM 1.0 // small volume fall off (1000 range) #define ATTN_IDLE 2.0 // medium volume fall off (500 range) -#define ATTN_STATIC 3.0 // large volume fall oof (333 range) +#define ATTN_STATIC 3.0 // large volume fall off (333 range) // entity effects @@ -472,15 +472,18 @@ float spotspawn; .string killtarget; // used by anything using SUB_UseTargets (items/triggers/etc) -// -// monster ai -// .void(entity attacker, float damage) th_pain; // used by secret doors, monsters, players .void() th_die; // used by anything damagable (doors/buttons/players/monsters/explobox/triggermultiple) .float speed; // used with door/plats/fireball spawner, inherited .string map; // used with world/trigger_changelevel, inherited +// used with monsters/players +INTEGER ammo_shells_real; // real shells count +INTEGER ammo_nails_real; // real nails count +INTEGER ammo_rockets_real; // real rockets count +INTEGER ammo_cells_real; // real cells count + // Zoid Additions .float maxspeed; // Used to set Maxspeed on a player .float gravity; // Gravity Multiplier (0 to 1.0) @@ -599,10 +602,6 @@ enum { float waterdmg; // damage water will deal when drowning float walkframe; // used with walking animation float jump_flag; // last z velocity used for falling damage - INTEGER ammo_shells_real; // real shells count - INTEGER ammo_nails_real; // real nails count - INTEGER ammo_rockets_real; // real rockets count - INTEGER ammo_cells_real; // real cells count INTEGER ammo_type; // ammo type in use }; struct { // fields used with bubbles spawned from drowning @@ -669,7 +668,7 @@ void(entity e, vector o) setorigin = #2; void(entity e, string m) setmodel = #3; // set movetype and solid first void(entity e, vector min, vector max) setsize = #4; // #5 was removed -void() break = #6; +// void() break = #6; float() random = #7; // returns 0 - 1 void(entity e, float chan, string samp, float vol, float atten) sound = #8; vector(vector v) normalize = #9; diff --git a/quakec/basemod/items.qc b/quakec/basemod/items.qc index a0c4ae01c..f5e45f7dc 100644 --- a/quakec/basemod/items.qc +++ b/quakec/basemod/items.qc @@ -1222,9 +1222,6 @@ POWERUPS =============================================================================== */ -void() powerup_touch; - - void() powerup_touch = { if (other.classname != "player") @@ -1540,7 +1537,6 @@ void() DropBackpack = { local entity item; - // FIX THIS FOR MONSTERS if (!(self.ammo_shells_real + self.ammo_nails_real + self.ammo_rockets_real + self.ammo_cells_real)) return; // nothing in it diff --git a/quakec/basemod/misc.qc b/quakec/basemod/misc.qc index 6ed68de2a..45510a9e5 100644 --- a/quakec/basemod/misc.qc +++ b/quakec/basemod/misc.qc @@ -2,10 +2,7 @@ /*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4) Used as a positional target for spotlights, etc. */ -void() info_null = -{ - remove(self); -}; +void() info_null = SUB_Remove; /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) Used as a positional target for lightning. @@ -377,9 +374,7 @@ void() trap_shooter = =============================================================================== */ - void() make_bubbles; -void() bubble_remove; void() bubble_bob; /*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8) @@ -387,10 +382,7 @@ void() bubble_bob; testing air bubbles */ -void() air_bubbles = -{ - remove (self); -}; +var void() air_bubbles = SUB_Remove; void() make_bubbles = { @@ -404,7 +396,6 @@ local entity bubble; bubble.velocity = '0 0 15'; bubble.nextthink = time + 0.5; bubble.think = bubble_bob; - bubble.touch = bubble_remove; bubble.classname = "bubble"; bubble.frame = 0; bubble.bubble_state = 0; @@ -425,7 +416,6 @@ local entity bubble; bubble.velocity = self.velocity; bubble.nextthink = time + 0.5; bubble.think = bubble_bob; - bubble.touch = bubble_remove; bubble.classname = "bubble"; bubble.frame = 1; bubble.bubble_state = 10; @@ -436,16 +426,6 @@ local entity bubble; remove (self); }; -void() bubble_remove = -{ - if (other.classname == self.classname) - { -// dprint ("bump"); - return; - } - remove(self); -}; - void() bubble_bob = { local float rnd1, rnd2, rnd3; @@ -491,15 +471,7 @@ local float rnd1, rnd2, rnd3; Just for the debugging level. Don't use */ -void() viewthing = - -{ - self.movetype = MOVETYPE_NONE; - self.solid = SOLID_NOT; - precache_model ("progs/player.mdl"); - setmodel (self, "progs/player.mdl"); -}; - +var void() viewthing = SUB_Remove; /* ============================================================================== @@ -531,7 +503,6 @@ void() func_wall = A simple entity that looks solid but lets you walk through it. */ void() func_illusionary = - { self.angles = '0 0 0'; self.movetype = MOVETYPE_NONE; @@ -544,7 +515,6 @@ void() func_illusionary = This bmodel will appear if the episode has allready been completed, so players can't reenter it. */ void() func_episodegate = - { if (!(serverflags & self.spawnflags)) return; // can still enter episode @@ -560,10 +530,12 @@ void() func_episodegate = This bmodel appears unless players have all of the episode sigils. */ void() func_bossgate = - { if ( (serverflags & 15) == 15) + { + remove(self); return; // all episodes completed + } self.angles = '0 0 0'; self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything self.solid = SOLID_BSP; diff --git a/quakec/basemod/models.qc b/quakec/basemod/models.qc deleted file mode 100644 index 56f474d56..000000000 --- a/quakec/basemod/models.qc +++ /dev/null @@ -1,585 +0,0 @@ - -/* -=============================================================================== - -WORLD WEAPONS - -=============================================================================== -*/ - -$modelname g_shot -$cd /raid/quake/id1/models/g_shot -$origin 0 0 -24 -$flags 8 // client side rotate -$base base -$skin skin -$frame shot1 - - -$modelname g_nail -$cd /raid/quake/id1/models/g_nail -$flags 8 // client side rotate -$origin 0 0 -24 -$base base -$skin skin -$frame shot1 - - -$modelname g_nail2 -$cd /raid/quake/id1/models/g_nail2 -$flags 8 // client side rotate -$origin 0 0 -24 -$base base -$skin skin -$frame shot2 - - -$modelname g_rock -$cd /raid/quake/id1/models/g_rock -$flags 8 // client side rotate -$origin 0 0 -24 -$base base -$skin skin -$frame shot1 - - -$modelname g_rock2 -$cd /raid/quake/id1/models/g_rock2 -$flags 8 // client side rotate -$origin 0 0 -24 -$base base -$skin skin -$frame shot1 - -$modelname g_light -$cd /raid/quake/id1/models/g_light -$flags 8 // client side rotate -$origin 0 0 -24 -$base base -$skin skin -$frame shot1 - -/* -=============================================================================== - -VIEW WEAPONS - -=============================================================================== -*/ - -$modelname v_axe -$cd /raid/quake/id1/models/v_axe -$origin 0 5 54 -$base base -$skin skin -$frame frame1 frame2 frame3 frame4 frame5 frame6 frame7 frame8 frame9 - - -$modelname v_shot -$cd /raid/quake/id1/models/v_shot -$origin 0 0 54 -$base base -$skin skin -$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 - - -$modelname v_shot2 -$cd /raid/quake/id1/models/v_shot2 -$origin 0 0 56 -$base base -$skin skin -$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 - - -$modelname v_rock2 -$cd /raid/quake/id1/models/v_rock2 -$origin 0 0 54 -$base base -$skin skin -$frame shot1 shot2 shot3 shot4 shot5 shot6 shot6 - - -$modelname v_rock -$cd /raid/quake/id1/models/v_rock -$origin 0 0 54 -$base base -$skin skin -$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 - - -$modelname v_nail2 -$cd /raid/quake/id1/models/v_nail2 -$origin 0 0 54 -$base base -$skin skin -$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 shot9 - - -$modelname v_nail -$cd /raid/quake/id1/models/v_nail -$origin 0 0 54 -$base base -$skin skin -$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 shot9 - -$modelname v_light -$cd /raid/quake/id1/models/v_light -$origin 0 0 54 -$base base -$skin skin -$frame shot1 shot2 shot3 shot4 shot5 - - -/* -=============================================================================== - -ITEMS - -=============================================================================== -*/ - -$modelname w_g_key -$cd /raid/quake/id1/models/w_g_key -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname w_s_key -$cd /raid/quake/id1/models/w_s_key -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname m_g_key -$cd /raid/quake/id1/models/m_g_key -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname m_s_key -$cd /raid/quake/id1/models/m_s_key -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname b_g_key -$cd /raid/quake/id1/models/b_g_key -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname b_s_key -$cd /raid/quake/id1/models/b_s_key -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - - -$modelname quaddama -$cd /raid/quake/id1/models/quaddama -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname invisibl -$cd /raid/quake/id1/models/invisibl -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname invulner -$flags 8 // client side rotate -$cd /raid/quake/id1/models/invulner -$base base -$skin skin -$frame frame1 - -//modelname jetpack -//cd /raid/quake/id1/models/jetpack -//flags 8 // client side rotate -//base base -//skin skin -//frame frame1 - -$modelname cube -$cd /raid/quake/id1/models/cube -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname suit -$cd /raid/quake/id1/models/suit -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname boots -$cd /raid/quake/id1/models/boots -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname end1 -$cd /raid/quake/id1/models/end1 -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname end2 -$cd /raid/quake/id1/models/end2 -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname end3 -$cd /raid/quake/id1/models/end3 -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - -$modelname end4 -$cd /raid/quake/id1/models/end4 -$flags 8 // client side rotate -$base base -$skin skin -$frame frame1 - - -/* -=============================================================================== - -GIBS - -=============================================================================== -*/ - -$modelname gib1 -$cd /raid/quake/id1/models/gib1 -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - - -// torso -$modelname gib2 -$cd /raid/quake/id1/models/gib2 -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname gib3 -$cd /raid/quake/id1/models/gib3 -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - - -// heads - -$modelname h_player -$cd /raid/quake/id1/models/h_player -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_dog -$cd /raid/quake/id1/models/h_dog -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_mega -$cd /raid/quake/id1/models/h_mega -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_guard -$cd /raid/quake/id1/models/h_guard -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_wizard -$cd /raid/quake/id1/models/h_wizard -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_knight -$cd /raid/quake/id1/models/h_knight -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_hellkn -$cd /raid/quake/id1/models/h_hellkn -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_zombie -$cd /raid/quake/id1/models/h_zombie -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_shams -$cd /raid/quake/id1/models/h_shams -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_shal -$cd /raid/quake/id1/models/h_shal -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_ogre -$cd /raid/quake/id1/models/h_ogre -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname h_demon -$cd /raid/quake/id1/models/h_demon -$flags 4 // EF_GIB -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -/* -=============================================================================== - -MISC - -=============================================================================== -*/ - -$modelname armor -$cd /raid/quake/id1/models/armor -$flags 8 // client side rotate -$origin 0 0 -8 -$base base -$skin skin -$skin skin2 -$skin skin3 -$frame armor - -$modelname s_light // shambler lightning ready -$cd /raid/quake/id1/models/s_light -$origin 0 0 24 -$base base -$skin skin -$frame frame1 frame2 frame3 - -$modelname bolt3 // lightning towar bolts -$cd /raid/quake/id1/models/bolt2 -$origin 0 0 0 -$base base -$scale 4 -$skin skin -$frame light - -$modelname bolt2 -$cd /raid/quake/id1/models/bolt2 -$origin 0 0 0 -$base base -$skin skin -$frame light - -$modelname bolt -$cd /raid/quake/id1/models/bolt -$origin 0 0 0 -$base light -$skin light -$frame light - -$modelname laser -$cd /raid/quake/id1/models/laser -$base base -$skin skin -$scale 2 -$frame frame1 - -$modelname flame // with torch -$cd /raid/quake/id1/models/flame -$origin 0 0 12 -$base base -$skin skin -$framegroupstart -$frame flame1 0.1 -$frame flame2 0.1 -$frame flame3 0.1 -$frame flame4 0.1 -$frame flame5 0.1 -$frame flame6 0.1 -$framegroupend - -$modelname flame2 // standing flame, no torch -$cd /raid/quake/id1/models/flame2 -$origin 0 0 12 -$base base -$skin skin -$framegroupstart -$frame flame1 0.1 -$frame flame2 0.1 -$frame flame3 0.1 -$frame flame4 0.1 -$frame flame5 0.1 -$frame flame6 0.1 -$framegroupend -$framegroupstart -$frame flameb1 -$frame flameb2 -$frame flameb3 -$frame flameb4 -$frame flameb5 -$frame flameb6 -$frame flameb7 -$frame flameb8 -$frame flameb9 -$frame flameb10 -$frame flameb11 -$framegroupend - -$modelname zom_gib -$cd /raid/quake/id1/models/zom_gib -$flags 32 // EF_ZOMGIB -$base base -$skin skin -$frame frame1 - -$modelname eyes -$cd /raid/quake/id1/models/eyes -$origin 0 0 -24 -$base base -$skin skin -$frame frame1 - -$modelname spike -$cd /raid/quake/id1/models/spike -$origin 0 0 0 -$base spike -$skin skin -$frame spike - -$modelname s_spike -$cd /raid/quake/id1/models/s_spike -$origin 0 0 0 -$base spike -$skin skin -$frame spike - -$modelname v_spike -$cd /raid/quake/id1/models/v_spike -$flags 128 // EF_TRACER3 -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname w_spike -$cd /raid/quake/id1/models/w_spike -$flags 16 // EF_TRACER -$origin 0 0 0 -$base base -$skin skin -$framegroupstart -$frame frame1 0.1 -$frame frame2 0.1 -$frame frame3 0.1 -$frame frame4 0.1 -$framegroupend - -$modelname k_spike -$cd /raid/quake/id1/models/k_spike -$flags 64 // EF_TRACER2 -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname backpack -$cd /raid/quake/id1/models/backpack -$flags 8 // EF_ROTATE -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname grenade -$cd /raid/quake/id1/models/grenade2 -$flags 2 // EF_GRENADE -$origin 0 0 0 -$base base -$skin skin -$frame grenade - -$modelname missile -$cd /raid/quake/id1/models/missile -$flags 1 // EF_ROCKET -$origin 0 0 0 -$base base -$skin skin -$frame missile - -$modelname lavaball -$cd /raid/quake/id1/models/lavaball -$flags 1 // EF_ROCKET -$origin 0 0 0 -$base base -$skin skin -$frame frame1 - -$modelname teleport -$cd /raid/quake/id1/models/teleport -$origin 0 0 24 -$base base -$skin skin -$frame frame1 - diff --git a/quakec/basemod/nomonst.qc b/quakec/basemod/nomonst.qc new file mode 100644 index 000000000..529e9a0c4 --- /dev/null +++ b/quakec/basemod/nomonst.qc @@ -0,0 +1,20 @@ + +// QC for a monsterless compile + +var void() monster_ogre = SUB_Remove; +var void() monster_demon1 = SUB_Remove; +var void() monster_shambler = SUB_Remove; +var void() monster_knight = SUB_Remove; +var void() monster_army = SUB_Remove; +var void() monster_wizard = SUB_Remove; +var void() monster_dog = SUB_Remove; +var void() monster_zombie = SUB_Remove; +var void() monster_boss = SUB_Remove; +var void() monster_tarbaby = SUB_Remove; +var void() monster_hell_knight = SUB_Remove; +var void() monster_fish = SUB_Remove; +var void() monster_shalrath = SUB_Remove; +var void() monster_enforcer = SUB_Remove; +var void() monster_oldone = SUB_Remove; +var void() event_lightning = SUB_Remove; +var void() path_corner = SUB_Remove; diff --git a/quakec/basemod/progs.src b/quakec/basemod/progs.src index 7eee421a6..0b77d3b8f 100644 --- a/quakec/basemod/progs.src +++ b/quakec/basemod/progs.src @@ -37,5 +37,9 @@ #include "triggers.qc" #include "plats.qc" #include "misc.qc" -#include "server.qc" +#ifdef MONSTERS + +#else +#include "nomonst.qc" +#endif diff --git a/quakec/basemod/server.qc b/quakec/basemod/server.qc deleted file mode 100644 index 38df848a1..000000000 --- a/quakec/basemod/server.qc +++ /dev/null @@ -1,99 +0,0 @@ - -void() monster_ogre = {remove(self);}; -void() monster_demon1 = {remove(self);}; -void() monster_shambler = {remove(self);}; -void() monster_knight = {remove(self);}; -void() monster_army = {remove(self);}; -void() monster_wizard = {remove(self);}; -void() monster_dog = {remove(self);}; -void() monster_zombie = {remove(self);}; -void() monster_boss = {remove(self);}; -void() monster_tarbaby = {remove(self);}; -void() monster_hell_knight = {remove(self);}; -void() monster_fish = {remove(self);}; -void() monster_shalrath = {remove(self);}; -void() monster_enforcer = {remove(self);}; -void() monster_oldone = {remove(self);}; -void() event_lightning = {remove(self);}; - -/* -============================================================================== - -MOVETARGET CODE - -The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target. - -targetname -must be present. The name of this movetarget. - -target -the next spot to move to. If not present, stop here for good. - -pausetime -The number of seconds to spend standing or bowing for path_stand or path_bow - -============================================================================== -*/ - -/* -============= -t_movetarget - -Something has bumped into a movetarget. If it is a monster -moving towards it, change the next destination and continue. -============== -*/ -void() t_movetarget = -{ -local entity temp; - - if (other.movetarget != self) - return; - - if (other.enemy) - return; // fighting, not following a path - - temp = self; - self = other; - other = temp; - - if (self.classname == "monster_ogre") - sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound - -//dprint ("t_movetarget\n"); - self.goalentity = self.movetarget = find (world, targetname, other.target); - self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); - if (!self.movetarget) - { - self.pausetime = time + 999999; - self.th_stand (); - } -}; - - - -void() movetarget_f = -{ - if (!self.targetname) - objerror ("monster_movetarget: no targetname"); - - self.solid = SOLID_TRIGGER; - self.touch = t_movetarget; - setsize (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 = -{ - if (deathmatch) - remove(self); - else - movetarget_f (); -}; - - - -//============================================================================ diff --git a/quakec/basemod/weapons.qc b/quakec/basemod/weapons.qc index 45d0dd2f8..1f4f9e2db 100644 --- a/quakec/basemod/weapons.qc +++ b/quakec/basemod/weapons.qc @@ -24,10 +24,7 @@ void() W_Precache = precache_sound ("weapons/shotgn2.wav"); // super shotgun }; -float() crandom = -{ - return 2*(random() - 0.5); -}; +#define crandom() (2*(random()-0.5)) /* Ammo update functions