Esempio n. 1
0
    public void SetStat(ShopTabManager manager)
    {
        Index = manager.stat;

        PosTo = new Vector2(GetComponent <RectTransform>().sizeDelta.x * -(Stat.d[Index].Value - 1), target.localPosition.y);
        target.localPosition = PosTo;
    }
    public void ModifyStatValue(eStat stat, int amount)
    {
        switch (stat)
        {
        case eStat.MAX_AP:
            SetMaxAp(amount);
            break;

        case eStat.MAX_MP:
            SetMaxMp(amount);
            break;

        case eStat.STR:
            strength = (strength + amount < 0) ? 0 : strength + amount;
            break;

        case eStat.INT:
            intelligence = (intelligence + amount < 0) ? 0 : intelligence + amount;
            break;

        case eStat.AGI:
            agility = (agility + amount < 0) ? 0 : agility + amount;
            break;

        case eStat.RES:
            resolve = (resolve + amount < 0) ? 0 : resolve + amount;
            break;
        }
    }
Esempio n. 3
0
    private void CopyHealProperty(HealProperty prop)
    {
        eStat scaling = new eStat();

        scaling = prop.scaleFactor;

        MinMaxValue[] values = new MinMaxValue[5];

        for (int i = 0; i < 5; i++)
        {
            MinMaxValue val = new MinMaxValue(prop.healPerLevel [i].min, prop.healPerLevel [i].max);
            values [i] = val;
        }

        bool targetCaster = prop.targetCasterOverride;
        bool affectCaster = prop.affectsCaster;
        bool allies       = prop.affectsAllyPlayers;
        bool allySummon   = prop.affectsAllySummons;
        bool enemies      = prop.affectsEnemyPlayers;
        bool enemySummon  = prop.affectsAllySummons;

        HealProperty newProp = new HealProperty();

        newProp.scaleFactor          = scaling;
        newProp.healPerLevel         = values;
        newProp.targetCasterOverride = targetCaster;
        newProp.affectsCaster        = affectCaster;
        newProp.affectsAllyPlayers   = allies;
        newProp.affectsAllySummons   = allySummon;
        newProp.affectsEnemyPlayers  = enemies;
        newProp.affectsEnemySummons  = enemySummon;

        ability.critHealEffects.Add(newProp);
    }
Esempio n. 4
0
    void DisplayScaleFactor(eStat stat)
    {
        string statName = "";

        switch (stat)
        {
        case eStat.STR:
            statName = "Strength";
            break;

        case eStat.INT:
            statName = "Intelligence";
            break;

        case eStat.AGI:
            statName = "Agility";
            break;

        case eStat.RES:
            statName = "Resolve";
            break;
        }

        EditorGUILayout.LabelField("Scaling:  " + statName, GUILayout.MaxWidth(120));
    }
    public static Vector2 GetMinMaxDamageValues(Unit source, Unit target, eStat scaleFactor, int min, int max)
    {
        float minDamage = min;
        float maxDamage = max;

        switch (scaleFactor)
        {
        case eStat.STR:
            minDamage = minDamage + (minDamage * (source.stats.strength / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.strength / 100f));
            break;

        case eStat.INT:
            minDamage = minDamage + (minDamage * (source.stats.intelligence / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.intelligence / 100f));
            break;

        case eStat.AGI:
            minDamage = minDamage + (minDamage * (source.stats.agility / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.agility / 100f));
            break;

        case eStat.RES:
            minDamage = minDamage + (minDamage * (source.stats.resolve / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.resolve / 100f));
            break;

        default:
            minDamage = minDamage + (minDamage * (source.stats.strength / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.strength / 100f));
            break;
        }

        return(new Vector2(Mathf.RoundToInt(minDamage), Mathf.RoundToInt(maxDamage)));
    }
 public StatMod(bool constant, int dur, eStat stat, int val, bool resistable)
 {
     applyEachTurn     = constant;
     remainingDuration = dur;
     statToMod         = stat;
     this.val          = val;
     this.resistable   = resistable;
     wasApplied        = false;
 }
