diff --git a/Makefile b/Makefile index f32ffecf..bbc42eb8 100644 --- a/Makefile +++ b/Makefile @@ -893,6 +893,7 @@ GAME_OBJS_ = \ src/game/menu/menu.o \ src/game/monster/actor/actor.o \ src/game/monster/arachnid/arachnid.o \ + src/game/monster/army/army.o \ src/game/monster/berserker/berserker.o \ src/game/monster/boss2/boss2.o \ src/game/monster/boss3/boss3.o \ @@ -902,6 +903,10 @@ GAME_OBJS_ = \ src/game/monster/brain/brain.o \ src/game/monster/carrier/carrier.o \ src/game/monster/chick/chick.o \ + src/game/monster/demon/demon.o \ + src/game/monster/dog/dog.o \ + src/game/monster/enforcer/enforcer.o \ + src/game/monster/fish/fish.o \ src/game/monster/fixbot/fixbot.o \ src/game/monster/flipper/flipper.o \ src/game/monster/float/float.o \ @@ -911,21 +916,28 @@ GAME_OBJS_ = \ src/game/monster/gladiator/gladiator.o \ src/game/monster/guardian/guardian.o \ src/game/monster/gunner/gunner.o \ + src/game/monster/hknight/hknight.o \ src/game/monster/hover/hover.o \ src/game/monster/infantry/infantry.o \ src/game/monster/insane/insane.o \ + src/game/monster/knight/knight.o \ src/game/monster/medic/medic.o \ src/game/monster/misc/move.o \ src/game/monster/mutant/mutant.o \ + src/game/monster/ogre/ogre.o \ src/game/monster/parasite/parasite.o \ + src/game/monster/shalrath/shalrath.o \ + src/game/monster/shambler/shambler.o \ src/game/monster/soldier/soldier.o \ src/game/monster/stalker/stalker.o \ src/game/monster/supertank/supertank.o \ - src/game/monster/shambler/shambler.o \ src/game/monster/tank/tank.o \ + src/game/monster/tarbaby/tarbaby.o \ src/game/monster/turret/turret.o \ src/game/monster/widow/widow2.o \ src/game/monster/widow/widow.o \ + src/game/monster/wizard/wizard.o \ + src/game/monster/zombie/zombie.o \ src/game/player/chase.o \ src/game/player/client.o \ src/game/player/hud.o \ diff --git a/doc/100_tested_maps.md b/doc/100_tested_maps.md index 148ab0eb..66c29e75 100644 --- a/doc/100_tested_maps.md +++ b/doc/100_tested_maps.md @@ -3,7 +3,6 @@ * OK - no known issues, * ML - model light issues, * WL - wall light issues, - * MD5 - md5 model load, * G - texture glitches, * B - can't load. @@ -14,8 +13,8 @@ Notes: | map | gl1.4 | gl3/gles3 | gl4.6 | vk | soft | | ------------------------------ | ------ | --------- | ------ | ------ | ----------- | - | badlands.bsp | MD5 | N/A | N/A | MD5 | N/A | - | base1.bsp | MD5 | WL/ML/MD5 | N/A | MD5 | WL/ML/MD5/G | + | badlands.bsp | OK | N/A | N/A | OK | N/A | + | base1.bsp | OK | OK | N/A | OK | WL/ML/G | | base2.bsp | N/A | N/A | N/A | N/A | N/A | | base3.bsp | N/A | N/A | N/A | N/A | N/A | | base64.bsp | N/A | N/A | N/A | N/A | N/A | @@ -61,35 +60,35 @@ Notes: | jail4.bsp | N/A | N/A | N/A | N/A | N/A | | jail5.bsp | N/A | N/A | N/A | N/A | N/A | | lab.bsp | N/A | N/A | N/A | N/A | N/A | - | mgdm1.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu1m1.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu1m2.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu1m3.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu1m4.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu1m5.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu1trial.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu2m1.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu2m2.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu2m3.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu3m1.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu3m2.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu3m3.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu3m4.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu3secret.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu4m1.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu4m2.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu4m3.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu4trial.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu5m1.bsp | MD5 | N/A | N/A | MD5 | N/A | + | mgdm1.bsp | OK | N/A | N/A | OK | N/A | + | mgu1m1.bsp | OK | N/A | N/A | OK | N/A | + | mgu1m2.bsp | OK | N/A | N/A | OK | N/A | + | mgu1m3.bsp | OK | N/A | N/A | OK | N/A | + | mgu1m4.bsp | OK | N/A | N/A | OK | N/A | + | mgu1m5.bsp | OK | N/A | N/A | OK | N/A | + | mgu1trial.bsp | OK | N/A | N/A | OK | N/A | + | mgu2m1.bsp | OK | N/A | N/A | OK | N/A | + | mgu2m2.bsp | OK | N/A | N/A | OK | N/A | + | mgu2m3.bsp | OK | N/A | N/A | OK | N/A | + | mgu3m1.bsp | OK | N/A | N/A | OK | N/A | + | mgu3m2.bsp | OK | N/A | N/A | OK | N/A | + | mgu3m3.bsp | OK | N/A | N/A | OK | N/A | + | mgu3m4.bsp | OK | N/A | N/A | OK | N/A | + | mgu3secret.bsp | OK | N/A | N/A | OK | N/A | + | mgu4m1.bsp | OK | N/A | N/A | OK | N/A | + | mgu4m2.bsp | OK | N/A | N/A | OK | N/A | + | mgu4m3.bsp | OK | N/A | N/A | OK | N/A | + | mgu4trial.bsp | OK | N/A | N/A | OK | N/A | + | mgu5m1.bsp | OK | N/A | N/A | OK | N/A | | mgu5m2.bsp | B | N/A | N/A | B | N/A | - | mgu5m3.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu5trial.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu6m1.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu6m2.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu6m3.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mgu6trial.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mguboss.bsp | MD5 | N/A | N/A | MD5 | N/A | - | mguhub.bsp | MD5 | ML/MD5 | ML/MD5 | MD5 | ML/MD5 | + | mgu5m3.bsp | OK | N/A | N/A | OK | N/A | + | mgu5trial.bsp | OK | N/A | N/A | OK | N/A | + | mgu6m1.bsp | OK | N/A | N/A | OK | N/A | + | mgu6m2.bsp | OK | N/A | N/A | OK | N/A | + | mgu6m3.bsp | OK | N/A | N/A | OK | N/A | + | mgu6trial.bsp | OK | N/A | N/A | OK | N/A | + | mguboss.bsp | OK | N/A | N/A | OK | N/A | + | mguhub.bsp | OK | OK | ML | OK | ML | | mine1.bsp | N/A | N/A | N/A | N/A | N/A | | mine2.bsp | N/A | N/A | N/A | N/A | N/A | | mine3.bsp | N/A | N/A | N/A | N/A | N/A | @@ -236,3 +235,114 @@ Notes: | xship.bsp | N/A | N/A | N/A | N/A | N/A | | xswamp.bsp | N/A | N/A | N/A | N/A | N/A | | xware.bsp | N/A | N/A | N/A | N/A | N/A | + +Additionally supported models: + + | source Quake 1 Path | destination Quake 2 Path | md5 hash | + | -------------------------- | --------------------------------- | -------------------------------- | + | progs/progs/soldier.mdl | models/monsters/army/tris.mdl | 5b6c30a984872b4273dd5861412d35c5 | + | progs/demon.mdl | models/monsters/demon/tris.mdl | 4c73786e7cfb2083ca38cbc983cd6c4b | + | progs/dog.mdl | models/monsters/dog/tris.mdl | e727fbc39acc652f812972612ce37565 | + | progs/enforcer.mdl | models/monsters/enforcer/tris.mdl | 136c265f96d6077ee3312c52e134529f | + | progs/fish.mdl | models/monsters/fish/tris.mdl | d770d6ef92ae8b372926e6c3d49e8716 | + | progs/hknight.mdl | models/monsters/hknight/tris.mdl | ed20e30be6fdb83efbaa6d0b23671a49 | + | progs/knight.mdl | models/monsters/knight/tris.mdl | 5328915db5c53e85cf75d46e7b747fb9 | + | progs/ogre.mdl | models/monsters/ogre/tris.mdl | fbb592ca3788a576dd2f31fcf8c80fab | + | progs/shalrath.mdl | models/monsters/shalrath/tris.mdl | dac8f6077b0d2bf970573d2d2c22529f | + | progs/shambler.mdl | models/monsters/shambler/tris.mdl | 9b09375a0f614dc4081e363cc34f1185 | + | progs/tarbaby.mdl | models/monsters/tarbaby/tris.mdl | 2bfc45593a43a0191982e3cfdc112dc5 | + | progs/wizard.mdl | models/monsters/wizard/tris.mdl | bf60986594f045e60e8aa6339d553ee7 | + | progs/zombie.mdl | models/monsters/zombie/tris.mdl | a923b1d03b9d237dd5ead9bd56acc900 | + | progs/k_spike.mdl | models/proj/fireball/tris.mdl | da95b49a695b34c2c3516a8d789c6b20 | + | progs/v_spike.mdl | models/proj/pod/tris.mdl | 2bdc0b264b9fd3443c8eee816305728f | + | progs/w_spike.mdl | models/proj/spit/tris.mdl | 8cf9245df2164e8062b01a220b508d6b | + | sound/army/death1.wav | sound/army/death1.wav | fe25952af40b536c3bb67bfca58062eb | + | sound/army/idle.wav | sound/army/idle.wav | 4cdfbdda8fb5f40b125c7bcddb6e8914 | + | sound/army/pain1.wav | sound/army/pain1.wav | 54d3b05fdcecf7480034858f2b22b06c | + | sound/army/pain2.wav | sound/army/pain2.wav | e2bbc9d3405b9b9fdae76d2fc298fc2f | + | sound/army/sattck1.wav | sound/army/sattck1.wav | b76ac35f900f280a7a7996da7e404362 | + | sound/army/sight1.wav | sound/army/sight1.wav | e2a39533250ddd1b08053d5c4ebf7fd0 | + | sound/demon/ddeath.wav | sound/demon/ddeath.wav | 62a48dcd405ca55c9ce18497e36faa0e | + | sound/demon/dhit2.wav | sound/demon/dhit2.wav | 9e741696e4d0d66e30e718fc70ec186e | + | sound/demon/djump.wav | sound/demon/djump.wav | 791ac9d6b6593808316145443cb7e7a0 | + | sound/demon/dland2.wav | sound/demon/dland2.wav | db14c7b01838f826b7a712075f9026fd | + | sound/demon/dpain1.wav | sound/demon/dpain1.wav | 5e6c485878393c9bebb0d0e6659bc479 | + | sound/demon/idle1.wav | sound/demon/idle1.wav | 7a83f8caf3d5b1172a7dc5afdc942988 | + | sound/demon/sight2.wav | sound/demon/sight2.wav | 65171c355c22a5069520b0881677ae3c | + | sound/dog/dattack1.wav | sound/dog/dattack1.wav | 0c47c9d4aaae0bf3159a288b674f4a35 | + | sound/dog/ddeath.wav | sound/dog/ddeath.wav | b0e7760b1d7286a028ff9773f6802958 | + | sound/dog/dpain1.wav | sound/dog/dpain1.wav | 28e5ab93b41e13e2916433283a5d1a46 | + | sound/dog/dsight.wav | sound/dog/dsight.wav | 0edc290765bac1fb4fe03ca55bc7c225 | + | sound/dog/idle.wav | sound/dog/idle.wav | 42bd6026ff32bd94523ad9f8fe8362cc | + | sound/enforcer/death1.wav | sound/enforcer/death1.wav | f38d7a235e13ef8918aac0c70437320d | + | sound/enforcer/enfire.wav | sound/enforcer/enfire.wav | b080a6a53f138bef9fc4403fb9373a24 | + | sound/enforcer/enfstop.wav | sound/enforcer/enfstop.wav | 0bc39c3c88187fb37d20ef21300e7b22 | + | sound/enforcer/idle1.wav | sound/enforcer/idle1.wav | d0435763860fe54e938ad25bb1780f9e | + | sound/enforcer/pain1.wav | sound/enforcer/pain1.wav | d52bc02afe624924684b25295edaa040 | + | sound/enforcer/pain2.wav | sound/enforcer/pain2.wav | f6b0ad6485d93f5c6d7d61b847d06877 | + | sound/enforcer/sight1.wav | sound/enforcer/sight1.wav | 9e9876444ba92ed18bfce4cec3a2ff12 | + | sound/enforcer/sight2.wav | sound/enforcer/sight2.wav | 815dd4f6a890b0a35dc466005df74850 | + | sound/enforcer/sight3.wav | sound/enforcer/sight3.wav | f8c8d19905b24d4adb6760a1b3762f3b | + | sound/enforcer/sight4.wav | sound/enforcer/sight4.wav | 04e40eb925290bc56520de326df6b220 | + | sound/fish/bite.wav | sound/fish/bite.wav | 7c56712615e2a2c3de4fe0e7e35cba05 | + | sound/fish/death.wav | sound/fish/death.wav | 8d6152ee55507430a8c2eb276c4aa8ac | + | sound/fish/idle.wav | sound/fish/idle.wav | 54a02731b85eb6f8b1a8ecce09771d20 | + | sound/hknight/attack1.wav | sound/hknight/attack1.wav | 695e9d890a085addf1a607aa79137e8e | + | sound/hknight/death1.wav | sound/hknight/death1.wav | 2d68c3c86632027676b823fcff3af08c | + | sound/hknight/grunt.wav | sound/hknight/grunt.wav | 122f3d4623e0146732aa0e4deb0fe326 | + | sound/hknight/hit.wav | sound/hknight/hit.wav | fece24e2548f1d769e8fce39a5c87d01 | + | sound/hknight/idle.wav | sound/hknight/idle.wav | e9ca23c4853472750d1f56e52a3d227b | + | sound/hknight/pain1.wav | sound/hknight/pain1.wav | 52c20eb6f5b5146ece6b0ac02f423341 | + | sound/hknight/sight1.wav | sound/hknight/sight1.wav | 786d28ec653a0d512d078b32eb8cb58b | + | sound/hknight/slash1.wav | sound/hknight/slash1.wav | 83e64bb90cff2a4f9764dd53489b9d7d | + | sound/knight/idle.wav | sound/knight/idle.wav | 1b5c3981bee078318af346d8fe8090b9 | + | sound/knight/kdeath.wav | sound/knight/kdeath.wav | 11a96f48a8f2433c23beae299c8fb96e | + | sound/knight/khurt.wav | sound/knight/khurt.wav | 32c9f48dd4a6a87752aedf56fe8de668 | + | sound/knight/ksight.wav | sound/knight/ksight.wav | eb75b4af348c88e84d8c87c19d5976fa | + | sound/knight/sword1.wav | sound/knight/sword1.wav | 93045b5f3178413dc6b01ec2869d1f73 | + | sound/knight/sword2.wav | sound/knight/sword2.wav | 82d1a7c263cd3df7b060dee2f7f8b1fd | + | sound/ogre/ogdrag.wav | sound/ogre/ogdrag.wav | 658587dc89aaefae5ca3f058f7ff4227 | + | sound/ogre/ogdth.wav | sound/ogre/ogdth.wav | de98e7bb9e70586edddd3308cfded3db | + | sound/ogre/ogidle2.wav | sound/ogre/ogidle2.wav | 196ae9c33a4311160e1d5f3da878ab09 | + | sound/ogre/ogidle.wav | sound/ogre/ogidle.wav | 177c829840a87c885bbc8951e7ce962e | + | sound/ogre/ogpain1.wav | sound/ogre/ogpain1.wav | ac6d133d7720c12df49813fe10e683b5 | + | sound/ogre/ogsawatk.wav | sound/ogre/ogsawatk.wav | 7257bdfd014bb61d778b8f88cb65d560 | + | sound/ogre/ogwake.wav | sound/ogre/ogwake.wav | 3296459e495c4c12b31179d4eeffac19 | + | sound/shalrath/attack2.wav | sound/shalrath/attack2.wav | 777fbda2f81350e45920ea1c36d318e1 | + | sound/shalrath/attack.wav | sound/shalrath/attack.wav | 8814a72b399be619d14223235f78f294 | + | sound/shalrath/death.wav | sound/shalrath/death.wav | 771844c5cfb5a42e82e221a63f101ac7 | + | sound/shalrath/idle.wav | sound/shalrath/idle.wav | 1a45f12579f9cdd27152332d5f816048 | + | sound/shalrath/pain.wav | sound/shalrath/pain.wav | 6ba007b79c50d7d5347f1a29fb315422 | + | sound/shalrath/sight.wav | sound/shalrath/sight.wav | 3d3c2001cc976efc67af1552427eedd3 | + | sound/shambler/melee1.wav | sound/shambler/melee1.wav | 77fe6240973a204b757a427ebf66bcfd | + | sound/shambler/melee2.wav | sound/shambler/melee2.wav | 3be31638d769e3d690c92311dfafdeac | + | sound/shambler/sattck1.wav | sound/shambler/sattck1.wav | ec8c3f79ea42d09154cb8975ada1b21c | + | sound/shambler/sboom.wav | sound/shambler/sboom.wav | 9834601a645d7d1f62001b2a314ec18f | + | sound/shambler/sdeath.wav | sound/shambler/sdeath.wav | e0e62d229a985a6e39218c6488599059 | + | sound/shambler/shurt2.wav | sound/shambler/shurt2.wav | 1e87631ede95e061a75f9c31629ac0b8 | + | sound/shambler/sidle.wav | sound/shambler/sidle.wav | 368a240e6c3e877793352a79c1828386 | + | sound/shambler/smack.wav | sound/shambler/smack.wav | bd8c634c9894348360fec7b7419d1649 | + | sound/shambler/ssight.wav | sound/shambler/ssight.wav | 657107577460d5acf3157dec97e07a89 | + | sound/tarbaby/death1.wav | sound/tarbaby/death1.wav | 53f8c73de11c018086ba19ed036833d3 | + | sound/tarbaby/hit1.wav | sound/tarbaby/hit1.wav | 42c5a1edd02421bf6df7ddc3e395c4f8 | + | sound/tarbaby/land1.wav | sound/tarbaby/land1.wav | 5a1585ab22368a48827db9b7d3763b58 | + | sound/tarbaby/sight1.wav | sound/tarbaby/sight1.wav | df4dd7ec91e094b5c2235be3f5353e4a | + | sound/wizard/hit.wav | sound/wizard/hit.wav | 6598d669334df977f1f97b95288edf11 | + | sound/wizard/wattack.wav | sound/wizard/wattack.wav | b3568a47439f81779d40335e76f5bc2d | + | sound/wizard/wdeath.wav | sound/wizard/wdeath.wav | 99d9c71343bc23222abb92119d404400 | + | sound/wizard/widle1.wav | sound/wizard/widle1.wav | b22b1dd9f66879b3447d36ab584316c7 | + | sound/wizard/widle2.wav | sound/wizard/widle2.wav | 7178fd83df227360564adef01bed92c6 | + | sound/wizard/wpain.wav | sound/wizard/wpain.wav | bd7e59ab7d7b835f9ed8ab51950914de | + | sound/wizard/wsight.wav | sound/wizard/wsight.wav | df5949057c750528917c6cb32b7fd9fd | + | sound/zombie/idle_w2.wav | sound/zombie/idle_w2.wav | d2bb59b9d7ac71097c07123a23525641 | + | sound/zombie/z_fall.wav | sound/zombie/z_fall.wav | 6968318b2d196c6d54bc707d8a390547 | + | sound/zombie/z_gib.wav | sound/zombie/z_gib.wav | 199dda66ade8d6f0ef4897e4d7608c0d | + | sound/zombie/z_hit.wav | sound/zombie/z_hit.wav | 6c66ab3e6b149bf35956a4bbc0057acb | + | sound/zombie/z_idle1.wav | sound/zombie/z_idle1.wav | 21088a7b38b1124d7ec72e58d5ab93a6 | + | sound/zombie/z_idle.wav | sound/zombie/z_idle.wav | e5e570e38c4405111004190a79f0e925 | + | sound/zombie/z_miss.wav | sound/zombie/z_miss.wav | 96fad96a8c3bc6f7bcc5da6c82678da2 | + | sound/zombie/z_pain1.wav | sound/zombie/z_pain1.wav | fcd83b89a94b0cadbe1361a4df080ec0 | + | sound/zombie/z_pain.wav | sound/zombie/z_pain.wav | 56637968b8309bd2f825153330bbdfc0 | + | sound/zombie/z_shot1.wav | sound/zombie/z_shot1.wav | 561afb69b7851923a8fb3b54e3e13c96 | + +Look to [infighter](https://github.com/decino/q2-infighter) for more info. diff --git a/src/client/refresh/files/models.c b/src/client/refresh/files/models.c index a0a81f9f..34f211f3 100644 --- a/src/client/refresh/files/models.c +++ b/src/client/refresh/files/models.c @@ -1848,13 +1848,13 @@ Mod_LoadLimits(const char *mod_name, void *extradata, modtype_t type) if (pheader->skinheight > MAX_LBM_HEIGHT) { - R_Printf(PRINT_ALL, "%s: model %s has a skin taller %d than %d", + R_Printf(PRINT_ALL, "%s: model %s has a skin taller %d than %d\n", __func__, mod_name, pheader->skinheight, MAX_LBM_HEIGHT); } if (pheader->skinwidth > MAX_LBM_HEIGHT) { - R_Printf(PRINT_ALL, "%s: model %s has a skin wider %d than %d", + R_Printf(PRINT_ALL, "%s: model %s has a skin wider %d than %d\n", __func__, mod_name, pheader->skinwidth, MAX_LBM_HEIGHT); } diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index 63a4cad2..42f01089 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -155,13 +155,7 @@ void SP_monster_boss2(edict_t *self); void SP_monster_jorg(edict_t *self); void SP_monster_makron(edict_t *self); void SP_monster_boss3_stand(edict_t *self); - void SP_monster_commander_body(edict_t *self); - -void SP_turret_breach(edict_t *self); -void SP_turret_base(edict_t *self); -void SP_turret_driver(edict_t *self); - void SP_monster_shambler(edict_t *self); void SP_monster_soldier_hypergun(edict_t *self); void SP_monster_soldier_lasergun(edict_t *self); @@ -171,6 +165,24 @@ void SP_monster_gekk(edict_t *self); void SP_monster_chick_heat(edict_t *self); void SP_monster_gladb(edict_t *self); void SP_monster_boss5(edict_t *self); +void SP_monster_army(edict_t *self); +void SP_monster_demon(edict_t *self); +void SP_monster_dog(edict_t *self); +void SP_monster_enforcer(edict_t *self); +void SP_monster_fish(edict_t *self); +void SP_monster_hknight(edict_t *self); +void SP_monster_knight(edict_t *self); +void SP_monster_ogre(edict_t *self); +void SP_monster_shalrath(edict_t *self); +void SP_monster_tarbaby(edict_t *self); +void SP_monster_wizard(edict_t *self); +void SP_monster_zombie(edict_t *self); + +void SP_turret_breach(edict_t *self); +void SP_turret_base(edict_t *self); +void SP_turret_driver(edict_t *self); + + void SP_rotating_light(edict_t *self); void SP_object_repair(edict_t *self); void SP_misc_crashviper(edict_t *ent); @@ -362,6 +374,18 @@ static spawn_t spawns[] = { {"monster_chick_heat", SP_monster_chick_heat}, {"monster_gladb", SP_monster_gladb}, {"monster_boss5", SP_monster_boss5}, + {"monster_army", SP_monster_army}, + {"monster_demon", SP_monster_demon}, + {"monster_dog", SP_monster_dog}, + {"monster_enforcer", SP_monster_enforcer}, + {"monster_fish", SP_monster_fish}, + {"monster_hknight", SP_monster_hknight}, + {"monster_knight", SP_monster_knight}, + {"monster_ogre", SP_monster_ogre}, + {"monster_shalrath", SP_monster_shalrath}, + {"monster_tarbaby", SP_monster_tarbaby}, + {"monster_wizard", SP_monster_wizard}, + {"monster_zombie", SP_monster_zombie}, {"turret_breach", SP_turret_breach}, {"turret_base", SP_turret_base}, diff --git a/src/game/monster/m_army.c b/src/game/monster/army/army.c similarity index 62% rename from src/game/monster/m_army.c rename to src/game/monster/army/army.c index d86ad760..93dc017d 100644 --- a/src/game/monster/m_army.c +++ b/src/game/monster/army/army.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_army.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_death; static int sound_search; @@ -29,17 +29,17 @@ static int sound_attack; static int sound_sight; // Stand -mframe_t army_frames_stand [] = +static mframe_t army_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, }; mmove_t army_move_stand = {0, 7, army_frames_stand, NULL}; @@ -49,17 +49,17 @@ void army_stand(edict_t *self) } // Run -mframe_t army_frames_run [] = +static mframe_t army_frames_run [] = { - ai_run, 11, NULL, - ai_run, 15, NULL, - ai_run, 10, NULL, - ai_run, 10, NULL, + {ai_run, 11, NULL}, + {ai_run, 15, NULL}, + {ai_run, 10, NULL}, + {ai_run, 10, NULL}, - ai_run, 8, NULL, - ai_run, 15, NULL, - ai_run, 10, NULL, - ai_run, 8, NULL + {ai_run, 8, NULL}, + {ai_run, 15, NULL}, + {ai_run, 10, NULL}, + {ai_run, 8, NULL} }; mmove_t army_move_run = {73, 80, army_frames_run, NULL}; @@ -85,19 +85,19 @@ void FireArmy(edict_t *self) } // Attack -mframe_t army_frames_attack [] = +static mframe_t army_frames_attack [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, FireArmy, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, FireArmy}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL + {ai_charge, 0, NULL} }; mmove_t army_move_attack = {81, 89, army_frames_attack, army_run}; @@ -107,7 +107,7 @@ void army_attack(edict_t *self) } // Sight -void army_sight(edict_t *self) +void army_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } @@ -119,69 +119,70 @@ void army_search(edict_t *self) } // Pain (1) -mframe_t army_frames_pain1 [] = +static mframe_t army_frames_pain1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t army_move_pain1 = {40, 45, army_frames_pain1, army_run}; // Pain (2) -mframe_t army_frames_pain2 [] = +static mframe_t army_frames_pain2 [] = { - ai_move, 0, NULL, - ai_move, 13, NULL, - ai_move, 9, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 13, NULL}, + {ai_move, 9, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 2, NULL, - ai_move, 0, NULL + {ai_move, 2, NULL}, + {ai_move, 0, NULL} }; mmove_t army_move_pain2 = {46, 59, army_frames_pain2, army_run}; // Pain (3) -mframe_t army_frames_pain3 [] = +static mframe_t army_frames_pain3 [] = { - ai_move, 0, NULL, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 1, NULL, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 1, NULL, + {ai_move, 1, NULL}, + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 1, NULL}, - ai_move, 4, NULL, - ai_move, 3, NULL, - ai_move, 6, NULL, - ai_move, 8, NULL, + {ai_move, 4, NULL}, + {ai_move, 3, NULL}, + {ai_move, 6, NULL}, + {ai_move, 8, NULL}, - ai_move, 2, NULL + {ai_move, 2, NULL} }; mmove_t army_move_pain3 = {60, 72, army_frames_pain3, army_run}; -void army_pain(edict_t *self) +void army_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { float r; - + // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; if (level.time < self->pain_debounce_time) return; @@ -218,39 +219,39 @@ void army_dead(edict_t *self) } // Death (1) -mframe_t army_frames_death1 [] = +static mframe_t army_frames_death1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t army_move_death1 = {8, 17, army_frames_death1, army_dead}; // Death (2) -mframe_t army_frames_death2 [] = +static mframe_t army_frames_death2 [] = { - ai_move, 0, NULL, - ai_move, -5, NULL, - ai_move, -4, NULL, - ai_move, -13, NULL, + {ai_move, 0, NULL}, + {ai_move, -5, NULL}, + {ai_move, -4, NULL}, + {ai_move, -13, NULL}, - ai_move, -3, NULL, - ai_move, -4, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, -3, NULL}, + {ai_move, -4, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t army_move_death2 = {18, 28, army_frames_death2, army_dead}; @@ -283,22 +284,19 @@ void army_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, self->monsterinfo.currentmove = &army_move_death2; } -void SP_monster_q1_army(edict_t *self) +void SP_monster_army(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/army/tris.md2"); - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, 40); + self->s.modelindex = gi.modelindex("models/monsters/army/tris.md2"); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, 40); self->health = 30; - self->monster_name = "Grunt"; - if (self->solid == SOLID_NOT) - return; - sound_death = gi.soundindex("quake1/army/death1.wav"); - sound_search = gi.soundindex("quake1/army/idle.wav"); - sound_pain1 = gi.soundindex("quake1/army/pain1.wav"); - sound_pain2 = gi.soundindex("quake1/army/pain2.wav"); - sound_attack = gi.soundindex("quake1/army/sattck1.wav"); - sound_sight = gi.soundindex("quake1/army/sight1.wav"); + sound_death = gi.soundindex("army/death1.wav"); + sound_search = gi.soundindex("army/idle.wav"); + sound_pain1 = gi.soundindex("army/pain1.wav"); + sound_pain2 = gi.soundindex("army/pain2.wav"); + sound_attack = gi.soundindex("army/sattck1.wav"); + sound_sight = gi.soundindex("army/sight1.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_demon.c b/src/game/monster/demon/demon.c similarity index 72% rename from src/game/monster/m_demon.c rename to src/game/monster/demon/demon.c index e4a6c4de..c3bf89d9 100644 --- a/src/game/monster/m_demon.c +++ b/src/game/monster/demon/demon.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_demon.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_death; static int sound_hit; @@ -30,24 +30,24 @@ static int sound_sight; static int sound_search; // Stand -mframe_t demon_frames_stand [] = +static mframe_t demon_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, }; mmove_t demon_move_stand = {0, 12, demon_frames_stand, NULL}; @@ -57,15 +57,15 @@ void demon_stand(edict_t *self) } // Run -mframe_t demon_frames_run [] = +static mframe_t demon_frames_run [] = { - ai_run, 20, NULL, - ai_run, 15, NULL, - ai_run, 36, NULL, - ai_run, 20, NULL, + {ai_run, 20, NULL}, + {ai_run, 15, NULL}, + {ai_run, 36, NULL}, + {ai_run, 20, NULL}, - ai_run, 15, NULL, - ai_run, 36, NULL + {ai_run, 15, NULL}, + {ai_run, 36, NULL} }; mmove_t demon_move_run = {21, 26, demon_frames_run, NULL}; @@ -85,14 +85,14 @@ qboolean CheckDemonJump(edict_t *self) return false; if (self->s.origin[2] + self->mins[2] < self->enemy->s.origin[2] + self->enemy->mins[2] + 0.25 * self->enemy->size[2]) return false; - + VectorSubtract(self->enemy->s.origin, self->s.origin, dir); dir[2] = 0; distance = VectorLength(dir); - + if (distance < 100) return false; - + if (distance > 200) { if (random() < 0.9) @@ -105,7 +105,7 @@ void DemonJumpTouch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t * { if (self->health < 1) return; - if (other->takedamage && other->monster_team != self->monster_team) + if (other->takedamage) { if (VectorLength(self->velocity) > 400) { @@ -148,22 +148,22 @@ void demon_roar(edict_t *self) } // Attack -mframe_t demon_frames_jump [] = +static mframe_t demon_frames_jump [] = { - ai_charge, 0, demon_roar, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, DemonJump, + {ai_charge, 0, demon_roar}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, DemonJump}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t demon_move_jump = {27, 38, demon_frames_jump, demon_run}; @@ -192,26 +192,26 @@ void DemonMelee(edict_t *self) } // Melee -mframe_t demon_frames_melee [] = +static mframe_t demon_frames_melee [] = { - ai_charge, 4, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 1, NULL, + {ai_charge, 4, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 1, NULL}, - ai_charge, 14, DemonMelee, - ai_charge, 1, NULL, - ai_charge, 6, NULL, - ai_charge, 8, NULL, + {ai_charge, 14, DemonMelee}, + {ai_charge, 1, NULL}, + {ai_charge, 6, NULL}, + {ai_charge, 8, NULL}, - ai_charge, 4, NULL, - ai_charge, 2, NULL, - ai_charge, 12, DemonMelee, - ai_charge, 5, NULL, + {ai_charge, 4, NULL}, + {ai_charge, 2, NULL}, + {ai_charge, 12, DemonMelee}, + {ai_charge, 5, NULL}, - ai_charge, 8, NULL, - ai_charge, 4, NULL, - ai_charge, 4, NULL + {ai_charge, 8, NULL}, + {ai_charge, 4, NULL}, + {ai_charge, 4, NULL} }; mmove_t demon_move_melee = {54, 68, demon_frames_melee, demon_run}; @@ -221,22 +221,22 @@ void demon_melee(edict_t *self) } // Pain -mframe_t demon_frames_pain [] = +static mframe_t demon_frames_pain [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t demon_move_pain = {39, 44, demon_frames_pain, demon_run}; void demon_pain(edict_t *self, edict_t *other, float kick, int damage) { // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; if (self->touch == DemonJumpTouch) return; @@ -261,19 +261,19 @@ void demon_dead(edict_t *self) } // Death -mframe_t demon_frames_die [] = +static mframe_t demon_frames_die [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t demon_move_die = {45, 53, demon_frames_die, demon_dead}; @@ -304,7 +304,7 @@ void demon_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, } // Sight -void demon_sight(edict_t *self) +void demon_sight(edict_t *self, edict_t *other /* unused */) { gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } @@ -315,23 +315,20 @@ void demon_search(edict_t *self) gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0); } -void SP_monster_q1_demon(edict_t *self) +void SP_monster_demon(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/demon/tris.md2"); + self->s.modelindex = gi.modelindex("models/monsters/demon/tris.md2"); VectorSet(self->mins, -32, -32, -24); VectorSet(self->maxs, 32, 32, 64); self->health = 300; - self->monster_name = "Fiend"; - if (self->solid == SOLID_NOT) - return; - sound_death = gi.soundindex("quake1/demon/ddeath.wav"); - sound_hit = gi.soundindex("quake1/demon/dhit2.wav"); - sound_jump = gi.soundindex("quake1/demon/djump.wav"); - sound_land = gi.soundindex("quake1/demon/dland2.wav"); - sound_pain = gi.soundindex("quake1/demon/dpain1.wav"); - sound_search = gi.soundindex("quake1/demon/idle1.wav"); - sound_sight = gi.soundindex("quake1/demon/sight2.wav"); + sound_death = gi.soundindex("demon/ddeath.wav"); + sound_hit = gi.soundindex("demon/dhit2.wav"); + sound_jump = gi.soundindex("demon/djump.wav"); + sound_land = gi.soundindex("demon/dland2.wav"); + sound_pain = gi.soundindex("demon/dpain1.wav"); + sound_search = gi.soundindex("demon/idle1.wav"); + sound_sight = gi.soundindex("demon/sight2.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_dog.c b/src/game/monster/dog/dog.c similarity index 64% rename from src/game/monster/m_dog.c rename to src/game/monster/dog/dog.c index 97db54e1..0c071bdf 100644 --- a/src/game/monster/m_dog.c +++ b/src/game/monster/dog/dog.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_dog.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_melee; static int sound_death; @@ -30,19 +30,19 @@ static int sound_search; void dog_leap(edict_t *self); // Stand -mframe_t dog_frames_stand [] = +static mframe_t dog_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, }; mmove_t dog_move_stand = {69, 77, dog_frames_stand, NULL}; @@ -52,35 +52,35 @@ void dog_stand(edict_t *self) } // Run -mframe_t dog_frames_run [] = +static mframe_t dog_frames_run [] = { - ai_run, 16, NULL, - ai_run, 32, NULL, - ai_run, 32, NULL, - ai_run, 20, NULL, - ai_run, 64, NULL, + {ai_run, 16, NULL}, + {ai_run, 32, NULL}, + {ai_run, 32, NULL}, + {ai_run, 20, NULL}, + {ai_run, 64, NULL}, - ai_run, 32, NULL, - ai_run, 16, NULL, - ai_run, 32, NULL, - ai_run, 32, NULL, + {ai_run, 32, NULL}, + {ai_run, 16, NULL}, + {ai_run, 32, NULL}, + {ai_run, 32, NULL}, - ai_run, 20, NULL, - ai_run, 64, NULL, - ai_run, 32, dog_leap + {ai_run, 20, NULL}, + {ai_run, 64, NULL}, + {ai_run, 32, dog_leap} }; mmove_t dog_move_run = {48, 59, dog_frames_run, NULL}; void dog_run(edict_t *self) { self->monsterinfo.currentmove = &dog_move_run; -} +} void DogLeapTouch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) { if (self->health < 1) return; - if (other->takedamage && other->monster_team != self->monster_team) + if (other->takedamage) { if (VectorLength(self->velocity) > 300) { @@ -116,25 +116,24 @@ void DogLeap(edict_t *self) } // Leap -mframe_t dog_frames_leap [] = +static mframe_t dog_frames_leap [] = { - ai_charge, 0, NULL, - ai_charge, 0, DogLeap, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, DogLeap}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t dog_move_leap = {60, 68, dog_frames_leap, dog_run}; void dog_leap(edict_t *self) { - //if (self->enemy && CheckDistance(self, self->enemy) < (MELEE_DISTANCE * 4)) self->monsterinfo.currentmove = &dog_move_leap; } @@ -158,17 +157,17 @@ void DogBite(edict_t *self) } // Melee -mframe_t dog_frames_melee [] = +static mframe_t dog_frames_melee [] = { - ai_charge, 10, NULL, - ai_charge, 10, NULL, - ai_charge, 10, NULL, - ai_charge, 10, DogBite, + {ai_charge, 10, NULL}, + {ai_charge, 10, NULL}, + {ai_charge, 10, NULL}, + {ai_charge, 10, DogBite}, - ai_charge, 10, NULL, - ai_charge, 10, NULL, - ai_charge, 10, NULL, - ai_charge, 10, NULL + {ai_charge, 10, NULL}, + {ai_charge, 10, NULL}, + {ai_charge, 10, NULL}, + {ai_charge, 10, NULL} }; mmove_t dog_move_melee = {0, 7, dog_frames_melee, dog_run}; @@ -178,7 +177,7 @@ void dog_melee(edict_t *self) } // Sight -void dog_sight(edict_t *self) +void dog_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } @@ -190,47 +189,48 @@ void dog_search(edict_t *self) } // Pain (1) -mframe_t dog_frames_pain1 [] = +static mframe_t dog_frames_pain1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t dog_move_pain1 = {26, 31, dog_frames_pain1, dog_run}; // Pain (2) -mframe_t dog_frames_pain2 [] = +static mframe_t dog_frames_pain2 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, -4, NULL, - ai_move, -12, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, -4, NULL}, + {ai_move, -12, NULL}, - ai_move, -12, NULL, - ai_move, -2, NULL, - ai_move, 0, NULL, - ai_move, -4, NULL, + {ai_move, -12, NULL}, + {ai_move, -2, NULL}, + {ai_move, 0, NULL}, + {ai_move, -4, NULL}, - ai_move, 0, NULL, - ai_move, -10, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, -10, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t dog_move_pain2 = {32, 47, dog_frames_pain2, dog_run}; -void dog_pain(edict_t *self) +void dog_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; if (random() > 0.5) self->monsterinfo.currentmove = &dog_move_pain1; @@ -250,36 +250,36 @@ void dog_dead(edict_t *self) } // Death (1) -mframe_t dog_frames_die1 [] = +static mframe_t dog_frames_die1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t dog_move_die1 = {8, 16, dog_frames_die1, dog_dead}; // Death (2) -mframe_t dog_frames_die2 [] = +static mframe_t dog_frames_die2 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t dog_move_die2 = {17, 25, dog_frames_die2, dog_dead}; @@ -312,21 +312,18 @@ void dog_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, v self->monsterinfo.currentmove = &dog_move_die2; } -void SP_monster_q1_dog(edict_t *self) +void SP_monster_dog(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/dog/tris.md2"); - VectorSet (self->mins, -32, -32, -24); - VectorSet (self->maxs, 32, 32, 40); + self->s.modelindex = gi.modelindex("models/monsters/dog/tris.md2"); + VectorSet(self->mins, -32, -32, -24); + VectorSet(self->maxs, 32, 32, 40); self->health = 25; - self->monster_name = "Rottweiler"; - if (self->solid == SOLID_NOT) - return; - sound_melee = gi.soundindex("quake1/dog/dattack1.wav"); - sound_death = gi.soundindex("quake1/dog/ddeath.wav"); - sound_pain = gi.soundindex("quake1/dog/dpain1.wav"); - sound_sight = gi.soundindex("quake1/dog/dsight.wav"); - sound_search = gi.soundindex("quake1/dog/idle.wav"); + sound_melee = gi.soundindex("dog/dattack1.wav"); + sound_death = gi.soundindex("dog/ddeath.wav"); + sound_pain = gi.soundindex("dog/dpain1.wav"); + sound_sight = gi.soundindex("dog/dsight.wav"); + sound_search = gi.soundindex("dog/idle.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_enforcer.c b/src/game/monster/enforcer/enforcer.c similarity index 68% rename from src/game/monster/m_enforcer.c rename to src/game/monster/enforcer/enforcer.c index 96e31103..369a34ec 100644 --- a/src/game/monster/m_enforcer.c +++ b/src/game/monster/enforcer/enforcer.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_enforcer.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_death; static int sound_hit; @@ -33,16 +33,16 @@ static int sound_sight3; static int sound_sight4; // Stand -mframe_t enforcer_frames_stand [] = +static mframe_t enforcer_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, }; mmove_t enforcer_move_stand = {0, 6, enforcer_frames_stand, NULL}; @@ -52,17 +52,17 @@ void enforcer_stand(edict_t *self) } // Run -mframe_t enforcer_frames_run [] = +static mframe_t enforcer_frames_run [] = { - ai_run, 18, NULL, - ai_run, 14, NULL, - ai_run, 7, NULL, - ai_run, 12, NULL, + {ai_run, 18, NULL}, + {ai_run, 14, NULL}, + {ai_run, 7, NULL}, + {ai_run, 12, NULL}, - ai_run, 14, NULL, - ai_run, 14, NULL, - ai_run, 7, NULL, - ai_run, 11, NULL + {ai_run, 14, NULL}, + {ai_run, 14, NULL}, + {ai_run, 7, NULL}, + {ai_run, 11, NULL} }; mmove_t enforcer_move_run = {23, 30, enforcer_frames_run, NULL}; @@ -73,17 +73,21 @@ void enforcer_run(edict_t *self) void enfbolt_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) { - int mod; - if (other == self->owner) + { return; + } + if (surf && (surf->flags & SURF_SKY)) { G_FreeEdict (self); return; } + if (other->takedamage) + { T_Damage (other, self, self->owner, self->velocity, self->s.origin, plane->normal, self->dmg, 1, DAMAGE_ENERGY, 0); + } else { gi.WriteByte(svc_temp_entity); @@ -96,6 +100,7 @@ void enfbolt_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *s gi.sound (self, CHAN_WEAPON, sound_hit, 1, ATTN_NORM, 0); } + G_FreeEdict(self); } @@ -104,12 +109,10 @@ void fire_enfbolt(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed edict_t *bolt; trace_t tr; - // decino: No enemies left, so stop shooting - if (!self->enemy || self->enemy == self) + if (!self) + { return; - // decino: Don't make impossible shots - VectorCopy(SightEndtToDir(self, dir)[0], dir); - VectorNormalize (dir); + } bolt = G_Spawn(); bolt->svflags = SVF_DEADMONSTER; @@ -125,7 +128,7 @@ void fire_enfbolt(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed VectorClear(bolt->mins); VectorClear(bolt->maxs); - bolt->s.modelindex = gi.modelindex ("models/objects/laser/tris.md2"); + bolt->s.modelindex = gi.modelindex("models/monsters/objects/laser/tris.md2"); bolt->owner = self; bolt->touch = enfbolt_touch; bolt->nextthink = level.time + 5; @@ -142,7 +145,7 @@ void fire_enfbolt(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed bolt->touch(bolt, tr.ent, NULL, NULL); } gi.sound(self, CHAN_WEAPON, sound_attack, 1, ATTN_NORM, 0); -} +} void FireEnforcerBolt(edict_t *self) { @@ -164,14 +167,14 @@ void FireEnforcerBolt(edict_t *self) } // Attack (second half) -mframe_t enforcer_frames_attack2 [] = +static mframe_t enforcer_frames_attack2 [] = { - ai_charge, 0, NULL, - ai_charge, 0, FireEnforcerBolt, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, FireEnforcerBolt}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL + {ai_charge, 0, NULL} }; mmove_t enforcer_move_attack2 = {35, 40, enforcer_frames_attack2, enforcer_run}; @@ -182,17 +185,17 @@ void enforcer_attack_again(edict_t *self) } // Attack (first half) -mframe_t enforcer_frames_attack1 [] = +static mframe_t enforcer_frames_attack1 [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, FireEnforcerBolt, - ai_charge, 0, NULL, - ai_charge, 0, NULL + {ai_charge, 0, NULL}, + {ai_charge, 0, FireEnforcerBolt}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL} }; mmove_t enforcer_move_attack1 = {31, 38, enforcer_frames_attack1, enforcer_attack_again}; @@ -202,7 +205,7 @@ void enforcer_attack(edict_t *self) } // Sight -void enforcer_sight(edict_t *self) +void enforcer_sight(edict_t *self, edict_t *other /* unused */) { int r = (int)(random() * 4); @@ -223,83 +226,84 @@ void enforcer_search(edict_t *self) } // Pain (1) -mframe_t enforcer_frames_pain1 [] = +static mframe_t enforcer_frames_pain1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t enforcer_move_pain1 = {66, 69, enforcer_frames_pain1, enforcer_run}; // Pain (2) -mframe_t enforcer_frames_pain2 [] = +static mframe_t enforcer_frames_pain2 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t enforcer_move_pain2 = {70, 74, enforcer_frames_pain2, enforcer_run}; // Pain (3) -mframe_t enforcer_frames_pain3 [] = +static mframe_t enforcer_frames_pain3 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t enforcer_move_pain3 = {75, 82, enforcer_frames_pain3, enforcer_run}; // Pain (4) -mframe_t enforcer_frames_pain4 [] = +static mframe_t enforcer_frames_pain4 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 2, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 2, NULL}, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 1, NULL, - ai_move, 1, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 1, NULL}, + {ai_move, 1, NULL}, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 1, NULL, + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 1, NULL}, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t enforcer_move_pain4 = {83, 101, enforcer_frames_pain4, enforcer_run}; // Pain -void enforcer_pain(edict_t *self) +void enforcer_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { float r; // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; if (level.time < self->pain_debounce_time) return; r = random(); - + if (r < 0.5) gi.sound(self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0); else @@ -337,44 +341,44 @@ void enforcer_dead(edict_t *self) } // Death (1) -mframe_t enforcer_frames_death1 [] = +static mframe_t enforcer_frames_death1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 14, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 14, NULL}, - ai_move, 2, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 2, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 3, NULL, - ai_move, 5, NULL, - ai_move, 5, NULL, - ai_move, 5, NULL, + {ai_move, 3, NULL}, + {ai_move, 5, NULL}, + {ai_move, 5, NULL}, + {ai_move, 5, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t enforcer_move_death1 = {41, 54, enforcer_frames_death1, enforcer_dead}; // Death (2) -mframe_t enforcer_frames_death2 [] = +static mframe_t enforcer_frames_death2 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t enforcer_move_death2 = {55, 65, enforcer_frames_death2, enforcer_dead}; @@ -408,26 +412,23 @@ void enforcer_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int dama self->monsterinfo.currentmove = &enforcer_move_death2; } -void SP_monster_q1_enforcer(edict_t *self) +void SP_monster_enforcer(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/enforcer/tris.md2"); - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, 40); + self->s.modelindex = gi.modelindex("models/monsters/enforcer/tris.md2"); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, 40); self->health = 80; - self->monster_name = "Enforcer"; - if (self->solid == SOLID_NOT) - return; - sound_death = gi.soundindex("quake1/enforcer/death1.wav"); - sound_hit = gi.soundindex("quake1/enforcer/enfstop.wav"); - sound_attack = gi.soundindex("quake1/enforcer/enfire.wav"); - sound_search = gi.soundindex("quake1/enforcer/idle1.wav"); - sound_pain1 = gi.soundindex("quake1/enforcer/pain1.wav"); - sound_pain2 = gi.soundindex("quake1/enforcer/pain2.wav"); - sound_sight1 = gi.soundindex("quake1/enforcer/sight1.wav"); - sound_sight2 = gi.soundindex("quake1/enforcer/sight2.wav"); - sound_sight3 = gi.soundindex("quake1/enforcer/sight3.wav"); - sound_sight4 = gi.soundindex("quake1/enforcer/sight4.wav"); + sound_death = gi.soundindex("enforcer/death1.wav"); + sound_hit = gi.soundindex("enforcer/enfstop.wav"); + sound_attack = gi.soundindex("enforcer/enfire.wav"); + sound_search = gi.soundindex("enforcer/idle1.wav"); + sound_pain1 = gi.soundindex("enforcer/pain1.wav"); + sound_pain2 = gi.soundindex("enforcer/pain2.wav"); + sound_sight1 = gi.soundindex("enforcer/sight1.wav"); + sound_sight2 = gi.soundindex("enforcer/sight2.wav"); + sound_sight3 = gi.soundindex("enforcer/sight3.wav"); + sound_sight4 = gi.soundindex("enforcer/sight4.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_fish.c b/src/game/monster/fish/fish.c similarity index 58% rename from src/game/monster/m_fish.c rename to src/game/monster/fish/fish.c index 564a56cc..56300682 100644 --- a/src/game/monster/m_fish.c +++ b/src/game/monster/fish/fish.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,37 +19,37 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_fish.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_search; static int sound_death; static int sound_melee; // Stand -mframe_t fish_frames_stand [] = +static mframe_t fish_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, }; mmove_t fish_move_stand = {39, 56, fish_frames_stand, NULL}; @@ -59,30 +59,30 @@ void fish_stand(edict_t *self) } // Run -mframe_t fish_frames_run [] = +static mframe_t fish_frames_run [] = { - ai_run, 12, NULL, - ai_run, 12, NULL, - ai_run, 12, NULL, - ai_run, 12, NULL, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, - ai_run, 12, NULL, - ai_run, 12, NULL, - ai_run, 12, NULL, - ai_run, 12, NULL, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, - ai_run, 12, NULL, - ai_run, 12, NULL, - ai_run, 12, NULL, - ai_run, 12, NULL, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, - ai_run, 12, NULL, - ai_run, 12, NULL, - ai_run, 12, NULL, - ai_run, 12, NULL, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, + {ai_run, 12, NULL}, - ai_run, 12, NULL, - ai_run, 12, NULL + {ai_run, 12, NULL}, + {ai_run, 12, NULL} }; mmove_t fish_move_run = {39, 56, fish_frames_run, NULL}; @@ -111,30 +111,30 @@ void FishBite(edict_t *self) } // Melee -mframe_t fish_frames_melee [] = +static mframe_t fish_frames_melee [] = { - ai_run, 10, NULL, - ai_run, 10, NULL, - ai_run, 0, FishBite, - ai_run, 10, NULL, + {ai_run, 10, NULL}, + {ai_run, 10, NULL}, + {ai_run, 0, FishBite}, + {ai_run, 10, NULL}, - ai_run, 10, NULL, - ai_run, 10, NULL, - ai_run, 10, NULL, - ai_run, 10, NULL, + {ai_run, 10, NULL}, + {ai_run, 10, NULL}, + {ai_run, 10, NULL}, + {ai_run, 10, NULL}, - ai_run, 0, FishBite, - ai_run, 10, NULL, - ai_run, 10, NULL, - ai_run, 10, NULL, + {ai_run, 0, FishBite}, + {ai_run, 10, NULL}, + {ai_run, 10, NULL}, + {ai_run, 10, NULL}, - ai_run, 10, NULL, - ai_run, 10, NULL, - ai_run, 0, FishBite, - ai_run, 10, NULL, + {ai_run, 10, NULL}, + {ai_run, 10, NULL}, + {ai_run, 0, FishBite}, + {ai_run, 10, NULL}, - ai_run, 10, NULL, - ai_run, 10, NULL + {ai_run, 10, NULL}, + {ai_run, 10, NULL} }; mmove_t fish_move_melee = {0, 17, fish_frames_melee, fish_run}; @@ -160,34 +160,34 @@ void fish_dead(edict_t *self) } // Death -mframe_t fish_frames_death [] = +static mframe_t fish_frames_death [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t fish_move_death = {18, 38, fish_frames_death, fish_dead}; @@ -217,58 +217,56 @@ void fish_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, } // Pain -mframe_t fish_frames_pain [] = +static mframe_t fish_frames_pain [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t fish_move_pain = {57, 65, fish_frames_pain, fish_run}; -void fish_pain(edict_t *self) +void fish_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { if (level.time < self->pain_debounce_time) return; self->pain_debounce_time = level.time + 3; // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; self->monsterinfo.currentmove = &fish_move_pain; } -void SP_monster_q1_fish(edict_t *self) +void SP_monster_fish(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/fish/tris.md2"); + self->s.modelindex = gi.modelindex("models/monsters/fish/tris.md2"); VectorSet(self->mins, -16, -16, -24); VectorSet(self->maxs, 16, 16, 24); self->health = 25; - self->monster_name = "Rotfish"; - if (self->solid == SOLID_NOT) - return; - sound_search = gi.soundindex("quake1/fish/idle.wav"); - sound_death = gi.soundindex("quake1/fish/death.wav"); - sound_melee = gi.soundindex("quake1/fish/bite.wav"); + sound_search = gi.soundindex("fish/idle.wav"); + sound_death = gi.soundindex("fish/death.wav"); + sound_melee = gi.soundindex("fish/bite.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_hknight.c b/src/game/monster/hknight/hknight.c similarity index 64% rename from src/game/monster/m_hknight.c rename to src/game/monster/hknight/hknight.c index 99725244..1ee644ef 100644 --- a/src/game/monster/m_hknight.c +++ b/src/game/monster/hknight/hknight.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_hknight.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_attack; static int sound_melee; @@ -33,19 +33,19 @@ void hknight_run(edict_t *self); void SwingSword(edict_t *self); // Stand -mframe_t hknight_frames_stand [] = +static mframe_t hknight_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, }; mmove_t hknight_move_stand = {0, 8, hknight_frames_stand, NULL}; @@ -55,27 +55,27 @@ void hknight_stand(edict_t *self) } // Charge -mframe_t hknight_frames_charge [] = +static mframe_t hknight_frames_charge [] = { - ai_charge, 20, NULL, - ai_charge, 25, NULL, - ai_charge, 18, NULL, - ai_charge, 16, NULL, + {ai_charge, 20, NULL}, + {ai_charge, 25, NULL}, + {ai_charge, 18, NULL}, + {ai_charge, 16, NULL}, - ai_charge, 14, NULL, - ai_charge, 20, SwingSword, - ai_charge, 21, SwingSword, - ai_charge, 13, SwingSword, + {ai_charge, 14, NULL}, + {ai_charge, 20, SwingSword}, + {ai_charge, 21, SwingSword}, + {ai_charge, 13, SwingSword}, - ai_charge, 20, SwingSword, - ai_charge, 20, SwingSword, - ai_charge, 18, SwingSword, - ai_charge, 16, NULL, + {ai_charge, 20, SwingSword}, + {ai_charge, 20, SwingSword}, + {ai_charge, 18, SwingSword}, + {ai_charge, 16, NULL}, - ai_charge, 20, NULL, - ai_charge, 14, NULL, - ai_charge, 25, NULL, - ai_charge, 21, NULL, + {ai_charge, 20, NULL}, + {ai_charge, 14, NULL}, + {ai_charge, 25, NULL}, + {ai_charge, 21, NULL}, }; mmove_t hknight_move_charge = {63, 78, hknight_frames_charge, hknight_run}; @@ -87,23 +87,23 @@ qboolean CheckForCharge(edict_t *self) return false; if (fabs(self->s.origin[2] - self->enemy->s.origin[2]) > 20) return false; - if (CheckDistance(self, self->enemy) > 320) + if (realrange(self, self->enemy) > 320) return false; return true; } // Run -mframe_t hknight_frames_run [] = +static mframe_t hknight_frames_run [] = { - ai_run, 20, NULL, - ai_run, 18, NULL, - ai_run, 25, NULL, - ai_run, 16, NULL, + {ai_run, 20, NULL}, + {ai_run, 18, NULL}, + {ai_run, 25, NULL}, + {ai_run, 16, NULL}, - ai_run, 14, NULL, - ai_run, 25, NULL, - ai_run, 21, NULL, - ai_run, 13, NULL + {ai_run, 14, NULL}, + {ai_run, 25, NULL}, + {ai_run, 21, NULL}, + {ai_run, 13, NULL} }; mmove_t hknight_move_run = {29, 36, hknight_frames_run, NULL}; @@ -116,16 +116,19 @@ void hknight_reset_magic(edict_t *self) { self->radius_dmg = -2; - if (self->enemy && CheckDistance(self, self->enemy) < 320 && (random() < 0.75)) + if (self->enemy && realrange(self, self->enemy) < 320 && (random() < 0.75)) + { self->monsterinfo.attack_finished = level.time + 1.0; + } } void magic_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) { - int mod; - if (other == self->owner) + { return; + } + if (surf && (surf->flags & SURF_SKY)) { G_FreeEdict (self); @@ -153,12 +156,10 @@ void fire_magic(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed) edict_t *magic; trace_t tr; - // decino: No enemies left, so stop shooting - if (!self->enemy || self->enemy == self) + if (!self) + { return; - // decino: Don't make impossible shots - VectorCopy(SightEndtToDir(self, dir)[0], dir); - VectorNormalize(dir); + } magic = G_Spawn(); magic->svflags = SVF_DEADMONSTER; @@ -174,7 +175,7 @@ void fire_magic(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed) VectorClear(magic->mins); VectorClear(magic->maxs); - magic->s.modelindex = gi.modelindex ("models/proj/fireball/tris.md2"); + magic->s.modelindex = gi.modelindex("models/proj/fireball/tris.md2"); magic->owner = self; magic->touch = magic_touch; magic->nextthink = level.time + 10; @@ -191,12 +192,11 @@ void fire_magic(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed) magic->touch(magic, tr.ent, NULL, NULL); } gi.sound(self, CHAN_WEAPON, sound_attack, 1, ATTN_NORM, 0); -} +} void FireMagic(edict_t *self) { - vec3_t dir; - vec3_t test; + vec3_t dir; VectorSubtract(self->enemy->s.origin, self->s.origin, dir); dir[1] += self->radius_dmg * 60; @@ -207,21 +207,21 @@ void FireMagic(edict_t *self) } // Attack -mframe_t hknight_frames_attack [] = +static mframe_t hknight_frames_attack [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, hknight_reset_magic, - ai_charge, 0, FireMagic, - ai_charge, 0, FireMagic, - ai_charge, 0, FireMagic, + {ai_charge, 0, hknight_reset_magic}, + {ai_charge, 0, FireMagic}, + {ai_charge, 0, FireMagic}, + {ai_charge, 0, FireMagic}, - ai_charge, 0, FireMagic, - ai_charge, 0, FireMagic, - ai_charge, 0, FireMagic + {ai_charge, 0, FireMagic}, + {ai_charge, 0, FireMagic}, + {ai_charge, 0, FireMagic} }; mmove_t hknight_move_attack = {155, 165, hknight_frames_attack, hknight_run}; @@ -236,72 +236,72 @@ void hknight_attack(edict_t *self) } // Slice -mframe_t hknight_frames_slice [] = +static mframe_t hknight_frames_slice [] = { - ai_charge, 9, NULL, - ai_charge, 6, NULL, - ai_charge, 13, NULL, - ai_charge, 4, NULL, + {ai_charge, 9, NULL}, + {ai_charge, 6, NULL}, + {ai_charge, 13, NULL}, + {ai_charge, 4, NULL}, - ai_charge, 7, SwingSword, - ai_charge, 15, SwingSword, - ai_charge, 8, SwingSword, - ai_charge, 2, SwingSword, + {ai_charge, 7, SwingSword}, + {ai_charge, 15, SwingSword}, + {ai_charge, 8, SwingSword}, + {ai_charge, 2, SwingSword}, - ai_charge, 0, SwingSword, - ai_charge, 3, NULL + {ai_charge, 0, SwingSword}, + {ai_charge, 3, NULL} }; mmove_t hknight_move_slice = {112, 121, hknight_frames_slice, hknight_run}; // Smash -mframe_t hknight_frames_smash [] = +static mframe_t hknight_frames_smash [] = { - ai_charge, 1, NULL, - ai_charge, 13, NULL, - ai_charge, 9, NULL, - ai_charge, 11, NULL, + {ai_charge, 1, NULL}, + {ai_charge, 13, NULL}, + {ai_charge, 9, NULL}, + {ai_charge, 11, NULL}, - ai_charge, 10, SwingSword, - ai_charge, 7, SwingSword, - ai_charge, 12, SwingSword, - ai_charge, 2, SwingSword, + {ai_charge, 10, SwingSword}, + {ai_charge, 7, SwingSword}, + {ai_charge, 12, SwingSword}, + {ai_charge, 2, SwingSword}, - ai_charge, 3, SwingSword, - ai_charge, 0, NULL, - ai_charge, 0, NULL + {ai_charge, 3, SwingSword}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL} }; mmove_t hknight_move_smash = {122, 132, hknight_frames_smash, hknight_run}; // Watk -mframe_t hknight_frames_watk [] = +static mframe_t hknight_frames_watk [] = { - ai_charge, 2, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, SwingSword, + {ai_charge, 2, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, SwingSword}, - ai_charge, 0, SwingSword, - ai_charge, 0, SwingSword, - ai_charge, 1, NULL, - ai_charge, 4, NULL, + {ai_charge, 0, SwingSword}, + {ai_charge, 0, SwingSword}, + {ai_charge, 1, NULL}, + {ai_charge, 4, NULL}, - ai_charge, 5, NULL, - ai_charge, 3, SwingSword, - ai_charge, 2, SwingSword, - ai_charge, 2, SwingSword, + {ai_charge, 5, NULL}, + {ai_charge, 3, SwingSword}, + {ai_charge, 2, SwingSword}, + {ai_charge, 2, SwingSword}, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 1, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 1, NULL}, - ai_charge, 1, SwingSword, - ai_charge, 3, SwingSword, - ai_charge, 4, SwingSword, - ai_charge, 6, NULL, + {ai_charge, 1, SwingSword}, + {ai_charge, 3, SwingSword}, + {ai_charge, 4, SwingSword}, + {ai_charge, 6, NULL}, - ai_charge, 7, NULL, - ai_charge, 3, NULL, + {ai_charge, 7, NULL}, + {ai_charge, 3, NULL}, }; mmove_t hknight_move_watk = {133, 154, hknight_frames_watk, hknight_run}; @@ -310,7 +310,7 @@ mmove_t hknight_move_watk = {133, 154, hknight_frames_watk, hknight_run}; void hknight_melee(edict_t *self) { self->dmg_radius++; - + if (self->dmg_radius == 1) self->monsterinfo.currentmove = &hknight_move_slice; else if (self->dmg_radius == 2) @@ -324,21 +324,21 @@ void hknight_melee(edict_t *self) } // Pain -mframe_t hknight_frames_pain [] = +static mframe_t hknight_frames_pain [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t hknight_move_pain = {37, 41, hknight_frames_pain, hknight_run}; void hknight_pain(edict_t *self, edict_t *other, float kick, int damage) { // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; if (level.time < self->pain_debounce_time) return; @@ -368,39 +368,39 @@ void hknight_dead(edict_t *self) } // Death (1) -mframe_t hknight_frames_die1 [] = +static mframe_t hknight_frames_die1 [] = { - ai_move, 0, NULL, - ai_move, 10, NULL, - ai_move, 8, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 10, NULL}, + {ai_move, 8, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 10, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 10, NULL}, - ai_move, 11, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 11, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t hknight_move_die1 = {42, 53, hknight_frames_die1, hknight_dead}; // Death (2) -mframe_t hknight_frames_die2 [] = +static mframe_t hknight_frames_die2 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t hknight_move_die2 = {54, 62, hknight_frames_die2, hknight_dead}; @@ -434,7 +434,7 @@ void hknight_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damag } // Sight -void hknight_sight(edict_t *self) +void hknight_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } @@ -445,23 +445,20 @@ void hknight_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0); } -void SP_monster_q1_hknight(edict_t *self) +void SP_monster_hknight(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/hknight/tris.md2"); - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, 40); + self->s.modelindex = gi.modelindex("models/monsters/hknight/tris.md2"); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, 40); self->health = 250; - self->monster_name = "Death Knight"; - if (self->solid == SOLID_NOT) - return; - sound_attack = gi.soundindex("quake1/hknight/attack1.wav"); - sound_melee = gi.soundindex("quake1/hknight/slash1.wav"); - sound_death = gi.soundindex("quake1/hknight/death1.wav"); - sound_proj_hit = gi.soundindex("quake1/hknight/hit.wav"); - sound_sight = gi.soundindex("quake1/hknight/sight1.wav"); - sound_search = gi.soundindex("quake1/hknight/idle.wav"); - sound_pain = gi.soundindex("quake1/hknight/pain1.wav"); + sound_attack = gi.soundindex("hknight/attack1.wav"); + sound_melee = gi.soundindex("hknight/slash1.wav"); + sound_death = gi.soundindex("hknight/death1.wav"); + sound_proj_hit = gi.soundindex("hknight/hit.wav"); + sound_sight = gi.soundindex("hknight/sight1.wav"); + sound_search = gi.soundindex("hknight/idle.wav"); + sound_pain = gi.soundindex("hknight/pain1.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_knight.c b/src/game/monster/knight/knight.c similarity index 61% rename from src/game/monster/m_knight.c rename to src/game/monster/knight/knight.c index 689a52f4..0add5d4e 100644 --- a/src/game/monster/m_knight.c +++ b/src/game/monster/knight/knight.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_knight.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_death; static int sound_pain; @@ -31,19 +31,19 @@ static int sound_melee2; void knight_attack(edict_t *self); // Stand -mframe_t knight_frames_stand [] = +static mframe_t knight_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, }; mmove_t knight_move_stand = {0, 8, knight_frames_stand, NULL}; @@ -53,17 +53,17 @@ void knight_stand(edict_t *self) } // Run -mframe_t knight_frames_run [] = +static mframe_t knight_frames_run [] = { - ai_run, 16, NULL, - ai_run, 20, NULL, - ai_run, 13, NULL, - ai_run, 7, NULL, + {ai_run, 16, NULL}, + {ai_run, 20, NULL}, + {ai_run, 13, NULL}, + {ai_run, 7, NULL}, - ai_run, 16, NULL, - ai_run, 20, NULL, - ai_run, 14, NULL, - ai_run, 6, knight_attack + {ai_run, 16, NULL}, + {ai_run, 20, NULL}, + {ai_run, 14, NULL}, + {ai_run, 6, knight_attack} }; mmove_t knight_move_run = {9, 16, knight_frames_run, NULL}; @@ -75,9 +75,13 @@ void knight_run(edict_t *self) void knight_attack_swing(edict_t *self) { if (random() > 0.5) + { gi.sound(self, CHAN_WEAPON, sound_melee1, 1, ATTN_NORM, 0); + } else + { gi.sound(self, CHAN_WEAPON, sound_melee2, 1, ATTN_NORM, 0); + } } void SwingSword(edict_t *self) @@ -87,41 +91,56 @@ void SwingSword(edict_t *self) int damage; if (!self->enemy) + { return; + } + VectorSubtract(self->s.origin, self->enemy->s.origin, dir); if (VectorLength(dir) > 100.0) + { return; + } + damage = (random() + random() + random()) * 3; fire_hit(self, aim, damage, damage); } // Attack -mframe_t knight_frames_attack [] = +static mframe_t knight_frames_attack [] = { - ai_charge, 16, knight_attack_swing, - ai_charge, 20, NULL, - ai_charge, 13, NULL, - ai_charge, 7, NULL, + {ai_charge, 16, knight_attack_swing}, + {ai_charge, 20, NULL}, + {ai_charge, 13, NULL}, + {ai_charge, 7, NULL}, - ai_charge, 16, SwingSword, - ai_charge, 20, SwingSword, - ai_charge, 14, SwingSword, - ai_charge, 6, SwingSword, + {ai_charge, 16, SwingSword}, + {ai_charge, 20, SwingSword}, + {ai_charge, 14, SwingSword}, + {ai_charge, 6, SwingSword}, - ai_charge, 14, SwingSword, - ai_charge, 10, NULL, - ai_charge, 7, NULL + {ai_charge, 14, SwingSword}, + {ai_charge, 10, NULL}, + {ai_charge, 7, NULL} +}; +mmove_t knight_move_attack = { + 17, + 27, + knight_frames_attack, + knight_run }; -mmove_t knight_move_attack = {17, 27, knight_frames_attack, knight_run}; void knight_attack(edict_t *self) { - if (self->enemy && CheckDistance(self, self->enemy) < (MELEE_DISTANCE * 4)) + if (self->enemy && realrange(self, self->enemy) < (MELEE_DISTANCE * 4)) + { self->monsterinfo.currentmove = &knight_move_attack; + } else + { self->monsterinfo.currentmove = &knight_move_run; + } } void knight_melee_swing(edict_t *self) @@ -130,20 +149,20 @@ void knight_melee_swing(edict_t *self) } // Melee -mframe_t knight_frames_melee [] = +static mframe_t knight_frames_melee [] = { - ai_charge, 0, knight_melee_swing, - ai_charge, 7, NULL, - ai_charge, 4, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, knight_melee_swing}, + {ai_charge, 7, NULL}, + {ai_charge, 4, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 4, SwingSword, - ai_charge, 4, SwingSword, - ai_charge, 1, SwingSword, - ai_charge, 3, NULL, + {ai_charge, 4, SwingSword}, + {ai_charge, 4, SwingSword}, + {ai_charge, 1, SwingSword}, + {ai_charge, 3, NULL}, - ai_charge, 1, NULL, - ai_charge, 5, NULL + {ai_charge, 1, NULL}, + {ai_charge, 5, NULL} }; mmove_t knight_move_melee = {43, 52, knight_frames_melee, knight_run}; @@ -153,37 +172,38 @@ void knight_melee(edict_t *self) } // Pain (1) -mframe_t knight_frames_pain1 [] = +static mframe_t knight_frames_pain1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t knight_move_pain1 = {28, 30, knight_frames_pain1, knight_run}; // Pain (2) -mframe_t knight_frames_pain2 [] = +static mframe_t knight_frames_pain2 [] = { - ai_move, 0, NULL, - ai_move, 3, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 3, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 2, NULL, - ai_move, 4, NULL, - ai_move, 2, NULL, - ai_move, 5, NULL, + {ai_move, 2, NULL}, + {ai_move, 4, NULL}, + {ai_move, 2, NULL}, + {ai_move, 5, NULL}, - ai_move, 5, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 5, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t knight_move_pain2 = {31, 41, knight_frames_pain2, knight_run}; -void knight_pain(edict_t *self) +void knight_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; if (level.time < self->pain_debounce_time) return; @@ -206,39 +226,39 @@ void knight_dead(edict_t *self) } // Death (1) -mframe_t knight_frames_die1 [] = +static mframe_t knight_frames_die1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t knight_move_die1 = {76, 85, knight_frames_die1, knight_dead}; // Death (2) -mframe_t knight_frames_die2 [] = +static mframe_t knight_frames_die2 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t knight_move_die2 = {86, 96, knight_frames_die2, knight_dead}; @@ -278,27 +298,24 @@ void knight_search(edict_t *self) } // Sight -void knight_sight(edict_t *self) +void knight_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } -void SP_monster_q1_knight(edict_t *self) +void SP_monster_knight(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/knight/tris.md2"); - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, 40); + self->s.modelindex = gi.modelindex("models/monsters/knight/tris.md2"); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, 40); self->health = 75; - self->monster_name = "Knight"; - if (self->solid == SOLID_NOT) - return; - sound_melee1 = gi.soundindex("quake1/knight/sword1.wav"); - sound_melee2 = gi.soundindex("quake1/knight/sword2.wav"); - sound_death = gi.soundindex("quake1/knight/kdeath.wav"); - sound_pain = gi.soundindex("quake1/knight/khurt.wav"); - sound_sight = gi.soundindex("quake1/knight/ksight.wav"); - sound_search = gi.soundindex("quake1/knight/idle.wav"); + sound_melee1 = gi.soundindex("knight/sword1.wav"); + sound_melee2 = gi.soundindex("knight/sword2.wav"); + sound_death = gi.soundindex("knight/kdeath.wav"); + sound_pain = gi.soundindex("knight/khurt.wav"); + sound_sight = gi.soundindex("knight/ksight.wav"); + sound_search = gi.soundindex("knight/idle.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_shambler.c b/src/game/monster/m_shambler.c deleted file mode 100644 index aa4970a8..00000000 --- a/src/game/monster/m_shambler.c +++ /dev/null @@ -1,415 +0,0 @@ -/* -Copyright (C) 1997-2001 Id Software, Inc. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -// m_shambler.c - -#include "../../game/g_local.h" - -static int sound_attack; -static int sound_lightning; -static int sound_death; -static int sound_pain; -static int sound_idle; -static int sound_sight; -static int sound_melee1; -static int sound_melee2; -static int sound_smack; - -// Stand -mframe_t shambler_frames_stand [] = -{ - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - - ai_stand, 0, NULL -}; -mmove_t shambler_move_stand = {0, 16, shambler_frames_stand, NULL}; - -void shambler_stand(edict_t *self) -{ - self->monsterinfo.currentmove = &shambler_move_stand; -} - -// Run -mframe_t shambler_frames_run [] = -{ - ai_run, 20, NULL, - ai_run, 24, NULL, - ai_run, 20, NULL, - ai_run, 20, NULL, - - ai_run, 24, NULL, - ai_run, 20, NULL -}; -mmove_t shambler_move_run = {29, 34, shambler_frames_run, NULL}; - -void shambler_run(edict_t *self) -{ - self->monsterinfo.currentmove = &shambler_move_run; -} - -void CastLightning(edict_t *self) -{ - vec3_t start, dir, end; - trace_t tr; - - // decino: No enemies left, so stop shooting - if (!self->enemy || self->enemy == self) - return; - if (!infront(self, self->enemy)) - return; - if (self->s.frame == 72) - gi.sound (self, CHAN_WEAPON, sound_attack, 1, ATTN_NORM, 0); - - // decino: Shambler has an extra lightning frame on Nightmare mode - if (self->s.frame == 75 && skill->value < 3) - return; - VectorCopy(self->s.origin, start); - VectorCopy(self->enemy->s.origin, end); - - start[2] += 40; - end[2] += 16; - - VectorSubtract(end, start, dir); - VectorNormalize(dir); - VectorMA(start, 600, dir, end); - - tr = gi.trace(start, NULL, NULL, end, self, (MASK_SHOT|CONTENTS_SLIME|CONTENTS_LAVA|CONTENTS_WATER)); - - if (!tr.ent) - return; - T_Damage(tr.ent, self, self, dir, tr.endpos, tr.plane.normal, 10, 1, 0, 0); - - gi.WriteByte(svc_temp_entity); - gi.WriteByte(TE_LIGHTNING); - gi.WriteShort(tr.ent - g_edicts); - gi.WriteShort(self - g_edicts); - gi.WritePosition(end); - gi.WritePosition(start); - gi.multicast(start, MULTICAST_PVS); -} - -void shambler_prepare(edict_t *self) -{ - gi.sound (self, CHAN_WEAPON, sound_lightning, 1, ATTN_NORM, 0); -} - -void shambler_sparks(edict_t *self) -{ - vec3_t end; - VectorCopy(self->s.origin, end); - - end[2] += 80; - - gi.WriteByte(svc_temp_entity); - gi.WriteByte(TE_WELDING_SPARKS); - gi.WriteByte(15); - gi.WritePosition(end); - gi.WriteDir(vec3_origin); - gi.WriteByte(15); - gi.multicast(end, MULTICAST_PVS); -} - -// Lightning -mframe_t shambler_frames_lightning [] = -{ - ai_charge, 0, shambler_prepare, - ai_charge, 0, shambler_sparks, - ai_charge, 0, shambler_sparks, - ai_charge, 0, NULL, - - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, CastLightning, - - ai_charge, 0, CastLightning, - ai_charge, 0, CastLightning, - ai_charge, 0, CastLightning, - ai_charge, 0, NULL -}; -mmove_t shambler_move_lightning = {65, 76, shambler_frames_lightning, shambler_run}; - -void shambler_lightning(edict_t *self) -{ - self->monsterinfo.currentmove = &shambler_move_lightning; -} - -void shambler_prepare_smash(edict_t *self) -{ - gi.sound(self, CHAN_VOICE, sound_melee1, 1, ATTN_NORM, 0); -} - -void shambler_prepare_claw(edict_t *self) -{ - gi.sound(self, CHAN_VOICE, sound_melee2, 1, ATTN_NORM, 0); -} - -void ShamblerSmash(edict_t *self) -{ - vec3_t dir; - static vec3_t aim = {100, 0, -24}; - int damage; - - if (!self->enemy) - return; - VectorSubtract(self->s.origin, self->enemy->s.origin, dir); - - if (VectorLength(dir) > 100.0) - return; - damage = (random() + random() + random()) * 40; - - if (fire_hit(self, aim, damage, damage)) - gi.sound(self, CHAN_WEAPON, sound_smack, 1, ATTN_NORM, 0); -} - -void ShamblerClaw(edict_t *self) -{ - vec3_t dir; - static vec3_t aim = {100, 0, -24}; - int damage; - - if (!self->enemy) - return; - VectorSubtract(self->s.origin, self->enemy->s.origin, dir); - - if (VectorLength(dir) > 100.0) - return; - damage = (random() + random() + random()) * 20; - - if (fire_hit(self, aim, damage, damage)) - gi.sound(self, CHAN_WEAPON, sound_smack, 1, ATTN_NORM, 0); -} - -// Claw (right) -mframe_t shambler_frames_clawr [] = -{ - ai_charge, 1, shambler_prepare_smash, - ai_charge, 8, NULL, - ai_charge, 14, NULL, - ai_charge, 7, NULL, - - ai_charge, 3, NULL, - ai_charge, 6, NULL, - ai_charge, 6, NULL, - ai_charge, 10, ShamblerClaw, - - ai_charge, 3, NULL -}; -mmove_t shambler_move_clawr = {47, 55, shambler_frames_clawr, shambler_run}; - -// Claw (left) -mframe_t shambler_frames_clawl [] = -{ - ai_charge, 5, shambler_prepare_claw, - ai_charge, 3, NULL, - ai_charge, 7, NULL, - ai_charge, 3, NULL, - - ai_charge, 7, NULL, - ai_charge, 9, NULL, - ai_charge, 5, NULL, - ai_charge, 10, ShamblerClaw, - - ai_charge, 4, NULL -}; -mmove_t shambler_move_clawl = {56, 64, shambler_frames_clawl, shambler_run}; - -// Smash -mframe_t shambler_frames_smash [] = -{ - ai_charge, 6, shambler_prepare_smash, - ai_charge, 6, NULL, - ai_charge, 5, NULL, - ai_charge, 4, NULL, - - ai_charge, 1, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, ShamblerSmash, - ai_charge, 0, NULL -}; -mmove_t shambler_move_smash = {35, 46, shambler_frames_smash, shambler_run}; - -void shambler_melee(edict_t *self) -{ - float r; - r = random(); - - if (r > 0.6 || self->health == 600) - self->monsterinfo.currentmove = &shambler_move_smash; - else if (r > 0.3) - self->monsterinfo.currentmove = &shambler_move_clawr; - else - self->monsterinfo.currentmove = &shambler_move_clawl; -} - -void shambler_search(edict_t *self) -{ - gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_NORM, 0); -} - -void shambler_sight(edict_t *self) -{ - gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); -} - -// Pain -mframe_t shambler_frames_pain [] = -{ - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - - ai_move, 0, NULL, - ai_move, 0, NULL -}; -mmove_t shambler_move_pain = {77, 82, shambler_frames_pain, shambler_run}; - -void shambler_pain(edict_t *self) -{ - if (level.time < self->pain_debounce_time) - return; - self->pain_debounce_time = level.time + 3; - gi.sound (self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0); - - // decino: No pain animations in Nightmare mode - if (skill->value == 3) - return; - self->monsterinfo.currentmove = &shambler_move_pain; -} - -void shambler_dead(edict_t *self) -{ - VectorSet(self->mins, -32, -32, -24); - VectorSet(self->maxs, 32, 32, -8); - self->movetype = MOVETYPE_TOSS; - self->svflags |= SVF_DEADMONSTER; - self->nextthink = 0; - gi.linkentity(self); -} - -// Die -mframe_t shambler_frames_death [] = -{ - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL -}; -mmove_t shambler_move_death = {83, 93, shambler_frames_death, shambler_dead}; - -void shambler_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) -{ - int n; - - if (self->health <= self->gib_health) - { - gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); - - for (n= 0; n < 2; n++) - ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC); - for (n= 0; n < 4; n++) - ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); - ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC); - self->deadflag = DEAD_DEAD; - return; - } - if (self->deadflag == DEAD_DEAD) - return; - gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0); - - self->deadflag = DEAD_DEAD; - self->takedamage = DAMAGE_YES; - self->monsterinfo.currentmove = &shambler_move_death; -} - -void SP_monster_q1_shambler(edict_t *self) -{ - self->s.modelindex = gi.modelindex("models/quake1/shambler/tris.md2"); - VectorSet (self->mins, -32, -32, -24); - VectorSet (self->maxs, 32, 32, 64); - self->health = 600; - self->monster_name = "Shambler"; - - if (self->solid == SOLID_NOT) - return; - sound_attack = gi.soundindex("quake1/shambler/sboom.wav"); - sound_lightning = gi.soundindex("quake1/shambler/sattck1.wav"); - sound_death = gi.soundindex("quake1/shambler/sdeath.wav"); - sound_pain = gi.soundindex("quake1/shambler/shurt2.wav"); - sound_idle = gi.soundindex("quake1/shambler/sidle.wav"); - sound_sight = gi.soundindex("quake1/shambler/ssight.wav"); - sound_melee1 = gi.soundindex("quake1/shambler/melee1.wav"); - sound_melee2 = gi.soundindex("quake1/shambler/melee2.wav"); - sound_smack = gi.soundindex("quake1/shambler/smack.wav"); - - self->movetype = MOVETYPE_STEP; - self->solid = SOLID_BBOX; - - self->gib_health = -60; - self->mass = 600; - - self->monsterinfo.stand = shambler_stand; - self->monsterinfo.walk = shambler_run; - self->monsterinfo.run = shambler_run; - self->monsterinfo.attack = shambler_lightning; - self->monsterinfo.sight = shambler_sight; - self->monsterinfo.search = shambler_search; - self->monsterinfo.melee = shambler_melee; - - self->pain = shambler_pain; - self->die = shambler_die; - - self->monsterinfo.scale = 1.000000; - gi.linkentity (self); - - walkmonster_start(self); -} diff --git a/src/game/monster/m_ogre.c b/src/game/monster/ogre/ogre.c similarity index 57% rename from src/game/monster/m_ogre.c rename to src/game/monster/ogre/ogre.c index ff03465d..2f2339fa 100644 --- a/src/game/monster/m_ogre.c +++ b/src/game/monster/ogre/ogre.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_ogre.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_death; static int sound_attack; @@ -36,19 +36,19 @@ void ogre_idle(edict_t *self) } // Stand -mframe_t ogre_frames_stand [] = +static mframe_t ogre_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, ogre_idle, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, ogre_idle}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, }; mmove_t ogre_move_stand = {0, 8, ogre_frames_stand, NULL}; @@ -58,19 +58,24 @@ void ogre_stand(edict_t *self) } // Run -mframe_t ogre_frames_run [] = +static mframe_t ogre_frames_run [] = { - ai_run, 9, NULL, - ai_run, 12, NULL, - ai_run, 8, NULL, - ai_run, 22, NULL, - ai_run, 16, NULL, + {ai_run, 9, NULL}, + {ai_run, 12, NULL}, + {ai_run, 8, NULL}, + {ai_run, 22, NULL}, + {ai_run, 16, NULL}, - ai_run, 4, NULL, - ai_run, 13, NULL, - ai_run, 24, NULL + {ai_run, 4, NULL}, + {ai_run, 13, NULL}, + {ai_run, 24, NULL} +}; +mmove_t ogre_move_run = { + 25, + 32, + ogre_frames_run, + NULL }; -mmove_t ogre_move_run = {25, 32, ogre_frames_run, NULL}; void ogre_run(edict_t *self) { @@ -95,48 +100,53 @@ void OgreChainsaw(edict_t *self) } // Smash -mframe_t ogre_frames_smash [] = +static mframe_t ogre_frames_smash [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 1, NULL, - ai_charge, 4, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 1, NULL}, + {ai_charge, 4, NULL}, - ai_charge, 14, OgreChainsaw, - ai_charge, 14, OgreChainsaw, - ai_charge, 20, OgreChainsaw, - ai_charge, 23, OgreChainsaw, + {ai_charge, 14, OgreChainsaw}, + {ai_charge, 14, OgreChainsaw}, + {ai_charge, 20, OgreChainsaw}, + {ai_charge, 23, OgreChainsaw}, - ai_charge, 10, OgreChainsaw, - ai_charge, 12, OgreChainsaw, - ai_charge, 1, NULL, - ai_charge, 4, NULL, + {ai_charge, 10, OgreChainsaw}, + {ai_charge, 12, OgreChainsaw}, + {ai_charge, 1, NULL}, + {ai_charge, 4, NULL}, - ai_charge, 12, NULL, - ai_charge, 0, NULL + {ai_charge, 12, NULL}, + {ai_charge, 0, NULL} +}; +mmove_t ogre_move_smash = { + 47, + 60, + ogre_frames_smash, + ogre_run }; -mmove_t ogre_move_smash = {47, 60, ogre_frames_smash, ogre_run}; // Swing -mframe_t ogre_frames_swing [] = +static mframe_t ogre_frames_swing [] = { - ai_charge, 11, NULL, - ai_charge, 1, NULL, - ai_charge, 4, NULL, - ai_charge, 19, OgreChainsaw, + {ai_charge, 11, NULL}, + {ai_charge, 1, NULL}, + {ai_charge, 4, NULL}, + {ai_charge, 19, OgreChainsaw}, - ai_charge, 13, OgreChainsaw, - ai_charge, 10, OgreChainsaw, - ai_charge, 10, OgreChainsaw, - ai_charge, 10, OgreChainsaw, + {ai_charge, 13, OgreChainsaw}, + {ai_charge, 10, OgreChainsaw}, + {ai_charge, 10, OgreChainsaw}, + {ai_charge, 10, OgreChainsaw}, - ai_charge, 10, OgreChainsaw, - ai_charge, 10, OgreChainsaw, - ai_charge, 3, NULL, - ai_charge, 8, NULL, + {ai_charge, 10, OgreChainsaw}, + {ai_charge, 10, OgreChainsaw}, + {ai_charge, 3, NULL}, + {ai_charge, 8, NULL}, - ai_charge, 9, NULL, - ai_charge, 0, NULL + {ai_charge, 9, NULL}, + {ai_charge, 0, NULL} }; mmove_t ogre_move_swing = {33, 46, ogre_frames_swing, ogre_run}; @@ -165,15 +175,15 @@ void FireOgreGrenade(edict_t *self) } // Grenade -mframe_t ogre_frames_attack [] = +static mframe_t ogre_frames_attack [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, FireOgreGrenade, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, FireOgreGrenade}, - ai_charge, 0, NULL, - ai_charge, 0, NULL + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL} }; mmove_t ogre_move_attack = {61, 66, ogre_frames_attack, ogre_run}; @@ -183,101 +193,107 @@ void ogre_attack(edict_t *self) } // Pain (1) -mframe_t ogre_frames_pain1 [] = +static mframe_t ogre_frames_pain1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t ogre_move_pain1 = {67, 71, ogre_frames_pain1, ogre_run}; // Pain (2) -mframe_t ogre_frames_pain2 [] = +static mframe_t ogre_frames_pain2 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t ogre_move_pain2 = {72, 74, ogre_frames_pain2, ogre_run}; // Pain (3) -mframe_t ogre_frames_pain3 [] = +static mframe_t ogre_frames_pain3 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t ogre_move_pain3 = {75, 80, ogre_frames_pain3, ogre_run}; // Pain (4) -mframe_t ogre_frames_pain4 [] = +static mframe_t ogre_frames_pain4 [] = { - ai_move, 0, NULL, - ai_move, 10, NULL, - ai_move, 9, NULL, - ai_move, 4, NULL, + {ai_move, 0, NULL}, + {ai_move, 10, NULL}, + {ai_move, 9, NULL}, + {ai_move, 4, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t ogre_move_pain4 = {81, 96, ogre_frames_pain4, ogre_run}; // Pain (5) -mframe_t ogre_frames_pain5 [] = +static mframe_t ogre_frames_pain5 [] = { - ai_move, 0, NULL, - ai_move, 10, NULL, - ai_move, 9, NULL, - ai_move, 4, NULL, + {ai_move, 0, NULL}, + {ai_move, 10, NULL}, + {ai_move, 9, NULL}, + {ai_move, 4, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} +}; +mmove_t ogre_move_pain5 = { + 97, + 111, + ogre_frames_pain5, + ogre_run }; -mmove_t ogre_move_pain5 = {97, 111, ogre_frames_pain5, ogre_run}; // Pain -void ogre_pain(edict_t *self) +void ogre_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { float r; // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; if (self->pain_debounce_time > level.time) return; r = random(); gi.sound (self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0); - + if (r < 0.25) { self->monsterinfo.currentmove = &ogre_move_pain1; @@ -316,43 +332,43 @@ void ogre_dead(edict_t *self) } // Death (1) -mframe_t ogre_frames_death1 [] = +static mframe_t ogre_frames_death1 [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t ogre_move_death1 = {112, 125, ogre_frames_death1, ogre_dead}; // Death (2) -mframe_t ogre_frames_death2 [] = +static mframe_t ogre_frames_death2 [] = { - ai_move, 0, NULL, - ai_move, 5, NULL, - ai_move, 0, NULL, - ai_move, 1, NULL, + {ai_move, 0, NULL}, + {ai_move, 5, NULL}, + {ai_move, 0, NULL}, + {ai_move, 1, NULL}, - ai_move, 3, NULL, - ai_move, 7, NULL, - ai_move, 25, NULL, - ai_move, 0, NULL, + {ai_move, 3, NULL}, + {ai_move, 7, NULL}, + {ai_move, 25, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t ogre_move_death2 = {126, 135, ogre_frames_death2, ogre_dead}; @@ -387,7 +403,7 @@ void ogre_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, } // Sight -void ogre_sight(edict_t *self) +void ogre_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } @@ -398,23 +414,20 @@ void ogre_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0); } -void SP_monster_q1_ogre(edict_t *self) +void SP_monster_ogre(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/ogre/tris.md2"); - VectorSet (self->mins, -32, -32, -24); - VectorSet (self->maxs, 32, 32, 64); + self->s.modelindex = gi.modelindex("models/monsters/ogre/tris.md2"); + VectorSet(self->mins, -32, -32, -24); + VectorSet(self->maxs, 32, 32, 64); self->health = 200; - self->monster_name = "Ogre"; - if (self->solid == SOLID_NOT) - return; - sound_death = gi.soundindex("quake1/ogre/ogdth.wav"); - sound_attack = gi.soundindex("quake1/ogre/grenade.wav"); - sound_melee = gi.soundindex("quake1/ogre/ogsawatk.wav"); - sound_sight = gi.soundindex("quake1/ogre/ogwake.wav"); - sound_search = gi.soundindex("quake1/ogre/ogidle2.wav"); - sound_idle = gi.soundindex("quake1/ogre/ogidle.wav"); - sound_pain = gi.soundindex("quake1/ogre/ogpain1.wav"); + sound_death = gi.soundindex("ogre/ogdth.wav"); + sound_attack = gi.soundindex("ogre/grenade.wav"); + sound_melee = gi.soundindex("ogre/ogsawatk.wav"); + sound_sight = gi.soundindex("ogre/ogwake.wav"); + sound_search = gi.soundindex("ogre/ogidle2.wav"); + sound_idle = gi.soundindex("ogre/ogidle.wav"); + sound_pain = gi.soundindex("ogre/ogpain1.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_shalrath.c b/src/game/monster/shalrath/shalrath.c similarity index 75% rename from src/game/monster/m_shalrath.c rename to src/game/monster/shalrath/shalrath.c index 860cc537..c0e017e1 100644 --- a/src/game/monster/m_shalrath.c +++ b/src/game/monster/shalrath/shalrath.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_shalrath.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_death; static int sound_search; @@ -29,9 +29,9 @@ static int sound_fire; static int sound_sight; // Stand -mframe_t shalrath_frames_stand [] = +static mframe_t shalrath_frames_stand [] = { - ai_stand, 0, NULL + {ai_stand, 0, NULL}, }; mmove_t shalrath_move_stand = {0, 0, shalrath_frames_stand, NULL}; @@ -41,22 +41,22 @@ void shalrath_stand(edict_t *self) } // Run -mframe_t shalrath_frames_run [] = +static mframe_t shalrath_frames_run [] = { - ai_run, 6, NULL, - ai_run, 4, NULL, - ai_run, 0, NULL, - ai_run, 0, NULL, + {ai_run, 6, NULL}, + {ai_run, 4, NULL}, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, - ai_run, 0, NULL, - ai_run, 0, NULL, - ai_run, 5, NULL, - ai_run, 6, NULL, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, + {ai_run, 5, NULL}, + {ai_run, 6, NULL}, - ai_run, 5, NULL, - ai_run, 0, NULL, - ai_run, 4, NULL, - ai_run, 5, NULL + {ai_run, 5, NULL}, + {ai_run, 0, NULL}, + {ai_run, 4, NULL}, + {ai_run, 5, NULL} }; mmove_t shalrath_move_run = {23, 34, shalrath_frames_run, NULL}; @@ -74,7 +74,7 @@ void shalrath_pod_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface { if (other == self->owner) return; - if (strcmp(other->classname, "monster_q1_zombie") == 0) // decino: According to shalrath.qc + if (strcmp(other->classname, "monster_zombie") == 0) // decino: According to shalrath.qc T_Damage(other, self, self, vec3_origin, other->s.origin, vec3_origin, 110, 0, 0, 0); T_RadiusDamage(self, self->owner, self->dmg, NULL, self->dmg + 40, 0); @@ -102,7 +102,7 @@ void shalrath_pod_home(edict_t *self) { G_FreeEdict(self); return; - }*/ + }*/ } if (self->owner->enemy) { @@ -111,7 +111,7 @@ void shalrath_pod_home(edict_t *self) end[2] += self->enemy->viewheight; VectorSubtract(end, self->s.origin, dir); VectorNormalize(dir); - VectorScale(dir, (skill->value >= 3) ? 350 : 250, self->velocity); + VectorScale(dir, (skill->value >= SKILL_HARDPLUS) ? 350 : 250, self->velocity); } } @@ -133,12 +133,10 @@ void fire_shalrath_pod(edict_t *self, vec3_t start, vec3_t dir, int damage, int { edict_t *pod; - // decino: No enemies left, so stop shooting - if (!self->enemy || self->enemy == self) + if (!self) + { return; - // decino: Don't make impossible shots - VectorCopy(SightEndtToDir(self, dir)[0], dir); - VectorNormalize(dir); + } pod = G_Spawn(); VectorCopy(start, pod->s.origin); @@ -185,21 +183,21 @@ void FireShalrathPod(edict_t *self) } // Attack -mframe_t shalrath_frames_attack [] = +static mframe_t shalrath_frames_attack [] = { - ai_charge, 0, shalrath_roar, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, shalrath_roar}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, FireShalrathPod, - ai_charge, 0, NULL, - ai_charge, 0, NULL + {ai_charge, 0, FireShalrathPod}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL} }; mmove_t shalrath_move_attack = {0, 10, shalrath_frames_attack, shalrath_run}; @@ -209,21 +207,22 @@ void shalrath_attack(edict_t *self) } // Pain -mframe_t shalrath_frames_pain [] = +static mframe_t shalrath_frames_pain [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t shalrath_move_pain = {11, 15, shalrath_frames_pain, shalrath_run}; -void shalrath_pain(edict_t *self) +void shalrath_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; if (level.time < self->pain_debounce_time) return; @@ -244,16 +243,16 @@ void shalrath_dead(edict_t *self) } // Death -mframe_t shalrath_frames_death [] = +static mframe_t shalrath_frames_death [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t shalrath_move_death = {16, 22, shalrath_frames_death, shalrath_dead}; @@ -283,7 +282,7 @@ void shalrath_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int dama } // Sight -void shalrath_sight(edict_t *self) +void shalrath_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } @@ -294,22 +293,19 @@ void shalrath_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0); } -void SP_monster_q1_shalrath(edict_t *self) +void SP_monster_shalrath(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/shalrath/tris.md2"); - VectorSet (self->mins, -32, -32, -24); - VectorSet (self->maxs, 32, 32, 48); + self->s.modelindex = gi.modelindex("models/monsters/shalrath/tris.md2"); + VectorSet(self->mins, -32, -32, -24); + VectorSet(self->maxs, 32, 32, 48); self->health = 400; - self->monster_name = "Vore"; - if (self->solid == SOLID_NOT) - return; - sound_death = gi.soundindex("quake1/shalrath/death.wav"); - sound_search = gi.soundindex("quake1/shalrath/idle.wav"); - sound_pain = gi.soundindex("quake1/shalrath/pain.wav"); - sound_attack = gi.soundindex("quake1/shalrath/attack.wav"); - sound_fire = gi.soundindex("quake1/shalrath/attack2.wav"); - sound_sight = gi.soundindex("quake1/shalrath/sight.wav"); + sound_death = gi.soundindex("shalrath/death.wav"); + sound_search = gi.soundindex("shalrath/idle.wav"); + sound_pain = gi.soundindex("shalrath/pain.wav"); + sound_attack = gi.soundindex("shalrath/attack.wav"); + sound_fire = gi.soundindex("shalrath/attack2.wav"); + sound_sight = gi.soundindex("shalrath/sight.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_tarbaby.c b/src/game/monster/tarbaby/tarbaby.c similarity index 69% rename from src/game/monster/m_tarbaby.c rename to src/game/monster/tarbaby/tarbaby.c index e4340303..d6160e2a 100644 --- a/src/game/monster/m_tarbaby.c +++ b/src/game/monster/tarbaby/tarbaby.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_tarbaby.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_death; static int sound_hit; @@ -34,9 +34,9 @@ void tarbaby_unbounce(edict_t *self) } // Stand -mframe_t tarbaby_frames_stand [] = +static mframe_t tarbaby_frames_stand [] = { - ai_stand, 0, tarbaby_unbounce + {ai_stand, 0, tarbaby_unbounce} }; mmove_t tarbaby_move_stand = {0, 0, tarbaby_frames_stand, NULL}; @@ -46,39 +46,39 @@ void tarbaby_stand(edict_t *self) } // Run -mframe_t tarbaby_frames_run [] = +static mframe_t tarbaby_frames_run [] = { - ai_run, 0, NULL, - ai_run, 0, NULL, - ai_run, 0, NULL, - ai_run, 0, NULL, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, - ai_run, 0, NULL, - ai_run, 0, NULL, - ai_run, 0, NULL, - ai_run, 0, NULL, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, - ai_run, 0, NULL, - ai_run, 0, NULL, - ai_run, 2, NULL, - ai_run, 2, NULL, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, - ai_run, 2, NULL, - ai_run, 2, NULL, - ai_run, 2, NULL, - ai_run, 2, NULL, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, - ai_run, 2, NULL, - ai_run, 2, NULL, - ai_run, 2, NULL, - ai_run, 2, NULL, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, - ai_run, 2, NULL, - ai_run, 2, NULL, - ai_run, 2, NULL, - ai_run, 2, NULL, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, + {ai_run, 2, NULL}, - ai_run, 2, NULL + {ai_run, 2, NULL} }; mmove_t tarbaby_move_run = {25, 49, tarbaby_frames_run, NULL}; @@ -88,14 +88,14 @@ void tarbaby_run(edict_t *self) } // Sight -void tarbaby_sight(edict_t *self) +void tarbaby_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } void tarbaby_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) { - if (other->takedamage && other->monster_team != self->monster_team) + if (other->takedamage) { if (VectorLength(self->velocity) > 400) { @@ -135,12 +135,12 @@ void TarBabyJump(edict_t *self) } // Fly -mframe_t tarbaby_frames_fly [] = +static mframe_t tarbaby_frames_fly [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t tarbaby_move_fly = {56, 59, tarbaby_frames_fly, tarbaby_rejump}; @@ -150,15 +150,15 @@ void tarbaby_fly(edict_t *self) } // Jump -mframe_t tarbaby_frames_jump [] = +static mframe_t tarbaby_frames_jump [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, TarBabyJump, - ai_charge, 0, NULL + {ai_charge, 0, TarBabyJump}, + {ai_charge, 0, NULL} }; mmove_t tarbaby_move_jump = {50, 55, tarbaby_frames_jump, tarbaby_fly}; @@ -193,7 +193,9 @@ void tarbaby_explode(edict_t *self) } // Death -void tarbaby_die(edict_t *self) +void tarbaby_die(edict_t *self, edict_t *inflictor /* unused */, + edict_t *attacker /* unused */, int damage, + vec3_t point /* unused */) { if (self->deadflag == DEAD_DEAD) return; @@ -204,26 +206,24 @@ void tarbaby_die(edict_t *self) } // Pain -void tarbaby_pain(edict_t *self) +void tarbaby_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { } -void SP_monster_q1_tarbaby(edict_t *self) +void SP_monster_tarbaby(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/tarbaby/tris.md2"); - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, 40); + self->s.modelindex = gi.modelindex("models/monsters/tarbaby/tris.md2"); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, 40); self->health = 80; - self->monster_name = "Spawn"; - if (self->solid == SOLID_NOT) - return; - sound_death = gi.soundindex("quake1/tarbaby/death1.wav"); - sound_hit = gi.soundindex("quake1/tarbaby/hit1.wav"); - sound_land = gi.soundindex("quake1/tarbaby/land1.wav"); - sound_sight = gi.soundindex("quake1/tarbaby/sight1.wav"); + sound_death = gi.soundindex("tarbaby/death1.wav"); + sound_hit = gi.soundindex("tarbaby/hit1.wav"); + sound_land = gi.soundindex("tarbaby/land1.wav"); + sound_sight = gi.soundindex("tarbaby/sight1.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_wizard.c b/src/game/monster/wizard/wizard.c similarity index 71% rename from src/game/monster/m_wizard.c rename to src/game/monster/wizard/wizard.c index cf75e441..addfa53b 100644 --- a/src/game/monster/m_wizard.c +++ b/src/game/monster/wizard/wizard.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_wizard.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_proj_hit; static int sound_attack; @@ -30,26 +30,26 @@ static int sound_pain; static int sound_sight; // Stand -mframe_t wizard_frames_stand [] = +static mframe_t wizard_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, }; mmove_t wizard_move_stand = {0, 14, wizard_frames_stand, NULL}; @@ -59,28 +59,33 @@ void wizard_stand(edict_t *self) } // Run -mframe_t wizard_frames_run [] = +static mframe_t wizard_frames_run [] = { - ai_run, 16, NULL, - ai_run, 16, NULL, - ai_run, 16, NULL, - ai_run, 16, NULL, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, - ai_run, 16, NULL, - ai_run, 16, NULL, - ai_run, 16, NULL, - ai_run, 16, NULL, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, - ai_run, 16, NULL, - ai_run, 16, NULL, - ai_run, 16, NULL, - ai_run, 16, NULL, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, - ai_run, 16, NULL, - ai_run, 16, NULL, - ai_run, 16, NULL + {ai_run, 16, NULL}, + {ai_run, 16, NULL}, + {ai_run, 16, NULL} +}; +mmove_t wizard_move_run = { + 15, + 28, + wizard_frames_run, + NULL }; -mmove_t wizard_move_run = {15, 28, wizard_frames_run, NULL}; void wizard_run(edict_t *self) { @@ -95,18 +100,20 @@ void wizard_frame(edict_t *self) frame++; if (frame > 5) + { frame = 0; + } } // decino: Quake plays this animation backwards, so we'll have to do some hacking -mframe_t wizard_frames_finish [] = +static mframe_t wizard_frames_finish [] = { - ai_charge, 0, wizard_frame, - ai_charge, 0, wizard_frame, - ai_charge, 0, wizard_frame, - ai_charge, 0, wizard_frame, + {ai_charge, 0, wizard_frame}, + {ai_charge, 0, wizard_frame}, + {ai_charge, 0, wizard_frame}, + {ai_charge, 0, wizard_frame}, - ai_charge, 0, wizard_frame + {ai_charge, 0, wizard_frame} }; mmove_t wizard_move_finish = {29, 33, wizard_frames_finish, wizard_run}; @@ -117,10 +124,11 @@ void wizard_finish_attack(edict_t *self) void spit_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) { - int mod; - if (other == self->owner) + { return; + } + if (surf && (surf->flags & SURF_SKY)) { G_FreeEdict (self); @@ -148,12 +156,10 @@ void fire_spit(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed) edict_t *spit; trace_t tr; - // decino: No enemies left, so stop shooting - if (!self->enemy || self->enemy == self) + if (!self) + { return; - // decino: Don't make impossible shots - VectorCopy(SightEndtToDir(self, dir)[0], dir); - VectorNormalize (dir); + } spit = G_Spawn(); spit->svflags = SVF_DEADMONSTER; @@ -169,7 +175,7 @@ void fire_spit(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed) VectorClear(spit->mins); VectorClear(spit->maxs); - spit->s.modelindex = gi.modelindex ("models/proj/spit/tris.md2"); + spit->s.modelindex = gi.modelindex("models/proj/spit/tris.md2"); spit->owner = self; spit->touch = spit_touch; spit->nextthink = level.time + 2; @@ -185,7 +191,7 @@ void fire_spit(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed) VectorMA(spit->s.origin, -10, dir, spit->s.origin); spit->touch(spit, tr.ent, NULL, NULL); } -} +} void WizardSpit(edict_t *self) { @@ -212,15 +218,15 @@ void wizard_prespit(edict_t *self) } // Attack -mframe_t wizard_frames_attack [] = +static mframe_t wizard_frames_attack [] = { - ai_charge, 0, wizard_prespit, - ai_charge, 0, WizardSpit, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, wizard_prespit}, + {ai_charge, 0, WizardSpit}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, WizardSpit, - ai_charge, 0, NULL + {ai_charge, 0, WizardSpit}, + {ai_charge, 0, NULL} }; mmove_t wizard_move_attack = {29, 34, wizard_frames_attack, wizard_finish_attack}; @@ -230,16 +236,17 @@ void wizard_attack(edict_t *self) } // Pain -mframe_t wizard_frames_pain [] = +static mframe_t wizard_frames_pain [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t wizard_move_pain = {42, 45, wizard_frames_pain, wizard_run}; -void wizard_pain(edict_t *self) +void wizard_pain(edict_t *self, edict_t *other /* unused */, + float kick /* unused */, int damage) { if (level.time < self->pain_debounce_time) return; @@ -247,7 +254,7 @@ void wizard_pain(edict_t *self) gi.sound (self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0); // decino: No pain animations in Nightmare mode - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; self->monsterinfo.currentmove = &wizard_move_pain; } @@ -272,17 +279,17 @@ void wizard_dead(edict_t *self) } // Death -mframe_t wizard_frames_death [] = +static mframe_t wizard_frames_death [] = { - ai_move, 0, wizard_fling, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, wizard_fling}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t wizard_move_death = {46, 53, wizard_frames_death, wizard_dead}; @@ -311,7 +318,7 @@ void wizard_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage self->monsterinfo.currentmove = &wizard_move_death; } -void wizard_sight(edict_t *self) +void wizard_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } @@ -327,23 +334,20 @@ void wizard_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_idle2, 1, ATTN_NORM, 0); } -void SP_monster_q1_wizard(edict_t *self) +void SP_monster_wizard(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/wizard/tris.md2"); - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, 40); + self->s.modelindex = gi.modelindex("models/monsters/wizard/tris.md2"); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, 40); self->health = 80; - self->monster_name = "Scrag"; - if (self->solid == SOLID_NOT) - return; - sound_proj_hit = gi.soundindex("quake1/wizard/hit.wav"); - sound_attack = gi.soundindex("quake1/wizard/wattack.wav"); - sound_death = gi.soundindex("quake1/wizard/wdeath.wav"); - sound_idle1 = gi.soundindex("quake1/wizard/widle1.wav"); - sound_idle2 = gi.soundindex("quake1/wizard/widle2.wav"); - sound_pain = gi.soundindex("quake1/wizard/wpain.wav"); - sound_sight = gi.soundindex("quake1/wizard/wsight.wav"); + sound_proj_hit = gi.soundindex("wizard/hit.wav"); + sound_attack = gi.soundindex("wizard/wattack.wav"); + sound_death = gi.soundindex("wizard/wdeath.wav"); + sound_idle1 = gi.soundindex("wizard/widle1.wav"); + sound_idle2 = gi.soundindex("wizard/widle2.wav"); + sound_pain = gi.soundindex("wizard/wpain.wav"); + sound_sight = gi.soundindex("wizard/wsight.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/m_zombie.c b/src/game/monster/zombie/zombie.c similarity index 53% rename from src/game/monster/m_zombie.c rename to src/game/monster/zombie/zombie.c index a670b1d5..c9925f25 100644 --- a/src/game/monster/m_zombie.c +++ b/src/game/monster/zombie/zombie.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // m_zombie.c -#include "../../game/g_local.h" +#include "../../header/local.h" static int sound_sight; static int sound_search; @@ -34,66 +34,72 @@ void zombie_down(edict_t *self); void zombie_get_up_attempt(edict_t *self); // Stand -mframe_t zombie_frames_stand [] = +static mframe_t zombie_frames_stand [] = { - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, - ai_stand, 0, NULL, - ai_stand, 0, NULL, - ai_stand, 0, NULL + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, + {ai_stand, 0, NULL}, +}; +mmove_t zombie_move_stand = { + 0, + 14, + zombie_frames_stand, + NULL }; -mmove_t zombie_move_stand = {0, 14, zombie_frames_stand, NULL}; void zombie_stand(edict_t *self) { self->monsterinfo.currentmove = &zombie_move_stand; } -void zombie_reset_state(edict_t *self) -{ - self->zombie_state = 0; -} - // Run -mframe_t zombie_frames_run [] = +static mframe_t zombie_frames_run[] = { - ai_run, 1, zombie_reset_state, - ai_run, 1, NULL, - ai_run, 0, NULL, - ai_run, 1, NULL, + {ai_run, 1, NULL}, + {ai_run, 1, NULL}, + {ai_run, 0, NULL}, + {ai_run, 1, NULL}, - ai_run, 2, NULL, - ai_run, 3, NULL, - ai_run, 4, NULL, - ai_run, 4, NULL, + {ai_run, 2, NULL}, + {ai_run, 3, NULL}, + {ai_run, 4, NULL}, + {ai_run, 4, NULL}, - ai_run, 2, NULL, - ai_run, 0, NULL, - ai_run, 0, NULL, - ai_run, 0, NULL, + {ai_run, 2, NULL}, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, + {ai_run, 0, NULL}, - ai_run, 2, NULL, - ai_run, 4, NULL, - ai_run, 6, NULL, - ai_run, 7, NULL, + {ai_run, 2, NULL}, + {ai_run, 4, NULL}, + {ai_run, 6, NULL}, + {ai_run, 7, NULL}, - ai_run, 3, NULL, - ai_run, 8, NULL + {ai_run, 3, NULL}, + {ai_run, 8, NULL} +}; + +mmove_t zombie_move_run = { + 34, + 51, + zombie_frames_run, + NULL }; -mmove_t zombie_move_run = {34, 51, zombie_frames_run, NULL}; void zombie_run(edict_t *self) { @@ -101,11 +107,16 @@ void zombie_run(edict_t *self) } // Sight -void zombie_sight(edict_t *self) +void zombie_sight(edict_t *self, edict_t *other /* unused */) { gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0); } +void zombie_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) +{ + G_FreeEdict(ent); +} + void zombie_gib_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) { if (other == ent->owner) @@ -125,7 +136,7 @@ void zombie_gib_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t gi.sound(ent, CHAN_WEAPON, sound_miss, 1, ATTN_NORM, 0); VectorSet(ent->avelocity, 0, 0, 0); VectorSet(ent->velocity, 0, 0, 0); - ent->touch = G_FreeEdict; + ent->touch = zombie_touch; } void fire_zombie_gib(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed) @@ -134,11 +145,11 @@ void fire_zombie_gib(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int vec3_t dir; vec3_t forward, right, up; - // decino: No enemies left, so stop shooting - if (!self->enemy || self->enemy == self) + if (!self) + { return; - // decino: Don't make impossible shots - VectorCopy(SightEndtToDir(self, aimdir)[0], dir); + } + vectoangles(aimdir, dir); AngleVectors(dir, forward, right, up); @@ -154,7 +165,7 @@ void fire_zombie_gib(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int gib->s.effects |= EF_GIB; VectorClear(gib->mins); VectorClear(gib->maxs); - gib->s.modelindex = gi.modelindex ("models/objects/gibs/sm_meat/tris.md2"); + gib->s.modelindex = gi.modelindex("models/monsters/objects/gibs/sm_meat/tris.md2"); gib->owner = self; gib->touch = zombie_gib_touch; gib->nextthink = level.time + 2.5; @@ -181,110 +192,131 @@ void FireZombieGib(edict_t *self) } // Attack (1) -mframe_t zombie_frames_attack1 [] = +static mframe_t zombie_frames_attack1 [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, FireZombieGib + {ai_charge, 0, FireZombieGib} }; mmove_t zombie_move_attack1 = {52, 64, zombie_frames_attack1, zombie_run}; // Attack (2) -mframe_t zombie_frames_attack2 [] = +static mframe_t zombie_frames_attack2 [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, FireZombieGib + {ai_charge, 0, NULL}, + {ai_charge, 0, FireZombieGib} +}; +mmove_t zombie_move_attack2 = { + 65, + 78, + zombie_frames_attack2, + zombie_run }; -mmove_t zombie_move_attack2 = {65, 78, zombie_frames_attack2, zombie_run}; // Attack (3) -mframe_t zombie_frames_attack3 [] = +static mframe_t zombie_frames_attack3 [] = { - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, NULL, - ai_charge, 0, FireZombieGib, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, NULL}, + {ai_charge, 0, FireZombieGib}, +}; +mmove_t zombie_move_attack3 = { + 79, + 90, + zombie_frames_attack3, + zombie_run }; -mmove_t zombie_move_attack3 = {79, 90, zombie_frames_attack3, zombie_run}; // Attack void zombie_attack(edict_t *self) { float r = random(); - + if (r < 0.3) + { self->monsterinfo.currentmove = &zombie_move_attack1; + } else if (r < 0.6) + { self->monsterinfo.currentmove = &zombie_move_attack2; + } else + { self->monsterinfo.currentmove = &zombie_move_attack3; + } } -mframe_t zombie_frames_get_up [] = +static mframe_t zombie_frames_get_up [] = { - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} +}; +mmove_t zombie_move_get_up = { + 173, + 191, + zombie_frames_get_up, + zombie_run }; -mmove_t zombie_move_get_up = {173, 191, zombie_frames_get_up, zombie_run}; void zombie_pain1(edict_t *self) { @@ -306,7 +338,7 @@ void zombie_get_up(edict_t *self) VectorSet(self->maxs, 16, 16, 40); self->takedamage = DAMAGE_YES; self->health = 60; - zombie_sight(self); + zombie_sight(self, NULL); if (!M_walkmove(self, 0, 0)) { @@ -322,15 +354,17 @@ void zombie_start_fall(edict_t *self) } // Down -mframe_t zombie_frames_get_up_attempt [] = +static mframe_t zombie_frames_get_up_attempt [] = { - ai_move, 0, zombie_get_up_attempt + {ai_move, 0, zombie_get_up_attempt} }; + mmove_t zombie_move_get_up_attempt = {173, 173, zombie_frames_get_up_attempt, NULL}; void zombie_get_up_attempt(edict_t *self) { static int down = 0; + zombie_down(self); // Try getting up in 5 seconds @@ -354,133 +388,138 @@ void zombie_down(edict_t *self) } // Pain (1) -mframe_t zombie_frames_pain1 [] = +static mframe_t zombie_frames_pain1 [] = { - ai_move, 0, zombie_pain1, - ai_move, 3, NULL, - ai_move, 1, NULL, - ai_move, 1, NULL, + {ai_move, 0, zombie_pain1}, + {ai_move, 3, NULL}, + {ai_move, 1, NULL}, + {ai_move, 1, NULL}, - ai_move, 3, NULL, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 3, NULL}, + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t zombie_move_pain1 = {91, 102, zombie_frames_pain1, zombie_run}; // Pain (2) -mframe_t zombie_frames_pain2 [] = +static mframe_t zombie_frames_pain2 [] = { - ai_move, 0, zombie_pain2, - ai_move, 2, NULL, - ai_move, 8, NULL, - ai_move, 6, NULL, + {ai_move, 0, zombie_pain2}, + {ai_move, 2, NULL}, + {ai_move, 8, NULL}, + {ai_move, 6, NULL}, - ai_move, 2, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 2, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, zombie_hit_floor, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, zombie_hit_floor}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t zombie_move_pain2 = {103, 130, zombie_frames_pain2, zombie_run}; // Pain (3) -mframe_t zombie_frames_pain3 [] = +static mframe_t zombie_frames_pain3 [] = { - ai_move, 0, zombie_pain2, - ai_move, 0, NULL, - ai_move, 3, NULL, - ai_move, 1, NULL, + {ai_move, 0, zombie_pain2}, + {ai_move, 0, NULL}, + {ai_move, 3, NULL}, + {ai_move, 1, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 1, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 1, NULL}, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL + {ai_move, 0, NULL}, + {ai_move, 0, NULL} }; mmove_t zombie_move_pain3 = {131, 148, zombie_frames_pain3, zombie_run}; // Pain (4) -mframe_t zombie_frames_pain4 [] = +static mframe_t zombie_frames_pain4 [] = { - ai_move, 0, zombie_pain1, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, zombie_pain1}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 1, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, - ai_move, 0, NULL, + {ai_move, 1, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, + {ai_move, 0, NULL}, - ai_move, 0, NULL + {ai_move, 0, NULL} }; mmove_t zombie_move_pain4 = {149, 161, zombie_frames_pain4, zombie_run}; // Pain (5) -mframe_t zombie_frames_fall_start [] = +static mframe_t zombie_frames_fall_start [] = { - ai_move, 0, zombie_start_fall, - ai_move, -8, NULL, - ai_move, -5, NULL, - ai_move, -3, NULL, + {ai_move, 0, zombie_start_fall}, + {ai_move, -8, NULL}, + {ai_move, -5, NULL}, + {ai_move, -3, NULL}, - ai_move, -1, NULL, - ai_move, -2, NULL, - ai_move, -1, NULL, - ai_move, -1, NULL, + {ai_move, -1, NULL}, + {ai_move, -2, NULL}, + {ai_move, -1, NULL}, + {ai_move, -1, NULL}, - ai_move, -2, NULL, - ai_move, 0, zombie_hit_floor, - ai_move, 0, zombie_down + {ai_move, -2, NULL}, + {ai_move, 0, zombie_hit_floor}, + {ai_move, 0, zombie_down} +}; +mmove_t zombie_move_fall_start = { + 162, + 172, + zombie_frames_fall_start, + zombie_get_up_attempt }; -mmove_t zombie_move_fall_start = {162, 172, zombie_frames_fall_start, zombie_get_up_attempt}; // Pain void zombie_pain(edict_t *self, edict_t *other, float kick, int damage) @@ -489,30 +528,40 @@ void zombie_pain(edict_t *self, edict_t *other, float kick, int damage) self->health = 60; if (damage < 9) + { return; - if (self->zombie_state == 2) + } + + if (self->monsterinfo.currentmove == &zombie_move_fall_start) + { return; + } + if (damage >= 25) { - self->zombie_state = 2; self->monsterinfo.currentmove = &zombie_move_fall_start; return; } + if (self->pain_debounce_time > level.time) { - self->zombie_state = 2; self->monsterinfo.currentmove = &zombie_move_fall_start; return; } - if (self->zombie_state) + + if ( + (self->monsterinfo.currentmove == &zombie_move_pain1) || + (self->monsterinfo.currentmove == &zombie_move_pain2) || + (self->monsterinfo.currentmove == &zombie_move_pain3) || + (self->monsterinfo.currentmove == &zombie_move_pain4) + ) { self->pain_debounce_time = level.time + 3; return; } - self->zombie_state = 1; // decino: No pain animations in Nightmare mode - if (skill->value >= 3) + if (skill->value >= SKILL_HARDPLUS) return; r = random(); @@ -550,24 +599,21 @@ void zombie_search(edict_t *self) gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0); } -void SP_monster_q1_zombie(edict_t *self) +void SP_monster_zombie(edict_t *self) { - self->s.modelindex = gi.modelindex("models/quake1/zombie/tris.md2"); - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, 40); + self->s.modelindex = gi.modelindex("models/monsters/zombie/tris.md2"); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, 40); self->health = 60; - self->monster_name = "Zombie"; - if (self->solid == SOLID_NOT) - return; - sound_sight = gi.soundindex("quake1/zombie/z_idle.wav"); - sound_search = gi.soundindex("quake1/zombie/z_idle.wav"); - sound_fling = gi.soundindex("quake1/zombie/z_shot1.wav"); - sound_pain1 = gi.soundindex("quake1/zombie/z_pain.wav"); - sound_pain2 = gi.soundindex("quake1/zombie/z_pain1.wav"); - sound_fall = gi.soundindex("quake1/zombie/z_fall.wav"); - sound_miss = gi.soundindex("quake1/zombie/z_miss.wav"); - sound_hit = gi.soundindex("quake1/zombie/z_hit.wav"); + sound_sight = gi.soundindex("zombie/z_idle.wav"); + sound_search = gi.soundindex("zombie/z_idle.wav"); + sound_fling = gi.soundindex("zombie/z_shot1.wav"); + sound_pain1 = gi.soundindex("zombie/z_pain.wav"); + sound_pain2 = gi.soundindex("zombie/z_pain1.wav"); + sound_fall = gi.soundindex("zombie/z_fall.wav"); + sound_miss = gi.soundindex("zombie/z_miss.wav"); + sound_hit = gi.soundindex("zombie/z_hit.wav"); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/savegame/tables/gamefunc_decs.h b/src/game/savegame/tables/gamefunc_decs.h index 8448e5bd..f65f0db4 100644 --- a/src/game/savegame/tables/gamefunc_decs.h +++ b/src/game/savegame/tables/gamefunc_decs.h @@ -235,7 +235,7 @@ extern void ThrowWidowGibLoc ( edict_t * self , char * gibname , int damage , in extern void ThrowWidowGib ( edict_t * self , char * gibname , int damage , int type ) ; extern void widow_gib_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; extern void WidowVelocityForDamage ( int damage , vec3_t v ) ; -extern void SP_monster_guardian(edict_t *self); +extern void SP_monster_guardian ( edict_t * self ) ; extern void SP_monster_widow2 ( edict_t * self ) ; extern void Widow2Precache ( void ) ; extern qboolean Widow2_CheckAttack ( edict_t * self ) ; @@ -337,17 +337,17 @@ extern void SP_CreateCoopSpots ( edict_t * self ) ; extern void SP_FixCoopSpots ( edict_t * self ) ; extern void SP_monster_arachnid ( edict_t * self ) ; extern void arachnid_sight(edict_t *self, edict_t *other /* unused */); -extern void arachnid_footstep(edict_t *self); -extern void arachnid_stand(edict_t *self); -extern void arachnid_walk(edict_t *self); -extern void arachnid_run(edict_t *self); +extern void arachnid_footstep ( edict_t * self ) ; +extern void arachnid_stand ( edict_t * self ) ; +extern void arachnid_walk ( edict_t * self ) ; +extern void arachnid_run ( edict_t * self ) ; extern void arachnid_pain(edict_t *self, edict_t *other /* other */, float kick /* other */, int damage); -extern void arachnid_charge_rail(edict_t *self); -extern void arachnid_rail(edict_t *self); -extern void arachnid_melee_charge(edict_t *self); -extern void arachnid_melee_hit(edict_t *self); -extern void arachnid_attack(edict_t *self); -extern void arachnid_dead(edict_t *self); +extern void arachnid_charge_rail ( edict_t * self ) ; +extern void arachnid_rail ( edict_t * self ) ; +extern void arachnid_melee_charge ( edict_t * self ) ; +extern void arachnid_melee_hit ( edict_t * self ) ; +extern void arachnid_attack ( edict_t * self ) ; +extern void arachnid_dead ( edict_t * self ) ; extern void arachnid_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */, int damage, vec3_t point /* unused */); extern void SP_monster_tank ( edict_t * self ) ; extern void tank_stand_think ( edict_t * self ) ; @@ -810,27 +810,27 @@ extern void floater_fire_blaster ( edict_t * self ) ; extern void floater_idle ( edict_t * self ) ; extern void floater_sight ( edict_t * self , edict_t * other ) ; extern void SP_monster_flipper ( edict_t * self ) ; -extern void guardian_stand(edict_t *self); -extern void guardian_footstep(edict_t *self); -extern void guardian_walk(edict_t *self); -extern void guardian_run(edict_t *self); +extern void guardian_stand ( edict_t * self ) ; +extern void guardian_footstep ( edict_t * self ) ; +extern void guardian_walk ( edict_t * self ) ; +extern void guardian_run ( edict_t * self ) ; extern void guardian_pain(edict_t *self, edict_t *other /* other */, float kick /* other */, int damage); -extern void guardian_atk1_finish(edict_t *self); -extern void guardian_atk1_charge(edict_t *self); -extern void guardian_fire_blaster(edict_t *self); -extern void guardian_hyper_sound(edict_t *self); -extern void guardian_atk1(edict_t *self); -extern void guardian_atk2_out(edict_t *self); -extern void guardian_laser_fire(edict_t *self); -extern void guardian_atk2(edict_t *self); -extern void guardian_kick(edict_t *self); -extern void guardian_attack(edict_t *self); -extern void guardian_explode(edict_t *self); -extern void guardian_dead(edict_t *self); +extern void guardian_atk1_finish ( edict_t * self ) ; +extern void guardian_atk1_charge ( edict_t * self ) ; +extern void guardian_fire_blaster ( edict_t * self ) ; +extern void guardian_hyper_sound ( edict_t * self ) ; +extern void guardian_atk1 ( edict_t * self ) ; +extern void guardian_atk2_out ( edict_t * self ) ; +extern void guardian_laser_fire ( edict_t * self ) ; +extern void guardian_atk2 ( edict_t * self ) ; +extern void guardian_kick ( edict_t * self ) ; +extern void guardian_attack ( edict_t * self ) ; +extern void guardian_explode ( edict_t * self ) ; +extern void guardian_dead ( edict_t * self ) ; extern void guardian_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */, int damage, vec3_t point /* unused */); -extern void SP_monster_guardian(edict_t *self); +extern void SP_monster_guardian ( edict_t * self ) ; extern void shambler_sight(edict_t* self, edict_t* other); -extern void shambler_lightning_update(edict_t *self); +extern void shambler_lightning_update ( edict_t * self ) ; extern void shambler_windup(edict_t* self); extern void shambler_idle(edict_t* self); extern void shambler_maybe_idle(edict_t* self); @@ -982,6 +982,18 @@ extern void brain_stand ( edict_t * self ) ; extern void brain_search ( edict_t * self ) ; extern void brain_sight ( edict_t * self , edict_t * other ) ; extern void SP_monster_boss5 ( edict_t * self ) ; +extern void SP_monster_army ( edict_t * self ) ; +extern void SP_monster_demon ( edict_t * self ) ; +extern void SP_monster_dog ( edict_t * self ) ; +extern void SP_monster_enforcer ( edict_t * self ) ; +extern void SP_monster_fish ( edict_t * self ) ; +extern void SP_monster_hknight ( edict_t * self ) ; +extern void SP_monster_knight ( edict_t * self ) ; +extern void SP_monster_ogre ( edict_t * self ) ; +extern void SP_monster_shalrath ( edict_t * self ) ; +extern void SP_monster_tarbaby ( edict_t * self ) ; +extern void SP_monster_wizard ( edict_t * self ) ; +extern void SP_monster_zombie ( edict_t * self ) ; extern void boss5_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; extern void BossExplode2 ( edict_t * self ) ; extern void boss5_dead ( edict_t * self ) ; diff --git a/src/game/savegame/tables/gamefunc_list.h b/src/game/savegame/tables/gamefunc_list.h index 1e25b929..9c16bee5 100644 --- a/src/game/savegame/tables/gamefunc_list.h +++ b/src/game/savegame/tables/gamefunc_list.h @@ -984,6 +984,18 @@ {"brain_search", (byte *)brain_search}, {"brain_sight", (byte *)brain_sight}, {"SP_monster_boss5", (byte *)SP_monster_boss5}, +{"SP_monster_army", (byte *)SP_monster_army}, +{"SP_monster_demon", (byte *)SP_monster_demon}, +{"SP_monster_dog", (byte *)SP_monster_dog}, +{"SP_monster_enforcer", (byte *)SP_monster_enforcer}, +{"SP_monster_fish", (byte *)SP_monster_fish}, +{"SP_monster_hknight", (byte *)SP_monster_hknight}, +{"SP_monster_knight", (byte *)SP_monster_knight}, +{"SP_monster_ogre", (byte *)SP_monster_ogre}, +{"SP_monster_shalrath", (byte *)SP_monster_shalrath}, +{"SP_monster_tarbaby", (byte *)SP_monster_tarbaby}, +{"SP_monster_wizard", (byte *)SP_monster_wizard}, +{"SP_monster_zombie", (byte *)SP_monster_zombie}, {"boss5_die", (byte *)boss5_die}, {"BossExplode2", (byte *)BossExplode2}, {"boss5_dead", (byte *)boss5_dead},