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
➜ New RIS (resistance, immune, susceptible) types
|
New RIS (resistance, immune, susceptible) types
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Tseris
(98 posts) Bio
|
| Date
| Sun 14 Oct 2007 08:43 AM (UTC) |
| Message
| First of all Id like to thank all of you who are helping new mud builders like me with all of our variable and sometimes obscure problems. I read this forum for a couple weeks before I started posting to it, and you guys' patience seems to be endless. So thank you.
And on to my current issue. I wrote out the words in the subject box in case anyone else tries to search the same thing. Id like to add new RIS types for use with weapons, spells, races, etc. and would like to know what all I need to look at and change. Heres what Ive seen so far:
in mud.h:
/*
* Resistant Immune Susceptible flags
*/
#define RIS_FIRE BV00
#define RIS_COLD BV01
#define RIS_ELECTRICITY BV02
#define RIS_ENERGY BV03
#define RIS_BLUNT BV04
#define RIS_PIERCE BV05
#define RIS_SLASH BV06
#define RIS_ACID BV07
#define RIS_POISON BV08
#define RIS_DRAIN BV09
#define RIS_SLEEP BV10
#define RIS_CHARM BV11
#define RIS_HOLD BV12
#define RIS_NONMAGIC BV13
#define RIS_PLUS1 BV14
#define RIS_PLUS2 BV15
#define RIS_PLUS3 BV16
#define RIS_PLUS4 BV17
#define RIS_PLUS5 BV18
#define RIS_PLUS6 BV19
#define RIS_MAGIC BV20
#define RIS_PARALYSIS BV21
/* 21 RIS's*/
in magic.c:
/*
* Is immune to a damage type
*/
bool is_immune( CHAR_DATA * ch, short damtype )
{
switch ( damtype )
{
case SD_FIRE:
return ( IS_SET( ch->immune, RIS_FIRE ) );
case SD_COLD:
return ( IS_SET( ch->immune, RIS_COLD ) );
case SD_ELECTRICITY:
return ( IS_SET( ch->immune, RIS_ELECTRICITY ) );
case SD_ENERGY:
return ( IS_SET( ch->immune, RIS_ENERGY ) );
case SD_ACID:
return ( IS_SET( ch->immune, RIS_ACID ) );
case SD_POISON:
return ( IS_SET( ch->immune, RIS_POISON ) );
case SD_DRAIN:
return ( IS_SET( ch->immune, RIS_DRAIN ) );
}
return FALSE;
}
Changing the Plus1 to 'Holy' or whatever is simple enough, and 6 extras is plenty. But id like to know where else id need to change things. Thanks alot. Tseris | | Top |
|
| Posted by
| Conner
USA (381 posts) Bio
|
| Date
| Reply #1 on Sun 14 Oct 2007 08:30 PM (UTC) |
| Message
| | grep is your friend. ;) |
-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org | | Top |
|
| Posted by
| Tseris
(98 posts) Bio
|
| Date
| Reply #2 on Mon 15 Oct 2007 10:45 PM (UTC) |
| Message
| Hrmm. Okay used grep on RIS_FIRE so that I could add my own RIS_HOLY, and made changes to magic.c, mud_comm.c, and mud.h, but ran into a problem in fight.c:
fight.c: In function ‘ch_ret one_hit(CHAR_DATA*, CHAR_DATA*, int)’:
fight.c:1258: error: ‘RIS_PLUS1’ was not declared in this scope
fight.c:1269: error: ‘RIS_PLUS1’ was not declared in this scope
fight.c: In function ‘ch_ret projectile_hit(CHAR_DATA*, CHAR_DATA*, OBJ_DATA*, OBJ_DATA*, short int)’:
fight.c:1584: error: ‘RIS_PLUS1’ was not declared in this scope
fight.c:1595: error: ‘RIS_PLUS1’ was not declared in this scope
fight.c: In function ‘ch_ret damage(CHAR_DATA*, CHAR_DATA*, int, int)’:
fight.c:1816: error: ‘IS_HOLY’ was not declared in this scope
make[1]: *** [o/fight.o] Error 1
make: *** [all] Error 2
I replaced RIS_PLUS1 with RIS_HOLY, thinking that RIS_PLUS1 through RIS_PLUS6 were extras, but its looking like those are used for resisting weapon damage? So should I just add an extra RIS at the end of RIS types in mud.h? | | Top |
|
| Posted by
| Tseris
(98 posts) Bio
|
| Date
| Reply #3 on Mon 15 Oct 2007 10:54 PM (UTC) |
| Message
| Okay, now my mud.h looks like this:
/*
* Resistant Immune Susceptible flags
*/
#define RIS_FIRE BV00
#define RIS_COLD BV01
#define RIS_ELECTRICITY BV02
#define RIS_ENERGY BV03
#define RIS_BLUNT BV04
#define RIS_PIERCE BV05
#define RIS_SLASH BV06
#define RIS_ACID BV07
#define RIS_POISON BV08
#define RIS_DRAIN BV09
#define RIS_SLEEP BV10
#define RIS_CHARM BV11
#define RIS_HOLD BV12
#define RIS_NONMAGIC BV13
#define RIS_PLUS1 BV14
#define RIS_PLUS2 BV15
#define RIS_PLUS3 BV16
#define RIS_PLUS4 BV17
#define RIS_PLUS5 BV18
#define RIS_PLUS6 BV19
#define RIS_MAGIC BV20
#define RIS_PARALYSIS BV21
#define RIS_HOLY BV22
/* 22 RIS's*/
and my fight.c looks like this:
/*
* Check damage types for RIS -Thoric
*/
if( dam && dt != TYPE_UNDEFINED )
{
if( IS_FIRE( dt ) )
dam = ris_damage( victim, dam, RIS_FIRE );
else if( IS_COLD( dt ) )
dam = ris_damage( victim, dam, RIS_COLD );
else if( IS_ACID( dt ) )
dam = ris_damage( victim, dam, RIS_ACID );
else if( IS_ELECTRICITY( dt ) )
dam = ris_damage( victim, dam, RIS_ELECTRICITY );
else if( IS_ENERGY( dt ) )
dam = ris_damage( victim, dam, RIS_ENERGY );
else if( IS_DRAIN( dt ) )
dam = ris_damage( victim, dam, RIS_DRAIN );
else if( IS_HOLY( dt ) )
dam = ris_damage( victim, dam, RIS_HOLY ); /* Tseris */
else if( dt == gsn_poison || IS_POISON( dt ) )
dam = ris_damage( victim, dam, RIS_POISON );
but my compile looks like this:
Compiling o/fight.o....
fight.c: In function ‘ch_ret damage(CHAR_DATA*, CHAR_DATA*, int, int)’:
fight.c:1816: error: ‘IS_HOLY’ was not declared in this scope
make[1]: *** [o/fight.o] Error 1
make: *** [all] Error 2
Thoughts?
| | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #4 on Mon 15 Oct 2007 11:08 PM (UTC) |
| Message
| | Look for the definitions of IS_DRAIN, IS_ENERGY and so forth. You'll need to add one for IS_HOLY. (Again, grep is your friend for finding those definitions. Or search in mud.h with a text editor.) |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Tseris
(98 posts) Bio
|
| Date
| Reply #5 on Mon 15 Oct 2007 11:19 PM (UTC) |
| Message
| | Found it. Defined IS_HOLY and SD_HOLY and clean compile. You're the bomb. | | 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.
25,143 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top