CardBuff,Exhaustible
This commit is contained in:
8
Assets/Mods/Basic/Cards/Scripts/Cleric.meta
Normal file
8
Assets/Mods/Basic/Cards/Scripts/Cleric.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a410ef469d4ae7a4f9595394751c7236
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
26
Assets/Mods/Basic/Cards/Scripts/Cleric/LessRestoration.cs
Normal file
26
Assets/Mods/Basic/Cards/Scripts/Cleric/LessRestoration.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
public class LessRestoration : CardLogicBase
|
||||
{
|
||||
protected override CommandBase PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup mainGroup = TargetListCommandGroup(targetList,
|
||||
new Cmd_PlayAnimation(user.characterView, "Skill"),
|
||||
new Cmd_ParamFunction<CharacterBase>(0.1f, target =>
|
||||
{
|
||||
target.Heal(GetAttribute("HealAmount"));
|
||||
target.combatBuffSubmodule.Dispel(BuffDispelLevel.Basic, user);
|
||||
}));
|
||||
|
||||
return mainGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f7dd98409993714c963704f02449599
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user