Re: [NEWBIE] Modification of hitpoins and manapoints

From: Ben Cartwright (europa@vt.edu)
Date: 02/14/00


> I know, that this is dump question, but i spent weekend with it and i feel
> confused.
> I have created a function, which tells player his HIT and MANA status more
> understandly, that Xh Xm in prompt. Now I want to call it WHENEVER his
hits
> or mana changes, but i didn't found where is such function defined nor
> called.
>

The easiest way to do this would be to:
1) Add a "int need_advanced_prompt" to struct player_specials in structs.h.
2) Add a check in make_prompt (in comm.c) to see if the need_advanced_prompt
variable is nonzero, and if it is, then set it back to zero and call the
function you wrote.
3) grep "GET_HIT(" *.c
or if you're using Windows use the Find program to find any *.c files
containing the text "GET_HIT(".
After each occurance that modifies the HP, set the need_advanced_prompt
variable to nonzero.
4) Do the same for GET_MANA(, and GET_MOVE( too if you want.

You might want to make a macro or two in utils.h, such as:

#define GET_NEED_ADV_PROMPT(ch) \
    CHECK_PLR((ch), ((ch)->player_specials->need_advanced_prompt))

/* usage: MODIFY_HMV(ch); -- call after you change a player's HMV */
#define MODIFY_HMV(ch)    do { \
    GET_NEED_ADV_PROMPT(ch) = 1; \
    } while(0);

--Ben Cartwright


     +------------------------------------------------------------+
     | 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