SpiritGuardian CounterAttack has bug
This commit is contained in:
@@ -37,5 +37,12 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
unitedStackSubmodule.ReduceStack(reducedStack);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
//TODO
|
||||
existingBuff = this;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public class CounterAttack : CharacterCombatBuffBase
|
||||
{
|
||||
public CounterAttack(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => actionCountSubmodule.remainingCount.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.onGetAttacked.Add(this.GetType().FullName, new PrioritizedAction<AttackResult>(atkResult =>
|
||||
{
|
||||
attachedCharacter.Attack(atkResult.attacker, unitedStackSubmodule.stackAmount, null, false, true);
|
||||
}));
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Counter Attack", 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: 4ed1ea7f3f7fad342a08a53bb00a0288
|
||||
@@ -14,31 +14,35 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString())
|
||||
.AddParameterGetter("Count", () => actionCountSubmodule.remainingCount.ToString());
|
||||
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
|
||||
this.actionCountSubmodule = new CountSubmodule(this, count);
|
||||
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onGetAttacked.Add("EstablishFormation", new PrioritizedAction<AttackResult>(atkResult =>
|
||||
{
|
||||
attachedCharacter.Attack(atkResult.attacker, unitedStackSubmodule.stackAmount, null, false, true);
|
||||
}));
|
||||
|
||||
this.eventSubmodule.onRoundStart.Add("EstablishFormation", new PrioritizedAction(() =>
|
||||
{
|
||||
this.Remove();
|
||||
}));
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.PickHigherStack(this.unitedStackSubmodule);
|
||||
existingBuff.actionCountSubmodule.PickHigherCount(this.actionCountSubmodule);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user