]> vgcfreebox.myrthtech.pt Git - gm-duelo.git/blob - objects/obj_player/Other_20.gml
game conroller objs
[gm-duelo.git] / objects / obj_player / Other_20.gml
1 /// @description EVASION C
2 sprite_index = asset_get_index(string(_my_spr_special));
3 if sprite_index != "tbd" {
4 image_speed = 1;
5 _hsp = sign(_hsp);
6
7 if(image_index < 1){
8 audio_play_sound(snd_melee_sword_attack,10,false);
9 }
10
11 // punch style
12 if(sprite_index == spr_model_punch or sprite_index == spr_alentejano_punch){
13 if(image_index > 4 and image_index < 7){
14 var _to_hit = collision_point(x+18*image_xscale,y,obj_player,true,true);
15 if(_to_hit){
16 if(_to_hit._state == HERO.ATTACK){
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 _to_hit._hsp = -image_xscale * 10;
19 _to_hit._vsp = -5;
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;
22 _to_hit._hsp = -_to_hit.image_xscale * 8;
23 _to_hit._vsp = -4;
24 }
25 }
26 }
27
28 if(image_index > 7){
29 _state = HERO.IDLE;
30 }
31 }
32
33 // samurai style - model attack 3
34 if(sprite_index == spr_samurai_attack_2){
35 if(image_index > 1 and image_index < 10){
36 var _to_hit = collision_point(x+30*image_xscale,y,obj_player,true,true);
37 if(_to_hit){
38 if(_to_hit._state == HERO.ATTACK){
39 audio_play_sound(snd_sword_w_sword_00,10,false);
40 var _efx = choose(effect_create_above(ef_ring,x,y,0,c_white), effect_create_above(ef_ellipse,x,y,0,c_white) );
41 _hsp = -image_xscale * 15;
42 _vsp = -10;
43 }else if(_to_hit._state != HERO.HIT and _to_hit._state != HERO.DEAD and _to_hit._state != HERO.ROLL){
44 _to_hit._state = HERO.HIT;
45 _to_hit._health = 0;
46 part_particles_burst(global._ps_blood,_to_hit.x,_to_hit.y,ps_blood);
47 }
48 }
49 }
50
51 if(image_index > 15){
52 _state = HERO.IDLE;
53 }
54 }
55
56 // stab style
57 if(sprite_index == spr_model_attack_2 or sprite_index == spr_pirate_hook_atk){
58 if(image_index > 1 and image_index < 5){
59 var _to_hit = collision_point(x+20*image_xscale,y,obj_player,true,true);
60 if(_to_hit){
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;
64 _vsp = -10;
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--;
68 }
69 }
70 }
71
72 if(image_index > 6){
73 _state = HERO.IDLE;
74 }
75 }
76
77 }else{
78 _state = HERO.IDLE;
79 }