Beispiel #1
0
        public static BaseStat[] GetBasicCommandStats(StatsContainer stats)
        {
            var owner = stats.GetEntity();

            BaseStat[] newStats = new BaseStat[3];
            newStats[0] = new BaseStat(owner, Stats.Power, 0);
            newStats[1] = new BaseStat(owner, Stats.CriticalHit, 0);
            newStats[2] = new BaseStat(owner, Stats.CriticalMulti, GameOptions.Get(RpgSettings.DefaultCritMulti, 1f));
            return(newStats);
        }
Beispiel #2
0
        public static void SetupVitalStats(StatsContainer stats)
        {
            var owner = stats.GetEntity();

            for (int i = 0; i < GameData.Vitals.Count; i++)
            {
                var vital = new VitalStat(owner, GameData.Vitals.Names[i], GameData.Vitals.GetID(i), GameData.Vitals.GetAssociatedValue(i), GameData.Vitals.GetValue <float>(i, "Recovery"));
                stats.Add(vital);
            }
        }
        public static void SetupVitalStats(StatsContainer stats)
        {
            var owner = stats.GetEntity();

            for (int i = 0; i < Vitals.Count; i++)
            {
                var vital = new VitalStat(owner, Vitals.GetNameAt(i), Vitals.GetID(i), Vitals.GetStartingValue(i), Vitals.GetRecoveryValue(i));
                stats.Add(vital);
            }
            stats.SetMax();
        }
Beispiel #4
0
        public static void SetupDefenseStats(StatsContainer stats)
        {
            var owner  = stats.GetEntity();
            var defend = owner.Add(new DefendDamageWithStats());

            for (int i = 0; i < GameData.DamageTypes.Count; i++)
            {
                var typeDef = new BaseStat(owner, string.Format("{0} Defense", GameData.DamageTypes.GetNameAt(i)), GameData.DamageTypes.GetID(i), 0);
                stats.Add(typeDef);
                defend.AddStat(GameData.DamageTypes.GetID(i), typeDef.ID, typeDef);
            }
            stats.Add(new BaseStat(owner, Stats.Evasion, 0));
        }
        public static void SetupBasicCharacterStats(StatsContainer stats)
        {
            var owner = stats.GetEntity();

            for (int i = 0; i < Attributes.Count; i++)
            {
                stats.Add(new BaseStat(owner, Attributes.GetNameAt(i), Attributes.GetID(i), Attributes.GetAssociatedValue(i)));
            }
            for (int i = 0; i < Skills.Count; i++)
            {
                stats.Add(new BaseStat(owner, Skills.GetNameAt(i), Skills.GetID(i), 0));
            }
        }
Beispiel #6
0
        public static float CalculateImpactTotal(StatsContainer stats, string statName, float percent)
        {
            var range = stats.Get <RangeStat>(statName);

            if (range != null)
            {
                return(CalculateTotal(range, percent));
            }
            var stat = stats.Get <BaseStat>(statName);

            if (stat != null)
            {
                return(CalculateTotal(stat, percent));
            }
            return(0);
        }
Beispiel #7
0
        public static void SetupBasicCharacterStats(StatsContainer stats)
        {
            var owner = stats.GetEntity();

            for (int i = 0; i < GameData.Attributes.Count; i++)
            {
                stats.Add(new BaseStat(owner, GameData.Attributes.Names[i], GameData.Attributes.GetID(i), GameData.Attributes.GetAssociatedValue(i)));
            }
            var atkStats = GameData.Enums[Stats.AttackStats];

            if (atkStats != null)
            {
                for (int i = 0; i < atkStats.Length; i++)
                {
                    stats.Add(new BaseStat(owner, atkStats.Names[i], atkStats.IDs[i], 0));
                }
            }
        }
Beispiel #8
0
        public static void GetCharacterStatValues(this StatsContainer statsContainer, ref StringBuilder sb)
        {
            for (int i = 0; i < GameData.Attributes.Count; i++)
            {
                sb.AppendNewLine(statsContainer.Get(GameData.Attributes.GetID(i)).ToString());
            }
            var atkStats = GameData.Enums[Stats.AttackStats];

            if (atkStats != null)
            {
                for (int i = 0; i < atkStats.Length; i++)
                {
                    sb.AppendNewLine(statsContainer.Get(atkStats.IDs[i]).ToString());
                }
            }
            for (int i = 0; i < GameData.DamageTypes.Count; i++)
            {
                sb.AppendNewLine(statsContainer.Get(GameData.DamageTypes.GetID(i)).ToString());
            }
        }
Beispiel #9
0
 private Entity()
 {
     Tags      = new TagsComponent(this);
     Stats     = new StatsContainer(this);
     _eventHub = new EntityEventHub();
 }