mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-25 01:17:10 +01:00
aura_script now inherits from gs_spell_script. Also updated spell script's handle_effect, to the new style.
This commit is contained in:
parent
7d57bbbd56
commit
197dbcc1e3
@ -7,6 +7,9 @@
|
|||||||
[resource]
|
[resource]
|
||||||
resource_name = "Nature's Swiftness"
|
resource_name = "Nature's Swiftness"
|
||||||
id = 7
|
id = 7
|
||||||
|
spell_type = 8
|
||||||
|
target_type = 0
|
||||||
|
target_relation_type = 7
|
||||||
icon = ExtResource( 3 )
|
icon = ExtResource( 3 )
|
||||||
text_name = "Nature's Swiftness"
|
text_name = "Nature's Swiftness"
|
||||||
aura_time = 10.0
|
aura_time = 10.0
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
extends Spell
|
extends "res://scripts/spells/gd_spell_script.gd"
|
||||||
class_name AuraGD
|
class_name AuraGD
|
||||||
|
|
||||||
# Copyright (c) 2019-2021 Péter Magyar
|
# Copyright (c) 2019-2021 Péter Magyar
|
||||||
|
@ -36,8 +36,9 @@ func _cast_starts(info : SpellCastInfo) -> void:
|
|||||||
if cooldown_global_cooldown_enabled and info.caster.gcd_hass() or info.caster.category_cooldown_hass(spell_type) or info.caster.cooldown_hass(id):
|
if cooldown_global_cooldown_enabled and info.caster.gcd_hass() or info.caster.category_cooldown_hass(spell_type) or info.caster.cooldown_hass(id):
|
||||||
return
|
return
|
||||||
|
|
||||||
if !info.caster.spell_hass_id(id):
|
# Todo Add source info to SpellCastInfo (player, item, spell, etc)
|
||||||
return
|
#if !info.caster.spell_hass_id(id):
|
||||||
|
# return
|
||||||
|
|
||||||
var entity_relation_type = info.caster.gets_relation_to(info.target)
|
var entity_relation_type = info.caster.gets_relation_to(info.target)
|
||||||
|
|
||||||
@ -173,38 +174,56 @@ func handle_effect(info : SpellCastInfo) -> void:
|
|||||||
|
|
||||||
handle_spell_heal(shi)
|
handle_spell_heal(shi)
|
||||||
|
|
||||||
for aura in spells_cast_on_caster:
|
if is_aura():
|
||||||
var ainfo : AuraApplyInfo = AuraApplyInfo.new()
|
var ad : AuraData = AuraData.new()
|
||||||
|
|
||||||
ainfo.caster = info.caster
|
if aura_get_aura_group():
|
||||||
ainfo.target = info.caster
|
ad = info.target.aura_gets_with_group_by_bind(info.caster, aura_get_aura_group())
|
||||||
ainfo.spell_scale = 1
|
|
||||||
ainfo.aura = aura
|
|
||||||
|
|
||||||
aura.aura_sapply(ainfo)
|
|
||||||
|
|
||||||
if info.target != null:
|
|
||||||
for aura in spells_cast_on_target:
|
|
||||||
var ad : AuraData = null
|
|
||||||
|
|
||||||
if aura.aura_group != null:
|
|
||||||
ad = info.target.aura_gets_with_group_by(info.caster, aura.aura_group)
|
|
||||||
else:
|
else:
|
||||||
ad = info.target.aura_gets_by(info.caster, aura.get_id())
|
ad = info.target.aura_gets_by(info.caster, id)
|
||||||
|
|
||||||
if ad != null:
|
if ad:
|
||||||
info.target.aura_removes_exact(ad)
|
info.target.aura_removes_exact(ad)
|
||||||
|
|
||||||
var ainfo : AuraApplyInfo = AuraApplyInfo.new()
|
var aai : AuraApplyInfo = AuraApplyInfo.new()
|
||||||
|
|
||||||
ainfo.caster = info.caster
|
aai.caster_set(info.caster)
|
||||||
ainfo.target = info.target
|
aai.target_set(info.target)
|
||||||
ainfo.spell_scale = 1
|
aai.spell_scale_set(info.spell_scale)
|
||||||
ainfo.aura = aura
|
aai.set_aura(self)
|
||||||
|
|
||||||
aura.aura_sapply(ainfo)
|
aura_sapply(aai)
|
||||||
|
|
||||||
|
for spell in spells_cast_on_caster:
|
||||||
|
if !spell:
|
||||||
|
continue
|
||||||
|
|
||||||
|
var sci : SpellCastInfo = SpellCastInfo.new()
|
||||||
|
|
||||||
|
sci.caster = info.caster
|
||||||
|
sci.target = info.caster
|
||||||
|
sci.has_cast_time = spell.cast_enabled
|
||||||
|
sci.cast_time = spell.cast_cast_time
|
||||||
|
sci.spell_scale = info.spell_scale
|
||||||
|
sci.set_spell(spell)
|
||||||
|
|
||||||
|
spell.cast_starts(sci)
|
||||||
|
|
||||||
|
if info.target != null:
|
||||||
|
for spell in spells_cast_on_target:
|
||||||
|
if !spell:
|
||||||
|
continue
|
||||||
|
|
||||||
|
var sci : SpellCastInfo = SpellCastInfo.new()
|
||||||
|
|
||||||
|
sci.caster = info.caster
|
||||||
|
sci.target = info.target
|
||||||
|
sci.has_cast_time = spell.cast_enabled
|
||||||
|
sci.cast_time = spell.cast_cast_time
|
||||||
|
sci.spell_scale = info.spell_scale
|
||||||
|
sci.set_spell(spell)
|
||||||
|
|
||||||
|
spell.cast_starts(sci)
|
||||||
|
|
||||||
func handle_cooldown(info : SpellCastInfo) -> void:
|
func handle_cooldown(info : SpellCastInfo) -> void:
|
||||||
if cooldown_cooldown > 0:
|
if cooldown_cooldown > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user