mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-28 16:32:18 +00:00
Fix #145: add a shading cheat
This commit is contained in:
parent
76176c9150
commit
8f5a51d2cf
@ -96,6 +96,7 @@ EX colortable westwall_colors = { 0x211F6F, 0x413F8F };
|
|||||||
EX colortable endorian_colors = { 0x202010, 0x404030, 0x0000D0 };
|
EX colortable endorian_colors = { 0x202010, 0x404030, 0x0000D0 };
|
||||||
EX colortable canopy_colors = { 0x60C060, 0x489048 };
|
EX colortable canopy_colors = { 0x60C060, 0x489048 };
|
||||||
EX colortable camelot_cheat_colors = { 0x606060, 0xC0C0C0 };
|
EX colortable camelot_cheat_colors = { 0x606060, 0xC0C0C0 };
|
||||||
|
EX colortable haunted_cheat_colors = { 0x609F60, 0xC0FFC0, 0x003F00 };
|
||||||
|
|
||||||
/** return the special colortable for the given cell -- color menu uses this to know that a colortable should be edited */
|
/** return the special colortable for the given cell -- color menu uses this to know that a colortable should be edited */
|
||||||
EX colortable* special_colortable_for(cell *c) {
|
EX colortable* special_colortable_for(cell *c) {
|
||||||
@ -105,7 +106,8 @@ EX colortable* special_colortable_for(cell *c) {
|
|||||||
if(c->land == laWestWall) return &westwall_colors;
|
if(c->land == laWestWall) return &westwall_colors;
|
||||||
if(c->land == laEndorian && !c->wall) return &endorian_colors;
|
if(c->land == laEndorian && !c->wall) return &endorian_colors;
|
||||||
if(c->land == laEndorian && c->wall == waCanopy) return &canopy_colors;
|
if(c->land == laEndorian && c->wall == waCanopy) return &canopy_colors;
|
||||||
if(c->land == laCamelot && camelotcheat) return &camelot_cheat_colors;
|
if(c->land == laCamelot && (camelotcheat || shadingcheat)) return &camelot_cheat_colors;
|
||||||
|
if(isHaunted(c->land) && shadingcheat) return &haunted_cheat_colors;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,6 +277,8 @@ void celldrawer::setcolors() {
|
|||||||
case laCaribbean:
|
case laCaribbean:
|
||||||
if(c->wall != waCIsland && c->wall != waCIsland2)
|
if(c->wall != waCIsland && c->wall != waCIsland2)
|
||||||
fcol = floorcolors[c->land];
|
fcol = floorcolors[c->land];
|
||||||
|
else if(shadingcheat)
|
||||||
|
fcol = celldistAlt(c) % 2 ? winf[waCIsland].color : winf[waCIsland2].color;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case laReptile:
|
case laReptile:
|
||||||
@ -429,11 +433,10 @@ void celldrawer::setcolors() {
|
|||||||
int d = ((eubinary||c->master->alt) ? celldistAltRelative(c) : 0);
|
int d = ((eubinary||c->master->alt) ? celldistAltRelative(c) : 0);
|
||||||
#if CAP_TOUR
|
#if CAP_TOUR
|
||||||
if(!tour::on) camelotcheat = false;
|
if(!tour::on) camelotcheat = false;
|
||||||
if(camelotcheat)
|
|
||||||
fcol = get_color_auto3(d, camelot_cheat_colors);
|
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
if(d < 0) {
|
if(camelotcheat || shadingcheat)
|
||||||
|
fcol = get_color_auto3(d, camelot_cheat_colors);
|
||||||
|
else if(d < 0) {
|
||||||
fcol = floorcolors[c->land];
|
fcol = floorcolors[c->land];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -512,18 +515,24 @@ void celldrawer::setcolors() {
|
|||||||
if(c->wall == waSmallTree) wcol = 0x608000;
|
if(c->wall == waSmallTree) wcol = 0x608000;
|
||||||
}
|
}
|
||||||
if(isHaunted(c->land)) {
|
if(isHaunted(c->land)) {
|
||||||
int itcolor = 0;
|
if(shadingcheat) {
|
||||||
for(int i=0; i<c->type; i++) if(c->move(i) && c->move(i)->item)
|
int d = getHauntedDepth(c);
|
||||||
itcolor = 1;
|
if(d == 0) fcol = haunted_cheat_colors[2];
|
||||||
if(c->item) itcolor |= 2;
|
else fcol = get_color_auto3(d, haunted_cheat_colors, 1);
|
||||||
fcol = floorcolors[laHaunted] + 0x202020 * itcolor;
|
} else {
|
||||||
|
int itcolor = 0;
|
||||||
forCellEx(c2, c) if(c2->monst == moFriendlyGhost)
|
for(int i=0; i<c->type; i++) if(c->move(i) && c->move(i)->item)
|
||||||
fcol = gradient(fcol, fghostcolor(c2), 0, .25, 1);
|
itcolor = 1;
|
||||||
|
if(c->item) itcolor |= 2;
|
||||||
if(c->monst == moFriendlyGhost)
|
fcol = floorcolors[laHaunted] + 0x202020 * itcolor;
|
||||||
fcol = gradient(fcol, fghostcolor(c), 0, .5, 1);
|
|
||||||
|
forCellEx(c2, c) if(c2->monst == moFriendlyGhost)
|
||||||
|
fcol = gradient(fcol, fghostcolor(c2), 0, .25, 1);
|
||||||
|
|
||||||
|
if(c->monst == moFriendlyGhost)
|
||||||
|
fcol = gradient(fcol, fghostcolor(c), 0, .5, 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!higher_contrast) {
|
if (!higher_contrast) {
|
||||||
if(c->wall == waSmallTree) wcol = 0x004000;
|
if(c->wall == waSmallTree) wcol = 0x004000;
|
||||||
else if(c->wall == waBigTree) wcol = 0x008000;
|
else if(c->wall == waBigTree) wcol = 0x008000;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
namespace hr {
|
namespace hr {
|
||||||
|
|
||||||
EX bool camelotcheat;
|
EX bool camelotcheat;
|
||||||
|
EX bool shadingcheat;
|
||||||
|
|
||||||
EX colortable minecolors = {
|
EX colortable minecolors = {
|
||||||
0xFFFFFF, 0xF0, 0xF060, 0xF00000,
|
0xFFFFFF, 0xF0, 0xF060, 0xF00000,
|
||||||
|
@ -3342,6 +3342,9 @@ EX namespace mapeditor {
|
|||||||
}
|
}
|
||||||
else dialog::addBreak(100);
|
else dialog::addBreak(100);
|
||||||
|
|
||||||
|
dialog::addBoolItem_action(XLAT("shading cheat"), shadingcheat, 'h');
|
||||||
|
dialog::addInfo(XLAT("(useful in Camelot, Caribbean, and Haunted Woods)"));
|
||||||
|
|
||||||
dialog::addBoolItem_action(XLAT("simple pattern generation"), reptilecheat, 'p');
|
dialog::addBoolItem_action(XLAT("simple pattern generation"), reptilecheat, 'p');
|
||||||
dialog::addInfo(XLAT("(e.g. pure Reptile pattern)"));
|
dialog::addInfo(XLAT("(e.g. pure Reptile pattern)"));
|
||||||
|
|
||||||
|
@ -409,6 +409,7 @@ EX void initgame() {
|
|||||||
if(!autocheat && !cheater && geometry == gNormal) patterns::whichShape = 0;
|
if(!autocheat && !cheater && geometry == gNormal) patterns::whichShape = 0;
|
||||||
hauntedWarning = false;
|
hauntedWarning = false;
|
||||||
if(!autocheat) {
|
if(!autocheat) {
|
||||||
|
shadingcheat = false;
|
||||||
timerghost = true;
|
timerghost = true;
|
||||||
gen_wandering = true;
|
gen_wandering = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user