Files
Continentis/Assets/Mods/Basic/Cards/Scripts/Mage/Abundant.cs

72 lines
2.5 KiB
C#
Raw Normal View History

2025-10-31 10:02:30 -04:00
using System.Collections.Generic;
2025-11-01 06:13:58 -04:00
using Continentis.MainGame;
2025-10-31 10:02:30 -04:00
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
2025-11-01 06:13:58 -04:00
using Continentis.Mods.Basic.Buffs;
2025-10-31 10:02:30 -04:00
using SLSFramework.General;
using UnityEngine;
2025-11-01 06:13:58 -04:00
namespace Continentis.Mods.Basic
2025-10-31 10:02:30 -04:00
{
2025-11-01 06:13:58 -04:00
namespace Cards
2025-10-31 10:02:30 -04:00
{
2025-11-01 06:13:58 -04:00
public class Abundant : CardLogicBase
2025-10-31 10:02:30 -04:00
{
2025-11-15 12:17:34 -05:00
public override void SetUpLogicComponents()
2025-11-01 06:13:58 -04:00
{
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
}
2025-11-15 12:17:34 -05:00
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
2025-11-01 06:13:58 -04:00
{
CommandGroup mainGroup = new CommandGroup(ExecutionMode.Sequential,
new Cmd_PlayAnimation(user.characterView, "Skill"));
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
2025-11-08 09:50:55 -05:00
return new List<CommandBase> { mainGroup };
2025-11-01 06:13:58 -04:00
}
private bool SelectCondition(CardInstance card)
{
2025-11-15 12:17:34 -05:00
return card.contentSubmodule.cardType is CardType.Attack && card.HasKeyword("Magic");
2025-11-01 06:13:58 -04:00
}
private void SelectEffect(CardInstance card)
{
2025-11-15 12:17:34 -05:00
CreateCardBuff<Buffs.Abundant>(GetAttribute("BuffStack_Abundant")).Apply(card, user, this);
2025-11-01 06:13:58 -04:00
}
2025-10-31 10:02:30 -04:00
}
2025-11-01 06:13:58 -04:00
}
namespace Buffs
{
public class Abundant : CardCombatBuffBase
2025-10-31 10:02:30 -04:00
{
2025-11-01 06:13:58 -04:00
public Abundant(int stack)
{
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
this.contentSubmodule = new ContentSubmodule(this);
2025-10-31 10:02:30 -04:00
2025-11-01 06:13:58 -04:00
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack);
this.attributeSubmodule = new AttributeSubmodule(this);
this.attributeSubmodule.numericChange.Add("Damage", stack);
}
2025-10-31 10:02:30 -04:00
2025-11-01 06:13:58 -04:00
public override bool OnBuffApply(out CardCombatBuffBase existingBuff)
2025-10-31 10:02:30 -04:00
{
2025-11-01 06:13:58 -04:00
if (FindExistingSameBuff(out existingBuff))
{
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
existingBuff.attributeSubmodule.numericChange["Damage"] = newStack;
return false;
}
return true;
}
2025-10-31 10:02:30 -04:00
}
}
}