Change dismount button and fix dodging on dismount
This commit is contained in:
parent
00bfe60c32
commit
5e89c73c31
|
|
@ -45,7 +45,7 @@ func _ready() -> void:
|
||||||
InputMap.action_add_event(mount_action, key))
|
InputMap.action_add_event(mount_action, key))
|
||||||
_ensure_action(dismount_action, func():
|
_ensure_action(dismount_action, func():
|
||||||
var pad := InputEventJoypadButton.new()
|
var pad := InputEventJoypadButton.new()
|
||||||
pad.button_index = JOY_BUTTON_Y
|
pad.button_index = JOY_BUTTON_X
|
||||||
InputMap.action_add_event(dismount_action, pad)
|
InputMap.action_add_event(dismount_action, pad)
|
||||||
var key := InputEventKey.new()
|
var key := InputEventKey.new()
|
||||||
key.physical_keycode = KEY_F
|
key.physical_keycode = KEY_F
|
||||||
|
|
@ -151,8 +151,7 @@ func dismount() -> void:
|
||||||
|
|
||||||
player.is_mounted = false
|
player.is_mounted = false
|
||||||
player.exit_mount_stats()
|
player.exit_mount_stats()
|
||||||
for state_name in blocked_states:
|
_release_blocked_states_next_frame()
|
||||||
state_machine.set_state_blocked(state_name, false)
|
|
||||||
|
|
||||||
visual_root.position -= _seat_applied
|
visual_root.position -= _seat_applied
|
||||||
_seat_applied = Vector3.ZERO
|
_seat_applied = Vector3.ZERO
|
||||||
|
|
@ -169,3 +168,11 @@ func _swallow_jump_this_frame() -> void:
|
||||||
state_machine.set_state_blocked("JumpState", true)
|
state_machine.set_state_blocked("JumpState", true)
|
||||||
await get_tree().physics_frame
|
await get_tree().physics_frame
|
||||||
state_machine.set_state_blocked("JumpState", false)
|
state_machine.set_state_blocked("JumpState", false)
|
||||||
|
|
||||||
|
func _release_blocked_states_next_frame() -> void:
|
||||||
|
#Dodge/Crouch restent refuses pendant la frame de la descente : si la touche de descente est aussi celle de la roulade,
|
||||||
|
#le meme appui ne declenche pas de roulade une fois descendu
|
||||||
|
await get_tree().physics_frame
|
||||||
|
if mount != null: return #on est remonte entre-temps : les etats restent bloques
|
||||||
|
for state_name in blocked_states:
|
||||||
|
state_machine.set_state_blocked(state_name, false)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue