Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case itype_wand:
- {
- //!Dimentio Edit Territory
- if(Lwpns.idCount(itemsbuf[itemid].misc1))
- return false;
- int bookid = current_item_id(itype_book);
- bool paybook = (bookid>-1 && checkmagiccost(bookid));
- if(!(itemsbuf[itemid].flags&ITEM_FLAG1) && !paybook) //Can the wand shoot without the book?
- return false;
- if(!checkmagiccost(itemid))
- return false;
- //Why is this here? -Z
- int type = bookid != -1 ? current_item(itype_book) : itemsbuf[itemid].fam_type;
- int pow = (bookid != -1 ? current_item_power(itype_book) : itemsbuf[itemid].power)*DAMAGE_MULTIPLIER;
- for(int i=(spins==1?up:dir); i<=(spins==1 ? right:dir); i++)
- if(dir!=(i^1))
- {
- //YOu don;t need any of those case statements until you want to do somethign special with each type.
- //Try this, for now.
- switch(itemsbuf[itemid].misc1) //!Dimentio: sort out the exceptions...
- {
- case 0: Lwpns.add(new weapon((fix)wx,(fix)wy,(fix)wz,wMagic,type,pow,i, itemid,getUID())); //! Just in case/backwards compatibility
- break;
- 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.
- break;
- case 15: Ewpns.add(new weapon((fix)wx,(fix)wy,(fix)wz,ewWind,type,pow,i, itemid,getUID()));
- break;
- case 20:
- case 1:
- case 12:
- case 19:
- case 27:
- break;
- 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.
- break;
- }
- weapon *w;
- if (itemsbuf[itemid].misc1 == 15) w = (weapon*)Lwpns.spr(Lwpns.Count()-1);
- else w = (weapon*)Lwpns.spr(Lwpns.Count()-1);
- w->LOADGFX(itemsbuf[itemid].wpn3); //use Sprites[3]
- if (itemsbuf[itemid].misc1 == 1 || itemsbuf[itemid].misc1 == 12 || itemsbuf[itemid].misc1 == 20 || itemsbuf[itemid].misc1 == 8 ||
- itemsbuf[itemid].misc1 == 2 || itemsbuf[itemid].misc1 == 13 || itemsbuf[itemid].misc1 == 16 || itemsbuf[itemid].misc1 == 28)
- {
- switch(w->dir)
- {
- case down:
- w->flip=2;
- case up:
- w->hyofs=2;
- w->hysz=12;
- break;
- case left:
- w->flip=1;
- case right: /*tile=o_tile+((frames>1)?frames:1)*/
- w->update_weapon_frame(((w->frames>1)?w->frames:1),w->o_tile);
- w->hxofs=2;
- w->hxsz=12;
- break;
- }
- }
- w->step = itemsbuf[itemid].misc2 / 100; //Attributes[1]
- } //!End Dimentio Edit Territory
- paymagiccost(itemid);
- if(paybook)
- paymagiccost(current_item_id(itype_book));
- if(bookid != -1)
- sfx(itemsbuf[bookid].usesound,pan(wx));
- else
- sfx(itemsbuf[itemid].usesound,pan(wx));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement