Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ battle prompt
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Ithildin
USA (262 posts) Bio
|
| Date
| Fri 05 Mar 2004 07:05 AM (UTC) |
| Message
| ok, so i'm switching everything from my windows smaug to smaugfuss on cygwin. but not everything compiles correctly. in my battle prompt, on my windows version, it shows something like this:
hp mana mv Ithildin: [Perfect Health] mob: [Perfect Health]
whenever i switched it to the smaugfuss, it only shows:
hp mana mv %s: [Perfect Health] %s: [Perfect Health]
here's some of my code:
case 'C': /* Tank */
if ( !IS_IMMORTAL( ch ) ) break;
if ( !ch->fighting || ( victim = ch->fighting->who ) == NULL )
strcpy( pbuf, "N/A" );
else if(!victim->fighting||(victim = victim->fighting->who)==NULL)
strcpy( pbuf, "N/A" );
else {
if ( victim->max_hit > 0 )
percent = (100 * victim->hit) / victim->max_hit;
else
percent = -1;
if (percent >= 100)
strcpy (pbuf, "&c%s: [\x1b[1;32mPerfect Health\x1b[0m]");
else if (percent >= 90)
strcpy (pbuf, "&c%s: [\x1b[33mSlightly Scratched\x1b[0m]");
else if (percent >= 80)
strcpy (pbuf, "&c%s: [\x1b[1;33mFew Bruises\x1b[0m]");
else if (percent >= 70)
strcpy (pbuf, "&c%s: [\x1b[1;33mSome Cuts\x1b[0m]");
else if (percent >= 60)
strcpy (pbuf, "&c%s: [\x1b[1;35mSeveral Wounds\x1b[0m]");
else if (percent >= 50)
strcpy (pbuf, "&c%s: [\x1b[35mNasty Wounds\x1b[0m]");
else if (percent >= 40)
strcpy (pbuf, "&c%s: [\x1b[35mBleeding Freely\x1b[0m]");
else if (percent >= 30)
strcpy (pbuf, "&c%s: [\x1b[31mCovered in Blood\x1b[0m]");
else if (percent >= 20)
strcpy (pbuf, "&c%s: [\x1b[1;31mLeaking Guts\x1b[0m]");
else if (percent >= 10)
strcpy (pbuf, "&c%s: [\x1b[1;31mAlmost Dead\x1b[0m]");
else
strcpy (pbuf, "&c%s: [\x1b[1;31mDYING\x1b[0m]");
}
break;
how do i make the names go back into the %s?
| | Top |
|
| Posted by
| Ithildin
USA (262 posts) Bio
|
| Date
| Reply #1 on Fri 05 Mar 2004 07:10 AM (UTC) |
| Message
| | ok, i found it. i changed to sprintf and put a victim->name in there. worked. | | Top |
|
| Posted by
| Greven
Canada (835 posts) Bio
|
| Date
| Reply #2 on Fri 05 Mar 2004 07:24 AM (UTC) |
| Message
| | BTW, you may want to remove the manual color codes, and put in the mud ones. If you don't, this will force color on the person, even if they have color turned off, and should someone be using a really old client, may cause other problems. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,029 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top