コード例 #1
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);
        }
コード例 #2
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;
 }
コード例 #3
0
        private void familiarTalentsListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            Talents newTalents = new Talents();

            foreach (object talentName in familiarTalentsListBox.SelectedItems)
            {
                Talent talent = FamiliarTalents[talentName.ToString()];
                newTalents.Add(talent);
            }
            bool hadMagicAttackIncreasedTalent = familiar.Talents.Has(Talents.MagicAttackIncreased);

            familiar.Talents = newTalents;
            CalculateFamiliarStats();
            if (hadMagicAttackIncreasedTalent != newTalents.Has(Talents.MagicAttackIncreased))
            {
                FamiliarMagicAttackIncreasedTalentChanged();
            }
        }