-----BEGIN PGP SIGNED MESSAGE----- // thus on Mon, 11 Mar 1996 19:40:39 -0700, Jer virtually scripted: Jer> Ok, I am trying to make the prompt system on my mud somewhat better Jer> than the stock one, I have most of the code, but being the novice Jer> programmer I am, (And for the record, I tried to RFTM :P ) ok if it Jer> worked correctly it would show your hit/mana/move in words instead of Jer> numbers....such as: Jer> HP: Hurt MG: Low MV: Tired > I Have written some stuff to do the Jer> percentials of hit mana and move, that works, its just somthing that Jer> screwd up in my ifs Would someone please tell me if this looks even Jer> REMOTLY correct An easy way to do the prompt system is make an index'ed array of strings like so... static char *health_messages[] { "perfect", "near perfect", "very good", "good", "fair", "poor", "very poor", "awful", "dying", "DEAD" } Then in the source put something like... (this is pseudo code) int index; if ( (max_hit / cur_hit) > 100) index = 0; else if ( (max_hit / cur_hit) > 95) index = 1; ... else if ( cur_hit > -10) index = 8; else index = 9; sprintf (prompt, "%s [H:%s]", prompt, health_messages[index]); d. -----BEGIN PGP SIGNATURE----- Version: 2.6.2 Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface iQCVAwUBMUT4I4X26urqpgG1AQGcFAP/STYn0HII2KFJQubzJItpMnOZqad6LpK6 tqfRMJa2Tfz0I6G17r523kXLwHqMZsZJX3HBc0R9Fa2dJNC++M616ixhjh8110eE I8+vzfwfoDFWnrTPqycdSKT20NmZvYTsvj2gWB0SqvEYM/JeWwITo2FizSgXiLvx IAYoChViHAk= =kGmX -----END PGP SIGNATURE-----
This archive was generated by hypermail 2b30 : 12/07/00 PST