bear long range slam. and not rotating while attacking animore. but dash and movement damage not working now

This commit is contained in:
2026-08-29 09:30:03 +03:00
parent 41f18cb5d6
commit 4d66df8c7e
4 changed files with 59 additions and 12 deletions
+56 -9
View File
@@ -280,29 +280,62 @@ func _decide() -> void:
var dist := _flat_dist_to_bull()
var options: Array
if dist <= DP.f("bear_close_range"):
# In strike range: punch or overhead (both step in during the swing).
options = [[State.SWIPE, 3.0], [State.SMASH, 3.0 if _enraged else 2.5]]
# Short range: claw attack
options = [[State.SWIPE, 3.0]]
elif dist <= DP.f("bear_mid_range"):
# Mid: mostly walk the bull down on two legs; occasionally leap the gap.
options = [[State.STALK, 3.0], [State.LEAP, 2.0 if _enraged else 1.5]]
# Mid range: jump smash or walk closer
options = [
[State.LEAP, 2.0 if _enraged else 1.5],
[State.STALK, 3.0]
]
else:
# Far: lope in on all fours, or spring across with a leap.
options = [[State.PROWL, 3.0], [State.LEAP, 1.5]]
# Long range: smash or prowl
options = [
[State.SMASH, 3.0 if _enraged else 2.5],
[State.PROWL, 3.0]
]
_start_routine(_weighted_pick(options))
if dist <= DP.f("bear_close_range"):
# Short range — claw attack
options = [[State.SWIPE, 3.0]]
elif dist <= DP.f("bear_mid_range"):
# Mid range — jump smash or stalk closer
options = [[State.LEAP, 2.0 if _enraged else 1.5], [State.STALK, 3.0]]
else:
# Long range — smash is allowed from farther away
options = [[State.SMASH, 3.0 if _enraged else 2.5], [State.PROWL, 3.0]]
# A queued combo step only fires if the bull is still roughly in its band, so a chain
# doesn't whiff into empty air after the player rolls away.
func _range_allows(routine: State) -> bool:
if _bull == null:
return routine == State.PROWL
var dist := _flat_dist_to_bull()
match routine:
State.SWIPE, State.SMASH:
State.SWIPE:
return dist <= DP.f("bear_close_range") * 1.4
State.LEAP:
return dist <= DP.f("bear_mid_range") * 1.5
State.SMASH:
# Smash can be started from any distance.
# The attack itself will move toward the bull.
return true
return true
@@ -419,8 +452,8 @@ func _tick_smash(delta: float) -> void:
if _phase_timer <= 0.0:
_begin_attack_active(_anim_smash, 0.9)
Phase.ACTIVE:
# The overhead steps in less than the swipe — it's a commitment, not a rush.
_lunge_and_track(DP.f("bear_lunge_speed") * 0.5, delta)
# The overhead steps in less than the swipe — it's a commitment, not a rush. no rotation
_lunge_and_track_no_rotation(DP.f("bear_lunge_speed") * 0.5, delta)
_phase_timer -= delta
var frac := 1.0 - _phase_timer / maxf(_active_len, 0.001)
if _hits_done == 0 and frac >= 0.4:
@@ -552,6 +585,20 @@ func _lunge_and_track(speed: float, delta: float) -> void:
_accelerate(to_bull / dist, speed, delta)
else:
_decelerate(_PLANT_DECEL, delta)
func _lunge_and_track_no_rotation(speed: float, delta: float) -> void:
if _bull == null:
_decelerate(_PLANT_DECEL, delta)
return
var to_bull := _flat_to_bull()
var dist := to_bull.length()
if speed > 0.0 and dist > _BULL_STANDOFF:
_accelerate(to_bull / dist, speed, delta)
else:
_decelerate(_PLANT_DECEL, delta)
# ── Hitting the bull ───────────────────────────────────────────────────────────────