|
|
|
|
@ -35,7 +35,7 @@ func reset():
|
|
|
|
|
play_animation("jump4_loop")
|
|
|
|
|
|
|
|
|
|
func trans_register() -> void:
|
|
|
|
|
# 地面行走
|
|
|
|
|
#地面行走
|
|
|
|
|
trans("idle_loop", "run1", "speed_xz", ">", 1)
|
|
|
|
|
run("run1", "run2_loop")
|
|
|
|
|
trans("run1", "run3", "speed_xz", "<", 1)
|
|
|
|
|
@ -43,11 +43,20 @@ func trans_register() -> void:
|
|
|
|
|
run("run3", "idle_loop")
|
|
|
|
|
trans("run3", "run1", "speed_xz", ">", 1)
|
|
|
|
|
|
|
|
|
|
# 跳跃
|
|
|
|
|
#下落
|
|
|
|
|
trans("idle_loop", "jump4_loop", "is_on_floor", "=", false)
|
|
|
|
|
trans("run1", "jump4_loop", "is_on_floor", "=", false)
|
|
|
|
|
trans("run2_loop", "jump4_loop", "is_on_floor", "=", false)
|
|
|
|
|
trans("run3", "jump4_loop", "is_on_floor", "=", false)
|
|
|
|
|
|
|
|
|
|
#跳跃
|
|
|
|
|
trigger("any", "jump1", "trigger_jump")
|
|
|
|
|
run("jump1", "jump2_loop")
|
|
|
|
|
trans("jump2_loop", "jump3", "speed_y", "<=", 0)
|
|
|
|
|
run("jump3", "jump4_loop")
|
|
|
|
|
|
|
|
|
|
#跳跃落地
|
|
|
|
|
trans("jump3", "jump5", "is_on_floor", "=", true)
|
|
|
|
|
trans("jump4_loop", "jump5", "is_on_floor", "=", true)
|
|
|
|
|
run("jump5", "idle_loop")
|
|
|
|
|
trans("jump5", "run1", "speed_xz", ">", 1)
|
|
|
|
|
@ -56,9 +65,12 @@ func trans_register() -> void:
|
|
|
|
|
trigger("any", "hit", "trigger_hit")
|
|
|
|
|
trigger("any", "mhit", "trigger_mhit")
|
|
|
|
|
trigger("any", "lhit", "trigger_lhit")
|
|
|
|
|
run("hit", "idle_loop")
|
|
|
|
|
run("mhit", "idle_loop")
|
|
|
|
|
run("lhit", "idle_loop")
|
|
|
|
|
run_with_condition("hit", "idle_loop", "is_on_floor", "=", true)
|
|
|
|
|
run_with_condition("mhit", "idle_loop", "is_on_floor", "=", true)
|
|
|
|
|
run_with_condition("lhit", "idle_loop", "is_on_floor", "=", true)
|
|
|
|
|
run_with_condition("hit", "jump4_loop", "is_on_floor", "=", false)
|
|
|
|
|
run_with_condition("mhit", "jump4_loop", "is_on_floor", "=", false)
|
|
|
|
|
run_with_condition("lhit", "jump4_loop", "is_on_floor", "=", false)
|
|
|
|
|
|
|
|
|
|
#地面眩晕受击
|
|
|
|
|
trigger("any", "stunhit", "trigger_stun_hit")
|
|
|
|
|
@ -70,9 +82,12 @@ func trans_register() -> void:
|
|
|
|
|
run("airhit1", "airhit2_loop")
|
|
|
|
|
trans("airhit2_loop", "airhit3", "speed_y", "<=", 0)
|
|
|
|
|
run("airhit3", "airhit4_loop")
|
|
|
|
|
trans("airhit4_loop", "airhit5_select", "is_on_floor", "=", true)
|
|
|
|
|
|
|
|
|
|
#空中受击落地
|
|
|
|
|
trans("airhit1", "airhit5_select", "is_on_floor", "=", true)
|
|
|
|
|
trans("airhit2_loop", "airhit5_select", "is_on_floor", "=", true)
|
|
|
|
|
trans("airhit3", "airhit5_select", "is_on_floor", "=", true)
|
|
|
|
|
trans("airhit4_loop", "airhit5_select", "is_on_floor", "=", true)
|
|
|
|
|
run_with_condition("airhit5_select", "airhit5_stun", "is_stun", "=", true)
|
|
|
|
|
run_with_condition("airhit5_select", "airhit5", "is_stun", "=", false)
|
|
|
|
|
run("airhit5_stun", "ground_stun1_loop")
|
|
|
|
|
@ -87,14 +102,16 @@ func trans_register() -> void:
|
|
|
|
|
|
|
|
|
|
#落地反弹
|
|
|
|
|
trigger("any", "rebound", "trigger_rebound")
|
|
|
|
|
run("rebound", "airhit2_loop")
|
|
|
|
|
run_with_condition("rebound", "airhit2_loop", "is_on_floor", "=", false)
|
|
|
|
|
run_with_condition("rebound", "airhit5_select", "is_on_floor", "=", true)
|
|
|
|
|
|
|
|
|
|
func _process(_delta) -> void:
|
|
|
|
|
if status.is_be_throw: return
|
|
|
|
|
if status.is_pause: return
|
|
|
|
|
for status_change_cache_single in status_change_cache:
|
|
|
|
|
update_trans(status_change_cache_single)
|
|
|
|
|
status_change_cache.clear()
|
|
|
|
|
if status_change_cache:
|
|
|
|
|
for status_change_cache_single in status_change_cache:
|
|
|
|
|
update_trans(status_change_cache_single)
|
|
|
|
|
status_change_cache.clear()
|
|
|
|
|
|
|
|
|
|
func _on_character_status_changed(status_name, _value) -> void:
|
|
|
|
|
if status_name in trans_dict:
|
|
|
|
|
|