Advertisement
Guest User

Untitled

a guest
Jan 25th, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.24 KB | None | 0 0
  1. case itype_wand:
  2.         {
  3.             //!Dimentio Edit Territory      
  4.        
  5.             if(Lwpns.idCount(itemsbuf[itemid].misc1))
  6.                 return false;
  7.                
  8.        
  9.             int bookid = current_item_id(itype_book);
  10.             bool paybook = (bookid>-1 && checkmagiccost(bookid));
  11.            
  12.             if(!(itemsbuf[itemid].flags&ITEM_FLAG1) && !paybook)  //Can the wand shoot without the book?
  13.                 return false;
  14.                
  15.             if(!checkmagiccost(itemid))
  16.                 return false;
  17.                
  18.         //Why is this here? -Z
  19.                
  20.             int type = bookid != -1 ? current_item(itype_book) : itemsbuf[itemid].fam_type;
  21.             int pow = (bookid != -1 ? current_item_power(itype_book) : itemsbuf[itemid].power)*DAMAGE_MULTIPLIER;
  22.            
  23.             for(int i=(spins==1?up:dir); i<=(spins==1 ? right:dir); i++)
  24.                 if(dir!=(i^1))
  25.                 {
  26.             //YOu don;t need any of those case statements until you want to do somethign special with each type.
  27.             //Try this, for now.
  28.                     switch(itemsbuf[itemid].misc1) //!Dimentio: sort out the exceptions...
  29.                     {
  30.                         case 0: Lwpns.add(new weapon((fix)wx,(fix)wy,(fix)wz,wMagic,type,pow,i, itemid,getUID())); //! Just in case/backwards compatibility
  31.                         break;
  32.                         case 9: Lwpns.add(new weapon((fix)wx,(fix)wy,(fix)wz,itemsbuf[itemid].misc1,type,pow,i, itemid,itemid)); //!Dimentio: wandfireweapon3 is what weapon the wand fires. Determined just above.
  33.                         break;
  34.                         case 15: Ewpns.add(new weapon((fix)wx,(fix)wy,(fix)wz,ewWind,type,pow,i, itemid,getUID()));
  35.                         break;
  36.                         case 20:
  37.                         case 1:
  38.                         case 12:
  39.                         case 19:
  40.                         case 27:
  41.                         break;
  42.                         default: Lwpns.add(new weapon((fix)wx,(fix)wy,(fix)wz,itemsbuf[itemid].misc1,type,pow,i, itemid,itemid)); //!Dimentio: wandfireweapon3 is what weapon the wand fires. Determined just above.
  43.                         break;
  44.                     }
  45.                     weapon *w;
  46.                     if (itemsbuf[itemid].misc1 == 15) w = (weapon*)Lwpns.spr(Lwpns.Count()-1);
  47.                      else w = (weapon*)Lwpns.spr(Lwpns.Count()-1);
  48.                      w->LOADGFX(itemsbuf[itemid].wpn3); //use Sprites[3]
  49.                     if (itemsbuf[itemid].misc1 == 1 || itemsbuf[itemid].misc1 == 12 || itemsbuf[itemid].misc1 == 20 || itemsbuf[itemid].misc1 == 8 ||
  50.                      itemsbuf[itemid].misc1 == 2 || itemsbuf[itemid].misc1 == 13 || itemsbuf[itemid].misc1 == 16 || itemsbuf[itemid].misc1 == 28)
  51.                      {
  52.                         switch(w->dir)
  53.                         {
  54.                         case down:
  55.                             w->flip=2;
  56.                            
  57.                         case up:
  58.                             w->hyofs=2;
  59.                             w->hysz=12;
  60.                             break;
  61.                            
  62.                         case left:
  63.                             w->flip=1;
  64.                            
  65.                         case right: /*tile=o_tile+((frames>1)?frames:1)*/
  66.                             w->update_weapon_frame(((w->frames>1)?w->frames:1),w->o_tile);
  67.                             w->hxofs=2;
  68.                             w->hxsz=12;
  69.                             break;
  70.                         }
  71.                     }
  72.                     w->step = itemsbuf[itemid].misc2 / 100; //Attributes[1]
  73.                 }  //!End Dimentio Edit Territory
  74.             paymagiccost(itemid);
  75.            
  76.             if(paybook)
  77.                 paymagiccost(current_item_id(itype_book));
  78.                
  79.             if(bookid != -1)
  80.                 sfx(itemsbuf[bookid].usesound,pan(wx));
  81.             else
  82.                 sfx(itemsbuf[itemid].usesound,pan(wx));
  83.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement