mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-08 23:20:12 +00:00
editable statues
This commit is contained in:
parent
266b55eea2
commit
4ac186437b
@ -1467,6 +1467,9 @@ walltype winf[walltypes] = {
|
|||||||
{ '^', 0xFD692F, "Explosive Barrel",
|
{ '^', 0xFD692F, "Explosive Barrel",
|
||||||
"These barrels can be pushed, and they will explode if next to a fire, or under some attacks."
|
"These barrels can be pushed, and they will explode if next to a fire, or under some attacks."
|
||||||
},
|
},
|
||||||
|
{ '#', 0xC0C0C0, "editable statue",
|
||||||
|
"A statue."
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// --- land types ---
|
// --- land types ---
|
||||||
|
@ -136,7 +136,7 @@ enum eItem {
|
|||||||
itOrbIntensity, itOrbGravity, itOrbChoice
|
itOrbIntensity, itOrbGravity, itOrbChoice
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int walltypes = 111;
|
static const int walltypes = 112;
|
||||||
|
|
||||||
struct walltype {
|
struct walltype {
|
||||||
char glyph;
|
char glyph;
|
||||||
@ -178,7 +178,7 @@ enum eWall { waNone, waIcewall, waBarrier, waFloorA, waFloorB, waCavewall, waCav
|
|||||||
waTerraWarrior, waBubble,
|
waTerraWarrior, waBubble,
|
||||||
waArrowTrap, waMercury, waMagma,
|
waArrowTrap, waMercury, waMagma,
|
||||||
waDock, waBurningDock, waRuinWall, waBrownian,
|
waDock, waBurningDock, waRuinWall, waBrownian,
|
||||||
waFireTrap, waExplosiveBarrel
|
waFireTrap, waExplosiveBarrel, waEditStatue
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int landtypes = 87;
|
static const int landtypes = 87;
|
||||||
|
@ -712,6 +712,7 @@ bool highwall(cell *c) {
|
|||||||
// if(wmspatial && isTree(c)) return false;
|
// if(wmspatial && isTree(c)) return false;
|
||||||
if(isGrave(c->wall)) return true;
|
if(isGrave(c->wall)) return true;
|
||||||
if(c->wall == waMirrorWall) return false;
|
if(c->wall == waMirrorWall) return false;
|
||||||
|
if(c->wall == waEditStatue) return false;
|
||||||
return winf[c->wall].glyph == '#' || c->wall == waClosedGate;
|
return winf[c->wall].glyph == '#' || c->wall == waClosedGate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3322,6 +3322,10 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
|
|||||||
case waCavewall:
|
case waCavewall:
|
||||||
if(c->land != laEmerald) fcol = winf[waCavefloor].color;
|
if(c->land != laEmerald) fcol = winf[waCavefloor].color;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case waEditStatue:
|
||||||
|
if(c->land == laCanvas) wcol = c->landparam;
|
||||||
|
else wcol = (0x125628 * c->wparam) & 0xFFFFFF;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -4915,6 +4919,11 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
|||||||
queuepoly(V, shMineMark[ct6], darkena(minecolors[mines], 0, 0xFF));
|
queuepoly(V, shMineMark[ct6], darkena(minecolors[mines], 0, 0xFF));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case waEditStatue:
|
||||||
|
if(!mapeditor::drawUserShape(V * ddspin(c, c->mondir), mapeditor::sgWall, c->wparam, darkena(wcol, fd, 0xFF), c))
|
||||||
|
queuepoly(V, shTriangle, darkena(wcol, fd, 0xFF));
|
||||||
|
break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
wa_default:
|
wa_default:
|
||||||
|
4
hyper.h
4
hyper.h
@ -1262,8 +1262,8 @@ namespace mapeditor {
|
|||||||
void showMapEditor();
|
void showMapEditor();
|
||||||
void showDrawEditor();
|
void showDrawEditor();
|
||||||
|
|
||||||
enum eShapegroup { sgPlayer, sgMonster, sgItem, sgFloor };
|
enum eShapegroup { sgPlayer, sgMonster, sgItem, sgFloor, sgWall };
|
||||||
static const int USERSHAPEGROUPS = 4;
|
static const int USERSHAPEGROUPS = 5;
|
||||||
|
|
||||||
bool haveUserShape(eShapegroup group, int id);
|
bool haveUserShape(eShapegroup group, int id);
|
||||||
void draw_texture_ghosts(cell *c, const transmatrix& V);
|
void draw_texture_ghosts(cell *c, const transmatrix& V);
|
||||||
|
@ -494,6 +494,7 @@ namespace mapeditor {
|
|||||||
#if CAP_EDIT
|
#if CAP_EDIT
|
||||||
int paintwhat = 0;
|
int paintwhat = 0;
|
||||||
int painttype = 0;
|
int painttype = 0;
|
||||||
|
int paintstatueid = 0;
|
||||||
int radius = 0;
|
int radius = 0;
|
||||||
string paintwhat_str = "clear monster";
|
string paintwhat_str = "clear monster";
|
||||||
|
|
||||||
@ -657,6 +658,7 @@ namespace mapeditor {
|
|||||||
|
|
||||||
eShapegroup drawcellShapeGroup() {
|
eShapegroup drawcellShapeGroup() {
|
||||||
if(drawcell == cwt.at && drawplayer) return sgPlayer;
|
if(drawcell == cwt.at && drawplayer) return sgPlayer;
|
||||||
|
if(drawcell->wall == waEditStatue) return sgWall;
|
||||||
if(drawcell->monst) return sgMonster;
|
if(drawcell->monst) return sgMonster;
|
||||||
if(drawcell->item) return sgItem;
|
if(drawcell->item) return sgItem;
|
||||||
return sgFloor;
|
return sgFloor;
|
||||||
@ -664,6 +666,7 @@ namespace mapeditor {
|
|||||||
|
|
||||||
int drawcellShapeID() {
|
int drawcellShapeID() {
|
||||||
if(drawcell == cwt.at && drawplayer) return vid.cs.charid;
|
if(drawcell == cwt.at && drawplayer) return vid.cs.charid;
|
||||||
|
if(drawcell->wall == waEditStatue) return drawcell->wparam;
|
||||||
if(drawcell->monst) return drawcell->monst;
|
if(drawcell->monst) return drawcell->monst;
|
||||||
if(drawcell->item) return drawcell->item;
|
if(drawcell->item) return drawcell->item;
|
||||||
auto si = patterns::getpatterninfo0(drawcell);
|
auto si = patterns::getpatterninfo0(drawcell);
|
||||||
@ -738,6 +741,11 @@ namespace mapeditor {
|
|||||||
}
|
}
|
||||||
else if(hasTimeout(c))
|
else if(hasTimeout(c))
|
||||||
c->wparam += spillinc();
|
c->wparam += spillinc();
|
||||||
|
|
||||||
|
if(c->wall == waEditStatue) {
|
||||||
|
c->wparam = paintstatueid;
|
||||||
|
c->mondir = cdir;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 5:
|
case 5:
|
||||||
@ -899,8 +907,14 @@ namespace mapeditor {
|
|||||||
for(int z=0; z<isize(dialog::v); z++) if(1000 + z == uni) {
|
for(int z=0; z<isize(dialog::v); z++) if(1000 + z == uni) {
|
||||||
paintwhat = dialog::v[z].second;
|
paintwhat = dialog::v[z].second;
|
||||||
paintwhat_str = dialog::v[z].first;
|
paintwhat_str = dialog::v[z].first;
|
||||||
|
|
||||||
mousepressed = false;
|
mousepressed = false;
|
||||||
popScreen();
|
popScreen();
|
||||||
|
|
||||||
|
if(painttype == 3 && paintwhat == waEditStatue)
|
||||||
|
dialog::editNumber(paintstatueid, 0, 127, 1, 1, XLAT1("editable statue"),
|
||||||
|
XLAT("These statues are designed to have their graphics edited in the Vector Graphics Editor. Each number has its own, separate graphics.")
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(dialog::editInfix(uni)) ;
|
if(dialog::editInfix(uni)) ;
|
||||||
|
@ -2877,7 +2877,7 @@ void initShape(int sg, int id) {
|
|||||||
usershapes[sg][id] = us;
|
usershapes[sg][id] = us;
|
||||||
|
|
||||||
for(int i=0; i<USERLAYERS; i++) {
|
for(int i=0; i<USERLAYERS; i++) {
|
||||||
us->d[i].sh.prio = PPR((sg >= 3 ? 1:50) + i);
|
us->d[i].sh.prio = PPR((sg == 3 ? 1:50) + i);
|
||||||
|
|
||||||
us->d[i].rots = 1;
|
us->d[i].rots = 1;
|
||||||
us->d[i].sym = 0;
|
us->d[i].sym = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user