StoryE23P9.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System;
  2. using System.Collections;
  3. using GameWorld;
  4. using UnityEngine;
  5. public class StoryE23P9 : BaseBehaviour
  6. {
  7. private void Start()
  8. {
  9. base.StartCoroutine(this.P4Coroutine());
  10. }
  11. private IEnumerator P4Coroutine()
  12. {
  13. this._l.Appear();
  14. this._r.Appear();
  15. this.airBot = R.Enemy.Generate(EnemyType.妖姬, new Vector2?(this.airBotPos.position), false, true);
  16. this.dao = R.Enemy.Generate(EnemyType.斩轮式一型, new Vector2?(this.daoPos.position), false, true);
  17. this.pao = R.Enemy.Generate(EnemyType.炮击式一型, new Vector2?(this.paoPos.position), false, true);
  18. this.daoAttribute = this.dao.GetComponent<EnemyAttribute>();
  19. this.paoAttribute = this.pao.GetComponent<EnemyAttribute>();
  20. this.airBotAttribute = this.airBot.GetComponent<EnemyAttribute>();
  21. this.dao.GetComponent<DaoAction>().ChangeFace(1);
  22. base.StartCoroutine(this.DaoMoe());
  23. base.StartCoroutine(this.PaoMoe());
  24. base.StartCoroutine(this.AirBotLookAround());
  25. this.daoAttribute.currentHp = 1;
  26. this.paoAttribute.currentHp = 1;
  27. this.airBotAttribute.currentHp = 1;
  28. while (this.dao != null || this.pao != null || this.airBot != null)
  29. {
  30. yield return null;
  31. }
  32. R.Mode.ExitMode(Mode.AllMode.Battle);
  33. EventManager.PostEvent<StoryE23P9, BattleEventArgs>("Battle", this, BattleEventArgs.End);
  34. this._l.DisAppear();
  35. this._r.DisAppear();
  36. yield break;
  37. }
  38. private IEnumerator DaoMoe()
  39. {
  40. while (this.dao != null && !this.daoAttribute.isDead)
  41. {
  42. int random = UnityEngine.Random.Range(0, 3);
  43. if (random != 0)
  44. {
  45. if (random == 1)
  46. {
  47. this.dao.GetComponent<DaoAction>().Idle3();
  48. }
  49. }
  50. else
  51. {
  52. this.dao.GetComponent<DaoAction>().Idle2();
  53. }
  54. yield return new WaitForSeconds(UnityEngine.Random.Range(3f, 4f));
  55. }
  56. yield break;
  57. }
  58. private IEnumerator PaoMoe()
  59. {
  60. while (this.pao != null && !this.paoAttribute.isDead)
  61. {
  62. int random = UnityEngine.Random.Range(0, 3);
  63. if (random != 0)
  64. {
  65. if (random == 1)
  66. {
  67. this.pao.GetComponent<DaoAction>().Idle3();
  68. }
  69. }
  70. else
  71. {
  72. this.pao.GetComponent<DaoAction>().Idle2();
  73. }
  74. yield return new WaitForSeconds(UnityEngine.Random.Range(3f, 4f));
  75. }
  76. yield break;
  77. }
  78. private IEnumerator AirBotLookAround()
  79. {
  80. while (this.airBot != null && !this.airBotAttribute.isDead)
  81. {
  82. int random = UnityEngine.Random.Range(0, 2);
  83. if (random != 0)
  84. {
  85. if (random == 1)
  86. {
  87. this.airBot.GetComponent<AirRobotAction>().TurnRound(1);
  88. }
  89. }
  90. else
  91. {
  92. this.airBot.GetComponent<AirRobotAction>().TurnRound(-1);
  93. }
  94. yield return new WaitForSeconds(UnityEngine.Random.Range(3f, 4f));
  95. }
  96. yield break;
  97. }
  98. private GameObject airBot;
  99. private EnemyAttribute airBotAttribute;
  100. [SerializeField]
  101. private Transform airBotPos;
  102. private GameObject dao;
  103. private EnemyAttribute daoAttribute;
  104. [SerializeField]
  105. private Transform daoPos;
  106. private GameObject pao;
  107. private EnemyAttribute paoAttribute;
  108. [SerializeField]
  109. private Transform paoPos;
  110. [SerializeField]
  111. private BattleZoneGate _l;
  112. [SerializeField]
  113. private BattleZoneGate _r;
  114. }