1 /// @description ATTACK
2 sprite_index = asset_get_index(string(_my_spr_attack));
7 audio_play_sound(snd_melee_attack,10,false);
10 // samurai style - model attack 4
11 if(sprite_index == spr_samurai_attack or sprite_index == spr_model_attack_4){
12 if(image_index > 0 and image_index < 9){
13 var _to_hit = collision_point(x+24*image_xscale,y,obj_player,true,true);
15 if(_to_hit._state == HERO.ATTACK){
16 audio_play_sound(snd_sword_hit_sword,10,false);
17 var _efx = choose(effect_create_above(ef_ring,x,y,0,c_white), effect_create_above(ef_ellipse,x,y,0,c_white) );
18 _hsp = -image_xscale * 15;
20 }else if(_to_hit._state != HERO.HIT and _to_hit._state != HERO.DEAD and _to_hit._state != HERO.ROLL){
21 _to_hit._state = HERO.HIT;
24 if(image_index > 5 and image_index < 6){audio_play_sound(snd_melee_attack,10,false);}
30 if(image_index > 3 and _melee_atk = 0){
36 if(sprite_index == spr_pirate_attack or sprite_index = spr_alentejano_attack){
37 if(image_index > 1 and image_index < 4){
38 var _to_hit = collision_point(x+16*image_xscale,y,obj_player,true,true);
40 if(_to_hit._state == HERO.ATTACK){
41 audio_play_sound(snd_sword_hit_sword,10,false);
42 var _efx = choose(effect_create_above(ef_ring,x,y,0,c_white), effect_create_above(ef_ellipse,x,y,0,c_white) );
43 _hsp = -image_xscale * 15;
45 }else if(_to_hit._state != HERO.HIT and _to_hit._state != HERO.DEAD and _to_hit._state != HERO.ROLL){
46 _to_hit._state = HERO.HIT;
57 if(sprite_index == spr_model_jab){
58 if(image_index > 0 and image_index < 8){
59 var _to_hit = collision_point(x+8*image_xscale,y,obj_player,true,true);
61 if(_to_hit._state == HERO.ATTACK){
62 var _efx = choose(effect_create_above(ef_ring,x,y,0,c_white), effect_create_above(ef_ellipse,x,y,0,c_white) );
63 _hsp = -image_xscale * 15;
65 }else if(_to_hit._state != HERO.HIT and _to_hit._state != HERO.DEAD and _to_hit._state != HERO.ROLL){
66 _to_hit._state = HERO.HIT;
67 //_to_hit._health += 0.5;
72 /*if(image_index > 8 and _evasion){
73 sprite_index = spr_model_punch;
74 _state = HERO.ATTACK;*/