mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-14 20:57:10 +00:00
Merge pull request #465 from josephcsible/hold-orbs-cheat
Add a cheat to hold orb powers at their current level
This commit is contained in:
12
debug.cpp
12
debug.cpp
@@ -123,6 +123,18 @@ vector<cheatkey> cheats = {
|
||||
kills[moCultist] = qkills;
|
||||
kills[moTroll] = qkills;
|
||||
}},
|
||||
cheatkey{'H', "toggle hold of orb powers", [] {
|
||||
if(cheat_items_enabled) {
|
||||
cheat_items_enabled = false;
|
||||
addMessage(XLAT("Hold of orb powers disabled!"));
|
||||
}
|
||||
else {
|
||||
cheat_items = items;
|
||||
cheat_items_enabled = true;
|
||||
cheater++;
|
||||
addMessage(XLAT("Hold of orb powers enabled!"));
|
||||
}
|
||||
}},
|
||||
cheatkey{'M', "deplete orb powers", [] {
|
||||
for(int i=0; i<ittypes; i++)
|
||||
if(itemclass(eItem(i)) == IC_ORB)
|
||||
|
||||
@@ -14,6 +14,9 @@ EX int currentLocalTreasure;
|
||||
/** for treasures, the number collected; for orbs, the number of charges */
|
||||
EX array<int, ittypes> items;
|
||||
|
||||
EX array<int, ittypes> cheat_items;
|
||||
EX bool cheat_items_enabled;
|
||||
|
||||
EX map<modecode_t, array<int, ittypes> > hiitems;
|
||||
|
||||
EX bool pickable_from_water(eItem it) {
|
||||
|
||||
10
orbs.cpp
10
orbs.cpp
@@ -50,7 +50,7 @@ EX void useupOrb(eItem it, int qty) {
|
||||
}
|
||||
|
||||
EX void drainOrb(eItem it, int target IS(0)) {
|
||||
if(items[it] > target) useupOrb(it, items[it] - target);
|
||||
if(!cheat_items_enabled && items[it] > target) useupOrb(it, items[it] - target);
|
||||
}
|
||||
|
||||
EX void empathyMove(const movei& mi) {
|
||||
@@ -233,6 +233,14 @@ EX void reduceOrbPowers() {
|
||||
else
|
||||
items[itCrossbow]--;
|
||||
}
|
||||
if(cheat_items_enabled)
|
||||
for(int i=0; i<ittypes; i++) {
|
||||
if(i == itOrbSpeed) {
|
||||
if(items[i] < cheat_items[i]) items[i] = cheat_items[i] + 1; // Orb of Speed always needs to alternate between an odd and even number to work right
|
||||
}
|
||||
else if(itemclass(eItem(i)) == IC_ORB && i != itOrbSafety)
|
||||
items[i] = cheat_items[i];
|
||||
}
|
||||
}
|
||||
|
||||
eWall orig_wall;
|
||||
|
||||
@@ -184,6 +184,7 @@ EX void reset_cheats() {
|
||||
cheater = 0;
|
||||
reptilecheat = false;
|
||||
shadingcheat = false;
|
||||
cheat_items_enabled = false;
|
||||
timerghost = true;
|
||||
gen_wandering = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user