コード例 #1
0
ファイル: bodypart.cs プロジェクト: thantos/ProteusCreature
        public bodypart(ClassTypes ty, PartTypes pt, string name = " ",double str = 0, double def = 0, double intel = 0, double agil = 0, double end = 0)
        {
            Name = name;
            Abilities = new List<ability>();

            Class = ty;
            Part = pt;
            ClassPart = (ClassPartTypes)Enum.Parse(typeof(ClassPartTypes),Class.ToString() + Part.ToString());
            if (str + agil + def + intel + end != 0)
            {
                ability tempAbility = new ability("Base", new List<effect>()
                    {
                    new effect(Stats.statsType.STRENGTH, str, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.AGILITY, agil, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.INTELLIGENCE, intel, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.ENDURANCE, end, -1, false, true, " ", this.ClassPart),
                    new effect(Stats.statsType.DEFENCE, def, -1, false, true, " ",this.ClassPart)
                    }, true, true, new mastery(), new Stats());
                this.AddAbility(tempAbility);
            }
        }
コード例 #2
0
ファイル: bodypart.cs プロジェクト: thantos/ProteusCreature
 public void AddAbility(ability ab)
 {
     if(ab.Passive)
         foreach (effect e in ab.Effects)
             e.EffectPart = this.ClassPart;
     Abilities.Add(ab);
 }
コード例 #3
0
ファイル: creature.cs プロジェクト: thantos/ProteusCreature
 private void AddAbility(ability a)
 {
     if (a.Passive)
         foreach (effect e in a.Effects)
             this.AddEffect(e);
     this.Abilities.Add(a);
 }
コード例 #4
0
ファイル: creature.cs プロジェクト: thantos/ProteusCreature
 private void RemoveAbility(ability a)
 {
     if (a.Passive)
         foreach (effect e in a.Effects)
             e.Timeout = 0;
     this.Abilities.Remove(a);
 }
コード例 #5
0
ファイル: creature.cs プロジェクト: thantos/ProteusCreature
 public void useAbilityOn(creature target, ability a)
 {
     foreach (effect e in a.Effects)
     {
         if (e.EffectedType == Stats.statsType.DAMAGE)
             this.GiveDamage(target, e);
         else
             target.AddEffect(e);
     }
 }