diff --git a/src/server/monster_barney.qc b/src/server/monster_barney.qc index 78a6282..62bdb48 100644 --- a/src/server/monster_barney.qc +++ b/src/server/monster_barney.qc @@ -48,6 +48,7 @@ class monster_barney:NSTalkMonster { void(void) monster_barney; + virtual void(void) Spawned; virtual void(void) Respawn; virtual void(void) OnPlayerUse; virtual void(void) Pain; @@ -188,7 +189,7 @@ monster_barney::Respawn(void) } void -monster_barney::monster_barney(void) +monster_barney::Spawned(void) { Sound_Precache("monster_barney.die"); Sound_Precache("monster_barney.pain"); @@ -223,4 +224,12 @@ monster_barney::monster_barney(void) base_mins = [-16,-16,0]; base_maxs = [16,16,72]; m_iAlliance = MAL_FRIEND; + + super::Spawned(); } + + +void +monster_barney::monster_barney(void) +{ +} \ No newline at end of file diff --git a/src/server/monster_houndeye.qc b/src/server/monster_houndeye.qc index 675c5ac..3152b6c 100644 --- a/src/server/monster_houndeye.qc +++ b/src/server/monster_houndeye.qc @@ -63,18 +63,50 @@ class monster_houndeye:NSMonster { float m_flIdleTime; - void(void) monster_houndeye; + void monster_houndeye(void); - virtual void(void) Spawned; - virtual void(void) Pain; - virtual void(void) Death; - virtual void(void) IdleNoise; - virtual void(void) Respawn; + virtual void Spawned(void); + virtual void Pain(void); + virtual void Death(void); + virtual void IdleNoise(void); + virtual void Respawn(void); - virtual int(void) AttackMelee; - virtual void(void) AttackBlast; + virtual int AnimIdle(void); + virtual int AnimWalk(void); + virtual int AnimRun(void); + + virtual int AttackMelee(void); + virtual void AttackBlast(void); + + virtual float MeleeMaxDistance(void); }; + +/* The maximum distance to which we should attempt an attack */ +float +monster_houndeye::MeleeMaxDistance(void) +{ + return HE_BLAST_RADIUS/2; +} + +int +monster_houndeye::AnimIdle(void) +{ + return HE_IDLE; +} + +int +monster_houndeye::AnimWalk(void) +{ + return HE_WALK2; +} + +int +monster_houndeye::AnimRun(void) +{ + return HE_RUN; +} + int monster_houndeye::AttackMelee(void) { @@ -187,6 +219,12 @@ monster_houndeye::Respawn(void) void monster_houndeye::Spawned(void) { + netname = "Houndeye"; + model = "models/houndeye.mdl"; + base_health = Skill_GetValue("houndeye_health", 20); + base_mins = [-16,-16,0]; + base_maxs = [16,16,36]; + m_iAlliance = MAL_ALIEN; super::Spawned(); Sound_Precache("monster_houndeye.alert"); @@ -200,10 +238,4 @@ monster_houndeye::Spawned(void) void monster_houndeye::monster_houndeye(void) { - netname = "Houndeye"; - model = "models/houndeye.mdl"; - base_health = Skill_GetValue("houndeye_health", 20); - base_mins = [-16,-16,0]; - base_maxs = [16,16,36]; - m_iAlliance = MAL_ALIEN; } diff --git a/src/server/monster_human_assassin.qc b/src/server/monster_human_assassin.qc index 558bcdf..d60186d 100644 --- a/src/server/monster_human_assassin.qc +++ b/src/server/monster_human_assassin.qc @@ -51,8 +51,14 @@ class monster_human_assassin:NSMonster virtual void(void) Death; virtual void(void) Respawn; + virtual void Spawned(void); }; +void +monster_human_assassin::monster_human_assassin(void) +{ +} + void monster_human_assassin::Death(void) { @@ -75,19 +81,22 @@ monster_human_assassin::Death(void) super::Death(); } -void -monster_human_assassin::Respawn(void) -{ - super::Respawn(); - frame = HAS_IDLE; -} - void -monster_human_assassin::monster_human_assassin(void) +monster_human_assassin::Spawned(void) { netname = "Assassin"; model = "models/hassassin.mdl"; base_health = Skill_GetValue("hassassin_health", 50); base_mins = [-16,-16,0]; base_maxs = [16,16,72]; + m_iAlliance = MAL_ENEMY; + + super::Spawned(); +} + +void +monster_human_assassin::Respawn(void) +{ + super::Respawn(); + frame = HAS_IDLE; } diff --git a/src/server/monster_human_grunt.qc b/src/server/monster_human_grunt.qc index 3e6bf50..8206657 100644 --- a/src/server/monster_human_grunt.qc +++ b/src/server/monster_human_grunt.qc @@ -113,23 +113,26 @@ class monster_human_grunt:NSTalkMonster { float m_flIdleTime; int m_iMP5Burst; + float m_flAlertNoiseTime; - void(void) monster_human_grunt; - - virtual void(void) Scream; - virtual void(void) IdleChat; - virtual void(void) Respawn; - virtual void(void) Spawned; - virtual void(void) Pain; - virtual void(void) Death; + void monster_human_grunt(void); - virtual int(void) AnimIdle; - virtual int(void) AnimWalk; - virtual int(void) AnimRun; + virtual void Scream(void); + virtual void IdleChat(void); + virtual void Respawn(void); + virtual void Spawned(void); + virtual void Pain(void); + virtual void Death(void); - virtual int(void) AttackRanged; - virtual int(void) AttackMelee; - virtual void(void) AttackKick; + virtual int AnimIdle(void); + virtual int AnimWalk(void); + virtual int AnimRun(void); + + virtual int AttackRanged(void); + virtual int AttackMelee(void); + virtual void AttackKick(void); + + virtual void AlertNoise(void); }; @@ -151,6 +154,15 @@ monster_human_grunt::AnimRun(void) return GR_RUN; } +void +monster_human_grunt::AlertNoise(void) +{ + if (m_flAlertNoiseTime > time) + return; + Sentence("!HG_CHECK"); + m_flAlertNoiseTime = time + 15.0f; +} + int monster_human_grunt::AttackMelee(void) { @@ -196,7 +208,6 @@ monster_human_grunt::AttackRanged(void) } /* functional */ - v_angle = vectoangles(m_eEnemy.origin - origin); TraceAttack_FireBullets(1, origin + [0,0,16], 8, [0.01,0.01], 2); return (1); } @@ -278,14 +289,6 @@ monster_human_grunt::Respawn(void) void monster_human_grunt::Spawned(void) -{ - super::Spawned(); - - Sound_Precache("monster_human_grunt.die"); - Sound_Precache("monster_human_grunt.pain"); -} - -void monster_human_grunt::monster_human_grunt(void) { /* Adding some into other slots in hopes it feels right * listed below are other setences that might need their own: @@ -320,4 +323,12 @@ void monster_human_grunt::monster_human_grunt(void) base_mins = [-16,-16,0]; base_maxs = [16,16,72]; m_iAlliance = MAL_ENEMY; + super::Spawned(); + + Sound_Precache("monster_human_grunt.die"); + Sound_Precache("monster_human_grunt.pain"); +} + +void monster_human_grunt::monster_human_grunt(void) +{ } diff --git a/src/server/monster_ichthyosaur.qc b/src/server/monster_ichthyosaur.qc index 6538519..99ef659 100644 --- a/src/server/monster_ichthyosaur.qc +++ b/src/server/monster_ichthyosaur.qc @@ -125,6 +125,10 @@ monster_ichthyosaur::Respawn(void) void monster_ichthyosaur::Spawned(void) { + netname = "Ichthyosaur"; + model = "models/icky.mdl"; + base_mins = [-32,-32,0]; + base_maxs = [32,32,64]; super::Spawned(); Sound_Precache("monster_ichthyosaur.alert"); @@ -137,8 +141,4 @@ monster_ichthyosaur::Spawned(void) void monster_ichthyosaur::monster_ichthyosaur(void) { - netname = "Ichthyosaur"; - model = "models/icky.mdl"; - base_mins = [-32,-32,0]; - base_maxs = [32,32,64]; } diff --git a/src/server/monster_leech.qc b/src/server/monster_leech.qc index ebc4d24..d836557 100644 --- a/src/server/monster_leech.qc +++ b/src/server/monster_leech.qc @@ -76,6 +76,10 @@ monster_leech::Respawn(void) void monster_leech::Spawned(void) { + netname = "Leech"; + model = "models/leech.mdl"; + base_mins = [-6,-6,0]; + base_maxs = [6,6,6]; super::Spawned(); Sound_Precache("monster_leech.alert"); @@ -84,8 +88,4 @@ monster_leech::Spawned(void) void monster_leech::monster_leech(void) { - netname = "Leech"; - model = "models/leech.mdl"; - base_mins = [-6,-6,0]; - base_maxs = [6,6,6]; } diff --git a/src/server/monster_miniturret.qc b/src/server/monster_miniturret.qc index f8070ac..5ffa5fe 100644 --- a/src/server/monster_miniturret.qc +++ b/src/server/monster_miniturret.qc @@ -35,12 +35,21 @@ enum class monster_miniturret:NSMonster { void(void) monster_miniturret; + + virtual void Spawned(void); }; void monster_miniturret::monster_miniturret(void) +{ +} + + +void monster_miniturret::Spawned(void) { netname = "Mini-Turret"; model = "models/miniturret.mdl"; base_mins = [-16,-16,-32]; base_maxs = [16,16,32]; + + super::Spawned(); } diff --git a/src/server/monster_nihilanth.qc b/src/server/monster_nihilanth.qc index 154fa43..6cb55ff 100644 --- a/src/server/monster_nihilanth.qc +++ b/src/server/monster_nihilanth.qc @@ -120,6 +120,11 @@ monster_nihilanth::Respawn(void) void monster_nihilanth::Spawned(void) { + netname = "Nihilanth"; + model = "models/nihilanth.mdl"; + base_health = Skill_GetValue("nihilanth_health", 800); + base_mins = [-192,-192,-32]; + base_maxs = [192,192,384]; super::Spawned(); Sound_Precache("monster_nihilanth.attack"); @@ -134,9 +139,4 @@ monster_nihilanth::Spawned(void) void monster_nihilanth::monster_nihilanth(void) { - netname = "Nihilanth"; - model = "models/nihilanth.mdl"; - base_health = Skill_GetValue("nihilanth_health", 800); - base_mins = [-192,-192,-32]; - base_maxs = [192,192,384]; } diff --git a/src/server/monster_osprey.qc b/src/server/monster_osprey.qc index 0b19a4f..36d34db 100644 --- a/src/server/monster_osprey.qc +++ b/src/server/monster_osprey.qc @@ -26,19 +26,27 @@ class monster_osprey:NSMonster { void(void) monster_osprey; virtual void(void) Respawn; + + virtual void Spawned(void); }; +void monster_osprey::monster_osprey(void) +{ +} + +void monster_osprey::Spawned(void) +{ + netname = "Osprey"; + model = "models/osprey.mdl"; + base_mins = [-480,-480,-112]; + base_maxs = [480,480,24]; + super::Spawned(); +} + + void monster_osprey::Respawn(void) { super::Respawn(); takedamage = DAMAGE_NO; iBleeds = FALSE; -} - -void monster_osprey::monster_osprey(void) -{ - netname = "Osprey"; - model = "models/osprey.mdl"; - base_mins = [-480,-480,-112]; - base_maxs = [480,480,24]; -} +} \ No newline at end of file diff --git a/src/server/monster_rat.qc b/src/server/monster_rat.qc index 19adc43..788f873 100644 --- a/src/server/monster_rat.qc +++ b/src/server/monster_rat.qc @@ -25,6 +25,8 @@ Rat class monster_rat:NSMonster { void(void) monster_rat; + + virtual void Spawned(void); }; void monster_rat::monster_rat(void) @@ -34,3 +36,13 @@ void monster_rat::monster_rat(void) base_mins = [-6,-6,-0]; base_maxs = [6,6,6]; } + +void monster_rat::Spawned(void) +{ + netname = "Rat"; + model = "models/bigrat.mdl"; + base_mins = [-6,-6,-0]; + base_maxs = [6,6,6]; + + super::Spawned(); +} diff --git a/src/server/monster_scientist.qc b/src/server/monster_scientist.qc index 0e47312..313b753 100644 --- a/src/server/monster_scientist.qc +++ b/src/server/monster_scientist.qc @@ -149,39 +149,6 @@ monster_scientist::SpawnKey(string strKey, string strValue) void monster_scientist::Spawned(void) -{ - super::Spawned(); - - Sound_Precache("monster_scientist.die"); - Sound_Precache("monster_scientist.pain"); - - /* has the body not been overriden, etc. choose a character for us */ - if (m_iBody == -1) { - SetBody((int)floor(random(1,5))); - } - - switch (m_iBody) { - case 1: - m_flPitch = 105; - netname = "Walter"; - break; - case 2: - m_flPitch = 100; - netname = "Einstein"; - break; - case 3: - m_flPitch = 95; - netname = "Luther"; - SetSkin(1); - break; - default: - m_flPitch = 100; - netname = "Slick"; - } -} - -void -monster_scientist::monster_scientist(void) { if (spawnflags & MSF_PREDISASTER) { m_talkAsk = ""; @@ -218,4 +185,38 @@ monster_scientist::monster_scientist(void) base_mins = [-16,-16,0]; base_maxs = [16,16,72]; base_health = Skill_GetValue("scientist_health", 20); + + super::Spawned(); + + Sound_Precache("monster_scientist.die"); + Sound_Precache("monster_scientist.pain"); + + /* has the body not been overriden, etc. choose a character for us */ + if (m_iBody == -1) { + SetBody((int)floor(random(1,5))); + } + + switch (m_iBody) { + case 1: + m_flPitch = 105; + netname = "Walter"; + break; + case 2: + m_flPitch = 100; + netname = "Einstein"; + break; + case 3: + m_flPitch = 95; + netname = "Luther"; + SetSkin(1); + break; + default: + m_flPitch = 100; + netname = "Slick"; + } +} + +void +monster_scientist::monster_scientist(void) +{ } diff --git a/src/server/monster_sentry.qc b/src/server/monster_sentry.qc index 03d3cac..90a7014 100644 --- a/src/server/monster_sentry.qc +++ b/src/server/monster_sentry.qc @@ -68,6 +68,12 @@ monster_sentry::Respawn(void) void monster_sentry::Spawned(void) { + netname = "Sentry"; + model = "models/sentry.mdl"; + base_health = Skill_GetValue("sentry_health", 40); + base_mins = [-16,-16,0]; + base_maxs = [16,16,72]; + super::Spawned(); Sound_Precache("monster_sentry.alert"); @@ -78,9 +84,4 @@ monster_sentry::Spawned(void) void monster_sentry::monster_sentry(void) { - netname = "Sentry"; - model = "models/sentry.mdl"; - base_health = Skill_GetValue("sentry_health", 40); - base_mins = [-16,-16,0]; - base_maxs = [16,16,72]; } diff --git a/src/server/monster_sitting_scientist.qc b/src/server/monster_sitting_scientist.qc index 37445bd..9dc6dc7 100644 --- a/src/server/monster_sitting_scientist.qc +++ b/src/server/monster_sitting_scientist.qc @@ -105,6 +105,8 @@ monster_sitting_scientist::SpawnKey(string strKey, string strValue) void monster_sitting_scientist::Spawned(void) { + model = "models/scientist.mdl"; + super::Spawned(); /* has the body not been overriden, etc. choose a character for us */ @@ -135,5 +137,4 @@ monster_sitting_scientist::Spawned(void) void monster_sitting_scientist::monster_sitting_scientist(void) { - model = "models/scientist.mdl"; } diff --git a/src/server/monster_tentacle.qc b/src/server/monster_tentacle.qc index b160d4a..bb2c11a 100644 --- a/src/server/monster_tentacle.qc +++ b/src/server/monster_tentacle.qc @@ -121,19 +121,19 @@ monster_tentacle::Respawn(void) void monster_tentacle::Spawned(void) { - super::Spawned(); - Sound_Precache("monster_tentacle.alert"); Sound_Precache("monster_tentacle.attack"); Sound_Precache("monster_tentacle.die"); Sound_Precache("monster_tentacle.idle"); + netname = "Tentacle"; + model = "models/tentacle2.mdl"; + base_mins = [-32,-32,0]; + base_maxs = [32,32,64]; + + super::Spawned(); } void monster_tentacle::monster_tentacle(void) { - netname = "Tentacle"; - model = "models/tentacle2.mdl"; - base_mins = [-32,-32,0]; - base_maxs = [32,32,64]; } diff --git a/src/server/monster_turret.qc b/src/server/monster_turret.qc index 44e709c..08472ed 100644 --- a/src/server/monster_turret.qc +++ b/src/server/monster_turret.qc @@ -35,12 +35,20 @@ enum class monster_turret:NSMonster { void(void) monster_turret; + + virtual void Spawned(void); }; void monster_turret::monster_turret(void) +{ +} + +void monster_turret::Spawned(void) { netname = "Turret"; model = "models/turret.mdl"; base_mins = [-16,-16,0]; base_maxs = [16,16,72]; + + super::Spawned(); } diff --git a/src/server/monster_zombie.qc b/src/server/monster_zombie.qc index 165acfa..dd5c82e 100644 --- a/src/server/monster_zombie.qc +++ b/src/server/monster_zombie.qc @@ -88,8 +88,31 @@ class monster_zombie:NSMonster virtual int(void) AttackMelee; virtual void(void) AttackFlail; + + virtual float GetWalkSpeed(void); + virtual float GetChaseSpeed(void); + virtual float GetRunSpeed(void); }; +float +monster_zombie::GetWalkSpeed(void) +{ + return 64; +} + +float +monster_zombie::GetChaseSpeed(void) +{ + return 64; +} + + +float +monster_zombie::GetRunSpeed(void) +{ + return 64; +} + int monster_zombie::AnimIdle(void) { @@ -207,23 +230,23 @@ monster_zombie::Respawn(void) void monster_zombie::Spawned(void) { - super::Spawned(); - Sound_Precache("monster_zombie.alert"); Sound_Precache("monster_zombie.attack"); Sound_Precache("monster_zombie.attackhit"); Sound_Precache("monster_zombie.attackmiss"); Sound_Precache("monster_zombie.idle"); Sound_Precache("monster_zombie.pain"); -} - -void -monster_zombie::monster_zombie(void) -{ netname = "Zombie"; model = "models/zombie.mdl"; base_health = Skill_GetValue("zombie_health", 50); base_mins = [-16,-16,0]; base_maxs = [16,16,72]; m_iAlliance = MAL_ALIEN; + + super::Spawned(); +} + +void +monster_zombie::monster_zombie(void) +{ }