mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-18 01:06:47 +01:00
AIs now wont go on top of their target.
This commit is contained in:
parent
79f5ffd084
commit
8ac869ac1f
@ -29,6 +29,9 @@ var _data : Dictionary = {
|
|||||||
"spells": []
|
"spells": []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
pass
|
||||||
|
|
||||||
func _on_set_owner():
|
func _on_set_owner():
|
||||||
if not is_instance_valid(owner):
|
if not is_instance_valid(owner):
|
||||||
return
|
return
|
||||||
@ -112,13 +115,16 @@ func attack(delta):
|
|||||||
cast = true
|
cast = true
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
if owner.sis_casting():
|
if owner.sis_casting():
|
||||||
owner.target_movement_direction = Vector2()
|
owner.target_movement_direction = Vector2()
|
||||||
return
|
return
|
||||||
|
|
||||||
var dir : Vector3 = target.get_body().translation - owner.get_body().translation
|
owner.target_movement_direction = Vector2()
|
||||||
|
|
||||||
|
var dir : Vector3 = target.get_body().translation - owner.get_body().translation
|
||||||
|
var l = dir.length()
|
||||||
|
|
||||||
|
if l > 2.5:
|
||||||
owner.target_movement_direction = Vector2(dir.x, dir.z)
|
owner.target_movement_direction = Vector2(dir.x, dir.z)
|
||||||
|
|
||||||
func sort_spells_by_rank(a, b):
|
func sort_spells_by_rank(a, b):
|
||||||
|
Loading…
Reference in New Issue
Block a user