diff --git a/classes.cpp b/classes.cpp index 90a1fd98..411c21d8 100644 --- a/classes.cpp +++ b/classes.cpp @@ -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 --- diff --git a/classes.h b/classes.h index f0ed85a5..24430db5 100644 --- a/classes.h +++ b/classes.h @@ -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; diff --git a/flags.cpp b/flags.cpp index 94e955f6..761b96f0 100644 --- a/flags.cpp +++ b/flags.cpp @@ -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; } diff --git a/graph.cpp b/graph.cpp index 1c83229f..d2b3bb7e 100644 --- a/graph.cpp +++ b/graph.cpp @@ -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: diff --git a/hyper.h b/hyper.h index f4f1ba4d..05f11b27 100644 --- a/hyper.h +++ b/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); diff --git a/mapeditor.cpp b/mapeditor.cpp index 0a559fbc..96fb76b5 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -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; zd[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;