]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add testing functional prop feature
authorLegendaryGuard <rootuser999@gmail.com>
Thu, 23 Dec 2021 03:38:49 +0000 (04:38 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Thu, 23 Dec 2021 03:38:49 +0000 (04:38 +0100)
22 files changed:
gamemodes-server.cfg
models/containers/barrel01.blend [new file with mode: 0644]
models/containers/barrel01.iqm [new file with mode: 0644]
models/containers/barrel01.md3 [new file with mode: 0644]
models/containers/barrel01.tga [new file with mode: 0644]
models/containers/barrel01_gloss.tga [new file with mode: 0644]
models/containers/barrel01_norm.tga [new file with mode: 0644]
models/containers/crate01.blend [new file with mode: 0644]
models/containers/crate01.iqm [new file with mode: 0644]
models/containers/crate01.md3 [new file with mode: 0644]
models/containers/crate01.tga [new file with mode: 0644]
models/containers/crate01_bump.tga [new file with mode: 0644]
models/containers/crate01_gloss.tga [new file with mode: 0644]
models/containers/crate01_lod.md3 [new file with mode: 0644]
models/containers/crate01_lod.tga [new file with mode: 0644]
models/containers/crate02.md3 [new file with mode: 0644]
models/containers/crate02.tga [new file with mode: 0644]
models/containers/crate02_gloss.tga [new file with mode: 0644]
models/containers/crate02_norm.tga [new file with mode: 0644]
models/containers/crate02_reflect.tga [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc
qcsrc/common/gamemodes/gamemode/mh/sv_mh.qh

index fa42fcc2a6c7985178432982b347e82599c60a33..7e45c4086c62fce179bf274b81d6c3d4f98503d0 100644 (file)
@@ -587,4 +587,5 @@ set g_mh_weapons_force 1 "0: no force, 1: only self-force, 2: self-force and opp
 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"
 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
+set g_mh_autotaunt_runner_time 35 "runner automatic taunt time, plays a sound automatically when time is over, and restarts taunt time"
+set g_mh_propmode 1 "when this is set, runners are spawned as props"
\ No newline at end of file
diff --git a/models/containers/barrel01.blend b/models/containers/barrel01.blend
new file mode 100644 (file)
index 0000000..d2acf31
Binary files /dev/null and b/models/containers/barrel01.blend differ
diff --git a/models/containers/barrel01.iqm b/models/containers/barrel01.iqm
new file mode 100644 (file)
index 0000000..776d559
Binary files /dev/null and b/models/containers/barrel01.iqm differ
diff --git a/models/containers/barrel01.md3 b/models/containers/barrel01.md3
new file mode 100644 (file)
index 0000000..ab7266c
Binary files /dev/null and b/models/containers/barrel01.md3 differ
diff --git a/models/containers/barrel01.tga b/models/containers/barrel01.tga
new file mode 100644 (file)
index 0000000..d80a68c
Binary files /dev/null and b/models/containers/barrel01.tga differ
diff --git a/models/containers/barrel01_gloss.tga b/models/containers/barrel01_gloss.tga
new file mode 100644 (file)
index 0000000..d842a9e
Binary files /dev/null and b/models/containers/barrel01_gloss.tga differ
diff --git a/models/containers/barrel01_norm.tga b/models/containers/barrel01_norm.tga
new file mode 100644 (file)
index 0000000..0b9a2db
Binary files /dev/null and b/models/containers/barrel01_norm.tga differ
diff --git a/models/containers/crate01.blend b/models/containers/crate01.blend
new file mode 100644 (file)
index 0000000..d77ffb4
Binary files /dev/null and b/models/containers/crate01.blend differ
diff --git a/models/containers/crate01.iqm b/models/containers/crate01.iqm
new file mode 100644 (file)
index 0000000..669c2e8
Binary files /dev/null and b/models/containers/crate01.iqm differ
diff --git a/models/containers/crate01.md3 b/models/containers/crate01.md3
new file mode 100644 (file)
index 0000000..24e9612
Binary files /dev/null and b/models/containers/crate01.md3 differ
diff --git a/models/containers/crate01.tga b/models/containers/crate01.tga
new file mode 100644 (file)
index 0000000..55abff8
Binary files /dev/null and b/models/containers/crate01.tga differ
diff --git a/models/containers/crate01_bump.tga b/models/containers/crate01_bump.tga
new file mode 100644 (file)
index 0000000..b539aeb
Binary files /dev/null and b/models/containers/crate01_bump.tga differ
diff --git a/models/containers/crate01_gloss.tga b/models/containers/crate01_gloss.tga
new file mode 100644 (file)
index 0000000..0a8f611
Binary files /dev/null and b/models/containers/crate01_gloss.tga differ
diff --git a/models/containers/crate01_lod.md3 b/models/containers/crate01_lod.md3
new file mode 100644 (file)
index 0000000..04244f6
Binary files /dev/null and b/models/containers/crate01_lod.md3 differ
diff --git a/models/containers/crate01_lod.tga b/models/containers/crate01_lod.tga
new file mode 100644 (file)
index 0000000..cd3c231
Binary files /dev/null and b/models/containers/crate01_lod.tga differ
diff --git a/models/containers/crate02.md3 b/models/containers/crate02.md3
new file mode 100644 (file)
index 0000000..8152f18
Binary files /dev/null and b/models/containers/crate02.md3 differ
diff --git a/models/containers/crate02.tga b/models/containers/crate02.tga
new file mode 100644 (file)
index 0000000..2d60cdc
Binary files /dev/null and b/models/containers/crate02.tga differ
diff --git a/models/containers/crate02_gloss.tga b/models/containers/crate02_gloss.tga
new file mode 100644 (file)
index 0000000..ce33db3
Binary files /dev/null and b/models/containers/crate02_gloss.tga differ
diff --git a/models/containers/crate02_norm.tga b/models/containers/crate02_norm.tga
new file mode 100644 (file)
index 0000000..d381490
Binary files /dev/null and b/models/containers/crate02_norm.tga differ
diff --git a/models/containers/crate02_reflect.tga b/models/containers/crate02_reflect.tga
new file mode 100644 (file)
index 0000000..3b0bbbf
Binary files /dev/null and b/models/containers/crate02_reflect.tga differ
index 71e5638970b7afe7043653df37206a41ba99628a..30550dbedef2ab5e4a82a5640cff78070733d1db 100644 (file)
@@ -5,6 +5,7 @@
 .vector taggedplayervelocity;
 .vector taggedplayerviewangles;
 .float RunnerSoundTaunt_time;
+.float proptime;
 
 void MH_FakeTimeLimit(entity e, float t)
 {
@@ -34,6 +35,31 @@ MUTATOR_HOOKFUNCTION(mh, Scores_CountFragsRemaining)
        return true;
 }
 
+// Prop feature
+.entity mh_prop; // TODO: to be checked
+MUTATOR_HOOKFUNCTION(mh, FixPlayermodel)
+{
+       entity player = M_ARGV(2, entity);
+
+       if(autocvar_g_mh_propmode)
+       {
+               if (player.team == Team_IndexToTeam(2))
+               {
+                       string defaultmodel = M_ARGV(0, string);
+                       // TODO: to be checked
+                       //M_ARGV(0, string) = player.mh_prop.model;
+                       //M_ARGV(1, int) = player.mh_prop.skin;
+                       
+                       defaultmodel = MDL_RUNNER_PROP2.model_str();
+                       player.playermodel = defaultmodel; // Runners are transformed into props
+                       //cvar_set("sv_defaultcharacter", "1");
+                       //cvar_set("sv_defaultplayermodel", "");
+                       //_setmodel(player, defaultmodel);
+                       //setplayermodel(player, MDL_RUNNER_PROP_RANDOM().model_str());//LOG_INFOF("Runner %s fixplayermodel disabled", player.netname);
+               }
+       }
+}
+
 // ===================
 //  weaponarena hooks
 // ===================
@@ -71,6 +97,16 @@ MUTATOR_HOOKFUNCTION(mh, PlayerPreThink)
        else if(player.team == Team_IndexToTeam(2))
                player.mh_status = MH_STATUS_RUNNER;
        
+       if(!IS_DEAD(player) && player.team == Team_IndexToTeam(2))
+               traceline_antilag(
+                       player, 
+                       CS(player).cursor_trace_start, 
+                       CS(player).cursor_trace_start + normalize(CS(player).cursor_trace_endpos - CS(player).cursor_trace_start) * max_shot_distance, 
+                       MOVE_NORMAL, 
+                       player, 
+                       ANTILAG_LATENCY(player)
+               );
+       
        // Autotaunt feature
        if(autocvar_g_mh_autotaunt_runner)
        {
@@ -686,6 +722,17 @@ MUTATOR_HOOKFUNCTION(mh, PlayerSpawn)
                if(player.team == Team_IndexToTeam(1))
                        HunterEyesStart(player); // Hunters can't see anything until round starts
        }
+
+       if(autocvar_g_mh_propmode)
+       {
+               if(player.team == Team_IndexToTeam(2))
+               {
+                       setmodel(player, MDL_RUNNER_PROP2);
+                       //setplayermodel(player, MDL_RUNNER_PROP_RANDOM().model_str());//prop_setup(player);
+                       //setmodel(player, MDL_RUNNER_PROP_RANDOM());
+                       LOG_INFOF("Spawned prop");
+               }
+       }
        
        if(player.team == Team_IndexToTeam(2) && !allowed_to_spawn_untagged && Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(2)) > 1 && round_handler_IsActive() && round_handler_IsRoundStarted()){
                player.mh_status = MH_STATUS_RUNNER;
index ffa24e6d03c2eb0447813a728d59f4a0ea5fcc40..ea3847ff8f02b6ed42516689e3845df3c5817c49 100644 (file)
@@ -15,6 +15,7 @@ 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_propmode;
 bool autocvar_g_mh_autotaunt_runner;
 float autocvar_g_mh_autotaunt_runner_time;
 
@@ -45,6 +46,13 @@ Sound SND_RUNNER_TAUNT_RANDOM() {
     return REGISTRY_GET(Sounds, SND_RUNNER_TAUNT1.m_id + floor(prandom() * 10));
 }
 
+// Prop feature
+MODEL(RUNNER_PROP1, "models/containers/barrel01.iqm");
+MODEL(RUNNER_PROP2, "models/containers/crate01.iqm");
+Model MDL_RUNNER_PROP_RANDOM() {
+    return REGISTRY_GET(Sounds, MDL_RUNNER_PROP1.m_id + floor(prandom() * 2));
+}
+
 bool MH_CheckTeams();
 bool MH_CheckWinner();
 void MH_RoundStart();