-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
18 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
extends SpellBase | ||
|
||
const PROJECTILE = preload("res://scenes/projectiles/fireball.tscn") | ||
const Fireball = preload("res://scenes/projectiles/fireball.tscn") | ||
|
||
func cast(player: Player, _enemies: Array[Node]): | ||
var projectile = PROJECTILE.instantiate() | ||
spawn_projectile(player, projectile) | ||
spawn_projectile(player, Fireball.instantiate()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
extends SpellBase | ||
|
||
const PROJECTILE = preload("res://scenes/projectiles/lightning.tscn") | ||
const Lightning = preload("res://scenes/projectiles/lightning.tscn") | ||
|
||
func cast(player: Player, _enemies: Array[Node]): | ||
var projectile = PROJECTILE.instantiate() | ||
spawn_projectile(player, projectile) | ||
spawn_projectile(player, Lightning.instantiate()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
extends SpellBase | ||
|
||
var effect_count | ||
var timer | ||
const DAMAGE_PER_SECOND := 2.0 | ||
|
||
func cast(_player: CharacterBody2D, enemies: Array[Node]): | ||
var spell_idx = SpellBook.Spells.RAIN_OF_BLOOD | ||
var spell_item_script = SpellBook.spell_item_scripts[spell_idx].new() | ||
var duration = spell_item_script.duration | ||
effect_count = duration | ||
var timer: Timer | ||
|
||
func cast(player: Player, enemies: Array[Node]): | ||
timer = Timer.new() | ||
timer.wait_time = 1.0 | ||
timer.timeout.connect(time_out.bind(enemies)) | ||
_player.add_child(timer) | ||
timer.timeout.connect(_time_out.bind(enemies)) | ||
player.add_child(timer) | ||
timer.start() | ||
|
||
func time_out(enemies: Array[Node]): | ||
if effect_count <= 0: timer.queue_free() | ||
func _time_out(enemies: Array[Node]): | ||
for enemy in enemies: | ||
enemy.take_damage(2.0) | ||
effect_count -= 1 | ||
enemy.take_damage(DAMAGE_PER_SECOND) | ||
|
||
func uncast(_player: Player, _enemies: Array[Node]): | ||
timer.queue_free() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
extends SpellBase | ||
|
||
const PROJECTILE = preload("res://scenes/projectiles/strike.tscn") | ||
const Strike = preload("res://scenes/projectiles/strike.tscn") | ||
|
||
func cast(player: Player, _enemies: Array[Node]): | ||
var projectile = PROJECTILE.instantiate() | ||
spawn_projectile(player, projectile) | ||
spawn_projectile(player, Strike.instantiate()) |