4.6, new attack, enemy spawning, shaders, bunch of stuff

This commit is contained in:
Daniel Kauss Serna 2026-02-17 01:24:05 +01:00
parent e08e3ebb13
commit 19517a3176
84 changed files with 13348 additions and 91399 deletions

View file

@ -6,7 +6,7 @@ enum MaskType { MELEE, RANGED, SPIT }
@export var mask_name: String
@export var texture: Texture2D
@export var drop_texture: Texture2D
@export var spawn_sfx : String
@export var spawn_sfx : Resource
@export_group("Combat")
@export var attack_scene: PackedScene
@ -18,22 +18,23 @@ func activate(attacker: Node2D, target_pos: Vector2) -> void:
if not attack_scene:
return
var atk = attack_scene.instantiate()
var atk : MaskAbility = attack_scene.instantiate()
if is_parented_to_attacker:
attacker.add_child(atk)
atk.position = Vector2.ZERO
else:
attacker.get_parent().add_child(atk)
atk.global_position = attacker.global_position
atk.look_at(target_pos)
if atk.get("start_position"):
atk.start_position = attacker.global_position
atk.target_position = target_pos
if atk.has_method("set_from_player"):
atk.set_from_player(attacker.is_in_group("player"))
atk.position = attacker.position
atk.start_position = attacker.position
atk.target_position = target_pos
var from_player = attacker.is_in_group("player")
atk.from_player = from_player
if not from_player:
atk.modulate = Color("#0000ff")
atk.mask_ready()
SoundManager.play_sfx(spawn_sfx)