Esempio n. 7
0
    private void CopyBuffDebuffProperty(BuffDebuffProperty prop)
    {
        eStat stat = new eStat();

        stat = prop.stat;

        eElement res = new eElement();

        res = prop.resistance;

        MinMaxValue[] values = new MinMaxValue[5];

        int[] durations = new int[5];

        for (int i = 0; i < 5; i++)
        {
            MinMaxValue val = new MinMaxValue(prop.valuePerLevel [i].min, prop.valuePerLevel [i].max);
            values [i] = val;
        }

        for (int i = 0; i < 5; i++)
        {
            int val = prop.durationPerLevel [i];
            durations [i] = val;
        }

        bool isResist   = prop.isResistanceModifier;
        bool resistable = prop.resistable;
        bool isBuff     = prop.isBuff;

        bool targetCaster = prop.targetCasterOverride;
        bool affectCaster = prop.affectsCaster;
        bool allies       = prop.affectsAllyPlayers;
        bool allySummon   = prop.affectsAllySummons;
        bool enemies      = prop.affectsEnemyPlayers;
        bool enemySummon  = prop.affectsAllySummons;

        BuffDebuffProperty newProp = new BuffDebuffProperty();

        newProp.isResistanceModifier = isResist;
        newProp.isBuff     = isBuff;
        newProp.resistable = resistable;

        newProp.resistance           = res;
        newProp.stat                 = stat;
        newProp.valuePerLevel        = values;
        newProp.targetCasterOverride = targetCaster;
        newProp.affectsCaster        = affectCaster;
        newProp.affectsAllyPlayers   = allies;
        newProp.affectsAllySummons   = allySummon;
        newProp.affectsEnemyPlayers  = enemies;
        newProp.affectsEnemySummons  = enemySummon;

        ability.critBuffDebuffEffects.Add(newProp);
    }
Esempio n. 8
0
 public void SetItemEquip(eStat mstat, Shop shop)
 {
     foreach (var i in ALLItemSlot[mstat])
     {
         if ((DB.equipItems[mstat] != -1) && (shop.mslotNumber != DB.equipItems[mstat]))
         {
             i.Equipment(DB.equipItems[mstat], false);
         }
     }
     DB.equipItems[mstat] = shop.mslotNumber;
 }
Esempio n. 9
0
 private void GameOverInit(eStat state, float v)
 {
     Stat.d[state].Event += () =>
     {
         if (Stat.d[state].Value < 0)
         {
             Stat.d[state].Value = 0;
             Debug.Log("GameOver");
         }
     };
     Stat.d[state].Value = v;
 }
Esempio n. 10
0
		/// <summary>
		/// Change a stat value
		/// (delegate to GameNPC)
		/// </summary>
		/// <param name="stat">The stat to change</param>
		/// <param name="val">The new value</param>
		public override void ChangeBaseStat(eStat stat, short val)
		{
			int oldstat = GetBaseStat(stat);
			base.ChangeBaseStat(stat, val);
			int newstat = GetBaseStat(stat);
			GameNPC npc = this;
			if (this != null && oldstat != newstat)
			{
				switch (stat)
				{
						case eStat.STR: npc.Strength = (short)newstat; break;
						case eStat.DEX: npc.Dexterity = (short)newstat; break;
						case eStat.CON: npc.Constitution = (short)newstat; break;
						case eStat.QUI: npc.Quickness = (short)newstat; break;
						case eStat.INT: npc.Intelligence = (short)newstat; break;
						case eStat.PIE: npc.Piety = (short)newstat; break;
						case eStat.EMP: npc.Empathy = (short)newstat; break;
						case eStat.CHR: npc.Charisma = (short)newstat; break;
				}
			}
		}
Esempio n. 11
0
 public override int GetBaseStat(eStat stat) => baseStat;
Esempio n. 12
0
 public override int GetBaseStat(eStat stat)
 {
     return(baseStat);
 }
    public static int CalculateDamage(Unit source, Unit target, int minDmg, int maxDmg, eElement element, eStat scaleFactor)
    {
        int   roll   = Random.Range(minDmg, maxDmg);
        float damage = 0;

        switch (scaleFactor)
        {
        case eStat.STR:
            damage = roll + (roll * (source.stats.strength / 100f));
            break;

        case eStat.INT:
            damage = roll + (roll * (source.stats.intelligence / 100f));
            break;

        case eStat.AGI:
            damage = roll + (roll * (source.stats.agility / 100f));
            break;

        case eStat.RES:
            damage = roll + (roll * (source.stats.resolve / 100f));
            break;

        default:
            damage = roll + (roll * (source.stats.strength / 100f));
            break;
        }

        float resistMultiplier = (float)target.stats.GetResistValue(element) / 100f;

        int finalValue = Mathf.RoundToInt(damage - (damage * resistMultiplier));

        return(finalValue);
    }
    public static int GetAverageDamageValue(Unit source, Unit target, eElement element, eStat scaleFactor, int min, int max)
    {
        float minDamage = min;
        float maxDamage = max;

        switch (scaleFactor)
        {
        case eStat.STR:
            minDamage = minDamage + (minDamage * (source.stats.strength / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.strength / 100f));
            break;

        case eStat.INT:
            minDamage = minDamage + (minDamage * (source.stats.intelligence / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.intelligence / 100f));
            break;

        case eStat.AGI:
            minDamage = minDamage + (minDamage * (source.stats.agility / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.agility / 100f));
            break;

        case eStat.RES:
            minDamage = minDamage + (minDamage * (source.stats.resolve / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.resolve / 100f));
            break;

        default:
            minDamage = minDamage + (minDamage * (source.stats.strength / 100f));
            maxDamage = maxDamage + (maxDamage * (source.stats.strength / 100f));
            break;
        }

        float avg = minDamage + maxDamage / 2;
        float resistMultiplier = (float)target.stats.GetResistValue(element) / 100f;
        int   finalValue       = Mathf.RoundToInt(avg - (avg * resistMultiplier));

        return(finalValue);
    }
Esempio n. 15
0
        public override int CalcValue(GameLiving living, eProperty property)
        {
            if (living is GamePlayer player)
            {
                eStat manaStat = player.CharacterClass.ManaStat;

                if (player.CharacterClass.ManaStat == eStat.UNDEFINED)
                {
                    // Special handling for Vampiirs:

                    /* There is no stat that affects the Vampiir's power pool or the damage done by its power based spells.
                     * The Vampiir is not a focus based class like, say, an Enchanter.
                     * The Vampiir is a lot more cut and dried than the typical casting class.
                     * EDIT, 12/13/04 - I was told today that this answer is not entirely accurate.
                     * While there is no stat that affects the damage dealt (in the way that intelligence or piety affects how much damage a more traditional caster can do),
                     * the Vampiir's power pool capacity is intended to be increased as the Vampiir's strength increases.
                     *
                     * This means that strength ONLY affects a Vampiir's mana pool
                     */
                    if (player.CharacterClass.ID == (int)eCharacterClass.Vampiir)
                    {
                        manaStat = eStat.STR;
                    }
                    else if (player.Champion && player.ChampionLevel > 0)
                    {
                        return(player.CalculateMaxMana(player.Level, 0));
                    }
                    else
                    {
                        return(0);
                    }
                }

                int manaBase     = player.CalculateMaxMana(player.Level, player.GetModified((eProperty)manaStat));
                int itemBonus    = living.ItemBonus[(int)property];
                int poolBonus    = living.ItemBonus[(int)eProperty.PowerPool];
                int abilityBonus = living.AbilityBonus[(int)property];

                int itemCap = player.Level / 2 + 1;
                int poolCap = player.Level / 2;
                itemCap = itemCap + Math.Min(player.ItemBonus[(int)eProperty.PowerPoolCapBonus], itemCap);
                poolCap = poolCap + Math.Min(player.ItemBonus[(int)eProperty.PowerPoolCapBonus], player.Level);

                if (itemBonus > itemCap)
                {
                    itemBonus = itemCap;
                }

                if (poolBonus > poolCap)
                {
                    poolBonus = poolCap;
                }

                // Q: What exactly does the power pool % increase do?Does it increase the amount of power my cleric
                // can generate (like having higher piety)? Or, like the dex cap increase, do I have to put spellcraft points into power to make it worth anything?
                // A: I’m better off quoting Balance Boy directly here: ” Power pool is affected by
                // your acuity stat, +power bonus, the Ethereal Bond Realm ability, and your level.
                // The resulting power pool is adjusted by your power pool % increase bonus.
                return((int)(manaBase + itemBonus + abilityBonus + (manaBase + itemBonus + abilityBonus) * poolBonus * 0.01));
            }

            return(1000000); // default
        }
Esempio n. 16
0
		public static string StatToName(eStat stat)
		{
			switch (stat)
			{
				case eStat.STR:
					return "Strength";
				case eStat.DEX:
					return "Dexterity";
				case eStat.CON:
					return "Constitution";
				case eStat.QUI:
					return "Quickness";
				case eStat.INT:
					return "Intelligence";
				case eStat.PIE:
					return "Piety";
				case eStat.EMP:
					return "Empathy";
				case eStat.CHR:
					return "Charisma";
			}

			return "Unknown";
		}
Esempio n. 17
0
 public Stat(int s, int c, eStat t)
 {
     standard = s;
     current  = c;
     type     = t;
 }