From e3ffaf333f0cf198af908fe8e69619aa77b9903c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 14 一月 2026 18:13:13 +0800
Subject: [PATCH] 287 【公会】BOSS讨伐
---
Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA504_tagSCFamilyTaofaAtkRet.cs | 7 +-
Main/System/Guild/GuildBossManager.cs | 22 ++++++-
Main/System/Guild/GuildBossWin.cs | 148 ++++++++++++++++++++++++++++++++++++++++++++++--
3 files changed, 163 insertions(+), 14 deletions(-)
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA504_tagSCFamilyTaofaAtkRet.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA504_tagSCFamilyTaofaAtkRet.cs
index 7ca7bf9..f399a2b 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA504_tagSCFamilyTaofaAtkRet.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA504_tagSCFamilyTaofaAtkRet.cs
@@ -1,11 +1,12 @@
-using UnityEngine;
-using System.Collections;
-
+using UnityEngine;
+using System.Collections;
+
// A5 04 鍏細璁ㄤ紣鏀诲嚮缁撴灉 #tagSCFamilyTaofaAtkRet
public class DTCA504_tagSCFamilyTaofaAtkRet : DtcBasic {
public override void Done(GameNetPackBasic vNetPack) {
base.Done(vNetPack);
HA504_tagSCFamilyTaofaAtkRet vNetData = vNetPack as HA504_tagSCFamilyTaofaAtkRet;
+ GuildBossManager.Instance.UpdateAtkResult(vNetData);
}
}
diff --git a/Main/System/Guild/GuildBossManager.cs b/Main/System/Guild/GuildBossManager.cs
index 61c8335..06b4aef 100644
--- a/Main/System/Guild/GuildBossManager.cs
+++ b/Main/System/Guild/GuildBossManager.cs
@@ -24,6 +24,10 @@
public long m_BoxHurt; // 浠婃棩浼ゅ
public long m_BoxHurtHis; // 鍘嗗彶浼ゅ
+ //鏀诲嚮鏁版嵁
+ public HA504_tagSCFamilyTaofaAtkRet atkResult;
+ public event Action AtkResultEvent;
+
//閰嶇疆
public int initSuperHitRate;
public int[] bzAddAttrs;
@@ -33,7 +37,7 @@
public int[][] atkItemList;
public int maxAngerValue;
- public int[] bxCumulativeDamageList;
+ public long[] bxCumulativeDamageList;
public int bxDailyMax; //涓汉姣忔棩浜у嚭涓婇檺
public int bxDailyAwardMax; //涓汉姣忔棩棰嗗彇濂栧姳涓婇檺
public int addAtkCntItemID = 17; //澧炲姞璁ㄤ紣娆℃暟閬撳叿ID
@@ -61,7 +65,7 @@
// 鏁板��2锛氭瘡鏃ヤ釜浜鸿础鐚疂绠辨暟涓婇檺锛屾渶鍚庝竴妗e彲寰幆锛屼笂闄愭帶鍒�
// 鏁板��3锛氭瘡鏃ヤ釜浜洪鍙栧疂绠卞鍔变釜鏁颁笂闄�
config = FuncConfigConfig.Get("FamilyTaofaBox");
- bxCumulativeDamageList = JsonMapper.ToObject<int[]>(config.Numerical1);
+ bxCumulativeDamageList = JsonMapper.ToObject<long[]>(config.Numerical1);
bxDailyMax = int.Parse(config.Numerical2);
bxDailyAwardMax = int.Parse(config.Numerical3);
}
@@ -129,6 +133,12 @@
BossHurtEvent?.Invoke();
}
+ public void UpdateAtkResult(HA504_tagSCFamilyTaofaAtkRet netPack)
+ {
+ atkResult = netPack;
+ AtkResultEvent?.Invoke();
+ }
+
public int GetHasAtkCnt()
{
@@ -170,8 +180,13 @@
}
//鍒ゆ柇鏄惁鏂扮殑鍏細鏁版嵁
- if (vNetData.FamilyActionList.Length == 1 && vNetData.FamilyActionList[0].Value1 == 1)
+ for (int i = 0; i < vNetData.Count; i++)
{
+ var playerID = (int)vNetData.FamilyActionList[i].Value1;
+ if (playerID != 1)
+ {
+ continue;
+ }
if (bossActions.ContainsKey(1) && bossActions[1].Time != vNetData.FamilyActionList[0].Time)
{
bossActions.Clear();
@@ -179,6 +194,7 @@
}
}
+
for (int i = 0; i < vNetData.Count; i++)
{
bossActions[(int)vNetData.FamilyActionList[i].Value1] = vNetData.FamilyActionList[i];
diff --git a/Main/System/Guild/GuildBossWin.cs b/Main/System/Guild/GuildBossWin.cs
index 979e6ec..65535f8 100644
--- a/Main/System/Guild/GuildBossWin.cs
+++ b/Main/System/Guild/GuildBossWin.cs
@@ -36,7 +36,7 @@
[SerializeField] Button atkBtn;
[SerializeField] Image angerAtk; //鎬掓皵鏀诲嚮
[SerializeField] Transform normalAtk; //鏅�氭敾鍑�
- [SerializeField] UIEffectPlayer atkEffect; //鏅�氭敾鍑荤壒鏁� 0娆′笉鏄剧ず
+ [SerializeField] UIEffectPlayer atkEffect; //鏅�氭敾鍑荤壒鏁� 0娆′笉鏄剧ず 鎸夐挳鐢�
[SerializeField] Text normalAtkCntText; //鏅�氭敾鍑绘鏁�
[SerializeField] Text atkCDText; //鏀诲嚮cd
[SerializeField] Transform addTimesRect;
@@ -55,6 +55,15 @@
[SerializeField] Transform attackArea3;
[SerializeField] GuildBossOtherPlayer otherPlayer; //鍒涘缓澶氫釜鐢�
[SerializeField] GuildBossOtherPlayerAttack otherPlayerAttack; //鍒涘缓澶氫釜鐢�
+
+ //鑷繁鐨勬敾鍑�
+ [SerializeField] UIEffectPlayer hurtEffect;
+ [SerializeField] UIEffectPlayer hurtAngerEffect;
+ [SerializeField] Text[] hurtValues;
+ [SerializeField] Text[] awardValues;
+ [SerializeField] Image[] awardIcons;
+ [SerializeField] Transform pos1;
+ [SerializeField] Transform pos2;
[SerializeField] Transform fakeRedBZ;
[SerializeField] Transform fakeRedAward;
@@ -79,15 +88,21 @@
{
UIManager.Instance.OpenWindow<GuildBossAwardWin>();
});
+
+ bossModel.Create(GuildBossManager.Instance.bossSkinID, 1, motionName: "chuxian");
+ heroModel.Create(PhantasmPavilionManager.Instance.GetMyModelSkinID(), 1.5f);
}
protected override void OnPreOpen()
{
+
GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefresh;
GuildBossManager.Instance.BossHurtEvent += BossHurtEvent;
+ GuildBossManager.Instance.AtkResultEvent += AtkResultEvent;
Display();
+ InitAttack();
}
protected override void OnPreClose()
@@ -95,7 +110,14 @@
GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefresh;
GuildBossManager.Instance.BossHurtEvent -= BossHurtEvent;
+ GuildBossManager.Instance.AtkResultEvent -= AtkResultEvent;
+
}
+ protected override void NextFrameAfterOpen()
+ {
+ SoundPlayer.Instance.PlayUIAudio(28);
+ }
+
void Display()
@@ -108,8 +130,7 @@
nameText.text = PlayerDatas.Instance.baseData.PlayerName;
BossHurtEvent();
- bossModel.Create(GuildBossManager.Instance.bossSkinID);
- heroModel.Create(PhantasmPavilionManager.Instance.GetMyModelSkinID());
+
}
//鎴樺姏鍙樺寲
@@ -304,11 +325,11 @@
curLayer = (int)bossAction.Value3;
}
- if (curLayer >= GuildBossManager.Instance.bzMaxLevel)
- {
- SysNotifyMgr.Instance.ShowTip("GuildBoss2");
- return;
- }
+ // if (curLayer >= GuildBossManager.Instance.bzMaxLevel)
+ // {
+ // SysNotifyMgr.Instance.ShowTip("GuildBoss2");
+ // return;
+ // }
if (GuildBossManager.Instance.m_BuZhenState == 1)
{
SysNotifyMgr.Instance.ShowTip("GuildBoss1");
@@ -371,4 +392,115 @@
ShowDynamicUI();
}
+ void AtkResultEvent()
+ {
+ //1. 鐜╁浠巔os1 绉诲姩鍒皃os2
+ //2. 鎾斁鏀诲嚮鍔ㄤ綔 - 鏄剧ず瀵瑰簲绫诲瀷鐗规晥
+ //3. 寤惰繜100姣椋樿鐗╁搧
+ heroModel.onComplete = null;
+ heroModel.PlayAnimation("run");
+ heroModel.transform.localPosition = pos1.localPosition;
+ heroModel.transform.DOLocalMove(pos2.localPosition, 0.3f).OnComplete(() =>
+ {
+ ShowDmg().Forget();
+ });
+
+ }
+
+ async UniTask ShowDmg()
+ {
+ heroModel.onComplete = () =>
+ {
+ heroModel.transform.localPosition = pos1.localPosition;
+ };
+ heroModel.PlayAnimation("attack");
+ if (GuildBossManager.Instance.atkResult.AtkType == 0)
+ {
+ hurtEffect.Play();
+ }
+ else
+ {
+ hurtAngerEffect.Play();
+ }
+ bossModel.PlayAnimation("hit");
+ bossModel.onComplete = () =>
+ {
+ bossModel.PlayAnimation("idle", true);
+ bossModel.onComplete = null;
+ };
+
+ for (int i = 0; i < hurtValues.Length; i++)
+ {
+ if (i < GuildBossManager.Instance.atkResult.HurtCount)
+ {
+ int index = i;
+ hurtValues[i].SetActive(true);
+ var tween = hurtValues[i].GetComponent<PositionTween>();
+ tween.SetStartState();
+ tween.Play(() =>
+ {
+ hurtValues[index].SetActive(false);
+ });
+ var hurtData = GuildBossManager.Instance.atkResult.HurtList[i];
+ BattleDmg dmg = new BattleDmg()
+ {
+ damage = hurtData.HurtValue + hurtData.HurtValueEx * Constants.ExpPointValue,
+ attackType = hurtData.IsSuper == 1 ? (int)DamageType.CritDamage : 2
+ };
+ hurtValues[i].text = BattleUtility.DisplayDamageNum(dmg);
+ await UniTask.Delay(100);
+ }
+ else
+ {
+ hurtValues[i].SetActive(false);
+ }
+ }
+
+ for (int i = 0; i < awardValues.Length; i++)
+ {
+ if (i < GuildBossManager.Instance.atkResult.ItemCount)
+ {
+ var itemData = GuildBossManager.Instance.atkResult.ItemList[i];
+ awardValues[i].SetActive(true);
+ var tween = hurtValues[i].GetComponent<PositionTween>();
+ tween.SetStartState();
+ int index = i;
+ tween.Play(() =>
+ {
+ awardValues[index].SetActive(false);
+ });
+
+
+ awardValues[i].text = itemData.Count.ToString();
+ awardIcons[i].SetItemSprite((int)itemData.ItemID);
+ await UniTask.Delay(100);
+ }
+ else
+ {
+ awardValues[i].SetActive(false);
+ }
+ }
+
+ }
+
+ void InitAttack()
+ {
+ for (int i = 0; i < hurtValues.Length; i++)
+ {
+ hurtValues[i].SetActive(false);
+ }
+
+ for (int i = 0; i < awardValues.Length; i++)
+ {
+ awardValues[i].SetActive(false);
+ }
+
+ heroModel.transform.localPosition = pos1.localPosition;
+ bossModel.onComplete = () =>
+ {
+ bossModel.PlayAnimation("idle", true);
+ bossModel.onComplete = null;
+ };
+ bossModel.PlayAnimation("chuxian");
+ }
}
\ No newline at end of file
--
Gitblit v1.8.0