From b19666d8acba43e715688da14fe19f029050e588 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 24 十月 2025 16:40:26 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
---
Main/Config/Configs/BattleMapConfig.cs.meta | 11 +++
Main/System/Battle/BattleField/BattleField.cs | 16 ++++
Main/System/Battle/BattleField/BattleRootNode.cs | 3 +
Main/System/Battle/BattleManager.cs | 4
Main/System/Battle/BattleObject/BattleObject.cs | 14 ++++
Main/System/Battle/BattleField/StoryBossBattleField.cs | 12 ++++
Main/System/Battle/BattleField/StoryBattleField.cs | 37 ++++++++++--
Main/Config/Configs/BattleMapConfig.cs | 44 ++++++++++++++
8 files changed, 128 insertions(+), 13 deletions(-)
diff --git a/Main/Config/Configs/BattleMapConfig.cs b/Main/Config/Configs/BattleMapConfig.cs
new file mode 100644
index 0000000..eda3756
--- /dev/null
+++ b/Main/Config/Configs/BattleMapConfig.cs
@@ -0,0 +1,44 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Friday, October 24, 2025
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class BattleMapConfig : ConfigBase<int, BattleMapConfig>
+{
+ static BattleMapConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int MapID;
+ public string MapName;
+ public string MapBg;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out MapID);
+
+ MapName = tables[1];
+
+ MapBg = tables[2];
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/BattleMapConfig.cs.meta b/Main/Config/Configs/BattleMapConfig.cs.meta
new file mode 100644
index 0000000..a4730b2
--- /dev/null
+++ b/Main/Config/Configs/BattleMapConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 82b47f1893ecf5f4f9100b051e2d6181
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Battle/BattleField/BattleField.cs b/Main/System/Battle/BattleField/BattleField.cs
index 4b8483f..b6c1989 100644
--- a/Main/System/Battle/BattleField/BattleField.cs
+++ b/Main/System/Battle/BattleField/BattleField.cs
@@ -130,7 +130,9 @@
battleObjMgr.Init(this, redTeamList[redTeamIndex], blueTeamList[blueTeamIndex]);
}
- battleRootNode.SetBackground(ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", "mainui_img_277"));
+ LoadMap(MapID);
+
+ // battleRootNode.SetBackground(ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", "mainui_img_277"));
SetBattleStartState();
if (MapID == 1)
@@ -138,13 +140,23 @@
SetSpeedRatio(BattleManager.Instance.speedGear[AutoFightModel.Instance.fightSpeed - 1]);
}
else
- {
+ {
SetSpeedRatio(BattleManager.Instance.speedGear[BattleManager.Instance.speedIndex]);
}
SetRootNodePosition();
rejectNewPackage = false;
OnRoundChange?.Invoke(round, turnMax);
}
+
+ protected virtual void LoadMap(int mapID)
+ {
+ BattleMapConfig battleMapConfig = BattleMapConfig.Get(mapID);
+ if (battleMapConfig != null)
+ {
+ Texture texture = ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", battleMapConfig.MapBg);
+ battleRootNode.SetBackground(texture);
+ }
+ }
public void SetSpeedRatio(float ratio)
{
diff --git a/Main/System/Battle/BattleField/BattleRootNode.cs b/Main/System/Battle/BattleField/BattleRootNode.cs
index f9bd1b6..e0dd2cf 100644
--- a/Main/System/Battle/BattleField/BattleRootNode.cs
+++ b/Main/System/Battle/BattleField/BattleRootNode.cs
@@ -50,6 +50,9 @@
_blueTeamNodeList.Add(blueTrans.gameObject);
}
DontDestroyOnLoad(gameObject);
+
+
+
// SetSortingOrder();
}
diff --git a/Main/System/Battle/BattleField/StoryBattleField.cs b/Main/System/Battle/BattleField/StoryBattleField.cs
index 9b6c5fe..e95ae50 100644
--- a/Main/System/Battle/BattleField/StoryBattleField.cs
+++ b/Main/System/Battle/BattleField/StoryBattleField.cs
@@ -38,6 +38,14 @@
public override void Init(int MapID, int FuncLineID, JsonData _extendData,
List<TeamBase> _redTeamList, List<TeamBase> _blueTeamList, byte turnMax)
{
+ chapter = FuncLineID / 10000;
+ wave = MapID == 1 ? FuncLineID % 100 : 1;//绗嚑娉㈡��
+ level = (FuncLineID % 10000) / 100;
+
+ extendData = _extendData;
+ chapterConfig = MainChapterConfig.Get(chapter);
+ levelConfig = MainLevelConfig.Get(level);
+
base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList, turnMax);
if (null == _blueTeamList || _blueTeamList.Count == 0)
@@ -51,15 +59,20 @@
// LoadBattleMode();
- chapter = FuncLineID / 10000;
- wave = MapID == 1 ? FuncLineID % 100 : 1;//绗嚑娉㈡��
- level = (FuncLineID % 10000) / 100;
- extendData = _extendData;
- chapterConfig = MainChapterConfig.Get(chapter);
- levelConfig = MainLevelConfig.Get(level);
+
+
TeamManager.Instance.OnTeamChange += OnTeamChange;
+ }
+
+ protected override void LoadMap(int mapID)
+ {
+ if (chapterConfig != null)
+ {
+ Texture texture = ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", chapterConfig.BG);
+ battleRootNode.SetBackground(texture);
+ }
}
public override void Release()
@@ -294,7 +307,17 @@
protected override void SetRootNodePosition()
{
battleRootNode.imgBackground.rectTransform.anchoredPosition = battleRootNode.bgPos1.anchoredPosition;
- battleRootNode.battleNode.anchoredPosition = battleRootNode.battleNodePos1.anchoredPosition;
+
+ float screenRatio = (float)Screen.height / (float)Screen.width;
+
+ if (screenRatio > 1.9f)
+ {
+ battleRootNode.battleNode.anchoredPosition = battleRootNode.battleNodePos1.anchoredPosition + new Vector2(0, 60f);
+ }
+ else
+ {
+ battleRootNode.battleNode.anchoredPosition = battleRootNode.battleNodePos1.anchoredPosition;
+ }
}
diff --git a/Main/System/Battle/BattleField/StoryBossBattleField.cs b/Main/System/Battle/BattleField/StoryBossBattleField.cs
index fb71a62..ae18d85 100644
--- a/Main/System/Battle/BattleField/StoryBossBattleField.cs
+++ b/Main/System/Battle/BattleField/StoryBossBattleField.cs
@@ -11,6 +11,8 @@
protected MainLevelConfig levelConfig;
+ protected MainChapterConfig chapterConfig;
+
public StoryBossBattleField(string _guid) : base(_guid)
{
@@ -24,10 +26,20 @@
int level = FuncLineID;// 鍏冲崱
extendData = _extendData;
levelConfig = MainLevelConfig.Get(level);
+ chapterConfig = MainChapterConfig.Get(levelConfig.ChapterID);
SetBattleMode(BattleMode.Record);
}
+ protected override void LoadMap(int mapID)
+ {
+ if (chapterConfig != null)
+ {
+ Texture texture = ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", chapterConfig.MapBG);
+ battleRootNode.SetBackground(texture);
+ }
+ }
+
public override void Release()
{
base.Release();
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 699bbee..af13f2a 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -67,8 +67,8 @@
protected void OnPlayerLoginOk()
{
- long exAttr1 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr1);
- long exAttr2 = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr2);
+ long exAttr1 = PlayerDatas.Instance.baseData.ExAttr1;
+ long exAttr2 = PlayerDatas.Instance.baseData.ExAttr2;
int MapID = 1;
int FuncLineID = (int)exAttr2;
diff --git a/Main/System/Battle/BattleObject/BattleObject.cs b/Main/System/Battle/BattleObject/BattleObject.cs
index 3c0bb25..5b1aa1f 100644
--- a/Main/System/Battle/BattleObject/BattleObject.cs
+++ b/Main/System/Battle/BattleObject/BattleObject.cs
@@ -294,6 +294,8 @@
}
}
+
+
bool isFatalAttack = (null != deadPack) && isLastHit;
if (isFatalAttack)
@@ -307,10 +309,18 @@
}
else
{
- if ((dmgInfo.IsType(DamageType.Damage) || dmgInfo.IsRealdamage()))
+ if (dmgInfo.IsType(DamageType.Block))
{
- motionBase.PlayAnimation(MotionName.hit, false);
+ battleField.battleEffectMgr.PlayEffect(this, 19999, heroRectTrans, Camp);
}
+ else
+ {
+ if ((dmgInfo.IsType(DamageType.Damage) || dmgInfo.IsRealdamage()))
+ {
+ motionBase.PlayAnimation(MotionName.hit, false);
+ }
+ }
+
}
--
Gitblit v1.8.0