Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions game/jbmod/cfg/vscript_convar_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ vscript_convar_allowlist

// Other
sv_alltalk allowed
sv_jbmod_weapon_respawn_time allowed
sv_jbmod_item_respawn_time allowed
}
Binary file modified game/jbmod/maps/graphs/jb_waterhole.ain
Binary file not shown.
Binary file modified game/jbmod/maps/jb_waterhole.bsp
Binary file not shown.
18 changes: 18 additions & 0 deletions game/jbmod/scripts/client_precache.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
precache
{
"model" "models/player.mdl"
"model" "models/gibs/agibs.mdl"
"model" "models/weapons/v_hands.mdl"

"scriptsound" "HUDQuickInfo.LowAmmo"
"scriptsound" "HUDQuickInfo.LowHealth"

"scriptsound" "FX_AntlionImpact.ShellImpact"
"scriptsound" "Missile.ShotDown"
"scriptsound" "Bullets.DefaultNearmiss"
"scriptsound" "Bullets.GunshipNearmiss"
"scriptsound" "Bullets.StriderNearmiss"

"scriptsound" "Geiger.BeepHigh"
"scriptsound" "Geiger.BeepLow"
}
205 changes: 205 additions & 0 deletions game/jbmod/scripts/vscripts/gamemodes/base.nut
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
// Copyright 2026 The JBMod Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//=============================================================================
// Base gamemode defaults
// All gamemodes should usually IncludeScript this first.
// Override any function below to customize behavior.
//=============================================================================

//=============================================================================
// Spawn Point Registration
//=============================================================================
RegisterEntityClass( "info_player_deathmatch", "info_player_start" );

//=============================================================================
// Precache
//=============================================================================
function OnPrecache()
{
}

//=============================================================================
// Spawn Point Selection
//=============================================================================
function GetSpawnPointClassname( player )
{
return "info_player_deathmatch";
}

//=============================================================================
// Team Selection
//=============================================================================
function OnPlayerPickTeam( player )
{
return Constants.ETeam.TEAM_UNASSIGNED;
}

//=============================================================================
// Model Selection (no-op: engine picks default)
//=============================================================================
function OnPlayerSetModel( player, model )
{
return model;
}

//=============================================================================
// Model Change Notification
//=============================================================================
function OnPlayerModelChanged( player, model )
{
}

//=============================================================================
// Loadout
//=============================================================================
function OnPlayerSpawn( player )
{
player.EquipSuit();
}

//=============================================================================
// Impulse 101 / Give All Items (no-op by default)
//=============================================================================
function OnGiveAllItems( player )
{
}

//=============================================================================
// Respawn (immediate by default)
//=============================================================================
function OnPlayerRespawn( player )
{
return true;
}

//=============================================================================
// Player Killed
//=============================================================================
function OnPlayerKilled( victim, attacker )
{
}

//=============================================================================
// Death Sound
//=============================================================================
function OnPlayerDeathSound( player )
{
return "NPC_Citizen.Die";
}

//=============================================================================
// Per-tick Think
//=============================================================================
function OnThink()
{
}

//=============================================================================
// Damage Modification
//=============================================================================
function OnPlayerTakeDamage( victim, attacker, damage )
{
return damage;
}

//=============================================================================
// Fall Damage (null for default, 0 for none, or custom value)
//=============================================================================
function GetFallDamage( player, fallSpeed )
{
return null;
}

//=============================================================================
// Team Changes
//=============================================================================
function OnPlayerChangeTeam( player, newTeam )
{
return true;
}

//=============================================================================
// Player Relationship
//=============================================================================
function GetPlayerRelationship( player, target )
{
return Constants.ERelationship.GR_NOTTEAMMATE;
}

//=============================================================================
// Weapon/Item Respawn
//=============================================================================
function GetWeaponRespawnTime( classname, limitInWorld )
{
if ( Convars.GetFloat( "mp_weaponstay" ) > 0 && !limitInWorld )
return 0;

return Convars.GetFloat( "sv_jbmod_weapon_respawn_time" );
}

function GetItemRespawnTime( classname )
{
return Convars.GetFloat( "sv_jbmod_item_respawn_time" );
}

function ShouldWeaponRespawn( classname )
{
return true;
}

function CanPickupWeapon( player, classname, ownsWeapon )
{
if ( Convars.GetFloat( "mp_weaponstay" ) > 0 && ownsWeapon )
return false;

return true;
}

//=============================================================================
// Connection / Disconnection
//=============================================================================
function OnPlayerConnect( player )
{
local name = player.GetPlayerName();
if ( name == "" )
name = "<unconnected>";
ClientPrint( null, Constants.EHudNotify.HUD_PRINTNOTIFY, name + " has joined the game\n" );

// Show MOTD by default, override in your own gamemode if you don't want it
player.ShowMOTD();
}

function OnPlayerDisconnect( player )
{
}

//=============================================================================
// Chat (return false to block)
//=============================================================================
function OnPlayerChat( player, text )
{
return text;
}

//=============================================================================
// Round Lifecycle
//=============================================================================
function OnRoundStart()
{
}

function OnRoundEnd()
{
}
52 changes: 51 additions & 1 deletion game/jbmod/scripts/vscripts/gamemodes/cstrike.nut
Original file line number Diff line number Diff line change
@@ -1,4 +1,54 @@
printl( "Loading Counter-Strike..." );
// Copyright 2026 The JBMod Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//=============================================================================
// Counter-Strike gamemode
// Very basic version to load maps, no gameplay logic
//=============================================================================

//=============================================================================
// Include base gamemode for default behavior
//=============================================================================
IncludeScript( "gamemodes/base.nut" );

//=============================================================================
// Spawn Point Registration
//=============================================================================
RegisterEntityClass( "info_player_counterterrorist", "info_player_start" );
RegisterEntityClass( "info_player_terrorist", "info_player_start" );

//=============================================================================
// Preserve Entities
//=============================================================================
PreserveEntityClass( "info_player_counterterrorist" );
PreserveEntityClass( "info_player_terrorist" );

//=============================================================================
// Team Constants
//=============================================================================
const TEAM_COUNTERTERRORIST = Constants.ETeam.TEAM_COMBINE;
const TEAM_TERRORIST = Constants.ETeam.TEAM_REBELS;

//=============================================================================
// Spawn Point Selection
//=============================================================================
function GetSpawnPointClassname( player )
{
local team = player.GetTeam();
if ( team == TEAM_COUNTERTERRORIST )
return "info_player_counterterrorist";
else if ( team == TEAM_TERRORIST )
return "info_player_terrorist";
return "info_player_deathmatch";
}
Loading
Loading