Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 9 additions & 1 deletion orbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ EX void reset_cheats() {
cheater = 0;
reptilecheat = false;
shadingcheat = false;
cheat_items_enabled = false;
timerghost = true;
gen_wandering = true;
}
Expand Down