|
|
|
@ -1196,18 +1196,31 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
case BattleState::POWER_SELECT:{ |
|
|
|
|
if (CURRENT_TURN<0) { |
|
|
|
|
if (DownPressed()) { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]+1,0,(int)BATTLE_MOVELIST_DISPLAY.size()-1); |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1]>=4) { |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]++; |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]==(int)BATTLE_MOVELIST_DISPLAY.size()-1) { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=0; |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]=0; |
|
|
|
|
} else { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]+1,0,(int)BATTLE_MOVELIST_DISPLAY.size()-1); |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1]>=4) { |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (UpPressed()) { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-1,0,(int)BATTLE_MOVELIST_DISPLAY.size()-1); |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]<POWER_SELECTION_OFFSET[-CURRENT_TURN-1]) { |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]--; |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]==0) { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=(int)BATTLE_MOVELIST_DISPLAY.size()-1; |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]=std::clamp(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-3,0,(int)BATTLE_MOVELIST_DISPLAY.size()-1); |
|
|
|
|
} else { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-1,0,(int)BATTLE_MOVELIST_DISPLAY.size()-1); |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]<POWER_SELECTION_OFFSET[-CURRENT_TURN-1]) { |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]--; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (ACTIONKEYPRESSED) { |
|
|
|
|
if (LeftPressed()) { |
|
|
|
|
BATTLE_STATE=BattleState::SELECT_ACTION; |
|
|
|
|
} |
|
|
|
|
if (ACTIONKEYPRESSED||RightPressed()) { |
|
|
|
|
BATTLE_STATE=BattleState::GRADE_SELECT; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1215,12 +1228,39 @@ goes on a very long time, I hope you can understand this is only for testing pur |
|
|
|
|
case BattleState::GRADE_SELECT:{ |
|
|
|
|
if (CURRENT_TURN<0) { |
|
|
|
|
if (RightPressed()) { |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_GRADE_CURSOR[-CURRENT_TURN-1]+1,0,(int)(BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]].size())-1); |
|
|
|
|
} |
|
|
|
|
if (UpPressed()||LeftPressed()&&POWER_GRADE_CURSOR[-CURRENT_TURN-1]==0) { |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=0; |
|
|
|
|
BATTLE_STATE=BattleState::POWER_SELECT; |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=(POWER_GRADE_CURSOR[-CURRENT_TURN-1]+1)%BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]].size(); |
|
|
|
|
} |
|
|
|
|
if (DownPressed()||UpPressed()||LeftPressed()&&POWER_GRADE_CURSOR[-CURRENT_TURN-1]==0) { |
|
|
|
|
if (UpPressed()) { |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]==0) { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=(int)BATTLE_MOVELIST_DISPLAY.size()-1; |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_GRADE_CURSOR[-CURRENT_TURN-1],0,(int)BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]].size()-1); |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]=std::clamp(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-3,0,(int)BATTLE_MOVELIST_DISPLAY.size()-1); |
|
|
|
|
} else { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-1,0,(int)BATTLE_MOVELIST_DISPLAY.size()-1); |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_GRADE_CURSOR[-CURRENT_TURN-1],0,(int)BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]].size()-1); |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]<POWER_SELECTION_OFFSET[-CURRENT_TURN-1]) { |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]--; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else
|
|
|
|
|
if (DownPressed()) { |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]==(int)BATTLE_MOVELIST_DISPLAY.size()-1) { |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=0; |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=0; |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]=0; |
|
|
|
|
} else { |
|
|
|
|
POWER_SELECTION_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_SELECTION_CURSOR[-CURRENT_TURN-1]+1,0,(int)BATTLE_MOVELIST_DISPLAY.size()-1); |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_GRADE_CURSOR[-CURRENT_TURN-1],0,(int)BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]].size()-1); |
|
|
|
|
if (POWER_SELECTION_CURSOR[-CURRENT_TURN-1]-POWER_SELECTION_OFFSET[-CURRENT_TURN-1]>=4) { |
|
|
|
|
POWER_SELECTION_OFFSET[-CURRENT_TURN-1]++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=0; |
|
|
|
|
BATTLE_STATE=BattleState::POWER_SELECT; |
|
|
|
|
} |
|
|
|
|
} else |
|
|
|
|
if (LeftPressed()) { |
|
|
|
|
POWER_GRADE_CURSOR[-CURRENT_TURN-1]=std::clamp(POWER_GRADE_CURSOR[-CURRENT_TURN-1]-1,0,(int)(BATTLE_MOVELIST_DISPLAY[POWER_SELECTION_CURSOR[-CURRENT_TURN-1]].size())-1); |
|
|
|
|
} |
|
|
|
|