Cleric card done
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public class FreedomOfMovement : CharacterCombatBuffBase
|
||||
{
|
||||
public FreedomOfMovement(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Basic);
|
||||
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.onBeforePlayCard.Add(this.GetType().FullName, new PrioritizedAction<MainGame.Card.CardInstance, System.Collections.Generic.List<CharacterBase>>(OnBeforePlayCard));
|
||||
}
|
||||
|
||||
private void OnBeforePlayCard(MainGame.Card.CardInstance instance, List<CharacterBase> list)
|
||||
{
|
||||
if (instance.cardLogic.contentSubmodule.cardType == MainGame.Card.CardType.Power)
|
||||
{
|
||||
this.attachedCharacter.deckSubmodule.DrawCards(unitedStackSubmodule.stackAmount);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Freedom Of Movement", attachedCharacter.characterView);
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user