public static uint HP(UnitTraits traits, uint level, bool doubleStat)
        {
            uint calculatedHp;

            if (traits.IsEvolved)
            {
                calculatedHp = traits.BaseHp;
                for (uint n = 1; n < level; ++n)
                {
                    calculatedHp = calculatedHp +
                                   (uint)(
                        Math.Floor(traits.HpGrowth * n / 16.0f) -
                        Math.Floor(traits.HpGrowth * (n - 1) / 16.0f) +
                        Math.Floor(2896 * traits.HpGrowth * Math.Sqrt(traits.HpGrowth * n) / 32768.0f) -
                        Math.Floor(2896 * traits.HpGrowth * Math.Sqrt(traits.HpGrowth * (n - 1)) / 32768.0f)
                        );
                }
            }
            else
            {
                calculatedHp = traits.BaseHp +
                               (uint)Math.Floor(traits.HpGrowth * (level - 1) / 16.0f) +
                               (uint)Math.Floor(2896 * traits.HpGrowth * Math.Sqrt(traits.HpGrowth * (level - 1)) / 32768);
            }
            return(CappedStat(calculatedHp, doubleStat));
        }
예제 #2
0
 public Monster(UnitTraits traits, uint level, uint hp, uint mp) : base(traits, level)
 {
     this.HP    = hp;
     this.MP    = mp;
     this.Spell = new Spell(traits.NativeSpell, level);
     this.Genus = traits.NativeGenus;
 }
예제 #3
0
        public UnitTraits WithTalents(Talents newTalents)
        {
            UnitTraits newUnitTraits = new UnitTraits();

            newUnitTraits.BaseHp         = this.BaseHp;
            newUnitTraits.HpGrowth       = this.HpGrowth;
            newUnitTraits.BaseMp         = this.BaseMp;
            newUnitTraits.MpGrowth       = this.MpGrowth;
            newUnitTraits.BaseAttack     = this.BaseAttack;
            newUnitTraits.AttackGrowth   = this.AttackGrowth;
            newUnitTraits.BaseDefense    = this.BaseDefense;
            newUnitTraits.DefenseGrowth  = this.DefenseGrowth;
            newUnitTraits.BaseAgility    = this.BaseAgility;
            newUnitTraits.AgilityGrowth  = this.AgilityGrowth;
            newUnitTraits.BaseLuck       = this.BaseLuck;
            newUnitTraits.LuckGrowth     = this.LuckGrowth;
            newUnitTraits.BaseExpGiven   = this.BaseExpGiven;
            newUnitTraits.ExpGivenGrowth = this.ExpGivenGrowth;
            newUnitTraits.NativeGenus    = this.NativeGenus;
            newUnitTraits.NativeSpell    = this.NativeSpell;
            newUnitTraits.Talents        = newTalents;
            newUnitTraits.IsEvolved      = this.IsEvolved;
            newUnitTraits.Liftable       = this.Liftable;
            newUnitTraits.Pushable       = this.Pushable;
            newUnitTraits.Portrait       = this.Portrait;
            return(newUnitTraits);
        }
예제 #4
0
 private void CreateFamiliar(UnitTraits traits)
 {
     familiar = new Familiar(traits);
     SetFamiliarFrogStatus();
     SetFamiliarLevel(initialize: true);
     CalculateFamiliarStats();
 }
        private static uint CalculateStat(ref UnitTraits traits, uint level, uint baseStat, uint statGrowth, uint statDivisor, bool doubleStat)
        {
            uint stat = traits.IsEvolved ?
                        CalculateEvolvedStat(level, baseStat, statGrowth, statDivisor) :
                        CalculateNonEvolvedStat(level, baseStat, statGrowth, statDivisor);

            return(CappedStat(stat, doubleStat));
        }
예제 #6
0
 public Unit(UnitTraits traits, uint level = 1)
 {
     this.Traits  = traits;
     this.Talents = new Talents();
     this.Level   = level;
     this.Stats   = new UnitStatistics(traits.NativeGenus);
     this.Weapon  = Weapon.NO_WEAPON;
     this.Shield  = Shield.NO_SHIELD;
     this.IsFrog  = false;
 }
 public static uint MP(UnitTraits traits, uint level)
 {
     return(CalculateStat(ref traits, level, traits.BaseMp, traits.MpGrowth, MP_LUCK_DIVISOR, false));
 }
 public static uint Defense(UnitTraits traits, uint level, bool doubleStat)
 {
     return(CalculateStat(ref traits, level, traits.BaseDefense, traits.DefenseGrowth, ATK_DEF_DIVISOR, doubleStat));
 }
 public static uint Attack(UnitTraits traits, uint level, bool doubleStat)
 {
     return(CalculateStat(ref traits, level, traits.BaseAttack, traits.AttackGrowth, ATK_DEF_DIVISOR, doubleStat));
 }
예제 #10
0
 public Familiar(UnitTraits traits) : base(traits, level: 1, hp: 0, mp: 0)
 {
     this.Spell2 = Spell.NO_SPELL.Copy();
     this.Genus  = traits.NativeGenus;
 }