Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c0374f9
some basic KOTH logic, implemented into CTG mode (cuz in-game koth ma…
Apr 5, 2026
4da9f62
move everything from CTG to separate KOTH game mode
Apr 5, 2026
9d15a4e
Fix shotguns not reading number of pellets from scripts. (#1910)
Agiel Apr 5, 2026
9fa661a
some changes to make it somehow playable...
Apr 5, 2026
960afcf
balance thing
Apr 5, 2026
9c0268f
attempt to restore visual signs of checkpoint control
Apr 5, 2026
adc3d2d
added hammer entities
May 10, 2026
4c87f35
minor fixes
Jul 3, 2026
5cdf545
mv CNEO_TriggerKOTHZone init to Activate() func (to avoid nullptrs)
Jul 3, 2026
2c94717
update player detecting logic
Jul 3, 2026
3c3e5ba
renamed some of the trigger's variables...
Jul 3, 2026
6e5667c
Added ability to control triggers for zone entity
Jul 3, 2026
0173731
removed legacy support, moved some logic to other places
Jul 3, 2026
686881a
added koth_master and some minor changes
Jul 4, 2026
60c2e24
fix fgd
Jul 4, 2026
6ee760b
comment changes
Jul 5, 2026
9cf8281
resstore gameinfo file state
Jul 5, 2026
2585174
resstore gameinfo file state v2
Jul 5, 2026
5a12746
.gitignore clion stuff
Jul 5, 2026
f456373
fixed clunky rebase
Jul 5, 2026
9f5a605
ui score draw
Jul 7, 2026
1dd7134
added borders!
Jul 12, 2026
8e54227
+prep time fix
Jul 12, 2026
069fc0f
+prep time fix2, visual fixes and now koth info is a child of the spr…
Jul 12, 2026
cd6343e
added the "both" texture, idk how to add it to git...
Jul 12, 2026
bb84ad6
added pause between zone switches
Jul 12, 2026
4a566e1
rm pause, added zone locked/unlocked states
Jul 12, 2026
7e1c59b
+locked sprite
Jul 12, 2026
9f89a60
LINK_ENTITY_TO_CLASS bugfix
Jul 12, 2026
9a62ee5
do not switch zones if we have only one
Jul 13, 2026
5ea95d9
Merge branch 'master' into master
Mngdd Jul 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -694,3 +694,7 @@ FodyWeavers.xsd

# Selected Background
/game/neo/scripts/[Cc]hapter[Bb]ackgrounds.txt

# clion stuff
/src/cmake-build-debug/
/.idea/
21 changes: 20 additions & 1 deletion game/bin/rebuild.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
6 : "JGR"
4 : "Empty"
5 : "Tutorial"
]
7 : "KOTH"
]

