Пример #1
0
        /// <summary>
        /// 通常攻撃で<paramref name="target"/>にダメージを与える
        /// </summary>
        public DamageResult GiveDamage(BattleCharacter target)
        {
            var damageResult = BattleCalcurator.GetDamage(this, target, CurrentSpec.AttackAttribute, 1.0f, true);

            target.TakeDamage(this, damageResult.damage);

            return(damageResult);
        }
Пример #2
0
        public IObservable <Unit> OnGiveDamage(BattleSystem battleSystem, BattleCharacter attacker, BattleCharacter target)
        {
            return(Observable.Defer(() =>
            {
                var damageResult = BattleCalcurator.GetDamage(attacker, target, attackAttribute, BattleCalcurator.GetBarrageDamageRate(Level), false);
                target.TakeDamageRaw(damageResult.damage);
                battleSystem.AddLog(ScriptLocalization.UI.Sentence_Attack.Format(attacker.CurrentSpec.Name, target.CurrentSpec.Name, damageResult.damage));

                return Observable.Timer(TimeSpan.FromSeconds(1.0f)).AsUnitObservable();
            }));
        }