This commit is contained in:
SoulliesOfficial
2026-05-27 15:15:28 -04:00
parent 76f498ae2b
commit 72756712f7
669 changed files with 5361 additions and 12268 deletions

View File

@@ -18,13 +18,21 @@ namespace Cielonos.MainGame.Characters
[ShowInInspector]
public bool isPerfectBlocking => blockSources.Any(source => source.hasPerfectBlock && source.isDuringPerfectBlock);
public float afterPerfectBlockTimer;
public float afterNormalBlockTimer;
public Timer afterPerfectBlockTimer;
public CharacterBase perfectBlockedTarget;
public Timer afterNormalBlockTimer;
public CharacterBase normalBlockedTarget;
public BlockSubmodule(ReactionSubcontroller owner) : base(owner)
{
blockSources = new List<BlockSource>();
canBlock = true;
this.afterPerfectBlockTimer = new Timer(1);
this.afterPerfectBlockTimer.onComplete.Add(new PrioritizedAction(() => perfectBlockedTarget = null));
this.afterNormalBlockTimer = new Timer(1);
this.afterPerfectBlockTimer.onComplete.Add(new PrioritizedAction(() => normalBlockedTarget = null));
}
public void ApplyBlock(BlockSource source, bool refreshPerfect = false)
@@ -99,8 +107,8 @@ namespace Cielonos.MainGame.Characters
blockSources.RemoveAll(source => source.blockTime <= 0);
}
afterPerfectBlockTimer -= owner.owner.selfTimeSm.DeltaTime;
afterNormalBlockTimer -= owner.owner.selfTimeSm.DeltaTime;
afterPerfectBlockTimer.Update(owner.owner.selfTimeSm.DeltaTime);
afterNormalBlockTimer.Update(owner.owner.selfTimeSm.DeltaTime);
}
}
@@ -121,11 +129,13 @@ namespace Cielonos.MainGame.Characters
public GameObject perfectBlockEffect;
public uint perfectBlockSound;
public Action<AttackAreaBase> onPerfectBlock;
public Breakthrough.Type normalBlockType;
public GameObject normalBlockEffect;
public uint normalBlockSound;
public Action<AttackAreaBase> onNormalBlock;
public float triggerTime;
@@ -173,11 +183,11 @@ namespace Cielonos.MainGame.Characters
}
VFXObject.Spawn(perfectBlockEffect, sourceCharacter, blockEffectPosition, Quaternion.identity);
//pObj.GetComponent<ParticleSystem>().Simulate(0.1f, true, true);
//pObj.GetComponent<ParticleSystem>().Play();//TODO: 增加起点时间参数
sourceCharacter.reactionSc.blockSm.afterPerfectBlockTimer = blockBufferTime + 0.25f;
onPerfectBlock?.Invoke(attackArea);
BlockSubmodule blockSm = sourceCharacter.reactionSc.blockSm;
blockSm.perfectBlockedTarget = attackArea.creator;
blockSm.afterPerfectBlockTimer.Reset(blockBufferTime + 0.25f);
}
public void NormalBlock(AttackAreaBase attackArea, Vector3 blockEffectPosition)
@@ -192,8 +202,11 @@ namespace Cielonos.MainGame.Characters
}
VFXObject.Spawn(normalBlockEffect, sourceCharacter, blockEffectPosition, Quaternion.identity);
sourceCharacter.reactionSc.blockSm.afterNormalBlockTimer = blockBufferTime + 0.25f;
onNormalBlock?.Invoke(attackArea);
BlockSubmodule blockSm = sourceCharacter.reactionSc.blockSm;
blockSm.normalBlockedTarget = attackArea.creator;
blockSm.afterPerfectBlockTimer.Reset(blockBufferTime + 0.25f);
}
}
}