]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to auto revive from fall damage
authorMario <mario.mario@y7mail.com>
Thu, 13 Jun 2013 02:10:30 +0000 (12:10 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 13 Jun 2013 02:10:30 +0000 (12:10 +1000)
gamemodes.cfg
qcsrc/common/notifications.qh
qcsrc/server/autocvars.qh
qcsrc/server/mutators/gamemode_freezetag.qc

index 35bd7acff3e3b118c3aac82510b5d8637e69a99b..744eb02d6bc87cad6e8d2f0564f4d080cacd90be 100644 (file)
@@ -278,6 +278,8 @@ seta g_freezetag_point_leadlimit -1 "Freeze Tag point lead limit overriding the
 set g_freezetag_revive_speed 0.4 "Speed for reviving a frozen teammate"
 set g_freezetag_revive_clearspeed 1.6 "Speed at which reviving progress gets lost when out of range"
 set g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
+set g_freezetag_revive_falldamage 0 "Enable reviving from this amount of fall damage"
+set g_freezetag_revive_falldamage_health 40 "Amount of health player has if they revived from falling"
 set g_freezetag_round_timelimit 180
 set g_freezetag_frozen_force 0.6 "How much to multiply the force on a frozen player with"
 set g_freezetag_frozen_maxtime 60 "frozen players will be automatically unfrozen after this time in seconds"
index be2006714b9f0ea8c872aca55be1a360d1ed7a16..1ad03e59b64eaedf029269bdd3d6517f3eaaf1d0 100644 (file)
@@ -326,6 +326,7 @@ void Send_Notification_WOVA(
        MULTITEAM_INFO(1, INFO_DEATH_TEAMKILL_, 4,             3, 1, "s1 s2 s3loc spree_end", "s2 s1",  "notify_teamkill_%s",   _("^BG%s^K1 was betrayed by ^BG%s^K1%s%s\n"), "") \
        MSG_INFO_NOTIF(1, INFO_FREEZETAG_FREEZE,               2, 0, "s1 s2", "",                       "",                     _("^BG%s^K1 was frozen by ^BG%s\n"), "") \
        MSG_INFO_NOTIF(1, INFO_FREEZETAG_REVIVED,              2, 0, "s1 s2", "",                       "",                     _("^BG%s^K3 was revived by ^BG%s\n"), "") \
+       MSG_INFO_NOTIF(1, INFO_FREEZETAG_REVIVED_FALL,         1, 0, "s1", "",                          "",                     _("^BG%s^K3 was revived by falling\n"), "") \
        MSG_INFO_NOTIF(1, INFO_FREEZETAG_AUTO_REVIVED,         1, 1, "s1 f1", "",                       "",                     _("^BG%s^K3 was automatically revived after %s second(s)\n"), "") \
        MULTITEAM_INFO(1, INFO_ROUND_TEAM_WIN_, 4,             0, 0, "", "",                            "",                     _("^TC^TT^BG team wins the round\n"), "") \
        MSG_INFO_NOTIF(1, INFO_ROUND_PLAYER_WIN,               1, 0, "s1", "",                          "",                     _("^BG%s^BG wins the round\n"), "") \
@@ -505,6 +506,7 @@ void Send_Notification_WOVA(
        MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_FREEZE,            1, 0, "s1",           NO_CPID,             "0 0", _("^K3You froze ^BG%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_FROZEN,            1, 0, "s1",           NO_CPID,             "0 0", _("^K1You were frozen by ^BG%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_REVIVE,            1, 0, "s1",           NO_CPID,             "0 0", _("^K3You revived ^BG%s"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_REVIVE_FALL,       0, 0, "",             NO_CPID,             "0 0", _("^K3You revived yourself"), "") \
        MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_REVIVED,           1, 0, "s1",           NO_CPID,             "0 0", _("^K3You were revived by ^BG%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_AUTO_REVIVED,      0, 1, "f1",           NO_CPID,             "0 0", _("^K3You were automatically revived after %s second(s)"), "") \
        MULTITEAM_CENTER(1, CENTER_ROUND_TEAM_WIN_, 4,          0, 0, "",             CPID_ROUND,          "0 0", _("^TC^TT^BG team wins the round"), "") \
index d1cce37c22b4886ae83656520776674b080faad2..e72cc4c0263a96b89027d6f235cd01bf54c87716 100644 (file)
@@ -817,6 +817,8 @@ string autocvar_g_forced_team_red;
 string autocvar_g_forced_team_yellow;
 float autocvar_g_freezetag_frozen_force;
 float autocvar_g_freezetag_frozen_maxtime;
+float autocvar_g_freezetag_revive_falldamage;
+float autocvar_g_freezetag_revive_falldamage_health;
 float autocvar_g_freezetag_point_leadlimit;
 float autocvar_g_freezetag_point_limit;
 float autocvar_g_freezetag_revive_extra_size;
index ac091cc99b164c4ae9838db4b198abcecf82d1f1..eec33b2ec1971228ba6dae3c861761a414b4372f 100644 (file)
@@ -541,6 +541,17 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDamage_Calculate)
 {
        if(frag_target.freezetag_frozen && frag_deathtype != DEATH_HURTTRIGGER)
        {
+               if(autocvar_g_freezetag_revive_falldamage > 0)
+               if(frag_deathtype == DEATH_FALL)
+               if(frag_damage >= autocvar_g_freezetag_revive_falldamage)
+               {
+                       freezetag_Unfreeze(frag_target);
+                       frag_target.health = autocvar_g_freezetag_revive_falldamage_health;
+                       pointparticles(particleeffectnum("iceorglass"), frag_target.origin, '0 0 0', 3);
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, frag_target.netname);
+                       Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_FALL);
+               }
+       
                frag_damage = 0;
                frag_force = frag_force * autocvar_g_freezetag_frozen_force;
        }