Real Time Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CF: Direction, maps and balancing
- To: crossfire (at) ifi.uio.no
- Subject: Re: CF: Direction, maps and balancing
- From: Kjetil Torgrim Homme <>
- Date: 10 Jun 1999 23:46:51 +0200
- In-Reply-To: <>
- References: <> <>
- Sender:
[Mark Wedel]
> Well, the way I envision the 'new' object structure when it is
> cleaned up is for the object itself to only have the basic
> information that all objects need (map it belongs on, above,
> below, face, etc.) There is then a substructure which contains
> the item specific attributes (hp, sp, speed, etc for monsters,
> connected status, current state, reset status, etc for gates.
>
> The player and monster will diverge in that model, since there
> are so many extra thing the player has anyways, it didn't seem to
> make the player a subobject of the monster.
I think it will be benificial to use a common structure for the common
variables. In classic LPMUD, the inheritance tree looked like this:
object
/ | \
room living container etc.
/ \
player monster
So all combat was handled in "living", but stuff like responding to
player input was only in the monster code.
How about a structure like
struct object {
universal attributes (face etc.)
int objtype;
union {
struct living *l;
struct item *i;
...
}
}
struct living {
attributes for living creatures (con, dex, hp, ...)
bool is_player;
union {
struct player *p;
struct monster *m;
}
}
Kjetil T.
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to ]