Esempio n. 1
0
    private void ShowEquippables()
    {
        GUILayout.Label("> Equippable", EditorStyles.boldLabel);
        MinEquipType    = (Enums.eMinEquipRequirementType)EditorGUILayout.EnumPopup("Minimum Requirement: ", MinEquipType);
        MinLevelToEquip = EditorGUILayout.IntField("Minimum Level: ", Mathf.Clamp(MinLevelToEquip, 0, 99));
        MinStatType     = (Enums.eStatType)EditorGUILayout.EnumPopup("Limiting Stat: ", MinStatType);
        MinStatLevel    = EditorGUILayout.IntField("Min Stat Level: ", Mathf.Clamp(MinStatLevel, 0, 999));

        for (int i = 0; i < UsableClasses.Count; i++)
        {
            UsableClasses[i] = (Enums.eClassType)EditorGUILayout.EnumPopup("Usable By (Class): ", UsableClasses[i]);
        }

        if (GUILayout.Button("Add Usable Class"))
        {
            UsableClasses.Add(Enums.eClassType.Melee);
        }

        for (int i = 0; i < UsableRaces.Count; i++)
        {
            UsableRaces[i] = (Enums.eRaceType)EditorGUILayout.EnumPopup("Usable By (Race): ", UsableRaces[i]);
        }

        if (GUILayout.Button("Add Usable Race"))
        {
            UsableRaces.Add(Enums.eRaceType.Human);
        }
    }
Esempio n. 2
0
    private void Reset()
    {
        mCurrentItem = new InventoryItem();

        newItemName   = "New Item";
        newItemIcon   = null;
        newItemDesc   = "New Description";
        newItemType   = Enums.eItemType.Consumable;
        newItemValue  = 0;
        newItemRarity = Enums.eRarity.Common;
        Themes        = new List <Enums.eLevelTheme>((int)Enums.eLevelTheme.All);
        Difficulties  = new List <Enums.eDifficulty>((int)Enums.eDifficulty.All);

        // consumable
        newConsumableType   = Enums.eConsumableType.Recovery;
        newRecoveryStatType = Enums.eConsumableStatType.HP;
        recoveryAmount      = 0;
        newStatType         = Enums.eStatType.HP;
        statBoostAmount     = 0;
        newEffectType       = Enums.eStatusEffect.All;
        weaponUpgradeAmount = 0;

        // stat boosts
        newBoostType   = Enums.eStatBoostType.Basic;
        StatToBoost    = Enums.eStatType.HP;
        BoostAmount    = 0;
        LongTermEffect = Enums.eLongTermEffectType.HP;
        LongTermDelay  = 0f;
        LongTermAmount = 0;
        ResistEffect   = Enums.eStatusEffect.All;
        ResistPercent  = 0f;

        // equippables
        MinEquipType    = Enums.eMinEquipRequirementType.None;
        MinLevelToEquip = 0;
        MinStatType     = Enums.eStatType.HP;
        MinStatLevel    = 0;
        UsableClasses   = new List <Enums.eClassType>((int)Enums.eClassType.All);
        UsableRaces     = new List <Enums.eRaceType>((int)Enums.eRaceType.All);

        // armours
        newArmourType = Enums.eArmourLocation.Head;
        BodySlots     = 0;

        // weapons
        BaseWeaponDamage  = 0;
        WeaponEffect      = Enums.eStatusEffect.None;
        WeaponMultiTarget = false;
        WeaponRangeType   = Enums.eWeaponType.Melee;
        MeleeTwoHanded    = false;
        Range             = 0f;
        MagicFocusType    = Enums.eMagicFocusType.Self;
        MagicType         = Enums.eMagicType.Support;
        MagicRadius       = 1f;
        MagicEffect       = Enums.eStatusEffect.None;
        MagicCost         = 0;
    }
Esempio n. 3
0
    private void ShowStatBoosts()
    {
        ShowEquippables();

        GUILayout.Label("> Stat Boost", EditorStyles.boldLabel);
        //newBoostType = (Enums.eStatBoostType)EditorGUILayout.EnumPopup("Boost Type: ", newBoostType);
        EquippableStatBoost boost = (EquippableStatBoost)mCurrentCreateType;

        switch (boost.StatBoostType)
        {
        case Enums.eStatBoostType.Basic:
            GUILayout.Label("  > Basic Boost", EditorStyles.boldLabel);
            StatBoostItem boostItem = (StatBoostItem)boost;
            StatToBoost = (Enums.eStatType)EditorGUILayout.EnumPopup("Stat: ", StatToBoost);
            BoostAmount = EditorGUILayout.IntField("Amount: ", Mathf.Clamp(BoostAmount, 0, 99));

            //if (mCurrentItem.GetType() != typeof(StatBoostItem))
            //{
            //    mCurrentItem = new StatBoostItem();
            //}
            break;

        case Enums.eStatBoostType.LongTerm:
            GUILayout.Label("  > Long Term Effect", EditorStyles.boldLabel);
            LongTermEffect = (Enums.eLongTermEffectType)EditorGUILayout.EnumPopup("Effect: ", LongTermEffect);
            LongTermDelay  = EditorGUILayout.FloatField("Interval: ", Mathf.Clamp(LongTermDelay, 0, 10));
            LongTermAmount = EditorGUILayout.IntField("Amount: ", Mathf.Clamp(LongTermAmount, 0, 99));

            //if (mCurrentItem.GetType() != typeof(LongTermEffectItem))
            //{
            //    mCurrentItem = new LongTermEffectItem();
            //}
            break;

        case Enums.eStatBoostType.Resist:
            GUILayout.Label("  > Resist", EditorStyles.boldLabel);
            ResistEffect  = (Enums.eStatusEffect)EditorGUILayout.EnumPopup("Effect: ", ResistEffect);
            ResistPercent = EditorGUILayout.FloatField("Percent: ", Mathf.Clamp(ResistPercent, 0, 100));

            //if (mCurrentItem.GetType() != typeof(ResistItem))
            //{
            //    mCurrentItem = new ResistItem();
            //}
            break;
        }
    }
