Skip to content

Instantly share code, notes, and snippets.

@notwa
Last active April 8, 2019 23:02
Show Gist options
  • Save notwa/a5ae511bceb0fda4ce1ce623b86c82d1 to your computer and use it in GitHub Desktop.
Save notwa/a5ae511bceb0fda4ce1ce623b86c82d1 to your computer and use it in GitHub Desktop.
personal NullpoMino tweaks (no gameplay changes): patch -d src -p1 < notwa.patch
diff -ruN src.orig/mu/nu/nullpo/game/play/GameEngine.java src/mu/nu/nullpo/game/play/GameEngine.java
--- src.orig/mu/nu/nullpo/game/play/GameEngine.java 2019-04-03 01:42:36.841722400 +0200
+++ src/mu/nu/nullpo/game/play/GameEngine.java 2019-04-03 01:43:02.322620300 +0200
@@ -811,7 +811,7 @@
blockHidden = -1;
blockHiddenAnim = true;
- blockOutlineType = BLOCK_OUTLINE_NORMAL;
+ blockOutlineType = BLOCK_OUTLINE_NONE; // NOTE(notwa): hack!
blockShowOutlineOnly = false;
heboHiddenEnable = false;
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/mode/DigRaceMode.java src/mu/nu/nullpo/game/subsystem/mode/DigRaceMode.java
--- src.orig/mu/nu/nullpo/game/subsystem/mode/DigRaceMode.java 2019-04-03 01:42:36.942453700 +0200
+++ src/mu/nu/nullpo/game/subsystem/mode/DigRaceMode.java 2019-04-08 06:08:56.436968600 +0200
@@ -472,10 +472,10 @@
receiver.drawScoreFont(engine, playerID, 0, 7, String.valueOf(engine.statistics.totalPieceLocked));
receiver.drawScoreFont(engine, playerID, 0, 9, "LINE/MIN", EventReceiver.COLOR_BLUE);
- receiver.drawScoreFont(engine, playerID, 0, 10, String.valueOf(engine.statistics.lpm));
+ receiver.drawScoreFont(engine, playerID, 0, 10, String.format("%.1f", engine.statistics.lpm)); // NOTE(notwa): hack
receiver.drawScoreFont(engine, playerID, 0, 12, "PIECE/SEC", EventReceiver.COLOR_BLUE);
- receiver.drawScoreFont(engine, playerID, 0, 13, String.valueOf(engine.statistics.pps));
+ receiver.drawScoreFont(engine, playerID, 0, 13, String.format("%.2f", engine.statistics.pps)); // NOTE(notwa): hack
receiver.drawScoreFont(engine, playerID, 0, 15, "TIME", EventReceiver.COLOR_BLUE);
receiver.drawScoreFont(engine, playerID, 0, 16, GeneralUtil.getTime(engine.statistics.time));
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/mode/LineRaceMode.java src/mu/nu/nullpo/game/subsystem/mode/LineRaceMode.java
--- src.orig/mu/nu/nullpo/game/subsystem/mode/LineRaceMode.java 2019-04-03 01:42:37.025231900 +0200
+++ src/mu/nu/nullpo/game/subsystem/mode/LineRaceMode.java 2019-04-03 01:43:02.501649200 +0200
@@ -393,10 +393,10 @@
receiver.drawScoreFont(engine, playerID, 0, 7, String.valueOf(engine.statistics.totalPieceLocked));
receiver.drawScoreFont(engine, playerID, 0, 9, "LINE/MIN", EventReceiver.COLOR_BLUE);
- receiver.drawScoreFont(engine, playerID, 0, 10, String.valueOf(engine.statistics.lpm));
+ receiver.drawScoreFont(engine, playerID, 0, 10, String.format("%.1f", engine.statistics.lpm)); // NOTE(notwa): hack
receiver.drawScoreFont(engine, playerID, 0, 12, "PIECE/SEC", EventReceiver.COLOR_BLUE);
- receiver.drawScoreFont(engine, playerID, 0, 13, String.valueOf(engine.statistics.pps));
+ receiver.drawScoreFont(engine, playerID, 0, 13, String.format("%.2f", engine.statistics.pps)); // NOTE(notwa): hack
receiver.drawScoreFont(engine, playerID, 0, 15, "TIME", EventReceiver.COLOR_BLUE);
receiver.drawScoreFont(engine, playerID, 0, 16, GeneralUtil.getTime(engine.statistics.time));
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/mode/PracticeMode.java src/mu/nu/nullpo/game/subsystem/mode/PracticeMode.java
--- src.orig/mu/nu/nullpo/game/subsystem/mode/PracticeMode.java 2019-04-03 01:42:37.107012500 +0200
+++ src/mu/nu/nullpo/game/subsystem/mode/PracticeMode.java 2019-04-03 01:43:02.583429700 +0200
@@ -1014,11 +1014,11 @@
// 1分間あたり score
receiver.drawScoreFont(engine, playerID, 0, 11, "SCORE/MIN", EventReceiver.COLOR_BLUE);
- receiver.drawScoreFont(engine, playerID, 0, 12, String.format("%-10g", engine.statistics.spm));
+ receiver.drawScoreFont(engine, playerID, 0, 12, String.format("%.0f", engine.statistics.spm - engine.statistics.spm % 10)); // NOTE(notwa): hack
// 1分間あたりのLines
receiver.drawScoreFont(engine, playerID, 0, 14, "LINE/MIN", EventReceiver.COLOR_BLUE);
- receiver.drawScoreFont(engine, playerID, 0, 15, String.valueOf(engine.statistics.lpm));
+ receiver.drawScoreFont(engine, playerID, 0, 15, String.format("%.1f", engine.statistics.lpm)); // NOTE(notwa): hack
// Time
receiver.drawScoreFont(engine, playerID, 0, 17, "TIME", EventReceiver.COLOR_BLUE);
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/randomizer/BagRandomizer.java src/mu/nu/nullpo/game/subsystem/randomizer/BagRandomizer.java
--- src.orig/mu/nu/nullpo/game/subsystem/randomizer/BagRandomizer.java 2019-04-03 01:42:37.216230100 +0200
+++ src/mu/nu/nullpo/game/subsystem/randomizer/BagRandomizer.java 2019-04-03 01:43:02.691142300 +0200
@@ -37,6 +37,7 @@
* 7 piece bag randomizer
* @deprecated No longer used. The current one is net.omegaboshi.nullpomino.game.subsystem.randomizer.BagRandomizer.
*/
+@Deprecated
public class BagRandomizer implements Randomizer {
/*
* Create NEXT sequence
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/randomizer/BagRandomizerNoSZO.java src/mu/nu/nullpo/game/subsystem/randomizer/BagRandomizerNoSZO.java
--- src.orig/mu/nu/nullpo/game/subsystem/randomizer/BagRandomizerNoSZO.java 2019-04-03 01:42:37.218224000 +0200
+++ src/mu/nu/nullpo/game/subsystem/randomizer/BagRandomizerNoSZO.java 2019-04-03 01:43:02.693136800 +0200
@@ -37,6 +37,7 @@
* 7 piece bag randomizer (No SZO at start)
* @deprecated No longer used. The current one is net.omegaboshi.nullpomino.game.subsystem.randomizer.BagNoSZORandomizer.
*/
+@Deprecated
public class BagRandomizerNoSZO implements Randomizer {
/*
* Create NEXT sequence
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/randomizer/History4RollsRandomizer.java src/mu/nu/nullpo/game/subsystem/randomizer/History4RollsRandomizer.java
--- src.orig/mu/nu/nullpo/game/subsystem/randomizer/History4RollsRandomizer.java 2019-04-03 01:42:37.220218800 +0200
+++ src/mu/nu/nullpo/game/subsystem/randomizer/History4RollsRandomizer.java 2019-04-03 01:43:02.695131600 +0200
@@ -37,6 +37,7 @@
* History randomizer (4 rolls)
* @deprecated No longer used. The current one is net.omegaboshi.nullpomino.game.subsystem.randomizer.History4RollsRandomizer.
*/
+@Deprecated
public class History4RollsRandomizer implements Randomizer {
/*
* Create NEXT sequence
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/randomizer/History6RollsRandomizer.java src/mu/nu/nullpo/game/subsystem/randomizer/History6RollsRandomizer.java
--- src.orig/mu/nu/nullpo/game/subsystem/randomizer/History6RollsRandomizer.java 2019-04-03 01:42:37.222214200 +0200
+++ src/mu/nu/nullpo/game/subsystem/randomizer/History6RollsRandomizer.java 2019-04-03 01:43:02.697125800 +0200
@@ -37,6 +37,7 @@
* History randomizer (4 rolls)
* @deprecated No longer used. The current one is net.omegaboshi.nullpomino.game.subsystem.randomizer.History6RollsRandomizer.
*/
+@Deprecated
public class History6RollsRandomizer implements Randomizer {
/*
* Create NEXT sequence
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/randomizer/MemorylessRandomizer.java src/mu/nu/nullpo/game/subsystem/randomizer/MemorylessRandomizer.java
--- src.orig/mu/nu/nullpo/game/subsystem/randomizer/MemorylessRandomizer.java 2019-04-03 01:42:37.225205500 +0200
+++ src/mu/nu/nullpo/game/subsystem/randomizer/MemorylessRandomizer.java 2019-04-03 01:43:02.699121200 +0200
@@ -36,6 +36,7 @@
* Memoryless randomizer
* @deprecated No longer used. The current one is net.omegaboshi.nullpomino.game.subsystem.randomizer.MemorylessRandomizer.
*/
+@Deprecated
public class MemorylessRandomizer implements Randomizer {
/*
* Create NEXT sequence
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/randomizer/NintendoRandomizer.java src/mu/nu/nullpo/game/subsystem/randomizer/NintendoRandomizer.java
--- src.orig/mu/nu/nullpo/game/subsystem/randomizer/NintendoRandomizer.java 2019-04-03 01:42:37.227200400 +0200
+++ src/mu/nu/nullpo/game/subsystem/randomizer/NintendoRandomizer.java 2019-04-03 01:43:02.703110900 +0200
@@ -36,6 +36,7 @@
* Nintendo randomizer
* @deprecated No longer used. The current one is net.omegaboshi.nullpomino.game.subsystem.randomizer.NintendoRandomizer.
*/
+@Deprecated
public class NintendoRandomizer implements Randomizer {
/*
* Create NEXT sequence
diff -ruN src.orig/mu/nu/nullpo/game/subsystem/randomizer/Randomizer.java src/mu/nu/nullpo/game/subsystem/randomizer/Randomizer.java
--- src.orig/mu/nu/nullpo/game/subsystem/randomizer/Randomizer.java 2019-04-03 01:42:37.229195500 +0200
+++ src/mu/nu/nullpo/game/subsystem/randomizer/Randomizer.java 2019-04-03 01:43:02.705104500 +0200
@@ -34,6 +34,7 @@
* Deprecated interface of piece sequence randomizer.
* @deprecated No longer used. The current one is net.omegaboshi.nullpomino.game.subsystem.randomizer.Randomizer.
*/
+@Deprecated
public interface Randomizer {
/**
* Create piece sequence.
diff -ruN src.orig/mu/nu/nullpo/gui/slick/RendererSlick.java src/mu/nu/nullpo/gui/slick/RendererSlick.java
--- src.orig/mu/nu/nullpo/gui/slick/RendererSlick.java 2019-04-03 01:42:37.468554400 +0200
+++ src/mu/nu/nullpo/gui/slick/RendererSlick.java 2019-04-03 01:43:02.943061300 +0200
@@ -542,20 +542,16 @@
graphics.setColor(Color.white);
if(!blkTemp.getAttribute(Block.BLOCK_ATTRIBUTE_CONNECT_UP)) {
- graphics.drawLine(x3, y3, x3 + ls, y3);
- graphics.drawLine(x3, y3 + 1, x3 + ls, y3 + 1);
+ graphics.fillRect(x3, y3, ls, 2); // NOTE(notwa): hack!
}
if(!blkTemp.getAttribute(Block.BLOCK_ATTRIBUTE_CONNECT_DOWN)) {
- graphics.drawLine(x3, y3 + ls, x3 + ls, y3 + ls);
- graphics.drawLine(x3, y3 - 1 + ls, x3 + ls, y3 - 1 + ls);
+ graphics.fillRect(x3, y3 + ls - 1, ls, 2); // NOTE(notwa): hack!
}
if(!blkTemp.getAttribute(Block.BLOCK_ATTRIBUTE_CONNECT_LEFT)) {
- graphics.drawLine(x3, y3, x3, y3 + ls);
- graphics.drawLine(x3 + 1, y3, x3 + 1, y3 + ls);
+ graphics.fillRect(x3, y3, 2, ls); // NOTE(notwa): hack!
}
if(!blkTemp.getAttribute(Block.BLOCK_ATTRIBUTE_CONNECT_RIGHT)) {
- graphics.drawLine(x3 + ls, y3, x3 + ls, y3 + ls);
- graphics.drawLine(x3 - 1 + ls, y3, x3 - 1 + ls, y3 + ls);
+ graphics.fillRect(x3 + ls - 1, y3, 2, ls); // NOTE(notwa): hack!
}
if(blkTemp.getAttribute(Block.BLOCK_ATTRIBUTE_CONNECT_LEFT | Block.BLOCK_ATTRIBUTE_CONNECT_UP)) {
graphics.fillRect(x3, y3, 2, 2);
diff -ruN src.orig/mu/nu/nullpo/gui/slick/ResourceHolder.java src/mu/nu/nullpo/gui/slick/ResourceHolder.java
--- src.orig/mu/nu/nullpo/gui/slick/ResourceHolder.java 2019-04-03 01:42:37.473541200 +0200
+++ src/mu/nu/nullpo/gui/slick/ResourceHolder.java 2019-04-03 01:43:02.947050600 +0200
@@ -312,7 +312,7 @@
Image img = null;
try {
- img = new Image(filename);
+ img = new Image(filename, false, Image.FILTER_NEAREST); // NOTE(notwa): hack!
} catch (Throwable e) {
log.error("Failed to load image from " + filename, e);
try {
diff -ruN src.orig/mu/nu/nullpo/util/GeneralUtil.java src/mu/nu/nullpo/util/GeneralUtil.java
--- src.orig/mu/nu/nullpo/util/GeneralUtil.java 2019-04-03 01:42:37.663036100 +0200
+++ src/mu/nu/nullpo/util/GeneralUtil.java 2019-04-03 01:43:03.140041400 +0200
@@ -56,9 +56,9 @@
* @return String for play time
*/
public static String getTime(int t) {
- if(t < 0) return "--:--.--";
+ if(t < 0) return "--:--.-"; // NOTE(notwa): hack
- return String.format("%02d:%02d.%02d", t / 3600, (t / 60) % 60, (t % 60) * 5 / 3);
+ return String.format("%02d:%02d.%01d", t / 3600, (t / 60) % 60, (t % 60) * 5 / 30); // NOTE(notwa): hack
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment