]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
and now for something completely different
authorMario <zacjardine@y7mail.com>
Fri, 6 Feb 2015 00:00:48 +0000 (11:00 +1100)
committerMario <zacjardine@y7mail.com>
Fri, 6 Feb 2015 00:00:48 +0000 (11:00 +1100)
qcsrc/common/buffs.qh
qcsrc/common/deathtypes.qh
qcsrc/common/notifications.qh
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_buffs.qh

index 5fb644bde81429b513f5f73f0d79bba9daa1be65..634860f2bd67821f6540487ee8e4ccb67630085a 100644 (file)
@@ -53,6 +53,7 @@ REGISTER_BUFF(_("Vengeance"),vengeance,VENGEANCE,15,'0.55 0.5 1');
 REGISTER_BUFF(_("Jump"),jump,JUMP,10,'0.7 0.2 1');
 REGISTER_BUFF(_("Flight"),flight,FLIGHT,11,'1 0.2 0.5');
 REGISTER_BUFF(_("Invisible"),invisible,INVISIBLE,12,'0.9 0.9 0.9');
+REGISTER_BUFF(_("Blessed"),blessed,BLESSED,14,'0.9 0.3 0');
 #undef REGISTER_BUFF
 
 #ifdef SVQC
@@ -80,10 +81,11 @@ BUFF_SPAWNFUNCS(vengeance,          BUFF_VENGEANCE)
 BUFF_SPAWNFUNCS(jump,                  BUFF_JUMP)
 BUFF_SPAWNFUNCS(flight,                        BUFF_FLIGHT)
 BUFF_SPAWNFUNCS(invisible,             BUFF_INVISIBLE)
+BUFF_SPAWNFUNCS(blessed,               BUFF_BLESSED)
 BUFF_SPAWNFUNCS(random,                        0)
 
 BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler,    BUFF_MEDIC)
-BUFF_SPAWNFUNC_Q3TA_COMPAT(resistance, BUFF_RESISTANCE)
+BUFF_SPAWNFUNC_Q3TA_COMPAT(resistance, BUFF_RESISTANCE)
 BUFF_SPAWNFUNC_Q3TA_COMPAT(scout,      BUFF_SPEED)
 BUFF_SPAWNFUNC_Q3TA_COMPAT(ammoregen,  BUFF_AMMO)
 
index b63dcc9074ad04c40a5287a580b5302b6a67715a..4b45a23845e6c7a0b3ee90ae1d9bbb59dc85c20f 100644 (file)
@@ -26,6 +26,7 @@ int DEATH_VHLAST;
        DEATHTYPE(DEATH_DROWN,                  DEATH_SELF_DROWN,                   DEATH_MURDER_DROWN,            NORMAL_POS) \
        DEATHTYPE(DEATH_FALL,                   DEATH_SELF_FALL,                    DEATH_MURDER_FALL,             NORMAL_POS) \
        DEATHTYPE(DEATH_FIRE,                   DEATH_SELF_FIRE,                    DEATH_MURDER_FIRE,             NORMAL_POS) \
+       DEATHTYPE(DEATH_FOOT,                   DEATH_SELF_FOOT,                    NO_MSG,                        NORMAL_POS) \
        DEATHTYPE(DEATH_GENERIC,                DEATH_SELF_GENERIC,                 NO_MSG,                        NORMAL_POS) \
        DEATHTYPE(DEATH_HURTTRIGGER,            DEATH_SELF_VOID,                    DEATH_MURDER_VOID,             NORMAL_POS) \
        DEATHTYPE(DEATH_KILL,                   DEATH_SELF_SUICIDE,                 NO_MSG,                        NORMAL_POS) \
