Confused about mutually dependant classes

From: Peter Ruderman (pruderman_at_rogers.com)
Date: 05/19/04


Date: Tue, 18 May 2004 22:53:06 GMT

Hello,

I'm writing a game (though it isn't a serious project). The game contains
creatures, each of whom has a number of hit points. Hit points are lost by
taking damage, and creatures may have various ways of modifying the amount
of damage they receive. In addition, damage may have other effects
unrelated to the creature itself. For example, fire damage might destroy a
creature's flammable possessions.

I'm confused about how to design the classes to support this system. It
seems appropriate to have a damage class that abstracts the various things
damage can do, but how do I divide the work of dealing damage between the
creature class and the damage class? Should damage be aware of the various
ways it can be resisted? Should creatures be aware of all the things damage
can do (besides reducing hit points)? Should damage deal itself to
creatures, or should creatures receive damage? How do I design a mutual
interface such that only these two classes can use it?

Any help would be greatly appreciated.

- Peter Ruderman



Relevant Pages

  • Otilukes
    ... The Acid cloud formed persists for 1 round/2 levels, dealing 1d4 damage per round to all who remain within, though any wind effects clear it after one round. ... The orb may be held before firing for up to 1 round/level, treated as a touch spell for which you are holding the charge. ... Sunken objects or creatures may be raised to the surface if in range. ... A 20' square screen of any colour the caster desires is created, sitting veryically in whatever space the caster desires. ...
    (rec.games.frp.dnd)
  • Re: Combat systems and mental blocks
    ... means to heal that damage. ... tenth of the game. ... dealt more damage in the turn it takes to drink the potion than you ... If you always have only 100 hit points, 10 extra hit points in one turn ...
    (rec.games.roguelike.development)
  • Re: I Need Balancing for Four Spells
    ... Spell Resistance: Yes ... sunder, disarm, trip, or bull rush attack against that person. ... spell can affect creatures immune to physical damage or force ... strength bonus, plus the weapon damage. ...
    (rec.games.frp.dnd)
  • Re: DEX Bonus to damage feat
    ... The arguments used for adding a DEX bonus to damage, however, might also be used to argue for an INT bonus to damage - analogous to the ranger's favored enemy class feature. ... I wouldn't propose a damage enhancement based on INT either, but I would probably link the application of a DEX enhancement to an ability based on INT and limit it to creatures that would normally be subject to sneak attack damage. ... In deference to the ranger class, I usually have the ranger, if one is present, roll for the entire party with other players rolling to assist. ...
    (rec.games.frp.dnd)
  • Re: Two 3.0 paladin questions
    ... creatures with a high evil DR at this point. ... longsword against evil creatures you do double damage, ... It's +1 per 3 caster levels, ...
    (rec.games.frp.dnd)