客户端rsa,冗余清理,bug修复,安卓build问题
This commit is contained in:
@@ -15,6 +15,8 @@ using TMPro;
|
||||
/// </summary>
|
||||
public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
{
|
||||
private static float GameplayNow => Application.isPlaying ? GameplayClock.NowSongTime : Time.realtimeSinceStartup;
|
||||
|
||||
private static AllyHero_SO[] cachedAllAllyHeroes;
|
||||
public int slotIndex = 0; // Documentation text normalized.
|
||||
|
||||
@@ -209,7 +211,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
if (Application.isPlaying && skillIconAutoFadeTime > 0f && lastSkillIconPushTime > 0f)
|
||||
{
|
||||
// Only start coroutine if not already running and time exceeded
|
||||
if (skillIconAutoFadeCoroutine == null && Time.time - lastSkillIconPushTime >= skillIconAutoFadeTime)
|
||||
if (skillIconAutoFadeCoroutine == null && GameplayNow - lastSkillIconPushTime >= skillIconAutoFadeTime)
|
||||
{
|
||||
// Double check visibility
|
||||
bool anyVisible = false;
|
||||
@@ -238,23 +240,23 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
TryCastOnFullMana();
|
||||
}
|
||||
|
||||
if (_selfDamageRedirectToAdjacentExpireTime > 0f && Time.time > _selfDamageRedirectToAdjacentExpireTime)
|
||||
if (_selfDamageRedirectToAdjacentExpireTime > 0f && GameplayNow > _selfDamageRedirectToAdjacentExpireTime)
|
||||
{
|
||||
ConsumeSelfDamageRedirectToAdjacent();
|
||||
}
|
||||
|
||||
if (_rewriteNonMissToPerfectExpireTime > 0f && Time.time > _rewriteNonMissToPerfectExpireTime)
|
||||
if (_rewriteNonMissToPerfectExpireTime > 0f && GameplayNow > _rewriteNonMissToPerfectExpireTime)
|
||||
{
|
||||
ClearNonMissToPerfectRewrite();
|
||||
}
|
||||
else if (_rewriteNonMissToPerfectExpireTime > 0f &&
|
||||
Time.time <= _rewriteNonMissToPerfectExpireTime &&
|
||||
GameplayNow <= _rewriteNonMissToPerfectExpireTime &&
|
||||
string.IsNullOrEmpty(_rewriteNonMissToPerfectIconId) &&
|
||||
iBudeffPrefabController.Instance != null)
|
||||
{
|
||||
// Fallback: if icon registration failed earlier (e.g. controller initialized later),
|
||||
// retry during active window.
|
||||
float remain = Mathf.Max(0.01f, _rewriteNonMissToPerfectExpireTime - Time.time);
|
||||
float remain = Mathf.Max(0.01f, _rewriteNonMissToPerfectExpireTime - GameplayNow);
|
||||
_rewriteNonMissToPerfectIconId = iBudeffPrefabController.Instance.RegisterTimedEffect(this, PlayerBudeffIconType.ot_luckyChance, 1f, remain);
|
||||
iBudeffPrefabController.Instance.RefreshAllyNow(this);
|
||||
}
|
||||
@@ -728,7 +730,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
if (skillIconSlots == null || skillIconSlots.Length == 0) return;
|
||||
|
||||
// Reset auto-fade logic
|
||||
lastSkillIconPushTime = Time.time;
|
||||
lastSkillIconPushTime = GameplayNow;
|
||||
if (skillIconAutoFadeCoroutine != null)
|
||||
{
|
||||
StopCoroutine(skillIconAutoFadeCoroutine);
|
||||
@@ -837,7 +839,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
skillIconOccupied[i] = false;
|
||||
|
||||
// Wait small interval between fades
|
||||
yield return new WaitForSeconds(0.15f);
|
||||
yield return GameplayClock.WaitForSeconds(0.15f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1887,7 +1889,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
}
|
||||
|
||||
activeBuffs.Add(buff);
|
||||
_buffAppliedTimes[buff.buffId] = Application.isPlaying ? Time.time : Time.realtimeSinceStartup;
|
||||
_buffAppliedTimes[buff.buffId] = GameplayNow;
|
||||
// Apply reversible multipliers. attackMultiplier is applied via baseline+recalc to ensure it can be reverted.
|
||||
if (buff.scoreMultiplier != 1f) scoreEfficiency *= buff.scoreMultiplier;
|
||||
if (buff.attackMultiplier != 1f) RecalculateAttackFromBuffs();
|
||||
@@ -2539,7 +2541,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
float expireTime = -1f;
|
||||
if (duration > 0f && Application.isPlaying)
|
||||
{
|
||||
expireTime = Time.time + duration;
|
||||
expireTime = GameplayNow + duration;
|
||||
}
|
||||
|
||||
NextDamageRedirectState state = null;
|
||||
@@ -2577,7 +2579,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
bool remove = redirector == null;
|
||||
if (!remove && (redirector.IsDead || !redirector.gameObject.activeInHierarchy))
|
||||
remove = true;
|
||||
if (!remove && Application.isPlaying && state.expireTime > 0f && Time.time > state.expireTime)
|
||||
if (!remove && Application.isPlaying && state.expireTime > 0f && GameplayNow > state.expireTime)
|
||||
remove = true;
|
||||
|
||||
if (!remove) continue;
|
||||
@@ -2703,12 +2705,12 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
if (string.IsNullOrWhiteSpace(buff.buffId))
|
||||
{
|
||||
buff.buffId = Guid.NewGuid().ToString();
|
||||
_buffAppliedTimes[buff.buffId] = Application.isPlaying ? Time.time : Time.realtimeSinceStartup;
|
||||
_buffAppliedTimes[buff.buffId] = GameplayNow;
|
||||
}
|
||||
float t = 0f;
|
||||
if (!_buffAppliedTimes.TryGetValue(buff.buffId, out t))
|
||||
{
|
||||
t = Application.isPlaying ? Time.time : Time.realtimeSinceStartup;
|
||||
t = GameplayNow;
|
||||
_buffAppliedTimes[buff.buffId] = t;
|
||||
}
|
||||
if (latest == null || t > latestTime)
|
||||
@@ -2747,7 +2749,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
{
|
||||
if (!_buffAppliedTimes.TryGetValue(objectBuff.buffId, out objectBuffTime))
|
||||
{
|
||||
objectBuffTime = Application.isPlaying ? Time.time : Time.realtimeSinceStartup;
|
||||
objectBuffTime = GameplayNow;
|
||||
_buffAppliedTimes[objectBuff.buffId] = objectBuffTime;
|
||||
}
|
||||
}
|
||||
@@ -2958,7 +2960,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
// Compensate at expiry: source +delta, target -delta, to keep net transfer behavior correct.
|
||||
if (duration > 0f)
|
||||
{
|
||||
float remaining = Mathf.Max(0.01f, (startTime + duration) - Time.time);
|
||||
float remaining = Mathf.Max(0.01f, (startTime + duration) - GameplayNow);
|
||||
StartCoroutine(CompensateTransferredTimedBudeffAtExpiry(actualTarget, iconType, value, remaining));
|
||||
}
|
||||
return true;
|
||||
@@ -2966,7 +2968,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
|
||||
private IEnumerator CompensateTransferredTimedBudeffAtExpiry(AllyCombatant target, PlayerBudeffIconType iconType, float value, float waitSeconds)
|
||||
{
|
||||
yield return new WaitForSeconds(Mathf.Max(0.01f, waitSeconds));
|
||||
yield return GameplayClock.WaitForSeconds(Mathf.Max(0.01f, waitSeconds));
|
||||
if (target == null) yield break;
|
||||
if (this == null) yield break;
|
||||
|
||||
@@ -3086,7 +3088,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
if (target.IsDead || !target.gameObject.activeInHierarchy) return;
|
||||
if (!IsSelfDamageRedirectToAdjacentActive()) return;
|
||||
|
||||
float remain = Mathf.Max(0.01f, _selfDamageRedirectToAdjacentExpireTime - Time.time);
|
||||
float remain = Mathf.Max(0.01f, _selfDamageRedirectToAdjacentExpireTime - GameplayNow);
|
||||
string iconId = _selfDamageRedirectToAdjacentIconId;
|
||||
|
||||
// Clear source state without touching icon (icon already moved by budeff controller transfer).
|
||||
@@ -3096,7 +3098,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
// Keep only one self-redirect state on target.
|
||||
target.ConsumeSelfDamageRedirectToAdjacent();
|
||||
|
||||
target._selfDamageRedirectToAdjacentExpireTime = Time.time + remain;
|
||||
target._selfDamageRedirectToAdjacentExpireTime = GameplayNow + remain;
|
||||
target._selfDamageRedirectToAdjacentIconId = iconId;
|
||||
}
|
||||
|
||||
@@ -3222,7 +3224,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
{
|
||||
if (!Application.isPlaying) return;
|
||||
if (duration <= 0f) duration = 0.01f;
|
||||
_selfDamageRedirectToAdjacentExpireTime = Time.time + duration;
|
||||
_selfDamageRedirectToAdjacentExpireTime = GameplayNow + duration;
|
||||
if (!string.IsNullOrEmpty(_selfDamageRedirectToAdjacentIconId))
|
||||
{
|
||||
iBudeffPrefabController.Instance?.UnregisterTimedEffect(slotIndex, _selfDamageRedirectToAdjacentIconId);
|
||||
@@ -3236,7 +3238,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
if (!Application.isPlaying) return;
|
||||
if (duration <= 0f) duration = 0.01f;
|
||||
|
||||
_rewriteNonMissToPerfectExpireTime = Time.time + duration;
|
||||
_rewriteNonMissToPerfectExpireTime = GameplayNow + duration;
|
||||
|
||||
if (!string.IsNullOrEmpty(_rewriteNonMissToPerfectIconId))
|
||||
{
|
||||
@@ -3252,7 +3254,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
{
|
||||
if (!Application.isPlaying) return false;
|
||||
if (_rewriteNonMissToPerfectExpireTime <= 0f) return false;
|
||||
if (Time.time > _rewriteNonMissToPerfectExpireTime)
|
||||
if (GameplayNow > _rewriteNonMissToPerfectExpireTime)
|
||||
{
|
||||
ClearNonMissToPerfectRewrite();
|
||||
return false;
|
||||
@@ -3280,7 +3282,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
{
|
||||
if (!Application.isPlaying) return false;
|
||||
if (IsDead) return false;
|
||||
return _rewriteNonMissToPerfectExpireTime > 0f && Time.time <= _rewriteNonMissToPerfectExpireTime;
|
||||
return _rewriteNonMissToPerfectExpireTime > 0f && GameplayNow <= _rewriteNonMissToPerfectExpireTime;
|
||||
}
|
||||
|
||||
private bool IsSelfDamageRedirectToAdjacentActive()
|
||||
@@ -3292,7 +3294,7 @@ public class AllyCombatant : MonoBehaviour, ICombatant
|
||||
ConsumeSelfDamageRedirectToAdjacent();
|
||||
return false;
|
||||
}
|
||||
if (Time.time > _selfDamageRedirectToAdjacentExpireTime)
|
||||
if (GameplayNow > _selfDamageRedirectToAdjacentExpireTime)
|
||||
{
|
||||
ConsumeSelfDamageRedirectToAdjacent();
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user