CardBuff,Exhaustible

This commit is contained in:
SoulliesOfficial
2025-11-01 06:13:58 -04:00
parent ee1d3d9c0a
commit abc540809f
30 changed files with 395 additions and 46 deletions

View File

@@ -1,39 +1,72 @@
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 SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
namespace Continentis.Mods.Basic
{
public class Abundant : CardLogicBase
namespace Cards
{
protected override void SetUpLogicComponents()
public class Abundant : CardLogicBase
{
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
}
protected override CommandBase PlayEffect(List<CharacterBase> targetList)
{
CommandGroup mainGroup = new CommandGroup(ExecutionMode.Sequential,
new Cmd_PlayAnimation(user.characterView, "Skill"));
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
return mainGroup;
}
private bool SelectCondition(CardInstance card)
{
return card.cardLogic.contentSubmodule.cardType is CardType.Attack && card.cardLogic.HasKeyword("Magic");
}
private void SelectEffect(CardInstance card)
{
/*if (card.cardLogic.HasAttribute("Damage"))
protected override void SetUpLogicComponents()
{
card.cardLogic.ModifyAttribute("Damage", GetAttribute("DamageIncrease"));
}*/
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
}
protected override CommandBase PlayEffect(List<CharacterBase> targetList)
{
CommandGroup mainGroup = new CommandGroup(ExecutionMode.Sequential,
new Cmd_PlayAnimation(user.characterView, "Skill"));
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
return mainGroup;
}
private bool SelectCondition(CardInstance card)
{
return card.cardLogic.contentSubmodule.cardType is CardType.Attack && card.cardLogic.HasKeyword("Magic");
}
private void SelectEffect(CardInstance card)
{
CreateCardBuff<Buffs.Abundant>(GetAttribute("BuffStack_Abundant")).Apply(card.cardLogic, 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;
}
}
}
}