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
- event_inherited();
- if ai_isghost
- {
- }
- if (ai_active){
- if (ai_tick<0)
- {
- if (ai_action!=3) and (ai_action!=4) and (ai_action>-1)
- {
- if (abs(x-o_vernal.x)>48)
- {
- ai_action=choose(0,0,0,4)
- }
- else
- {
- ai_action=choose(1,1,2)
- }
- }
- hsp=0
- }
- switch (ai_action)
- {
- case 0: //go to
- if (ai_tick<0)
- {
- show_debug_message("walk")
- character_action_set(s_e_yknight_d_idle,0,0,60,60,true,true,false)
- if (x>o_vernal.x)
- {
- image_xscale=-1
- }
- else
- {
- image_xscale=1
- }
- ai_tick=80
- }
- var whichway=0
- if (x<o_vernal.x)
- {
- whichway=1
- }
- if (x>o_vernal.x)
- {
- whichway=-1
- }
- move_to(o_vernal.x+(16*whichway),0.025)
- break;
- case 1: //attack
- if (ai_tick<0)
- {
- show_debug_message("swing")
- character_action_set(s_e_yknight_maincombo,0,0,60,60,true,true,false)
- character_slash_set(s_player_ground01_fx,0,create_slash_p.none,false,100,100,1,1,0,false,1,"none","none","facing",false)
- if (x>o_vernal.x)
- {
- image_xscale=-1
- }
- else
- {
- image_xscale=1
- }
- ai_tick=60
- }
- break;
- case 2: // jump one
- if (ai_tick<0)
- {
- show_debug_message("junp")
- character_action_set(s_e_george_airidle,0,0,60,60,true,true,false)
- var whichway=0
- if (x<o_vernal.x)
- {
- whichway=-1
- }
- else
- {
- whichway=1
- }
- ai_jump((whichway*2),-3)
- if (x>o_vernal.x)
- {
- image_xscale=-1
- }
- else
- {
- image_xscale=1
- }
- ai_action=3
- ai_tick=15
- }
- break;
- //follow up actions
- case 3: // jump two
- if (ai_tick<0)
- {
- show_debug_message("junp")
- character_action_set(s_e_george_airidle,0,0,60,60,true,true,false)
- var whichway=0
- if (x<o_vernal.x)
- {
- whichway=-1
- }
- else
- {
- whichway=1
- }
- ai_jump((whichway*2),-4)
- if (x>o_vernal.x)
- {
- image_xscale=-1
- }
- else
- {
- image_xscale=1
- }
- ai_action=4
- ai_tick=25
- }
- break;
- case 4: // shoot
- if (ai_tick<0)
- {
- show_debug_message("i shooot")
- character_action_set(s_player_air03,0,0,60,60,true,true,false)
- character_create_projectile(point_direction(x,y,o_vernal.x,o_vernal.y),1,0,0,200,5,5,"none",l_property.none,1,5)
- var whichway=0
- if (x>o_vernal.x)
- {
- image_xscale=-1
- }
- else
- {
- image_xscale=1
- }
- ai_action=1
- ai_tick=100
- }
- break;
- //NOW ENTERING GHOST ZONE
- case -1: // ghost shoot
- if (ai_tick<0)
- {
- show_debug_message("i shooot")
- character_action_set(s_player_air03,0,0,60,60,true,true,false)
- image_xscale=o_vernal.image_xscale
- if image_xscale=1
- {
- var projdirection = 0
- }
- else
- var projdirection = 180
- character_create_projectile(projdirection,4,0,0,200,5,5,"none",l_property.none,1,5)
- ai_action=-2
- ai_tick=40
- }
- break;
- case -2: // i die now
- if (ai_tick<0)
- {
- o_vernal.canghost=true
- instance_destroy(id,false)
- }
- break;
- }
- ai_tick-=1*get_delta_time()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement