示例#1
0
 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
 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
 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);
     }
 }