Re: Breathing

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 02/14/00


Dave Ely wrote:
>
> Hello, I have played a MUD where you basically breathed.  If you moved too fast you ran out of breath.  I'm trying to Imp that and getting stuck.  Here's what I have already.
>
> Theory of how it should work, I think.  Basically every char will have a value for breath at 100, every second or so, it will add a # to breath if it's less than 100.  When a move is performed, it will subtract a # from breath.  so.. following this logic of lack of.  I move, I lose 5 from breath, pulse, I get 5 back, my breath is 100.  I move move move move move, I lose 25 from breath, pulse, I get 5 back, my breath is 80.
>
Hrmmm, sounds a lot like Movement Points to me.

> If anyone can Help I'd apprecitate it.  Also, I want to add in a Stamina Attribute that will affect breath, but need help with putting in new attributes so their in all the proper places.
>
The best thing I can tell you is to grep for existing attributes (HP,
MP, AC, etc...) and add stuff everywhere you see stuff for the existing
attribute.

> (the followingn should just keep adding 5 to breath every second, and I have it added to prompt to show, but I cant get past login name, never asks for pword)
>
> in act.movement.c
>
> void perform_breath(void)
> {
>   struct char_data *ch;
>
>   for (ch = character_list; ch; ch->next)
>     GET_BREATH(ch) += 5;
>
> }
>
> in comm.c
> if (!(pulse % PULSE_BREATH))
>   perform_breath();
>
> in structs.h
> #define PULSE_BREATH    (1 RL_SEC)
>
> (in player section)
> int breath;
>
1.  `int breath;' needs to go into struct char_data.

2.  You'll have to initialize breath to 80 everytime a player logs in or
that player will immediately be out of breath.

> utils.h
> #define GET_BREATH(ch)  ((ch)->breath)

PS.  Please set your email client to wrap lines at 70 characters or so.

Regards, Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT