repulsion wave: tornado cast blasts all enemies away from the witch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017NTjSa2VgCtWZWVm573NB6main
parent
7743a9b8d2
commit
4ce2603d40
|
|
@ -22,6 +22,10 @@ signal died
|
|||
var xp = 1
|
||||
var explosion_scene = preload("res://scenes/explosion.tscn")
|
||||
var is_tagged: bool = false
|
||||
var _push_velocity: Vector2 = Vector2.ZERO
|
||||
|
||||
func apply_push(dir: Vector2, strength: float) -> void:
|
||||
_push_velocity = dir * strength
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("enemies")
|
||||
|
|
@ -109,6 +113,11 @@ func _chase_witch() -> void:
|
|||
if direction != Vector2.ZERO:
|
||||
last_direction = direction
|
||||
velocity = direction * speed
|
||||
if _push_velocity != Vector2.ZERO:
|
||||
velocity += _push_velocity
|
||||
_push_velocity *= 0.82
|
||||
if _push_velocity.length() < 5.0:
|
||||
_push_velocity = Vector2.ZERO
|
||||
|
||||
if direction == Vector2.ZERO:
|
||||
animated_sprite_2d.play("idle")
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ var available_perks: Array[Perk] = []
|
|||
var spell_modes: Dictionary = {}
|
||||
var laser_retarget_enabled = false
|
||||
var shuriken_tag_enabled = false
|
||||
var tornado_push_on_cast = false
|
||||
var throwing_knife_enabled = false
|
||||
var throwing_knife_cooldown: float = 2.0
|
||||
var throwing_knife_count: int = 1
|
||||
|
|
@ -198,6 +199,15 @@ func _ready() -> void:
|
|||
bh.effect = battle_hardened
|
||||
available_perks.append(bh)
|
||||
|
||||
var rw = Perk.new()
|
||||
rw.name = "Repulsion Wave"
|
||||
rw.description = "Casting Tornado blasts all enemies away from the witch"
|
||||
rw.stats = _stat_toggle("Push on Cast")
|
||||
rw.spell = SpellLibrary.TORNADO
|
||||
rw.icon = _icon_fireball
|
||||
rw.effect = enable_tornado_push
|
||||
available_perks.append(rw)
|
||||
|
||||
var mp = Perk.new()
|
||||
mp.name = "Marked Prey"
|
||||
mp.description = "Shuriken marks enemies. The next spell that hits them triggers an extra explosion"
|
||||
|
|
@ -234,6 +244,9 @@ func laser_retarget():
|
|||
func enable_marked_prey() -> void:
|
||||
shuriken_tag_enabled = true
|
||||
|
||||
func enable_tornado_push() -> void:
|
||||
tornado_push_on_cast = true
|
||||
|
||||
func double_shuriken():
|
||||
witch.shuriken_count += 2
|
||||
|
||||
|
|
|
|||
|
|
@ -150,6 +150,11 @@ func shoot_shuriken():
|
|||
|
||||
func shoot_tornado():
|
||||
StatsManager.on_spell_cast("tornado")
|
||||
if perk_effects.tornado_push_on_cast:
|
||||
for enemy in get_tree().get_nodes_in_group("enemies"):
|
||||
if is_instance_valid(enemy) and not enemy.is_dying:
|
||||
var push_dir = global_position.direction_to(enemy.global_position)
|
||||
enemy.apply_push(push_dir, 500.0)
|
||||
var target = get_nearest_enemy(global_position)
|
||||
var tw = tornado.instantiate()
|
||||
tw.global_position = target.global_position if target != null else global_position
|
||||
|
|
|
|||
Loading…
Reference in New Issue