INTRINSIC_NAMESint_good[] = { INTRINSIC_FAST, INTRINSIC_UNCHANGING, INTRINSIC_RESISTSTONING, INTRINSIC_RESISTFIRE, INTRINSIC_RESISTCOLD, INTRINSIC_RESISTSHOCK, INTRINSIC_RESISTACID, INTRINSIC_RESISTPOISON, // INTRINSIC_RESISTPHYSICAL, // I think this is too powerful. INTRINSIC_TELEPORTCONTROL, INTRINSIC_REGENERATION, INTRINSIC_REFLECTION, INTRINSIC_SEARCH,// In someways, this is bad :> INTRINSIC_INVISIBLE, INTRINSIC_SEEINVISIBLE, INTRINSIC_TELEPATHY, INTRINSIC_NOBREATH, INTRINSIC_LIFESAVE,// You don't want this on +7 sword :> // Especially if it kicks in prior to // your amulet :> INTRINSIC_RESISTSLEEP, INTRINSIC_FREEDOM, INTRINSIC_WATERWALK, INTRINSIC_JUMP, INTRINSIC_WARNING, INTRINSIC_DIG, INTRINSIC_NONE
if (hasIntrinsic(INTRINSIC_ASLEEP)) { intnoisethreshold = 10; if (hasIntrinsic(INTRINSIC_TIRED)) { noisethreshold = 20; // A small chance of clearing the tired intrinsic early! if (!rand_choice(20)) { clearIntrinsic(INTRINSIC_TIRED); } } if (isAvatar()) { // If we are the avatar, we check all other mobs to // see if any of them will wake us. // Technically, all mobs should use this code path, // but we do have to worry about efficiency somewhere. MOB*mob; for (mob = glbCurLevel->getMobHead(); mob; mob = mob->getNext()) { // Ignore our own noise! if (mob == this) continue; intnoise, dist; noise = getNoiseLevel(mob); dist = abs(getX() - mob->getX()) + abs(getY() - mob->getY()); noise -= dist; if (noise > 0) { if (rand_choice(noisethreshold) < noise) { clearIntrinsic(INTRINSIC_ASLEEP); // Can stop the search. break; } } } } else if (getAvatar()) { intnoise, dist; noise = getAvatar()->getNoiseLevel(this); dist = abs(getAvatar()->getX() - getX()) + abs(getAvatar()->getY() - getY()); noise -= dist; if (noise > 0) { if (rand_choice(noisethreshold) < noise) clearIntrinsic(INTRINSIC_ASLEEP); } } }
void MOB::pietyHeal(int amount, bool self, bool enemy, bool vampiric) { // Necros are rewarded for healing enemies, as it is assumed // one merely wants them to suffer longer. // Otherwise, it isn't something one should be doing. if (enemy || vampiric) pietyGrant(GOD_NECRO, 1); else pietyGrant(GOD_NECRO, -5); // Clerics are of two minds of enemy healing. It is a no-op // as otherwise it would encourage uncleric like behaviour. // We get massive bonuses for healing our pets. if (!enemy) { // vampiric styles of healing are not appreciated. if (vampiric) pietyGrant(GOD_CLERIC, -1); else pietyGrant(GOD_CLERIC, self ? 1 : 3); } }