From 5e48af2bb359aaded195db61bb40df05a245d1f0 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 2 Mar 2020 03:06:15 +0100 Subject: [PATCH] world turtles --- attack.cpp | 5 +++-- content.cpp | 8 +++++++- graph.cpp | 18 +++++++++++++++--- landgen.cpp | 9 +++++++-- monstermove.cpp | 1 + 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/attack.cpp b/attack.cpp index b2731910..0c33495d 100644 --- a/attack.cpp +++ b/attack.cpp @@ -336,6 +336,7 @@ EX void stunMonster(cell *c2, eMonster killer, flagtype flags) { c2->monst == moTerraWarrior ? min(int(c2->stuntime + 8 - c2->hitpoints), 7) : isMetalBeast(c2->monst) ? 7 : c2->monst == moTortoise ? 7 : + c2->monst == moWorldTurtle ? 7 : c2->monst == moReptile ? 7 : isPrincess(c2->monst) ? 6 : // spear stunning @@ -350,7 +351,7 @@ EX void stunMonster(cell *c2, eMonster killer, flagtype flags) { c2->monst == moBrownBug ? 3 : 3); if(killer == moArrowTrap) newtime = min(newtime + 3, 7); - if(!isMetalBeast(c2->monst) && !among(c2->monst, moSkeleton, moReptile, moSalamander, moTortoise, moBrownBug)) { + if(!isMetalBeast(c2->monst) && !among(c2->monst, moSkeleton, moReptile, moSalamander, moTortoise, moWorldTurtle, moBrownBug)) { c2->hitpoints--; if(c2->monst == moPrincess) playSound(c2, princessgender() ? "hit-princess" : "hit-prince"); @@ -1002,7 +1003,7 @@ EX void killFriendlyIvy() { } EX bool monsterPushable(cell *c2) { - return (c2->monst != moFatGuard && !(isMetalBeast(c2->monst) && c2->stuntime < 2) && c2->monst != moTortoise && c2->monst != moTerraWarrior && c2->monst != moVizier); + return (c2->monst != moFatGuard && !(isMetalBeast(c2->monst) && c2->stuntime < 2) && c2->monst != moTortoise && c2->monst != moTerraWarrior && c2->monst != moVizier && c2->monst != moWorldTurtle); } EX bool should_switchplace(cell *c1, cell *c2) { diff --git a/content.cpp b/content.cpp index fb69d857..f17300b9 100644 --- a/content.cpp +++ b/content.cpp @@ -1565,7 +1565,13 @@ WALL( '=', 0x0000A0, "deep water", waDeepWater, WF_WATER, RESERVED, 0, sgWater, MONSTER( 'P', 0xC08080, "Pike", moPike, CF_FACE_SIDE | CF_SHARK, RESERVED, moShark, "You remembler anglers from your hometown showing the impressive pikes they have caught. This one is much larger." ) -MONSTER( 'S', 0xC0C080, "Yellow Skipper", moYellowSkipper, CF_FACE_SIDE | CF_SHARK, RESERVED, moShark, "Just a nasty shark.") /* unused */ +MONSTER( 'T', 0xFF00FF, "World Turtle", moWorldTurtle, CF_FACE_SIDE | CF_STUNNABLE | CF_SLOWMOVER, RESERVED, moYeti, + "Have you reached the edge of the Poincaré disk? No, it must just be the edge of this world. " + "Which happens to be floating on the backs of some turtles. Wondering how such not very big turtles could " + "support such a large world? Well, there are LOTS of them! " + "This one got so annoyed by the fact that you discovered this that it left its post. However, the world still " + "stands, because there are so many turtles." + ) MONSTER( 'R', 0x4040C0, "Rusałka", moRusalka, CF_FACE_SIDE | CF_SHARK, RESERVED, moShark, GENDERSWITCH) ITEM( 'o', 0x808080, "Orb of Plague", itOrbPlague, IC_ORB, IF_EMPATHY, RESERVED, osOffensive, "When you kill an enemy, adjacent enemies all also attacked, as long as they are further away from you than from the originally attacked enemy. " diff --git a/graph.cpp b/graph.cpp index a59ebfa7..836a81ca 100644 --- a/graph.cpp +++ b/graph.cpp @@ -438,6 +438,13 @@ EX namespace tortoise { if(getBit(bits, tfShellDark)) shellcolor = gradient(shellcolor, 0, 0, .5, 1); if(getBit(bits, tfSkinDark)) skincolor = gradient(skincolor, 0, 0, .5, 1); + if(bits < 0) { + skincolor = 0xC00060; + shellcolor = 0xFF00FF; + scutecolor = 0x6000C0; + eyecolor = 0xFFFFFF; + } + for(int i=0; i<12; i++) { color_t col = i == 0 ? shellcolor: @@ -1266,9 +1273,9 @@ EX bool drawMonsterType(eMonster m, cell *where, const transmatrix& V1, color_t // if(GDIM == 3) V = V * cspin(0, 2, M_PI/2); - if(m == moTortoise && where && where->stuntime >= 3) + if(among(m, moTortoise, moWorldTurtle) && where && where->stuntime >= 3) drawStunStars(V, where->stuntime-2); - else if (m == moTortoise || m == moPlayer || (where && !where->stuntime)) ; + else if (among(m, moTortoise, moWorldTurtle) || m == moPlayer || (where && !where->stuntime)) ; else if(where && !(isMetalBeast(m) && where->stuntime == 1)) drawStunStars(V, where->stuntime); @@ -1284,6 +1291,11 @@ EX bool drawMonsterType(eMonster m, cell *where, const transmatrix& V1, color_t return false; } + case moWorldTurtle: { + tortoise::draw(V, -1, 0, where ? where->stuntime : 0); + return false; + } + case moPlayer: drawPlayer(m, where, V, col, footphase); return false; @@ -1525,7 +1537,7 @@ EX bool drawMonsterType(eMonster m, cell *where, const transmatrix& V1, color_t return false; } - case moShark: case moGreaterShark: case moCShark: case moYellowSkipper: + case moShark: case moGreaterShark: case moCShark: queuepoly(VFISH, cgi.shShark, darkena(col, 0, 0xFF)); return false; diff --git a/landgen.cpp b/landgen.cpp index c7db55d7..f82f977a 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -2910,8 +2910,13 @@ EX void setdist(cell *c, int d, cell *from) { c->item = itNone; } } - if(d == 7 && c->land == laMemory && hrand(100) < 5) { - c->wall = waTrapdoor, c->item = itOrbSafety; + if(d == 7 && c->land == laMemory) { + if(hrand(100) < 5) { + c->wall = waTrapdoor, c->item = itOrbSafety; + } + else if(hrand(100) < 2) { + c->monst = moWorldTurtle, c->wall = waNone, c->hitpoints = 5; + } } } diff --git a/monstermove.cpp b/monstermove.cpp index c056c191..7167a1e2 100644 --- a/monstermove.cpp +++ b/monstermove.cpp @@ -258,6 +258,7 @@ EX void moveMonster(const movei& mi) { if(!cellEdgeUnstable(ct)) { if(isMetalBeast(m)) ct->stuntime += 2; if(m == moTortoise) ct->stuntime += 3; + if(m == moWorldTurtle) ct->stuntime += 3; if(m == moDraugr && ct->land != laBurial && ct->land != laHalloween) ct->stuntime += 2; if(m == moBrownBug && snakelevel(ct) < snakelevel(cf)) ct->stuntime += 2; if(m == moBrownBug && snakelevel(ct) < snakelevel(cf) - 1) ct->stuntime += 2;