private void PhaseControll(AttackDamageBox attack_damage_box) { var attack_type = attack_damage_box.attackType; switch (PhaseManager.Instance.NowPhase) { case Phase.P3D: stackHealth = 0; if (attack_type == AttackType.Strong || attack_type == AttackType.Grab) { DebugLogger.Log("to 2D phase by" + attack_damage_box.attackType); PhaseManager.Instance.NowPhase = Phase.P2D; } break; case Phase.P2D: stackHealth += attack_damage_box.damage; if (stackHealth >= stackableHealth && attack_type != AttackType.Weak) { stackHealth = 0; PhaseManager.Instance.NowPhase = Phase.P3D; } break; default: throw new ArgumentOutOfRangeException(); } }
public void DamageRecieve(AttackDamageBox attack_damage_box) { health -= attack_damage_box.damage; gaugeControll.TempUpdate(health / maxHealth); gaugeControll.EntityUpdate(); if (health <= 0) { deadStream.OnNext(Unit.Default); return; } PhaseControll(attack_damage_box); }
public void Hit(AttackDamageBox attack_damage_box) { if (IsDown) { return; } foreach (var item in playerCancelProcesses) { item.Cancel(); } if (guardControll.InGuard) { if (attack_damage_box.attackType == AttackType.Weak || attack_damage_box.attackType == AttackType.Shot) { soundEffectControl.Play(ESoundType.WeakGuard); return; //ガード成功 } else if (attack_damage_box.attackType == AttackType.Strong || attack_damage_box.attackType == AttackType.Finish) { attack_damage_box.damage *= reductionRate; //削り soundEffectControl.Play(ESoundType.StrongGuard); attack_damage_box.attackType = AttackType.Weak; //ガードでフェイズが変わらないように damageStream.OnNext(attack_damage_box); return; } } //自分から見てどれくらい吹っ飛ぶか var po = -transform.forward * attack_damage_box.knockbackPower.z + transform.right * attack_damage_box.knockbackPower.x + transform.up * attack_damage_box.knockbackPower.y; rigid.AddForce(new Vector3(po.x, po.y, po.z), ForceMode.VelocityChange); damageStream.OnNext(attack_damage_box); //ダメージを受けた通知をするだけで計算はHealthManager任せ if (attack_damage_box.knockbackPower.magnitude > blowPowerBorder) { motionAnimControll.ForceChangeAnim(motionAnimControll.MyDic.BigDamage); soundEffectControl.Play(ESoundType.StrongHit); InDamage = true; IsDown = true; } else { motionAnimControll.ForceChangeAnim(motionAnimControll.MyDic.SmallDamage); soundEffectControl.Play(ESoundType.WeakHit); InDamage = true; } }