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 whatif_equipment()
    {
        PAGENAME = "whatif_equipment.aspx";

        featureHelper = new EquipmentDelegate();

        fieldsNonEditable    = new bool[featureHelper.FIELDS.Length];
        fieldsNonEditable[1] = true;
    }
Exemplo n.º 3
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();
    }
Exemplo n.º 4
0
    public equipment()
    {
        PAGENAME = "/input/equipment/table.aspx";

        featureHelper = new EquipmentDelegate();
    }
Exemplo n.º 5
0
    //create the method delegate for each item
    EquipmentDelegate DelegateCreation(object target, string functionName)
    {
        EquipmentDelegate eq = (EquipmentDelegate)Delegate.CreateDelegate(typeof(EquipmentDelegate), target, functionName);

        return(eq);
    }