1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-22 08:04:23 +00:00

Change the type of current_monster to PhysicsBody2D

This commit is contained in:
Steffo 2024-04-28 11:09:31 +02:00
parent ce0df48674
commit 26132848c2
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -2,14 +2,14 @@ extends Node2D
class_name SacrificeStone class_name SacrificeStone
signal sacrifice_changed(entity: Node2D, type: Enums.MonsterType) signal sacrifice_changed(entity: PhysicsBody2D, type: Enums.MonsterType)
var current_monster: Node2D var current_monster: PhysicsBody2D
var current_type: Enums.MonsterType = Enums.MonsterType.None var current_type: Enums.MonsterType = Enums.MonsterType.None
func _on_tracked(body: Node2D): func _on_tracked(body: PhysicsBody2D):
if current_monster != null: if current_monster != null:
Log.w(self, "Captured two entities") Log.w(self, "Captured two entities")
return return
@ -24,7 +24,7 @@ func _on_tracked(body: Node2D):
if current_monster == null: if current_monster == null:
Log.w(self, "Captured entity with no MonsterType") Log.w(self, "Captured entity with no MonsterType")
func _on_untracked(body: Node2D): func _on_untracked(body: PhysicsBody2D):
if body == current_monster: if body == current_monster:
current_monster = null current_monster = null
current_type = Enums.MonsterType.None current_type = Enums.MonsterType.None