Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: a patch for ring bug.



Random rings with Pow stat will be generated by the following patch.


*** common.org/treasure.c	Sun Jun 22 14:52:33 1997
--- common/treasure.c	Sun Aug 17 22:30:39 1997
***************
*** 504,517 ****
   */
  
  void set_ring_bonus(object *op,int bonus) {
!   int r=RANDOM()%(bonus>0?24:10);
    if(op->type==AMULET)
      if(!(RANDOM()%21))
!       r=19+RANDOM()%2;
      else if(RANDOM()&2)
!       r=9;
      else
!       r=10+RANDOM()%9;
    switch(r) {
    case 0:
      if(op->stats.Str)
--- 504,517 ----
   */
  
  void set_ring_bonus(object *op,int bonus) {
!   int r=RANDOM()%(bonus>0?25:11);
    if(op->type==AMULET)
      if(!(RANDOM()%21))
!       r=20+RANDOM()%2;
      else if(RANDOM()&2)
!       r=10;
      else
!       r=11+RANDOM()%9;
    switch(r) {
    case 0:
      if(op->stats.Str)
***************
*** 544,569 ****
      op->stats.Wis=bonus;
      break;
    case 6:
      if(op->stats.dam)
        return;
      op->stats.dam=bonus;
      break;
!   case 7:
      if(op->stats.wc)
        return;
      op->stats.wc=bonus;
      break;
!   case 8:
      if(op->stats.food)
        return;
      op->stats.food=bonus; /* hunger/sustenance */
      break;
!   case 9:
      if(op->stats.ac)
        return;
      op->stats.ac=bonus;
      break;
!   case 10:
      if(bonus==2) { /* Maybe make an artifact of this? */
        op->immune|=AT_PARALYZE;
        op->immune|=AT_SLOW;
--- 544,574 ----
      op->stats.Wis=bonus;
      break;
    case 6:
+     if(op->stats.Pow)
+       return;
+     op->stats.Pow=bonus;
+     break;
+   case 7:
      if(op->stats.dam)
        return;
      op->stats.dam=bonus;
      break;
!   case 8:
      if(op->stats.wc)
        return;
      op->stats.wc=bonus;
      break;
!   case 9:
      if(op->stats.food)
        return;
      op->stats.food=bonus; /* hunger/sustenance */
      break;
!   case 10:
      if(op->stats.ac)
        return;
      op->stats.ac=bonus;
      break;
!   case 11:
      if(bonus==2) { /* Maybe make an artifact of this? */
        op->immune|=AT_PARALYZE;
        op->immune|=AT_SLOW;
***************
*** 572,606 ****
      } else
        op->protected|=AT_PARALYZE;
      break;
!   case 11:
      op->protected|=AT_MAGIC;
      op->value*=2;
      break;
!   case 12:
      op->protected|=AT_ELECTRICITY;
      break;
!   case 13:
      op->protected|=AT_FIRE;
      op->vulnerable|=AT_COLD;
      op->value=(op->value*3)/2;
      break;
!   case 14:
      op->protected|=AT_DRAIN;
      break;
!   case 15:
      op->protected|=AT_SLOW;
      break;
!   case 16:
      op->protected|=AT_COLD;
      op->vulnerable|=AT_FIRE;
      break;
!   case 17:
      op->protected|=AT_POISON;
      break;
!   case 18:
      op->protected|=AT_FEAR;
      break;
!   case 19:
      if(op->type==AMULET) {
        SET_FLAG(op,FLAG_REFL_SPELL);
        op->value*=11;
--- 577,611 ----
      } else
        op->protected|=AT_PARALYZE;
      break;
!   case 12:
      op->protected|=AT_MAGIC;
      op->value*=2;
      break;
!   case 13:
      op->protected|=AT_ELECTRICITY;
      break;
!   case 14:
      op->protected|=AT_FIRE;
      op->vulnerable|=AT_COLD;
      op->value=(op->value*3)/2;
      break;
!   case 15:
      op->protected|=AT_DRAIN;
      break;
!   case 16:
      op->protected|=AT_SLOW;
      break;
!   case 17:
      op->protected|=AT_COLD;
      op->vulnerable|=AT_FIRE;
      break;
!   case 18:
      op->protected|=AT_POISON;
      break;
!   case 19:
      op->protected|=AT_FEAR;
      break;
!   case 20:
      if(op->type==AMULET) {
        SET_FLAG(op,FLAG_REFL_SPELL);
        op->value*=11;
***************
*** 609,615 ****
        op->value*=4;
      }
      break;
!   case 20:
      if(op->type==AMULET) {
        SET_FLAG(op,FLAG_REFL_MISSILE);
        op->value*=9;
--- 614,620 ----
        op->value*=4;
      }
      break;
!   case 21:
      if(op->type==AMULET) {
        SET_FLAG(op,FLAG_REFL_MISSILE);
        op->value*=9;
***************
*** 618,624 ****
        op->value*=3;
      }
      break;
!   case 21:
      if(op->stats.exp)
        return;
      op->stats.exp=bonus; /* Speed! */
--- 623,629 ----
        op->value*=3;
      }
      break;
!   case 22:
      if(op->stats.exp)
        return;
      op->stats.exp=bonus; /* Speed! */
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]