using System;
using System.IO;
using System.Text;
using Godot;
using Environment = System.Environment;
namespace ColdMint.scripts;
public static class Config
{
public class BehaviorTreeId
{
///
/// 巡逻
/// Patrol
///
public const string Patrol = "Patrol";
}
///
/// BehaviorTreeResult
/// 行为树的结果
///
public class BehaviorTreeResult
{
///
/// Running
/// 运行中
///
public const int Running = 0;
///
/// Success
/// 成功
///
public const int Success = 1;
///
/// Failure
/// 失败
///
public const int Failure = 2;
}
///
/// Camp ID
/// 阵营ID
///
public static class CampId
{
///
/// Default camp
/// 表示默认阵营
///
public const string Default = "Default";
///
/// Demon camp
/// 魔族阵营
///
public const string Mazoku = "Mazoku";
///
/// Aborigines
/// 原住民
///
public const string Aborigines = "Aborigines";
}
///
/// How much blood does a heart represent
/// 一颗心代表多少血量
///
public const int HeartRepresentsHealthValue = 4;
///
/// The maximum number of stacked items in a single inventory
/// 单个物品栏最大堆叠的物品数量
///
public const int MaxStackQuantity = 99;
///
/// Company/Creator name
/// 公司/创作者名字
///
public const string CompanyName = "ColdMint";
///
/// How many item slots are there on the shortcut bar
/// 快捷栏上有多少个物品槽
///
public const int HotBarSize = 10;
///
/// UserID
/// 用户ID
///
public const string UserId = "DefaultUser";
///
/// Whether version isolation is enabled
/// 是否启用版本隔离
///
public const bool EnableVersionIsolation = true;
///
/// Default version name
/// 默认的版本名称
///
///
///Used when version isolation is disabled
///在禁用版本隔离时用的
///
public const string DefaultVersionName = "Default";
///
/// IsDebug
/// 是否为Debug模式
///
///
public static bool IsDebug()
{
return OS.HasFeature("debug");
}
public static string GetVersion()
{
var stringBuilder = new StringBuilder();
stringBuilder.Append(ProjectSettings.GetSetting("application/config/version").AsString());
stringBuilder.Append(IsDebug() ? "_debug" : "_release");
return stringBuilder.ToString();
}
///
/// GetGameDataDirectory
/// 获取游戏数据目录
///
///
public static string GetGameDataDirectory()
{
if (EnableVersionIsolation)
{
return Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), CompanyName,
ProjectSettings.GetSetting("application/config/name").AsString(), UserId,
ProjectSettings.GetSetting("application/config/version").AsString());
}
else
{
return Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), CompanyName,
ProjectSettings.GetSetting("application/config/name").AsString(), UserId,
DefaultVersionName);
}
}
///
/// The initial year of creating this game
/// 创建此游戏的初始年份
///
public const int CreationYear = 2024;
///
/// Tile map, dimensions of individual tiles
/// 瓦片地图,单个瓦片的尺寸
///
public const int CellSize = 32;
///
/// The maximum health of the default creature
/// 默认生物的最大血量
///
public const int DefaultMaxHp = 100;
///
/// When a creature takes damage, how long to hide the bloodline again
/// 生物受到伤害时,要在多长时间后再次隐藏血条
///
public static TimeSpan HealthBarDisplaysTime = TimeSpan.FromSeconds(2);
///
/// Text size of critical hit damage
/// 暴击伤害的文本大小
///
public const int CritDamageTextSize = 33;
///
/// Crit damage multiplier
/// 暴击伤害乘数
///
///
///How much damage to increase after a critical strike
///造成暴击后要将伤害提升到原有的多少倍
///
public const float CriticalHitMultiplier = 2f;
///
/// Text size of normal damage
/// 普通伤害的文本大小
///
public const int NormalDamageTextSize = 22;
///
/// Horizontal speed of damage numbers
/// 伤害数字的水平速度
///
public const int HorizontalSpeedOfDamageNumbers = 3;
///
/// The file name of the packet's manifest
/// 数据包的清单文件名
///
public const string DataPackManifestName = "DataPackManifest.json";
///
/// VerticalVelocityOfDamageNumbers
/// 伤害数字的垂直速度
///
public const int VerticalVelocityOfDamageNumbers = 5;
///
/// Physical collision layer number
/// 物理碰撞层 序号
///
public class LayerNumber
{
public const int RoomArea = 1;
public const int Ground = 2;
public const int Player = 3;
public const int Weapon = 4;
public const int Projectile = 5;
public const int Platform = 6;
public const int Mob = 7;
}
///
/// Specify the type of damage used in the game
/// 指定游戏内使用的伤害类型
///
public class DamageType
{
///
/// physical injury
/// 物理伤害
///
public const int Physical = 1;
///
/// Magic damage
/// 魔法伤害
///
public const int Magic = 2;
}
}