Exemple #1
0
    public static int CalculateElementDamageOTToMonster(Damage_OT dot, Monster y)
    {
        int d = 0;

        Damage_OT.Damage_OTType otype = dot.GetDamage_OTType();
        Damage_OT.Damage_OTType poi   = Damage_OT.Damage_OTType.Poison;

        //Damage_OT.Damage_OTType ble = Damage_OT.Damage_OTType.Bleeding;
        Damage_OT.Damage_OTType fir = Damage_OT.Damage_OTType.Fire;

        Damage.DamageType m = y.mobElement;

        if (otype == poi && m == Damage.DamageType.Poison)
        {
            d = (int)((dot.GetDamage_OTAmount() / 2f)) * -1;
        }
        else if (otype == fir && m == Damage.DamageType.Fire)
        {
            d = (int)((dot.GetDamage_OTAmount() / 2f)) * -1;
        }
        else
        {
            d = dot.GetDamage_OTAmount();
        }
        return(d);
    }
Exemple #2
0
    public void FinalizeStats()
    {
        energyPoints = 15 + (int)(playerLevel * (1.35f + (playerLevel / 5f)));
        minDamage_P  = 1 + (int)(minDamage_P * (1 + (damageP / 100f)) + bonusDamage + (strength / 2f));
        maxDamage_P  = 3 + (int)(maxDamage_P * (1 + (damageP / 100f)) + bonusDamage + (strength / 2f));
        healthPoints = 25 + (int)((healthPoints) * (1 + (healthPointsP / 100f)));
        spellPoints  = 15 + (int)((spellPoints) * (1 + (spellPointsP / 100f)));
        energyPoints = 5 + (int)((energyPoints) * (1 + (energyPointsP / 100f)));
        magicFindP   = (int)((mluck * 0.7f) + ((playerLevel / 2f) * (mluck / 5f)));
        moneyFindP   = (int)((mluck * 1.1f) + ((playerLevel / 2f) * (mluck / 5f)));

        critChance = 5 + (int)(perception / (playerLevel * 1.3f) + 5);
        critDamage = (int)(ferocity / (playerLevel * 1.3f) + 50);

        if (magicFindP >= 9950)
        {
            magicFindP = 9950;
        }

        Lucky = magicFindP;

        if (Lucky >= 9950)
        {
            Lucky = 9950;
        }
        Debug.Log("LootRoll is : (" + (Lucky * 10).ToString() + ",100000) ");
        if (speed < 1)
        {
            speed = 1;
        }
        GetComponent <Player_Movement>().speed = (speed * 1.0f);

        // set weapon element
        var p_Main = GetComponent <Player_Main>();

        if (p_Main.pE.equipSlots[5].item != null)
        {
            primaryDamage   = p_Main.pE.equipSlots[5].item.d_Type;
            primaryOTDamage = p_Main.pE.equipSlots[5].item.do_Type;
        }
        else
        {
            primaryDamage   = Damage.DamageType.Normal;
            primaryOTDamage = Damage_OT.Damage_OTType.Normal;
        }
        UpdateUI();
    }
Exemple #3
0
    public Resistance GetResistanceForType(Damage_OT.Damage_OTType _type)
    {
        int x = 0;

        if (_type == Damage_OT.Damage_OTType.Bleeding)
        {
            x = bleedResistance;
        }
        else if (_type == Damage_OT.Damage_OTType.Fire)
        {
            x = fireResistance;
        }
        else if (_type == Damage_OT.Damage_OTType.Poison)
        {
            x = poisonResistance;
        }

        return(new Resistance(x, _type));
    }
Exemple #4
0
 public Color32 SetDamageOTColor(Damage_OT.Damage_OTType dt)
 {
     if (dt == Damage_OT.Damage_OTType.Bleeding)
     {
         return(Blood);
     }
     else if (dt == Damage_OT.Damage_OTType.Fire)
     {
         return(Fire);
     }
     else if (dt == Damage_OT.Damage_OTType.Poison)
     {
         return(Poison);
     }
     else
     {
         return(Normal);
     }
 }
Exemple #5
0
    // Checks to see which enchant is the most powerful
    public void SetPrimaryWeaponEnchantAttributes()
    {
        Enchant primary = null;

        if (enchants != null)
        {
            foreach (Enchant e in enchants)
            {
                if (e.type == Enchant.EnchantTypes.Damage_T1 || e.type == Enchant.EnchantTypes.Damage_T2 || e.type == Enchant.EnchantTypes.Damage_T3)
                {
                    if (primary != null)
                    {
                        if (e.power > primary.power)
                        {
                            primary = e;
                            if (primary != null)
                            {
                                d_Type = primary.e_dType;
                                if (do_Type == Damage_OT.Damage_OTType.Normal && e.e_doType != Damage_OT.Damage_OTType.Normal)
                                {
                                    do_Type = primary.e_doType;
                                }
                            }
                        }
                    }
                    else
                    {
                        primary = e;
                        if (primary != null)
                        {
                            d_Type = primary.e_dType;
                            if (do_Type == Damage_OT.Damage_OTType.Normal && e.e_doType != Damage_OT.Damage_OTType.Normal)
                            {
                                do_Type = primary.e_doType;
                            }
                        }
                    }
                }
            }
        }
    }
Exemple #6
0
 public void SetResistanceType(Damage_OT.Damage_OTType t)
 {
     oType = t;
 }
Exemple #7
0
 public Resistance(int _amount, Damage_OT.Damage_OTType _type)
 {
     SetResistanceType(_type);
     SetResistanceAmount(_amount);
 }