Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. /// @description Insert description here
  2. // You can write your code in this editor
  3.  
  4. if(!global.whose_turn){
  5.  
  6. //this sets the amount of actions to 0 when ever the enemy gets a new turn
  7. if(!flag_0){
  8. amount_of_actions = 0
  9. flag_0 = true
  10. }
  11.  
  12. //after the enemy takes three actions and there's no effects on the screen then it'll reset the flag0 and give the turn back to the play
  13. if(amount_of_actions >= 3 and !instance_exists(obj_decal_dark)) {
  14. global.whose_turn = true
  15. flag_0 = false
  16. exit
  17. }
  18.  
  19. //this is the rng that starts the thing
  20. if(!flag_1 and !instance_exists(obj_decal_dark)){
  21. rng = random(2)
  22. flag_1 = true
  23. if(rng > 1) storeup = true
  24. if(rng < 1) attack1 = true
  25. }
  26.  
  27.  
  28.  
  29.  
  30. if(storeup and !instance_exists(obj_decal_dark)){
  31.  
  32. //here's the rules for store up: if amount is less then 5 we can't use any skills, so it'll just add one to store up
  33. //if it's greater than 5 than, it'll go through a thing
  34.  
  35. //******when amount of store up has reached 10 it'll have then next skill open to use and might use that skill
  36. if(amount_of_storeup >= 10) {
  37. //doing the rng for skills
  38. if(!flag_2 and !instance_exists(obj_decal_dark)){
  39. rng_for_skills = random(3)
  40. flag_2 = true
  41. }
  42.  
  43. //this will just continue storing up
  44. if(rng_for_skills > 1 and rng_for_skills < 2){
  45. amount_of_storeup += 1
  46. amount_of_actions += 1
  47. flag_1 = false
  48. flag_2 = false
  49. storeup = false
  50. if(!instance_exists(obj_decal_dark)) instance_create_layer(500,300,"Instances_1",obj_decal_dark)
  51. }
  52.  
  53. //this will just default to a normal attack
  54. if(rng_for_skills < 1){
  55. attack1 = true
  56. flag_2 = false
  57. storeup = false
  58. }
  59.  
  60. //this is the skill for having 5 store up
  61. if(rng_for_skills > 2){
  62. storeup_attack = true
  63. flag_2 = false
  64. storeup = false
  65. }
  66. }
  67.  
  68. //******this throws you another rng check to see if you use a skill or if you just store up again
  69. if(amount_of_storeup >= 5 and amount_of_storeup < 10) {
  70. //doing the rng for skills
  71. if(!flag_2 and !instance_exists(obj_decal_dark)){
  72. rng_for_skills = random(2)
  73. flag_2 = true
  74. }
  75.  
  76. //this will just continue storing up
  77. if(rng_for_skills > 1 and rng_for_skills < 2){
  78. amount_of_storeup += 1
  79. amount_of_actions += 1
  80. flag_1 = false
  81. flag_2 = false
  82. storeup = false
  83. if(!instance_exists(obj_decal_dark)) instance_create_layer(500,300,"Instances_1",obj_decal_dark)
  84. }
  85.  
  86. //this will just default to a normal attack
  87. if(rng_for_skills < 1){
  88. attack1 = true
  89. flag_2 = false
  90. storeup = false
  91. }
  92.  
  93. //this is the skill for having 5 store up
  94. //if(rng_for_skills > 2) do skill stuff lol
  95. }
  96.  
  97. //******this is when you are less then 5 store up and there is nothing to do but store up somemore
  98. if(amount_of_storeup < 5){
  99. //if there is no other store up status effects in effect
  100. if(!instance_exists(obj_status_effect_storeup)){
  101. instance_create_layer(1180,100,"Instances_1",obj_status_effect_storeup)//make object on the side of the screen that shows how many units of the power up is being made
  102. if(!instance_exists(obj_decal_dark)) instance_create_layer(500,300,"Instances_1",obj_decal_dark)
  103.  
  104.  
  105. flag_1 = false
  106. storeup = false
  107. amount_of_actions += 1
  108. amount_of_storeup = 1
  109.  
  110.  
  111. }
  112.  
  113. //this just updates the number of amounts
  114. if(instance_exists(obj_status_effect_storeup)){
  115. if(!instance_exists(obj_decal_dark)) instance_create_layer(500,300,"Instances_1",obj_decal_dark)
  116. if(storeup){
  117. flag_1 = false
  118. storeup = false
  119. amount_of_actions += 1
  120. amount_of_storeup += 1
  121. }
  122.  
  123. }
  124. }
  125.  
  126. }
  127.  
  128.  
  129.  
  130.  
  131. //================================================================
  132. //These are just the attack animations
  133. //================================================================
  134.  
  135. //this is the stuff for the attack that happens affter store up
  136. if(storeup_attack and !instance_exists(obj_decal_dark)){
  137. movex = lerp(movex,610,.05)
  138. if(movex > 600) xscale = lerp(xscale,50,.05)
  139. if(xscale > 45){
  140. global.player_hp -= 1000
  141. audio_play_sound(se_shot,10,false)
  142. movex = -52
  143. xscale = 1
  144. flag_1 = false
  145. storeup_attack = false
  146. amount_of_storeup -= 10
  147. amount_of_actions += 1
  148. }
  149. }
  150.  
  151.  
  152. //this is a normall attack that takes 100 hp from you
  153. if(attack1 and !instance_exists(obj_decal_dark)){
  154. movex = lerp(movex,1400,.05)
  155. if(movex >= 1350){
  156. global.player_hp -= 100
  157. audio_play_sound(se_shot,10,false)
  158. movex = -52
  159. flag_1 = false
  160. attack1 = false
  161. amount_of_actions += 1
  162. }
  163. }
  164.  
  165.  
  166. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement