Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
allow bots to be frozen and changed default bot number and default wa…
Browse files Browse the repository at this point in the history
…rmuplimit
  • Loading branch information
namidaka authored and namidaka committed Oct 6, 2023
1 parent 1d60b9c commit 53416f2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
14 changes: 14 additions & 0 deletions src/Module.Server/Common/CrpgServerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static void Init()
public static float ServerExperienceMultiplier { get; private set; } = 1.0f;
public static int RewardTick { get; private set; } = 60;
public static bool TeamBalanceOnce { get; private set; }
public static bool FrozenBots { get; private set; } = false;
public static Tuple<TimeSpan, TimeSpan, TimeZoneInfo>? HappyHours { get; private set; }

[UsedImplicitly]
Expand Down Expand Up @@ -94,7 +95,20 @@ private static void SetTeamBalanceOnce(string? teamBalanceOnceStr)
TeamBalanceOnce = teamBalanceOnce;
Debug.Print($"Set team balance once to {teamBalanceOnce}");
}
[UsedImplicitly]
[ConsoleCommandMethod("crpg_frozen_bots", "Sets the Alarmed status of bots to off.")]
private static void SetFrozenBots(string? frozenBotsStr)
{
if (frozenBotsStr == null
|| !bool.TryParse(frozenBotsStr, out bool frozenBots))
{
Debug.Print($"Invalid Frozen Bots: {frozenBotsStr}");
return;
}

FrozenBots = frozenBots;
Debug.Print($"Set team balance once to {frozenBots}");
}
[UsedImplicitly]
[ConsoleCommandMethod("crpg_happy_hours", "Sets the happy hours. Format: HH:MM-HH:MM,TZ")]
private static void SetHappyHours(string? happHoursStr)
Expand Down
7 changes: 6 additions & 1 deletion src/Module.Server/Common/CrpgSpawningBehaviorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ protected Agent SpawnBotAgent(string classDivisionId, Team team)
agentBuildData.BodyProperties(bodyProperties);

Agent agent = Mission.SpawnAgent(agentBuildData);
agent.SetWatchState(Agent.WatchState.Alarmed);
#if CRPG_SERVER
if (!CrpgServerConfiguration.FrozenBots)
{
agent.SetWatchState(Agent.WatchState.Alarmed);
}
#endif
agent.WieldInitialWeapons();
return agent;
}
Expand Down
7 changes: 4 additions & 3 deletions src/Module.Server/ds_config_crpg_battle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ FriendlyFireDamageMeleeSelfPercent 0
FriendlyFireDamageRangedFriendPercent 50
FriendlyFireDamageRangedSelfPercent 0
MinNumberOfPlayersForMatchStart 0
NumberOfBotsTeam1 2
NumberOfBotsTeam2 2
NumberOfBotsTeam1 20
NumberOfBotsTeam2 20
RoundTotal 10
MapTimeLimit 8
RoundTimeLimit 300
WarmupTimeLimit 1
WarmupTimeLimit 60
crpg_happy_hours 19:00-23:00,Central European Standard Time
start_game
set_automated_battle_count -1
enable_automated_battle_switching
crpg_frozen_bots True

0 comments on commit 53416f2

Please sign in to comment.