Advertisement
ZoriaRPG

Dimentio - Wand of Wondor 2

Jan 23rd, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.05 KB | None | 0 0
  1.  
  2.  
  3.     case itype_wand:
  4.         {
  5.             //!Dimentio Edit Territory
  6.             int wandfireweapon1 = current_item_id(itype_wand); //I'm doing it the long way to test this, as I have no idea if doing it the shorter way will cause problems
  7.            // int wandfireweapon3; //Store the weapon value in here, for use later/to prevent 27 copies of the new weapon code.
  8.             /*
  9.        
  10.         switch(itemsbuf[wandfireweapon1].misc1) //Okay, what weapon will the wand fire?
  11.             {
  12.                 case 0: wandfireweapon3 = wMagic; //Magic is default.
  13.                         break;
  14.                 case 1: wandfireweapon3 = wArrow; //Arrows?
  15.                         break;
  16.                 case 2: wandfireweapon3 = wFire; //Fire?
  17.                         break;
  18.                 case 3: wandfireweapon3 = wWind; //Wind?
  19.                         break;
  20.                 case 4: wandfireweapon3 = wRefMagic; //Reflected Magic?
  21.                         break;
  22.                 case 5: wandfireweapon3 = wRefFireball; //Reflected Fireball?
  23.                         break;
  24.                 case 6: wandfireweapon3 = wRefRock; //Reflected Rock?
  25.                         break;
  26.                 case 7: wandfireweapon3 = wRefBeam; //Reflected Sword Beam?
  27.                         break;
  28.                 case 8: wandfireweapon3 = wBrang; //Boomerang?
  29.                         break;
  30.                 case 9: wandfireweapon3 = wBeam; //Sword Beam?
  31.                         break;
  32.                 //Less sure about the following ones:
  33.                 case 10: wandfireweapon3 = wLitBomb; //Bomb?
  34.                         break;
  35.                 case 11: wandfireweapon3 = wLitSBomb; //SuperBomb?
  36.                         break;
  37.                 case 12: wandfireweapon3 = wBomb; //Explosion?
  38.                         break;
  39.                 case 13: wandfireweapon3 = wSBomb; //Super Explosion?
  40.                         break;
  41.                 case 14: wandfireweapon3 = wSSparkle; //Sparkle?
  42.                         break;
  43.                 case 15: wandfireweapon3 = wFSparkle; //Fire Sparkle?
  44.                         break;
  45.                 case 16: wandfireweapon3 = wHookshot; //Hookshot?
  46.                         break;
  47.                 case 17: wandfireweapon3 = wBait; //Woo! BaitWand!
  48.                 //Script weapon time!
  49.                 case 18: wandfireweapon3 = wScript1;
  50.                         break;
  51.                 case 19: wandfireweapon3 = wScript2;
  52.                         break;
  53.                 case 20: wandfireweapon3 = wScript3;
  54.                         break;
  55.                 case 21: wandfireweapon3 = wScript4;
  56.                         break;
  57.                 case 22: wandfireweapon3 = wScript5;
  58.                         break;
  59.                 case 23: wandfireweapon3 = wScript6;
  60.                         break;
  61.                 case 24: wandfireweapon3 = wScript7;
  62.                         break;
  63.                 case 25: wandfireweapon3 = wScript8;
  64.                         break;
  65.                 case 26: wandfireweapon3 = wScript9;
  66.                         break;
  67.                 case 27: wandfireweapon3 = wScript10;
  68.                         break;    
  69.                
  70.             }
  71.         */
  72.        
  73.        
  74.        
  75.             if(Lwpns.idCount(itemsbuf[wandfireweapon1].misc1))
  76.                 return false;
  77.                
  78.        
  79.             int bookid = current_item_id(itype_book);
  80.             bool paybook = (bookid>-1 && checkmagiccost(bookid));
  81.            
  82.             if(!(itemsbuf[itemid].flags&ITEM_FLAG1) && !paybook)  //Can the wand shoot without the book?
  83.                 return false;
  84.                
  85.             if(!checkmagiccost(itemid))
  86.                 return false;
  87.                
  88.         //Why is this here? -Z
  89.             if(Lwpns.idCount(wBeam))
  90.                 Lwpns.del(Lwpns.idFirst(wBeam));
  91.                
  92.             int type = bookid != -1 ? current_item(itype_book) : itemsbuf[itemid].fam_type;
  93.             int pow = (bookid != -1 ? current_item_power(itype_book) : itemsbuf[itemid].power)*DAMAGE_MULTIPLIER;
  94.            
  95.             for(int i=(spins==1?up:dir); i<=(spins==1 ? right:dir); i++)
  96.                 if(dir!=(i^1))
  97.                 {
  98.             //YOu don;t need any of those case statements until you want to do somethign special with each type.
  99.             //Try this, for now.
  100.                  Lwpns.add(new weapon((fix)wx,(fix)wy,(fix)wz,itemsbuf[wandfireweapon1].misc1,type,pow,i, itemid,getUID())); //!Dimentio: wandfireweapon3 is what weapon the wand fires. Determined just above.
  101.                  weapon *w = (weapon*)Lwpns.spr(Lwpns.Count()-1);
  102.                  w->LOADGFX(itemsbuf[wandfireweapon1].wpn3 + w->dir); //use Sprites[2]
  103.                  w->step = itemsbuf[wandfireweapon1].misc2; //Attributes[1]
  104.                 }  
  105.             paymagiccost(itemid);
  106.            
  107.             if(paybook)
  108.                 paymagiccost(current_item_id(itype_book));
  109.                
  110.             if(bookid != -1)
  111.                 sfx(itemsbuf[bookid].usesound,pan(wx));
  112.             else
  113.                 sfx(itemsbuf[itemid].usesound,pan(wx));
  114.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement