Help with damage code

Posted by Oblisgr on Thu 23 Jan 2020 06:44 PM — 6 posts, 20,764 views.

#0
Hello, these are my changes in smaugfuss 1.9.3 in order to appear the number of damage done.

It compiles withour errors but it doesnt work. it appears like before.

Can you help?

if( dt == TYPE_HIT )
{
snprintf( buf1, 256, "$n %s $N%c %d", vp, punct, dam );
snprintf( buf2, 256, "You %s $N%c %d", vs, punct, dam );
snprintf( buf3, 256, "$n %s you%c %d", vp, punct, dam );
}
Australia Forum Administrator #1
Hard to say, maybe you didn't compile the new code, or if you compiled it you are not using it. Or you made the change in the wrong place.
USA Global Moderator #2
Can you link to the original source files you used and then also to copies of the new files with your changes?
#3
snprintf( buf1, 256, "$n %s $N%c %d", vp, punct, dam );
snprintf( buf2, 256, "You %s $N%c %d", vs, punct, dam );
snprintf( buf3, 256, "$n %s you%c %d", vp, punct, dam );

i made this to appear the damage number in the last
i want to make the messages appear like this:

Player hits Mob for [9] points of damage
Mob hits Player for [6] points of damage.

how i shall write it?
pleae help me i now learning c
USA Global Moderator #4
Not good enough. We need you to link to the original files before your changes and then also to copies of the new files including your changes so that we can see exactly what needs to be done in relation to what you actually did.
#5
i made what i wanted:

snprintf( buf1, 256, "[%d dmg] $n %s $N%c", dam, vp, punct);
snprintf( buf2, 256, "[%d dmg] You %s $N%c", dam, vs, punct);
snprintf( buf3, 256, "[%d dmg] $n %s you%c", dam, vp, punct);