超大量的更新 修复很多问题,gameplay特效初步
This commit is contained in:
@@ -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 ʱ�����ܽ����ж�Ϊ Miss��quality == 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 ---
|
||||
|
||||
Reference in New Issue
Block a user