Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// @description Insert description here
- // You can write your code in this editor
- if(!global.whose_turn){
- //this sets the amount of actions to 0 when ever the enemy gets a new turn
- if(!flag_0){
- amount_of_actions = 0
- flag_0 = true
- }
- //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
- if(amount_of_actions >= 3 and !instance_exists(obj_decal_dark)) {
- global.whose_turn = true
- flag_0 = false
- exit
- }
- //this is the rng that starts the thing
- if(!flag_1 and !instance_exists(obj_decal_dark)){
- rng = random(2)
- flag_1 = true
- if(rng > 1) storeup = true
- if(rng < 1) attack1 = true
- }
- if(storeup and !instance_exists(obj_decal_dark)){
- //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
- //if it's greater than 5 than, it'll go through a thing
- //******when amount of store up has reached 10 it'll have then next skill open to use and might use that skill
- if(amount_of_storeup >= 10) {
- //doing the rng for skills
- if(!flag_2 and !instance_exists(obj_decal_dark)){
- rng_for_skills = random(3)
- flag_2 = true
- }
- //this will just continue storing up
- if(rng_for_skills > 1 and rng_for_skills < 2){
- amount_of_storeup += 1
- amount_of_actions += 1
- flag_1 = false
- flag_2 = false
- storeup = false
- if(!instance_exists(obj_decal_dark)) instance_create_layer(500,300,"Instances_1",obj_decal_dark)
- }
- //this will just default to a normal attack
- if(rng_for_skills < 1){
- attack1 = true
- flag_2 = false
- storeup = false
- }
- //this is the skill for having 5 store up
- if(rng_for_skills > 2){
- storeup_attack = true
- flag_2 = false
- storeup = false
- }
- }
- //******this throws you another rng check to see if you use a skill or if you just store up again
- if(amount_of_storeup >= 5 and amount_of_storeup < 10) {
- //doing the rng for skills
- if(!flag_2 and !instance_exists(obj_decal_dark)){
- rng_for_skills = random(2)
- flag_2 = true
- }
- //this will just continue storing up
- if(rng_for_skills > 1 and rng_for_skills < 2){
- amount_of_storeup += 1
- amount_of_actions += 1
- flag_1 = false
- flag_2 = false
- storeup = false
- if(!instance_exists(obj_decal_dark)) instance_create_layer(500,300,"Instances_1",obj_decal_dark)
- }
- //this will just default to a normal attack
- if(rng_for_skills < 1){
- attack1 = true
- flag_2 = false
- storeup = false
- }
- //this is the skill for having 5 store up
- //if(rng_for_skills > 2) do skill stuff lol
- }
- //******this is when you are less then 5 store up and there is nothing to do but store up somemore
- if(amount_of_storeup < 5){
- //if there is no other store up status effects in effect
- if(!instance_exists(obj_status_effect_storeup)){
- 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
- if(!instance_exists(obj_decal_dark)) instance_create_layer(500,300,"Instances_1",obj_decal_dark)
- flag_1 = false
- storeup = false
- amount_of_actions += 1
- amount_of_storeup = 1
- }
- //this just updates the number of amounts
- if(instance_exists(obj_status_effect_storeup)){
- if(!instance_exists(obj_decal_dark)) instance_create_layer(500,300,"Instances_1",obj_decal_dark)
- if(storeup){
- flag_1 = false
- storeup = false
- amount_of_actions += 1
- amount_of_storeup += 1
- }
- }
- }
- }
- //================================================================
- //These are just the attack animations
- //================================================================
- //this is the stuff for the attack that happens affter store up
- if(storeup_attack and !instance_exists(obj_decal_dark)){
- movex = lerp(movex,610,.05)
- if(movex > 600) xscale = lerp(xscale,50,.05)
- if(xscale > 45){
- global.player_hp -= 1000
- audio_play_sound(se_shot,10,false)
- movex = -52
- xscale = 1
- flag_1 = false
- storeup_attack = false
- amount_of_storeup -= 10
- amount_of_actions += 1
- }
- }
- //this is a normall attack that takes 100 hp from you
- if(attack1 and !instance_exists(obj_decal_dark)){
- movex = lerp(movex,1400,.05)
- if(movex >= 1350){
- global.player_hp -= 100
- audio_play_sound(se_shot,10,false)
- movex = -52
- flag_1 = false
- attack1 = false
- amount_of_actions += 1
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement