コード例 #1
0
ファイル: ItemRefs.cs プロジェクト: youngneil1/IB2Engine
 public ItemRefs DeepCopy()
 {
     ItemRefs copy = new ItemRefs();
     copy.tag = this.tag;
     copy.name = this.name;
     copy.resref = this.resref;
     copy.canNotBeUnequipped = this.canNotBeUnequipped;
     copy.quantity = this.quantity;
     return copy;
 }
コード例 #2
0
        public ItemRefs createItemRefsFromItem(Item it)
        {
            ItemRefs newIR = new ItemRefs();

            newIR.tag                = it.tag + "_" + this.getNextIdNumber();
            newIR.name               = it.name;
            newIR.resref             = it.resref;
            newIR.canNotBeUnequipped = it.canNotBeUnequipped;
            newIR.quantity           = it.quantity;
            newIR.isRation           = it.isRation;
            newIR.isLightSource      = it.isLightSource;
            newIR.hpRegenTimer       = it.hpRegenTimer;
            newIR.spRegenTimer       = it.spRegenTimer;
            return(newIR);
        }
コード例 #3
0
        public ItemRefs DeepCopy()
        {
            ItemRefs copy = new ItemRefs();

            copy.isRation           = this.isRation;
            copy.isLightSource      = this.isLightSource;
            copy.tag                = this.tag;
            copy.name               = this.name;
            copy.resref             = this.resref;
            copy.canNotBeUnequipped = this.canNotBeUnequipped;
            copy.quantity           = this.quantity;
            copy.hpRegenTimer       = this.hpRegenTimer;
            copy.spRegenTimer       = this.spRegenTimer;
            return(copy);
        }
コード例 #4
0
ファイル: Module.cs プロジェクト: youngneil1/IB2Engine
 public ItemRefs createItemRefsFromItem(Item it)
 {
     ItemRefs newIR = new ItemRefs();
     newIR.tag = it.tag + "_" + this.getNextIdNumber();
     newIR.name = it.name;
     newIR.resref = it.resref;
     newIR.canNotBeUnequipped = it.canNotBeUnequipped;
     newIR.quantity = it.quantity;
     return newIR;
 }
コード例 #5
0
ファイル: CommonCode.cs プロジェクト: youngneil1/IB2Engine
 public void doItemScriptBasedOnUseItem(Player pc, ItemRefs itRef, bool destroyItemAfterUse)
 {
     Item it = gv.mod.getItemByResRefForInfo(itRef.resref);
     bool foundScript = false;
     if (it.onUseItem.Equals("itHealLight.cs"))
     {
         gv.sf.itHeal(pc, it, 8);
         foundScript = true;
     }
     else if (it.onUseItem.Equals("itHealMedium.cs"))
     {
         gv.sf.itHeal(pc, it, 16);
         foundScript = true;
     }
     else if (it.onUseItem.Equals("itRegenSPLight.cs"))
     {
         gv.sf.itSpHeal(pc, it, 20);
         foundScript = true;
     }
     else if (it.onUseItem.Equals("itForceRest.cs"))
     {
         gv.sf.itForceRest();
         foundScript = true;
     }
     if ((foundScript) && (destroyItemAfterUse))
     {
         gv.sf.RemoveItemFromInventory(itRef, 1);
     }
 }
コード例 #6
0
 public void RemoveItemFromInventory(ItemRefs itRef, int quantity)
 {
     //decrement item quantity
     itRef.quantity -= quantity;
     //if item quantity <= 0, remove item from inventory
     if (itRef.quantity < 1)
     {
         gv.mod.partyInventoryRefsList.Remove(itRef);
     }
 }