record and replay trading pc places
This commit is contained in:
@@ -1256,6 +1256,19 @@ void handle_print_pc_sp(int which_pc) {
|
|||||||
add_string_to_buf(str.str());
|
add_string_to_buf(str.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_trade_places(int which_pc) {
|
||||||
|
if(recording){
|
||||||
|
record_action("handle_trade_places", boost::lexical_cast<std::string>(which_pc));
|
||||||
|
}
|
||||||
|
if(!prime_time())
|
||||||
|
add_string_to_buf("Trade places: Finish what you're doing first.");
|
||||||
|
else if(is_combat())
|
||||||
|
add_string_to_buf("Trade places: Can't do this in combat.");
|
||||||
|
else {
|
||||||
|
switch_pc(which_pc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
|
bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
|
||||||
long item_hit;
|
long item_hit;
|
||||||
bool are_done = false;
|
bool are_done = false;
|
||||||
@@ -1492,13 +1505,7 @@ bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
|
|||||||
give_pc_info(i);
|
give_pc_info(i);
|
||||||
break;
|
break;
|
||||||
case PCBTN_TRADE:
|
case PCBTN_TRADE:
|
||||||
if(!prime_time())
|
handle_trade_places(i);
|
||||||
add_string_to_buf("Trade places: Finish what you're doing first.");
|
|
||||||
else if(is_combat())
|
|
||||||
add_string_to_buf("Trade places: Can't do this in combat.");
|
|
||||||
else {
|
|
||||||
switch_pc(i);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MAX_ePlayerButton:
|
case MAX_ePlayerButton:
|
||||||
break; // Not a button
|
break; // Not a button
|
||||||
|
@@ -91,5 +91,6 @@ void debug_heal_plus_extra();
|
|||||||
void debug_heal();
|
void debug_heal();
|
||||||
void handle_print_pc_hp(int which_pc);
|
void handle_print_pc_hp(int which_pc);
|
||||||
void handle_print_pc_sp(int which_pc);
|
void handle_print_pc_sp(int which_pc);
|
||||||
|
void handle_trade_places(int which_pc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -527,6 +527,8 @@ static void replay_next_action() {
|
|||||||
handle_print_pc_sp(boost::lexical_cast<int>(next_action.GetText()));
|
handle_print_pc_sp(boost::lexical_cast<int>(next_action.GetText()));
|
||||||
}else if(t == "give_pc_info"){
|
}else if(t == "give_pc_info"){
|
||||||
give_pc_info(boost::lexical_cast<short>(next_action.GetText()));
|
give_pc_info(boost::lexical_cast<short>(next_action.GetText()));
|
||||||
|
}else if(t == "handle_trade_places"){
|
||||||
|
handle_trade_places(boost::lexical_cast<short>(next_action.GetText()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO some of these actions shouldn't call advance_time(). They should return
|
// TODO some of these actions shouldn't call advance_time(). They should return
|
||||||
|
Reference in New Issue
Block a user