AttackResult修改
This commit is contained in:
@@ -1,18 +1,32 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public class WoundDeterioration : CharacterCombatBuffBase
|
||||
{
|
||||
public WoundDeterioration(int stack)
|
||||
private int damageCount;
|
||||
|
||||
public WoundDeterioration(int stack, int damageCount)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Basic);
|
||||
this.damageCount = damageCount;
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString())
|
||||
.AddParameterGetter("DamageCount", damageCount.ToString);
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onDealAttack.Add("WoundDeterioration", new PrioritizedAction<AttackResult>(atkRes =>
|
||||
{
|
||||
if (atkRes.hurtDamage >= 20)
|
||||
{
|
||||
CreateCharacterBuff<Corrosion>(this.unitedStackSubmodule.stackAmount).Apply(atkRes.target, atkRes.attacker);
|
||||
}
|
||||
}));
|
||||
//TODO: When character damage exceed 20, apply corrision
|
||||
//this.attachedCharacter.eventSubmodule.onFinishAttack.Add;
|
||||
}
|
||||
@@ -23,8 +37,10 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
WoundDeterioration existing = existingBuff as WoundDeterioration;
|
||||
|
||||
existingBuff.unitedStackSubmodule.PickHigherStack(this.unitedStackSubmodule);
|
||||
existingBuff.actionCountSubmodule.PickHigherCount(this.actionCountSubmodule);
|
||||
existing!.damageCount = Mathf.Min(existing.damageCount, this.damageCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
private void OnGetAttacked(AttackResult result)
|
||||
{
|
||||
int stackAmount = unitedStackSubmodule.stackAmount;
|
||||
result.attacker.Attack(attachedCharacter, stackAmount, false, true);
|
||||
result.attacker.Attack(attachedCharacter, stackAmount, null, false, true);
|
||||
}
|
||||
|
||||
private void OnActionStart()
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
private void OnAfterPlayCard(CardInstance card, List<CharacterBase> targets)
|
||||
{
|
||||
sourceCharacter.Attack(attachedCharacter, unitedStackSubmodule.stackAmount, false, true);
|
||||
sourceCharacter.Attack(attachedCharacter, unitedStackSubmodule.stackAmount, null, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
private void OnActionStart()
|
||||
{
|
||||
sourceCharacter.Attack(attachedCharacter, unitedStackSubmodule.stackAmount, false, true);
|
||||
sourceCharacter.Attack(attachedCharacter, unitedStackSubmodule.stackAmount, null, false, true);
|
||||
unitedStackSubmodule.ReduceStack(1);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onGetAttacked.Add("EstablishFormation", new PrioritizedAction<AttackResult>(atkResult =>
|
||||
{
|
||||
attachedCharacter.Attack(atkResult.attacker, unitedStackSubmodule.stackAmount, false, true);
|
||||
attachedCharacter.Attack(atkResult.attacker, unitedStackSubmodule.stackAmount, null, false, true);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
private void OnAfterPlayCard(CardInstance card, List<CharacterBase> targets)
|
||||
{
|
||||
int reducedStack = Mathf.Max(1, Mathf.FloorToInt(unitedStackSubmodule.stackAmount * 0.2f));
|
||||
sourceCharacter.Attack(attachedCharacter, reducedStack, true);
|
||||
sourceCharacter.Attack(attachedCharacter, reducedStack, null, true);
|
||||
unitedStackSubmodule.ReduceStack(reducedStack);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
@@ -206,5 +206,6 @@ MonoBehaviour:
|
||||
- CardData_Basic_Torture
|
||||
- CardData_Basic_CompoundPosion
|
||||
- CardData_Basic_WoundDeterioration
|
||||
- CardData_Basic_DivineSmite
|
||||
hudDataRefs:
|
||||
- HUDData_Basic_Default
|
||||
|
||||
Reference in New Issue
Block a user