Combat overhaul: charge/gore, bear ram, matador taunt reactions
Bull charge damage: - Tunnel-proof swept detection (prev→now segment) for matador gore and bear ram, so a 66 m/s dash no longer skips clean over the thin HitArea. - Horns-first cone (bull_gore_arc): running into an enemy only wounds it when charging roughly at it, not a sideways brush. - Dash is a committed lunge: bypasses the horns cone AND the survival roll, so a dash connect is a guaranteed kill. Cruise charges keep a speed-scaled roll (mat_charge_pierce). Roll ability defers to its own pop (is_rolling guard). Bear: - Horns-first swept ram detection (edge-triggered: one charge = one wound); a tunnelling or point-blank charge now lands where body_entered wouldn't. - Overhead smash lane extends faster (0.1s) and further (20 m). - Leap slam launches the bull from anywhere in the circle (ring_frac 0). - Removed stray-quote syntax errors that broke the script. Matador: - Collider-driven stab (BladeHitbox) with recovery beat + taunt-after-hit so it stops machine-gunning the bull. - A taunting matador answers a charge: spear from range, sword up close. Spear projectile masks the BULL layer so throws connect. Tests: matador_charge/stab/spear/taunt_react, bear_ram/hitbox/fx (+ unified _fake_bull stand-in). Trimmed verbose comments. Note: bear claw-emitter/death work is still WIP (3 bear_boss_test failures). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+25
-2
@@ -10,6 +10,8 @@ extends RigidBody3D
|
||||
# (see shed_all, which the bull's slam calls to fling them all off); other hits pin
|
||||
# it in place until the despawn timer clears it.
|
||||
|
||||
const PhysicsLayers = preload("res://physics_layers.gd")
|
||||
|
||||
const _DESPAWN_SEC: float = 8.0
|
||||
const _STUCK_GROUP: StringName = &"stuck_spear"
|
||||
# Shaft geometry in spear.glb local space: tip at +Z, butt behind the origin.
|
||||
@@ -34,16 +36,25 @@ static func launch(parent: Node, mesh: Node3D, origin: Vector3, velocity: Vector
|
||||
var s := SpearProjectile.new()
|
||||
s.gravity_scale = gravity
|
||||
s.collision_layer = 0
|
||||
s.collision_mask = 1
|
||||
# Mask WORLD so a miss sticks in the arena, and BULL so it can actually hit the
|
||||
# bull — the bull's body is on layer BULL, not WORLD, so a WORLD-only mask flew
|
||||
# straight through it (every throw whiffed, even against a stationary bull).
|
||||
s.collision_mask = PhysicsLayers.WORLD | PhysicsLayers.BULL
|
||||
s.contact_monitor = true
|
||||
s.max_contacts_reported = 6
|
||||
parent.add_child(s)
|
||||
# Seat the body so its local +Z (the shaft, see spear.glb) points along the throw.
|
||||
s.global_transform = Transform3D(_aim_basis(velocity), origin)
|
||||
# Take the editor-tweakable collider from the spear wrapper (Spear.tscn's HitShape)
|
||||
# before reparenting, then drop the now-nested template.
|
||||
var collider := _collider_from(mesh)
|
||||
mesh.reparent(s, false)
|
||||
mesh.transform = Transform3D.IDENTITY
|
||||
s._mesh = mesh
|
||||
s.add_child(_shaft_collider())
|
||||
var tmpl := mesh.get_node_or_null("HitShape")
|
||||
if tmpl != null:
|
||||
tmpl.queue_free()
|
||||
s.add_child(collider)
|
||||
s.linear_velocity = velocity
|
||||
_despawn(s)
|
||||
return s
|
||||
@@ -84,6 +95,18 @@ static func shed_all(bull: Node) -> void:
|
||||
_despawn(rb)
|
||||
|
||||
|
||||
# Clone the wrapper's editor-tweakable HitShape (Spear.tscn) into a fresh CollisionShape3D
|
||||
# for the projectile body; falls back to the built-in shaft collider if it's missing.
|
||||
static func _collider_from(source: Node) -> CollisionShape3D:
|
||||
var tmpl := source.get_node_or_null("HitShape") as CollisionShape3D
|
||||
if tmpl != null and tmpl.shape != null:
|
||||
var cs := CollisionShape3D.new()
|
||||
cs.shape = tmpl.shape
|
||||
cs.transform = tmpl.transform
|
||||
return cs
|
||||
return _shaft_collider()
|
||||
|
||||
|
||||
static func _shaft_collider() -> CollisionShape3D:
|
||||
# Collider along local +Z (mesh runs z≈-0.34 … 1.92), fattened so a fast throw
|
||||
# can't tunnel past the bull's collision spheres.
|
||||
|
||||
Reference in New Issue
Block a user