mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-18 01:06:47 +01:00
Implemented spell target relations.
This commit is contained in:
parent
8ac869ac1f
commit
f23ec89a58
@ -26,8 +26,6 @@ func _sstart_casting(info : SpellCastInfo) -> void:
|
||||
if needs_target and info.target == null:
|
||||
return
|
||||
|
||||
|
||||
|
||||
if info.caster.sis_casting():
|
||||
return
|
||||
|
||||
@ -37,6 +35,21 @@ func _sstart_casting(info : SpellCastInfo) -> void:
|
||||
if !info.caster.hass_spell_id(id):
|
||||
return
|
||||
|
||||
var entity_relation_type = info.caster.gets_relation_to(info.target)
|
||||
|
||||
var ok = false
|
||||
|
||||
if target_relation_type & TARGET_FRIENDLY or target_relation_type & TARGET_SELF:
|
||||
if entity_relation_type == EntityEnums.ENTITY_RELATION_TYPE_FRIENDLY or entity_relation_type == EntityEnums.ENTITY_RELATION_TYPE_NEUTRAL:
|
||||
ok = true
|
||||
|
||||
if target_relation_type & TARGET_ENEMY:
|
||||
if entity_relation_type == EntityEnums.ENTITY_RELATION_TYPE_HOSTILE:
|
||||
ok = true
|
||||
|
||||
if !ok:
|
||||
return
|
||||
|
||||
if cast_enabled:
|
||||
info.caster.sstart_casting(info)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user