Esempio n. 4
0
    public void Restore(Enums.eStatType stat, int amount = -1)
    {
        int  statIndex   = (int)stat;
        bool fullRestore = amount < 0;

        if (fullRestore)
        {
            m_CurrentStats[statIndex] = m_MaxStats[statIndex];
        }
        else
        {
            m_CurrentStats[statIndex] += amount;
        }

        // ew
        if (stat == Enums.eStatType.HP && OnHPModified != null)
        {
            OnHPModified(m_CurrentStats[statIndex], m_MaxStats[statIndex]);
        }
        else if (stat == Enums.eStatType.MP && OnMPModified != null)
        {
            OnMPModified(m_CurrentStats[statIndex], m_MaxStats[statIndex]);
        }
    }
Esempio n. 5
0
    private void ShowConsumables()
    {
        GUILayout.Label("> Consumable", EditorStyles.boldLabel);
        //newConsumableType = (Enums.eConsumableType)EditorGUILayout.EnumPopup("Consumable: ", newConsumableType);
        ConsumableItem consumable = (ConsumableItem)mCurrentCreateType;

        switch (consumable.ConsumableType)
        {
        case Enums.eConsumableType.Recovery:
            GUILayout.Label("  > Recovery", EditorStyles.boldLabel);
            RecoveryItem recovery = (RecoveryItem)consumable;
            //newRecoveryStatType = (Enums.eConsumableStatType)EditorGUILayout.EnumPopup("Stat Type: ", newRecoveryStatType);
            GUILayout.Label("Recovery Type: " + recovery.ConsumableStatType, EditorStyles.boldLabel);
            recoveryAmount = EditorGUILayout.IntField("Recovery Amount: ", Mathf.Clamp(recoveryAmount, 0, 99));

            //if (mCurrentItem.GetType() != typeof(RecoveryItem))
            //{
            //    mCurrentItem = new RecoveryItem();
            //}
            break;

        case Enums.eConsumableType.StatUpgrade:
            GUILayout.Label("  > Stat Upgrade", EditorStyles.boldLabel);
            StatUpgradeItem statUpgrade = (StatUpgradeItem)consumable;
            newStatType     = (Enums.eStatType)EditorGUILayout.EnumPopup("Boost Max Stat: ", newStatType);
            statBoostAmount = EditorGUILayout.IntField("Amount: ", Mathf.Clamp(statBoostAmount, 0, 99));

            //if (mCurrentItem.GetType() != typeof(StatUpgradeItem))
            //{
            //    mCurrentItem = new StatUpgradeItem();
            //}
            break;

        case Enums.eConsumableType.StatusEffect:
            GUILayout.Label("  > Status Effect", EditorStyles.boldLabel);
            StatusEffectItem status = (StatusEffectItem)consumable;
            newEffectType = (Enums.eStatusEffect)EditorGUILayout.EnumPopup("Effect: ", newEffectType);

            //if (mCurrentItem.GetType() != typeof(StatusEffectItem))
            //{
            //    mCurrentItem = new StatusEffectItem();
            //}
            break;

        case Enums.eConsumableType.WeaponUpgrade:
            GUILayout.Label("  > Weapon Upgrade", EditorStyles.boldLabel);
            WeaponUpgradeItem weaponUpgrade = (WeaponUpgradeItem)consumable;
            GUILayout.Label("Stat Boosted: ATT", EditorStyles.boldLabel);
            weaponUpgradeAmount = EditorGUILayout.IntField("Amount: ", Mathf.Clamp(weaponUpgradeAmount, 0, 99));

            //if (mCurrentItem.GetType() != typeof(WeaponUpgradeItem))
            //{
            //    mCurrentItem = new WeaponUpgradeItem();
            //}
            break;

        case Enums.eConsumableType.CharacterSupport:
            GUILayout.Label("  > Character Support", EditorStyles.boldLabel);
            CharacterSupportItem support = (CharacterSupportItem)consumable;
            switch (support.SupportType)
            {
            case Enums.eCharacterSupportType.Teleport:
                GUILayout.Label("    > Teleport", EditorStyles.boldLabel);
                Teleport t = (Teleport)support;
                TeleportPrefab = (GameObject)EditorGUILayout.ObjectField("Prefab:", TeleportPrefab, typeof(GameObject), false);
                if (TeleportPrefab != null)
                {
                    TeleportPrefabName = TeleportPrefab.name;
                }
                break;

            case Enums.eCharacterSupportType.Revive:
                GUILayout.Label("    > Revive", EditorStyles.boldLabel);
                // no fields
                break;

            case Enums.eCharacterSupportType.Resource:
                GUILayout.Label("    > Resource", EditorStyles.boldLabel);
                // will need fields filled in
                break;

            case Enums.eCharacterSupportType.Scroll:
                GUILayout.Label("    > Scroll", EditorStyles.boldLabel);

                ScrollTeachType = (Enums.eSpellType)EditorGUILayout.EnumPopup("Spell Type: ", ScrollTeachType);
                break;
            }
            break;
        }
    }
Esempio n. 6
0
 public UpdateCharacterStatEvent(Enums.eStatType stat, int amount, bool updateMax = false)
 {
     Stat      = stat;
     Amount    = amount;
     UpdateMax = updateMax;
 }