mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 12:19:18 +00:00
editable statues
This commit is contained in:
parent
266b55eea2
commit
4ac186437b
@ -1467,6 +1467,9 @@ walltype winf[walltypes] = {
|
||||
{ '^', 0xFD692F, "Explosive Barrel",
|
||||
"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 ---
|
||||
|
@ -136,7 +136,7 @@ enum eItem {
|
||||
itOrbIntensity, itOrbGravity, itOrbChoice
|
||||
};
|
||||
|
||||
static const int walltypes = 111;
|
||||
static const int walltypes = 112;
|
||||
|
||||
struct walltype {
|
||||
char glyph;
|
||||
@ -178,7 +178,7 @@ enum eWall { waNone, waIcewall, waBarrier, waFloorA, waFloorB, waCavewall, waCav
|
||||
waTerraWarrior, waBubble,
|
||||
waArrowTrap, waMercury, waMagma,
|
||||
waDock, waBurningDock, waRuinWall, waBrownian,
|
||||
waFireTrap, waExplosiveBarrel
|
||||
waFireTrap, waExplosiveBarrel, waEditStatue
|
||||
};
|
||||
|
||||
static const int landtypes = 87;
|
||||
|
@ -712,6 +712,7 @@ bool highwall(cell *c) {
|
||||
// if(wmspatial && isTree(c)) return false;
|
||||
if(isGrave(c->wall)) return true;
|
||||
if(c->wall == waMirrorWall) return false;
|
||||
if(c->wall == waEditStatue) return false;
|
||||
return winf[c->wall].glyph == '#' || c->wall == waClosedGate;
|
||||
}
|
||||
|
||||
|
@ -3322,6 +3322,10 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
|
||||
case waCavewall:
|
||||
if(c->land != laEmerald) fcol = winf[waCavefloor].color;
|
||||
break;
|
||||
|
||||
case waEditStatue:
|
||||
if(c->land == laCanvas) wcol = c->landparam;
|
||||
else wcol = (0x125628 * c->wparam) & 0xFFFFFF;
|
||||
|
||||
default:
|
||||
break;
|
||||
@ -4915,6 +4919,11 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||
queuepoly(V, shMineMark[ct6], darkena(minecolors[mines], 0, 0xFF));
|
||||
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: {
|
||||
wa_default:
|
||||
|
4
hyper.h
4
hyper.h
@ -1262,8 +1262,8 @@ namespace mapeditor {
|
||||
void showMapEditor();
|
||||
void showDrawEditor();
|
||||
|
||||
enum eShapegroup { sgPlayer, sgMonster, sgItem, sgFloor };
|
||||
static const int USERSHAPEGROUPS = 4;
|
||||
enum eShapegroup { sgPlayer, sgMonster, sgItem, sgFloor, sgWall };
|
||||
static const int USERSHAPEGROUPS = 5;
|
||||
|
||||
bool haveUserShape(eShapegroup group, int id);
|
||||
void draw_texture_ghosts(cell *c, const transmatrix& V);
|
||||
|
@ -494,6 +494,7 @@ namespace mapeditor {
|
||||
#if CAP_EDIT
|
||||
int paintwhat = 0;
|
||||
int painttype = 0;
|
||||
int paintstatueid = 0;
|
||||
int radius = 0;
|
||||
string paintwhat_str = "clear monster";
|
||||
|
||||
@ -657,6 +658,7 @@ namespace mapeditor {
|
||||
|
||||
eShapegroup drawcellShapeGroup() {
|
||||
if(drawcell == cwt.at && drawplayer) return sgPlayer;
|
||||
if(drawcell->wall == waEditStatue) return sgWall;
|
||||
if(drawcell->monst) return sgMonster;
|
||||
if(drawcell->item) return sgItem;
|
||||
return sgFloor;
|
||||
@ -664,6 +666,7 @@ namespace mapeditor {
|
||||
|
||||
int drawcellShapeID() {
|
||||
if(drawcell == cwt.at && drawplayer) return vid.cs.charid;
|
||||
if(drawcell->wall == waEditStatue) return drawcell->wparam;
|
||||
if(drawcell->monst) return drawcell->monst;
|
||||
if(drawcell->item) return drawcell->item;
|
||||
auto si = patterns::getpatterninfo0(drawcell);
|
||||
@ -738,6 +741,11 @@ namespace mapeditor {
|
||||
}
|
||||
else if(hasTimeout(c))
|
||||
c->wparam += spillinc();
|
||||
|
||||
if(c->wall == waEditStatue) {
|
||||
c->wparam = paintstatueid;
|
||||
c->mondir = cdir;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
@ -899,8 +907,14 @@ namespace mapeditor {
|
||||
for(int z=0; z<isize(dialog::v); z++) if(1000 + z == uni) {
|
||||
paintwhat = dialog::v[z].second;
|
||||
paintwhat_str = dialog::v[z].first;
|
||||
|
||||
mousepressed = false;
|
||||
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;
|
||||
}
|
||||
if(dialog::editInfix(uni)) ;
|
||||
|
@ -2877,7 +2877,7 @@ void initShape(int sg, int id) {
|
||||
usershapes[sg][id] = us;
|
||||
|
||||
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].sym = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user