From: Mario Date: Tue, 4 Jun 2013 00:08:15 +0000 (+1000) Subject: Minor cleanup X-Git-Tag: xonotic-v0.8.0~241^2^2~203 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=da156245f16deb1f37359098d00ee2559b7d89e1;p=xonotic%2Fxonotic-data.pk3dir.git Minor cleanup --- diff --git a/qcsrc/server/monsters/monster/animus.qc b/qcsrc/server/monsters/monster/animus.qc index 83f1b695e..cfb2292b8 100644 --- a/qcsrc/server/monsters/monster/animus.qc +++ b/qcsrc/server/monsters/monster/animus.qc @@ -1,12 +1,9 @@ -// size const vector ANIMUS_MIN = '-41 -41 -31'; const vector ANIMUS_MAX = '41 41 31'; -// model string ANIMUS_MODEL = "models/monsters/demon.mdl"; #ifdef SVQC -// cvars float autocvar_g_monster_animus; float autocvar_g_monster_animus_health; float autocvar_g_monster_animus_attack_jump_damage; @@ -14,7 +11,6 @@ float autocvar_g_monster_animus_damage; float autocvar_g_monster_animus_speed_walk; float autocvar_g_monster_animus_speed_run; -// animations const float animus_anim_stand = 0; const float animus_anim_walk = 1; const float animus_anim_run = 2; @@ -23,7 +19,7 @@ const float animus_anim_pain = 4; const float animus_anim_death = 5; const float animus_anim_attack = 6; -void animus_think () +void animus_think() { self.think = animus_think; self.nextthink = time + self.ticrate; @@ -31,7 +27,7 @@ void animus_think () monster_move(autocvar_g_monster_animus_speed_run, autocvar_g_monster_animus_speed_walk, 100, animus_anim_run, animus_anim_walk, animus_anim_stand); } -void animus_touch_jump () +void animus_touch_jump() { if (self.health <= 0) return; @@ -72,7 +68,7 @@ float animus_attack(float attack_type) return FALSE; } -void animus_die () +void animus_die() { Monster_CheckDropCvars ("animus"); @@ -84,7 +80,7 @@ void animus_die () monster_hook_death(); // for post-death mods } -void animus_spawn () +void animus_spawn() { if not(self.health) self.health = autocvar_g_monster_animus_health; @@ -102,8 +98,8 @@ void animus_spawn () monster_hook_spawn(); // for post-spawn mods } -void spawnfunc_monster_animus () -{ +void spawnfunc_monster_animus() +{ if not(autocvar_g_monster_animus) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_animus; diff --git a/qcsrc/server/monsters/monster/bruiser.qc b/qcsrc/server/monsters/monster/bruiser.qc index bf2983735..e19066bba 100644 --- a/qcsrc/server/monsters/monster/bruiser.qc +++ b/qcsrc/server/monsters/monster/bruiser.qc @@ -1,19 +1,15 @@ -// size const vector BRUISER_MIN = '-20 -20 -31'; const vector BRUISER_MAX = '20 20 53'; -// model string BRUISER_MODEL = "models/monsters/knight.mdl"; #ifdef SVQC -// cvars float autocvar_g_monster_bruiser; float autocvar_g_monster_bruiser_health; float autocvar_g_monster_bruiser_melee_damage; float autocvar_g_monster_bruiser_speed_walk; float autocvar_g_monster_bruiser_speed_run; -// animations const float bruiser_anim_stand = 0; const float bruiser_anim_run = 1; const float bruiser_anim_runattack = 2; @@ -26,7 +22,7 @@ const float bruiser_anim_standing = 8; const float bruiser_anim_death1 = 9; const float bruiser_anim_death2 = 10; -void bruiser_think () +void bruiser_think() { self.think = bruiser_think; self.nextthink = time + self.ticrate; @@ -54,7 +50,7 @@ float bruiser_attack(float attack_type) return FALSE; } -void bruiser_die () +void bruiser_die() { Monster_CheckDropCvars ("bruiser"); @@ -66,7 +62,7 @@ void bruiser_die () monster_hook_death(); // for post-death mods } -void bruiser_spawn () +void bruiser_spawn() { if not(self.health) self.health = autocvar_g_monster_bruiser_health; @@ -84,8 +80,8 @@ void bruiser_spawn () monster_hook_spawn(); // for post-spawn mods } -void spawnfunc_monster_bruiser () -{ +void spawnfunc_monster_bruiser() +{ if not(autocvar_g_monster_bruiser) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_bruiser; diff --git a/qcsrc/server/monsters/monster/brute.qc b/qcsrc/server/monsters/monster/brute.qc index 22eaeb0c1..7ebca8202 100644 --- a/qcsrc/server/monsters/monster/brute.qc +++ b/qcsrc/server/monsters/monster/brute.qc @@ -1,12 +1,9 @@ -// size const vector BRUTE_MIN = '-36 -36 -20'; const vector BRUTE_MAX = '36 36 50'; -// model string BRUTE_MODEL = "models/monsters/ogre.dpm"; #ifdef SVQC -// cvars float autocvar_g_monster_brute; float autocvar_g_monster_brute_health; float autocvar_g_monster_brute_chainsaw_damage; @@ -21,7 +18,6 @@ float autocvar_g_monster_brute_attack_grenade_edgedamage; float autocvar_g_monster_brute_attack_grenade_force; float autocvar_g_monster_brute_attack_grenade_radius; -// animations const float brute_anim_idle = 0; const float brute_anim_walk = 1; const float brute_anim_run = 2; @@ -232,7 +228,7 @@ void brute_spawn() } void spawnfunc_monster_brute() -{ +{ if not(autocvar_g_monster_brute) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_brute; diff --git a/qcsrc/server/monsters/monster/cerberus.qc b/qcsrc/server/monsters/monster/cerberus.qc index f1ba83357..38b57e76c 100644 --- a/qcsrc/server/monsters/monster/cerberus.qc +++ b/qcsrc/server/monsters/monster/cerberus.qc @@ -1,12 +1,9 @@ -// size const vector CERBERUS_MIN = '-16 -16 -24'; const vector CERBERUS_MAX = '16 16 12'; -// model string CERBERUS_MODEL = "models/monsters/dog.dpm"; #ifdef SVQC -// cvars float autocvar_g_monster_cerberus; float autocvar_g_monster_cerberus_health; float autocvar_g_monster_cerberus_bite_damage; @@ -14,7 +11,6 @@ float autocvar_g_monster_cerberus_attack_jump_damage; float autocvar_g_monster_cerberus_speed_walk; float autocvar_g_monster_cerberus_speed_run; -// animations const float cerberus_anim_idle = 0; const float cerberus_anim_walk = 1; const float cerberus_anim_run = 2; @@ -97,7 +93,7 @@ void cerberus_spawn() } void spawnfunc_monster_cerberus() -{ +{ if not(autocvar_g_monster_cerberus) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_cerberus; diff --git a/qcsrc/server/monsters/monster/knight.qc b/qcsrc/server/monsters/monster/knight.qc index c1d2763a8..0b8f29b73 100644 --- a/qcsrc/server/monsters/monster/knight.qc +++ b/qcsrc/server/monsters/monster/knight.qc @@ -1,12 +1,9 @@ -// size const vector KNIGHT_MIN = '-20 -20 -32'; const vector KNIGHT_MAX = '20 20 41'; -// model string KNIGHT_MODEL = "models/monsters/hknight.mdl"; #ifdef SVQC -// cvars float autocvar_g_monster_knight; float autocvar_g_monster_knight_health; float autocvar_g_monster_knight_melee_damage; @@ -29,7 +26,6 @@ float autocvar_g_monster_knight_jump_chance; float autocvar_g_monster_knight_jump_damage; float autocvar_g_monster_knight_jump_dist; -// animations const float knight_anim_stand = 0; const float knight_anim_walk = 1; const float knight_anim_run = 2; @@ -308,7 +304,7 @@ void knight_spawn() } void spawnfunc_monster_knight() -{ +{ if not(autocvar_g_monster_knight) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_knight; diff --git a/qcsrc/server/monsters/monster/mage.qc b/qcsrc/server/monsters/monster/mage.qc index 8c0a04a66..13198e6c7 100644 --- a/qcsrc/server/monsters/monster/mage.qc +++ b/qcsrc/server/monsters/monster/mage.qc @@ -1,12 +1,9 @@ -// size const vector MAGE_MIN = '-36 -36 -24'; const vector MAGE_MAX = '36 36 50'; -// model string MAGE_MODEL = "models/monsters/mage.dpm"; #ifdef SVQC -// cvars float autocvar_g_monster_mage; float autocvar_g_monster_mage_health; float autocvar_g_monster_mage_speed; @@ -30,7 +27,6 @@ float autocvar_g_monster_mage_attack_grenade_lifetime; float autocvar_g_monster_mage_attack_grenade_force; float autocvar_g_monster_mage_attack_grenade_chance; -// animations const float mage_anim_idle = 0; const float mage_anim_walk = 1; const float mage_anim_attack = 2; @@ -362,7 +358,7 @@ void mage_spawn() } void spawnfunc_monster_mage() -{ +{ if not(autocvar_g_monster_mage) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_mage; diff --git a/qcsrc/server/monsters/monster/shambler.qc b/qcsrc/server/monsters/monster/shambler.qc index 15d4d14db..0416bbcc4 100644 --- a/qcsrc/server/monsters/monster/shambler.qc +++ b/qcsrc/server/monsters/monster/shambler.qc @@ -1,12 +1,9 @@ -// size const vector SHAMBLER_MIN = '-41 -41 -31'; const vector SHAMBLER_MAX = '41 41 65'; -// model string SHAMBLER_MODEL = "models/monsters/shambler.mdl"; #ifdef SVQC -// cvars float autocvar_g_monster_shambler; float autocvar_g_monster_shambler_health; float autocvar_g_monster_shambler_damage; @@ -15,7 +12,6 @@ float autocvar_g_monster_shambler_attack_claw_damage; float autocvar_g_monster_shambler_speed_walk; float autocvar_g_monster_shambler_speed_run; -// animations const float shambler_anim_stand = 0; const float shambler_anim_walk = 1; const float shambler_anim_run = 2; @@ -26,7 +22,7 @@ const float shambler_anim_magic = 6; const float shambler_anim_pain = 7; const float shambler_anim_death = 8; -void shambler_think () +void shambler_think() { self.think = shambler_think; self.nextthink = time + self.ticrate; @@ -34,7 +30,7 @@ void shambler_think () monster_move(autocvar_g_monster_shambler_speed_run, autocvar_g_monster_shambler_speed_walk, 300, shambler_anim_run, shambler_anim_walk, shambler_anim_stand); } -void shambler_smash () +void shambler_smash() { self.monster_delayedattack = func_null; self.delay = -1; @@ -42,7 +38,7 @@ void shambler_smash () monster_melee(self.enemy, autocvar_g_monster_shambler_damage, 0.3, DEATH_MONSTER_SHAMBLER_SMASH, TRUE); } -void shambler_delayedsmash () +void shambler_delayedsmash() { monsters_setframe(shambler_anim_smash); self.monster_delayedattack = shambler_smash; @@ -65,7 +61,7 @@ void shambler_swing() } } -void CastLightning () +void CastLightning() { self.monster_delayedattack = func_null; self.delay = -1; @@ -120,7 +116,7 @@ float shambler_attack(float attack_type) return FALSE; } -void shambler_die () +void shambler_die() { Monster_CheckDropCvars ("shambler"); @@ -132,7 +128,7 @@ void shambler_die () monster_hook_death(); // for post-death mods } -void shambler_spawn () +void shambler_spawn() { if not(self.health) self.health = autocvar_g_monster_shambler_health; @@ -151,8 +147,8 @@ void shambler_spawn () monster_hook_spawn(); // for post-spawn mods } -void spawnfunc_monster_shambler () -{ +void spawnfunc_monster_shambler() +{ if not(autocvar_g_monster_shambler) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_shambler; diff --git a/qcsrc/server/monsters/monster/slime.qc b/qcsrc/server/monsters/monster/slime.qc index e32e40ab8..8f73ceaea 100644 --- a/qcsrc/server/monsters/monster/slime.qc +++ b/qcsrc/server/monsters/monster/slime.qc @@ -1,18 +1,14 @@ -// size const vector SLIME_MIN = '-16 -16 -24'; const vector SLIME_MAX = '16 16 16'; -// model string SLIME_MODEL = "models/monsters/slime.dpm"; #ifdef SVQC -// cvars float autocvar_g_monster_slime; float autocvar_g_monster_slime_health; float autocvar_g_monster_slime_speed_walk; float autocvar_g_monster_slime_speed_run; -// animations const float slime_anim_walk = 0; const float slime_anim_idle = 1; const float slime_anim_jump = 2; @@ -20,8 +16,6 @@ const float slime_anim_fly = 3; const float slime_anim_die = 4; const float slime_anim_pain = 5; -void() slime_dead; - void slime_think() { self.think = slime_think; @@ -122,7 +116,7 @@ void slime_spawn() } void spawnfunc_monster_slime() -{ +{ if not(autocvar_g_monster_slime) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_slime; diff --git a/qcsrc/server/monsters/monster/spider.qc b/qcsrc/server/monsters/monster/spider.qc index e23224141..1356eba6a 100644 --- a/qcsrc/server/monsters/monster/spider.qc +++ b/qcsrc/server/monsters/monster/spider.qc @@ -1,12 +1,9 @@ -// size const vector SPIDER_MIN = '-18 -18 -25'; const vector SPIDER_MAX = '18 18 30'; -// model string SPIDER_MODEL = "models/monsters/spider.dpm"; #ifdef SVQC -// cvars float autocvar_g_monster_spider; float autocvar_g_monster_spider_stopspeed; float autocvar_g_monster_spider_attack_leap_delay; @@ -18,7 +15,6 @@ float autocvar_g_monster_spider_speed_walk; float autocvar_g_monster_spider_speed_run; float autocvar_g_monster_spider_attack_type; -// animations const float spider_anim_idle = 0; const float spider_anim_walk = 1; const float spider_anim_attack = 2; @@ -36,7 +32,7 @@ void spider_think() monster_move(autocvar_g_monster_spider_speed_run, autocvar_g_monster_spider_speed_walk, autocvar_g_monster_spider_stopspeed, spider_anim_walk, spider_anim_walk, spider_anim_idle); } -void spider_web_explode () +void spider_web_explode() { float damg = 0, edamg = 0, rad = 1; switch(self.realowner.spider_type) @@ -55,7 +51,7 @@ void spider_web_explode () remove (self); } -void spider_web_touch () +void spider_web_touch() { PROJECTILE_TOUCH; @@ -159,7 +155,7 @@ float spider_attack(float attack_type) return FALSE; } -void spider_die () +void spider_die() { Monster_CheckDropCvars ("spider"); diff --git a/qcsrc/server/monsters/monster/stingray.qc b/qcsrc/server/monsters/monster/stingray.qc index cc28f0842..61dccfbd6 100644 --- a/qcsrc/server/monsters/monster/stingray.qc +++ b/qcsrc/server/monsters/monster/stingray.qc @@ -1,25 +1,21 @@ -// size const vector STINGRAY_MIN = '-20 -20 -31'; const vector STINGRAY_MAX = '20 20 20'; -// model string STINGRAY_MODEL = "models/monsters/fish.mdl"; #ifdef SVQC -// cvars float autocvar_g_monster_stingray; float autocvar_g_monster_stingray_health; float autocvar_g_monster_stingray_damage; float autocvar_g_monster_stingray_speed_walk; float autocvar_g_monster_stingray_speed_run; -// animations const float stingray_anim_attack = 0; const float stingray_anim_death = 1; const float stingray_anim_swim = 2; const float stingray_anim_pain = 3; -void stingray_think () +void stingray_think() { self.think = stingray_think; self.nextthink = time + self.ticrate; @@ -45,7 +41,7 @@ float stingray_attack(float attack_type) return FALSE; } -void stingray_die () +void stingray_die() { Monster_CheckDropCvars ("stingray"); @@ -57,7 +53,7 @@ void stingray_die () monster_hook_death(); // for post-death mods } -void stingray_spawn () +void stingray_spawn() { if not(self.health) self.health = autocvar_g_monster_stingray_health; @@ -74,8 +70,8 @@ void stingray_spawn () monster_hook_spawn(); // for post-spawn mods } -void spawnfunc_monster_stingray () -{ +void spawnfunc_monster_stingray() +{ if not(autocvar_g_monster_stingray) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_stingray; diff --git a/qcsrc/server/monsters/monster/wyvern.qc b/qcsrc/server/monsters/monster/wyvern.qc index e5182285d..e9eda6d6a 100644 --- a/qcsrc/server/monsters/monster/wyvern.qc +++ b/qcsrc/server/monsters/monster/wyvern.qc @@ -1,12 +1,9 @@ -// size const vector WYVERN_MIN = '-20 -20 -58'; const vector WYVERN_MAX = '20 20 20'; -// model string WYVERN_MODEL = "models/monsters/wizard.mdl"; #ifdef SVQC -// cvars float autocvar_g_monster_wyvern; float autocvar_g_monster_wyvern_health; float autocvar_g_monster_wyvern_speed_walk; @@ -18,14 +15,13 @@ float autocvar_g_monster_wyvern_fireball_edgedamage; float autocvar_g_monster_wyvern_fireball_damagetime; float autocvar_g_monster_wyvern_fireball_speed; -// animations const float wyvern_anim_hover = 0; const float wyvern_anim_fly = 1; const float wyvern_anim_magic = 2; const float wyvern_anim_pain = 3; const float wyvern_anim_death = 4; -void wyvern_think () +void wyvern_think() { self.think = wyvern_think; self.nextthink = time + self.ticrate; @@ -131,7 +127,7 @@ void wyvern_spawn() } void spawnfunc_monster_wyvern() -{ +{ if not(autocvar_g_monster_wyvern) { remove(self); return; } self.monster_spawnfunc = spawnfunc_monster_wyvern; diff --git a/qcsrc/server/monsters/monster/zombie.qc b/qcsrc/server/monsters/monster/zombie.qc index 4e74810dd..aa96920d7 100644 --- a/qcsrc/server/monsters/monster/zombie.qc +++ b/qcsrc/server/monsters/monster/zombie.qc @@ -1,12 +1,9 @@ -// size const vector ZOMBIE_MIN = '-18 -18 -25'; const vector ZOMBIE_MAX = '18 18 47'; -// model string ZOMBIE_MODEL = "models/monsters/zombie.dpm"; #ifdef SVQC -// cvars float autocvar_g_monster_zombie; float autocvar_g_monster_zombie_stopspeed; float autocvar_g_monster_zombie_attack_leap_damage; @@ -19,7 +16,6 @@ float autocvar_g_monster_zombie_health; float autocvar_g_monster_zombie_speed_walk; float autocvar_g_monster_zombie_speed_run; -// animations const float zombie_anim_attackleap = 0; const float zombie_anim_attackrun1 = 1; const float zombie_anim_attackrun2 = 2; @@ -60,7 +56,7 @@ void zombie_think() monster_move(autocvar_g_monster_zombie_speed_run, autocvar_g_monster_zombie_speed_walk, autocvar_g_monster_zombie_stopspeed, zombie_anim_runforward, zombie_anim_runforward, zombie_anim_idle); } -void zombie_attack_leap_touch () +void zombie_attack_leap_touch() { if (self.health <= 0) return; @@ -113,7 +109,7 @@ float zombie_attack(float attack_type) return FALSE; } -void zombie_die () +void zombie_die() { Monster_CheckDropCvars ("zombie"); diff --git a/qcsrc/server/mutators/base.qh b/qcsrc/server/mutators/base.qh index e0e14979f..4f33594d9 100644 --- a/qcsrc/server/mutators/base.qh +++ b/qcsrc/server/mutators/base.qh @@ -175,6 +175,7 @@ MUTATOR_HOOKABLE(MonsterDropItem); // called when a monster is dropping loot // INPUT, OUTPUT: .void() monster_loot; + entity other; MUTATOR_HOOKABLE(MonsterMove); // called when a monster moves