Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/devtomaster0424 #285

Merged
merged 5 commits into from
Apr 24, 2024
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: 1 addition & 1 deletion Source/Coop/FreeCamera/FreeCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void Update()
}

var fastMode = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
var movementSpeed = fastMode ? 10f : 2f;
var movementSpeed = fastMode ? 20f : 3f;

if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow))
{
Expand Down
12 changes: 12 additions & 0 deletions Source/Coop/FreeCamera/FreeCameraController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ public void Update()
DisableAndDestroyEffect(effectsController.GetComponent<CC_Wiggle>());
DisableAndDestroyEffect(effectsController.GetComponent<CC_RadialBlur>());
DisableAndDestroyEffect(effectsController.GetComponent<MotionBlur>());
DisableAndDestroyEffect(effectsController.GetComponent<BloodOnScreen>());
DisableAndDestroyEffect(effectsController.GetComponent<GrenadeFlashScreenEffect>());
DisableAndDestroyEffect(effectsController.GetComponent<DepthOfField>());
//DisableAndDestroyEffect(effectsController.GetComponent<RainScreenDrops>());

var ccBlends = fpsCamInstance.EffectsController.GetComponents<CC_Blend>();
if (ccBlends != null)
Expand Down Expand Up @@ -162,6 +166,14 @@ public void ToggleCamera()

if (!_freeCamScript.IsActive)
{
GameObject[] allGameObject = Resources.FindObjectsOfTypeAll<GameObject>();
foreach (GameObject gobj in allGameObject)
{
if (gobj.GetComponent<DisablerCullingObject>() != null)
{
gobj.GetComponent<DisablerCullingObject>().ForceEnable(true);
}
}
SetPlayerToFreecamMode(localPlayer);
}
else
Expand Down
56 changes: 30 additions & 26 deletions Source/Coop/SITGameModes/CoopSITGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ public BossLocationSpawn[] FixBossWaveSettings(WavesSettings wavesSettings, Loca
#endif

var bossLocationSpawns = location.BossLocationSpawn;
TimeSpan CurrentGameTime = GameDateTime.Calculate().TimeOfDay;
if (!wavesSettings.IsBosses)
{
Logger.LogDebug($"{nameof(CoopSITGame)}:{nameof(FixBossWaveSettings)}: Bosses are disabled");
Expand All @@ -479,36 +480,39 @@ public BossLocationSpawn[] FixBossWaveSettings(WavesSettings wavesSettings, Loca
Logger.LogDebug($"{nameof(FixBossWaveSettings)}:===BEFORE===");
Logger.LogDebug($"{nameof(FixBossWaveSettings)}:{bossLocationSpawn.ToJson()}");
#endif
List<int> sourceEscortAmount;
try
{
sourceEscortAmount = bossLocationSpawn.BossEscortAmount.Split(',').Select(int.Parse).ToList();
bossLocationSpawn.ParseMainTypesTypes();
}
catch (Exception)
{
Logger.LogError($"{nameof(CoopSITGame)}:{nameof(FixBossWaveSettings)}: Unable to parse BossEscortAmount");
continue;
}
float bossChance = bossLocationSpawn.BossChance;
if (CanSpawnCultist(GameWorldTime.Hour) && (bossLocationSpawn.BossType == WildSpawnType.sectantPriest || bossLocationSpawn.BossType == WildSpawnType.sectantWarrior))

if (!CanSpawnCultist(CurrentGameTime.Hours) && bossLocationSpawn.BossName.Contains("sectant"))
{
Logger.LogDebug($"Block spawn of Sectant (Cultist) in day time in hour {GameWorldTime.Hour}!");
bossChance = -1f;
Logger.LogDebug($"Block spawn of Sectant (Cultist) in day time in hour {CurrentGameTime.Hours}!");
bossLocationSpawn.BossChance = 0f;
}
bossLocationSpawn.BossChance = bossChance;
bossLocationSpawn.BossEscortAmount = sourceEscortAmount != null ? sourceEscortAmount.Max((int x) => x).ToString() : "1";
if (bossLocationSpawn.Supports == null && !string.IsNullOrEmpty(bossLocationSpawn.BossEscortType) && !bossLocationSpawn.BossName.Equals("bossTagilla"))

//ArchangelWTF: boss types like 'arenaFighterEvent' can have multiple values, split these out and take the first value.
//We could maybe do some fancy randomization here at some point to get a number in between the two values, but for now this works.
if (bossLocationSpawn.BossEscortAmount.Contains(","))
bossLocationSpawn.BossEscortAmount = bossLocationSpawn.BossEscortAmount.Split(',')[0];

int EscortAmount = Convert.ToInt32(bossLocationSpawn.BossEscortAmount);

if (bossLocationSpawn.Supports == null && !string.IsNullOrEmpty(bossLocationSpawn.BossEscortType) && EscortAmount > 0)
{
Logger.LogDebug($"bossLocationSpawn.Supports is Null. Attempt to create them.");

bossLocationSpawn.Supports = new WildSpawnSupports[1];
bossLocationSpawn.Supports[0] = new WildSpawnSupports();
bossLocationSpawn.Supports[0].BossEscortDifficult = new[] { "normal" };
bossLocationSpawn.Supports[0].BossEscortAmount = 3;
if (Enum.TryParse<WildSpawnType>(bossLocationSpawn.BossEscortType, out var t))
bossLocationSpawn.Supports[0].BossEscortType = t;
Enum.TryParse<WildSpawnType>(bossLocationSpawn.BossEscortType, out var EscortType);

bossLocationSpawn.Supports = new WildSpawnSupports[EscortAmount];

for (int i = 0; i < EscortAmount; i++)
{
bossLocationSpawn.Supports[i] = new WildSpawnSupports
{
BossEscortDifficult = new[] { bossLocationSpawn.BossEscortDifficult },
BossEscortAmount = 1,
BossEscortType = EscortType
};
}
}

#if DEBUG
Logger.LogDebug($"{nameof(FixBossWaveSettings)}:===AFTER===");
Logger.LogDebug($"{nameof(FixBossWaveSettings)}:{bossLocationSpawn.ToJson()}");
Expand All @@ -524,13 +528,13 @@ private async Task<LocalPlayer> CreatePhysicalBot(Profile profile, Vector3 posit
if (SITMatchmaking.IsClient)
return null;

if (Bots != null && Bots.Count(x => x.Value != null && x.Value.PlayerHealthController.IsAlive) >= MaxBotCount)
if (Bots != null && !profile.Info.Settings.IsBossOrFollower() && Bots.Count(x => x.Value != null && x.Value.PlayerHealthController.IsAlive) >= MaxBotCount)
{
Logger.LogDebug("Block spawn of Bot. Max Bot Count has been reached!");
return null;
}

if (GameDateTime.Calculate().TimeOfDay < new TimeSpan(20, 0, 0) && profile.Info != null && profile.Info.Settings != null
if (!CanSpawnCultist(GameDateTime.Calculate().TimeOfDay.Hours) && profile.Info != null && profile.Info.Settings != null
&& (profile.Info.Settings.Role == WildSpawnType.sectantPriest || profile.Info.Settings.Role == WildSpawnType.sectantWarrior)
)
{
Expand Down
Loading