From 86ea246c49cf2975c1240ee9390fed744b185e72 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Wed, 16 Oct 2019 10:35:48 +0200 Subject: ... --- src/battle/mechanic/action/btl_action_move.erl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/battle') diff --git a/src/battle/mechanic/action/btl_action_move.erl b/src/battle/mechanic/action/btl_action_move.erl index eed7add..ad19f7a 100644 --- a/src/battle/mechanic/action/btl_action_move.erl +++ b/src/battle/mechanic/action/btl_action_move.erl @@ -444,7 +444,6 @@ commit_move (CharacterIX, Character, S0Update, Path, NewLocation) -> -spec handle ( btl_action:type(), - btl_character:type(), btl_character_turn_update:type() ) -> @@ -452,9 +451,22 @@ commit_move (CharacterIX, Character, S0Update, Path, NewLocation) -> {'ok', btl_character_turn_update:type()} | {'events', list(btl_action:type()), btl_character_turn_update:type()} ). -handle (Action, Character, S0Update) -> - Path = btl_action:get_path(Action), - CharacterIX = btl_action:get_actor_index(Action), +handle (Action, S0Update) -> + ActorIX = btl_action:get_actor_index(Action), + + S0MovementPoints = ..., + + S0Path = btl_action:get_path(Action), + + {{S1MovementPoints, S1Path}, S2Update} = + btl_condition:apply_to_character + ( + ActorIX, + ?CONDITION_TRIGGER_ABOUT_TO_MOVE, + {S0MovementPoints, S0Path}, + S1Update + ), + { NewLocation, -- cgit v1.2.3-70-g09d2