init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using GeometryTD.CustomUtility;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class AttackPayload
|
||||
{
|
||||
public int BaseDamage { get; set; }
|
||||
public AttackPropertyType AttackPropertyType { get; set; }
|
||||
public int SourceEntityId { get; set; }
|
||||
public int ProjectileEntityId { get; set; }
|
||||
public Vector3 OriginPosition { get; set; }
|
||||
public TagRuntimeData[] TagRuntimes { get; set; } = Array.Empty<TagRuntimeData>();
|
||||
|
||||
public AttackPayload Clone()
|
||||
{
|
||||
return new AttackPayload
|
||||
{
|
||||
BaseDamage = BaseDamage,
|
||||
AttackPropertyType = AttackPropertyType,
|
||||
SourceEntityId = SourceEntityId,
|
||||
ProjectileEntityId = ProjectileEntityId,
|
||||
OriginPosition = OriginPosition,
|
||||
TagRuntimes = InventoryCloneUtility.CloneTagRuntimes(TagRuntimes)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家背包聚合数据。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class BackpackInventoryData
|
||||
{
|
||||
/// <summary>
|
||||
/// 背包金币。
|
||||
/// </summary>
|
||||
public int Gold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 背包中的枪口组件实例。
|
||||
/// </summary>
|
||||
public List<MuzzleCompItemData> MuzzleComponents { get; set; } = new List<MuzzleCompItemData>();
|
||||
|
||||
/// <summary>
|
||||
/// 背包中的轴承组件实例。
|
||||
/// </summary>
|
||||
public List<BearingCompItemData> BearingComponents { get; set; } = new List<BearingCompItemData>();
|
||||
|
||||
/// <summary>
|
||||
/// 背包中的底座组件实例。
|
||||
/// </summary>
|
||||
public List<BaseCompItemData> BaseComponents { get; set; } = new List<BaseCompItemData>();
|
||||
|
||||
/// <summary>
|
||||
/// 背包中的防御塔实例。
|
||||
/// </summary>
|
||||
public List<TowerItemData> Towers { get; set; } = new List<TowerItemData>();
|
||||
|
||||
/// <summary>
|
||||
/// 参与战斗的防御塔 Id。
|
||||
/// </summary>
|
||||
public List<long> ParticipantTowerInstanceIds { get; set; } = new List<long>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class BuildInfo
|
||||
{
|
||||
public string GameVersion
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public int InternalGameVersion
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string CheckVersionUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string WindowsAppUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string MacOSAppUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string IOSAppUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string AndroidAppUrl
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class EventItem
|
||||
{
|
||||
public EventItem(int id, string title, string description, EventOption[] options)
|
||||
{
|
||||
Id = id;
|
||||
Title = title;
|
||||
Description = description;
|
||||
Options = options ?? System.Array.Empty<EventOption>();
|
||||
}
|
||||
|
||||
public int Id { get; private set; }
|
||||
public string Title { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
public EventOption[] Options { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class EventOption
|
||||
{
|
||||
public string OptionText { get; private set; }
|
||||
public EventRequirementBase[] Requirements { get; private set; }
|
||||
public EventEffectBase[] CostEffects { get; private set; }
|
||||
public EventEffectBase[] RewardEffects { get; private set; }
|
||||
public float Probability { get; private set; }
|
||||
|
||||
public EventOption(
|
||||
string optionText,
|
||||
EventRequirementBase[] requirements,
|
||||
EventEffectBase[] costEffects,
|
||||
EventEffectBase[] rewardEffects,
|
||||
float probability = 1f)
|
||||
{
|
||||
OptionText = optionText;
|
||||
Requirements = requirements ?? System.Array.Empty<EventRequirementBase>();
|
||||
CostEffects = costEffects ?? System.Array.Empty<EventEffectBase>();
|
||||
RewardEffects = rewardEffects ?? System.Array.Empty<EventEffectBase>();
|
||||
Probability = probability;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using GeometryTD.Entity;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class HitStatusModifierContext
|
||||
{
|
||||
public float BonusBurnDurationSeconds { get; set; }
|
||||
public float BonusBurnDamagePerSecond { get; set; }
|
||||
public float BonusSlowDurationSeconds { get; set; }
|
||||
public float BonusSlowRatio { get; set; }
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
BonusBurnDurationSeconds = 0f;
|
||||
BonusBurnDamagePerSecond = 0f;
|
||||
BonusSlowDurationSeconds = 0f;
|
||||
BonusSlowRatio = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class HitContext
|
||||
{
|
||||
public AttackPayload AttackPayload { get; set; }
|
||||
public int FinalDamage { get; set; }
|
||||
public bool IsCriticalHit { get; set; }
|
||||
public bool IsKilled { get; set; }
|
||||
public int TargetEntityId { get; set; }
|
||||
public Vector3 TargetPosition { get; set; }
|
||||
public int TargetCurrentHealthBeforeHit { get; set; }
|
||||
public int TargetCurrentHealthAfterHit { get; set; }
|
||||
public int TargetMaxHealth { get; set; }
|
||||
public float TargetMoveSpeedMultiplierBeforeHit { get; set; } = 1f;
|
||||
public TagType[] TargetStatusTagsBeforeHit { get; set; } = Array.Empty<TagType>();
|
||||
public EnemyTagStatusRuntime TargetStatusRuntime { get; set; }
|
||||
public float? CritRoll { get; set; }
|
||||
public HitStatusModifierContext StatusModifierContext { get; set; } = new HitStatusModifierContext();
|
||||
|
||||
public bool HasTargetStatus(TagType tagType)
|
||||
{
|
||||
if (tagType == TagType.None || TargetStatusTagsBeforeHit == null || TargetStatusTagsBeforeHit.Length <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < TargetStatusTagsBeforeHit.Length; i++)
|
||||
{
|
||||
if (TargetStatusTagsBeforeHit[i] == tagType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool HasSlowStatusBeforeHit => TargetMoveSpeedMultiplierBeforeHit < 0.999f || HasTargetStatus(TagType.Ice);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
[StructLayout(LayoutKind.Auto)]
|
||||
public struct ImpactData
|
||||
{
|
||||
public ImpactData(CampType camp, int hp, int attack, int defense)
|
||||
{
|
||||
Camp = camp;
|
||||
HP = hp;
|
||||
Attack = attack;
|
||||
Defense = defense;
|
||||
}
|
||||
|
||||
public CampType Camp { get; }
|
||||
|
||||
public int HP { get; }
|
||||
|
||||
public int Attack { get; }
|
||||
|
||||
public int Defense { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 背包内组件实例基类(非 DataTable,表示玩家持有物)。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public abstract class TowerCompItemData
|
||||
{
|
||||
/// <summary>
|
||||
/// 组件实例唯一 Id。
|
||||
/// </summary>
|
||||
public long InstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件配置 Id(对应 DataTable Id)。
|
||||
/// </summary>
|
||||
public int ConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件槽位类型。
|
||||
/// </summary>
|
||||
public TowerCompSlotType SlotType { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件名称。
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件品质。
|
||||
/// </summary>
|
||||
public RarityType Rarity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件当前耐久(0~100)。
|
||||
/// </summary>
|
||||
public float Endurance { get; set; } = 100f;
|
||||
|
||||
public bool IsAssembledIntoTower { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件约束(先沿用 DataTable 原定义)。
|
||||
/// </summary>
|
||||
public string Constraint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件当前 Tag(实例态)。
|
||||
/// </summary>
|
||||
public TagType[] Tags { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class MuzzleCompItemData : TowerCompItemData
|
||||
{
|
||||
public MuzzleCompItemData()
|
||||
{
|
||||
SlotType = TowerCompSlotType.Muzzle;
|
||||
}
|
||||
|
||||
public int[] AttackDamage { get; set; }
|
||||
public float DamageRandomRate { get; set; }
|
||||
public AttackMethodType AttackMethodType { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class BearingCompItemData : TowerCompItemData
|
||||
{
|
||||
public BearingCompItemData()
|
||||
{
|
||||
SlotType = TowerCompSlotType.Bearing;
|
||||
}
|
||||
|
||||
public float[] RotateSpeed { get; set; }
|
||||
public float[] AttackRange { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class BaseCompItemData : TowerCompItemData
|
||||
{
|
||||
public BaseCompItemData()
|
||||
{
|
||||
SlotType = TowerCompSlotType.Base;
|
||||
}
|
||||
|
||||
public float[] AttackSpeed { get; set; }
|
||||
public AttackPropertyType AttackPropertyType { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class AccessoryItemData : TowerCompItemData
|
||||
{
|
||||
public AccessoryItemData()
|
||||
{
|
||||
SlotType = TowerCompSlotType.Accessory;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 背包内防御塔实例数据。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class TowerItemData
|
||||
{
|
||||
/// <summary>
|
||||
/// 防御塔实例唯一 Id。
|
||||
/// </summary>
|
||||
public long InstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 防御塔显示名称。
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 防御塔品质。
|
||||
/// </summary>
|
||||
public RarityType Rarity { get; set; }
|
||||
|
||||
public bool IsParticipatingInCombat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 构成该防御塔的枪口组件实例 Id。
|
||||
/// </summary>
|
||||
public long MuzzleComponentInstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 构成该防御塔的轴承组件实例 Id。
|
||||
/// </summary>
|
||||
public long BearingComponentInstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 构成该防御塔的底座组件实例 Id。
|
||||
/// </summary>
|
||||
public long BaseComponentInstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 防御塔独立属性,不依赖组件对象引用。
|
||||
/// </summary>
|
||||
public TowerStatsData Stats { get; set; } = new TowerStatsData();
|
||||
|
||||
[JsonIgnore] public Sprite ComposedIconSprite { get; set; }
|
||||
|
||||
[JsonIgnore] public string ComposedIconKey { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 防御塔独立属性快照。
|
||||
/// 注意:这里是塔实例的独立值,不通过组件引用实时计算。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class TowerStatsData
|
||||
{
|
||||
public int[] AttackDamage { get; set; }
|
||||
public float DamageRandomRate { get; set; }
|
||||
public float[] RotateSpeed { get; set; }
|
||||
public float[] AttackRange { get; set; }
|
||||
public float[] AttackSpeed { get; set; }
|
||||
public AttackMethodType AttackMethodType { get; set; }
|
||||
public AttackPropertyType AttackPropertyType { get; set; }
|
||||
public TagRuntimeData[] TagRuntimes { get; set; }
|
||||
public TagType[] Tags { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
namespace GeometryTD.Definition
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
// 是否需要强制更新游戏应用
|
||||
public bool ForceUpdateGame
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// 最新的游戏版本号
|
||||
public string LatestGameVersion
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// 最新的游戏内部版本号
|
||||
public int InternalGameVersion
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// 最新的资源内部版本号
|
||||
public int InternalResourceVersion
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// 资源更新下载地址
|
||||
public string UpdatePrefixUri
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// 资源版本列表长度
|
||||
public int VersionListLength
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// 资源版本列表哈希值
|
||||
public int VersionListHashCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// 资源版本列表压缩后长度
|
||||
public int VersionListCompressedLength
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// 资源版本列表压缩后哈希值
|
||||
public int VersionListCompressedHashCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user