OnOtherBuffApply/Remove监听

This commit is contained in:
SoulliesOfficial
2025-11-10 12:57:04 -05:00
parent 41a0990600
commit 0e66d4d0dd
29 changed files with 321 additions and 27 deletions

View File

@@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: CardData_Basic_BladeOfFear
m_EditorClassIdentifier: Assembly-CSharp::Continentis.MainGame.Card.CardData
modName: Basic
categoryName:
className: BladeOfFear
displayName: Card_Basic_BladeOfFear_DisplayName
cardRarity: 20
@@ -42,7 +43,7 @@ MonoBehaviour:
Value: 5
index: 3
isKeyDuplicated: 0
- Key: BuffStack
- Key: BuffStack_Sharpness
Value: 5
index: 4
isKeyDuplicated: 0

View File

@@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: CardData_Basic_KnifeTrick
m_EditorClassIdentifier: Assembly-CSharp::Continentis.MainGame.Card.CardData
modName: Basic
categoryName:
className: KnifeTrick
displayName: Card_Basic_KnifeTrick_DisplayName
cardRarity: 20
@@ -38,7 +39,7 @@ MonoBehaviour:
Value: 0
index: 2
isKeyDuplicated: 0
- Key: BuffStack
- Key: BuffStack_KnifeTrick
Value: 4
index: 3
isKeyDuplicated: 0

View File

@@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: CardData_Basic_LessRestoration
m_EditorClassIdentifier:
modName: Basic
categoryName: Cleric
className: LessRestoration
displayName: Card_Basic_LessRestoration_DisplayName
cardRarity: 10

View File

@@ -2,14 +2,38 @@ using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using SLSFramework.General;
using System.Collections.Generic;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
namespace Continentis.Mods.Basic.Cards
{
public class BladeOfFear : CardLogicBase
{
protected override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
}
protected override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{
return base.PlayEffect(targetList);
base.PlayEffect(targetList);
CommandGroup mainGroup = TargetListCommandGroup(targetList,
new Cmd_PlayAnimation(user.characterView, "Attack"),
new Cmd_ParamFunction<CharacterBase>(0.2f, target =>
{
user.Attack(target, GetFinalDamage(target));
}));
mainGroup.AddCommand(new Cmd_Function(() =>
{
CreateCharacterBuff<Sharpness>(GetAttribute("BuffStack_Sharpness")).Apply(user, user, this);
}));
return new List<CommandBase> { mainGroup };
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
}
}
}

View File

@@ -2,6 +2,7 @@ using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using SLSFramework.General;
using System.Collections.Generic;
using Continentis.MainGame.Commands;
namespace Continentis.Mods.Basic.Cards
{
@@ -9,7 +10,14 @@ namespace Continentis.Mods.Basic.Cards
{
protected override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{
return base.PlayEffect(targetList);
CommandGroup mainGroup = new CommandGroup(ExecutionMode.Sequential,
new Cmd_PlayAnimation(user.characterView, "Skill"),
new Cmd_Function(() =>
{
CreateCharacterBuff<Buffs.KnifeTrick>(GetAttribute("BuffStack_KnifeTrick")).Apply(user, user, this);
}));
return new List<CommandBase> { mainGroup };
}
}
}

View File

@@ -5,7 +5,7 @@ using Continentis.MainGame.Commands;
using SLSFramework.General;
using System.Collections.Generic;
namespace Continentis.Mods.Basic.Cards
namespace Continentis.Mods.Basic.Cards.Cleric
{
public class LessRestoration : CardLogicBase
{

View File

@@ -4,10 +4,12 @@ using Continentis.MainGame.Character;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
using System.Collections.Generic;
using SLSFramework.UModAssistance;
using UnityEngine;
namespace Continentis.Mods.Basic.Buffs
{
public class KnifeTrick : CharacterCombatBuffBase, IBuffExtension_IntegerRange
public class KnifeTrick : CharacterCombatBuffBase
{
private bool _canTrigger = false;
@@ -17,10 +19,21 @@ namespace Continentis.Mods.Basic.Buffs
this.contentSubmodule = new ContentSubmodule(this, false)
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
this.iconSubmodule = new IconSubmodule(this);
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
this.eventSubmodule = new EventSubmodule(this);
this.eventSubmodule.onOtherBuffRemoved.Add("KnifeTrick_AddSharpness", new PrioritizedAction<BuffBase<CharacterBase>>((buff) =>
{
if (buff is Sharpness)
{
Debug.Log("Knife Trick observed Sharpness buff removal, adding new Sharpness buff.");
Debug.Log("Stack amount: " + unitedStackSubmodule.stackAmount);
CreateCharacterBuff<Sharpness>(unitedStackSubmodule.stackAmount).Apply(attachedCharacter, attachedCharacter);
}
}));
//TODO: Event listener for adding/removing buffs
//this.eventSubmodule.onPreAttack.Add("KnifeTrick", new PrioritizedAction<int>((damage) =>
//{
// if (this.attachedCharacter.combatBuffSubmodule.HasBuff<Sharpness>())
@@ -37,8 +50,6 @@ namespace Continentis.Mods.Basic.Buffs
// _canTrigger = false;
// }
//}));
(this as IBuffExtension_IntegerRange).Initialize(stack);
}
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)

View File

@@ -156,11 +156,11 @@ MonoBehaviour:
index: 24
isKeyDuplicated: 0
- Key: DeckCapacity
Value: 10
Value: 15
index: 25
isKeyDuplicated: 0
- Key: DrawCardAmountPerAction
Value: 10
Value: 15
index: 26
isKeyDuplicated: 0
- Key: Awareness
@@ -212,5 +212,6 @@ MonoBehaviour:
- CardData_Basic_BladeOfFear
- CardData_Basic_Backstab
- CardData_Basic_FlashTerror
- CardData_Basic_Strike
hudDataRefs:
- HUDData_Basic_Default

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 268144c5f2d60b345be49a779d58dadf
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant: