PlayerSkillAbility.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using System;
  2. using ExtensionMethods;
  3. using I2.Loc;
  4. public class PlayerSkillAbility : CharacterState
  5. {
  6. public void ShadeAtk()
  7. {
  8. if (R.Player.Enhancement.ShadeAttack == 0)
  9. {
  10. return;
  11. }
  12. if (this.stateMachine.currentState.IsInArray(this._shadeAtkSta))
  13. {
  14. if (this.pAttr.currentHP > this.pAttr.maxHP / 10)
  15. {
  16. this.pAttr.currentHP -= this.pAttr.maxHP / 10;
  17. this.weapon.HandleShadeAttack();
  18. }
  19. else
  20. {
  21. R.Ui.Toast.Show(ScriptLocalization.ui.energyMatrixNotEnough, 2f, true);
  22. }
  23. }
  24. }
  25. public void BladeStorm()
  26. {
  27. if (R.Player.Enhancement.BladeStorm == 0)
  28. {
  29. return;
  30. }
  31. if (!this.pAttr.isOnGround)
  32. {
  33. return;
  34. }
  35. if (this.stateMachine.currentState.IsInArray(this._bladeStormSta))
  36. {
  37. if (this.pAttr.currentHP > this.pAttr.maxHP / 10)
  38. {
  39. this.pAttr.currentHP -= this.pAttr.maxHP / 10;
  40. this.weapon.HandleBladeStorm();
  41. }
  42. else
  43. {
  44. R.Ui.Toast.Show(ScriptLocalization.ui.energyMatrixNotEnough, 2f, true);
  45. }
  46. }
  47. }
  48. private readonly string[] _shadeAtkSta = new string[]
  49. {
  50. "EndAtk",
  51. "GetUp",
  52. "Idle",
  53. "Ready",
  54. "Run",
  55. "RunSlow",
  56. "Atk1",
  57. "Atk2",
  58. "Atk3",
  59. "Atk4",
  60. "Atk5",
  61. "Atk6",
  62. "Atk7",
  63. "Atk8",
  64. "Atk11",
  65. "Atk12",
  66. "Atk13",
  67. "Atk14",
  68. "Atk23",
  69. "Atk15",
  70. "AtkHv1",
  71. "AtkHv2",
  72. "AtkHv3",
  73. "Atk16",
  74. "AtkHv1Push",
  75. "AtkRollReady",
  76. "AtkRollEnd",
  77. "AirAtk1",
  78. "AirAtk2",
  79. "AirAtk3",
  80. "AirAtk4",
  81. "AirAtk6",
  82. "AirAtkHv1",
  83. "AirAtkHv2",
  84. "AirAtkHv3",
  85. "AirAtkHv4",
  86. "AirAtkHv5",
  87. "AirAtkHv1Push",
  88. "AirAtkRollReady",
  89. "AirAtkRoll",
  90. "Fall1",
  91. "Fall2",
  92. "Flash2",
  93. "FlashDown2",
  94. "FlashUp2",
  95. "Jump",
  96. "Jump2",
  97. "RollJump"
  98. };
  99. private readonly string[] _bladeStormSta = new string[]
  100. {
  101. "EndAtk",
  102. "GetUp",
  103. "Idle",
  104. "Ready",
  105. "Run",
  106. "RunSlow",
  107. "Atk1",
  108. "Atk2",
  109. "Atk3",
  110. "Atk4",
  111. "Atk5",
  112. "Atk6",
  113. "Atk7",
  114. "Atk8",
  115. "Atk11",
  116. "Atk12",
  117. "Atk13",
  118. "Atk14",
  119. "Atk23",
  120. "Atk15",
  121. "AtkHv1",
  122. "AtkHv2",
  123. "AtkHv3",
  124. "Atk16",
  125. "AtkHv1Push",
  126. "AtkRollReady",
  127. "AtkRollEnd",
  128. "AirAtk1",
  129. "AirAtk2",
  130. "AirAtk3",
  131. "AirAtk4",
  132. "AirAtk6",
  133. "AirAtkHv1",
  134. "AirAtkHv2",
  135. "AirAtkHv3",
  136. "AirAtkHv4",
  137. "AirAtkHv5",
  138. "AirAtkHv1Push",
  139. "AirAtkRollReady",
  140. "AirAtkRoll",
  141. "Fall1",
  142. "Fall2",
  143. "Flash2",
  144. "FlashDown2",
  145. "FlashUp2",
  146. "Jump",
  147. "Jump2",
  148. "RollJump"
  149. };
  150. }