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