]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add autotaunt runner feature and fix hunter eyes black screen time when round is...
authorLegendaryGuard <rootuser999@gmail.com>
Wed, 8 Dec 2021 16:01:29 +0000 (17:01 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Wed, 8 Dec 2021 16:01:29 +0000 (17:01 +0100)
17 files changed:
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/mh/TODO.txt
qcsrc/common/gamemodes/gamemode/mh/cl_mh.qc
qcsrc/common/gamemodes/gamemode/mh/mh.qh
qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc
qcsrc/common/gamemodes/gamemode/mh/sv_mh.qh
qcsrc/common/stats.qh
sound/mh/taunt1.ogg [new file with mode: 0644]
sound/mh/taunt10.ogg [new file with mode: 0644]
sound/mh/taunt2.ogg [new file with mode: 0644]
sound/mh/taunt3.ogg [new file with mode: 0644]
sound/mh/taunt4.ogg [new file with mode: 0644]
sound/mh/taunt5.ogg [new file with mode: 0644]
sound/mh/taunt6.ogg [new file with mode: 0644]
sound/mh/taunt7.ogg [new file with mode: 0644]
sound/mh/taunt8.ogg [new file with mode: 0644]
sound/mh/taunt9.ogg [new file with mode: 0644]

index d6716f7fc74c58619ecf7068ea148b8b78bda52c..fa42fcc2a6c7985178432982b347e82599c60a33 100644 (file)
@@ -585,4 +585,6 @@ set g_mh_weaponarena " " "starting weapons - takes the same options as g_weapona
 set g_mh_weapons_damage 0 "0: no damage, 1: only self-damage for runners, 2: only damage opposing team, 3: only allow hunters to damage runners, 4: self-damage and opposing team damage"
 set g_mh_weapons_force 1 "0: no force, 1: only self-force, 2: self-force and opposing team force"
 set g_mh_limited_ammunition 0 "do players consume ammunition when firing"
-set g_mh_hunterblind 1 "when this is set, hunters can't see anything until the round starts"
\ No newline at end of file
+set g_mh_hunterblind 1 "when this is set, hunters can't see anything until the round starts"
+set g_mh_autotaunt_runner 1 "when this is set, runners play automatically a sound being noticed by everyone"
+set g_mh_autotaunt_runner_time 35 "runner automatic taunt time, plays a sound automatically when time is over, and restarts taunt time"
\ No newline at end of file
index 2ef7f5cc6bfd0e9192a342858439c2ae92af96ed..a3192b817adf0ab216ef0ad9ab327ad90b7e581b 100644 (file)
@@ -2,7 +2,6 @@ add g_mh_startitem cvars to the balance files
 
 +2 waypoint modes, 
 waypoints for runners on round start always and waypoints for hunters when there are 3 or more hunters
-only runners can see other runners but hunters don't see others
 
 rename teams as far as possible
 
@@ -16,7 +15,6 @@ more dynamicity for the code :)
 
 add more TODO: notes
 
-it might need to improve something in Hunter black screen in mh.qh, sv_mh.qc uses HunterEyesStart function to execute black screen
-g_mh_hunterblind 1 // to activate hunter black screen
+if player(runner) taunts, his autotaunt time is restarted. something similar to "voice taunt"
 
 fix waypoint visibility, currently they are always visible to everyone. Fix them to not be visible for spectators of that player.
\ No newline at end of file
index 3e60dce671cb8771d25d92759b16fcfbe383c0a1..bb814acd7f371c1be56846f0a74fb56a27e8085f 100644 (file)
@@ -45,6 +45,27 @@ void HUD_Mod_MH(vector pos, vector mySize)
                        timer_color = '1 0 0'; //red
        }
 
