更新
This commit is contained in:
69
Assets/Mods/Basic/Cards/Scripts/Mage/Obsolete/Abundant.cs
Normal file
69
Assets/Mods/Basic/Cards/Scripts/Mage/Obsolete/Abundant.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic
|
||||
{
|
||||
namespace Cards
|
||||
{
|
||||
public class Abundant : CardLogicBase
|
||||
{
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup mainGroup = Cmd.Sequential(new Cmd_PlayAnimation(user.characterView, "Skill"));
|
||||
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
|
||||
return mainGroup;
|
||||
}
|
||||
|
||||
private bool SelectCondition(CardInstance card)
|
||||
{
|
||||
return card.contentSubmodule.cardType is CardType.Attack && card.HasKeyword("Magic");
|
||||
}
|
||||
|
||||
private void SelectEffect(CardInstance card)
|
||||
{
|
||||
CreateCardBuff<Buffs.Abundant>(GetAttribute("BuffStack_Abundant")).Apply(card, user, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Buffs
|
||||
{
|
||||
public class Abundant : CardCombatBuffBase
|
||||
{
|
||||
public Abundant(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this);
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack);
|
||||
|
||||
this.attributeSubmodule = new AttributeSubmodule(this);
|
||||
this.attributeSubmodule.numericChange.Add("Damage", stack);
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CardCombatBuffBase existingBuff)
|
||||
{
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
|
||||
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
|
||||
existingBuff.attributeSubmodule.numericChange["Damage"] = newStack;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user