Heartbeat

From The Unofficial POWDER Wiki
Jump to: navigation, search

The time within POWDER's dungeon is marked out in the 5 "phases" of the Speed System. The most important phases are the three "heartbeat" phases during which counters count down, healing counts up, and cause produces effect across the level (only the current level seems to get heartbeats). There are actually several heartbeat functions, but for the moment, this article focuses on the "creature" heartbeat, which is applied individually to every monster on the current level, including the avatar. Here's what that means:

  1. Beginnings:
    • After establishing that we are in fact in a heartbeat phase, we store the sort of tile we're standing on, for later use.
    • A wild Special Case appears! If we are possessed, but that's about to expire, we handle the expiration right here, so as to avoid a later identity crisis. It appears that the heartbeat then continues for your former host body.
    • OK, back to business. Clean up pointers and stale info from last turn.
  2. Ok, time to make some noise!
    • We go through our slots, except for hands and feet. Footwear, weapons and shields only make noise when used, but every other item makes a noise according to its item stats.
    • If we have Noisy intrinsic, we make a noise at loudness 3.
    • Finally, we make our creature base noise. The avatar's is loudness 1, some species are much louder.
    • All these noises have been accumulating into a "noise level" as described on the Noise page, which will determine what hears us this turn.
    • Quizar does not use the noise level; instead he may (1 in 30) react to each individual noise at loudness 3 or higher.
  3. A housekeeping detail: In we have the Missing a Finger intrinsic, we check if we were wearing two rings, and if so, drop one.
  4. Are we asleep? If so, check to see if something will wake us.
    • We note whether we are Tired: We also have a 1 in 20 chance of clearing the Tired intrinsic in our sleep, but that won't help us this phase.
    • If we are the avatar, we check all other monsters on the level, to see if they will wake us. If we are a monster, we check only the avatar. That means monsters don't wake each other up (at least, not this way).
    • For each target, we get their noiselevel (imperfectly, as only Quizar hears all), and subtract the distance (horizontal+vertical), then (if that's above 0) wake on a 10% chance per level, or 5% if we were Tired. So a hearing a "very loud" (4) noise, just to our upper left (2 squares away) has a 20% (or 10%) chance to wake us.
  5. Back to housekeeping:
  6. And now a biggie -- we are going through all our temporary intrinsics, counting down their timers and handling the effects for the expired ones.
    • Special cases: For Tame and Amnesic, we check if the creature that enslaved, animated, summoned, or mindsucked us, has died. If so, we clip the duration to a maximum of 5 turns (plus one for the decrement below).
    • For Tame, we now check if our master is alive, and if so restore the permanent servitude that might have been zapped by his temporary demise.
    • At this point, we actually count down the duration, and handle the effects of an intrinsic that expires.
      • If the expired intrinsic was a poison, we store the attack information for its "final damage". We will use that later because we want to manipulate the message order here.
      • For petrification, your time has run out. Unless you had Unchanging, tou're a statue.
      • If you were summoned, you shall return from whence you came. Unless you're an Animated Tree, in which case you'll take root where you stand. Burning trees become burning forests. Whatever you were carrying falls to the floor (or water, etc.).
      • If your tameness has expired, note that for later.
      • Except for poison, it's time to tell the player about the expiration.
  7. And then, to wrap up the final effects of expirations:
    • Final poison damage (even if we're resistant), and if we survive, report our cure. (If we didn't, we're out of here. doHeartbeat() fails...)
    • If we went wild this turn, we get a few turns of confused
  8. Now on to another biggie: Hunger, healing and mana recovery. Some things here only happen every 2nd turn, every 4th, or so on.
    • Up front, we use 1 unit of food. If we are using an item (usually rings) granting Invisible, use 1 more unit, and likewise for Regeneration. In the following, we will also use 1 food for each HP or MP recovered.
    • Check our hunger level. But if we have Endure Hunger, "hungry" or "starving" counts as "normal" from here on.
    • Healing proper: If we are not starving and our HP is below max, we can heal or regenerate.
      • If we have Regeneration we normally heal 1 HP every 2nd turn, but if we are "full", we instead heal every turn (as usual for fullness). Thus, a ring of regeneration doesn't change our healing if we're full. However, if we are Non-Regeneratable, the regeneration must be from a temporary source, or we get nada.
      • Otherwise (no regeneration, but not non-regeneratable) we heal 1 HP every 8th turn if at "normal" satiation, or every turn if "full".
      • If we are still below max (we just healed at most 1 HP), and we are dressed as a fighter, we heal another 1 HP every 2nd turn. Notice that this stacks with any of the other three healing conditions. (But it still doesn't work for the non-regeneratable.)
      • If we are still below max, we are a pet, and our master is dressed as a cleric, then we heal 1 HP every turn, even if we are non-regeneratable.
      • Turning to the spiritual side of things, if we have Magic Drained, we will now lose 1 mana point, every turn.
      • If our mana is below max, and we are satiated or full, we recover 1 MP every 2nd turn; If hungry, we recover 1 MP only every 4th turn.
      • If mana is still below max, and we are dressed as a wizard, we recover 1 MP every turn.
  9. Now we check for other per-turn effects, most of them painful:
    • If we have the Teleport intrinsic, 1% chance of doing so.
    • If we have the Search intrinsic, we do so. This may reveal a pit that kills us, especially if we just jumped or teleported.
    • If we are submerged in a liquid, pick one equipment slot and expose its contents to the liquid.
    • Breath-related attacks, if we are breathless skip this bit:
      • If we are Strangled, Submerged, or stuck in a wall, we take damage from strangling (1d10), drowning (2d5), or suffocating (2d5).
      • Otherwise, if there is smoke in our square, we may take damage from that. (according to type)
    • If we are Bleeding, feel the pain (1d3).
    • If we are poisoned, suffer as appropriate (unless we're resistant).
    • If we are subject to being blown by the wind, and there is a wind, we move one square in that direction.
    • If we are something that affects the squares we pass through, do that now. Living Frost freezes squares, Fire Elemental burns them, Air Elemental disperses smoke.
    • If we are to be affected by our square, do so. Forest fires burn (3d6+6 fire), lava burns (3d6+6 fire) and sets us Aflame if we aren't already (1d4+2 turns) , water puts us out if we were Aflame, acid dissolves us (4d3+9 acid) , outer space asphyxiates us (2d5). (drowning was already handled)
    • If we are aflame and not fire resistant, we burn (1d6 fire)
    • If we are Vulnerable to Silver, we take damage from any worn silver items. (2d3 per item)
    • Likewise for Allergic to Gold and golden equipment. (2d3 per item)
    • Now scan our inventory and apply the items' individual heartbeats. (This is just corpses rotting and the rare Mind Acid potato.)
    • Polymorphing is saved for last, due to its drastic effects:
      • If we have the Polymorph intrinsic, but not Unchanging, check the 1 in 300 chance of polymorphing.
      • If we are already polymorphed, but lack Unchanging, check the 1 in 1000 chance of reverting
  10. Finally, give any per-turn credits or penalties for piety conditions (just dress code and "surrounded".)
Personal tools
Free Web Hosting