feat: implement Candy Cannon mechanics, CI/CD pipelines, and version 2.3.7 updates

This commit is contained in:
2026-05-25 18:17:00 +08:00
parent 7380161743
commit f2f90f98e2
20 changed files with 952 additions and 36 deletions
@@ -0,0 +1,47 @@
extends Node3D
class_name CandyCannonController
@export var is_static_turret: bool = true
func _ready() -> void:
pass
@rpc("authority", "call_local", "reliable")
func play_animation_rpc(anim_name: String) -> void:
# Stub for future model animations
pass
@rpc("authority", "call_local", "reliable")
func spawn_projectile_rpc(target_world_pos: Vector3, duration: float) -> void:
var projectile = MeshInstance3D.new()
var sphere = BoxMesh.new()
sphere.size = Vector3(0.4, 0.4, 0.4)
projectile.mesh = sphere
var mat = StandardMaterial3D.new()
mat.albedo_color = Color(1.0, 0.4, 0.8) # Candy pink for Gauntlet
projectile.material_override = mat
get_tree().get_root().add_child(projectile)
# Start projectile slightly above the cannon center
projectile.global_position = global_position + Vector3(0, 2.0, 0)
var tween = create_tween()
if not tween:
projectile.queue_free()
return
tween.set_parallel(true)
tween.tween_property(projectile, "global_position:x", target_world_pos.x, duration).set_trans(Tween.TRANS_LINEAR)
tween.tween_property(projectile, "global_position:z", target_world_pos.z, duration).set_trans(Tween.TRANS_LINEAR)
var mid_y = max(global_position.y, target_world_pos.y) + 4.0
var tween_y = create_tween()
tween_y.tween_property(projectile, "global_position:y", mid_y, duration / 2.0).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_OUT)
tween_y.tween_property(projectile, "global_position:y", target_world_pos.y, duration / 2.0).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN).set_delay(duration / 2.0)
tween.chain().tween_callback(projectile.queue_free)
func can_rpc() -> bool:
if not multiplayer.has_multiplayer_peer(): return false
return multiplayer.multiplayer_peer.get_connection_status() == MultiplayerPeer.CONNECTION_CONNECTED