the new orbs appear (also some more refactoring and updated graphics for Swords)

This commit is contained in:
Zeno Rogue 2017-10-10 14:05:36 +02:00
parent 664ebe30ee
commit f8b47115ae
6 changed files with 76 additions and 51 deletions

View File

@ -456,7 +456,7 @@ bool ignoresPlates(eMonster m) {
}
bool itemBurns(eItem it) {
return it && it != itOrbDragon && it != itOrbFire && it != itDragon && it != itTreat;
return it && it != itOrbDragon && it != itOrbFire && it != itDragon && it != itOrbWinter && it != itOrbLava && it != itTreat && it != itLavaLily;
}
bool attackThruVine(eMonster m) {
@ -529,20 +529,22 @@ bool haveRangedOrb() {
items[itOrbIllusion] || items[itOrbSpace] || items[itOrbAir] ||
items[itOrbFrog] || items[itOrbSummon] || items[itOrbMatter] ||
items[itRevolver] || items[itOrbStunning] || items[itStrongWind] ||
items[itOrbDomination] || items[itOrbNature] || items[itOrbDash];
items[itOrbDomination] || items[itOrbNature] || items[itOrbDash] ||
items[itOrbMorph];
}
bool isOffensiveOrb(eItem it) {
return it == itOrbLightning || it == itOrbFlash || it == itOrbThorns ||
it == itOrbDragon || it == itOrbStunning ||
it == itOrbFreedom || it == itOrbPsi;
it == itOrbFreedom || it == itOrbPsi ||
it == itOrbSide1 || it == itOrbSide2 || it == itOrbSide3;
}
bool isRangedOrb(eItem i) {
return i == itOrbPsi || i == itOrbDragon || i == itOrbTeleport || i == itOrbIllusion ||
i == itOrbSpace || i == itOrbAir || i == itOrbFrog ||
i == itOrbSummon || i == itOrbMatter || i == itRevolver || i == itOrbStunning ||
i == itOrbDomination || i == itOrbNature || i == itOrbDash;
i == itOrbDomination || i == itOrbNature || i == itOrbDash || i == itOrbMorph;
}
bool isProtectionOrb(eItem i) {
@ -561,11 +563,12 @@ bool isUtilityOrb(eItem i) {
return i == itOrbSpeed || i == itOrbDigging ||
i == itOrbSafety || i == itOrbTeleport || i == itOrbAether ||
i == itOrbTime || i == itOrbSpace ||
i == itOrbSummon || i == itOrbLuck || i == itOrbEnergy;
i == itOrbSummon || i == itOrbLuck || i == itOrbEnergy ||
i == itOrbLava;
}
bool isDirectionalOrb(eItem i) {
return i == itOrbHorns || i == itOrbBull;
return i == itOrbHorns || i == itOrbBull || i == itOrbSword || i == itOrbSword2;
}
bool isRevivalOrb(eItem i) {

View File

@ -2466,7 +2466,12 @@ void checkTide(cell *c) {
if(c->land == laVolcano) {
int id = alchemyval(c, 0);
if(id < 96) {
if(c->wall == waNone || isWateryOrBoat(c) || c->wall == waVinePlant) c->wall = waMagma;
if(c->wall == waNone || isWateryOrBoat(c) || c->wall == waVinePlant) {
c->wall = waMagma;
if(itemBurns(c->item)) {
addMessage(XLAT("%The1 burns!", c->item)), c->item = itNone;
}
}
}
else if(c->wall == waMagma) c->wall = waNone;
}
@ -6036,6 +6041,10 @@ void ambush(cell *c, eItem what) {
dogs = 20;
return;
case itOrbLava:
dogs = 20;
return;
case itOrbBeauty:
dogs = 35;
return;

View File

@ -629,7 +629,10 @@ bool drawItemType(eItem it, cell *c, const transmatrix& V, int icol, int ticks,
else if(xch == 'o' || it == itInventory) {
if(it == itOrbFire) icol = firecolor(100);
queuepoly(V, shDisk, darkena(icol, 0, hidden ? 0x20 : 0xC0));
int pr = PPR_ITEM;
bool inice = c && c->wall == waIcewall;
if(inice) pr = PPR_HIDDEN;
queuepolyat(V, shDisk, darkena(icol, 0, inice ? 0x80 : hidden ? 0x20 : 0xC0), pr);
if(it == itOrbFire) icol = firecolor(200);
if(it == itOrbFriend || it == itOrbDiscord) icol = 0xC0C0C0;
if(it == itOrbFrog) icol = 0xFF0000;
@ -647,7 +650,7 @@ bool drawItemType(eItem it, cell *c, const transmatrix& V, int icol, int ticks,
isDirectionalOrb(it) ? shSpearRing :
it == itOrb37 ? shHeptaRing :
shRing;
queuepoly(V * spin(ticks / 1500.), sh, darkena(icol, 0, int(0x80 + 0x70 * sin(ticks / 300.))));
queuepolyat(V * spin(ticks / 1500.), sh, darkena(icol, 0, int(0x80 + 0x70 * sin(ticks / 300.))), pr);
}
else if(it) return true;

View File

@ -319,7 +319,11 @@ namespace inv {
gainRandomOrbs(offensiveOrbs, itBone, 25, 0);
gainRandomOrbs(elementalOrbs, itElemental, 12, 0);
gainRandomOrbs(demonicOrbs, itHell, 20, 100);
gainOrbs(itOrbLava, itLavaLily);
gainOrbs(itOrbSide3, itDogPlains);
gainOrbs(itOrbWinter, itBlizzard);
gainOrbs(itOrbSide1, itTerra);
for(auto& it: lateextraorbs) gainLate(it.treasure, it.orb);
if(items[itOrbLove] && !items[itSavedPrincess]) items[itSavedPrincess] = 1;

View File

@ -38,10 +38,7 @@ void buildRedWall(cell *c, int gemchance) {
c->wall = waRed3;
if(hrand(100+ki) < gemchance + ki)
c->item = itRedGem;
if(items[itRedGem] >= 10 && hrand(8000) < gemchance && !peace::on && !inv::on)
c->item = itOrbSpace;
else if(hrand(8000) < gemchance * PRIZEMUL)
placePrizeOrb(c);
else if(gemchance) placeLocalSpecial(c, 8000, gemchance, gemchance);
}
#define RANDPATC(c) (randpattern(c,randompattern[c->land]))
@ -680,11 +677,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->item = itFjord;
}
if(items[itFjord] >= 10 && hrand(2000) < 2 && !peace::on && !inv::on)
c->item = itOrbFish;
if(hrand(2000) < 2*PRIZEMUL)
placePrizeOrb(c);
placeLocalSpecial(c, 1000);
buildPrizeMirror(c, 1000);
}
@ -745,6 +738,8 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->hitpoints = 3;
if(hrand(8000) < PT(100 + 2 * kills[moLavaWolf], 200) && notDippingFor(itLavaLily))
c->item = itLavaLily;
else placeLocalSpecial(c, 1000, 2, 10);
// prize orbs get a bonus, because most of them are not allowed anyway
}
ONEMPTY {
if(hrand(8000) < (items[itLavaLily] + yendor::hardness()))
@ -766,11 +761,12 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->wall = waIcewall;
if(hrand(500) < PT(100 + 2 * kills[moVoidBeast] + 2 * kills[moIceGolem], 200) && notDippingFor(itBlizzard))
c->item = itBlizzard;
else placeLocalSpecial(c, 100);
}
}
if(d == 8) c->landparam = 0;
ONEMPTY {
if(hrand(8000) < 10 + 2 * (items[itBlizzard] + yendor::hardness()))
if(hrand(8000) < 10 + (items[itBlizzard] + yendor::hardness()))
c->monst = pick(moVoidBeast, moIceGolem);
}
@ -1222,10 +1218,8 @@ void giantLandSwitch(cell *c, int d, cell *from) {
}
if(coast && hrand(10) < 5) {
c->wall = waBoat;
if(items[itPirate] >= 10 && hrand(100) < 2 && !safety && !peace::on && !inv::on)
c->item = itOrbTime;
else if(hrand(100) < 2*PRIZEMUL && !safety)
placePrizeOrb(c);
placeLocalSpecial(c, 50);
}
}
if(d == 7 && c->wall == waSea && hrand(10000) < 20 + items[itPirate] + 2 * yendor::hardness() && !safety)
@ -1493,16 +1487,19 @@ void giantLandSwitch(cell *c, int d, cell *from) {
case laDogPlains:
if(d == 7 && c->land == laDogPlains) {
if(hrand(1000) < 10) {
if(hrand(1000) < 20) {
if(openplains(c)) {
c->item = itDogPlains;
vector<cell*> next;
forCellEx(c2, c) if(c2->mpdist > 7) next.push_back(c2);
if(size(next) && items[itDogPlains] < 10) {
cell *c3 = next[hrand(size(next))];
forCellEx(c4, c3) if(c4->mpdist > 7 && !isNeighbor(c4, c))
c4->monst = moHunterGuard;
if(hrand(2) == 0) {
c->item = itDogPlains;
vector<cell*> next;
forCellEx(c2, c) if(c2->mpdist > 7) next.push_back(c2);
if(size(next) && items[itDogPlains] < 10) {
cell *c3 = next[hrand(size(next))];
forCellEx(c4, c3) if(c4->mpdist > 7 && !isNeighbor(c4, c))
c4->monst = moHunterGuard;
}
}
else placeLocalSpecial(c, 10);
}
}
if(hrand(5000) < items[itDogPlains]- 17 + yendor::hardness())
@ -1542,10 +1539,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->monst = moAlbatross;
if(items[itCoast] >= 10 && hrand(10000) < 5 && !peace::on && !inv::on)
c->item = itOrbAir;
else if(items[itCoast] >= 10 && hrand(10000) < 6 && !peace::on && !inv::on)
c->item = itOrbEmpathy;
if(hrand(10000) < 5*PRIZEMUL)
placePrizeOrb(c);
else placeLocalSpecial(c, 10000, 6, 5);
buildPrizeMirror(c, 2000);
}
else if(c->landparam > 25) {
@ -1595,10 +1589,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
}
else if(hrand(5000) < treas - 20 + yendor::hardness() && !safety)
c->monst = moBomberbird;
else if(treas >= 10 && hrand(5000) < 10 && !safety && !peace::on && !inv::on)
c->item = itOrbFriend;
else if(hrand(5000) < 10*PRIZEMUL && !safety)
placePrizeOrb(c);
else placeLocalSpecial(c, 500);
}
if(d == 3 && safety && (c->wall == waMineMine || c->wall == waMineUnknown))
c->wall = waMineOpen;
@ -1743,10 +1734,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
}
else if(hrand(5000) < 100 + elkills*3 && notDippingFor(itElemental))
c->item = localshard;
else if(hrand(5000) < 10 && items[itElemental] >= 10 && !inv::on && !peace::on)
c->item = itOrbSummon;
else if(hrand(5000) < 10*PRIZEMUL)
placePrizeOrb(c);
else placeLocalSpecial(c, 500);
}
break;

View File

@ -1,4 +1,4 @@
#define ORBLINES 56
#define ORBLINES 61
// orbgen flags
@ -53,10 +53,11 @@ const orbinfo orbinfos[ORBLINES] = {
{orbgenflags::S_YENDOR, laHell, 2000, 1000,itOrbYendor},
{orbgenflags::S_NATIVE, laRlyeh, 1500, 1500,itOrbTeleport},
{orbgenflags::S_NA_O25, laMotion, 2000, 700, itOrbSafety},
{orbgenflags::S_NATIVE, laIce, 1500, 0, itOrbWinter},
{orbgenflags::S_GUEST, laIce, 1500, 0, itOrbWinter},
{orbgenflags::S_GUEST, laDragon, 2500, 0, itOrbWinter},
{orbgenflags::S_GUEST, laDryForest, 2500, 0, itOrbWinter},
{orbgenflags::S_NATIVE, laCocytus, 1500, 1500, itOrbWinter},
{orbgenflags::S_NATIVE, laCocytus, 1500, 1500, itOrbMorph},
{orbgenflags::S_GUEST, laCocytus, 1500, 0, itOrbWinter},
{orbgenflags::S_GUEST, laCaves, 1200, 0, itOrbDigging},
{orbgenflags::S_NATIVE, laDryForest, 500, 4500, itOrbThorns},
{orbgenflags::S_GUEST, laDeadCaves, 1800, 0, itGreenStone},
@ -99,7 +100,11 @@ const orbinfo orbinfos[ORBLINES] = {
{orbgenflags::S_NATIVE, laBull, 720, 3000, itOrbHorns},
{orbgenflags::S_NATIVE, laPrairie, 0, 3500, itOrbBull},
{orbgenflags::S_GUEST, laWhirlpool, 0, 0, itOrbSafety},
{orbgenflags::S_NATIVE, laWhirlpool, 0, 2000, itOrbWater},
{orbgenflags::S_NATIVE, laVolcano, 0, 7000, itOrbLava},
{orbgenflags::S_NATIVE, laDogPlains, 0, 2500, itOrbSide3},
{orbgenflags::S_NATIVE, laBlizzard, 0, 2000, itOrbWinter},
{orbgenflags::S_NATIVE, laTerracotta, 800, 2500, itOrbSide1},
{orbgenflags::S_NATIVE, laWhirlpool, 0, 2000, itOrbWater}, // needs to be last
};
eItem nativeOrbType(eLand l) {
@ -131,7 +136,7 @@ enum eOrbLandRelation {
olrPrize25, // prize for collecting 25
olrPrize3, // prize for collecting 3
olrNative, // native orb in this land
olrNative1, // native orb in this land (1)
olrNative1, // native orb in this land (1)
olrGuest, // extra orb in this land
olrPNative, // Land of Power: native
olrPBasic, // Land of Power: basic orbs
@ -139,7 +144,8 @@ enum eOrbLandRelation {
olrPNever, // Land of Power: foreign orbs
olrHub, // hub lands
olrMonster, // available from a monster
olrAlways // always available
olrAlways, // always available
olrBurns // burns
};
string olrDescriptions[] = {
@ -159,7 +165,8 @@ string olrDescriptions[] = {
"this Orb never appears in %the1",
"Hub Land: orbs appear here if unlocked in their native land",
"kill a monster, or collect 25 %2",
"always available"
"always available",
"would be destroyed in %the1"
};
eOrbLandRelation getOLR(eItem it, eLand l) {
@ -191,6 +198,8 @@ eOrbLandRelation getOLR(eItem it, eLand l) {
if(it == itOrbLife && (l == laKraken)) return olrUseless;
if(l == laVolcano && itemBurns(it)) return olrBurns;
if(it == itOrbAir && l == laAlchemist) return olrUseless;
// if(it == itOrbShield && l == laMotion) return olrUseless;
@ -453,6 +462,15 @@ void placeLocalOrbs(cell *c) {
}
}
void placeLocalSpecial(cell *c, int outof, int loc=1, int priz=1) {
if(peace::on || safety) return;
int i = hrand(outof);
if(i < loc && items[treasureType(c->land)] >= 10 && !inv::on)
c->item = nativeOrbType(c->land);
else if(i >= loc && i < loc + PRIZEMUL * priz)
placePrizeOrb(c);
}
void placeCrossroadOrbs(cell *c) {
if(peace::on) return;
for(int i=0; i<ORBLINES; i++) {