index 8a4865c3a33ca55eb1633f5ad311093a9b5dd037..e8f5c675a47026c9e2aa1564a86ddf8d1c459a2c 100644 (file)
@@ -423,7 +423,8 @@ void Send_Notification_WOCOVA(
     MSG_INFO_NOTIF(1, INFO_DEATH_SELF_DROWN,               2, 1, "s1 s2loc spree_lost", "s1",       "notify_water",         _("^BG%s^K1 couldn't catch their breath%s%s"), _("^BG%s^K1 was in the water for too long%s%s")) \
     MSG_INFO_NOTIF(1, INFO_DEATH_SELF_FALL,                2, 1, "s1 s2loc spree_lost", "s1",       "notify_fall",          _("^BG%s^K1 hit the ground with a crunch%s%s"), _("^BG%s^K1 hit the ground with a bit too much force%s%s")) \
     MSG_INFO_NOTIF(1, INFO_DEATH_SELF_FIRE,                2, 1, "s1 s2loc spree_lost", "s1",       "notify_death",         _("^BG%s^K1 became a bit too crispy%s%s"), _("^BG%s^K1 felt a little hot%s%s")) \
-    MSG_INFO_NOTIF(1, INFO_DEATH_SELF_GENERIC,             2, 1, "s1 s2loc spree_lost", "s1",       "notify_selfkill",      _("^BG%s^K1 died%s%s"), "") \
+    MSG_INFO_NOTIF(1, INFO_DEATH_SELF_FOOT,                2, 1, "s1 s2loc spree_lost", "s1",       "notify_parrot",         _("^BG%s^K1 is a dead parrot!%s%s"),"") \
+    MSG_INFO_NOTIF(1, INFO_DEATH_SELF_GENERIC,             2, 1, "s1 s2loc spree_lost", "s1",       "notify_death",         _("^BG%s^K1 died%s%s"), "") \
     MSG_INFO_NOTIF(1, INFO_DEATH_SELF_LAVA,                2, 1, "s1 s2loc spree_lost", "s1",       "notify_lava",          _("^BG%s^K1 turned into hot slag%s%s"), _("^BG%s^K1 found a hot place%s%s")) \
     MSG_INFO_NOTIF(1, INFO_DEATH_SELF_MON_AFRIT,           2, 1, "s1 s2loc spree_lost", "s1",       "notify_death",         _("^BG%s^K1 was turned to ash by an Afrit%s%s"), "") \
     MSG_INFO_NOTIF(1, INFO_DEATH_SELF_MON_CREEPER,         2, 1, "s1 s2loc spree_lost", "s1",       "notify_death",         _("^BG%s^K1 was blown up by Creeper%s%s"), "") \
@@ -700,6 +701,7 @@ void Send_Notification_WOCOVA(
     MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_DROWN,            0, 0, "",             NO_CPID,             "0 0", _("^K1You couldn't catch your breath!"), "") \
     MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_FALL,             0, 0, "",             NO_CPID,             "0 0", _("^K1You hit the ground with a crunch!"), "") \
     MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_FIRE,             0, 0, "",             NO_CPID,             "0 0", _("^K1You got a little bit too crispy!"), _("^K1You felt a little too hot!")) \
+    MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_FOOT,             0, 0, "",             NO_CPID,             "0 0", _("^K1This is an ex-parrot!"), "") \
     MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_GENERIC,          0, 0, "",             NO_CPID,             "0 0", _("^K1You killed your own dumb self!"), _("^K1You need to be more careful!")) \
     MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_LAVA,             0, 0, "",             NO_CPID,             "0 0", _("^K1You couldn't stand the heat!"), "") \
     MSG_CENTER_NOTIF(1, CENTER_DEATH_SELF_MONSTER,          0, 0, "",             NO_CPID,             "0 0", _("^K1You were killed by a monster!"), _("^K1You need to watch out for monsters!")) \
@@ -907,6 +909,7 @@ void Send_Notification_WOCOVA(
     MSG_MULTI_NOTIF(1, DEATH_SELF_DROWN,                     NO_MSG,        INFO_DEATH_SELF_DROWN,                     CENTER_DEATH_SELF_DROWN) \
     MSG_MULTI_NOTIF(1, DEATH_SELF_FALL,                      NO_MSG,        INFO_DEATH_SELF_FALL,                      CENTER_DEATH_SELF_FALL) \
     MSG_MULTI_NOTIF(1, DEATH_SELF_FIRE,                      NO_MSG,        INFO_DEATH_SELF_FIRE,                      CENTER_DEATH_SELF_FIRE) \
+    MSG_MULTI_NOTIF(1, DEATH_SELF_FOOT,                      NO_MSG,        INFO_DEATH_SELF_FOOT,                      CENTER_DEATH_SELF_FOOT) \
     MSG_MULTI_NOTIF(1, DEATH_SELF_GENERIC,                   NO_MSG,        INFO_DEATH_SELF_GENERIC,                   CENTER_DEATH_SELF_GENERIC) \
     MSG_MULTI_NOTIF(1, DEATH_SELF_LAVA,                      NO_MSG,        INFO_DEATH_SELF_LAVA,                      CENTER_DEATH_SELF_LAVA) \
     MSG_MULTI_NOTIF(1, DEATH_SELF_MON_AFRIT,                 NO_MSG,        INFO_DEATH_SELF_MON_AFRIT,                 CENTER_DEATH_SELF_MONSTER) \
index 93f022d3ba8450f61029925a73f1f62e7ef51ce7..c5fcefd9ec311331b7f51de4e29cd356cdea650a 100644 (file)
@@ -373,6 +373,81 @@ void buff_SpawnReplacement(entity ent, entity old)
        buff_Init(ent);
 }
 
