Ejemplo n.º 1
0
    void CalculateItem(SlotItem item)
    {
        if (item != null)
        {
            switch (item.item.Category)
            {
            case ItemCategory.Armor:
                IArmor aItem = (IArmor)item.item;
                CalculateBase(aItem.Stats.Base);
                CalculateAbility(aItem.Stats.Ability);
                CalculateResistance(aItem.Stats.Resistance);
                CalculateOther(aItem.Stats.Other);
                CalculateBattle(aItem.Stats.Battle);
                break;

            case ItemCategory.Weapon:
                IWeapon wItem = (IWeapon)item.item;
                CalculateBase(wItem.Stats.Base);
                CalculateAbility(wItem.Stats.Ability);
                CalculateResistance(wItem.Stats.Resistance);
                CalculateOther(wItem.Stats.Other);
                CalculateBattle(wItem.Stats.Battle);
                break;

            case ItemCategory.Accessories:
                IAccessories acItem = (IAccessories)item.item;
                CalculateBase(acItem.Stats.Base);
                CalculateAbility(acItem.Stats.Ability);
                CalculateResistance(acItem.Stats.Resistance);
                CalculateOther(acItem.Stats.Other);
                CalculateBattle(acItem.Stats.Battle);
                break;
            }
        }
    }
Ejemplo n.º 2
0
    public IAccessories(IAccessories item)
    {
        Stats = item.Stats;

        Name        = item.Name;
        Icon        = item.Icon;
        Category    = item.Category;
        Description = item.Description;
        Value       = item.Value;
        Stack       = item.Stack;
    }
Ejemplo n.º 3
0
    void AccessoriesSwitch()
    {
        IAccessories accessories = (IAccessories)selected;

        GUILayout.Space(20);
        GUILayout.BeginHorizontal();
        Buttons();
        if (GUILayout.Button("State Resist"))
        {
            typeEdit = 6;
        }
        GUILayout.EndHorizontal();
        switch (typeEdit)
        {
        case 1:
            EditorFunctions.ViewBase(accessories.Stats.Base);
            break;

        case 2:
            EditorFunctions.ViewBattle(accessories.Stats.Battle);
            break;

        case 3:
            EditorFunctions.ViewAbility(accessories.Stats.Ability);
            break;

        case 4:
            EditorFunctions.ViewResist(accessories.Stats.Resistance);
            break;

        case 5:
            EditorFunctions.ViewOther(accessories.Stats.Other);
            break;

        case 6:
            EditorFunctions.ViewState(accessories.Stats.ResistState, "State resist");
            break;

        case 7:
            EditorFunctions.ViewSkills();
            break;
        }
    }
Ejemplo n.º 4
0
    public static CharacterStats CalculateItem(CharacterStats current, SlotItem item)
    {
        if (item != null)
        {
            switch (item.item.Category)
            {
            case ItemCategory.Armor:
                IArmor aItem = (IArmor)item.item;
                current = CalculateBase(current, aItem.Stats.Base);
                current = CalculateAbility(current, aItem.Stats.Ability);
                current = CalculateResistance(current, aItem.Stats.Resistance);
                current = CalculateOther(current, aItem.Stats.Other);
                current = CalculateBattle(current, aItem.Stats.Battle);
                break;

            case ItemCategory.Weapon:
                IWeapon wItem = (IWeapon)item.item;
                current = CalculateBase(current, wItem.Stats.Base);
                current = CalculateAbility(current, wItem.Stats.Ability);
                current = CalculateResistance(current, wItem.Stats.Resistance);
                current = CalculateOther(current, wItem.Stats.Other);
                current = CalculateBattle(current, wItem.Stats.Battle);
                break;

            case ItemCategory.Accessories:
                IAccessories acItem = (IAccessories)item.item;
                current = CalculateBase(current, acItem.Stats.Base);
                current = CalculateAbility(current, acItem.Stats.Ability);
                current = CalculateResistance(current, acItem.Stats.Resistance);
                current = CalculateOther(current, acItem.Stats.Other);
                current = CalculateBattle(current, acItem.Stats.Battle);
                break;
            }
        }
        return(current);
    }
Ejemplo n.º 5
0
    void ActionMenu()
    {
        GUILayout.BeginHorizontal("box", GUILayout.ExpandWidth(true));
        if (GUILayout.Button("Add", GUILayout.Width(100)))
        {
            //my.States.Add(new State());
            switch (ICategory)
            {
            case ItemCategory.Weapon:
                IWeapon weapon = new IWeapon();
                weapon.Category = ItemCategory.Weapon;
                my.Weapons.Add(weapon);
                break;

            case ItemCategory.Armor:
                IArmor armor = new IArmor();
                armor.Category = ItemCategory.Armor;
                my.Armors.Add(armor);
                break;

            case ItemCategory.Consume:
                IConsume consume = new IConsume();
                consume.Category = ItemCategory.Consume;
                my.Consumes.Add(consume);
                break;

            case ItemCategory.Throw:
                IThrow itemThrow = new IThrow();
                itemThrow.Category = ItemCategory.Throw;
                my.Throws.Add(itemThrow);
                break;

            case ItemCategory.Component:
                IComponent component = new IComponent();
                component.Category = ItemCategory.Component;
                my.Components.Add(component);
                break;

            case ItemCategory.Recipe:
                IRecipe recipe = new IRecipe();
                recipe.Category = ItemCategory.Recipe;
                my.Recipes.Add(recipe);
                break;

            case ItemCategory.KeyItem:
                IKey key = new IKey();
                key.Category = ItemCategory.KeyItem;
                my.KeyItems.Add(key);
                break;

            case ItemCategory.Rune:
                IRune rune = new IRune();
                rune.Category = ItemCategory.Rune;
                my.Runes.Add(rune);
                break;

            case ItemCategory.Accessories:
                IAccessories accessories = new IAccessories();
                accessories.Category = ItemCategory.Accessories;
                my.Accessories.Add(accessories);
                break;
            }
        }
        if (GUILayout.Button("Remove", GUILayout.Width(100)))
        {
            switch (ICategory)
            {
            case ItemCategory.Weapon:
                if (my.Weapons.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.Weapons.RemoveAt(my.Weapons.Count - 1);
                }
                break;

            case ItemCategory.Armor:
                if (my.Armors.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.Armors.RemoveAt(my.Armors.Count - 1);
                }
                break;

            case ItemCategory.Consume:
                if (my.Consumes.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.Consumes.RemoveAt(my.Consumes.Count - 1);
                }
                break;

            case ItemCategory.Throw:
                if (my.Throws.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.Throws.RemoveAt(my.Throws.Count - 1);
                }
                break;

            case ItemCategory.Component:
                if (my.Components.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.Components.RemoveAt(my.Components.Count - 1);
                }
                break;

            case ItemCategory.Recipe:
                if (my.Recipes.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.Recipes.RemoveAt(my.Recipes.Count - 1);
                }
                break;

            case ItemCategory.KeyItem:
                if (my.KeyItems.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.KeyItems.RemoveAt(my.KeyItems.Count - 1);
                }
                break;

            case ItemCategory.Rune:
                if (my.Runes.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.Runes.RemoveAt(my.Runes.Count - 1);
                }
                break;

            case ItemCategory.Accessories:
                if (my.Accessories.Count > 0)
                {
                    selected = null;
                    index    = 0;
                    my.Accessories.RemoveAt(my.Accessories.Count - 1);
                }
                break;
            }
        }
        GUILayout.EndHorizontal();
    }