record and replay the burma shave easter egg
This commit is contained in:
@@ -2226,6 +2226,24 @@ void cancel_item_target(bool& did_something, bool& need_redraw, bool& need_repri
|
||||
did_something = need_redraw = need_reprint = true;
|
||||
}
|
||||
|
||||
// I'm finally adding the easter egg to the replay system
|
||||
// because it allows forcing the text buffer into a specific state
|
||||
// which I'm debugging.
|
||||
std::vector<std::string> easter_egg_messages = {
|
||||
"If Valorim ...",
|
||||
"You want to save ...",
|
||||
"Back up your save files ...",
|
||||
"Burma Shave."
|
||||
};
|
||||
|
||||
void easter_egg(int idx) {
|
||||
if(recording){
|
||||
record_action("easter_egg", boost::lexical_cast<std::string>(idx));
|
||||
}
|
||||
add_string_to_buf(easter_egg_messages[idx]);
|
||||
print_buf();
|
||||
}
|
||||
|
||||
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
|
||||
bool are_done = false;
|
||||
location pass_point; // TODO: This isn't needed
|
||||
@@ -2381,20 +2399,16 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
|
||||
switch(chr) {
|
||||
|
||||
case '&':
|
||||
add_string_to_buf("If Valorim ...");
|
||||
print_buf();
|
||||
easter_egg(0);
|
||||
break;
|
||||
case '*':
|
||||
add_string_to_buf("You want to save ...");
|
||||
print_buf();
|
||||
easter_egg(1);
|
||||
break;
|
||||
case '(':
|
||||
add_string_to_buf("Back up your save files ...");
|
||||
print_buf();
|
||||
easter_egg(2);
|
||||
break;
|
||||
case ')':
|
||||
add_string_to_buf("Burma Shave.");
|
||||
print_buf();
|
||||
easter_egg(3);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
|
@@ -102,5 +102,6 @@ void show_item_info(short item_hit);
|
||||
void close_map(bool record = false);
|
||||
void cancel_item_target(bool& did_something, bool& need_redraw, bool& need_reprint);
|
||||
void update_item_stats_area(bool& need_reprint);
|
||||
void easter_egg(int idx);
|
||||
|
||||
#endif
|
||||
|
@@ -640,6 +640,8 @@ void replay_action(Element& action) {
|
||||
return;
|
||||
}else if(t == "cancel_item_target"){
|
||||
cancel_item_target(did_something, need_redraw, need_reprint);
|
||||
}else if(t == "easter_egg"){
|
||||
easter_egg(boost::lexical_cast<int>(action.GetText()));
|
||||
}else if(t == "advance_time"){
|
||||
// This is bad regardless of strictness, because visual changes may have occurred which won't get redrawn/reprinted
|
||||
throw std::string { "Replay system internal error! advance_time() was supposed to be called by the last action, but wasn't: " } + _last_action_type;
|
||||
|
Reference in New Issue
Block a user