mirror of https://github.com/badvision/jace.git
Wolfenstein cheats: Added "Day in the office" hack mode for cheap laughs
This commit is contained in:
parent
f7ca7c198c
commit
8bd9ec1781
|
@ -93,6 +93,9 @@ public class WolfensteinCheats extends Cheats {
|
||||||
|
|
||||||
@ConfigurableField(category = "Hack", name = "Legendary (1)", defaultValue = "false", description = "All of them are SS guards!")
|
@ConfigurableField(category = "Hack", name = "Legendary (1)", defaultValue = "false", description = "All of them are SS guards!")
|
||||||
public static boolean legendary = false;
|
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
|
@Override
|
||||||
public void registerListeners() {
|
public void registerListeners() {
|
||||||
|
@ -101,6 +104,11 @@ public class WolfensteinCheats extends Cheats {
|
||||||
if (rich) {
|
if (rich) {
|
||||||
forceValue(MARKS, 255);
|
forceValue(MARKS, 255);
|
||||||
}
|
}
|
||||||
|
if (dayAtTheOffice) {
|
||||||
|
for (int i = 0x04080; i < 0x04100; i += 0x010) {
|
||||||
|
addCheat(RAMEvent.TYPE.READ, this::allDesks, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Only work in the first Wolfenstein game
|
// Only work in the first Wolfenstein game
|
||||||
if (uniform) {
|
if (uniform) {
|
||||||
|
@ -172,6 +180,20 @@ public class WolfensteinCheats extends Cheats {
|
||||||
return false;
|
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) {
|
private void allDead(RAMEvent evt) {
|
||||||
int type = evt.getNewValue();
|
int type = evt.getNewValue();
|
||||||
if (_isBeyondWolfenstein) {
|
if (_isBeyondWolfenstein) {
|
||||||
|
|
Loading…
Reference in New Issue