コード例 #1
0
ファイル: ProjectileAttack.cs プロジェクト: w1r2p1/unitrpg
        public override SkillForecast ComputeForecast(ICombatant attacker, ICombatant defender)
        {
            var hitChance = new HitChance(attacker, defender);

            var critChance   = new CritChance(attacker, defender);
            var glanceChance = new GlanceChance(attacker, defender);

            var chances = new SkillChances {
                CritChance   = critChance.Value,
                HitChance    = hitChance.Value,
                GlanceChance = glanceChance.Value
            };

            var attackCount = new AttackCount(attacker, defender);

            var hit = new SkillHit {
                BaseDamage = DamageUtils.ComputeMeleeDamage(attacker, defender),
                HitCount   = attackCount.Value
            };

            return(new SkillForecast {
                Type = Type,
                Hit = hit,
                Chances = chances,
                Attacker = attacker,
                Defender = defender
            });
        }
コード例 #2
0
ファイル: Knockback.cs プロジェクト: w1r2p1/unitrpg
        public override SkillForecast ComputeForecast(ICombatant attacker, ICombatant defender)
        {
            var result = base.ComputeForecast(attacker, defender);

            // Knockback only gets one hit, always
            var hit = new SkillHit {
                BaseDamage = DamageUtils.ComputeMeleeDamage(attacker, defender),
                HitCount   = 1
            };

            result.Hit = hit;

            return(result);
        }
コード例 #3
0
        public override SkillForecast ComputeForecast(ICombatant attacker, ICombatant defender)
        {
            var attackCount = 1;
            var chances     = new SkillChances {
                CritChance   = 100,
                HitChance    = 100,
                GlanceChance = 0
            };

            var myKinesis = attacker.GetAttribute(Attribute.AttributeType.Special).Value;
            var hit       = new SkillHit {
                BaseDamage = myKinesis,
                HitCount   = attackCount
            };

            return(new SkillForecast {
                Type = Type,
                Hit = hit,
                Chances = chances,
                Attacker = attacker,
                Defender = defender
            });
        }