fixed sla range
This commit is contained in:
parent
77f01b8596
commit
a017d6988a
7 changed files with 51 additions and 44 deletions
|
@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xmx2g
|
|||
baseGroup = com.github.stachelbeere1248.zombiesutils
|
||||
mcVersion = 1.8.9
|
||||
modid = zombiesutils
|
||||
version = 1.3.5
|
||||
version = 1.3.6
|
|
@ -4,11 +4,12 @@ import java.util.stream.IntStream;
|
|||
|
||||
public enum Prefix {
|
||||
BOSS(0xCC5555, "B"),
|
||||
BLAZES(0xEFB61F, "F"),
|
||||
BLAZES(0xEFB61F, "BL"),
|
||||
SLIME(0x88FF88,"S"),
|
||||
HBM(0x2A415F, "HBM"),
|
||||
WITHER_SKELETON(0x888888, "WS"),
|
||||
OLD_ONE(0x55AA55, "O1"),
|
||||
GIANT(0x00FFFF,"G"),
|
||||
UFO(0x30D5C8,"U"),
|
||||
POLICE(0x16537E,"P"),
|
||||
CELL(0xFF8234,"C"),
|
||||
WINDOW(0xAAAAAA,"W");
|
||||
|
|
|
@ -149,6 +149,7 @@ public class Room {
|
|||
})
|
||||
};
|
||||
}
|
||||
|
||||
@Contract(" -> new")
|
||||
public static Room @NotNull [] getP() {
|
||||
return new Room[]{
|
||||
|
@ -172,7 +173,8 @@ public class Room {
|
|||
new Window(2, 189, 144, 25),
|
||||
}),
|
||||
new Room("Visitor's Room", "v", new Window[]{
|
||||
new Window(1, 261, 146, -45),
|
||||
new Window(1, 261, 144, -45),
|
||||
new Window(2, 273, 144, 13)
|
||||
}),
|
||||
new Room("Library", "l", new Window[]{
|
||||
new Window(1, 265, 158, 9),
|
||||
|
@ -188,7 +190,8 @@ public class Room {
|
|||
}),
|
||||
new Room("The Courts", "cs", new Window[]{
|
||||
new Window(1, 285, 144, 81),
|
||||
new Window(2, 211, 144, 157),
|
||||
new Window(2, 247, 144, 157),
|
||||
new Window(3, 211, 144, 157),
|
||||
}),
|
||||
new Room("Offices", "o", new Window[]{
|
||||
new Window(1, 153, 144, 161),
|
||||
|
@ -205,6 +208,7 @@ public class Room {
|
|||
}),
|
||||
new Room("Basement Corridor", "bc", new Window[]{
|
||||
new Window(1, 231, 130, 29),
|
||||
new Window(2, 193, 130, 31),
|
||||
}),
|
||||
new Room("The Deep", "d", new Window[]{
|
||||
new Window(1, 167, 126, -45),
|
||||
|
@ -224,6 +228,7 @@ public class Room {
|
|||
}),
|
||||
new Room("Alleyway", "a", new Window[]{
|
||||
new Window(1, 101, 144, 133),
|
||||
new Window(2, 147, 144, 117)
|
||||
}),
|
||||
new Room("Guard's Gunroom", "gr", new Window[]{
|
||||
new Window(1, 29, 148, 75),
|
||||
|
@ -250,6 +255,10 @@ public class Room {
|
|||
new Window(1, 37, 144, 15),
|
||||
new Window(2, 37, 144, -11),
|
||||
}),
|
||||
new Room("???", "?", new Window[]{
|
||||
new Window(1, 191, 126, -67),
|
||||
new Window(2, 207, 126, -67),
|
||||
}),
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class SLA {
|
|||
this.rooms = Room.getAA();
|
||||
break;
|
||||
case PRISON:
|
||||
this.rooms = Room.getP();
|
||||
this.rooms = new Room[0];
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected value: " + map);
|
||||
|
@ -86,7 +86,7 @@ public class SLA {
|
|||
}
|
||||
|
||||
// (2x)²+(2y)²+(2z)² = 4(x²+y²+z²) = 4d²
|
||||
final int slaRange = 40;
|
||||
final int slaRange = 50;
|
||||
if (distanceDoubledThenSquared < 4 * slaRange * slaRange) {
|
||||
window.setActive(true);
|
||||
room.increaseActiveWindowCount();
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.github.stachelbeere1248.zombiesutils.handlers;
|
|||
|
||||
import com.github.stachelbeere1248.zombiesutils.ZombiesUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
@ -27,5 +28,14 @@ public class RenderPlayerHandler {
|
|||
}
|
||||
public void togglePlayerVisibility() {
|
||||
this.visible = !this.visible;
|
||||
final String s;
|
||||
if (this.visible) {
|
||||
s = "§dPlayer Visibility §e is now §rON";
|
||||
} else {
|
||||
s = "§dPlayer Visibility §e is now §8OFF";
|
||||
}
|
||||
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
|
||||
s
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ public class Game {
|
|||
|
||||
if (bestSegment == (short) 0) categoryFile.setBestSegment(round, roundTime);
|
||||
else if (roundTime < bestSegment) categoryFile.setBestSegment(round, roundTime);
|
||||
final RecordMessageSender recordMessageSender = new RecordMessageSender(this.category.getName(), round, false, roundTime, bestSegment);
|
||||
final RecordMessageSender recordMessageSender = new RecordMessageSender(this.category.getName(), round, roundTime, bestSegment);
|
||||
recordMessageSender.roundSplit();
|
||||
recordMessageSender.sendRecordMessage();
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ public class Game {
|
|||
|
||||
if (personalBest == 0) categoryFile.setPersonalBest(round, gameTime);
|
||||
else if (gameTime < personalBest) categoryFile.setPersonalBest(round, gameTime);
|
||||
final RecordMessageSender recordMessageSender = new RecordMessageSender(category.getName(), round, true, gameTime, personalBest);
|
||||
final RecordMessageSender recordMessageSender = new RecordMessageSender(category.getName(), round, gameTime, personalBest);
|
||||
if (!escaping) recordMessageSender.gameSplit();
|
||||
else recordMessageSender.helicopterSplit();
|
||||
recordMessageSender.sendRecordMessage();
|
||||
|
|
|
@ -9,33 +9,20 @@ import org.jetbrains.annotations.Contract;
|
|||
|
||||
public class RecordMessageSender {
|
||||
private final StringBuilder recordMessage;
|
||||
private final int roundTime;
|
||||
private final int gameTime;
|
||||
private final int oldPB;
|
||||
private final int oldBS;
|
||||
private final int newTime;
|
||||
private final int oldTime;
|
||||
private final int round;
|
||||
private final String deltaString;
|
||||
private final String timeString;
|
||||
private final boolean cumulative;
|
||||
private String copyString;
|
||||
public RecordMessageSender(final String categoryName, final int round, final boolean cumulative, final int newTime, final int oldTime) {
|
||||
public RecordMessageSender(final String categoryName, final int round, final int newTime, final int oldTime) {
|
||||
this.recordMessage = new StringBuilder(
|
||||
"§l§a▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n§e Category: §d" + categoryName
|
||||
);
|
||||
if (cumulative) {
|
||||
this.gameTime = newTime;
|
||||
this.oldPB = oldTime;
|
||||
this.roundTime = 0;
|
||||
this.oldBS = 0;
|
||||
} else {
|
||||
this.gameTime = 0;
|
||||
this.oldPB = 0;
|
||||
this.roundTime = newTime;
|
||||
this.oldBS = oldTime;
|
||||
}
|
||||
this.deltaString = oldTime != 0 ? formattedDelta(newTime, oldTime) : "";
|
||||
this.newTime = newTime;
|
||||
this.oldTime = oldTime;
|
||||
this.deltaString = oldTime != 0 ? " " + formattedDelta(newTime, oldTime) : "";
|
||||
this.timeString = formattedTime(newTime);
|
||||
this.cumulative = cumulative;
|
||||
this.round = round;
|
||||
}
|
||||
|
||||
|
@ -50,7 +37,7 @@ public class RecordMessageSender {
|
|||
}
|
||||
|
||||
public void gameSplit() {
|
||||
final String announcement = gameTime < oldPB && ZombiesUtils.getInstance().getConfig().getAnnouncePB() ?
|
||||
final String announcement = newTime < oldTime && ZombiesUtils.getInstance().getConfig().getAnnouncePB() ?
|
||||
"\n§e§l***§6§l NEW PERSONAL BEST! §e§l***" : "";
|
||||
this.recordMessage.append(announcement)
|
||||
.append("\n§cRound ")
|
||||
|
@ -66,10 +53,10 @@ public class RecordMessageSender {
|
|||
}
|
||||
|
||||
public void roundSplit() {
|
||||
final String announcement = roundTime < oldBS && ZombiesUtils.getInstance().getConfig().getAnnouncePB() ?
|
||||
final String announcement = newTime < oldTime && ZombiesUtils.getInstance().getConfig().getAnnouncePB() ?
|
||||
"\n§e§l***§6§l NEW BEST SEGMENT! §e§l***" : "";
|
||||
final String timeString = formattedTime(roundTime);
|
||||
final String deltaString = oldBS != 0 ? formattedDelta(roundTime, oldBS) : "";
|
||||
final String timeString = formattedTime(newTime);
|
||||
final String deltaString = oldTime != 0 ? formattedDelta(newTime, oldTime) : "";
|
||||
this.recordMessage.append(announcement)
|
||||
.append("\n§cRound ")
|
||||
.append(round)
|
||||
|
@ -83,10 +70,10 @@ public class RecordMessageSender {
|
|||
String.format("Round %d took %s (%s)!", round, timeString, deltaString);
|
||||
}
|
||||
public void helicopterSplit() {
|
||||
final String announcement = gameTime < oldPB && ZombiesUtils.getInstance().getConfig().getAnnouncePB() ?
|
||||
final String announcement = newTime < oldTime && ZombiesUtils.getInstance().getConfig().getAnnouncePB() ?
|
||||
"\n§e§l***§6§l NEW PERSONAL BEST! §e§l***" : "";
|
||||
this.recordMessage.append(announcement)
|
||||
.append("§8§lHelicopter §r§ecalled at §a")
|
||||
.append("\n§8§lHelicopter §r§ecalled at §a")
|
||||
.append(timeString)
|
||||
.append("§9")
|
||||
.append(deltaString)
|
||||
|
|
Loading…
Add table
Reference in a new issue