狗屎Minimax坏我代码

This commit is contained in:
SoulliesOfficial
2026-04-18 13:57:19 -04:00
parent 41140a2017
commit 7379583165
473 changed files with 34480 additions and 8069 deletions

View File

@@ -116,11 +116,11 @@ namespace Cielonos.MainGame.Characters
string gainMultiplier = attackValue.attackType.AttackTypeToString() + "DamageGainMultiplier";
float baseDamage = attackValue.damage;
baseDamage *= attackValue.attacker.attributeSm[dealtMultiplier];
baseDamage *= attackValue.attacker is not null ? attackValue.attacker.attributeSm[dealtMultiplier] : 1;
baseDamage *= attributeSm[gainMultiplier];
baseDamage *= attackValue.attacker.attributeSm["FinalDamageDealtMultiplier"];
baseDamage *= attackValue.attacker is not null ? attackValue.attacker.attributeSm["FinalDamageDealtMultiplier"] : 1;
baseDamage *= attributeSm["FinalDamageGainMultiplier"];
return (baseDamage + attackValue.additionalFlatDamage) * attackValue.damageMultiplier;
@@ -149,12 +149,6 @@ namespace Cielonos.MainGame.Characters
attributeSm["Health"] -= damage;
attackResult.finalDamage = damage;
Attack.AttackType attackType = attackResult.attackValue.attackType;
bool isCritical = attackResult.attackValue.isCritical;
MainGameBaseCollection.Instance.DamageNumber(attackType, isCritical)
.Spawn(attackResult.hitPosition, damage, transform)
.SetSpamGroup(attackResult.spamGroupID);
if (attributeSm["Health"] <= 0)
{
attackResult.causedDeath = true;

View File

@@ -235,8 +235,12 @@ namespace Cielonos.MainGame.Characters
public virtual void PlayGetHitAnimation(string funcAnimName, out float animDuration,
Vector3 direction = default)
{
fullBodyFuncAnimSm.Play(funcAnimName);
animDuration = fullBodyFuncAnimSm.currentData.Interval(IntervalType.ActionDisruption).StartTime;
if (fullBodyFuncAnimSm.Play(funcAnimName))
{
animDuration = fullBodyFuncAnimSm.currentData.Interval(IntervalType.ActionDisruption).StartTime;
}
animDuration = 0.2f;
//animDuration = fullBodyFuncAnimSm.currentData.Interval(IntervalType.Active).EndTime;
}
}

View File

@@ -29,6 +29,23 @@ namespace Cielonos.MainGame.Characters
_timeProvider = new CharacterFeedbackTimeProvider(owner);
}
}
public FeedbackData GetFeedbackData(string feedbackName)
{
if (feedbackDataCollection == null)
{
Debug.LogWarning($"[Item.FeedbackSubcontroller] feedbackDataCollection is null on {owner?.name}.");
return null;
}
if (!feedbackDataCollection.TryGet(feedbackName, out FeedbackData data))
{
Debug.LogWarning($"[Item.FeedbackSubcontroller] FeedbackData '{feedbackName}' not found on {owner?.name}.");
return null;
}
return data;
}
/// <summary>
/// 通过新系统播放一个 FeedbackData。
@@ -109,7 +126,7 @@ namespace Cielonos.MainGame.Characters
}
// 新系统驱动
float dt = Time.unscaledDeltaTime;
float dt = Time.deltaTime;
for (int i = _activePlayers.Count - 1; i >= 0; i--)
{
FeedbackPlayer player = _activePlayers[i];
@@ -122,30 +139,4 @@ namespace Cielonos.MainGame.Characters
}
}
}
public partial class FeedbackSubcontroller
{
protected void Swing(Vector3 swingRotation, float rotationDuration, Vector3 swingPosition, float positionDuration)
{
MMF_Player swing = LeanPool.Spawn(MainGameBaseCollection.Instance.feedbackCollection["Swing"]).GetComponent<MMF_Player>();
MMF_CinemachineRotation cinemachineRotation = swing.GetFeedbackOfType<MMF_CinemachineRotation>();
if (cinemachineRotation != null)
{
cinemachineRotation.RotationAmplitude = swingRotation != default ? swingRotation : Vector3.zero;
cinemachineRotation.Duration = rotationDuration;
}
MMF_CinemachinePosition cinemachinePosition = swing.GetFeedbackOfType<MMF_CinemachinePosition>();
if (cinemachinePosition != null)
{
cinemachinePosition.PositionAmplitude = swingPosition != default ? swingPosition : Vector3.zero;
cinemachinePosition.Duration = positionDuration;
}
swing.Events.OnComplete.RemoveAllListeners();
swing.Events.OnComplete.AddListener(()=> LeanPool.Despawn(swing.gameObject));
swing.PlayFeedbacks();
}
}
}

View File

@@ -143,8 +143,9 @@ namespace Cielonos.MainGame.Characters
{
defaultDodge.onPerfectDodge = () =>
{
player.feedbackSc["PerfectDodge"].feedback.GetFeedbackOfType<MMF_RadialBlur>().TargetCenter = player.GetNormalizedScreenPosition();
player.feedbackSc["PerfectDodge"].feedback.GetFeedbackOfType<MMF_AdvancedVignette>().Center = player.GetNormalizedScreenPosition();
// Perfect Dodge 反馈将在 PlayerFeedbackSubcontroller 中统一处理
// 这里可以添加任何 Perfect Dodge 特有的回调逻辑
// 例如:记录完美闪避次数、触发成就等
};
}
return defaultDodge;

View File

@@ -21,6 +21,7 @@ namespace Cielonos.MainGame.Characters
onDashEnd = new OrderedDictionary<string, PrioritizedAction>();
onDodgeStart = new OrderedDictionary<string, PrioritizedAction>();
onDodgeEnd = new OrderedDictionary<string, PrioritizedAction>();
onGetHit = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase>>();
onGetBreakthrough = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase>>();
@@ -31,6 +32,8 @@ namespace Cielonos.MainGame.Characters
onBlockSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>>();
onNormalBlockSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>>();
onPerfectBlockSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>>();
onNormalDodgeSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, DodgeSource>>();
onPerfectDodgeSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, DodgeSource>>();
}
}
@@ -159,6 +162,16 @@ namespace Cielonos.MainGame.Characters
/// 完美格挡成功时,参数为攻击区域和格挡来源
/// </summary>
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>> onPerfectBlockSuccess;
/// <summary>
/// 普通闪避成功时,参数为闪避来源
/// </summary>
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, DodgeSource>> onNormalDodgeSuccess;
/// <summary>
/// 完美闪避成功时,参数为闪避来源
/// </summary>
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, DodgeSource>> onPerfectDodgeSuccess;
}
#endregion