From 8bd9ec178196d417c606c942f9e8bb86130d0f77 Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Sat, 26 May 2018 01:46:31 -0500 Subject: [PATCH] Wolfenstein cheats: Added "Day in the office" hack mode for cheap laughs --- .../java/jace/cheat/WolfensteinCheats.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/jace/cheat/WolfensteinCheats.java b/src/main/java/jace/cheat/WolfensteinCheats.java index 40a8d79..5318f15 100644 --- a/src/main/java/jace/cheat/WolfensteinCheats.java +++ b/src/main/java/jace/cheat/WolfensteinCheats.java @@ -93,6 +93,9 @@ public class WolfensteinCheats extends Cheats { @ConfigurableField(category = "Hack", name = "Legendary (1)", defaultValue = "false", description = "All of them are SS guards!") public static boolean legendary = false; + + @ConfigurableField(category = "Hack", name = "Day at the office (2)", defaultValue = "false", description = "All of them are at desks") + public static boolean dayAtTheOffice = false; @Override public void registerListeners() { @@ -101,6 +104,11 @@ public class WolfensteinCheats extends Cheats { if (rich) { forceValue(MARKS, 255); } + if (dayAtTheOffice) { + for (int i = 0x04080; i < 0x04100; i += 0x010) { + addCheat(RAMEvent.TYPE.READ, this::allDesks, i); + } + } } else { // Only work in the first Wolfenstein game if (uniform) { @@ -172,6 +180,20 @@ public class WolfensteinCheats extends Cheats { return false; } + private void allDesks(RAMEvent evt) { + int location = computer.getMemory().readRaw(evt.getAddress() + 1); + if (!isFinalRoom() || location < 32) { + int type = evt.getNewValue(); + if (type == GUARD) { + evt.setNewValue(SEATED_GUARD); + // Reset the status flag to 0 to prevent the boss desk from rendering, but don't revive dead guards! + if (computer.getMemory().readRaw(evt.getAddress() + 4) != 4) { + computer.getMemory().write(evt.getAddress() + 4, (byte) 0, false, false); + } + } + } + } + private void allDead(RAMEvent evt) { int type = evt.getNewValue(); if (_isBeyondWolfenstein) {