This commit is contained in:
kawagiri 2025-08-27 22:44:05 +08:00
commit c1b5856a91
2 changed files with 30 additions and 14 deletions

View File

@ -474,6 +474,12 @@ namespace RuntimeData
maxScore = player.PlayerScore;
maxScorePlayer = player.Id;
}
var originCity = new HashSet<uint>();
foreach (var player in map.PlayerMap.PlayerDataList)
{
originCity.Add(player.CradleCityId);
}
foreach (var player in map.PlayerMap.PlayerDataList)
{
@ -549,13 +555,12 @@ namespace RuntimeData
// 强大的 弱小的
var selfScore = 0f;
var playerScore = 0f;
foreach (var gridId in Sight.SightGidSet)
{
if (!map.GetUnitDataByGid(gridId, out var unit)) continue;
if (!map.GetPlayerIdByUnitId(unit.Id, out var ownerId)) continue;
if (ownerId == Id) selfScore += unit.GetMilitary();
if (ownerId == player.Id) playerScore += unit.GetMilitary();
}
var selfUnit = new HashSet<UnitData>();
map.GetUnitDataListByPlayerId(Id, selfUnit);
var targetUnit = new HashSet<UnitData>();
map.GetUnitDataListByPlayerId(player.Id, targetUnit);
foreach (var unit in selfUnit) selfScore += unit.GetMilitary();
foreach (var unit in targetUnit) playerScore += unit.GetMilitary();
if (selfScore < playerScore)
{
score += 15;
@ -615,15 +620,21 @@ namespace RuntimeData
}
// 主宰的
var count = 0f;
if (maxScorePlayer == player.Id)
{
var count = 0;
var playerCity = new HashSet<CityData>();
map.GetCityDataListByPlayerId(player.Id, playerCity);
foreach (var city in playerCity) if (Main.CityLogic.CheckCradleCapital(map,player,city)) count++;
if (count > 0) count--;
score -= 15 + count * 5;
selfToPlayer.FeelingStrategyList.Add(FeelingStrategy.Dominative);
var selfCity = new List<CityData>();
map.GetCityDataListByPlayerId(Id, selfCity);
foreach (var city in selfCity)
{
if (originCity.Contains(city.Id)) count++;
}
if (count >= originCity.Count * 0.5f)
{
score -= 15;
selfToPlayer.FeelingStrategyList.Add(FeelingStrategy.Dominative);
}
}
score = Mathf.Max(0, score);

View File

@ -17,6 +17,7 @@ using System.Text.RegularExpressions;
using Logic.Multilingual;
using TMPro;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
@ -419,7 +420,11 @@ namespace Logic.Editor
_idIndex++;
}
_activeSet.Add(textCom.ID);
EditorUtility.SetDirty(textCom);
PrefabUtility.RecordPrefabInstancePropertyModifications(textCom);
}
EditorSceneManager.MarkSceneDirty(uiObj.scene);
// 最后处理 assets
var path = $"Assets/Resources/DataAssets/";