Merge branch 'temp827'
This commit is contained in:
@ -8,8 +8,8 @@ namespace Data
|
||||
public float moveSpeed = 1;
|
||||
public int attack = 1;
|
||||
public int defense = 0;
|
||||
public int attackSpeed = 2;
|
||||
public int attackRange = 3;
|
||||
public float attackSpeed = 2;
|
||||
public float attackRange = 3;
|
||||
public int attackTargetCount = 1;
|
||||
}
|
||||
}
|
65
Client/Assets/Scripts/Data/AttributesOffsetDef.cs
Normal file
65
Client/Assets/Scripts/Data/AttributesOffsetDef.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using Entity;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class AttributesOffsetDef : Define
|
||||
{
|
||||
// ======================================================================
|
||||
// 绝对值偏移 (Added/Subtracted directly)
|
||||
// ======================================================================
|
||||
public float healthOffset = 0f;
|
||||
public float moveSpeedOffset = 0f;
|
||||
public float attackOffset = 0f;
|
||||
public float defenseOffset = 0f;
|
||||
public float attackSpeedOffset = 0f;
|
||||
public float attackRangeOffset = 0f;
|
||||
|
||||
public float attackTargetCountOffset = 0f;
|
||||
|
||||
// ======================================================================
|
||||
// 百分比偏移 (Multiplied as a factor, e.g., 0.1 for +10%)
|
||||
// ======================================================================
|
||||
public float healthPercentOffset = 0f; // 例如 0.1 表示 +10%
|
||||
public float moveSpeedPercentOffset = 0f;
|
||||
public float attackPercentOffset = 0f;
|
||||
public float defensePercentOffset = 0f;
|
||||
public float attackSpeedPercentOffset = 0f;
|
||||
public float attackRangePercentOffset = 0f;
|
||||
|
||||
public float attackTargetCountPercentOffset = 0f;
|
||||
|
||||
/// <summary>
|
||||
/// 重载 + 操作符,用于合并两个 AttributesOffsetDef 实例。
|
||||
/// </summary>
|
||||
/// <param name="a">第一个属性修正定义。</param>
|
||||
/// <param name="b">第二个属性修正定义。</param>
|
||||
/// <returns>一个新的 AttributesOffsetDef 实例,包含两个输入的累加值。</returns>
|
||||
public static AttributesOffsetDef operator +(AttributesOffsetDef a, AttributesOffsetDef b)
|
||||
{
|
||||
// 处理 null 情况,如果其中一个为 null,则返回另一个的副本(或一个空实例如果两者都为 null)。
|
||||
if (a == null && b == null) return new AttributesOffsetDef();
|
||||
if (a == null) return b; // 如果 a 是 null,返回 b 的值
|
||||
if (b == null) return a; // 如果 b 是 null,返回 a 的值
|
||||
var combined = new AttributesOffsetDef
|
||||
{
|
||||
// 绝对值偏移累加
|
||||
healthOffset = a.healthOffset + b.healthOffset,
|
||||
moveSpeedOffset = a.moveSpeedOffset + b.moveSpeedOffset,
|
||||
attackOffset = a.attackOffset + b.attackOffset,
|
||||
defenseOffset = a.defenseOffset + b.defenseOffset,
|
||||
attackSpeedOffset = a.attackSpeedOffset + b.attackSpeedOffset,
|
||||
attackRangeOffset = a.attackRangeOffset + b.attackRangeOffset,
|
||||
attackTargetCountOffset = a.attackTargetCountOffset + b.attackTargetCountOffset,
|
||||
// 百分比偏移累加
|
||||
healthPercentOffset = a.healthPercentOffset + b.healthPercentOffset,
|
||||
moveSpeedPercentOffset = a.moveSpeedPercentOffset + b.moveSpeedPercentOffset,
|
||||
attackPercentOffset = a.attackPercentOffset + b.attackPercentOffset,
|
||||
defensePercentOffset = a.defensePercentOffset + b.defensePercentOffset,
|
||||
attackSpeedPercentOffset = a.attackSpeedPercentOffset + b.attackSpeedPercentOffset,
|
||||
attackRangePercentOffset = a.attackRangePercentOffset + b.attackRangePercentOffset,
|
||||
attackTargetCountPercentOffset = a.attackTargetCountPercentOffset + b.attackTargetCountPercentOffset
|
||||
};
|
||||
return combined;
|
||||
}
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/AttributesOffsetDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/AttributesOffsetDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb6190c213d44e04946784c3a5063e83
|
||||
timeCreated: 1756302637
|
7
Client/Assets/Scripts/Data/AudioDef.cs
Normal file
7
Client/Assets/Scripts/Data/AudioDef.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Data
|
||||
{
|
||||
public class AudioDef:Define
|
||||
{
|
||||
public string path;
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/AudioDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/AudioDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea58fdcb622943429532fd1b9d264340
|
||||
timeCreated: 1756397633
|
@ -149,6 +149,8 @@ namespace Data
|
||||
public string packID;
|
||||
public string packRootPath;
|
||||
|
||||
public int priority = -1;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
|
@ -231,7 +231,7 @@ namespace Data
|
||||
public List<DrawNodeDef> nodes = new();
|
||||
public string nodeName;
|
||||
public Vector2 position = new(0, 0);
|
||||
public float FPS = 0.5f;
|
||||
public float FPS = 1f;
|
||||
|
||||
public override bool Init(XElement xmlDef)
|
||||
{
|
||||
|
@ -7,8 +7,9 @@ namespace Data
|
||||
|
||||
public BehaviorTreeDef behaviorTree;
|
||||
public AffiliationDef affiliation;
|
||||
|
||||
|
||||
|
||||
public DrawNodeDef deathAnimation;
|
||||
public EventDef[] deathEffects;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,21 +1,8 @@
|
||||
namespace Data
|
||||
{
|
||||
public enum EventType
|
||||
{
|
||||
None,
|
||||
SpawnCharacter,
|
||||
SpawnBuilding,
|
||||
SpawnBullet,
|
||||
SpawnPickup,
|
||||
SpawnDefaultEntity,
|
||||
}
|
||||
public class EventDef : Define
|
||||
{
|
||||
public EventType eventType = EventType.None;
|
||||
public EntityDef entityDef_Character; // 用于 EventType.SpawnCharacter
|
||||
public BuildingDef entityDef_Building; // 用于 EventType.SpawnBuilding
|
||||
public BulletDef entityDef_Bullet; // 用于 EventType.SpawnBullet
|
||||
public ItemDef entityDef_Pickup; // 用于 EventType.SpawnPickup
|
||||
public EventDef() { }
|
||||
public string workClass;
|
||||
public string value;
|
||||
}
|
||||
}
|
17
Client/Assets/Scripts/Data/HediffCompDef.cs
Normal file
17
Client/Assets/Scripts/Data/HediffCompDef.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class HediffCompDef:Define
|
||||
{
|
||||
public Type compClass;
|
||||
public override bool Init(XElement xmlDef)
|
||||
{
|
||||
base.Init(xmlDef);
|
||||
var name = xmlDef.Attribute("class")?.Value??"";
|
||||
compClass=Type.GetType(name);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/HediffCompDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/HediffCompDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92779af4b74648a99930c10376760af6
|
||||
timeCreated: 1756303386
|
13
Client/Assets/Scripts/Data/HediffDef.cs
Normal file
13
Client/Assets/Scripts/Data/HediffDef.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class HediffDef:Define
|
||||
{
|
||||
public float time = -1;
|
||||
// Hediff的发展阶段列表
|
||||
public List<HediffStageDef> stages = new List<HediffStageDef>();
|
||||
// 附加的组件列表
|
||||
public List<HediffCompDef> comps = new List<HediffCompDef>();
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/HediffDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/HediffDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4311115be2f4da8a5a27e1bb298928e
|
||||
timeCreated: 1756303757
|
8
Client/Assets/Scripts/Data/HediffStageDef.cs
Normal file
8
Client/Assets/Scripts/Data/HediffStageDef.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Data
|
||||
{
|
||||
public class HediffStageDef:Define
|
||||
{
|
||||
public float start;
|
||||
public AttributesOffsetDef attributesOffset = new();
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/HediffStageDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/HediffStageDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59d3b562e68e40fdaa65e5e6431c58e0
|
||||
timeCreated: 1756304101
|
@ -4,7 +4,6 @@ namespace Data
|
||||
{
|
||||
public class ImageDef : Define
|
||||
{
|
||||
public string name;
|
||||
public string path;
|
||||
public int wCount;
|
||||
public int hCount;
|
||||
@ -13,7 +12,6 @@ namespace Data
|
||||
public override bool Init(XElement xmlDef)
|
||||
{
|
||||
base.Init(xmlDef);
|
||||
name = defName;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
47
Client/Assets/Scripts/Data/MessageDef.cs
Normal file
47
Client/Assets/Scripts/Data/MessageDef.cs
Normal file
@ -0,0 +1,47 @@
|
||||
namespace Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 定义提示文本在游戏或应用中显示方式的类别。
|
||||
/// Defines categories for how prompt text is displayed in a game or application.
|
||||
/// </summary>
|
||||
public enum PromptDisplayCategory
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认或未分类的显示方式。
|
||||
/// Default or uncategorized display method.
|
||||
/// </summary>
|
||||
Default = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 显示在玩家当前焦点实体(例如NPC或交互物)上方,以聊天气泡的形式呈现。
|
||||
/// Displayed as a chat bubble above the player's currently focused entity (e.g., NPC, interactive object).
|
||||
/// </summary>
|
||||
FocusedEntityChatBubble,
|
||||
|
||||
/// <summary>
|
||||
/// 显示在玩家当前焦点实体(例如NPC或交互物)的头顶,通常是简短的状态、名称或互动提示。
|
||||
/// Displayed as text above the player's currently focused entity (e.g., NPC, interactive object), typically for short status, names, or interaction prompts.
|
||||
/// </summary>
|
||||
FocusedEntityOverheadText,
|
||||
|
||||
/// <summary>
|
||||
/// 大型文本显示在屏幕中央,通常用于重要通知、标题或剧情提示,需要玩家立即注意。
|
||||
/// Large text displayed in the center of the screen, typically for important announcements, titles, or narrative prompts that demand immediate player attention.
|
||||
/// </summary>
|
||||
ScreenCenterLargeText,
|
||||
|
||||
/// <summary>
|
||||
/// 非焦点提示,通常以不易干扰的方式(如屏幕边缘、HUD小字或右下角浮动)显示,提供辅助信息、次要指引或环境提示。
|
||||
/// Non-focused hint, typically displayed in a non-intrusive way (e.g., screen corner, small HUD text, or bottom-right floating message) to provide auxiliary information, minor guidance, or environmental cues.
|
||||
/// </summary>
|
||||
PassiveHint,
|
||||
|
||||
}
|
||||
|
||||
public class MessageDef : Define
|
||||
{
|
||||
public PromptDisplayCategory type;
|
||||
public string text;
|
||||
public string color;
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/MessageDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/MessageDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8df8531d3d53412e8c299262aeea6f57
|
||||
timeCreated: 1756860490
|
11
Client/Assets/Scripts/Data/SkillTreeDef.cs
Normal file
11
Client/Assets/Scripts/Data/SkillTreeDef.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace Data
|
||||
{
|
||||
public class SkillTreeDef:Define
|
||||
{
|
||||
public string tag="Default";
|
||||
public AffiliationDef faction;
|
||||
public SkillTreeDef[] prerequisites;
|
||||
public WeaponDef[] unlockedWeapons;
|
||||
public HediffDef[] unlockedHediffs;
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/SkillTreeDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/SkillTreeDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08ca1b39c5b342ceb23bd565d433ac66
|
||||
timeCreated: 1756705012
|
14
Client/Assets/Scripts/Data/StoryDef.cs
Normal file
14
Client/Assets/Scripts/Data/StoryDef.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace Data
|
||||
{
|
||||
public class StoryStageDef : Define
|
||||
{
|
||||
public float lastWaitTime = 0;
|
||||
public float nextWaitTime = 0;
|
||||
public EventDef eventDef;
|
||||
public MessageDef messageDef;
|
||||
}
|
||||
public class StoryDef:Define
|
||||
{
|
||||
public StoryStageDef[] storyStage;
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/StoryDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/StoryDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e11d701b7d8b4af0a947d630884bfeab
|
||||
timeCreated: 1756306428
|
Reference in New Issue
Block a user