Exemplo n.º 1
0
    public void Equip(Monster Monster, int slot)
    {
        monster = Monster;
        Slot    = slot;


        //get string of the name of the item
        string name = string.Concat(itemName.Where(c => !char.IsWhiteSpace(c)));

        //convert string to a delegate to call the method of the name of the ability
        equipMethod = DelegateCreation(this, name);

        if (Slot == 1)
        {
            monster.info.equip1 = this;
        }
        else if (Slot == 2)
        {
            monster.info.equip2 = this;
        }

        isEquipped = true;


        //SetInventorySlot(inventorySlot);

        equipMethod.Invoke();
        //refresh the monster's list of stat modifiers
        monster.MonsterStatMods();
    }
Exemplo n.º 2
0
    public EquipEffect(Monster Monster, EquipmentScript Equipment, int slot)
    {
        monster   = Monster;
        equipment = Equipment;
        Slot      = slot;



        equipment.UnEquip();

        //get string of the name of the item
        string name = string.Concat(equipment.itemName.Where(c => !char.IsWhiteSpace(c)));

        //convert string to a delegate to call the method of the name of the ability
        equipMethod = DelegateCreation(this, name);
        //call the method that lines up with the name of the item
        equipMethod.Invoke();
        //refresh the monster's list of stat modifiers
        monster.MonsterStatMods();
    }