Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enemySelected=beforeSort[# 0, optionEnemy-1]
- fighterUsing=beforeSort[# 0, enemyQuant+fighterOrder]
- prompt="Which action will fighter "+string(fighterOrder)+" execute? ("+string(action[fighterOrder])+")"
- if keyboard_check_pressed(vk_left){option=0}
- if keyboard_check_pressed(vk_right){option=1}
- if option=0{
- if keyboard_check_pressed(vk_up){optionEnemy++}
- if keyboard_check_pressed(vk_down){optionEnemy--}
- }
- if fighterOrder<fighterQuant and finished=false{
- switch (option) {
- case 0:
- action[fighterOrder]="attack"
- if keyboard_check_pressed(vk_enter){
- stringLog+="Fighter "+string(fighterUsing)+" will attack the enemy "+string(enemySelected)+"!\n";
- fighterOrder++;
- ds_grid_add(checkWhoTo,2,fighterOrder,enemySelected)
- option=0;
- if fighterOrder=fighterQuant{finished=true}
- }
- break;
- case 1:
- action[fighterOrder]="defend"
- if keyboard_check_pressed(vk_enter){
- stringLog+="Fighter "+string(fighterUsing)+" will defend!\n";
- fighterOrder++
- ds_grid_add(checkWhoTo,2,fighterOrder,"none")
- option=0;
- if fighterOrder=fighterQuant{finished=true}
- }
- break;
- default:
- show_message("Option not added.")
- break;
- }
- }
- if finished=true{timer[1]++}
- if timer[1]>10 and timer[1]<15
- {
- for (var i = fighterOrder; i < allQuant; ++i)
- {
- ds_grid_add(checkWhoTo,2,i,choose("F1","F2","F3","F4")) //6899 Change choose with formula
- }
- }
- if timer[1]>20{ds_grid_sort(checkWhoTo,1,false)}
- if timer[1]>60
- {
- timer[0]++
- if timer[0]>=100 and subTurn<allQuant-1
- {
- subTurn++
- var who = subTurnSorter[# 0, subTurn]
- var to = checkWhoTo[# 2, subTurn]
- var howFast = subTurnSorter[# 1, subTurn]
- stringLog+=string(who)+" attacked " + string(to) + " with a speed of "+string(howFast)+"\n"
- timer[0]=0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement