]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove W_SetupShot from monster code & fix minibosses flying
authorMario <mario.mario@y7mail.com>
Thu, 29 Aug 2013 11:33:27 +0000 (21:33 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 29 Aug 2013 11:33:27 +0000 (21:33 +1000)
qcsrc/common/monsters/lib/monsters.qc
qcsrc/common/monsters/monster/brute.qc
qcsrc/common/monsters/monster/knight.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/mutators/gamemode_ctf.qc

index 4abf318dca1e89457a20563807f7578eb3b0792d..e423b55ed0cb88eeecab1064c818ec2af7f80e04 100644 (file)
@@ -212,7 +212,6 @@ void Monster_CheckMinibossFlag ()
        if ((self.spawnflags & MONSTERFLAG_MINIBOSS) || (chance < autocvar_g_monsters_miniboss_chance))
        {
                self.health += autocvar_g_monsters_miniboss_healthboost;
-               self.flags |= MONSTERFLAG_MINIBOSS;
                if not(self.weapon)
                        self.weapon = WEP_NEX;
        }
index f0268b72817fa825d6b0d361dfdec13c913c740f..3f50e5d2d62a4bd6aca48abbd2528a777ee6dbb3 100644 (file)
@@ -57,8 +57,8 @@ void brute_uzi()
        
        monster_makevectors(self.enemy);
        
-       W_SetupShot (self, autocvar_g_antilag_bullets && 18000 >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, MON_CVAR(brute, attack_uzi_damage));
-       fireBallisticBullet(w_shotorg, w_shotdir, 0.02, 18000, 5, MON_CVAR(brute, attack_uzi_damage), MON_CVAR(brute, attack_uzi_force), DEATH_MONSTER_BRUTE_UZI, 0, 1, 115);
+       sound(self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
+       fireBallisticBullet(CENTER_OR_VIEWOFS(self), v_forward, 0.02, 18000, 5, MON_CVAR(brute, attack_uzi_damage), MON_CVAR(brute, attack_uzi_force), DEATH_MONSTER_BRUTE_UZI, 0, 1, 115);
        endFireBallisticBullet();
        
        if(self.brute_cycles <= MON_CVAR(brute, attack_uzi_bullets))
@@ -116,9 +116,10 @@ void brute_grenade_think()
 void brute_grenade()
 {
        entity gren;
-
-       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, MON_CVAR(brute, attack_grenade_damage));
-       w_shotdir = v_forward; // no TrueAim for grenades please
+       
+       monster_makevectors(self.enemy);
+       
+       sound(self, CH_WEAPON_A, "weapons/grenade_fire.wav", VOL_BASE, ATTN_NORM);
 
        gren = spawn ();
        gren.owner = gren.realowner = self;
@@ -128,7 +129,7 @@ void brute_grenade()
        gren.movetype = MOVETYPE_BOUNCE;
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = DEATH_MONSTER_BRUTE_GRENADE;
-       setorigin(gren, w_shotorg);
+       setorigin(gren, CENTER_OR_VIEWOFS(self));
        setsize(gren, '-3 -3 -3', '3 3 3');
 
        gren.cnt = time + 5;
@@ -143,7 +144,7 @@ void brute_grenade()
        gren.event_damage = brute_grenade_damage;
        gren.damagedbycontents = TRUE;
        gren.missile_flags = MIF_SPLASH | MIF_ARC;
-       W_SetupProjectileVelocityEx(gren, w_shotdir, v_up, MON_CVAR(brute, attack_grenade_speed), MON_CVAR(brute, attack_grenade_speed_up), 0, 0, FALSE);
+       W_SetupProjectileVelocityEx(gren, v_forward, v_up, MON_CVAR(brute, attack_grenade_speed), MON_CVAR(brute, attack_grenade_speed_up), 0, 0, FALSE);
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
index f87ca009188174155ee0b93c09ca4845c59c2d3b..c41c18b9d1cfb56983c426f2298f6fd02e25fbc5 100644 (file)
@@ -285,7 +285,7 @@ float m_knight(float req)
                {
                        float chance = random();
                        monsters_setframe((random() > 0.5) ? knight_anim_death1 : knight_anim_death2);
-                       if(chance < 0.10 || self.flags & MONSTERFLAG_MINIBOSS)
+                       if(chance < 0.10 || self.spawnflags & MONSTERFLAG_MINIBOSS)
                        if(self.candrop)
                        {
                                self.superweapons_finished = time + autocvar_g_balance_superweapons_time + 5; // give the player a few seconds to find the weapon
index 67a3fac95d1a8d44d2ab9a3d63aca3a8886e0969..19d7b116d7273562d975c663fe505fd647408eb0 100644 (file)
@@ -127,10 +127,7 @@ void mage_grenade_touch()
 void mage_throw_itemgrenade()
 {
        makevectors(self.angles);
-
-       W_SetupShot_ProjectileSize (self, '-64 -64 -64', '64 64 64', FALSE, 4, "", CH_WEAPON_A, MON_CVAR(mage, attack_grenade_damage));
-       w_shotdir = v_forward; // no TrueAim for grenades please
-
+       
        entity gren = spawn ();
        gren.owner = gren.realowner = self;
        gren.classname = "grenade";
@@ -147,7 +144,7 @@ void mage_throw_itemgrenade()
        gren.touch = mage_grenade_touch;
 
        gren.missile_flags = MIF_SPLASH | MIF_ARC;
-       W_SetupProjectileVelocityEx(gren, w_shotdir, v_up, MON_CVAR(mage, attack_grenade_speed), MON_CVAR(mage, attack_grenade_speed_up), 0, 0, FALSE);
+       W_SetupProjectileVelocityEx(gren, v_forward, v_up, MON_CVAR(mage, attack_grenade_speed), MON_CVAR(mage, attack_grenade_speed_up), 0, 0, FALSE);
        
        gren.flags = FL_PROJECTILE;
        
index 8888faa0545ebae82f229a58c93bc4ae752facbd..c88ca98a12efac08e5eaeb6d4de75027be8b55df 100644 (file)
@@ -99,10 +99,10 @@ void spider_shootweb(float ptype)
        }
        
        vector fmins = '-4 -4 -4', fmaxs = '4 4 4';
-
-       W_SetupShot_ProjectileSize(self, fmins, fmaxs, FALSE, 2, snd, CH_WEAPON_A, 0);
-
-       w_shotdir = v_forward; // no TrueAim for grenades please
+       
+       monster_makevectors(self.enemy);
+       
+       sound(self, CH_SHOTS, snd, VOL_BASE, ATTN_NORM);
 
        entity proj = spawn ();
        proj.classname = "plasma";
@@ -114,12 +114,12 @@ void spider_shootweb(float ptype)
        proj.nextthink = time + 5;
        PROJECTILE_MAKETRIGGER(proj);
        proj.projectiledeathtype = DEATH_MONSTER_SPIDER_FIRE;
-       setorigin(proj, w_shotorg);
+       setorigin(proj, CENTER_OR_VIEWOFS(self));
 
        //proj.glow_size = 50;
        //proj.glow_color = 45;
        proj.movetype = MOVETYPE_BOUNCE;
-       W_SetupProjectileVelocityEx(proj, w_shotdir, v_up, MON_CVAR(spider, attack_web_speed), MON_CVAR(spider, attack_web_speed_up), 0, 0, FALSE);
+       W_SetupProjectileVelocityEx(proj, v_forward, v_up, MON_CVAR(spider, attack_web_speed), MON_CVAR(spider, attack_web_speed_up), 0, 0, FALSE);
        proj.touch = spider_web_touch;
        setsize(proj, fmins, fmaxs);
        proj.takedamage = DAMAGE_NO;
@@ -155,7 +155,6 @@ float spider_attack(float attack_type)
                        
                        monsters_setframe(spider_anim_attack2);
                        self.attack_finished_single = time + MON_CVAR(spider, attack_web_delay);
-                       monster_makevectors(self.enemy);
                        spider_shootweb(self.spider_type);
                        
                        return TRUE;
index 131c543781c5d1325d1934153ebfc3592c766711..134007cc99aeae524d18a5b189ab3fbae9813b5b 100644 (file)
@@ -163,9 +163,8 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
        // track max damage
        if(accuracy_canbegooddamage(ent))
                accuracy_add(ent, ent.weapon, maxdamage, 0);
-
-       if not(ent.flags & FL_MONSTER)
-               W_HitPlotAnalysis(ent, v_forward, v_right, v_up);
+               
+       W_HitPlotAnalysis(ent, v_forward, v_right, v_up);
 
        if(ent.weaponentity.movedir_x > 0)
                vecs = ent.weaponentity.movedir;
index f4d1c31cf3e3c276797933ebb92420774737f524..988462940c0b9bbda7444f8da2ec5099de42a829 100644 (file)
@@ -454,7 +454,7 @@ void ctf_Handle_Return(entity flag, entity player)
        if(IS_PLAYER(player))
                Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_RETURN_));
                
-       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_RETURN_), player.netname);
+       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_RETURN_), (player.flags & FL_MONSTER) ? player.monster_name : player.netname);
        sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTN_NONE);
        ctf_EventLog("return", flag.team, player);