diff --git a/Bear.tscn b/Bear.tscn index caa6a19..da26d32 100644 --- a/Bear.tscn +++ b/Bear.tscn @@ -49,9 +49,8 @@ visible = false [node name="RigidBody3D" type="AnimatableBody3D" parent="bear_model/test_cube/Bear_FX/Bear_fx_smash_hit" index="0" unique_id=1764208051] transform = Transform3D(1.0000001, -1.21071935e-08, -1.8626451e-08, -9.313226e-10, 0.99999994, 7.450581e-09, 3.7252903e-09, -1.4901161e-08, 0.99999994, 0, 0, 0) -disable_mode = 1 -collision_layer = 8 -collision_mask = 2 +collision_layer = 0 +collision_mask = 0 [node name="CollisionShape3D2" type="CollisionShape3D" parent="bear_model/test_cube/Bear_FX/Bear_fx_smash_hit/RigidBody3D" unique_id=1779197150] transform = Transform3D(0.99993557, -0.00749125, -0.010078691, 0.0077760145, 0.999569, 0.028562747, 0.009858355, -0.028639637, 0.9995405, -1.5136471, 0.9093375, 35.591957) diff --git a/addons/rider-plugin/bin/windows/~rider-gdextension.windows.editor.x86_64.dll b/addons/rider-plugin/bin/windows/~rider-gdextension.windows.editor.x86_64.dll new file mode 100644 index 0000000..31e7384 Binary files /dev/null and b/addons/rider-plugin/bin/windows/~rider-gdextension.windows.editor.x86_64.dll differ diff --git a/bear.gd b/bear.gd index c406d05..e2493eb 100644 --- a/bear.gd +++ b/bear.gd @@ -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 ─────────────────────────────────────────────────────────────── diff --git a/debug_params.gd b/debug_params.gd index 2ad75e5..f8f8889 100644 --- a/debug_params.gd +++ b/debug_params.gd @@ -203,6 +203,7 @@ func _register_all() -> void: # steps in during the swing (see bear_lunge_speed) rather than needing to be on top. _reg_f("Bear", "bear_close_range", 5.0, 1.0, 12.0, 0.1) _reg_f("Bear", "bear_mid_range", 10.0, 3.0, 20.0, 0.5) + _reg_f("Bear", "bear_long_range", 15.0, 3.0, 100.0, 0.5) # Beat spent in NEUTRAL sizing up the bull between routines — kept short so the bear # flows straight from one action into the next instead of pausing (raise for a more # hesitant, readable boss; near-0 for relentless pressure). Shrinks again in phase 2.