More cards
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSFramework.General;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public class KnifeTrick : CharacterCombatBuffBase, IBuffExtension_IntegerRange
|
||||
{
|
||||
private bool _canTrigger = false;
|
||||
|
||||
public KnifeTrick(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
this.contentSubmodule = new ContentSubmodule(this, false)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
|
||||
//TODO: Event listener for adding/removing buffs
|
||||
|
||||
//this.eventSubmodule.onPreAttack.Add("KnifeTrick", new PrioritizedAction<int>((damage) =>
|
||||
//{
|
||||
// if (this.attachedCharacter.combatBuffSubmodule.HasBuff<Sharpness>())
|
||||
// {
|
||||
// _canTrigger = true;
|
||||
// }
|
||||
//}));
|
||||
|
||||
//this.eventSubmodule.onDealAttack.Add("KnifeTrick", new PrioritizedAction<AttackResult>((result) =>
|
||||
//{
|
||||
// if (_canTrigger)
|
||||
// {
|
||||
// CreateCharacterBuff<Sharpness>(this.unitedStackSubmodule.stackAmount).Apply(this.attachedCharacter, this.attachedCharacter);
|
||||
// _canTrigger = false;
|
||||
// }
|
||||
//}));
|
||||
|
||||
(this as IBuffExtension_IntegerRange).Initialize(stack);
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Knife Trick", attachedCharacter.characterView);
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
|
||||
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
|
||||
existingBuff.coreAttributeSubmodule.numericChange["DodgeChanceOffset"] = newStack;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44b807e0cc85f4f438e1840542e98324
|
||||
@@ -0,0 +1,51 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public class Sharpness : CharacterCombatBuffBase, IBuffExtension_IntegerRange
|
||||
{
|
||||
public Sharpness(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this, false)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack, true);
|
||||
|
||||
this.coreAttributeSubmodule = new CoreAttributeSubmodule(this);
|
||||
this.coreAttributeSubmodule.numericChange.Add("PhysicsDamageDealtOffset", stack);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onDealAttack.Add("Sharpness", new PrioritizedAction<AttackResult>(atkRes =>
|
||||
{
|
||||
if (atkRes.attacker.combatBuffSubmodule.HasBuff<Sharpness>())
|
||||
{
|
||||
atkRes.attacker.combatBuffSubmodule.GetBuff<Sharpness>().Remove();
|
||||
}
|
||||
}));
|
||||
|
||||
(this as IBuffExtension_IntegerRange).Initialize(stack);
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Sharpness", attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
|
||||
|
||||
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
|
||||
existingBuff.coreAttributeSubmodule.numericChange["PhysicsDamageDealtOffset"] = newStack;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3269dfba0fee4fa4ea1eeecb87b9f71b
|
||||
Reference in New Issue
Block a user