+       // Autotaunt feature
+       string timerrunnertaunt_text = string_null;
+       vector timerrunnertaunt_color = '1 1 1';
+       if(!STAT(GAME_STOPPED) && !warmup_stage && STAT(MH_ROUNDTIMER) > 0)
+       {
+               float timeleft_runnertaunt = max(0, STAT(MH_RUNNER_TAUNTTIMER) - time);
+               timeleft_runnertaunt = ceil(timeleft_runnertaunt);
+               timerrunnertaunt_text = strcat("Taunt: ", seconds_tostring(timeleft_runnertaunt));
+               float secondsLeft = timeleft_runnertaunt;
+               if(intermission_time || secondsLeft >= 20 || warmup_stage || STAT(MH_RUNNER_TAUNTTIMER) == 0)
+                       timerrunnertaunt_color = '1 1 1'; //white
+               else if(secondsLeft >= 10)
+                       timerrunnertaunt_color = '1 1 0'; //yellow
+               else
+                       timerrunnertaunt_color = '1 0 0'; //red
+       }
+
+       // Autotaunt feature
+       if(mystatus == MH_STATUS_RUNNER)
+               drawstring_aspect(pos + eX * (0.3 * mySize.x) + eY * (0.7 * mySize.y), timerrunnertaunt_text, vec2(0.3 * mySize.x, mySize.y), timerrunnertaunt_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+
        //drawpic_aspect_skin(pos, player_icon, vec2(0.5 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        if(!time_text)
                drawstring_aspect(pos, player_text, vec2(mySize.x, mySize.y), player_color, panel_fg_alpha, DRAWFLAG_NORMAL);
index 7f1b0a34a2dd6646219e19906ec6044ef6666c63..d6a18985ae641ee281e0e9456c1fd6b23f8207d8 100644 (file)
@@ -103,6 +103,9 @@ MUTATOR_HOOKFUNCTION(cl_hunteryes, HUD_Draw_overlay)
        if(!eyesblinded)
                return false;
 
+       if(!STAT(GAME_STOPPED) && !warmup_stage && STAT(MH_ROUNDTIMER) > 0)
+               eyesblinded = false;
+       
        if(time <= huntereyes_fadetime)
        {
                HUD_HunterEyes();
@@ -123,22 +126,6 @@ NET_HANDLE(TE_CSQC_HUNTEREYES, bool isNew)
 
        eyesblinded = true;
        huntereyes_appeartime = time;
-       float time_mh_roundstart = (time * 2 + cvar("g_mh_warmup")) / 1.655;
-       if(time <= cvar("g_mh_warmup")) // if it's the first time round starts
-       {
-               huntereyes_fadetime = time_mh_roundstart;
-               // LOG_INFOF("if ENTERED time: %f", time);
-       }
-       else
-       {
-               huntereyes_fadetime = time + cvar("g_mh_warmup");
-               // LOG_INFOF("else ENTERED time: %f", time);
-       }
-       
-       // just another test
-       // if(huntereyes_fadetime > time)
-       //      huntereyes_fadetime = time; LOG_INFOF("time: %f", time);
-
-       // LOG_INFOF("huntereyes_fadetime: %f", huntereyes_fadetime);
+       huntereyes_fadetime = time + cvar("g_mh_warmup");
 }
 #endif
\ No newline at end of file
index 2ab7bac54b417b30ffb15400e54319fa51b7e3e0..71e5638970b7afe7043653df37206a41ba99628a 100644 (file)
@@ -4,6 +4,7 @@
 .vector taggedplayerlocation;
 .vector taggedplayervelocity;
 .vector taggedplayerviewangles;
+.float RunnerSoundTaunt_time;
 
 void MH_FakeTimeLimit(entity e, float t)
 {
@@ -69,6 +70,30 @@ MUTATOR_HOOKFUNCTION(mh, PlayerPreThink)
                player.mh_status = MH_STATUS_HUNTER;
        else if(player.team == Team_IndexToTeam(2))
                player.mh_status = MH_STATUS_RUNNER;
+       
+       // Autotaunt feature
+       if(autocvar_g_mh_autotaunt_runner)
+       {
+               if(!game_stopped && !warmup_stage && round_handler_IsActive() && round_handler_IsRoundStarted())
+               {
+                       if(time > player.RunnerSoundTaunt_time)
+                       {
+                               if(player.team == Team_IndexToTeam(2))
+                               {
+                                       // play sound to make hunter notice
+                                       sound(player, CH_SHOTS, SND_RUNNER_TAUNT_RANDOM(), VOL_BASEVOICE, ATTEN_NORM);
+                                       player.RunnerSoundTaunt_time = time + autocvar_g_mh_autotaunt_runner_time;
+                                       STAT(MH_RUNNER_TAUNTTIMER, player) = player.RunnerSoundTaunt_time;
+                               }
+                       }
+               }
+               else
+               {
+                       // LOG_INFOF("^2RESTARTED RUNNER TAUNT TIMER!");
+                       player.RunnerSoundTaunt_time = time + autocvar_g_mh_autotaunt_runner_time;
+                       STAT(MH_RUNNER_TAUNTTIMER, player) = player.RunnerSoundTaunt_time;
+               }
+       }
 }
 
 MUTATOR_HOOKFUNCTION(mh, Damage_Calculate)
@@ -84,7 +109,7 @@ MUTATOR_HOOKFUNCTION(mh, Damage_Calculate)
                return;
        }
        
