spiral swirl: fire swirl rotates outward as a pinwheel covering a wider area

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NTjSa2VgCtWZWVm573NB6
main
Artur David 2026-07-07 14:00:46 +02:00
parent 1c54f7f2db
commit 31b368bc65
2 changed files with 51 additions and 1 deletions

View File

@ -1,6 +1,9 @@
extends ProjectileBase
var _is_spread_child := false
var _spiral_rotation_rate: float = 0.0
var _lifetime: float = 0.0
var _max_lifetime: float = 0.0
const DIRS := [
Vector2(1, 0),
@ -17,11 +20,29 @@ func _on_body_entered(body: Node2D) -> void:
if body.is_in_group("enemies"):
body.take_damage(damage)
func _process(delta: float) -> void:
if _max_lifetime > 0.0:
_lifetime += delta
if _lifetime >= _max_lifetime:
queue_free()
return
if _spiral_rotation_rate != 0.0:
direction = direction.rotated(_spiral_rotation_rate * delta)
super(delta)
func _ready() -> void:
damage = 6
if _is_spread_child:
super()
return
var perk_effects = get_node("/root/Game/PerkEffects")
if perk_effects.get_mode("fire_swirl.cast") == "spiral":
_spawn_spiral()
else:
_spawn_burst()
queue_free()
func _spawn_burst() -> void:
var spawn_pos = global_position
for dir in DIRS:
var bullet = duplicate()
@ -29,4 +50,15 @@ func _ready() -> void:
get_parent().add_child(bullet)
bullet.global_position = spawn_pos
bullet.launch(spawn_pos + dir * 1000)
queue_free()
func _spawn_spiral() -> void:
var spawn_pos = global_position
for i in range(8):
var angle = TAU * float(i) / 8.0
var bullet = duplicate()
bullet._is_spread_child = true
bullet._spiral_rotation_rate = 2.0
bullet._max_lifetime = 3.0
get_parent().add_child(bullet)
bullet.global_position = spawn_pos
bullet.launch(spawn_pos + Vector2.from_angle(angle) * 1000)

View File

@ -12,6 +12,7 @@ var shuriken_tag_enabled = false
var tornado_push_on_cast = false
var tornado_fruit_collect = false
var laser_shuriken_on_kill = false
var _icon_fire_swirl: AtlasTexture
var throwing_knife_enabled = false
var throwing_knife_cooldown: float = 2.0
var throwing_knife_count: int = 1
@ -73,6 +74,10 @@ func _ready() -> void:
_icon_tornado.atlas = preload("res://assets/Free Effect Bullet Impact Explosion 32x32 V1/Purple Effect Bullet Impact Explosion 32x32.png")
_icon_tornado.region = Rect2(192, 0, 32, 32)
_icon_fire_swirl = AtlasTexture.new()
_icon_fire_swirl.atlas = preload("res://assets/Free Effect Bullet Impact Explosion 32x32 V1/Red Effect Bullet Impact Explosion 32x32.png")
_icon_fire_swirl.region = Rect2(352, 64, 32, 32)
var lrt = Perk.new()
lrt.name = "Laser Lock-On"
lrt.description = "Laser retargets to the next highest health enemy on kill"
@ -224,6 +229,16 @@ func _ready() -> void:
rw.effect = enable_tornado_push
available_perks.append(rw)
var ssp = Perk.new()
ssp.name = "Spiral Swirl"
ssp.description = "Fire Swirl fires all 8 swirls simultaneously in a rotating spiral pattern"
ssp.stats = _stat_toggle("Spiral")
ssp.spell = SpellLibrary.FIRE_SWIRL
ssp.archetype_slot = "fire_swirl.cast"
ssp.icon = _icon_fire_swirl
ssp.effect = enable_fire_swirl_spiral
available_perks.append(ssp)
var lsk = Perk.new()
lsk.name = "Chain Kill"
lsk.description = "Laser spawns a free Shuriken at every enemy it kills"
@ -278,6 +293,9 @@ func enable_tornado_fruit_collect() -> void:
func enable_laser_shuriken_on_kill() -> void:
laser_shuriken_on_kill = true
func enable_fire_swirl_spiral() -> void:
set_mode("fire_swirl.cast", "spiral")
func double_shuriken():
witch.shuriken_count += 2