Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Weapon and Susceptible
Forum Rules | Mark all | Recent Posts

Weapon and Susceptible
< Newer Topic :: Older Topic > Bug

Pages:<< prev 1 next >>
Post is unread #1 Apr 18, 2006, 10:00 pm
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

Bug: each victim result susceptible at weapon with an hitroll-bonus.
Find this code:
if( dam )
{
      int x, res, imm, sus, mod;

      if( plusris )
      plusris = RIS_PLUS1 << UMIN( plusris, 7 );

      /* initialize values to handle a zero plusris */
      imm = res = -1; sus = 1;

      /* find high ris */
      for( x = RIS_PLUS1; x <= RIS_PLUS6; x <<= 1 )
      {
         if( IS_SET( victim->immune, x ) ) imm = x;
         if( IS_SET( victim->resistant, x ) ) res = x;
         if( IS_SET( victim->susceptible, x ) ) sus = x;
      }
      mod = 10;
      if( imm >= plusris ) mod -= 10;
      if( res >= plusris ) mod -= 2;
      if( sus <= plusris ) mod += 2;

      /* check if immune */
      if( mod <= 0 ) dam = -1;
      if( mod != 10 ) dam = ( dam * mod ) / 10;
}

Add: "bug( "1) MOD: %d, DAM: %d", mod, dam );" before "if ( mod <= 0 )"
Add: "bug( "2) MOD: %d, DAM: %d", mod, dam );" after "dam = ( dam * mod ) / 10;".

Now you can see that if you use a normal weapon, all it's good [mod == 10], but if you use a weapon with an hitroll-bonus, the victim result susceptible to the damage [mod == 12].

A possible fix is...

Change:

     if( plusris )
         plusris = RIS_PLUS1 << UMIN( plusris, 7 );


with...
     if( plusris )
         plusris = (RIS_PLUS1 >> 1) << UMIN( plusris, 7 )


And change the initialize values:

      
      imm = res = -1;
      sus = 1;


with

      imm = res = -1;
      sus = (RIS_PLUS6 << 1);


The same fix can be applyed in projectile etc...
Bye matteo
       
Pages:<< prev 1 next >>