The problem with picking up items under a dead body is fixed but now need to fix combat.
This commit is contained in:
parent
97fe02d99d
commit
f84b63f0e6
7 changed files with 93 additions and 43 deletions
16
gui/fsm.cpp
16
gui/fsm.cpp
|
@ -74,7 +74,7 @@ namespace gui {
|
|||
void FSM::MOVING(Event ) {
|
||||
// this should be an optional that returns a point
|
||||
if(auto move_to = $main_ui.play_move()) {
|
||||
System::plan_motion(*$level.world, *move_to);
|
||||
System::plan_motion($level, *move_to);
|
||||
run_systems();
|
||||
$main_ui.dirty();
|
||||
state(State::IDLE);
|
||||
|
@ -198,14 +198,8 @@ namespace gui {
|
|||
case MOUSE_MOVE:
|
||||
mouse_action(true);
|
||||
break;
|
||||
case AIM_CLICK: {
|
||||
auto aimed_at = $main_ui.camera_aim();
|
||||
|
||||
if(aimed_at) {
|
||||
// this will then send LOOT_ITEM if it's valid
|
||||
System::pickup($level, aimed_at);
|
||||
}
|
||||
} break;
|
||||
case AIM_CLICK:
|
||||
System::pickup($level);
|
||||
default:
|
||||
break; // ignore everything else
|
||||
}
|
||||
|
@ -357,6 +351,10 @@ namespace gui {
|
|||
$loot_ui.update();
|
||||
event(Event::LOOT_OPEN);
|
||||
break;
|
||||
case KEY::Z: {
|
||||
auto& player_pos = System::player_position($level);
|
||||
System::distribute_loot($level, {player_pos.aiming_at});
|
||||
} break;
|
||||
case KEY::X:
|
||||
event(Event::STAIRS_DOWN);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue