From b97ca7fc69d2cddeaf1af2d4e59ba4b413034784 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 12 三月 2026 16:51:46 +0800
Subject: [PATCH] 59 邮件系统-客户端 邮件标题支持参数匹配
---
Main/System/Guild/GuildBossWin.cs | 265 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 242 insertions(+), 23 deletions(-)
diff --git a/Main/System/Guild/GuildBossWin.cs b/Main/System/Guild/GuildBossWin.cs
index ee91432..7c57f73 100644
--- a/Main/System/Guild/GuildBossWin.cs
+++ b/Main/System/Guild/GuildBossWin.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
using Cysharp.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
@@ -49,12 +50,14 @@
[SerializeField] Text awardCntText;
//鏀诲嚮鍖�
[SerializeField] UIHeroController bossModel;
+
+ [SerializeField] Transform atkTargetPos;
[SerializeField] HorseController heroModel;
- [SerializeField] Transform attackArea1;
- [SerializeField] Transform attackArea2;
- [SerializeField] Transform attackArea3;
+ [SerializeField] Transform[] attackAreas;
+ [SerializeField] RectTransform attackAreaParent;
[SerializeField] GuildBossOtherPlayer otherPlayer; //鍒涘缓澶氫釜鐢�
- [SerializeField] GuildBossOtherPlayerAttack otherPlayerAttack; //鍒涘缓澶氫釜鐢�
+ List<GuildBossOtherPlayer> otherPlayers;
+ [SerializeField] GuildBossOtherPlayerAttack[] otherPlayerAttacks;
//鑷繁鐨勬敾鍑�
[SerializeField] UIEffectPlayer hurtEffect;
@@ -64,9 +67,22 @@
[SerializeField] Image[] awardIcons;
[SerializeField] Transform pos1;
[SerializeField] Transform pos2;
+ [SerializeField] Transform[] dropBoxes;
+ [SerializeField] Transform targetPos;
+
[SerializeField] Transform fakeRedBZ;
[SerializeField] Transform fakeRedAward;
+
+ [Header("姝﹀皢杩涘満鏃堕棿")]
+ public float heroShowTime = 0.1f;
+ [Header("姝﹀皢鏀诲嚮閫熷害瓒婂ぇ瓒婂揩")]
+ public float heroAtkSpeed = 2f;
+ [Header("澶氭椋樿浠ュ強鐗╁搧鍑虹幇闂撮殧姣")]
+ public int atkValueShowCD = 200;
+
+ [Header("鏄惁寰幆鎾斁浠栦汉鎴樻枟")]
+ public bool isOthersLoop = false;
bool isCD = false;
@@ -122,8 +138,8 @@
void Display()
{
- endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds));
- fightPowerText.text = PlayerDatas.Instance.baseData.FightPower.ToString();
+ endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetCommTodayEndTime(GuildManager.Instance.zoneID) - TimeUtility.GetCommServerNow(GuildManager.Instance.zoneID)).TotalSeconds));
+ fightPowerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower);
headCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
PlayerDatas.Instance.baseData.face,
PlayerDatas.Instance.baseData.facePic));
@@ -229,6 +245,8 @@
beforeLayerNum = (int)layer;
}
ShowDynamicUI();
+ ShowDropBox();
+ ShowOtherAttacker();
}
void ShowRank()
@@ -253,17 +271,19 @@
bzAttrText.text = GetAddAttrs(bossAction);
var layer = bossAction == null ? 0 : bossAction.Value3;
var bzTime = bossAction == null ? 0 : bossAction.Value2;
- if (bzTime == 0)
+ int remainTime = (int)Math.Max(0, bzTime - TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID));
+ if (remainTime == 0)
+ {
+ //鏃堕棿鍒颁簡 瀹㈡埛绔嚜宸辨竻0
+ layer = 0;
+ }
+ if (remainTime == 0)
{
bzLayerText.text = $"{layer}/{GuildBossManager.Instance.bzMaxLevel}";
}
else
{
- int remainTime = (int)Math.Max(0, bzTime - TimeUtility.AllSeconds);
- if (remainTime > 0)
- {
- bzLayerText.text = $"{layer}/{GuildBossManager.Instance.bzMaxLevel}" + Language.Get("GuildBoss28", TimeUtility.SecondsToHMS(remainTime));
- }
+ bzLayerText.text = $"{layer}/{GuildBossManager.Instance.bzMaxLevel}" + Language.Get("GuildBoss28", TimeUtility.SecondsToHMS(remainTime));
}
}
@@ -271,6 +291,14 @@
string GetAddAttrs(HA513_tagMCFamilyActionInfo.tagMCFamilyAction action)
{
var layerNum = action == null ? 0 : action.Value3;
+ var bzTime = action == null ? 0 : action.Value2;
+ int remainTime = (int)Math.Max(0, bzTime - TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID));
+ if (remainTime == 0)
+ {
+ //鏃堕棿鍒颁簡 瀹㈡埛绔嚜宸辨竻0
+ layerNum = 0;
+ }
+ layerNum = (uint)Math.Min(layerNum, GuildBossManager.Instance.bzMaxLevel);
var superHitRate = GuildBossManager.Instance.initSuperHitRate + (int)layerNum * GuildBossManager.Instance.bzAddAttrs[0];
var addHurtPer = (int)layerNum * GuildBossManager.Instance.bzAddAttrs[1];
@@ -283,9 +311,10 @@
void OnSecondEvent()
{
- endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds));
+ endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetCommTodayEndTime(GuildManager.Instance.zoneID) - TimeUtility.GetCommServerNow(GuildManager.Instance.zoneID)).TotalSeconds));
var bossAction = GuildBossManager.Instance.GetGuildBossAction();
ShowBzInfo(bossAction);
+ OtherPlayerAnimation();
}
void ShowProcess(float value)
@@ -318,12 +347,12 @@
void OnBzBtnClick()
{
- int curLayer = 0;
- var bossAction = GuildBossManager.Instance.GetGuildBossAction();
- if (bossAction != null)
- {
- curLayer = (int)bossAction.Value3;
- }
+ // int curLayer = 0;
+ // var bossAction = GuildBossManager.Instance.GetGuildBossAction();
+ // if (bossAction != null)
+ // {
+ // curLayer = (int)bossAction.Value3;
+ // }
// if (curLayer >= GuildBossManager.Instance.bzMaxLevel)
// {
@@ -374,7 +403,7 @@
}
GuildBossManager.Instance.TaofaBoss(0);
- ShowAttackCD().Forget();
+ // ShowAttackCD().Forget();
}
async UniTask ShowAttackCD()
@@ -395,6 +424,7 @@
ShowDynamicUI();
}
+
void AtkResultEvent()
{
//1. 鐜╁浠巔os1 绉诲姩鍒皃os2
@@ -403,7 +433,7 @@
heroModel.GetHero().onComplete = null;
heroModel.PlayAnimation("run", true);
heroModel.transform.localPosition = pos1.localPosition;
- heroModel.transform.DOLocalMove(pos2.localPosition, 0.3f).OnComplete(() =>
+ heroModel.transform.DOLocalMove(pos2.localPosition, heroShowTime).OnComplete(() =>
{
ShowDmg().Forget();
});
@@ -417,6 +447,7 @@
heroModel.transform.localPosition = pos1.localPosition;
};
heroModel.HeroPlay("attack");
+
if (GuildBossManager.Instance.atkResult.AtkType == 0)
{
hurtEffect.Play();
@@ -454,7 +485,7 @@
attackType = hurtData.IsSuper == 1 ? (int)DamageType.CritDamage : 2
};
hurtValues[i].text = BattleUtility.DisplayDamageNum(dmg);
- await UniTask.Delay(200);
+ await UniTask.Delay(atkValueShowCD);
}
else
{
@@ -482,7 +513,7 @@
awardValues[i].text = itemData.Count.ToString();
awardIcons[i].SetItemSprite((int)itemData.ItemID);
- await UniTask.Delay(200);
+ await UniTask.Delay(atkValueShowCD);
}
else
{
@@ -496,6 +527,7 @@
{
var skinConfig = HorseSkinConfig.Get(HorseManager.Instance.GetUsingHorseSkinID(false));
heroModel.Create(skinConfig.SkinID, PhantasmPavilionManager.Instance.GetMyModelSkinID(), 1.2f);
+ heroModel.GetHero().SetSpeed(heroAtkSpeed);
for (int i = 0; i < hurtValues.Length; i++)
{
hurtValues[i].transform.localScale = Vector3.zero;
@@ -513,5 +545,192 @@
bossModel.onComplete = null;
};
bossModel.PlayAnimation("chuxian");
+ lastValueIndex = FindHurtIndex();
+
+ for (int i = 0; i < dropBoxes.Length; i++)
+ {
+ dropBoxes[i].transform.localScale = Vector3.zero;
+ }
+
+ for (int i = otherPlayers.Count - 1; i >= 0; i--)
+ {
+ otherPlayers[i].moveState = 0;
+ }
+ for (int i = 0; i < otherPlayerAttacks.Length; i++)
+ {
+ otherPlayerAttacks[i].Hide();
+ //缃簳
+ otherPlayerAttacks[i].transform.SetAsLastSibling();
+ }
+ }
+
+ int lastValueIndex = -1; // -1 鏈揪鏍�
+ void ShowDropBox()
+ {
+ int index = FindHurtIndex();
+ if (index > lastValueIndex)
+ {
+ var showBoxCnt = index - lastValueIndex;
+ lastValueIndex = index;
+ for (int i = 0; i < dropBoxes.Length; i++)
+ {
+ if (i < showBoxCnt)
+ {
+ dropBoxes[i].transform.localScale = Vector3.one*0.5f;
+
+ var startPos = new Vector3(UnityEngine.Random.Range(-80, 80), 30, 0);
+ //闅忔満鏂瑰悜杩斿洖1鎴栬��-1
+ int randDir = UnityEngine.Random.Range(0, 2) == 0 ? 1 : -1;
+
+ dropBoxes[i].localPosition = startPos;
+ int _index = i;
+ dropBoxes[i].DOLocalPath(new Vector3[] { startPos,
+ new Vector3(startPos.x + randDir * 10, startPos.y + 30f, 0),
+ new Vector3(startPos.x + randDir * 25, startPos.y - 60, 0) }, 0.5f, PathType.CatmullRom).SetEase(Ease.InOutSine).OnComplete(()=>
+ {
+ dropBoxes[_index].DOLocalMove(targetPos.localPosition, 0.3f).OnComplete(()=>
+ {
+ dropBoxes[_index].transform.localScale = Vector3.zero;
+ awardBtn.GetComponent<ScaleTween>().Play();
+ });
+ });
+ }
+ else
+ {
+ dropBoxes[i].transform.localScale = Vector3.zero;
+ }
+ }
+ }
+ }
+
+
+ int FindHurtIndex()
+ {
+ for (int i = 0; i < GuildBossManager.Instance.allBXCumulativeDamageList.Count; i++)
+ {
+ if (GuildBossManager.Instance.m_BoxHurt < GuildBossManager.Instance.allBXCumulativeDamageList[i])
+ {
+ return i - 1;
+ }
+ }
+ return GuildBossManager.Instance.allBXCumulativeDamageList.Count;
+ }
+
+ void ShowOtherAttacker()
+ {
+ CreateOtherAttacker();
+ var cnt = GuildBossManager.Instance.playerBossHurtRank.Count;
+ //浼ゅ楂樼殑鍦ㄤ笂闈紝閫嗗簭鏄剧ず
+ for (int i = otherPlayers.Count - 1; i >= 0; i--)
+ {
+ if (i < cnt)
+ {
+ otherPlayers[i].SetActive(true);
+ otherPlayers[i].Display(GuildBossManager.Instance.playerBossHurtRank[cnt - i - 1]);
+ }
+ else
+ {
+ otherPlayers[i].SetActive(false);
+ }
+
+ }
+ }
+
+ void CreateOtherAttacker()
+ {
+ if (otherPlayers.IsNullOrEmpty())
+ {
+ otherPlayers = new List<GuildBossOtherPlayer>();
+ }
+
+ int addCnt = GuildBossManager.Instance.playerBossHurtRank.Count - otherPlayers.Count;
+ for (int i = 0; i < addCnt; i++)
+ {
+ var inst = Instantiate(otherPlayer, attackAreaParent);
+ //鍧愭爣浠巃ttackAreas 闅忔満涓�涓粍浠讹紝鐒跺悗鍦ㄧ粍浠剁殑鑼冨洿鍐呴殢鏈猴紝鐖剁被涓篴ttackAreaParent
+ int pos = UnityEngine.Random.Range(0, attackAreas.Length);
+ var rect = attackAreas[pos] as RectTransform;
+ inst.transform.localPosition = attackAreas[pos].transform.localPosition +
+ new Vector3(UnityEngine.Random.Range(-rect.rect.width / 2, rect.rect.width / 2),
+ UnityEngine.Random.Range(-rect.rect.height / 2, rect.rect.height / 2), 0);
+ inst.NotePos();
+ otherPlayers.Add(inst);
+ }
+ }
+
+ void OtherPlayerAnimation()
+ {
+ if (GuildBossManager.Instance.taofaAtkData.Keys.Count == 0)
+ {
+ return;
+ }
+ var keys = GuildBossManager.Instance.taofaAtkData.Keys.ToList();
+ keys.Sort();
+ int index = keys.IndexOf(GuildBossManager.Instance.lastPlayTick) + 1;
+ if (index >= keys.Count)
+ {
+ index = isOthersLoop ? 0 : -1; //鏄惁寰幆鎾斁
+ }
+ int atkPlayerID = 0;
+ TaofaAtkData atkData = null;
+ if (index >= 0)
+ {
+ GuildBossManager.Instance.lastPlayTick = keys[index];
+ atkData = GuildBossManager.Instance.taofaAtkData[keys[index]];
+ atkPlayerID = atkData.playerID;
+ }
+ for (int i = 0; i < otherPlayers.Count; i++)
+ {
+ if (!otherPlayers[i].isActiveAndEnabled)
+ {
+ continue;
+ }
+ if (otherPlayers[i].moveState != 0)
+ {
+ continue;
+ }
+ // 绐佽繘
+ if (otherPlayers[i].playerID == atkPlayerID)
+ {
+ if (otherPlayers[i].moveState != 1)
+ {
+ otherPlayers[i].moveState = 1;
+ //鍚戠洰鏍� atkTargetPos 绐佽繘80鍚庡洖鍘熶綅缃�
+ Vector3 currentPos = otherPlayers[i].transform.localPosition;
+ Vector3 targetPos = atkTargetPos.localPosition;
+
+ // 璁$畻浠庡綋鍓嶇偣鍒扮洰鏍囩偣鐨勬柟鍚戝悜閲�
+ Vector3 direction = (targetPos - currentPos).normalized;
+
+ // 鍚戠洰鏍囨柟鍚戠Щ鍔�80鐨勮窛绂�
+ Vector3 attackPos = currentPos + direction * 50f;
+
+ // 璁板綍鍘熶綅缃紝鐢ㄤ簬鍚庣画杩斿洖
+ Vector3 originalPos = currentPos;
+
+ // 鍏堢Щ鍔ㄥ埌鏀诲嚮浣嶇疆锛岀劧鍚庤繑鍥炲師浣嶇疆
+ // 鍏堝仠姝㈠師浣嶇疆鐨勭Щ鍔�
+ int _index = i;
+ int valueIndex = i % otherPlayerAttacks.Length;
+ otherPlayerAttacks[valueIndex].transform.localPosition = currentPos + direction * 160f;
+ otherPlayerAttacks[valueIndex].Display(atkData);
+
+ otherPlayers[i].transform.DOKill();
+ otherPlayers[i].transform.DOLocalMove(attackPos, 0.2f).SetEase(Ease.OutQuad)
+ .OnComplete(() =>
+ {
+ otherPlayers[_index].transform.DOLocalMove(originalPos, 0.2f).SetEase(Ease.InQuad);
+ otherPlayers[_index].moveState = 0;
+ });
+ }
+ continue;
+ }
+
+ otherPlayers[i].transform.DOKill();
+ //缂撴參绉诲姩
+ var randomPos = otherPlayers[i].startPos + new Vector3(UnityEngine.Random.Range(-50, 50), UnityEngine.Random.Range(-50, 50), 0);
+ otherPlayers[i].transform.DOLocalMove(randomPos, 2f).SetEase(Ease.InOutSine);
+
+ }
}
}
\ No newline at end of file
--
Gitblit v1.8.0