JudgesHurt.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System;
  2. using GameWorld;
  3. using UnityEngine;
  4. public class JudgesHurt : EnemyBaseHurt
  5. {
  6. protected override void Init()
  7. {
  8. this.defaultAnimName = "NoStiff";
  9. this.defaultAirAnimName = "NoStiff";
  10. this.hurtData = SingletonMono<EnemyDataPreload>.Instance.hurt[EnemyType.犹大];
  11. }
  12. protected override void HitIntoWeakState(Vector2 speed, Vector2 airSpeed, string normalAtkType, string airAtkType)
  13. {
  14. normalAtkType = "IdleToWeak";
  15. airAtkType = "IdleToWeak";
  16. base.ChaseEnd();
  17. this.action.EnterWeakState();
  18. this.eAttr.stiffTime = 1f;
  19. R.Audio.PlayEffect(405, new Vector3?(base.transform.position));
  20. base.PlayHurtAnim(normalAtkType, airAtkType, speed, airSpeed);
  21. if (!base.IsInvoking("ExitWeak"))
  22. {
  23. base.Invoke("ExitWeak", 5f);
  24. }
  25. }
  26. protected override void FlashAttackHurt()
  27. {
  28. R.Effect.Generate(156, null, base.transform.position + Vector3.up, default(Vector3), default(Vector3), true);
  29. R.Effect.Generate(214, null, default(Vector3), default(Vector3), default(Vector3), true);
  30. SingletonMono<WorldTime>.Instance.TimeSlowByFrameOn60Fps(30, 0.5f);
  31. R.Camera.Controller.CameraShake(0.5f, 0.2f, CameraController.ShakeTypeEnum.Rect, false);
  32. R.Camera.Controller.OpenMotionBlur(0.0833333358f, 1f, base.transform.position);
  33. R.Audio.PlayEffect(405, new Vector3?(base.transform.position));
  34. this.SetHitSpeed(Vector2.zero);
  35. base.GenerateCritHurtNum(base.flashAttackDamage);
  36. base.FlashAttackHurt();
  37. }
  38. public override void QTEHurt()
  39. {
  40. base.QTEHurt();
  41. R.Audio.PlayEffect(405, new Vector3?(base.transform.position));
  42. R.Player.Action.QTEHPRecover(false);
  43. base.QTEZPositionRecover();
  44. base.QTEHpMinus();
  45. }
  46. protected override void ExecuteDieEffect()
  47. {
  48. }
  49. public override void EnemyDie()
  50. {
  51. }
  52. protected override void ExecuteFollow()
  53. {
  54. }
  55. protected override void ExecuteDie()
  56. {
  57. if (this.deadFlag)
  58. {
  59. return;
  60. }
  61. R.Trophy.AwardTrophy(33);
  62. R.Audio.PlayEffect(412, new Vector3?(base.transform.position));
  63. R.Player.Action.QTEHPRecover(this.eAttr.rankType == EnemyAttribute.RankType.BOSS);
  64. R.Audio.PlayEffect(UnityEngine.Random.Range(105, 108), new Vector3?(base.transform.position));
  65. R.Audio.PlayEffect(404, new Vector3?(base.transform.position));
  66. this.deadFlag = true;
  67. this.eAttr.currentHp = 0;
  68. this.eAttr.inWeakState = false;
  69. this.eAttr.isFlyingUp = false;
  70. this.eAttr.checkHitGround = false;
  71. this.eAttr.stiffTime = 0f;
  72. this.eAttr.timeController.SetGravity(1f);
  73. EventManager.PostEvent<EnemyAttribute>("EnemyKilled", this.eAttr);
  74. this.action.WeakEffectDisappear("Null");
  75. R.Effect.Generate(91, null, base.transform.position + new Vector3(0f, 3f, LayerManager.ZNum.Fx), Vector3.zero, default(Vector3), true);
  76. R.Effect.Generate(49, null, base.transform.position + new Vector3(0f, 3f, LayerManager.ZNum.Fx), default(Vector3), default(Vector3), true);
  77. R.Effect.Generate(14, null, base.transform.position + new Vector3(0f, 3f, LayerManager.ZNum.Fx), default(Vector3), default(Vector3), true);
  78. base.AddCoinAndExp();
  79. R.Effect.Generate(213, null, default(Vector3), default(Vector3), default(Vector3), true);
  80. R.Effect.Generate(214, null, default(Vector3), default(Vector3), default(Vector3), true);
  81. SingletonMono<WorldTime>.Instance.TimeSlowByFrameOn60Fps(45, 0.2f);
  82. R.Camera.Controller.CameraShake(0.9166667f, 0.3f, CameraController.ShakeTypeEnum.Rect, false);
  83. this.action.hurtBox.gameObject.SetActive(false);
  84. this.eAttr.inWeakState = false;
  85. for (int i = 0; i < R.Enemy.EnemyAttributes.Count; i++)
  86. {
  87. R.Enemy.EnemyAttributes[i].GetComponent<EnemyBaseAction>().KillSelf();
  88. }
  89. }
  90. }