From 878134b97de34ef43a71b2e2a6d4c5d118b14523 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 13 Jun 2013 12:10:30 +1000 Subject: [PATCH] Add an option to auto revive from fall damage --- gamemodes.cfg | 2 ++ qcsrc/common/notifications.qh | 2 ++ qcsrc/server/autocvars.qh | 2 ++ qcsrc/server/mutators/gamemode_freezetag.qc | 11 +++++++++++ 4 files changed, 17 insertions(+) diff --git a/gamemodes.cfg b/gamemodes.cfg index 35bd7acff..744eb02d6 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -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" diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index be2006714..1ad03e59b 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -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"), "") \ diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index d1cce37c2..e72cc4c02 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index ac091cc99..eec33b2ec 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -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; } -- 2.39.2