From: LegendaryGuard Date: Thu, 23 Dec 2021 03:38:49 +0000 (+0100) Subject: Add testing functional prop feature X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8cf94658ca2373ac30c76e184714fc66f4d1cd03;p=xonotic%2Fxonotic-data.pk3dir.git Add testing functional prop feature --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index fa42fcc2a..7e45c4086 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -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 index 000000000..d2acf3155 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 index 000000000..776d559d4 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 index 000000000..ab7266c3f 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 index 000000000..d80a68ce4 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 index 000000000..d842a9e95 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 index 000000000..0b9a2db37 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 index 000000000..d77ffb477 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 index 000000000..669c2e84b 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 index 000000000..24e9612cb 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 index 000000000..55abff82a 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 index 000000000..b539aebbe 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 index 000000000..0a8f6115d 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 index 000000000..04244f646 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 index 000000000..cd3c2313a 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 index 000000000..8152f18c5 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 index 000000000..2d60cdcc6 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 index 000000000..ce33db382 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 index 000000000..d381490b2 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 index 000000000..3b0bbbfc5 Binary files /dev/null and b/models/containers/crate02_reflect.tga differ diff --git a/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc b/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc index 71e563897..30550dbed 100644 --- a/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc +++ b/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc @@ -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; diff --git a/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qh b/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qh index ffa24e6d0..ea3847ff8 100644 --- a/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qh +++ b/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qh @@ -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();