Combat Mode is more reliable now, just one little glitch that it doesn't exit on the last enemy dying.
This commit is contained in:
parent
232c994347
commit
cfe56bbf99
5 changed files with 20 additions and 6 deletions
19
gui.cpp
19
gui.cpp
|
@ -99,9 +99,13 @@ namespace gui {
|
|||
System::combat($level);
|
||||
run_systems();
|
||||
$rotation = -10.0f;
|
||||
state(State::IDLE);
|
||||
state(State::IN_COMBAT);
|
||||
}
|
||||
break;
|
||||
case STOP_COMBAT:
|
||||
dbc::log("Exiting ATTACKING STATE");
|
||||
state(State::IDLE);
|
||||
break;
|
||||
default:
|
||||
dbc::log(fmt::format("In ATTACKING state, unhandled event {}", (int)ev));
|
||||
}
|
||||
|
@ -161,6 +165,7 @@ namespace gui {
|
|||
case CLOSE:
|
||||
dbc::log("Nothing to close.");
|
||||
break;
|
||||
case STOP_COMBAT:
|
||||
case TICK:
|
||||
// do nothing
|
||||
break;
|
||||
|
@ -186,6 +191,9 @@ namespace gui {
|
|||
$camera.plan_rotate($rayview, -1);
|
||||
state(State::COMBAT_ROTATE);
|
||||
break;
|
||||
case STOP_COMBAT:
|
||||
state(State::IDLE);
|
||||
break;
|
||||
case QUIT:
|
||||
$window.close();
|
||||
state(State::END);
|
||||
|
@ -405,9 +413,12 @@ namespace gui {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case eGUI::COMBAT_START: {
|
||||
event(Event::START_COMBAT);
|
||||
} break;
|
||||
case eGUI::COMBAT_START:
|
||||
event(Event::START_COMBAT);
|
||||
break;
|
||||
case eGUI::NO_NEIGHBORS:
|
||||
event(Event::STOP_COMBAT);
|
||||
break;
|
||||
case eGUI::LOOT: {
|
||||
// auto &item = std::any_cast<InventoryItem&>(data);
|
||||
// $status_view.log(fmt::format("You picked up a {}.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue