Skip to content

Commit

Permalink
LS: Fix block/flood type messages not showing when going to next leve…
Browse files Browse the repository at this point in the history
…l after next map voting finishes (Thanks icanttellyou)
  • Loading branch information
UnknownShadow200 committed Dec 29, 2022
1 parent 0514f42 commit fb9b63f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions MCGalaxy/Modules/Games/LavaSurvival/LSGame.Round.cs
Expand Up @@ -25,7 +25,7 @@ namespace MCGalaxy.Modules.Games.LS
public sealed partial class LSGame : RoundsGame
{
int roundSecs, layerSecs;
protected override void DoRound() {
if (!Running) return;
roundSecs = 0;
Expand All @@ -34,7 +34,10 @@ public sealed partial class LSGame : RoundsGame
Player[] players = PlayerInfo.Online.Items;
foreach (Player p in players)
{
if (p.level == Map) ResetRoundState(p, Get(p));
if (p.level != Map) continue;

ResetRoundState(p, Get(p));
OutputRoundInfo(p);
}

ResetPlayerDeaths();
Expand Down Expand Up @@ -99,28 +102,32 @@ public sealed partial class LSGame : RoundsGame
}

public override void OutputStatus(Player p) {
string block = waterMode ? "water" : "lava";

// TODO: send these messages if player is op
//if (data.layer) {
// Map.ChatLevelOps("There will be " + mapSettings.LayerCount + " layers, each " + mapSettings.LayerHeight + " blocks high.");
// Map.ChatLevelOps("There will be another layer every " + mapSettings.layerInterval + " minutes.");
//}

OutputRoundInfo(p);
OutputTimeInfo(p);
}

void OutputRoundInfo(Player p) {
string block = waterMode ? "water" : "lava";

if (waterMode) p.Message("The map will be flooded with &9water &Sthis round!");
if (layerMode) p.Message("The " + block + " will &aflood in layers &Sthis round!");

if (fastMode) p.Message("The lava will be &cfast &Sthis round!");
if (destroyMode) p.Message("The " + block + " will &cdestroy plants " + (waterMode ? "" : "and flammable blocks ") + "&Sthis round!");
if (floodUp) p.Message("The " + block + " will &cflood upwards &Sthis round!");

OutputTimeInfo(p);
}

public override void OutputTimeInfo(Player p) {
if (!flooded) p.Message(FloodTimeLeftMessage());
p.Message(RoundTimeLeftMessage());
}


protected override bool SetMap(string map) {
if (!base.SetMap(map)) return false;
Expand Down

0 comments on commit fb9b63f

Please sign in to comment.