超大量的更新 修复很多问题,gameplay特效初步

This commit is contained in:
FloatGaming
2026-02-14 23:46:20 +08:00
parent ef8eb67259
commit 3a7a0b4669
360 changed files with 85670 additions and 4144 deletions
+62 -36
View File
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -16,90 +16,114 @@ public class SkillDefinition : ScriptableObject
OnNoteHit,
OnManaFull,
OnAttackZero,
OnEnemyRevive, // ˵dzʱ
OnEnemyDead, // ʱ
// е˱ʱ
OnEnemyRevive, // Documentation text normalized.
OnEnemyDead, // Documentation text normalized.
// Documentation text normalized.
OnAllEnemiesDefeated,
// λֵָʱƣ
// Documentation text normalized.
OnHPHealed,
// λʧȥֵʱ/˺
// Documentation text normalized.
OnHPLost,
// λ÷ʱ
// Documentation text normalized.
OnManaGained,
// λʧȥʱ
// Documentation text normalized.
OnManaLost,
// ֵijֵʱٷֱȣ0-1
// Documentation text normalized.
OnHPAbovePercent,
// ֵijֵʱٷֱȣ0-1
OnHPBelowPercent
// Documentation text normalized.
OnHPBelowPercent,
// New: attack threshold trigger (attack < attackTriggerValue)
OnAttackBelowValue,
// New: triggers once when this ally is defeated (HP reaches 0 from above).
OnSelfDefeated
}
[Header("ʶ (Identity)")]
[Tooltip("ܵڲΨһ IDڴʶ˼")]
[Header("Inspector")]
[Tooltip("Documentation text normalized.")]
public string skillId;
[Tooltip(" UI ʾ")]
[Tooltip("Documentation text normalized.")]
public string displayName;
[Tooltip("ע/ժҪʱοӰ")]
[Tooltip("Documentation text normalized.")]
[TextArea(1,2)]
public string summaryInfo;
[Header("Ч (Effect)")]
[Tooltip("ܵЧͣ缴ʱ˺˺ơ/")]
[Header("Inspector")]
[Tooltip("Documentation text normalized.")]
public EffectType effectType = EffectType.DamageSingleEnemy;
[Tooltip("ĬĿѡĬõĿ귶Χ/Ѿ/зȣ")]
[Tooltip("Documentation text normalized.")]
public Selector defaultSelector = Selector.CurrentEnemies;
[Tooltip("ѡ FromFormula ʱʹõıʽַ֧ʹñattack, maxHP, currentHP, maxMana, currentMana, damageResistance, scoreEfficiency, ally_currentEXP, currentScore( idolScore), slot, level/currentLevel/levelIDʾ: 'attack * 1.5 + maxHP * 0.1 + 20'ֻдһ֣ '120'̶ֵָͬ")]
[Tooltip("Documentation text normalized.")]
[TextArea(2,4)]
public string formula = "";
[Tooltip("ĬϳʱڳЧ Buff ijʱΪ 0 Ϊһ/ʱܣᰴ tick ַ")]
[Tooltip("Documentation text normalized.")]
public float defaultDuration = 0f;
[Tooltip("ĬϴڳЧÿδÿѪΪ 0 Ϊһ/ʱ")]
[Tooltip("Documentation text normalized.")]
public float defaultTickInterval = 1f;
[Header("־ (Flags)")]
[Tooltip("ǷָĿ꣨true ʾ˼ͨҪ specificTarget")]
[Header("Inspector")]
[Tooltip("Documentation text normalized.")]
public bool requiresSpecificTarget = false; // if true, skill usually targets a specific GameObject
[Tooltip("ǷֱĿݣtrue ʾ SkillBuilder ֱӵ ICombatant/AllyCombatantͨ EffectSystem ַ")]
[Tooltip("Documentation text normalized.")]
public bool operateDirectly = false; // if true, SkillBuilder will operate on ICombatant/AllyCombatant fields directly and update UI, instead of calling EffectSystem
[Tooltip("ܵעʱд˵")]
[Tooltip("Documentation text normalized.")]
[TextArea(8,4)]
public string description;
[Header(" (Trigger)")]
[Tooltip("ܴϷʱʱֵʱ")]
[Header("Inspector")]
[Tooltip("Documentation text normalized.")]
public SkillTrigger triggerCondition = SkillTrigger.None;
[Tooltip(" triggerCondition == OnNoteHit ʱЧжʱѡ Miss/Good/Great/Perfectر˵ѡ Miss ʾжΪ Miss ʱжGood/Great/Perfect")]
[Tooltip("Documentation text normalized.")]
public NoteTriggerThreshold onNoteHitMinThreshold = NoteTriggerThreshold.Good;
[Tooltip(" triggerCondition == OnNoteHit ʱЧָ˼ Tap/HoldβΣ Eitherѡ Holdֻгβλᴥѡ Tap̰Either ߾ɣ Hold Կɱʽã")]
[Tooltip("Documentation text normalized.")]
public NoteTypeTrigger noteTriggerType = NoteTypeTrigger.Either;
[Tooltip(" triggerCondition == OnNoteHit ʱЧȴʱȴʱٴж")]
[Tooltip("Documentation text normalized.")]
public float onNoteHitCooldown = 0f;
[Tooltip(" triggerCondition Ϊ HP ٷֱʱЧֵֵ0-1 0.3 ʾ 30%")]
[Tooltip("Documentation text normalized.")]
public float hpTriggerPercent = 0.5f;
[Tooltip("Optional: for HP percent triggers, evaluate this formula (0..1) to get the threshold instead of hpTriggerPercent. Useful for per-level thresholds like 90/80/75/70.")]
public string hpTriggerPercentFormula = "";
[Tooltip("For OnAttackBelowValue: triggers when attack < attackTriggerValue.")]
public int attackTriggerValue = 0;
[Tooltip("Optional: if > 0 and repeatValue != 0, when the skill triggers again within this window, the computed amount is overridden by repeatValue.")]
public float repeatWindowSeconds = 0f;
public float repeatValue = 0f;
[Header("技能专属")]
[Tooltip("技能专属")]
public specificBelongsTo specificBelongType = specificBelongsTo.None;
public enum specificBelongsTo
{
None,
Unique,
Special
}
// Minimum judge quality required to trigger on note hit
public enum NoteTriggerThreshold
{
// Ϊ Miss ʱܽжΪ Missquality == 0ʱ
// Documentation text normalized.
Miss = 0,
Good = 1,
Great = 2,
Perfect = 3
}
// ָӦ Tap/ Hold/ Either
// Documentation text normalized.
public enum NoteTypeTrigger
{
Tap,
@@ -107,10 +131,10 @@ public class SkillDefinition : ScriptableObject
Either
}
// ʱԣ defaultDuration defaultTickInterval Ϊ 0 ʱһԼʱ
// Documentation text normalized.
public bool IsSingleInstance => defaultDuration <= 0f || defaultTickInterval <= 0f;
// ʵڷַļΪһԼ򷵻 0
// Documentation text normalized.
public float GetEffectiveTickInterval()
{
return IsSingleInstance ? 0f : Mathf.Max(0.0001f, defaultTickInterval);
@@ -118,13 +142,15 @@ public class SkillDefinition : ScriptableObject
private void OnValidate()
{
// ֵ֤ΪǸ
// Documentation text normalized.
if (defaultDuration < 0f) defaultDuration = 0f;
if (defaultTickInterval < 0f) defaultTickInterval = 0f;
if (onNoteHitCooldown < 0f) onNoteHitCooldown = 0f;
// clamp hpTriggerPercent
if (hpTriggerPercent < 0f) hpTriggerPercent = 0f;
if (hpTriggerPercent > 1f) hpTriggerPercent = 1f;
if (attackTriggerValue < 0) attackTriggerValue = 0;
if (repeatWindowSeconds < 0f) repeatWindowSeconds = 0f;
}
// --- Simple expression evaluator used when valueMode == FromFormula ---