Skip to content

Commit

Permalink
LS: Reduce burn chance in all modes except extreme, also don't make w…
Browse files Browse the repository at this point in the history
…ater/lava killable blocks (e.g. log) insta-burn in disturbed mode
  • Loading branch information
UnknownShadow200 committed Feb 13, 2023
1 parent 9bd5a9e commit c5770f8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
14 changes: 12 additions & 2 deletions MCGalaxy/Modules/Games/LavaSurvival/LSGame.Physics.cs
Expand Up @@ -202,16 +202,17 @@ public sealed partial class LSGame : RoundsGame
void SpreadLiquid(Level lvl, ushort x, ushort y, ushort z, int index,
BlockID block, bool isWater) {
if (floodMode == LSFloodMode.Calm) return;
Random rand = lvl.physRandom;

bool instaKills = isWater ?
lvl.Props[block].WaterKills : lvl.Props[block].LavaKills;

// TODO need to kill less often
if (instaKills) {
if (instaKills && floodMode > LSFloodMode.Disturbed) {
if (!lvl.CheckSpongeWater(x, y, z)) {
lvl.AddUpdate(index, Block.Air, default(PhysicsArgs));
}
} else if (!lvl.Props[block].OPBlock) {
} else if (!lvl.Props[block].OPBlock && rand.Next(1, 101) <= burnChance) {
PhysicsArgs C = default(PhysicsArgs);
C.Type1 = PhysicsArgs.Wait; C.Value1 = destroyDelay;
C.Type2 = PhysicsArgs.Dissipate; C.Value2 = dissipateChance;
Expand All @@ -237,5 +238,14 @@ public sealed partial class LSGame : RoundsGame
if (mode == LSFloodMode.Wild) return 80;
return 100;
}

byte GetBurnChance() {
LSFloodMode mode = floodMode;

if (mode == LSFloodMode.Disturbed) return 50;
if (mode == LSFloodMode.Furious) return 70;
if (mode == LSFloodMode.Wild) return 85;
return 100;
}
}
}
1 change: 0 additions & 1 deletion MCGalaxy/Modules/Games/LavaSurvival/LSGame.Round.cs
Expand Up @@ -46,7 +46,6 @@ public sealed partial class LSGame : RoundsGame
RoundStart = DateTime.UtcNow;
RoundInProgress = true;
UpdateBlockHandlers();
SetFloodMode(floodMode);

while (RoundInProgress && roundSecs < roundTotalSecs) {
if (!Running) return;
Expand Down
4 changes: 2 additions & 2 deletions MCGalaxy/Modules/Games/LavaSurvival/LSGame.cs
Expand Up @@ -49,7 +49,7 @@ public sealed partial class LSGame : RoundsGame
LSFloodMode floodMode;
int curLayer, spreadDelay;
int roundTotalSecs, floodDelaySecs, layerIntervalSecs;
byte destroyDelay, dissipateChance;
byte destroyDelay, dissipateChance, burnChance;
static bool hooked;

public static LSGame Instance = new LSGame();
Expand Down Expand Up @@ -86,7 +86,6 @@ public sealed partial class LSGame : RoundsGame
roundTotalSecs = (int)Config.GetRoundTime(cfg).TotalSeconds;
floodDelaySecs = (int)Config.GetFloodTime(cfg).TotalSeconds;
layerIntervalSecs = (int)Config.GetLayerInterval(cfg).TotalSeconds;

SetFloodMode(RandomFloodMode(rnd));
}

Expand All @@ -110,6 +109,7 @@ public sealed partial class LSGame : RoundsGame
floodMode = mode;
destroyDelay = GetDestroyDelay();
dissipateChance = GetDissipateChance();
burnChance = GetBurnChance();

if (!RoundInProgress) return;
Map.SetPhysics(floodMode > LSFloodMode.Calm ? 2 : 1);
Expand Down

0 comments on commit c5770f8

Please sign in to comment.