1 |
var hp_percentage = global.current_hp_enemy / global.max_hp_enemy; |
2 |
switch (fmartlet_event_lowhp) |
3 |
{ |
4 |
case 0: |
5 |
if (hp_percentage <= 0.8) |
6 |
{ |
7 |
fmartlet_event_lowhp = 1; |
8 |
global.attack_cycle = 40; |
9 |
exit; |
10 |
} |
11 |
break; |
12 |
case 1: |
13 |
if (hp_percentage <= 0.6) |
14 |
{ |
15 |
fmartlet_event_lowhp = 2; |
16 |
global.attack_cycle = 41; |
17 |
exit; |
18 |
} |
19 |
break; |
20 |
case 2: |
21 |
if (hp_percentage <= 0.4) |
22 |
{ |
23 |
fmartlet_event_lowhp = 3; |
24 |
global.attack_cycle = 42; |
25 |
exit; |
26 |
} |
27 |
break; |
28 |
case 3: |
29 |
if (hp_percentage <= 0.2) |
30 |
{ |
31 |
fmartlet_event_lowhp = 4; |
32 |
global.attack_cycle = 43; |
33 |
exit; |
34 |
} |
35 |
break; |
36 |
} |
37 |
if (ds_list_size(fmartlet_atpool) == 0) |
38 |
event_user(1); |
39 |
var random_pos = irandom(ds_list_size(fmartlet_atpool) - 1); |
40 |
var new_attack = ds_list_find_value(fmartlet_atpool, random_pos); |
41 |
global.attack_cycle = new_attack; |
42 |
ds_list_delete(fmartlet_atpool, random_pos); |