+#ifdef MONTY
+void buff_Blessed_Foot_Touch()
+{
+       if(other.iscreature && other.takedamage && other.health > 0)
+       {
+               int mydamage = 9999;
+               if(other == self.realowner)
+                       mydamage = 5; // but spammed
+               Damage (other, self, world, mydamage, DEATH_FOOT, other.origin, '0 0 0');
+       }
+}
+
+void buff_Blessed_Foot_Think()
+{
+       self.nextthink = time;
+       if(self.buff_blessed_time)
+       if(time >= self.buff_blessed_time)
+       {
+               remove(self);
+               return;
+       }
+       if(self.origin_z <= self.buff_blessed_bottom_z)
+       {
+               if(!self.buff_blessed_soundplayed)
+               {
+                       self.buff_blessed_time = time + 1;
+                       self.velocity = '0 0 0';
+                       setorigin(self, self.buff_blessed_bottom);
+                       //sound(self, CH_TRIGGER_SINGLE, "monty/foot.wav", VOL_BASE, ATTEN_MAX);
+                       sound(self, CH_TRIGGER_SINGLE, "monty/foot.wav", VOL_BASEVOICE, ATTEN_MIN);
+                       self.buff_blessed_soundplayed = true;
+               }
+       }
+       else
+       {
+               self.velocity = '0 0 -1500';
+               //setorigin(self, self.origin - '0 0 10');
+       }
+}
+
+void buff_Blessed_SpawnFoot(entity player)
+{
+       makevectors(player.angles);
+       vector org = player.origin + (v_forward * 220) + ('0 0 1' * 32);
+       vector bottom;
+       vector top;
+       entity foot = spawn();
+
+       foot.realowner = player; // don't set owner, as we want this to crush owner
+       foot.classname = "montyfoot";
+       foot.solid = SOLID_TRIGGER;
+       foot.touch = buff_Blessed_Foot_Touch;
+       foot.think = buff_Blessed_Foot_Think;
+       foot.nextthink = time;
+       foot.movetype = MOVETYPE_NOCLIP;
+       foot.scale = 6;
+
+       setmodel(foot, "models/monty/foot.iqm");
+       setsize(foot, '-150 -150 0', '150 150 250');
+
+       //tracebox(org, foot.mins, foot.maxs, org + '0 0 800', MOVE_NORMAL, foot);
+       top = org + '0 0 800';
+       foot.dphitcontentsmask = DPCONTENTS_SOLID;
+       tracebox(org, foot.mins, foot.maxs, org - '0 0 2000', MOVE_WORLDONLY, foot);
+       foot.dphitcontentsmask = DPCONTENTS_LAVA;
+       bottom = trace_endpos;
+
+       foot.buff_blessed_bottom = bottom;
+       foot.buff_blessed_top = top;
+       setorigin(foot, top);
+
+       sound(player, CH_TRIGGER_SINGLE, "monty/ni.wav", VOL_BASEVOICE, ATTEN_NORM);
+}
+#endif
+
 // mutator hooks
 MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_SplitHealthArmor)
 {
@@ -629,6 +704,20 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
                }
        }
 
+#ifdef MONTY
+       if(!self.crouch)
+               self.buff_blessed_crouch_held = false;
+
+       if(self.buffs & BUFF_BLESSED)
+       if(time >= self.buff_blessed_time)
+       if(self.crouch && !self.buff_blessed_crouch_held)
+       {
+               buff_Blessed_SpawnFoot(self);
+               self.buff_blessed_time = time + 0.5;
+               self.buff_blessed_crouch_held = true;
+       }
+#endif
+
        if((self.buffs & BUFF_INVISIBLE) && (self.oldbuffs & BUFF_INVISIBLE))
        if(self.alpha != autocvar_g_buffs_invisible_alpha)
                self.alpha = autocvar_g_buffs_invisible_alpha;
@@ -785,12 +874,15 @@ void buffs_DelayedInit()
 
 void buffs_Initialize()
 {
+       precache_model("models/monty/foot.iqm");
        precache_model("models/relics/relic.md3");
        precache_sound("misc/strength_respawn.wav");
        precache_sound("misc/shield_respawn.wav");
        precache_sound("relics/relic_effect.wav");
        precache_sound(W_Sound("rocket_impact"));
        precache_sound("keepaway/respawn.wav");
+       precache_sound("monty/foot.wav");
+       precache_sound("monty/ni.wav");
 
        addstat(STAT_BUFFS, AS_INT, buffs);
 
index 2d72e5b666d8ab34fa693e78bc1c9ecb29d18e1c..33d5b40d0b8f8d2872595dc23aa19b20259d2489 100644 (file)
 // disability
 .float buff_disability_time;
 .float buff_disability_effect_time;
+#ifdef MONTY
+// blessed
+.float buff_blessed_time; // a little delay to prevent super spam
+.vector buff_blessed_bottom;
+.vector buff_blessed_top;
+.bool buff_blessed_soundplayed;
+.bool buff_blessed_crouch_held;
+#endif
 
 // buff definitions
 .float buff_active;