From 534663e66322d7dec7ebf8ae310e1aa92394f9c9 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 11 May 2019 15:20:34 +0200 Subject: [PATCH] 3d:: using models not walls for worms --- 3d-models.cpp | 2 ++ graph.cpp | 14 ++++++++------ polygons.cpp | 26 ++++++++++++++------------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/3d-models.cpp b/3d-models.cpp index bfb829e7..438bea31 100644 --- a/3d-models.cpp +++ b/3d-models.cpp @@ -964,6 +964,8 @@ void make_3d_models() { make_revolution_cut(shWormSegment, 60, g); make_revolution_cut(shSmallWormSegment, 60, g); make_revolution_cut(shWormHead, 60, g); + make_revolution_cut(shWormTail, 60, g); + make_revolution_cut(shSmallWormTail, 60, g); make_revolution_cut(shTentHead, 60, g); make_revolution_cut(shKrakenHead, 60, -geom3::FLOOR); make_revolution_cut(shSeaTentacle, 60, -geom3::FLOOR); diff --git a/graph.cpp b/graph.cpp index 1d19386e..7a81f4ca 100644 --- a/graph.cpp +++ b/graph.cpp @@ -2195,8 +2195,6 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) { else if(isAnyIvy(c) || isWorm(c)) { - if(isWorm(c) && WDIM == 3) return false; - if((m == moHexSnake || m == moHexSnakeTail) && c->hitpoints == 2) { int d = c->mondir; if(d == NODIR) @@ -2211,6 +2209,9 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) { if(isDragon(c->monst) && c->stuntime == 0) col = 0xFF6000; + if(DIM == 3 && among(c->monst, moIvyRoot, moWorm, moHexSnake, moDragonHead, moKrakenH)) + radarpoints.emplace_back(radarpoint{makeradar(Vparam), minf[m].glyph, col, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF }); + transmatrix Vb0 = Vb; if(c->mondir != NODIR && DIM == 3 && isAnyIvy(c)) { queueline(tC0(Vparam), Vparam * tC0(calc_relative_matrix(c->move(c->mondir), c, C0)), (col << 8) + 0xFF, 0); @@ -2274,7 +2275,9 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) { add_segment(taildist(c), [=] () { for(int i=11; i>=0; i--) { if(i < 3 && (c->monst == moTentacle || c->monst == moTentaclewait)) continue; - transmatrix Vbx = Vb * spin(sin(M_PI * i / 6.) * wav / (i+.1)) * xpush(length * (i) / 12.0); + transmatrix Vbx = Vb; + if(WDIM == 2) Vbx = Vbx * spin(sin(M_PI * i / 6.) * wav / (i+.1)); + Vbx = Vbx * xpush(length * (i) / 12.0); // transmatrix Vbx2 = Vnext * xpush(length2 * i / 6.0); // Vbx = Vbx * rspintox(inverse(Vbx) * Vbx2 * C0) * pispin; ShadowV(Vbx, sh, PPR::GIANTSHADOW); @@ -2308,14 +2311,14 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) { Vb = Vb * pispin; transmatrix Vbh = mmscale(Vb, geom3::AHEAD); queuepoly(Vbh, shWormHead, darkena(col, 0, 0xFF)); - queuepolyat(Vbh, shEyes, 0xFF, PPR::ONTENTACLE_EYES); + queuepolyat(Vbh, shWormEyes, 0xFF, PPR::ONTENTACLE_EYES); ShadowV(Vb, shWormHead, PPR::GIANTSHADOW); } else if(m == moDragonHead) { transmatrix Vbh = mmscale(Vb, geom3::AHEAD); ShadowV(Vb, shDragonHead, PPR::GIANTSHADOW); queuepoly(Vbh, shDragonHead, darkena(col, c->hitpoints?0:1, 0xFF)); - queuepolyat(Vbh/* * pispin */, shEyes, 0xFF, PPR::ONTENTACLE_EYES); + queuepolyat(Vbh/* * pispin */, shDragonEyes, 0xFF, PPR::ONTENTACLE_EYES); int noscolor = (c->hitpoints == 1 && c->stuntime ==1) ? 0xFF0000FF : 0xFF; queuepoly(Vbh, shDragonNostril, noscolor); @@ -4075,7 +4078,6 @@ void draw_gravity_particles(cell *c, const transmatrix V) { } bool isWall3(cell *c, color_t& wcol) { - if(isWorm(c)) { wcol = minf[c->monst].color; return true; } if(isWall(c)) return true; if(c->wall == waChasm && c->land == laMemory) { wcol = 0x606000; return true; } if(c->wall == waInvisibleFloor) return false; diff --git a/polygons.cpp b/polygons.cpp index 5854f348..49d594eb 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -2854,6 +2854,8 @@ void buildpolys() { bshape(shPirateX, PPR::ITEM, scalefactor, 124); bshape(shTreat, PPR::ITEM, scalefactor, 253); + ld wormscale = WDIM == 3 ? 3 : 1; + // first layer monsters bshape(shTentacleX, PPR::TENTACLE0); drawTentacle(shTentacleX, crossf * .25, crossf * .1, 10); @@ -2862,24 +2864,24 @@ void buildpolys() { bshape(shTentacle, PPR::TENTACLE1); drawTentacle(shTentacle, crossf * .2, crossf * .1, 10); copyshape(shJoint, shDisk, PPR::ONTENTACLE); - bshape(shTentHead, PPR::ONTENTACLE, scalefactor, 79); - bshape(shWormHead, PPR::ONTENTACLE, scalefactor, 80); + bshape(shTentHead, PPR::ONTENTACLE, scalefactor * wormscale, 79); + bshape(shWormHead, PPR::ONTENTACLE, scalefactor * wormscale, 80); bshape(shWormSegment, PPR::TENTACLE1); RING(i) - hpcpush(ddi(i, .20 * scalefactor) * C0); + hpcpush(ddi(i, .20 * scalefactor * wormscale) * C0); bshape(shSmallWormSegment, PPR::TENTACLE1); RING(i) - hpcpush(ddi(i, .16 * scalefactor) * C0); - bshape(shWormTail, PPR::TENTACLE1, scalefactor, 383); - bshape(shSmallWormTail, PPR::TENTACLE1, scalefactor, 384); + hpcpush(ddi(i, .16 * scalefactor * wormscale) * C0); + bshape(shWormTail, PPR::TENTACLE1, scalefactor * wormscale, 383); + bshape(shSmallWormTail, PPR::TENTACLE1, scalefactor * wormscale, 384); - bshape(shDragonSegment, PPR::TENTACLE1, scalefactor, 234); //233 alt - bshape(shDragonWings, PPR::ONTENTACLE, scalefactor, 237); - bshape(shDragonLegs, PPR::TENTACLE0, scalefactor, 238); - bshape(shDragonTail, PPR::TENTACLE1, scalefactor, 240); //239 alt - bshape(shDragonNostril, PPR::ONTENTACLE_EYES, scalefactor, 241); - bshape(shDragonHead, PPR::ONTENTACLE, scalefactor, 242); + bshape(shDragonSegment, PPR::TENTACLE1, scalefactor * wormscale, 234); //233 alt + bshape(shDragonWings, PPR::ONTENTACLE, scalefactor * wormscale, 237); + bshape(shDragonLegs, PPR::TENTACLE0, scalefactor * wormscale, 238); + bshape(shDragonTail, PPR::TENTACLE1, scalefactor * wormscale, 240); //239 alt + bshape(shDragonNostril, PPR::ONTENTACLE_EYES, scalefactor * wormscale, 241); + bshape(shDragonHead, PPR::ONTENTACLE, scalefactor * wormscale, 242); ld krsc = 1; if(sphere) krsc *= 1.4;