52 lines
2.0 KiB
C#
52 lines
2.0 KiB
C#
using System.Collections.Generic;
|
|
using Continentis.MainGame;
|
|
using Continentis.MainGame.Card;
|
|
using Continentis.MainGame.Character;
|
|
using Continentis.MainGame.Combat;
|
|
using SLSFramework.General;
|
|
using UnityEngine;
|
|
|
|
namespace Continentis.Mods.Basic.Buffs
|
|
{
|
|
public class FlameInscription : CharacterCombatBuffBase
|
|
{
|
|
public FlameInscription(int stack)
|
|
{
|
|
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
|
|
|
this.contentSubmodule = new ContentSubmodule(this)
|
|
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
|
|
|
this.iconSubmodule = new IconSubmodule(this);
|
|
|
|
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
|
|
|
this.eventSubmodule = new EventSubmodule(this);
|
|
this.eventSubmodule.onAfterPlayCard.Add("FlameInscription",
|
|
new PrioritizedAction<CardInstance, List<CharacterBase>>((card, targets) =>
|
|
{
|
|
if (card.contentSubmodule.cardType == CardType.Attack && card.HasKeyword("Magic"))
|
|
{
|
|
List<CharacterBase> enemies = CombatMainManager.Instance.characterController.GetAllEnemies(attachedCharacter);
|
|
foreach (CharacterBase enemy in enemies)
|
|
{
|
|
CreateCharacterBuff<Burn>(unitedStackSubmodule.stackAmount).Apply(enemy, attachedCharacter);
|
|
}
|
|
}
|
|
}));
|
|
}
|
|
|
|
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
|
{
|
|
MainGameManager.Instance.basePrefabs.GenerateInfoText(contentSubmodule.displayName, attachedCharacter.characterView);
|
|
|
|
if (FindExistingSameBuff(out existingBuff))
|
|
{
|
|
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
} |