ForcedTeam(choices) : "Forced Team" : -1 : "Skip team menu and spawn as this team" =
[
Expand Down Expand Up @@ -461,3 +462,21 @@
[
radius(float) : "Radius" : 12 : ""
]

@SolidClass base(Trigger) = neo_trigger_koth_zone: "Trigger for zone capture detection. Can be grouped with other triggers into a single zone."
[
zone_name(target_destination) : "Zone name" : "" : "Name of the neo_info_koth_zone this trigger belongs to."
]

@PointClass base(Targetname) iconsprite("vgui/hud/cp/hammer_koth_info.vmt") = neo_info_koth_zone : "Creates a zone to capture. Give it a name, then point one or more neo_trigger_koth_zone's zone_name at that name."
[
]

@PointClass iconsprite("vgui/hud/cp/hammer_koth_master.vmt") = neo_koth_master : "Manages all neo_info_koth_zone entities on the map: picks which one is active and rotates between them. Place exactly one per map."
[
]

@SolidClass base(Targetname) = neo_func_koth_border : "Visual border brush for a KOTH zone. Solidity, +use, shadows and color are all forced by default - not editable here."
[
zone_name(target_destination) : "Zone name" : "" : "Name of the neo_info_koth_zone this border belongs to."
]
39 changes: 31 additions & 8 deletions src/game/client/neo/ui/neo_hud_round_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ void CNEOHud_RoundState::UpdateStateForNeoHudElementDraw()
case NEO_GAME_TYPE_JGR:
m_pWszStatusUnicode = L"Control the Juggernaut\n";
break;
case NEO_GAME_TYPE_KOTH:
m_pWszStatusUnicode = L"Capture the objective!\n";
break;
default:
m_pWszStatusUnicode = L"Await further orders\n";
break;
Expand Down Expand Up @@ -365,6 +368,10 @@ void CNEOHud_RoundState::UpdateStateForNeoHudElementDraw()
{
m_iWszRoundUCSize = V_swprintf_safe(m_wszRoundUnicode, L"DEATHMATCH");
}
else if (NEORules()->GetGameType() == NEO_GAME_TYPE_KOTH)
{
m_iWszRoundUCSize = V_swprintf_safe(m_wszRoundUnicode, L"FIRST TO %i WINS", sv_neo_koth_max_score.GetInt());
}
else
{
m_iWszRoundUCSize = V_swprintf_safe(m_wszRoundUnicode, L"ROUND %i", NEORules()->roundNumber());
Expand Down Expand Up @@ -393,13 +400,21 @@ void CNEOHud_RoundState::UpdateStateForNeoHudElementDraw()
const int localPlayerTeam = GetLocalPlayerTeam();
if (NEORules()->IsTeamplay())
{
if (cl_neo_hud_team_swap_sides.GetBool() && (localPlayerTeam == TEAM_JINRAI || localPlayerTeam == TEAM_NSF)) {
V_snwprintf(m_wszLeftTeamScore, 3, L"%i", GetGlobalTeam(localPlayerTeam)->GetRoundsWon());
V_snwprintf(m_wszRightTeamScore, 3, L"%i", GetGlobalTeam(NEORules()->GetOpposingTeam(localPlayerTeam))->GetRoundsWon());
const bool bSwapToLocal = cl_neo_hud_team_swap_sides.GetBool() && (localPlayerTeam == TEAM_JINRAI || localPlayerTeam == TEAM_NSF);
const int leftScoreTeam = bSwapToLocal ? localPlayerTeam : TEAM_JINRAI;
const int rightScoreTeam = bSwapToLocal ? NEORules()->GetOpposingTeam(localPlayerTeam) : TEAM_NSF;

if (NEORules()->GetGameType() == NEO_GAME_TYPE_KOTH)
{
const int leftScore = (leftScoreTeam == TEAM_JINRAI) ? NEORules()->GetKothTimeJinrai() : NEORules()->GetKothTimeNSF();
const int rightScore = (rightScoreTeam == TEAM_JINRAI) ? NEORules()->GetKothTimeJinrai() : NEORules()->GetKothTimeNSF();
V_snwprintf(m_wszLeftTeamScore, ARRAYSIZE(m_wszLeftTeamScore), L"%i", leftScore);
V_snwprintf(m_wszRightTeamScore, ARRAYSIZE(m_wszRightTeamScore), L"%i", rightScore);
}
else {
V_snwprintf(m_wszLeftTeamScore, 3, L"%i", GetGlobalTeam(TEAM_JINRAI)->GetRoundsWon());
V_snwprintf(m_wszRightTeamScore, 3, L"%i", GetGlobalTeam(TEAM_NSF)->GetRoundsWon());
else
{
V_snwprintf(m_wszLeftTeamScore, ARRAYSIZE(m_wszLeftTeamScore), L"%i", GetGlobalTeam(leftScoreTeam)->GetRoundsWon());
V_snwprintf(m_wszRightTeamScore, ARRAYSIZE(m_wszRightTeamScore), L"%i", GetGlobalTeam(rightScoreTeam)->GetRoundsWon());
}
}
else
Expand Down Expand Up @@ -430,6 +445,13 @@ void CNEOHud_RoundState::UpdateStateForNeoHudElementDraw()
V_sprintf_safe(szPlayersAliveANSI, "%i:%i", GetGlobalTeam(TEAM_JINRAI)->Get_Score(), GetGlobalTeam(TEAM_NSF)->Get_Score());
}
}
// neo TODO: add KOTH gameType (wip) or detect KOTH maps (removed this feature)
// else if (NEORules()->GetGameType() == NEO_GAME_TYPE_KOTH)
// {
// V_sprintf_safe(szPlayersAliveANSI, "J:%d N:%d",
// NEORules()->GetKothTimeJinrai(),
// NEORules()->GetKothTimeNSF());
// }
else
{
V_sprintf_safe(szPlayersAliveANSI, "%i vs %i", m_iLeftPlayersAlive, m_iRightPlayersAlive);
Expand Down Expand Up @@ -547,12 +569,13 @@ void CNEOHud_RoundState::DrawNeoHudElement()
surface()->DrawSetTextFont(m_hOCRLargeFont);
surface()->DrawSetTextPos(m_posLeftTeamScore.x - (fontWidth / 2), m_posLeftTeamScore.y);
surface()->DrawSetTextColor(leftTeamInfo.color);
surface()->DrawPrintText(m_wszLeftTeamScore, 2);
surface()->DrawPrintText(m_wszLeftTeamScore, V_wcslen(m_wszLeftTeamScore));

surface()->GetTextSize(m_hOCRLargeFont, m_wszRightTeamScore, fontWidth, fontHeight);
surface()->DrawSetTextFont(m_hOCRLargeFont);
surface()->DrawSetTextPos(m_posRightTeamScore.x - (fontWidth / 2), m_posRightTeamScore.y);
surface()->DrawSetTextColor(rightTeamInfo.color);
surface()->DrawPrintText(m_wszRightTeamScore, 2);
surface()->DrawPrintText(m_wszRightTeamScore, V_wcslen(m_wszRightTeamScore));
}

m_iLeftPlayersAlive = m_iLeftPlayersTotal = m_iRightPlayersAlive = m_iRightPlayersTotal = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/game/client/neo/ui/neo_hud_round_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ class CNEOHud_RoundState : public CNEOHud_ChildElement, public CHudElement, publ
int m_iSmallFontHeight = 0;

// Center Box info
wchar_t m_wszRoundUnicode[12] = {};
wchar_t m_wszRoundUnicode[32] = {};
int m_iWszRoundUCSize = 0;
wchar_t m_wszTime[6] = {};
wchar_t m_wszLeftTeamScore[3] = {};
wchar_t m_wszRightTeamScore[3] = {};
wchar_t m_wszLeftTeamScore[12] = {};
wchar_t m_wszRightTeamScore[12] = {};
wchar_t m_wszPlayersAliveUnicode[16] = {};
const wchar_t *m_pWszStatusUnicode = nullptr;
int m_iStatusUnicodeSize = 0;
Expand Down
8 changes: 8 additions & 0 deletions src/game/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,14 @@ target_sources_grouped(
neo/neo_te_tocflash.h
neo/neo_tracefilter_collisiongroupdelta.h
neo/neo_dm_spawn.h
neo/neo_trigger_koth_zone.h
neo/neo_info_koth_zone.h
neo/neo_koth_master.h
neo/neo_koth_border.h
neo/neo_trigger_koth_zone.cpp
neo/neo_info_koth_zone.cpp
neo/neo_koth_master.cpp
neo/neo_koth_border.cpp
neo/neo_gamerules_restore.h
${UNITY_SOURCE_NEO_SRC_SERVER}
)
Expand Down
Loading