I'm using SmaugFUSS 1.9
Was wondering, I added in a new token from the prompts to display them as a "life" bar for the character pretty much from observing the C/c tokens.
The next step I wanted to take was displaying the character's hitpoints as "Life: ???% of 100%", in the score command but I must admit I'm a little lost.
Any help would be greatly appreciated in advance.
Was wondering, I added in a new token from the prompts to display them as a "life" bar for the character pretty much from observing the C/c tokens.
case 'J':
if (ch->max_hit > 0)
percent = (100 * ch->hit ) / ch->max_hit;
else
percent = -1;
if (percent >= 100)
sprintf (pbuf, "&wLife[&R|||&Y||||&G|||&w]" );
else if (percent >= 90)
sprintf (pbuf, "&wLife[&R|||&Y||||&G||-&w]" );
else if (percent >= 80)
sprintf (pbuf, "&wLife[&R|||&Y||||&G|--&w]" );
else if (percent >= 70)
sprintf (pbuf, "&wLife[&R|||&Y||||&G---&w]" );
else if (percent >= 60)
sprintf (pbuf, "&wLife[&R|||&Y|||-&G---&w]" );
else if (percent >= 50)
sprintf (pbuf, "&wLife[&R|||&Y||--&G---&w]" );
else if (percent >= 40)
sprintf (pbuf, "&wLife[&R|||&Y|---&G---&w]" );
else if (percent >= 30)
sprintf (pbuf, "&wLife[&R|||&Y----&G---&w]" );
else if (percent >= 20)
sprintf (pbuf, "&wLife[&R||-&Y----&G---&w]" );
else if (percent >= 10)
sprintf (pbuf, "&wLife[&R|--&Y----&G---&w]" );
else
sprintf (pbuf, "&wLife[&R-&r-&R-&r-&R-&r-&R-&r-&R-&r-&w]" );
break;
The next step I wanted to take was displaying the character's hitpoints as "Life: ???% of 100%", in the score command but I must admit I'm a little lost.
Any help would be greatly appreciated in advance.