/// <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); }
public IObservable <Unit> OnTakeDamage(BattleSystem battleSystem, BattleCharacter attacker, BattleCharacter target) { return(Observable.Defer(() => { target.AddStatus(statusType, BattleCalcurator.GetStatusUpTakeDamageAddValue(statusType, Level)); return Observable.ReturnUnit(); })); }
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(); })); }
public IObservable <Unit> OnGiveDamage(BattleSystem battleSystem, BattleCharacter attacker, BattleCharacter target) { return(Observable.Defer(() => { var battleCharacter = BattleUtility.GetBattleCharacter(attacker, target, targetType); var rate = BattleCalcurator.GetAbnormalStateAddRate(abnormalStateType, Level); if (battleCharacter.AbnormalStateController.Lottery(abnormalStateType, rate) && battleCharacter.AbnormalStateController.Add(abnormalStateType)) { battleSystem.AddLog(ScriptLocalization.UI.Sentence_AddedAbnormalState.Format(battleCharacter.CurrentSpec.Name, abnormalStateType)); return Observable.Timer(TimeSpan.FromSeconds(1.0f)).AsUnitObservable(); } else { return Observable.ReturnUnit(); } })); }
public IObservable <Unit> OnStartBattle(BattleCharacter owner) { return(Observable.Defer(() => { owner.CurrentSpec.Status.abnormalStateResistance.Set(abnormalStateType, BattleCalcurator.GetAbnormalStateResistanceFromSkill(Level)); return Observable.ReturnUnit(); })); }
public float GetReductionRate(AttackAttribute attackattackerSideAttackAttribute) { return(BattleCalcurator.GetAttackAttributeReductionRate(attackattackerSideAttackAttribute, attackAttribute, Level)); }
public int GetAddValue() { return(BattleCalcurator.GetStatusUpAddValue(statusType, Level)); }
/// <summary> /// スキルからステータスを加算する /// </summary> public void Add(List <ISkill> skills, CharacterStatus baseStatus) { foreach (var s in skills.OfType <IStatusUp>()) { Get(s.StatusType).Value += s.GetAddValue(); } var fightingLevel = skills.GetSkillLevel(SkillType.Fighting); if (fightingLevel > 0) { Add(StatusType.HitPoint, -Get(StatusType.HitPoint).Value / 2); Add(StatusType.Attack, Mathf.FloorToInt(baseStatus.Get(StatusType.Attack).Value *BattleCalcurator.GetFightingAddRate(fightingLevel))); } var samuraiTechniqueLevel = skills.GetSkillLevel(SkillType.SamuraiTechnique); if (samuraiTechniqueLevel > 0) { Add(StatusType.Defense, -Get(StatusType.Defense).Value / 2); Add(StatusType.Attack, Mathf.FloorToInt(baseStatus.Get(StatusType.Attack).Value *BattleCalcurator.GetSamuraiTechniqueAddRate(samuraiTechniqueLevel))); } var shinobiTechniqueLevel = skills.GetSkillLevel(SkillType.SamuraiTechnique); if (shinobiTechniqueLevel > 0) { Add(StatusType.Defense, -Get(StatusType.Defense).Value / 2); Add(StatusType.Evasion, Mathf.FloorToInt(baseStatus.Get(StatusType.Evasion).Value *BattleCalcurator.GetShinobiTechniqueAddRate(shinobiTechniqueLevel))); } var motionLessLevel = skills.GetSkillLevel(SkillType.Motionless); if (motionLessLevel > 0) { Add(StatusType.Evasion, -Get(StatusType.Evasion).Value); Add(StatusType.Attack, Mathf.FloorToInt(baseStatus.Get(StatusType.Attack).Value *BattleCalcurator.GetMotionLessAddRate(motionLessLevel))); } }
public void OnRemovedAbnormalState(AbnormalStateType abnormalStateType, BattleCharacter owner) { var value = BattleCalcurator.GetStatusUpOnDebuffAddValue(owner, statusType, Level); owner.CurrentSpec.Status.Add(statusType, -value); }
public bool IsDisable(AttackAttribute attackerSideAttackAttribute) { return(BattleCalcurator.IsAttackAttributeDisable(attackerSideAttackAttribute, attackAttribute, Level)); }