Compare commits
No commits in common. "refactor" and "main" have entirely different histories.
|
|
@ -1,8 +1,11 @@
|
|||
{
|
||||
"name": "GeometryTD.Core",
|
||||
"rootNamespace": "GeometryTD.Core",
|
||||
"name": "GeometryTD.Runtime",
|
||||
"rootNamespace": "GeometryTD",
|
||||
"references": [
|
||||
"GUID:363c5eb08ff8e6a439b85e37b8c20d96"
|
||||
"UnityGameFramework.Editor",
|
||||
"UnityGameFramework.Runtime",
|
||||
"Unity.InputSystem",
|
||||
"Unity.TextMeshPro"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"name": "GeometryTD.Runtime",
|
||||
"rootNamespace": "GeometryTD.Runtime",
|
||||
"references": [
|
||||
"GUID:363c5eb08ff8e6a439b85e37b8c20d96",
|
||||
"GUID:75469ad4d38634e559750d17036d5f7c",
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:771b79705393da244ae720aa28ae8a69",
|
||||
"GUID:c53de6f5028489b4689382a86bfbd807",
|
||||
"GUID:0f19320f1ba33834b896afc5a5aaae67"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Android"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"name": "GeometryTD.Gameplay",
|
||||
"rootNamespace": "GeometryTD.Gameplay",
|
||||
"references": [
|
||||
"GUID:771b79705393da244ae720aa28ae8a69"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Android"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c53de6f5028489b4689382a86bfbd807
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"reference": "GUID:c53de6f5028489b4689382a86bfbd807"
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5304296ea426f4d4b8067b7b64a3ad48
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using GameFramework.DataTable;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.CustomEvent;
|
||||
using GeometryTD.DataTable;
|
||||
using GeometryTD.Definition;
|
||||
|
|
@ -80,7 +79,7 @@ namespace GeometryTD.CustomComponent
|
|||
return;
|
||||
}
|
||||
|
||||
_eventFormUseCase.BindEvent(_activeEvent, CreateEventOptionExecutionContext(_activeContext));
|
||||
_eventFormUseCase.BindEvent(_activeEvent, _activeContext);
|
||||
GameEntry.UIRouter.OpenUI(UIFormType.EventForm);
|
||||
GameEntry.Event.Fire(
|
||||
this,
|
||||
|
|
@ -237,12 +236,5 @@ namespace GeometryTD.CustomComponent
|
|||
return seed;
|
||||
}
|
||||
}
|
||||
|
||||
private static EventOptionExecutionContext CreateEventOptionExecutionContext(RunNodeExecutionContext context)
|
||||
{
|
||||
return new EventOptionExecutionContext(
|
||||
context?.RunSeed ?? 0,
|
||||
context?.SequenceIndex ?? -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"reference": "GUID:e67bd2d1b65d48ce8120141996e55b2b"
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bd7362132664f0c499e39663c24ade2d
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"reference": "GUID:0f19320f1ba33834b896afc5a5aaae67"
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4c1cfd0d064e8b3418adeca47c20ae1d
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"reference": "GUID:c53de6f5028489b4689382a86bfbd807"
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6bc6ae941e9ae4c43a4f75e3405d0eaf
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -123,7 +123,7 @@ namespace GeometryTD.CustomComponent
|
|||
|
||||
private int ResolveRandomPrice(RarityType rarity, Random random)
|
||||
{
|
||||
return ShopPriceRuleService.ResolveRandomBuyPrice(rarity, random);
|
||||
return ShopPriceRuleService.ResolveRandomBuyPrice(_shopPriceRows, rarity, random);
|
||||
}
|
||||
|
||||
private static IconAreaContext BuildIconAreaContext(TowerCompItemData item)
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"reference": "GUID:c53de6f5028489b4689382a86bfbd807"
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 93d673219f2a1a94599e67456ea33f7f
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using GeometryTD.Core;
|
||||
using System.Collections.Generic;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityEngine;
|
||||
|
|
@ -43,4 +42,108 @@ namespace GeometryTD.CustomComponent
|
|||
enduranceLoss);
|
||||
}
|
||||
}
|
||||
|
||||
public static class InventoryTowerEnduranceUtility
|
||||
{
|
||||
public static int ReduceTowerEndurance(
|
||||
BackpackInventoryData inventory,
|
||||
IReadOnlyList<long> towerInstanceIds,
|
||||
float enduranceLoss)
|
||||
{
|
||||
float resolvedLoss = Mathf.Max(0f, enduranceLoss);
|
||||
if (inventory?.Towers == null ||
|
||||
inventory.Towers.Count <= 0 ||
|
||||
resolvedLoss <= 0f ||
|
||||
towerInstanceIds == null ||
|
||||
towerInstanceIds.Count <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Dictionary<long, MuzzleCompItemData> muzzleMap = BuildComponentMap(inventory.MuzzleComponents);
|
||||
Dictionary<long, BearingCompItemData> bearingMap = BuildComponentMap(inventory.BearingComponents);
|
||||
Dictionary<long, BaseCompItemData> baseMap = BuildComponentMap(inventory.BaseComponents);
|
||||
HashSet<long> processedTowerIds = new HashSet<long>();
|
||||
|
||||
int affectedCount = 0;
|
||||
for (int i = 0; i < towerInstanceIds.Count; i++)
|
||||
{
|
||||
long towerInstanceId = towerInstanceIds[i];
|
||||
if (towerInstanceId <= 0 || !processedTowerIds.Add(towerInstanceId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!InventoryParticipantUtility.TryGetTowerById(inventory, towerInstanceId, out TowerItemData tower) ||
|
||||
tower == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
bool towerAffected = false;
|
||||
if (muzzleMap.TryGetValue(tower.MuzzleComponentInstanceId, out MuzzleCompItemData muzzleComp))
|
||||
{
|
||||
towerAffected |= TryReduceComponentEndurance(muzzleComp, resolvedLoss);
|
||||
}
|
||||
|
||||
if (bearingMap.TryGetValue(tower.BearingComponentInstanceId, out BearingCompItemData bearingComp))
|
||||
{
|
||||
towerAffected |= TryReduceComponentEndurance(bearingComp, resolvedLoss);
|
||||
}
|
||||
|
||||
if (baseMap.TryGetValue(tower.BaseComponentInstanceId, out BaseCompItemData baseComp))
|
||||
{
|
||||
towerAffected |= TryReduceComponentEndurance(baseComp, resolvedLoss);
|
||||
}
|
||||
|
||||
if (towerAffected)
|
||||
{
|
||||
affectedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return affectedCount;
|
||||
}
|
||||
|
||||
private static bool TryReduceComponentEndurance(TowerCompItemData component, float enduranceLoss)
|
||||
{
|
||||
if (component == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
float originalEndurance = component.Endurance;
|
||||
float nextEndurance = Mathf.Clamp(originalEndurance - Mathf.Max(0f, enduranceLoss), 0f, 100f);
|
||||
if (nextEndurance >= originalEndurance)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
component.Endurance = nextEndurance;
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Dictionary<long, TComp> BuildComponentMap<TComp>(List<TComp> components)
|
||||
where TComp : TowerCompItemData
|
||||
{
|
||||
Dictionary<long, TComp> map = new Dictionary<long, TComp>();
|
||||
if (components == null || components.Count <= 0)
|
||||
{
|
||||
return map;
|
||||
}
|
||||
|
||||
for (int i = 0; i < components.Count; i++)
|
||||
{
|
||||
TComp component = components[i];
|
||||
if (component == null || component.InstanceId <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
map[component.InstanceId] = component;
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using GameFramework.DataTable;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.DataTable;
|
||||
using GeometryTD.Definition;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
@ -39,13 +41,16 @@ namespace GeometryTD.CustomComponent
|
|||
{
|
||||
private readonly PlayerInventoryQueryModel _queryModel;
|
||||
private readonly PlayerInventoryCommandModel _commandModel;
|
||||
private IDataTable<DRShopPrice> _shopPriceTable;
|
||||
|
||||
public PlayerInventoryTradeService(
|
||||
PlayerInventoryQueryModel queryModel,
|
||||
PlayerInventoryCommandModel commandModel)
|
||||
PlayerInventoryCommandModel commandModel,
|
||||
IDataTable<DRShopPrice> shopPriceTable = null)
|
||||
{
|
||||
_queryModel = queryModel;
|
||||
_commandModel = commandModel;
|
||||
_shopPriceTable = shopPriceTable;
|
||||
}
|
||||
|
||||
public bool TryPurchaseComponent(TowerCompItemData item, int price)
|
||||
|
|
@ -174,7 +179,7 @@ namespace GeometryTD.CustomComponent
|
|||
};
|
||||
}
|
||||
|
||||
if (!ShopPriceRuleService.TryResolveTowerSalePrice(tower, inventory, out int towerPrice))
|
||||
if (!ShopPriceRuleService.TryResolveTowerSalePrice(tower, inventory, out int towerPrice, EnsureShopPriceTable()))
|
||||
{
|
||||
return new PlayerInventorySaleCandidate
|
||||
{
|
||||
|
|
@ -244,7 +249,7 @@ namespace GeometryTD.CustomComponent
|
|||
ItemId = component.InstanceId,
|
||||
IsSellable = true,
|
||||
IsTower = false,
|
||||
Price = ShopPriceRuleService.ResolveComponentSalePrice(component),
|
||||
Price = ShopPriceRuleService.ResolveComponentSalePrice(component, EnsureShopPriceTable()),
|
||||
FailureReason = PlayerInventorySaleFailureReason.None
|
||||
};
|
||||
}
|
||||
|
|
@ -385,5 +390,11 @@ namespace GeometryTD.CustomComponent
|
|||
|
||||
return inventory;
|
||||
}
|
||||
|
||||
private IDataTable<DRShopPrice> EnsureShopPriceTable()
|
||||
{
|
||||
_shopPriceTable ??= GameEntry.DataTable.GetDataTable<DRShopPrice>();
|
||||
return _shopPriceTable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"reference": "GUID:c53de6f5028489b4689382a86bfbd807"
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e09026219ecab5e44ab54879792e2b26
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,8 +1,15 @@
|
|||
using System;
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
public static class BinaryReaderExtension
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.Definition;
|
||||
using GeometryTD.CustomUtility;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 底座组件表
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.Definition;
|
||||
using GeometryTD.CustomUtility;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 轴承组件表
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 敌人配置表
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ using System.Text;
|
|||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 实体表。
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using UnityGameFramework.Runtime;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 事件配置表
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.Definition;
|
||||
using GeometryTD.CustomUtility;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 关卡表
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 关卡阶段表
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 关卡阶段出怪条目表
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ using System.Text;
|
|||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 音乐配置表。
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.Definition;
|
||||
using GeometryTD.CustomUtility;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 枪口组件表
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 局外道具掉落池配置表。
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using GeometryTD.Core;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
public sealed class DRRarityTagBudget : DataRowBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using System.Text;
|
|||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 场景配置表。
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using GeometryTD.Core;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
public class DRShopPrice : DataRowBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Text;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 声音配置表。
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.Definition;
|
||||
using GeometryTD.CustomUtility;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Tag 表
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using GeometryTD.Core;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
public sealed class DRTagConfig : DataRowBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Text;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 界面配置表。
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ using System.Text;
|
|||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 声音配置表。
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ using System;
|
|||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
public static class DataTableExtension
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 771b79705393da244ae720aa28ae8a69
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum CombatParticipantTowerValidationFailureReason
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public static class CombatParticipantTowerValidationText
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using GeometryTD.Core;
|
||||
using GeometryTD.CustomUtility;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class AttackPayload
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家背包聚合数据。
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class BuildInfo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class EventItem
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class EventOption
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using GeometryTD.Entity;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class HitStatusModifierContext
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
[StructLayout(LayoutKind.Auto)]
|
||||
public struct ImpactData
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 背包内组件实例基类(非 DataTable,表示玩家持有物)。
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 背包内防御塔实例数据。
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 防御塔独立属性快照。
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum AttackMethodType : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum AttackPropertyType : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 阵营类型。
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 出怪条目类型
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum EventEffectType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum EventRequirementType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum InventoryTagSourceType : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum LevelThemeType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum LevelVictoryType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 关卡阶段结束类型
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum ProcedureMainCombatEntryBlockReason
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum ProcedureMainFlowPhase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum ProcedureMainRunAdvanceResult
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum ProcedureMainRunCompletionResult
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum RarityType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 关系类型。
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum RepoItemClickActionType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum SceneType : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum TagCategory : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum TagTriggerPhase : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum TagType : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum TowerCompSlotType : byte
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 界面编号。
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class AddGoldEffect : EventEffectBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class AddRandomCompsEffect : EventEffectBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class DamageRandomTowerEnduranceEffect : EventEffectBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public abstract class EventEffectBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class RemoveRandomCompsEffect : EventEffectBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,21 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GeometryTD.CustomComponent;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Procedure;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public sealed class EventOptionExecutionContext
|
||||
{
|
||||
public EventOptionExecutionContext(int runSeed, int sequenceIndex)
|
||||
{
|
||||
RunSeed = runSeed;
|
||||
SequenceIndex = sequenceIndex;
|
||||
}
|
||||
|
||||
public int RunSeed { get; }
|
||||
public int SequenceIndex { get; }
|
||||
}
|
||||
|
||||
public sealed class EventOptionExecutor
|
||||
{
|
||||
public EventOptionAvailability EvaluateOption(EventOption option, BackpackInventoryData inventory)
|
||||
|
|
@ -46,7 +37,7 @@ namespace GeometryTD.Core
|
|||
public EventOptionExecutionResult Execute(
|
||||
EventItem eventItem,
|
||||
int optionIndex,
|
||||
EventOptionExecutionContext context,
|
||||
RunNodeExecutionContext context,
|
||||
BackpackInventoryData workingInventory)
|
||||
{
|
||||
if (eventItem == null || workingInventory == null)
|
||||
|
|
@ -81,7 +72,7 @@ namespace GeometryTD.Core
|
|||
EventEffectBase[] effects,
|
||||
EventItem eventItem,
|
||||
int optionIndex,
|
||||
EventOptionExecutionContext context,
|
||||
RunNodeExecutionContext context,
|
||||
BackpackInventoryData workingInventory,
|
||||
bool isRewardPhase)
|
||||
{
|
||||
|
|
@ -152,7 +143,7 @@ namespace GeometryTD.Core
|
|||
RemoveRandomCompsParam param,
|
||||
int eventId,
|
||||
int optionIndex,
|
||||
EventOptionExecutionContext context,
|
||||
RunNodeExecutionContext context,
|
||||
BackpackInventoryData workingInventory,
|
||||
int effectIndex)
|
||||
{
|
||||
|
|
@ -180,7 +171,7 @@ namespace GeometryTD.Core
|
|||
AddRandomCompsParam param,
|
||||
int eventId,
|
||||
int optionIndex,
|
||||
EventOptionExecutionContext context,
|
||||
RunNodeExecutionContext context,
|
||||
BackpackInventoryData workingInventory,
|
||||
int effectIndex)
|
||||
{
|
||||
|
|
@ -190,12 +181,12 @@ namespace GeometryTD.Core
|
|||
return;
|
||||
}
|
||||
|
||||
if (CoreServiceHub.InventoryGeneration == null)
|
||||
if (GameEntry.InventoryGeneration == null)
|
||||
{
|
||||
throw new InvalidOperationException("Event component generation requires InventoryGenerationComponent.");
|
||||
}
|
||||
|
||||
IReadOnlyList<TowerCompItemData> generatedComponents = CoreServiceHub.InventoryGeneration.BuildEventRewardComponents(
|
||||
IReadOnlyList<TowerCompItemData> generatedComponents = GameEntry.InventoryGeneration.BuildEventRewardComponents(
|
||||
addCount,
|
||||
param.MinRarity,
|
||||
param.MaxRarity,
|
||||
|
|
@ -214,7 +205,7 @@ namespace GeometryTD.Core
|
|||
DamageRandomTowerEnduranceParam param,
|
||||
int eventId,
|
||||
int optionIndex,
|
||||
EventOptionExecutionContext context,
|
||||
RunNodeExecutionContext context,
|
||||
BackpackInventoryData workingInventory,
|
||||
int effectIndex)
|
||||
{
|
||||
|
|
@ -281,7 +272,7 @@ namespace GeometryTD.Core
|
|||
}
|
||||
}
|
||||
|
||||
private static bool RollProbability(int eventId, int optionIndex, EventOptionExecutionContext context, float probability)
|
||||
private static bool RollProbability(int eventId, int optionIndex, RunNodeExecutionContext context, float probability)
|
||||
{
|
||||
float clampedProbability = Mathf.Clamp01(probability);
|
||||
if (clampedProbability >= 1f)
|
||||
|
|
@ -299,7 +290,7 @@ namespace GeometryTD.Core
|
|||
}
|
||||
|
||||
private static System.Random CreateRandom(
|
||||
EventOptionExecutionContext context,
|
||||
RunNodeExecutionContext context,
|
||||
int eventId,
|
||||
int optionIndex,
|
||||
int effectIndex,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class CompCountAtLeastRequirement : EventRequirementBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public abstract class EventRequirementBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class GoldAtLeastRequirement : EventRequirementBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class HasRelicRequirement : EventRequirementBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class TowerCountAtLeastRequirement : EventRequirementBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"reference": "GUID:771b79705393da244ae720aa28ae8a69"
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f6496f38c28361745bf703b0dc338bc3
|
||||
AssemblyDefinitionReferenceImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public static class InventoryRarityRuleService
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace GeometryTD.Core
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public enum ParticipantTowerAssignFailureReason
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9aeb92ccac2068f489dcbd0200417463
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
{
|
||||
public static class CoreServiceHub
|
||||
{
|
||||
public static IPlayerInventoryManager PlayerInventory { get; private set; }
|
||||
public static IInventoryGenerationManager InventoryGeneration { get; private set; }
|
||||
public static IEventFlowManager EventFlow { get; private set; }
|
||||
public static ISpriteCacheService SpriteCache { get; private set; }
|
||||
public static IStaticDataService StaticData { get; private set; }
|
||||
public static ITextService TextService { get; private set; }
|
||||
|
||||
public static void Bind(
|
||||
IPlayerInventoryManager playerInventory,
|
||||
IInventoryGenerationManager inventoryGeneration,
|
||||
IEventFlowManager eventFlow,
|
||||
ISpriteCacheService spriteCache,
|
||||
IStaticDataService staticData,
|
||||
ITextService textService)
|
||||
{
|
||||
PlayerInventory = playerInventory ?? throw new ArgumentNullException(nameof(playerInventory));
|
||||
InventoryGeneration = inventoryGeneration ?? throw new
|
||||
ArgumentNullException(nameof(inventoryGeneration));
|
||||
EventFlow = eventFlow ?? throw new ArgumentNullException(nameof(eventFlow));
|
||||
SpriteCache = spriteCache ?? throw new ArgumentNullException(nameof(spriteCache));
|
||||
StaticData = staticData ?? throw new ArgumentNullException(nameof(staticData));
|
||||
TextService = textService ?? throw new ArgumentNullException(nameof(textService));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 95f8a75dcf78e4545b36f1e24b92d82e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
namespace GeometryTD.Core
|
||||
{
|
||||
public interface IEventFlowManager
|
||||
{
|
||||
void EndEvent();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c14fccc4cf6d239489afdc5b302c03b9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace GeometryTD.Core
|
||||
{
|
||||
public interface IInventoryGenerationManager
|
||||
{
|
||||
IReadOnlyList<TowerCompItemData> BuildEventRewardComponents(
|
||||
int count,
|
||||
RarityType minRarity,
|
||||
RarityType maxRarity,
|
||||
int runSeed,
|
||||
int sequenceIndex,
|
||||
int eventId,
|
||||
int optionIndex,
|
||||
int effectIndex);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue