[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Bandage

Bandage

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Halomantis   (27 posts)  [Biography] bio
Date Tue 01 Jul 2003 05:49 PM (UTC)
Message
I have added the bandage code from http://ftp.kyndig.com/diku/merc/smaug/snippets/bandage.txt

It works just fine what I need help with is how to allow me to bandage other players and I need to run a check to see if the Actor and the Victim are both sitting or laying down.

Thanks before hand
[Go to top] top

Posted by Rob Harper   (108 posts)  [Biography] bio
Date Reply #1 on Tue 01 Jul 2003 06:28 PM (UTC)
Message
Would a if check on position work?
[Go to top] top

Posted by Celestine   (29 posts)  [Biography] bio
Date Reply #2 on Wed 02 Jul 2003 12:57 AM (UTC)
Message
For the character who applies the bandage, when you add the skill in the skilltable, you can set the minpos. If you don't want to do that, you can do what you said--run position checks.
[Go to top] top

Posted by Halomantis   (27 posts)  [Biography] bio
Date Reply #3 on Wed 02 Jul 2003 01:53 AM (UTC)
Message
cool I still have the problem that I am not able to direct this towards a victim.

Thanks with the answers so far they are helping me!!
[Go to top] top

Posted by Celestine   (29 posts)  [Biography] bio
Date Reply #4 on Wed 02 Jul 2003 03:20 AM (UTC)
Message
Aren't you passing in the victim as part of the argument? I mean take the name of the victim, convert it to CHAR_DATA, then use the position check on that.
[Go to top] top

Posted by Halomantis   (27 posts)  [Biography] bio
Date Reply #5 on Wed 02 Jul 2003 06:03 AM (UTC)
Message
no I mean I am trying to change the code. As it sets now you cannot bandage someone other than yourself. I am still learning how to program so I am not totally understanding how to set it up so that it looks at the victim to apply the bandage to and stop the bleeding.

Thanks beforehand!
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Reply #6 on Wed 02 Jul 2003 04:42 PM (UTC)
Message
find another peice of code in your code that uses the ability to do something to another player. just copy and paste and then change a few things here and there.
[Go to top] top

Posted by Halomantis   (27 posts)  [Biography] bio
Date Reply #7 on Wed 02 Jul 2003 05:48 PM (UTC)
Message
I would love to thank all who helped me.... here is the altered code that works just like it I wanted. Thanks again!!!!

void do_bandage( CHAR_DATA *ch, char *argument )
{
char arg1 [MAX_INPUT_LENGTH];
CHAR_DATA *victim;
/* OBJ_DATA *obj; This is commented out in case I want make them carry bandages later */

argument = one_argument( argument, arg1 );

if ( ch->mount )
{
send_to_char( "You can't do that while mounted.\n\r", ch );
return;
}

if ( arg1[0] == '\0')
{
send_to_char( "Bandage whom?\n\r", ch );
return;
}

if ( ( victim = get_char_room( ch, arg1 ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}

if ( victim->pcdata->condition[COND_BLEEDING] <= 0)
{
send_to_char( "How can you bandage that which is not bleeding? \n\r", ch );
return;
}

if ( victim->position == POS_SITTING || victim->position == POS_RESTING )
{
if(can_use_skill(ch, number_percent(), gsn_bleeding))
{
gain_condition(victim, COND_BLEEDING, -1);
act( AT_SKILL, "You place a bandage over $N's wound trying to help the bleeding!", ch, NULL, victim, TO_CHAR );
act( AT_SKILL, "$n places a bandage over your wound to help stop the bleeding!", ch, NULL, victim, TO_VICT );
act( AT_SKILL, "$n places a bandage over $N's wound to help stop the bleeding!", ch, NULL, victim, TO_NOTVICT );
learn_from_success( ch, gsn_bleeding );
return;
}
}
else
{
if ( victim == ch )
{
send_to_char( "You need to sit still to bandage yourself.\n\r", ch );
return;
}
else
{
send_to_char( "How can you bandage anyone if they won't sit still. /n/r", ch );
return;
}
return;
}
}
[Go to top] 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.


18,899 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]