]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a new mage attack
authorMario <mario.mario@y7mail.com>
Sat, 20 Apr 2013 17:28:22 +0000 (03:28 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 20 Apr 2013 17:28:22 +0000 (03:28 +1000)
monsters.cfg
qcsrc/client/projectile.qc
qcsrc/server/monsters/monster/shalrath.qc

index aa1f16a145a61546f809fda513acf7faef574208..809d1518bee87fc72406a6854c0a923d99d5d95c 100644 (file)
@@ -193,6 +193,16 @@ set g_monster_shalrath_heal_delay 1.5 "Delay between healing bursts"
 set g_monster_shalrath_shield_blockpercent 20 "% of damage inflicted on Vore if using a force field"
 set g_monster_shalrath_shield_delay 7 "Refire for Vore force shield"
 set g_monster_shalrath_shield_time 3 "Amount of time Vore force field lasts"
+set g_monster_shalrath_attack_grenade_damage 25 "Vore fake item grenade attack damage"
+set g_monster_shalrath_attack_grenade_edgedamage 20 "Vore fake item grenade attack edge damage"
+set g_monster_shalrath_attack_grenade_radius 100 "Vore fake item grenade attack explosion radius"
+set g_monster_shalrath_attack_grenade_lifetime 5 "Vore fake item grenade life time"
+set g_monster_shalrath_attack_grenade_speed 150 "Vore fake item grenade forward speed"
+set g_monster_shalrath_attack_grenade_speed_up 95 "Vore fake item grenade upwards speed"
+set g_monster_shalrath_attack_grenade_speed_z 0 "Vore fake item grenade speed angle"
+set g_monster_shalrath_attack_grenade_spread 0 "Vore fake item grenade spread"
+set g_monster_shalrath_attack_grenade_force 170 "Vore fake item grenade damage knockback"
+set g_monster_shalrath_attack_grenade_chance 30 "% chance of Vore attack being fake item grenade"
 
 // Zombie
 set g_monster_zombie 1 "Enable Zombies"
index a0fd4105f751538e06a09d6ef2c702b4975098b9..af8c5ce38afe87505b58fec58bc8edc4c2e1cedd 100644 (file)
@@ -290,7 +290,7 @@ void Ent_Projectile()
                        case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_SEEKER"); break;
                        case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.traileffect = particleeffectnum("TR_SEEKER"); break;
                        
-                       case PROJECTILE_VORE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(""); break;
+                       case PROJECTILE_VORE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum("TR_VORESPIKE"); break;
 
                        case PROJECTILE_RAPTORBOMB:    setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break;
                        case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3");     self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break;
index 8eb48dd11b7b5a1e779e67de2492772c28c14e57..02097c010716e34e059d631dd3b3d0b48ca2a4b2 100644 (file)
@@ -23,6 +23,12 @@ float autocvar_g_monster_shalrath_heal_delay;
 float autocvar_g_monster_shalrath_shield_time;
 float autocvar_g_monster_shalrath_shield_delay;
 float autocvar_g_monster_shalrath_shield_blockpercent;
+float autocvar_g_monster_shalrath_attack_grenade_damage;
+float autocvar_g_monster_shalrath_attack_grenade_edgedamage;
+float autocvar_g_monster_shalrath_attack_grenade_radius;
+float autocvar_g_monster_shalrath_attack_grenade_lifetime;
+float autocvar_g_monster_shalrath_attack_grenade_force;
+float autocvar_g_monster_shalrath_attack_grenade_chance;
 
 // animations
 const float shalrath_anim_idle         = 0;
@@ -109,8 +115,65 @@ void shalrath_attack_melee ()
        self.attack_finished_single = time + autocvar_g_monster_shalrath_attack_melee_delay;
 }
 
+void shalrath_grenade_explode()
+{
+       pointparticles(particleeffectnum("explosion_small"), self.origin, '0 0 0', 1);
+       
+       sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+       RadiusDamage (self, self.realowner, autocvar_g_monster_shalrath_attack_grenade_damage, autocvar_g_monster_shalrath_attack_grenade_edgedamage, autocvar_g_monster_shalrath_attack_grenade_radius, world, autocvar_g_monster_shalrath_attack_grenade_force, DEATH_MONSTER_MAGE, other);
+       remove(self);
+}
+
+void shalrath_grenade_touch()
+{
+       if(IS_PLAYER(other))
+       {
+               PROJECTILE_TOUCH;
+               shalrath_grenade_explode();
+               return;
+       }
+}
+
+void shalrath_throw_itemgrenade()
+{
+       makevectors(self.angles);
+
+       W_SetupShot_ProjectileSize (self, '-64 -64 -64', '64 64 64', FALSE, 4, "", CH_WEAPON_A, autocvar_g_monster_shalrath_attack_grenade_damage);
+       w_shotdir = v_forward; // no TrueAim for grenades please
+
+       entity gren = spawn ();
+       gren.owner = gren.realowner = self;
+       gren.classname = "grenade";
+       gren.bot_dodge = FALSE;
+       gren.movetype = MOVETYPE_BOUNCE;
+       gren.solid = SOLID_TRIGGER;
+       gren.projectiledeathtype = DEATH_MONSTER_MAGE;
+       setorigin(gren, w_shotorg);
+       setsize(gren, '-64 -64 -64', '64 64 64');
+
+       gren.nextthink = time + autocvar_g_monster_shalrath_attack_grenade_lifetime;
+       gren.think = shalrath_grenade_explode;
+       gren.use = shalrath_grenade_explode;
+       gren.touch = shalrath_grenade_touch;
+
+       gren.missile_flags = MIF_SPLASH | MIF_ARC;
+       W_SETUPPROJECTILEVELOCITY_UP(gren, g_monster_shalrath_attack_grenade);
+       
+       gren.flags = FL_PROJECTILE;
+       
+       setmodel(gren, "models/items/g_h50.md3");
+       
+       self.attack_finished_single = time + 1.5;
+}
+
 float shal_missile ()
 {
+       if(random() < autocvar_g_monster_shalrath_attack_grenade_chance / 100)
+       {
+               shalrath_throw_itemgrenade();
+               return TRUE;
+       }
+       
        shalrath_attack();
        
        return TRUE;