drawMonsterType with cases

This commit is contained in:
Zeno Rogue 2019-03-30 13:16:19 +01:00
parent 3634956046
commit 11ee7c1b9a
1 changed files with 908 additions and 795 deletions

455
graph.cpp
View File

@ -891,36 +891,13 @@ void drawTerraWarrior(const transmatrix& V, int t, int hp, double footphase) {
}
#endif
bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col, double footphase) {
#if MAXMDIM >= 4
if(DIM == 3 && m != moPlayer)
radarpoints.emplace_back(radarpoint{makeradar(V), minf[m].glyph, col, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF });
#endif
#if CAP_SHAPES
char xch = minf[m].glyph;
if(m == moTortoise && where && where->stuntime >= 3)
drawStunStars(V, where->stuntime-2);
else if (m == moTortoise || m == moPlayer || (where && !where->stuntime)) ;
else if(where && !(isMetalBeast(m) && where->stuntime == 1))
drawStunStars(V, where->stuntime);
if(m == moTortoise) {
int bits = where ? tortoise::getb(where) : tortoise::last;
tortoise::draw(V, bits, 0, where ? where->stuntime : 0);
if(tortoise::seek() && !tortoise::diff(bits) && where)
queuepoly(V, shRing, darkena(0xFFFFFF, 0, 0x80 + 0x70 * sintick(200)));
}
else if(m == moPlayer) {
void drawPlayer(eMonster m, cell *where, const transmatrix& V, color_t col, double footphase) {
charstyle& cs = getcs();
if(mapeditor::drawplayer && !mapeditor::drawUserShape(V, mapeditor::sgPlayer, cs.charid, cs.skincolor, where)) {
if(cs.charid >= 8) {
/* famililar */
if(!mmspatial && !footphase)
queuepoly(VALEGS, shWolfLegs, fc(150, cs.dresscolor, 4));
else {
@ -942,6 +919,7 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
tortoise::draw(VABODY, tortoise::seekbits, 4, 0);
}
else if(cs.charid >= 6) {
/* dog */
if(!mmspatial && !footphase)
queuepoly(VABODY, shDogBody, fc(0, cs.skincolor, 0));
else {
@ -967,6 +945,7 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
tortoise::draw(VABODY, tortoise::seekbits, 4, 0);
}
else if(cs.charid >= 4) {
/* cat */
if(!mmspatial && !footphase)
queuepoly(VALEGS, shCatLegs, fc(500, cs.dresscolor, 4));
else {
@ -988,7 +967,7 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
tortoise::draw(VABODY, tortoise::seekbits, 4, 0);
}
else {
/* human */
const transmatrix VBS = otherbodyparts(V, fc(0, cs.skincolor, 0), items[itOrbFish] ? moWaterElemental : moPlayer, footphase);
queuepoly(VBODY * VBS, (cs.charid&1) ? shFemaleBody : shPBody, fc(0, cs.skincolor, 0));
@ -1066,16 +1045,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
if(tortoise::seek())
tortoise::draw(VBODY * VBS * ypush(-crossf*.25), tortoise::seekbits, 4, 0);
}
}
}
else if(mapeditor::drawUserShape(V, mapeditor::sgMonster, m, darkena(col, 0, 0xFF), where)) {
return false;
}
else if(isMimic(m) || m == moShadow || m == moIllusion) {
void drawMimic(eMonster m, cell *where, const transmatrix& V, color_t col, double footphase) {
charstyle& cs = getcs();
if(mapeditor::drawUserShape(V, mapeditor::sgPlayer, cs.charid, darkena(col, 0, 0x80), where)) return false;
@ -1149,12 +1122,48 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
}
}
else if(m == moBullet) {
ShadowV(V, shKnife);
queuepoly(VBODY * spin(-M_PI/4), shKnife, getcs().swordcolor);
bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col, double footphase) {
#if MAXMDIM >= 4
if(DIM == 3 && m != moPlayer)
radarpoints.emplace_back(radarpoint{makeradar(V), minf[m].glyph, col, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF });
#endif
#if CAP_SHAPES
char xch = minf[m].glyph;
if(m == moTortoise && where && where->stuntime >= 3)
drawStunStars(V, where->stuntime-2);
else if (m == moTortoise || m == moPlayer || (where && !where->stuntime)) ;
else if(where && !(isMetalBeast(m) && where->stuntime == 1))
drawStunStars(V, where->stuntime);
if(mapeditor::drawUserShape(V, mapeditor::sgMonster, m, darkena(col, 0, 0xFF), where))
return false;
switch(m) {
case moTortoise: {
int bits = where ? tortoise::getb(where) : tortoise::last;
tortoise::draw(V, bits, 0, where ? where->stuntime : 0);
if(tortoise::seek() && !tortoise::diff(bits) && where)
queuepoly(V, shRing, darkena(0xFFFFFF, 0, 0x80 + 0x70 * sintick(200)));
return false;
}
else if(m == moKnight || m == moKnightMoved) {
case moPlayer:
drawPlayer(m, where, V, col, footphase);
return false;
case moMimic: moShadow: moIllusion:
drawMimic(m, where, V, col, footphase);
return false;
case moBullet:
ShadowV(V, shKnife);
queuepoly(VBODY * spin(-M_PI/4), shKnife, getcs().swordcolor);
return false;
case moKnight: case moKnightMoved: {
ShadowV(V, shPBody);
const transmatrix VBS = otherbodyparts(V, darkena(0xC0C0A0, 0, 0xC0), m, footphase);
queuepoly(VBODY * VBS, shPBody, darkena(0xC0C0A0, 0, 0xC0));
@ -1172,15 +1181,24 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
return false;
}
else if(m == moGolem || m == moGolemMoved) {
case moGolem: case moGolemMoved: {
ShadowV(V, shPBody);
const transmatrix VBS = otherbodyparts(V, darkena(col, 1, 0XC0), m, footphase);
queuepoly(VBODY * VBS, shPBody, darkena(col, 0, 0XC0));
queuepoly(VHEAD, shGolemhead, darkena(col, 1, 0XFF));
return false;
}
else if(isPrincess(m) || m == moFalsePrincess || m == moRoseLady || m == moRoseBeauty) {
case moEvilGolem: case moIceGolem: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 2, 0xC0), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, darkena(col, 0, 0XC0));
queuepoly(VHEAD, shGolemhead, darkena(col, 1, 0XFF));
return false;
}
case moFalsePrincess: case moRoseLady: case moRoseBeauty: {
princess:
bool girl = princessgender() == GEN_F;
bool evil = !isPrincess(m);
@ -1233,7 +1251,7 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VHEAD, shPFace, facecolor);
}
else if(m == moWolf || m == moRedFox || m == moWolfMoved || m == moLavaWolf) {
case moWolf: case moRedFox: case moWolfMoved: case moLavaWolf: {
ShadowV(V, shWolfBody);
if(mmspatial || footphase)
animallegs(VALEGS, moWolf, darkena(col, 0, 0xFF), footphase);
@ -1246,20 +1264,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
}
queuepoly(VAHEAD, shWolfHead, darkena(col, 0, 0xFF));
queuepoly(VAHEAD, shWolfEyes, darkena(col, 3, 0xFF));
break;
}
else if(isBull(m)) {
ShadowV(V, shBullBody);
int hoofcol = darkena(gradient(0, col, 0, .65, 1), 0, 0xFF);
if(mmspatial || footphase)
animallegs(VALEGS, moRagingBull, hoofcol, footphase);
queuepoly(VABODY, shBullBody, darkena(gradient(0, col, 0, .80, 1), 0, 0xFF));
queuepoly(VAHEAD, shBullHead, darkena(col, 0, 0xFF));
queuepoly(VAHEAD, shBullHorn, darkena(0xFFFFFF, 0, 0xFF));
queuepoly(VAHEAD * Mirror, shBullHorn, darkena(0xFFFFFF, 0, 0xFF));
}
else if(m == moReptile) {
case moReptile: {
ShadowV(V, shReptileBody);
animallegs(VALEGS, moReptile, darkena(col, 0, 0xFF), footphase);
queuepoly(VABODY, shReptileBody, darkena(col, 0, 0xFF));
@ -1267,9 +1275,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VAHEAD, shReptileEye, darkena(col, 3, 0xFF));
queuepoly(VAHEAD * Mirror, shReptileEye, darkena(col, 3, 0xFF));
queuepoly(VABODY, shReptileTail, darkena(col, 2, 0xFF));
break;
}
else if(m == moSalamander) {
case moSalamander: {
ShadowV(V, shReptileBody);
animallegs(VALEGS, moReptile, darkena(0xD00000, 1, 0xFF), footphase);
queuepoly(VABODY, shReptileBody, darkena(0xD00000, 0, 0xFF));
@ -1277,9 +1286,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VAHEAD, shReptileEye, darkena(0xD00000, 0, 0xFF));
queuepoly(VAHEAD * Mirror, shReptileEye, darkena(0xD00000, 0, 0xFF));
queuepoly(VABODY, shReptileTail, darkena(0xD08000, 0, 0xFF));
break;
}
else if(m == moVineBeast) {
case moVineBeast: {
ShadowV(V, shWolfBody);
if(mmspatial || footphase)
animallegs(VALEGS, moWolf, 0x00FF00FF, footphase);
@ -1288,23 +1298,17 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VABODY, shWolfBody, darkena(col, 1, 0xFF));
queuepoly(VAHEAD, shWolfHead, darkena(col, 0, 0xFF));
queuepoly(VAHEAD, shWolfEyes, 0xFF0000FF);
break;
}
else if(m == moMouse || m == moMouseMoved) {
case moMouse: case moMouseMoved: {
queuepoly(VALEGS, shMouse, darkena(col, 0, 0xFF));
queuepoly(VALEGS, shMouseLegs, darkena(col, 1, 0xFF));
queuepoly(VALEGS, shMouseEyes, 0xFF);
break;
}
else if(isBug(m)) {
ShadowV(V, shBugBody);
if(!mmspatial && !footphase)
queuepoly(VABODY, shBugBody, darkena(col, 0, 0xFF));
else {
animallegs(VALEGS, moBug0, darkena(col, 0, 0xFF), footphase);
queuepoly(VABODY, shBugAntenna, darkena(col, 1, 0xFF));
}
queuepoly(VABODY, shBugArmor, darkena(col, 1, 0xFF));
}
else if(among(m, moRunDog, moHunterDog, moHunterGuard, moHunterChanging, moFallingDog)) {
case moRunDog: case moHunterDog: case moHunterGuard: case moHunterChanging: case moFallingDog: {
if(!mmspatial && !footphase)
queuepoly(VABODY, shDogBody, darkena(col, 0, 0xFF));
else {
@ -1328,8 +1332,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VAHEAD, shWolf2, eyes).flags |= POLY_FORCEWIDE;
}
queuepoly(VAHEAD, shWolf3, darkena(m == moRunDog ? 0x202020 : 0x000000, 0, 0xFF));
return false;
}
else if(m == moOrangeDog) {
case moOrangeDog: {
if(!mmspatial && !footphase)
queuepoly(VABODY, shDogBody, darkena(0xFFFFFF, 0, 0xFF));
else {
@ -1342,30 +1348,39 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VAHEAD, shWolf1, darkena(0x202020, 0, 0xFF));
queuepoly(VAHEAD, shWolf2, darkena(0x202020, 0, 0xFF));
queuepoly(VAHEAD, shWolf3, darkena(0x202020, 0, 0xFF));
return false;
}
else if(m == moShark || m == moGreaterShark || m == moCShark)
case moShark: moGreaterShark: moCShark:
queuepoly(VFISH, shShark, darkena(col, 0, 0xFF));
else if(m == moEagle || m == moParrot || m == moBomberbird || m == moAlbatross ||
m == moTameBomberbird || m == moWindCrow || m == moTameBomberbirdMoved ||
m == moSandBird || m == moAcidBird) {
return false;
case moEagle: moParrot: moBomberbird: moAlbatross:
case moTameBomberbird: case moWindCrow: case moTameBomberbirdMoved:
case moSandBird: case moAcidBird:
ShadowV(V, shEagle);
if(m == moParrot && DIM == 3)
queuepolyat(VBIRD, shEagle, darkena(col, 0, 0xFF), PPR::SUPERLINE);
else
queuepoly(VBIRD, shEagle, darkena(col, 0, 0xFF));
}
else if(among(m, moSparrowhawk, moWestHawk)) {
return false;
case moSparrowhawk: case moWestHawk: {
ShadowV(V, shHawk);
queuepoly(VBIRD, shHawk, darkena(col, 0, 0xFF));
return false;
}
else if(m == moButterfly) {
case moButterfly: {
transmatrix Vwing = Id;
Vwing[1][1] = .85 + .15 * sintick(100);
ShadowV(V * Vwing, shButterflyWing);
queuepoly(VBIRD * Vwing, shButterflyWing, darkena(col, 0, 0xFF));
queuepoly(VBIRD, shButterflyBody, darkena(col, 2, 0xFF));
return false;
}
else if(m == moGadfly) {
case moGadfly: {
transmatrix Vwing = Id;
Vwing[1][1] = .85 + .15 * sintick(100);
ShadowV(V * Vwing, shGadflyWing);
@ -1373,8 +1388,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VBIRD, shGadflyBody, darkena(col, 1, 0xFF));
queuepoly(VBIRD, shGadflyEye, darkena(col, 2, 0xFF));
queuepoly(VBIRD * Mirror, shGadflyEye, darkena(col, 2, 0xFF));
return false;
}
else if(m == moVampire || m == moBat) {
case moVampire: case moBat: {
// vampires have no shadow and no mirror images
if(m == moBat) ShadowV(V, shBatWings);
if(m == moBat || !inmirrorcount) {
@ -1386,42 +1403,48 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(V*Mirror, shBatFang, darkena(0xFFC0C0, 0, 0xFF));
queuepoly(V, shBatEye, darkena(00000000, 0, 0xFF));
queuepoly(V*Mirror, shBatEye, darkena(00000000, 0, 0xFF)); */
return false;
}
else if(m == moGargoyle) {
case moGargoyle: {
ShadowV(V, shGargoyleWings);
queuepoly(VBIRD, shGargoyleWings, darkena(col, 0, 0xD0));
queuepoly(VBIRD, shGargoyleBody, darkena(col, 0, 0xFF));
return false;
}
else if(m == moZombie) {
case moZombie: {
int c = darkena(col, where && where->land == laHalloween ? 1 : 0, 0xFF);
const transmatrix VBS = otherbodyparts(V, c, m, footphase);
ShadowV(V, shPBody);
queuepoly(VBODY * VBS, shPBody, c);
return false;
}
else if(m == moTerraWarrior)
case moTerraWarrior: {
drawTerraWarrior(V, 7, (where ? where->hitpoints : 7), footphase);
else if(m == moVariantWarrior) {
return false;
}
case moVariantWarrior: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xC0), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, darkena(0xFFD500, 0, 0xF0));
if(!peace::on) queuepoly(VBS, shPSword, 0xFFFF00FF);
queuepoly(VHEAD, shHood, 0x008000FF);
return false;
}
else if(m == moDesertman) {
case moDesertman: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xC0), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, darkena(col, 0, 0xC0));
if(!peace::on) queuepoly(VBS, shPSword, 0xFFFF00FF);
queuepoly(VHEAD, shHood, 0xD0D000C0);
return false;
}
/* else if(isSwitch(m)) {
otherbodyparts(V, darkena(col, 0, 0xC0), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBODY, shPBody, darkena(col, 0, 0xC0));
if(!peace::on) queuepoly(VBODY, shPSword, 0xFFFF00FF);
queuepoly(VHEAD, shHood, darkena(col, 0, 0xFF));
} */
else if(m == moMonk) {
case moMonk: {
const transmatrix VBS = otherbodyparts(V, darkena(col, 0, 0xC0), m, footphase);
ShadowV(V, shRaiderBody);
queuepoly(VBODY * VBS, shRaiderBody, darkena(col, 0, 0xFF));
@ -1431,8 +1454,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepolyat(VBODY3 * VBS, shRatCape2, darkena(col, 2, 0xFF), PPR::MONSTER_ARMOR0);
queuepoly(VHEAD1, shRaiderHelmet, darkena(col, 0, 0XFF));
queuepoly(VHEAD, shPFace, darkena(0xC0C0A0, 0, 0XFF));
return false;
}
else if(m == moCrusher) {
case moCrusher: {
const transmatrix VBS = otherbodyparts(V, darkena(col, 1, 0xFF), m, footphase);
ShadowV(V, shRaiderBody);
queuepoly(VBODY * VBS, shRaiderBody, darkena(col, 0, 0xFF));
@ -1442,8 +1467,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VBODY1 * VBS, shHammerHead, darkena(col, 0, 0XFF));
queuepoly(VHEAD1, shRaiderHelmet, darkena(col, 0, 0XFF));
queuepoly(VHEAD, shPFace, darkena(0xC0C0A0, 0, 0XFF));
return false;
}
else if(m == moPair) {
case moPair: {
const transmatrix VBS = otherbodyparts(V, darkena(col, 1, 0xFF), m, footphase);
ShadowV(V, shRaiderBody);
queuepoly(VBODY * VBS, shRaiderBody, darkena(col, 0, 0xFF));
@ -1452,8 +1479,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VBODY * VBS, shPickAxe, darkena(0xA0A0A0, 0, 0XFF));
queuepoly(VHEAD1, shRaiderHelmet, darkena(col, 0, 0XFF));
queuepoly(VHEAD, shPFace, darkena(0xC0C0A0, 0, 0XFF));
return false;
}
else if(m == moAltDemon || m == moHexDemon) {
case moAltDemon: case moHexDemon: {
const transmatrix VBS = otherbodyparts(V, darkena(col, 0, 0xC0), m, footphase);
ShadowV(V, shRaiderBody);
queuepoly(VBODY * VBS, shRaiderBody, darkena(col, 0, 0xFF));
@ -1462,17 +1491,20 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
if(!peace::on) queuepoly(VBODY * VBS, shPSword, 0xFFD0D0D0);
queuepoly(VHEAD1, shRaiderHelmet, darkena(col, 0, 0XFF));
queuepoly(VHEAD, shPFace, darkena(0xC0C0A0, 0, 0XFF));
return false;
}
else if(m == moPalace || m == moFatGuard || m == moVizier || m == moSkeleton) {
if(m == moSkeleton) {
case moSkeleton: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(0xFFFFFF, 0, 0xFF), moSkeleton, footphase);
queuepoly(VBS, shSkeletonBody, darkena(0xFFFFFF, 0, 0xFF));
queuepoly(VHEAD, shSkull, darkena(0xFFFFFF, 0, 0xFF));
queuepoly(VHEAD1, shSkullEyes, darkena(0, 0, 0xFF));
ShadowV(V, shSkeletonBody);
queuepoly(VBS, shSabre, 0xFFFFFFFF);
return false;
}
else {
case moPalace: case moFatGuard: case moVizier: {
ShadowV(V, shPBody);
const transmatrix VBS = otherbodyparts(V, darkena(0xFFD500, 0, 0xFF), m, footphase);
if(m == moFatGuard) {
@ -1493,49 +1525,46 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
if(!where || where->hitpoints >= 2)
queuepoly(VHEAD2, shTurban2, darkena(col, 0, 0xFF));
queuepoly(VBODY * VBS, shSabre, 0xFFFFFFFF);
return false;
}
drawStunStars(V, where ? where->stuntime : 0);
}
else if(m == moCrystalSage) {
case moCrystalSage: {
const transmatrix VBS = VBODY * otherbodyparts(V, 0xFFFFFFFF, m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, 0xFFFFFFFF);
queuepoly(VHEAD1, shPHead, 0xFFFFFFFF);
queuepoly(VHEAD, shPFace, 0xFFFFFFFF);
return false;
}
else if(m == moHedge) {
case moHedge: {
ShadowV(V, shPBody);
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 1, 0xFF), m, footphase);
queuepoly(VBS, shPBody, darkena(col, 0, 0xFF));
queuepoly(VBS, shHedgehogBlade, 0xC0C0C0FF);
queuepoly(VHEAD1, shPHead, 0x804000FF);
queuepoly(VHEAD, shPFace, 0xF09000FF);
return false;
}
else if(m == moYeti || m == moMonkey) {
case moYeti: case moMonkey: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xC0), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shYeti, darkena(col, 0, 0xC0));
queuepoly(VHEAD1, shPHead, darkena(col, 0, 0xFF));
return false;
}
else if(m == moResearcher) {
case moResearcher: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, darkena(0xFFFF00, 0, 0xC0));
queuepoly(VHEAD, shAztecHead, darkena(col, 0, 0xFF));
queuepoly(VHEAD1, shAztecCap, darkena(0xC000C0, 0, 0xFF));
return false;
}
else if(m == moFamiliar) {
/* queuepoly(V, shFemaleBody, darkena(0xC0B070, 0, 0xFF));
queuepoly(V, shPFace, darkena(0xC0B070, 0, 0XFF));
queuepoly(V, shWizardCape1, 0x601000FF);
queuepoly(V, shWizardCape2, 0x781800FF);
queuepoly(V, shWizardHat1, 0x902000FF);
queuepoly(V, shWizardHat2, 0xA82800FF); */
// queuepoly(V, shCatBody, darkena(0x601000, 0, 0xFF));
// queuepoly(V, shGargoyleBody, darkena(0x903000, 0, 0xFF));
case moFamiliar: {
ShadowV(V, shWolfBody);
queuepoly(VABODY, shWolfBody, darkena(0xA03000, 0, 0xFF));
if(mmspatial || footphase)
@ -1549,15 +1578,19 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VAHEAD, shFamiliarEye, darkena(0xFFFF000, 0, 0xFF));
queuepoly(VAHEAD * Mirror, shFamiliarEye, darkena(0xFFFF000, 0, 0xFF));
}
return false;
}
else if(m == moRanger) {
case moRanger: {
ShadowV(V, shPBody);
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
queuepoly(VBS, shPBody, darkena(col, 0, 0xC0));
if(!peace::on) queuepoly(VBS, shPSword, darkena(col, 0, 0xFF));
queuepoly(VHEAD, shArmor, darkena(col, 1, 0xFF));
return false;
}
else if(m == moNarciss) {
case moNarciss: {
ShadowV(V, shPBody);
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
queuepoly(VBS, shFlowerHand, darkena(col, 0, 0xFF));
@ -1565,8 +1598,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
if(!peace::on) queuepoly(VBS, shPKnife, 0xC0C0C0FF);
queuepoly(VHEAD, shPFace, 0xFFE080FF);
queuepoly(VHEAD1, shPHead, 0x806A00FF);
return false;
}
else if(m == moMirrorSpirit) {
case moMirrorSpirit: {
ShadowV(V, shPBody);
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0x90), m, footphase);
queuepoly(VBS, shPBody, darkena(col, 0, 0x90));
@ -1574,8 +1609,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VHEAD, shPHead, darkena(col, 1, 0x90));
queuepoly(VHEAD, shPFace, darkena(col, 1, 0x90));
queuepoly(VHEAD, shArmor, darkena(col, 0, 0xC0));
return false;
}
else if(m == moJiangshi) {
case moJiangshi: {
ShadowV(V, shJiangShi);
auto z2 = geom3::lev_to_factor(abs(sin(footphase * M_PI * 2)) * geom3::human_height);
auto V0 = V;
@ -1587,52 +1624,60 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VHEAD, shPFace, darkena(col, 0, 0xFF));
queuepoly(VHEAD, shJiangShiCap1, darkena(0x800000, 0, 0xFF));
queuepoly(VHEAD, shJiangShiCap2, darkena(0x400000, 0, 0xFF));
return false;
}
else if(m == moGhost || m == moSeep || m == moFriendlyGhost) {
case moGhost: case moSeep: case moFriendlyGhost: {
if(m == moFriendlyGhost) col = fghostcolor(where);
queuepoly(VGHOST, shGhost, darkena(col, 0, m == moFriendlyGhost ? 0xC0 : 0x80));
queuepoly(VGHOST, shEyes, 0xFF);
return false;
}
else if(m == moVineSpirit) {
case moVineSpirit: {
queuepoly(VGHOST, shGhost, 0xD0D0D0C0);
queuepoly(VGHOST, shEyes, 0xFF0000FF);
return false;
}
else if(m == moFireFairy) {
case moFireFairy: {
col = firecolor(0);
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shFemaleBody);
queuepoly(VBS, shFemaleBody, darkena(col, 0, 0XC0));
queuepoly(VHEAD, shWitchHair, darkena(col, 1, 0xFF));
queuepoly(VHEAD, shPFace, darkena(col, 0, 0XFF));
return false;
}
else if(m == moSlime) {
case moSlime: {
queuepoly(VFISH, shSlime, darkena(col, 0, 0x80));
queuepoly(VSLIMEEYE, shEyes, 0xFF);
}
else if(isSwitch(m)) {
queuepoly(VFISH, shJelly, darkena(col, 0, 0xD0));
queuepolyat(VBODY, shJelly, darkena(col, 0, 0xD0), PPR::MONSTER_BODY);
queuepolyat(VHEAD, shJelly, darkena(col, 0, 0xD0), PPR::MONSTER_HEAD);
queuepolyat(VHEAD, shEyes, 0xFF, PPR::MONSTER_HEAD);
}
else if(m == moKrakenH) {
case moKrakenH: {
queuepoly(VFISH, shKrakenHead, darkena(col, 0, 0xD0));
queuepoly(VFISH, shKrakenEye, 0xFFFFFFC0);
queuepoly(VFISH, shKrakenEye2, 0xC0);
queuepoly(VFISH * Mirror, shKrakenEye, 0xFFFFFFC0);
queuepoly(VFISH * Mirror, shKrakenEye2, 0xC0);
return false;
}
else if(m == moKrakenT) {
case moKrakenT: {
queuepoly(VFISH, shSeaTentacle, darkena(col, 0, 0xD0));
return false;
}
else if(m == moCultist || m == moPyroCultist || m == moCultistLeader) {
case moCultist: case moPyroCultist: case moCultistLeader: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 1, 0xFF), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, darkena(col, 0, 0xC0));
if(!peace::on) queuepoly(VBS, shPSword, darkena(col, 2, 0xFF));
queuepoly(VHEAD, shHood, darkena(col, 1, 0xFF));
return false;
}
else if(m == moPirate) {
case moPirate: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, darkena(0x404040, 0, 0xFF));
@ -1640,8 +1685,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VHEAD, shPFace, darkena(0xFFFF80, 0, 0xFF));
queuepoly(VHEAD1, shEyepatch, darkena(0, 0, 0xC0));
queuepoly(VHEAD2, shPirateHood, darkena(col, 0, 0xFF));
return false;
}
else if(m == moRatling || m == moRatlingAvenger) {
case moRatling: case moRatlingAvenger: {
const transmatrix VBS = otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shYeti);
queuepoly(VLEG, shRatTail, darkena(col, 0, 0xFF));
@ -1659,8 +1706,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VBODY1 * VBS, shRatCape2, 0x484848FF);
queuepoly(VHEAD, shRatCape1, 0x303030FF);
}
return false;
}
else if(m == moViking) {
case moViking: {
const transmatrix VBS = otherbodyparts(V, darkena(col, 1, 0xFF), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBODY * VBS, shPBody, darkena(0xE00000, 0, 0xFF));
@ -1668,8 +1717,10 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VBODY1 * VBS, shKnightCloak, darkena(0x404040, 0, 0xFF));
queuepoly(VHEAD, shVikingHelmet, darkena(0xC0C0C0, 0, 0XFF));
queuepoly(VHEAD, shPFace, darkena(0xFFFF80, 0, 0xFF));
return false;
}
else if(m == moOutlaw) {
case moOutlaw: {
const transmatrix VBS = otherbodyparts(V, darkena(col, 1, 0xFF), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBODY * VBS, shPBody, darkena(col, 0, 0xFF));
@ -1678,14 +1729,18 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(VHEAD, shWestHat2, darkena(col, 1, 0XFF));
queuepoly(VHEAD, shPFace, darkena(0xFFFF80, 0, 0xFF));
queuepoly(VBODY * VBS, shGunInHand, darkena(col, 1, 0XFF));
return false;
}
else if(m == moNecromancer) {
case moNecromancer: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, 0xC00000C0);
queuepoly(VHEAD, shHood, darkena(col, 1, 0xFF));
return false;
}
else if(m == moDraugr) {
case moDraugr: {
const transmatrix VBS = VBODY * otherbodyparts(V, 0x483828D0, m, footphase);
queuepoly(VBS, shPBody, 0x483828D0);
queuepoly(VBS, shPSword, 0xFFFFD0A0);
@ -1698,20 +1753,26 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
if(b < 0) b = 0;
if(b > 6) b = 6;
queuepoly(VHEAD1, shWightCloak, 0x605040A0 + 0x10101000 * b);
return false;
}
else if(m == moVoidBeast) {
case moVoidBeast: {
const transmatrix VBS = VBODY * otherbodyparts(V, 0x080808D0, m, footphase);
queuepoly(VBS, shPBody, 0x080808D0);
queuepoly(VHEAD, shPHead, 0x080808D0);
queuepoly(VHEAD, shWightCloak, 0xFF0000A0);
return false;
}
else if(m == moGoblin) {
case moGoblin: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shYeti);
queuepoly(VBS, shYeti, darkena(col, 0, 0xC0));
queuepoly(VHEAD, shArmor, darkena(col, 1, 0XFF));
return false;
}
else if(m == moLancer || m == moFlailer || m == moMiner) {
case moLancer: case moFlailer: case moMiner: {
transmatrix V2 = V;
if(m == moLancer)
V2 = V * spin((where && where->type == 6) ? -M_PI/3 : -M_PI/2 );
@ -1730,64 +1791,140 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
queuepoly(Vb, shFlailChain, darkena(col, 1, 0XFF));
queuepoly(Vb, shFlailTrunk, darkena(col, 0, 0XFF));
}
return false;
}
else if(m == moTroll) {
case moTroll: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shYeti);
queuepoly(VBS, shYeti, darkena(col, 0, 0xC0));
queuepoly(VHEAD1, shPHead, darkena(col, 1, 0XFF));
queuepoly(VHEAD, shPFace, darkena(col, 2, 0XFF));
return false;
}
else if(m == moFjordTroll || m == moForestTroll || m == moStormTroll) {
case moFjordTroll: case moForestTroll: case moStormTroll: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shYeti);
queuepoly(VBS, shYeti, darkena(col, 0, 0xC0));
queuepoly(VHEAD1, shPHead, darkena(col, 1, 0XFF));
queuepoly(VHEAD, shPFace, darkena(col, 2, 0XFF));
return false;
}
else if(m == moDarkTroll) {
case moDarkTroll: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shYeti);
queuepoly(VBS, shYeti, darkena(col, 0, 0xC0));
queuepoly(VHEAD1, shPHead, darkena(col, 1, 0XFF));
queuepoly(VHEAD, shPFace, 0xFFFFFF80);
return false;
}
else if(m == moRedTroll) {
case moRedTroll: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xFF), m, footphase);
ShadowV(V, shYeti);
queuepoly(VBS, shYeti, darkena(col, 0, 0xC0));
queuepoly(VHEAD1, shPHead, darkena(0xFF8000, 0, 0XFF));
queuepoly(VHEAD, shPFace, 0xFFFFFF80);
return false;
}
else if(m == moEarthElemental) {
case moEarthElemental: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 1, 0xFF), m, footphase);
ShadowV(V, shWaterElemental);
queuepoly(VBS, shWaterElemental, darkena(col, 0, 0xC0));
queuepoly(VHEAD1, shFemaleHair, darkena(col, 0, 0XFF));
queuepoly(VHEAD, shPFace, 0xF0000080);
return false;
}
else if(m == moWaterElemental) {
case moWaterElemental: {
const transmatrix VBS = VBODY * otherbodyparts(V, watercolor(50), m, footphase);
ShadowV(V, shWaterElemental);
queuepoly(VBS, shWaterElemental, watercolor(0));
queuepoly(VHEAD1, shFemaleHair, watercolor(100));
queuepoly(VHEAD, shPFace, watercolor(200));
return false;
}
else if(m == moFireElemental) {
case moFireElemental: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(firecolor(50), 0, 0xFF), m, footphase);
ShadowV(V, shWaterElemental);
queuepoly(VBS, shWaterElemental, darkena(firecolor(0), 0, 0xFF));
queuepoly(VHEAD1, shFemaleHair, darkena(firecolor(100), 0, 0xFF));
queuepoly(VHEAD, shPFace, darkena(firecolor(200), 0, 0xFF));
return false;
}
else if(m == moAirElemental) {
case moAirElemental: {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0x40), m, footphase);
ShadowV(V, shWaterElemental);
queuepoly(VBS, shWaterElemental, darkena(col, 0, 0x80));
queuepoly(VHEAD1, shFemaleHair, darkena(col, 0, 0x80));
queuepoly(VHEAD, shPFace, darkena(col, 0, 0x80));
return false;
}
else if((xch == 'd' || xch == 'D') && m != moDragonHead && m != moDragonTail) {
case moWorm: case moWormwait: case moHexSnake: {
queuepoly(V, shWormHead, darkena(col, 0, 0xFF));
queuepolyat(V, shEyes, 0xFF, PPR::ONTENTACLE_EYES);
return false;
}
case moDragonHead: {
queuepoly(V, shDragonHead, darkena(col, 0, 0xFF));
queuepolyat(V, shEyes, 0xFF, PPR::ONTENTACLE_EYES);
int noscolor = 0xFF0000FF;
queuepoly(V, shDragonNostril, noscolor);
queuepoly(V * Mirror, shDragonNostril, noscolor);
return false;
}
case moDragonTail: {
queuepoly(V, shDragonSegment, darkena(col, 0, 0xFF));
return false;
}
case moTentacle: case moTentaclewait: case moTentacleEscaping: {
queuepoly(V, shTentHead, darkena(col, 0, 0xFF));
ShadowV(V, shTentHead, PPR::GIANTSHADOW);
return false;
}
default: ;
}
if(isPrincess(m)) goto princess;
else if(isBull(m)) {
ShadowV(V, shBullBody);
int hoofcol = darkena(gradient(0, col, 0, .65, 1), 0, 0xFF);
if(mmspatial || footphase)
animallegs(VALEGS, moRagingBull, hoofcol, footphase);
queuepoly(VABODY, shBullBody, darkena(gradient(0, col, 0, .80, 1), 0, 0xFF));
queuepoly(VAHEAD, shBullHead, darkena(col, 0, 0xFF));
queuepoly(VAHEAD, shBullHorn, darkena(0xFFFFFF, 0, 0xFF));
queuepoly(VAHEAD * Mirror, shBullHorn, darkena(0xFFFFFF, 0, 0xFF));
}
else if(isBug(m)) {
ShadowV(V, shBugBody);
if(!mmspatial && !footphase)
queuepoly(VABODY, shBugBody, darkena(col, 0, 0xFF));
else {
animallegs(VALEGS, moBug0, darkena(col, 0, 0xFF), footphase);
queuepoly(VABODY, shBugAntenna, darkena(col, 1, 0xFF));
}
queuepoly(VABODY, shBugArmor, darkena(col, 1, 0xFF));
}
else if(isSwitch(m)) {
queuepoly(VFISH, shJelly, darkena(col, 0, 0xD0));
queuepolyat(VBODY, shJelly, darkena(col, 0, 0xD0), PPR::MONSTER_BODY);
queuepolyat(VHEAD, shJelly, darkena(col, 0, 0xD0), PPR::MONSTER_HEAD);
queuepolyat(VHEAD, shEyes, 0xFF, PPR::MONSTER_HEAD);
}
else if(isDemon(m)) {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 0, 0xC0), m, footphase);
queuepoly(VBS, shPBody, darkena(col, 1, 0xC0));
ShadowV(V, shPBody);
@ -1811,12 +1948,6 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
int acol = col;
queuepoly(VAHEAD, shTrylobiteHead, darkena(acol, 0, 0xFF));
}
else if(m == moEvilGolem || m == moIceGolem) {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 2, 0xC0), m, footphase);
ShadowV(V, shPBody);
queuepoly(VBS, shPBody, darkena(col, 0, 0XC0));
queuepoly(VHEAD, shGolemhead, darkena(col, 1, 0XFF));
}
else if(isWitch(m)) {
const transmatrix VBS = VBODY * otherbodyparts(V, darkena(col, 1, 0xFF), m, footphase);
int cc = 0xFF;
@ -1838,27 +1969,9 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col,
}
// just for the HUD glyphs...
else if(isIvy(m) || isMutantIvy(m) || m == moFriendlyIvy) {
else if(isAnyIvy(m)) {
queuepoly(V, shILeaf[0], darkena(col, 0, 0xFF));
}
else if(m == moWorm || m == moWormwait || m == moHexSnake) {
queuepoly(V, shWormHead, darkena(col, 0, 0xFF));
queuepolyat(V, shEyes, 0xFF, PPR::ONTENTACLE_EYES);
}
else if(m == moDragonHead) {
queuepoly(V, shDragonHead, darkena(col, 0, 0xFF));
queuepolyat(V, shEyes, 0xFF, PPR::ONTENTACLE_EYES);
int noscolor = 0xFF0000FF;
queuepoly(V, shDragonNostril, noscolor);
queuepoly(V * Mirror, shDragonNostril, noscolor);
}
else if(m == moDragonTail) {
queuepoly(V, shDragonSegment, darkena(col, 0, 0xFF));
}
else if(m == moTentacle || m == moTentaclewait || m == moTentacleEscaping) {
queuepoly(V, shTentHead, darkena(col, 0, 0xFF));
ShadowV(V, shTentHead, PPR::GIANTSHADOW);
}
else return true;