-       if(frag_deathtype==DEATH_CAMP.m_id || !IS_PLAYER(frag_attacker)) return;
+       if(frag_deathtype == DEATH_CAMP.m_id || !IS_PLAYER(frag_attacker)) return;
 
        
        if(IS_PLAYER(frag_target) && !IS_DEAD(frag_target)){ //check that the target is a player and not dead, allows anyone to knock around corpses for funsies
index e8e43a206a75039e8a125c0df7bf83e073966317..ffa24e6d03c2eb0447813a728d59f4a0ea5fcc40 100644 (file)
@@ -15,6 +15,8 @@ int autocvar_g_mh_weapons_damage;
 int autocvar_g_mh_weapons_force;
 bool autocvar_g_mh_limited_ammunition;
 bool autocvar_g_mh_hunterblind;
+bool autocvar_g_mh_autotaunt_runner;
+float autocvar_g_mh_autotaunt_runner_time;
 
 int mh_teams;
 bool allowed_to_spawn_untagged = 1;
@@ -28,6 +30,21 @@ float autocvar_g_mh_player_waypoints;
 
 const int ST_MH_ROUNDS = 1;
 
+// Autotaunt feature
+SOUND(RUNNER_TAUNT1, "sound/mh/taunt1");
+SOUND(RUNNER_TAUNT2, "sound/mh/taunt2");
+SOUND(RUNNER_TAUNT3, "sound/mh/taunt3");
+SOUND(RUNNER_TAUNT4, "sound/mh/taunt4");
+SOUND(RUNNER_TAUNT5, "sound/mh/taunt5");
+SOUND(RUNNER_TAUNT6, "sound/mh/taunt6");
+SOUND(RUNNER_TAUNT7, "sound/mh/taunt7");
+SOUND(RUNNER_TAUNT8, "sound/mh/taunt8");
+SOUND(RUNNER_TAUNT9, "sound/mh/taunt9");
+SOUND(RUNNER_TAUNT10, "sound/mh/taunt10");
+Sound SND_RUNNER_TAUNT_RANDOM() {
+    return REGISTRY_GET(Sounds, SND_RUNNER_TAUNT1.m_id + floor(prandom() * 10));
+}
+
 bool MH_CheckTeams();
 bool MH_CheckWinner();
 void MH_RoundStart();
index 7e260ec23aefe3ba5c855ae238935fbc74862a9c..ba75343810f8fa5460e5771b88f36be1666805c8 100644 (file)
@@ -340,6 +340,7 @@ REGISTER_STAT(DOM_PPS_PINK, float)
 
 // man hunt
 REGISTER_STAT(MH_ROUNDTIMER, float)
+REGISTER_STAT(MH_RUNNER_TAUNTTIMER, float)
 
 #ifdef SVQC
 float autocvar_g_teleport_maxspeed;
diff --git a/sound/mh/taunt1.ogg b/sound/mh/taunt1.ogg
new file mode 100644 (file)
index 0000000..0f00278
Binary files /dev/null and b/sound/mh/taunt1.ogg differ
diff --git a/sound/mh/taunt10.ogg b/sound/mh/taunt10.ogg
new file mode 100644 (file)
index 0000000..27e43f2
Binary files /dev/null and b/sound/mh/taunt10.ogg differ
diff --git a/sound/mh/taunt2.ogg b/sound/mh/taunt2.ogg
new file mode 100644 (file)
index 0000000..05c7e2d
Binary files /dev/null and b/sound/mh/taunt2.ogg differ
diff --git a/sound/mh/taunt3.ogg b/sound/mh/taunt3.ogg
new file mode 100644 (file)
index 0000000..1722627
Binary files /dev/null and b/sound/mh/taunt3.ogg differ
diff --git a/sound/mh/taunt4.ogg b/sound/mh/taunt4.ogg
new file mode 100644 (file)
index 0000000..16f7799
Binary files /dev/null and b/sound/mh/taunt4.ogg differ
diff --git a/sound/mh/taunt5.ogg b/sound/mh/taunt5.ogg
new file mode 100644 (file)
index 0000000..fca4ecf
Binary files /dev/null and b/sound/mh/taunt5.ogg differ
diff --git a/sound/mh/taunt6.ogg b/sound/mh/taunt6.ogg
new file mode 100644 (file)
index 0000000..41d91d2
Binary files /dev/null and b/sound/mh/taunt6.ogg differ
diff --git a/sound/mh/taunt7.ogg b/sound/mh/taunt7.ogg
new file mode 100644 (file)
index 0000000..bb2b031
Binary files /dev/null and b/sound/mh/taunt7.ogg differ
diff --git a/sound/mh/taunt8.ogg b/sound/mh/taunt8.ogg
new file mode 100644 (file)
index 0000000..a3128df
Binary files /dev/null and b/sound/mh/taunt8.ogg differ
diff --git a/sound/mh/taunt9.ogg b/sound/mh/taunt9.ogg
new file mode 100644 (file)
index 0000000..a3600e9
Binary files /dev/null and b/sound/mh/taunt9.ogg differ