38 lines
715 B
Plaintext
Raw Normal View History

2022-08-19 10:19:08 -07:00
function st_enemyturn() {
2022-08-23 01:34:45 -07:00
if selectedunit != noone {
hspd = 0;
vspd = 0;
x = lerp(x, selectedunit.x, .4);
y = lerp(y, selectedunit.y, .4);
cursor.x = mouse_x;
cursor.y = mouse_y;
global.camerax = x;
global.cameray = y;
2022-08-19 10:19:08 -07:00
}
2022-08-23 01:34:45 -07:00
if waiting {
waiting--;
exit;
}
done = false;
//for (k=0; k<array_length(global.units[ARMY.THEM]); k++) {
var target = global.units[ARMY.THEM][k];
selectedunit = target;
while !target.waiting {
c_doenemyai(target);
if waiting exit;
}
k++;
if k >= array_length(global.units[ARMY.THEM]){
done = true;
}
//}
if done {
c_dewait(global.turn);
k = 0;
2022-08-23 02:25:43 -07:00
c_deselectunit(selectedunit);
2022-08-23 01:34:45 -07:00
state = st_control;
global.turn = ARMY.US;
2022-08-23 02:25:43 -07:00
done = false;
2022-08-23 01:34:45 -07:00
}
//}
2022-08-19 10:19:08 -07:00
}