167 lines
6.2 KiB
C#
167 lines
6.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Xml.Linq;
|
|
using Milimoe.FunGame.Core.Api.Utility;
|
|
using Milimoe.FunGame.Core.Entity;
|
|
using Milimoe.FunGame.Core.Library.Constant;
|
|
|
|
namespace Milimoe.GodotGame
|
|
{
|
|
public class GameConstant
|
|
{
|
|
public static Dictionary<long, Character> Characters { get; set; } = [];
|
|
public static Dictionary<Character, Region> CharacterInRegion { get; set; } = [];
|
|
public static Dictionary<long, Region> Regions { get; set; } = [];
|
|
public static string ChapterInGame { get; set; } = "";
|
|
public static string AreaInGame { get; set; } = "";
|
|
public static string NovelName { get; set; } = "";
|
|
public static string SceneName { get; set; } = "";
|
|
public static string NovelNodeKey { get; set; } = "";
|
|
|
|
public static void InitGame()
|
|
{
|
|
Character character = Factory.GetCharacter();
|
|
character.Id = 1;
|
|
character.Name = "雷恩";
|
|
character.FirstName = "Rayne";
|
|
character.NickName = "雷恩";
|
|
character.PrimaryAttribute = PrimaryAttribute.AGI;
|
|
character.InitialATK = 21;
|
|
character.InitialHP = 120;
|
|
character.InitialMP = 20;
|
|
character.InitialSTR = 7;
|
|
character.STRGrowth = 1;
|
|
character.InitialAGI = 21;
|
|
character.AGIGrowth = 1.8;
|
|
character.InitialINT = 2;
|
|
character.INTGrowth = 0.2;
|
|
character.InitialSPD = 300;
|
|
character.InitialHR = 4;
|
|
character.InitialMR = 2;
|
|
Characters.Add(character.Id, character);
|
|
character = Factory.GetCharacter();
|
|
character.Id = 2;
|
|
character.Name = "艾琳";
|
|
character.FirstName = "Irene";
|
|
character.NickName = "艾琳";
|
|
character.PrimaryAttribute = PrimaryAttribute.INT;
|
|
character.InitialATK = 17;
|
|
character.InitialHP = 110;
|
|
character.InitialMP = 80;
|
|
character.InitialSTR = 6;
|
|
character.STRGrowth = 0.5;
|
|
character.InitialAGI = 4;
|
|
character.AGIGrowth = 0.5;
|
|
character.InitialINT = 20;
|
|
character.INTGrowth = 2;
|
|
character.InitialSPD = 270;
|
|
character.InitialHR = 4;
|
|
character.InitialMR = 2;
|
|
Characters.Add(character.Id, character);
|
|
Region region = new()
|
|
{
|
|
Id = 1,
|
|
Guid = Guid.NewGuid(),
|
|
Name = "霜语城废墟",
|
|
Category = "主线地图",
|
|
Description = "第一章",
|
|
Difficulty = RarityType.OneStar,
|
|
Weathers = { ["晴"] = 15, ["阴"] = 10, ["雨"] = 5 }
|
|
};
|
|
region.ChangeRandomWeather();
|
|
Regions.Add(region.Id, region);
|
|
region = new()
|
|
{
|
|
Id = 2,
|
|
Guid = Guid.NewGuid(),
|
|
Name = "幽暗密林",
|
|
Category = "主线地图",
|
|
Description = "第一章",
|
|
Difficulty = RarityType.OneStar,
|
|
Weathers = { ["晴"] = 15, ["阴"] = 10, ["雨"] = 5 }
|
|
};
|
|
region.ChangeRandomWeather();
|
|
Regions.Add(region.Id, region);
|
|
region = new()
|
|
{
|
|
Id = 3,
|
|
Guid = Guid.NewGuid(),
|
|
Name = "翡翠回廊",
|
|
Category = "主线地图",
|
|
Description = "第二章",
|
|
Difficulty = RarityType.OneStar,
|
|
Weathers = { ["晴"] = 15, ["阴"] = 10, ["雨"] = 5 }
|
|
};
|
|
region.ChangeRandomWeather();
|
|
Regions.Add(region.Id, region);
|
|
region = new()
|
|
{
|
|
Id = 4,
|
|
Guid = Guid.NewGuid(),
|
|
Name = "炼狱裂谷",
|
|
Category = "主线地图",
|
|
Description = "第三章",
|
|
Difficulty = RarityType.OneStar,
|
|
Weathers = { ["晴"] = 15, ["阴"] = 10, ["雨"] = 5 }
|
|
};
|
|
region.ChangeRandomWeather();
|
|
Regions.Add(region.Id, region);
|
|
region = new()
|
|
{
|
|
Id = 5,
|
|
Guid = Guid.NewGuid(),
|
|
Name = "虚空回廊",
|
|
Category = "主线地图",
|
|
Description = "第四章",
|
|
Difficulty = RarityType.OneStar,
|
|
Weathers = { ["晴"] = 15, ["阴"] = 10, ["雨"] = 5 }
|
|
};
|
|
region.ChangeRandomWeather();
|
|
Regions.Add(region.Id, region);
|
|
region = new()
|
|
{
|
|
Id = 6,
|
|
Guid = Guid.NewGuid(),
|
|
Name = "地脉祭坛",
|
|
Category = "主线地图",
|
|
Description = "第五章",
|
|
Difficulty = RarityType.OneStar,
|
|
Weathers = { ["晴"] = 15, ["阴"] = 10, ["雨"] = 5 }
|
|
};
|
|
region.ChangeRandomWeather();
|
|
Regions.Add(region.Id, region);
|
|
region = new()
|
|
{
|
|
Id = 7,
|
|
Guid = Guid.NewGuid(),
|
|
Name = "天空圣殿",
|
|
Category = "主线地图",
|
|
Description = "终章",
|
|
Difficulty = RarityType.OneStar,
|
|
Weathers = { ["晴"] = 15, ["阴"] = 10, ["雨"] = 5 }
|
|
};
|
|
region.ChangeRandomWeather();
|
|
Regions.Add(region.Id, region);
|
|
foreach (Character c in Characters.Values)
|
|
{
|
|
CharacterInRegion[c] = Regions[1];
|
|
}
|
|
}
|
|
|
|
public static void AutoSave(int index)
|
|
{
|
|
PluginConfig config = new("Saved", $"auto{index}")
|
|
{
|
|
{ "SavedTime", $"保存时间:{DateTime.Now.ToString(General.GeneralDateTimeFormatChinese)}" },
|
|
{ "ChapterInGame", ChapterInGame },
|
|
{ "AreaInGame", AreaInGame },
|
|
{ "NovelName", NovelName },
|
|
{ "SceneName", SceneName },
|
|
{ "NovelNodeKey", NovelNodeKey },
|
|
{ "Characters", new List<Character>(Characters.Values) }
|
|
};
|
|
config.SaveConfig();
|
|
}
|
|
}
|
|
}
|