-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHealSpell.cs
More file actions
30 lines (26 loc) · 1019 Bytes
/
HealSpell.cs
File metadata and controls
30 lines (26 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "Battle/Attack/Spell/HealSpell")]
public class HealSpell : Spell
{
[SerializeField]
private int _buffValue = 0;
public int BuffValue { get => _buffValue; }
[SerializeField]
private int _buffDuration = 0;
public int BuffDuration { get => _buffDuration; }
public override void Activate(BattleCharacter attacker, BattleCharacter defender)
{
int healAmount = BaseValue + (int)(attacker.stats.magicDamage.GetValue() * SpellMultiplier);
attacker.controller.CastDefensive();
attacker.GainHealth(healAmount);
ApplyBuffs(attacker, BuffDuration, BuffValue);
attacker.onAttackComplete?.Invoke();
}
public void ActivateOutOfBattle(Character attacker)
{
int healAmount = BaseValue + (int)(attacker.stats.magicDamage.GetValue() * SpellMultiplier);
attacker.GainHealth(healAmount);
}
}