midori-school/sprites/common/bullet/X11.gd

43 lines
1,009 B
GDScript3
Raw Normal View History

2024-03-24 19:23:12 +01:00
extends Area2D
var velocity: Vector2 = Vector2()
var direction
2024-03-24 20:41:04 +01:00
var speciality
2024-03-24 19:23:12 +01:00
var btype
# Called when the node enters the scene tree for the first time.
func _ready():
2024-03-31 20:39:39 +02:00
if is_in_group("players"):
speciality = Global.pcspecialities[Global.dparty[Global.dcpchar][0]]
2024-03-24 19:23:12 +01:00
add_to_group(btype)
#pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta):
pass
func _on_body_entered(body):if !body.is_in_group(btype):
if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"):
2024-03-24 20:41:04 +01:00
if body.weakness == speciality:
print("weakness")
2024-03-24 19:23:12 +01:00
#if body.is_in_group("players"):
# Global.live = 2
#elif body.is_in_group("enemies"):
# Global.live = 3
#elif body.is_in_group("boss"):
# Global.live = 3
#queue_free()
func _on_area_entered(area):
if !area.is_in_group(btype):
queue_free()
#pass # Replace with function body.
func _on_timer_timeout():
queue_free()