为实体编号添加枚举;修改实体创建器

This commit is contained in:
milimoe 2024-09-21 01:31:06 +08:00
parent 8bcddf642f
commit 6d244bb77b
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
62 changed files with 3101 additions and 608 deletions

View File

@ -24,4 +24,13 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Update="Solutions\EntityCreator\CreateItem.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="Solutions\EntityCreator\CreateSkill.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project> </Project>

View File

@ -1,388 +0,0 @@
using Microsoft.VisualBasic;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Interface.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class EntityCreator : Form
{
private CharacterCreator CharacterCreator { get; } = new();
private SkillCreator SkillCreator { get; } = new();
private ItemCreator ItemCreator { get; } = new();
private GameModuleLoader GameModuleLoader { get; }
private bool CheckSelectedIndex => .SelectedIndex != -1 && .SelectedIndex < .Items.Count;
private int nowClick = 0;
public EntityCreator()
{
InitializeComponent();
GameModuleLoader = LoadModules();
CharacterCreator.Load();
SkillCreator.Load();
ItemCreator.Load();
();
();
();
}
private void ()
{
.Items.Clear();
foreach (string name in CharacterCreator.LoadedCharacters.Keys)
{
.Items.Add(CharacterCreator.LoadedCharacters[name]);
}
nowClick = 0;
}
private void ()
{
.Items.Clear();
foreach (string name in SkillCreator.LoadedSkills.Keys)
{
.Items.Add(SkillCreator.LoadedSkills[name].GetIdName());
}
nowClick = 1;
}
private void ()
{
.Items.Clear();
foreach (string name in ItemCreator.LoadedItems.Keys)
{
.Items.Add(ItemCreator.LoadedItems[name].GetIdName());
}
nowClick = 2;
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 0)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 1)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 2)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
CharacterCreator.Save();
SkillCreator.Save();
ItemCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
CharacterCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
SkillCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
ItemCreator.Save();
MessageBox.Show("保存成功!");
}
private Skill? (long id, string name)
{
foreach (SkillModule module in GameModuleLoader.Skills.Values)
{
Skill? s = module.GetSkill(id, name);
if (s != null)
{
return s;
}
}
return null;
}
private Item? (long id, string name)
{
foreach (ItemModule module in GameModuleLoader.Items.Values)
{
Item? i = module.GetItem(id, name);
if (i != null)
{
return i;
}
}
return null;
}
private void _MouseDoubleClick(object sender, EventArgs e)
{
if (CheckSelectedIndex)
{
ShowDetail d = new();
switch (nowClick)
{
case 0:
d.SetText(CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault()?.GetInfo() ?? "");
d.ShowDialog();
break;
case 1:
Skill? s = SkillCreator.LoadedSkills.Values.Where(c => c.GetIdName() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
if (s != null)
{
s = (s.Id, s.Name);
if (s != null)
{
d.SetText(s.ToString() ?? "");
d.ShowDialog();
}
}
break;
case 2:
Item? i = ItemCreator.LoadedItems.Values.Where(c => c.GetIdName() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
if (i != null)
{
i = (i.Id, i.Name);
if (i != null)
{
d.SetText(i.ToString() ?? "");
d.ShowDialog();
}
}
break;
default:
break;
}
d.Dispose();
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0)
{
if (SkillCreator.LoadedSkills.Count != 0)
{
Showlist l = new();
l.AddListItem(SkillCreator.LoadedSkills.Values.Select(s => s.GetIdName()).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Character? c = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
Skill? s = SkillCreator.LoadedSkills.Values.Where(s => s.GetIdName() == selected).FirstOrDefault();
if (c != null && s != null)
{
s = (s.Id, s.Name);
if (s != null) c.Skills.Add(s);
}
}
else
{
MessageBox.Show("技能列表为空!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0)
{
if (ItemCreator.LoadedItems.Count != 0)
{
Showlist l = new();
l.AddListItem(ItemCreator.LoadedItems.Values.Select(i => i.GetIdName()).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Character? c = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
Item? i = ItemCreator.LoadedItems.Values.Where(i => i.GetIdName() == selected).FirstOrDefault();
if (c != null && i != null)
{
i = (i.Id, i.Name);
if (i != null) c.Items.Add(i);
}
}
else
{
MessageBox.Show("物品列表为空!");
}
}
}
private void _Click(object sender, EventArgs e)
{
Character c = Factory.GetCharacter();
c.Name = Interaction.InputBox("输入姓", "姓", "");
c.FirstName = Interaction.InputBox("输入名", "名", "");
c.NickName = Interaction.InputBox("输入昵称", "昵称", "");
string primaryAttributeInput = Interaction.InputBox("输入核心属性 (STR, AGI, INT)", "核心属性", "None");
c.PrimaryAttribute = Enum.TryParse(primaryAttributeInput, out PrimaryAttribute primaryAttribute) ? primaryAttribute : PrimaryAttribute.None;
// 解析 double 类型的输入
c.InitialATK = double.Parse(Interaction.InputBox("输入初始攻击力", "初始攻击力", "0.0"));
c.InitialHP = double.Parse(Interaction.InputBox("输入初始生命值", "初始生命值", "1.0"));
c.InitialMP = double.Parse(Interaction.InputBox("输入初始魔法值", "初始魔法值", "0.0"));
c.InitialSTR = double.Parse(Interaction.InputBox("输入初始力量", "初始力量", "0.0"));
c.STRGrowth = double.Parse(Interaction.InputBox("输入力量成长", "力量成长", "0.0"));
c.InitialAGI = double.Parse(Interaction.InputBox("输入初始敏捷", "初始敏捷", "0.0"));
c.AGIGrowth = double.Parse(Interaction.InputBox("输入敏捷成长", "敏捷成长", "0.0"));
c.InitialINT = double.Parse(Interaction.InputBox("输入初始智力", "初始智力", "0.0"));
c.INTGrowth = double.Parse(Interaction.InputBox("输入智力成长", "智力成长", "0.0"));
c.InitialSPD = double.Parse(Interaction.InputBox("输入初始行动速度", "初始行动速度", "0.0"));
c.InitialHR = double.Parse(Interaction.InputBox("输入初始生命回复", "初始生命回复", "0.0"));
c.InitialMR = double.Parse(Interaction.InputBox("输入初始魔法回复", "初始魔法回复", "0.0"));
string name = Interaction.InputBox("输入角色代号以确认创建", "角色代号", "");
if (name != "" && c.Name != "" && CharacterCreator.Add(name, c))
{
MessageBox.Show("创建成功!");
();
ShowDetail d = new();
d.SetText(c.GetInfo());
d.ShowDialog();
d.Dispose();
}
else
{
MessageBox.Show("创建已取消。");
}
}
private void _Click(object sender, EventArgs e)
{
Skill s = Factory.GetSkill();
s.Id = long.Parse(Interaction.InputBox("输入技能编号", "技能编号", "0"));
s.Name = Interaction.InputBox("输入技能名称", "技能名称", "");
string name = Interaction.InputBox("输入技能代号以确认创建", "技能代号", "");
if (name != "" && s.Id != 0 && s.Name != "" && SkillCreator.Add(name, s))
{
MessageBox.Show("创建成功!");
();
ShowDetail d = new();
d.SetText(s.ToString());
d.ShowDialog();
d.Dispose();
}
else
{
MessageBox.Show("创建已取消。");
}
}
private void _Click(object sender, EventArgs e)
{
Item i = Factory.GetItem();
i.Id = long.Parse(Interaction.InputBox("输入物品编号", "物品编号", "0"));
i.Name = Interaction.InputBox("输入物品名称", "物品名称", "");
string name = Interaction.InputBox("输入物品代号以确认创建", "物品代号", "");
if (name != "" && i.Id != 0 && i.Name != "" && ItemCreator.Add(name, i))
{
MessageBox.Show("创建成功!");
();
ShowDetail d = new();
d.SetText(i.ToString());
d.ShowDialog();
d.Dispose();
}
else
{
MessageBox.Show("创建已取消。");
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = CharacterCreator.LoadedCharacters.Where(ky => ky.Value.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (CharacterCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = SkillCreator.LoadedSkills.Where(ky => ky.Value.GetIdName() == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (SkillCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = ItemCreator.LoadedItems.Where(ky => ky.Value.GetIdName() == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (ItemCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (MessageBox.Show("重新读取会丢失未保存的数据,是否确认重新读取全部?", "重新读取全部", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
CharacterCreator.Load();
SkillCreator.Load();
ItemCreator.Load();
();
();
();
}
}
private static GameModuleLoader LoadModules()
{
PluginLoader plugins = PluginLoader.LoadPlugins([]);
foreach (string plugin in plugins.Plugins.Keys)
{
Console.WriteLine(plugin + " is loaded.");
}
return GameModuleLoader.LoadGameModules(FunGameInfo.FunGame.FunGame_Desktop, []);
}
}
}

View File

@ -9,9 +9,13 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions
public void Load() public void Load()
{ {
EntityModuleConfig<Character> config = new("redbud.fun.entitycreator", "charactercreator"); EntityModuleConfig<Character> config = new("EntityCreator", "character.creator");
config.LoadConfig(); config.LoadConfig();
LoadedCharacters = new(config); LoadedCharacters = new(config);
foreach (Character c in LoadedCharacters.Values)
{
c.Recovery();
}
} }
public bool Add(string name, Character character) public bool Add(string name, Character character)
@ -26,12 +30,18 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions
public void Save() public void Save()
{ {
EntityModuleConfig<Character> config = new("redbud.fun.entitycreator", "charactercreator"); EntityModuleConfig<Character> config = new("EntityCreator", "character.creator");
foreach (string key in LoadedCharacters.Keys) foreach (string key in LoadedCharacters.Keys)
{ {
config.Add(key, LoadedCharacters[key]); config.Add(key, LoadedCharacters[key]);
} }
config.SaveConfig(); config.SaveConfig();
} }
public void OpenCreator(Character? character = null)
{
CreateCharacter creator = new(this, character);
creator.ShowDialog();
}
} }
} }

View File

@ -0,0 +1,539 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
partial class CreateCharacter
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
LabelName = new Label();
TextName = new TextBox();
TextFirstName = new TextBox();
TipName = new Label();
TipFirstName = new Label();
TextNickName = new TextBox();
TipNickName = new Label();
ComboPA = new ComboBox();
LabelPA = new Label();
LabelSTR = new Label();
LabelAGI = new Label();
LabelINT = new Label();
TextSTR = new TextBox();
TextAGI = new TextBox();
TextINT = new TextBox();
TextGrowthSTR = new TextBox();
TextGrowthAGI = new TextBox();
TextGrowthINT = new TextBox();
LabelGrowth1 = new Label();
LabelGrowth2 = new Label();
LabelGrowth3 = new Label();
LabelHR = new Label();
TextHR = new TextBox();
TextHP = new TextBox();
LabelHP = new Label();
LabelMR = new Label();
TextMR = new TextBox();
TextMP = new TextBox();
LabelMP = new Label();
TextATK = new TextBox();
LabelATK = new Label();
TextSPD = new TextBox();
LabelSPD = new Label();
BtnCreate = new Button();
TextCode = new TextBox();
LabelCode = new Label();
SuspendLayout();
//
// LabelName
//
LabelName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelName.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelName.Location = new Point(47, 54);
LabelName.Name = "LabelName";
LabelName.Size = new Size(129, 27);
LabelName.TabIndex = 0;
LabelName.Text = "角色姓名";
LabelName.TextAlign = ContentAlignment.MiddleCenter;
//
// TextName
//
TextName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextName.Font = new Font("等线", 14.25F);
TextName.Location = new Point(182, 54);
TextName.Name = "TextName";
TextName.Size = new Size(94, 27);
TextName.TabIndex = 0;
TextName.WordWrap = false;
//
// TextFirstName
//
TextFirstName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextFirstName.Font = new Font("等线", 14.25F);
TextFirstName.Location = new Point(282, 54);
TextFirstName.Name = "TextFirstName";
TextFirstName.Size = new Size(171, 27);
TextFirstName.TabIndex = 1;
TextFirstName.WordWrap = false;
//
// TipName
//
TipName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipName.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipName.Location = new Point(182, 24);
TipName.Name = "TipName";
TipName.Size = new Size(94, 27);
TipName.TabIndex = 2;
TipName.Text = "姓";
TipName.TextAlign = ContentAlignment.MiddleCenter;
//
// TipFirstName
//
TipFirstName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipFirstName.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipFirstName.Location = new Point(282, 24);
TipFirstName.Name = "TipFirstName";
TipFirstName.Size = new Size(171, 27);
TipFirstName.TabIndex = 4;
TipFirstName.Text = "名";
TipFirstName.TextAlign = ContentAlignment.MiddleCenter;
//
// TextNickName
//
TextNickName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextNickName.Font = new Font("等线", 14.25F);
TextNickName.Location = new Point(459, 54);
TextNickName.Name = "TextNickName";
TextNickName.Size = new Size(171, 27);
TextNickName.TabIndex = 2;
TextNickName.WordWrap = false;
//
// TipNickName
//
TipNickName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipNickName.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipNickName.Location = new Point(459, 24);
TipNickName.Name = "TipNickName";
TipNickName.Size = new Size(171, 27);
TipNickName.TabIndex = 6;
TipNickName.Text = "昵称";
TipNickName.TextAlign = ContentAlignment.MiddleCenter;
//
// ComboPA
//
ComboPA.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
ComboPA.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
ComboPA.FormattingEnabled = true;
ComboPA.Items.AddRange(new object[] { "力量", "敏捷", "智力" });
ComboPA.Location = new Point(182, 188);
ComboPA.Name = "ComboPA";
ComboPA.Size = new Size(133, 27);
ComboPA.TabIndex = 7;
//
// LabelPA
//
LabelPA.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelPA.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelPA.Location = new Point(47, 188);
LabelPA.Name = "LabelPA";
LabelPA.Size = new Size(129, 27);
LabelPA.TabIndex = 8;
LabelPA.Text = "核心属性";
LabelPA.TextAlign = ContentAlignment.MiddleCenter;
//
// LabelSTR
//
LabelSTR.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelSTR.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelSTR.Location = new Point(47, 238);
LabelSTR.Name = "LabelSTR";
LabelSTR.Size = new Size(129, 27);
LabelSTR.TabIndex = 9;
LabelSTR.Text = "力量";
LabelSTR.TextAlign = ContentAlignment.MiddleCenter;
//
// LabelAGI
//
LabelAGI.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelAGI.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelAGI.Location = new Point(47, 274);
LabelAGI.Name = "LabelAGI";
LabelAGI.Size = new Size(129, 27);
LabelAGI.TabIndex = 10;
LabelAGI.Text = "敏捷";
LabelAGI.TextAlign = ContentAlignment.MiddleCenter;
//
// LabelINT
//
LabelINT.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelINT.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelINT.Location = new Point(47, 310);
LabelINT.Name = "LabelINT";
LabelINT.Size = new Size(129, 27);
LabelINT.TabIndex = 11;
LabelINT.Text = "智力";
LabelINT.TextAlign = ContentAlignment.MiddleCenter;
//
// TextSTR
//
TextSTR.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextSTR.Font = new Font("等线", 14.25F);
TextSTR.Location = new Point(182, 238);
TextSTR.Name = "TextSTR";
TextSTR.Size = new Size(133, 27);
TextSTR.TabIndex = 9;
TextSTR.WordWrap = false;
//
// TextAGI
//
TextAGI.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextAGI.Font = new Font("等线", 14.25F);
TextAGI.Location = new Point(182, 274);
TextAGI.Name = "TextAGI";
TextAGI.Size = new Size(133, 27);
TextAGI.TabIndex = 11;
TextAGI.WordWrap = false;
//
// TextINT
//
TextINT.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextINT.Font = new Font("等线", 14.25F);
TextINT.Location = new Point(182, 310);
TextINT.Name = "TextINT";
TextINT.Size = new Size(133, 27);
TextINT.TabIndex = 13;
TextINT.WordWrap = false;
//
// TextGrowthSTR
//
TextGrowthSTR.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextGrowthSTR.Font = new Font("等线", 14.25F);
TextGrowthSTR.Location = new Point(321, 238);
TextGrowthSTR.Name = "TextGrowthSTR";
TextGrowthSTR.Size = new Size(94, 27);
TextGrowthSTR.TabIndex = 10;
TextGrowthSTR.WordWrap = false;
//
// TextGrowthAGI
//
TextGrowthAGI.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextGrowthAGI.Font = new Font("等线", 14.25F);
TextGrowthAGI.Location = new Point(321, 275);
TextGrowthAGI.Name = "TextGrowthAGI";
TextGrowthAGI.Size = new Size(94, 27);
TextGrowthAGI.TabIndex = 12;
TextGrowthAGI.WordWrap = false;
//
// TextGrowthINT
//
TextGrowthINT.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextGrowthINT.Font = new Font("等线", 14.25F);
TextGrowthINT.Location = new Point(321, 311);
TextGrowthINT.Name = "TextGrowthINT";
TextGrowthINT.Size = new Size(94, 27);
TextGrowthINT.TabIndex = 14;
TextGrowthINT.WordWrap = false;
//
// LabelGrowth1
//
LabelGrowth1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelGrowth1.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelGrowth1.Location = new Point(421, 238);
LabelGrowth1.Name = "LabelGrowth1";
LabelGrowth1.Size = new Size(96, 27);
LabelGrowth1.TabIndex = 18;
LabelGrowth1.Text = "力量成长";
LabelGrowth1.TextAlign = ContentAlignment.MiddleCenter;
//
// LabelGrowth2
//
LabelGrowth2.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelGrowth2.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelGrowth2.Location = new Point(421, 275);
LabelGrowth2.Name = "LabelGrowth2";
LabelGrowth2.Size = new Size(96, 27);
LabelGrowth2.TabIndex = 19;
LabelGrowth2.Text = "敏捷成长";
LabelGrowth2.TextAlign = ContentAlignment.MiddleCenter;
//
// LabelGrowth3
//
LabelGrowth3.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelGrowth3.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelGrowth3.Location = new Point(421, 311);
LabelGrowth3.Name = "LabelGrowth3";
LabelGrowth3.Size = new Size(96, 27);
LabelGrowth3.TabIndex = 20;
LabelGrowth3.Text = "智力成长";
LabelGrowth3.TextAlign = ContentAlignment.MiddleCenter;
//
// LabelHR
//
LabelHR.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelHR.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelHR.Location = new Point(421, 97);
LabelHR.Name = "LabelHR";
LabelHR.Size = new Size(96, 27);
LabelHR.TabIndex = 24;
LabelHR.Text = "生命回复";
LabelHR.TextAlign = ContentAlignment.MiddleCenter;
//
// TextHR
//
TextHR.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextHR.Font = new Font("等线", 14.25F);
TextHR.Location = new Point(321, 97);
TextHR.Name = "TextHR";
TextHR.Size = new Size(94, 27);
TextHR.TabIndex = 4;
TextHR.WordWrap = false;
//
// TextHP
//
TextHP.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextHP.Font = new Font("等线", 14.25F);
TextHP.Location = new Point(182, 97);
TextHP.Name = "TextHP";
TextHP.Size = new Size(133, 27);
TextHP.TabIndex = 3;
TextHP.WordWrap = false;
//
// LabelHP
//
LabelHP.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelHP.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelHP.Location = new Point(47, 97);
LabelHP.Name = "LabelHP";
LabelHP.Size = new Size(129, 27);
LabelHP.TabIndex = 21;
LabelHP.Text = "初始生命值";
LabelHP.TextAlign = ContentAlignment.MiddleCenter;
//
// LabelMR
//
LabelMR.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelMR.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelMR.Location = new Point(421, 137);
LabelMR.Name = "LabelMR";
LabelMR.Size = new Size(96, 27);
LabelMR.TabIndex = 28;
LabelMR.Text = "魔法回复";
LabelMR.TextAlign = ContentAlignment.MiddleCenter;
//
// TextMR
//
TextMR.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextMR.Font = new Font("等线", 14.25F);
TextMR.Location = new Point(321, 137);
TextMR.Name = "TextMR";
TextMR.Size = new Size(94, 27);
TextMR.TabIndex = 6;
TextMR.WordWrap = false;
//
// TextMP
//
TextMP.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextMP.Font = new Font("等线", 14.25F);
TextMP.Location = new Point(182, 137);
TextMP.Name = "TextMP";
TextMP.Size = new Size(133, 27);
TextMP.TabIndex = 5;
TextMP.WordWrap = false;
//
// LabelMP
//
LabelMP.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelMP.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelMP.Location = new Point(47, 137);
LabelMP.Name = "LabelMP";
LabelMP.Size = new Size(129, 27);
LabelMP.TabIndex = 25;
LabelMP.Text = "初始魔法值";
LabelMP.TextAlign = ContentAlignment.MiddleCenter;
//
// TextATK
//
TextATK.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextATK.Font = new Font("等线", 14.25F);
TextATK.Location = new Point(497, 188);
TextATK.Name = "TextATK";
TextATK.Size = new Size(133, 27);
TextATK.TabIndex = 8;
TextATK.WordWrap = false;
//
// LabelATK
//
LabelATK.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelATK.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelATK.Location = new Point(362, 188);
LabelATK.Name = "LabelATK";
LabelATK.Size = new Size(129, 27);
LabelATK.TabIndex = 29;
LabelATK.Text = "初始攻击力";
LabelATK.TextAlign = ContentAlignment.MiddleCenter;
//
// TextSPD
//
TextSPD.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextSPD.Font = new Font("等线", 14.25F);
TextSPD.Location = new Point(182, 352);
TextSPD.Name = "TextSPD";
TextSPD.ReadOnly = true;
TextSPD.Size = new Size(133, 27);
TextSPD.TabIndex = 15;
TextSPD.Text = "300";
TextSPD.WordWrap = false;
//
// LabelSPD
//
LabelSPD.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelSPD.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelSPD.Location = new Point(47, 352);
LabelSPD.Name = "LabelSPD";
LabelSPD.Size = new Size(129, 27);
LabelSPD.TabIndex = 31;
LabelSPD.Text = "行动速度";
LabelSPD.TextAlign = ContentAlignment.MiddleCenter;
//
// BtnCreate
//
BtnCreate.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
BtnCreate.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
BtnCreate.Location = new Point(628, 412);
BtnCreate.Name = "BtnCreate";
BtnCreate.Size = new Size(103, 45);
BtnCreate.TabIndex = 17;
BtnCreate.Text = "创建";
BtnCreate.UseVisualStyleBackColor = true;
BtnCreate.Click += BtnCreate_Click;
//
// TextCode
//
TextCode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextCode.Font = new Font("等线", 14.25F);
TextCode.Location = new Point(407, 422);
TextCode.Name = "TextCode";
TextCode.Size = new Size(215, 27);
TextCode.TabIndex = 16;
TextCode.WordWrap = false;
//
// LabelCode
//
LabelCode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelCode.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelCode.Location = new Point(231, 422);
LabelCode.Name = "LabelCode";
LabelCode.Size = new Size(170, 27);
LabelCode.TabIndex = 34;
LabelCode.Text = "代号(存档标识)";
LabelCode.TextAlign = ContentAlignment.MiddleCenter;
//
// CreateCharacter
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(743, 469);
Controls.Add(TextCode);
Controls.Add(LabelCode);
Controls.Add(BtnCreate);
Controls.Add(TextSPD);
Controls.Add(LabelSPD);
Controls.Add(TextATK);
Controls.Add(LabelATK);
Controls.Add(LabelMR);
Controls.Add(TextMR);
Controls.Add(TextMP);
Controls.Add(LabelMP);
Controls.Add(LabelHR);
Controls.Add(TextHR);
Controls.Add(TextHP);
Controls.Add(LabelHP);
Controls.Add(LabelGrowth3);
Controls.Add(LabelGrowth2);
Controls.Add(LabelGrowth1);
Controls.Add(TextGrowthINT);
Controls.Add(TextGrowthAGI);
Controls.Add(TextGrowthSTR);
Controls.Add(TextINT);
Controls.Add(TextAGI);
Controls.Add(TextSTR);
Controls.Add(LabelINT);
Controls.Add(LabelAGI);
Controls.Add(LabelSTR);
Controls.Add(LabelPA);
Controls.Add(ComboPA);
Controls.Add(TipNickName);
Controls.Add(TextNickName);
Controls.Add(TipFirstName);
Controls.Add(TextFirstName);
Controls.Add(TipName);
Controls.Add(TextName);
Controls.Add(LabelName);
Name = "CreateCharacter";
StartPosition = FormStartPosition.CenterScreen;
Text = "角色创建器";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label LabelName;
private TextBox TextName;
private TextBox TextFirstName;
private Label TipName;
private Label TipFirstName;
private TextBox TextNickName;
private Label TipNickName;
private ComboBox ComboPA;
private Label LabelPA;
private Label LabelSTR;
private Label LabelAGI;
private Label LabelINT;
private TextBox TextSTR;
private TextBox TextAGI;
private TextBox TextINT;
private TextBox TextGrowthSTR;
private TextBox TextGrowthAGI;
private TextBox TextGrowthINT;
private Label LabelGrowth1;
private Label LabelGrowth2;
private Label LabelGrowth3;
private Label LabelHR;
private TextBox TextHR;
private TextBox TextHP;
private Label LabelHP;
private Label LabelMR;
private TextBox TextMR;
private TextBox TextMP;
private Label LabelMP;
private TextBox TextATK;
private Label LabelATK;
private TextBox TextSPD;
private Label LabelSPD;
private Button BtnCreate;
private TextBox TextCode;
private Label LabelCode;
}
}

View File

@ -0,0 +1,205 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class CreateCharacter : Form
{
private CharacterCreator CharacterCreator { get; }
private Character? EditCharacter { get; }
public CreateCharacter(CharacterCreator creator, Character? character = null)
{
InitializeComponent();
CharacterCreator = creator;
if (character != null)
{
Text = "角色编辑器";
BtnCreate.Text = "编辑";
EditCharacter = character;
TextName.Text = character.Name;
TextCode.Text = creator.LoadedCharacters.Where(kv => kv.Value == character).Select(kv => kv.Key).FirstOrDefault() ?? "";
TextFirstName.Text = character.FirstName;
TextNickName.Text = character.NickName;
TextATK.Text = character.InitialATK.ToString();
TextHP.Text = character.InitialHP.ToString();
TextMP.Text = character.InitialMP.ToString();
TextHR.Text = character.InitialHR.ToString();
TextMR.Text = character.InitialMR.ToString();
ComboPA.Text = CharacterSet.GetPrimaryAttributeName(character.PrimaryAttribute);
TextSTR.Text = character.InitialSTR.ToString();
TextGrowthSTR.Text = character.STRGrowth.ToString();
TextAGI.Text = character.InitialAGI.ToString();
TextGrowthAGI.Text = character.AGIGrowth.ToString();
TextINT.Text = character.InitialINT.ToString();
TextGrowthINT.Text = character.INTGrowth.ToString();
}
}
private void BtnCreate_Click(object sender, EventArgs e)
{
Character c;
if (EditCharacter != null)
{
c = EditCharacter;
}
else
{
c = Factory.GetCharacter();
}
string name;
if (TextName.Text.Trim() != "")
{
c.Name = TextName.Text.Trim();
}
else
{
MessageBox.Show("姓不能为空。");
return;
}
if (TextCode.Text.Trim() != "")
{
name = TextCode.Text.Trim();
}
else
{
MessageBox.Show("角色存档标识不能为空。");
return;
}
if (TextFirstName.Text.Trim() != "")
{
c.FirstName = TextFirstName.Text.Trim();
}
if (TextNickName.Text.Trim() != "")
{
c.NickName = TextNickName.Text.Trim();
}
if (TextATK.Text.Trim() != "" && double.TryParse(TextATK.Text.Trim(), out double atk))
{
c.InitialATK = atk;
}
if (TextHP.Text.Trim() != "" && double.TryParse(TextHP.Text.Trim(), out double hp))
{
c.InitialHP = hp;
}
if (TextMP.Text.Trim() != "" && double.TryParse(TextMP.Text.Trim(), out double mp))
{
c.InitialMP = mp;
}
if (TextHR.Text.Trim() != "" && double.TryParse(TextHR.Text.Trim(), out double hr))
{
c.InitialHR = hr;
}
if (TextMR.Text.Trim() != "" && double.TryParse(TextMR.Text.Trim(), out double mr))
{
c.InitialMR = mr;
}
if (ComboPA.Text.Trim() != "")
{
string pa = ComboPA.Text.Trim();
if (pa == "敏捷")
{
c.PrimaryAttribute = PrimaryAttribute.AGI;
}
else if (pa == "智力")
{
c.PrimaryAttribute = PrimaryAttribute.INT;
}
else
{
c.PrimaryAttribute = PrimaryAttribute.STR;
}
}
if (TextSTR.Text.Trim() != "" && double.TryParse(TextSTR.Text.Trim(), out double str))
{
c.InitialSTR = str;
}
if (TextGrowthSTR.Text.Trim() != "" && double.TryParse(TextGrowthSTR.Text.Trim(), out double strg))
{
c.STRGrowth = strg;
}
if (TextAGI.Text.Trim() != "" && double.TryParse(TextAGI.Text.Trim(), out double agi))
{
c.InitialAGI = agi;
}
if (TextGrowthAGI.Text.Trim() != "" && double.TryParse(TextGrowthAGI.Text.Trim(), out double agig))
{
c.AGIGrowth = agig;
}
if (TextINT.Text.Trim() != "" && double.TryParse(TextINT.Text.Trim(), out double @int))
{
c.InitialINT = @int;
}
if (TextGrowthINT.Text.Trim() != "" && double.TryParse(TextGrowthINT.Text.Trim(), out double intg))
{
c.INTGrowth = intg;
}
if (TextSPD.Text.Trim() != "" && double.TryParse(TextSPD.Text.Trim(), out double spd))
{
c.InitialSPD = spd;
}
if (EditCharacter != null)
{
MessageBox.Show("保存成功!");
Dispose();
return;
}
else
{
if (CharacterCreator.Add(name, c))
{
ShowDetail d = new(CharacterCreator, null, null);
d.SetText(-1, c, c.GetInfo());
d.Text = "预览模式";
d.ShowDialog();
d.Dispose();
if (MessageBox.Show("添加成功!是否继续添加?", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
{
Dispose();
return;
}
}
else
{
MessageBox.Show("添加失败!");
}
}
TextName.Text = "";
TextCode.Text = "";
TextFirstName.Text = "";
TextNickName.Text = "";
TextATK.Text = "";
TextHP.Text = "";
TextMP.Text = "";
TextHR.Text = "";
TextMR.Text = "";
ComboPA.Text = "";
TextSTR.Text = "";
TextGrowthSTR.Text = "";
TextAGI.Text = "";
TextGrowthAGI.Text = "";
TextINT.Text = "";
TextGrowthINT.Text = "";
}
}
}

View File

@ -0,0 +1,391 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
partial class CreateItem
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
BtnCreate = new Button();
TextCode = new TextBox();
LabelCode = new Label();
TipItemType = new Label();
TextName = new TextBox();
TipID = new Label();
TextID = new TextBox();
TipName = new Label();
LabelWeaponType = new Label();
CheckboxIsWeapon = new CheckBox();
CheckboxIsEquip = new CheckBox();
LabelEquip = new Label();
CheckboxIsPurchasable = new CheckBox();
TextPrice = new TextBox();
LabelPrice = new Label();
CheckboxIsSellable = new CheckBox();
LabelNextSellTime = new Label();
CheckboxIsTradable = new CheckBox();
LabelNextTradeTime = new Label();
DateTimePickerSell = new DateTimePicker();
DateTimePickerTrade = new DateTimePicker();
ComboWeapon = new ComboBox();
ComboEquip = new ComboBox();
ComboItemType = new ComboBox();
SuspendLayout();
//
// BtnCreate
//
BtnCreate.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
BtnCreate.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
BtnCreate.Location = new Point(628, 412);
BtnCreate.Name = "BtnCreate";
BtnCreate.Size = new Size(103, 45);
BtnCreate.TabIndex = 14;
BtnCreate.Text = "创建";
BtnCreate.UseVisualStyleBackColor = true;
BtnCreate.Click += BtnCreate_Click;
//
// TextCode
//
TextCode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextCode.Font = new Font("等线", 14.25F);
TextCode.Location = new Point(407, 422);
TextCode.Name = "TextCode";
TextCode.Size = new Size(215, 27);
TextCode.TabIndex = 13;
TextCode.WordWrap = false;
//
// LabelCode
//
LabelCode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelCode.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelCode.Location = new Point(231, 422);
LabelCode.Name = "LabelCode";
LabelCode.Size = new Size(170, 27);
LabelCode.TabIndex = 34;
LabelCode.Text = "代号(存档标识)";
LabelCode.TextAlign = ContentAlignment.MiddleCenter;
//
// TipItemType
//
TipItemType.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipItemType.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipItemType.Location = new Point(214, 128);
TipItemType.Name = "TipItemType";
TipItemType.Size = new Size(129, 27);
TipItemType.TabIndex = 41;
TipItemType.Text = "物品类型";
TipItemType.TextAlign = ContentAlignment.MiddleCenter;
//
// TextName
//
TextName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextName.Font = new Font("等线", 14.25F);
TextName.Location = new Point(349, 78);
TextName.Name = "TextName";
TextName.Size = new Size(201, 27);
TextName.TabIndex = 1;
TextName.WordWrap = false;
//
// TipID
//
TipID.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipID.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipID.Location = new Point(214, 28);
TipID.Name = "TipID";
TipID.Size = new Size(129, 27);
TipID.TabIndex = 40;
TipID.Text = "物品编号";
TipID.TextAlign = ContentAlignment.MiddleCenter;
//
// TextID
//
TextID.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextID.Font = new Font("等线", 14.25F);
TextID.Location = new Point(349, 28);
TextID.Name = "TextID";
TextID.Size = new Size(201, 27);
TextID.TabIndex = 0;
TextID.WordWrap = false;
//
// TipName
//
TipName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipName.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipName.Location = new Point(214, 78);
TipName.Name = "TipName";
TipName.Size = new Size(129, 27);
TipName.TabIndex = 38;
TipName.Text = "物品名称";
TipName.TextAlign = ContentAlignment.MiddleCenter;
//
// LabelWeaponType
//
LabelWeaponType.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelWeaponType.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelWeaponType.Location = new Point(272, 192);
LabelWeaponType.Name = "LabelWeaponType";
LabelWeaponType.Size = new Size(129, 27);
LabelWeaponType.TabIndex = 43;
LabelWeaponType.Text = "武器类型";
LabelWeaponType.TextAlign = ContentAlignment.MiddleCenter;
//
// CheckboxIsWeapon
//
CheckboxIsWeapon.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
CheckboxIsWeapon.CheckAlign = ContentAlignment.MiddleRight;
CheckboxIsWeapon.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
CheckboxIsWeapon.ImageAlign = ContentAlignment.MiddleRight;
CheckboxIsWeapon.Location = new Point(121, 192);
CheckboxIsWeapon.Name = "CheckboxIsWeapon";
CheckboxIsWeapon.Size = new Size(145, 27);
CheckboxIsWeapon.TabIndex = 3;
CheckboxIsWeapon.Text = "是武器";
CheckboxIsWeapon.TextAlign = ContentAlignment.MiddleCenter;
CheckboxIsWeapon.UseVisualStyleBackColor = true;
CheckboxIsWeapon.CheckedChanged += CheckboxIsWeapon_CheckedChanged;
//
// CheckboxIsEquip
//
CheckboxIsEquip.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
CheckboxIsEquip.CheckAlign = ContentAlignment.MiddleRight;
CheckboxIsEquip.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
CheckboxIsEquip.ImageAlign = ContentAlignment.MiddleRight;
CheckboxIsEquip.Location = new Point(121, 232);
CheckboxIsEquip.Name = "CheckboxIsEquip";
CheckboxIsEquip.Size = new Size(145, 27);
CheckboxIsEquip.TabIndex = 5;
CheckboxIsEquip.Text = "可被装备";
CheckboxIsEquip.TextAlign = ContentAlignment.MiddleCenter;
CheckboxIsEquip.UseVisualStyleBackColor = true;
CheckboxIsEquip.CheckedChanged += CheckboxIsEquip_CheckedChanged;
//
// LabelEquip
//
LabelEquip.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelEquip.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelEquip.Location = new Point(272, 232);
LabelEquip.Name = "LabelEquip";
LabelEquip.Size = new Size(129, 27);
LabelEquip.TabIndex = 46;
LabelEquip.Text = "装备类型";
LabelEquip.TextAlign = ContentAlignment.MiddleCenter;
//
// CheckboxIsPurchasable
//
CheckboxIsPurchasable.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
CheckboxIsPurchasable.CheckAlign = ContentAlignment.MiddleRight;
CheckboxIsPurchasable.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
CheckboxIsPurchasable.ImageAlign = ContentAlignment.MiddleRight;
CheckboxIsPurchasable.Location = new Point(121, 272);
CheckboxIsPurchasable.Name = "CheckboxIsPurchasable";
CheckboxIsPurchasable.Size = new Size(145, 27);
CheckboxIsPurchasable.TabIndex = 7;
CheckboxIsPurchasable.Text = "可供购买";
CheckboxIsPurchasable.TextAlign = ContentAlignment.MiddleCenter;
CheckboxIsPurchasable.UseVisualStyleBackColor = true;
CheckboxIsPurchasable.CheckedChanged += CheckboxIsPurchasable_CheckedChanged;
//
// TextPrice
//
TextPrice.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextPrice.Font = new Font("等线", 14.25F);
TextPrice.Location = new Point(407, 272);
TextPrice.Name = "TextPrice";
TextPrice.Size = new Size(201, 27);
TextPrice.TabIndex = 8;
TextPrice.WordWrap = false;
//
// LabelPrice
//
LabelPrice.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelPrice.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelPrice.Location = new Point(272, 272);
LabelPrice.Name = "LabelPrice";
LabelPrice.Size = new Size(129, 27);
LabelPrice.TabIndex = 49;
LabelPrice.Text = "售价";
LabelPrice.TextAlign = ContentAlignment.MiddleCenter;
//
// CheckboxIsSellable
//
CheckboxIsSellable.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
CheckboxIsSellable.CheckAlign = ContentAlignment.MiddleRight;
CheckboxIsSellable.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
CheckboxIsSellable.ImageAlign = ContentAlignment.MiddleRight;
CheckboxIsSellable.Location = new Point(121, 312);
CheckboxIsSellable.Name = "CheckboxIsSellable";
CheckboxIsSellable.Size = new Size(145, 27);
CheckboxIsSellable.TabIndex = 9;
CheckboxIsSellable.Text = "允许出售";
CheckboxIsSellable.TextAlign = ContentAlignment.MiddleCenter;
CheckboxIsSellable.UseVisualStyleBackColor = true;
CheckboxIsSellable.CheckedChanged += CheckboxIsSellable_CheckedChanged;
//
// LabelNextSellTime
//
LabelNextSellTime.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelNextSellTime.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelNextSellTime.Location = new Point(272, 312);
LabelNextSellTime.Name = "LabelNextSellTime";
LabelNextSellTime.Size = new Size(160, 27);
LabelNextSellTime.TabIndex = 52;
LabelNextSellTime.Text = "下次可出售时间";
LabelNextSellTime.TextAlign = ContentAlignment.MiddleCenter;
//
// CheckboxIsTradable
//
CheckboxIsTradable.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
CheckboxIsTradable.CheckAlign = ContentAlignment.MiddleRight;
CheckboxIsTradable.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
CheckboxIsTradable.ImageAlign = ContentAlignment.MiddleRight;
CheckboxIsTradable.Location = new Point(121, 352);
CheckboxIsTradable.Name = "CheckboxIsTradable";
CheckboxIsTradable.Size = new Size(145, 27);
CheckboxIsTradable.TabIndex = 11;
CheckboxIsTradable.Text = "允许交易";
CheckboxIsTradable.TextAlign = ContentAlignment.MiddleCenter;
CheckboxIsTradable.UseVisualStyleBackColor = true;
CheckboxIsTradable.CheckedChanged += CheckboxIsTradable_CheckedChanged;
//
// LabelNextTradeTime
//
LabelNextTradeTime.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelNextTradeTime.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelNextTradeTime.Location = new Point(272, 352);
LabelNextTradeTime.Name = "LabelNextTradeTime";
LabelNextTradeTime.Size = new Size(160, 27);
LabelNextTradeTime.TabIndex = 55;
LabelNextTradeTime.Text = "下次可交易时间";
LabelNextTradeTime.TextAlign = ContentAlignment.MiddleCenter;
//
// DateTimePickerSell
//
DateTimePickerSell.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
DateTimePickerSell.Location = new Point(438, 312);
DateTimePickerSell.Name = "DateTimePickerSell";
DateTimePickerSell.Size = new Size(170, 27);
DateTimePickerSell.TabIndex = 10;
//
// DateTimePickerTrade
//
DateTimePickerTrade.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
DateTimePickerTrade.Location = new Point(438, 352);
DateTimePickerTrade.Name = "DateTimePickerTrade";
DateTimePickerTrade.Size = new Size(170, 27);
DateTimePickerTrade.TabIndex = 12;
//
// ComboWeapon
//
ComboWeapon.Font = new Font("Microsoft YaHei UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
ComboWeapon.FormattingEnabled = true;
ComboWeapon.Items.AddRange(new object[] { "单手剑", "双手重剑", "弓", "手枪", "步枪", "双持短刀", "法器", "法杖", "长柄", "拳套", "暗器" });
ComboWeapon.Location = new Point(407, 188);
ComboWeapon.Name = "ComboWeapon";
ComboWeapon.Size = new Size(201, 33);
ComboWeapon.TabIndex = 4;
//
// ComboEquip
//
ComboEquip.Font = new Font("Microsoft YaHei UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
ComboEquip.FormattingEnabled = true;
ComboEquip.Items.AddRange(new object[] { "魔法卡包", "武器", "防具", "鞋子", "饰品" });
ComboEquip.Location = new Point(407, 228);
ComboEquip.Name = "ComboEquip";
ComboEquip.Size = new Size(201, 33);
ComboEquip.TabIndex = 6;
//
// ComboItemType
//
ComboItemType.Font = new Font("Microsoft YaHei UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
ComboItemType.FormattingEnabled = true;
ComboItemType.Items.AddRange(new object[] { "魔法卡包", "武器", "防具", "鞋子", "饰品", "消耗品", "魔法卡", "收藏品", "特殊物品", "任务物品", "礼包", "其他" });
ComboItemType.Location = new Point(349, 125);
ComboItemType.Name = "ComboItemType";
ComboItemType.Size = new Size(201, 33);
ComboItemType.TabIndex = 56;
//
// CreateItem
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(743, 469);
Controls.Add(ComboItemType);
Controls.Add(ComboEquip);
Controls.Add(ComboWeapon);
Controls.Add(DateTimePickerTrade);
Controls.Add(DateTimePickerSell);
Controls.Add(CheckboxIsTradable);
Controls.Add(LabelNextTradeTime);
Controls.Add(CheckboxIsSellable);
Controls.Add(LabelNextSellTime);
Controls.Add(CheckboxIsPurchasable);
Controls.Add(TextPrice);
Controls.Add(LabelPrice);
Controls.Add(CheckboxIsEquip);
Controls.Add(LabelEquip);
Controls.Add(CheckboxIsWeapon);
Controls.Add(LabelWeaponType);
Controls.Add(TipItemType);
Controls.Add(TextName);
Controls.Add(TipID);
Controls.Add(TextID);
Controls.Add(TipName);
Controls.Add(TextCode);
Controls.Add(LabelCode);
Controls.Add(BtnCreate);
Name = "CreateItem";
StartPosition = FormStartPosition.CenterScreen;
Text = "物品创建器";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button BtnCreate;
private TextBox TextCode;
private Label LabelCode;
private Label TipItemType;
private TextBox TextName;
private Label TipID;
private TextBox TextID;
private Label TipName;
private Label LabelWeaponType;
private CheckBox CheckboxIsWeapon;
private CheckBox CheckboxIsEquip;
private Label LabelEquip;
private CheckBox CheckboxIsPurchasable;
private TextBox TextPrice;
private Label LabelPrice;
private CheckBox CheckboxIsSellable;
private Label LabelNextSellTime;
private CheckBox CheckboxIsTradable;
private Label LabelNextTradeTime;
private DateTimePicker DateTimePickerSell;
private DateTimePicker DateTimePickerTrade;
private ComboBox ComboWeapon;
private ComboBox ComboEquip;
private ComboBox ComboItemType;
}
}

View File

@ -0,0 +1,199 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class CreateItem : Form
{
private ItemCreator ItemCreator { get; }
private Item? EditItem { get; }
public CreateItem(ItemCreator creator, Item? item = null)
{
InitializeComponent();
ItemCreator = creator;
if (item != null)
{
Text = "物品编辑器";
BtnCreate.Text = "编辑";
EditItem = item;
TextID.Text = item.Id.ToString();
TextName.Text = item.Name;
TextCode.Text = creator.LoadedItems.Where(kv => kv.Value.Equals(item)).Select(kv => kv.Key).FirstOrDefault() ?? "";
ComboItemType.Text = ItemSet.GetItemTypeName(item.ItemType);
CheckboxIsWeapon.Checked = item.ItemType == ItemType.Weapon;
ComboWeapon.Text = ItemSet.GetWeaponTypeName(item.WeaponType);
ComboWeapon.Enabled = item.ItemType == ItemType.Weapon;
CheckboxIsEquip.Checked = item.Equipable;
ComboEquip.Text = ItemSet.GetEquipSlotTypeName(item.EquipSlotType);
ComboEquip.Enabled = item.Equipable;
CheckboxIsPurchasable.Checked = item.IsPurchasable;
TextPrice.Text = item.Price.ToString();
TextPrice.Enabled = item.IsPurchasable;
CheckboxIsSellable.Checked = item.IsSellable;
CheckboxIsTradable.Checked = item.IsTradable;
if (item.NextSellableTime > DateTime.Now && item.NextSellableTime < DateTime.MaxValue) DateTimePickerSell.Value = item.NextSellableTime;
DateTimePickerSell.Enabled = !item.IsSellable;
if (item.NextTradableTime > DateTime.Now && item.NextTradableTime < DateTime.MaxValue) DateTimePickerTrade.Value = item.NextTradableTime;
DateTimePickerTrade.Enabled = !item.IsTradable;
}
else
{
CheckboxIsWeapon.Checked = false;
ComboWeapon.Enabled = false;
CheckboxIsEquip.Checked = false;
ComboEquip.Enabled = false;
CheckboxIsPurchasable.Checked = false;
TextPrice.Enabled = false;
CheckboxIsSellable.Checked = true;
CheckboxIsTradable.Checked = true;
DateTimePickerSell.Value = DateTime.Now;
DateTimePickerSell.Enabled = false;
DateTimePickerTrade.Value = DateTime.Now;
DateTimePickerTrade.Enabled = false;
}
}
private void BtnCreate_Click(object sender, EventArgs e)
{
Item i;
if (EditItem != null)
{
i = EditItem;
}
else
{
i = Factory.GetItem();
}
string name;
if (TextID.Text.Trim() != "" && long.TryParse(TextID.Text.Trim(), out long id))
{
i.Id = id;
}
else
{
MessageBox.Show("ID不能为空。");
return;
}
if (TextName.Text.Trim() != "")
{
i.Name = TextName.Text.Trim();
}
else
{
MessageBox.Show("名称不能为空。");
return;
}
if (TextCode.Text.Trim() != "")
{
name = TextCode.Text.Trim();
}
else
{
MessageBox.Show("物品存档标识不能为空。");
return;
}
if (CheckboxIsWeapon.Checked && ComboWeapon.Text.Trim() != "")
{
i.WeaponType = ItemSet.GetWeaponTypeFromName(ComboWeapon.Text.Trim());
}
if (CheckboxIsEquip.Checked && ComboEquip.Text.Trim() != "")
{
i.EquipSlotType = ItemSet.GetEquipSlotTypeFromName(ComboEquip.Text.Trim());
}
if (CheckboxIsPurchasable.Checked && TextPrice.Text.Trim() != "" && double.TryParse(TextPrice.Text.Trim(), out double price))
{
i.Price = price;
}
if (!CheckboxIsSellable.Checked && DateTime.Now < DateTimePickerSell.Value)
{
i.NextSellableTime = DateTimePickerSell.Value;
}
if (!CheckboxIsTradable.Checked && DateTime.Now < DateTimePickerTrade.Value)
{
i.NextTradableTime = DateTimePickerTrade.Value;
}
if (EditItem != null)
{
MessageBox.Show("保存成功!");
Dispose();
return;
}
else
{
if (ItemCreator.Add(name, i))
{
ShowDetail d = new(null, null, ItemCreator);
d.SetText(-1, i, i.ToString());
d.Text = "预览模式";
d.ShowDialog();
d.Dispose();
if (MessageBox.Show("添加成功!是否继续添加?", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
{
Dispose();
return;
}
}
else
{
MessageBox.Show("添加失败!");
}
}
TextID.Text = "";
TextName.Text = "";
TextCode.Text = "";
ComboItemType.Text = "";
CheckboxIsWeapon.Checked = false;
ComboWeapon.Text = "";
ComboWeapon.Enabled = false;
CheckboxIsEquip.Checked = false;
ComboEquip.Text = "";
ComboEquip.Enabled = false;
CheckboxIsPurchasable.Checked = false;
TextPrice.Text = "";
TextPrice.Enabled = false;
CheckboxIsSellable.Checked = true;
CheckboxIsTradable.Checked = true;
DateTimePickerSell.Value = DateTime.Now;
DateTimePickerSell.Enabled = false;
DateTimePickerTrade.Value = DateTime.Now;
DateTimePickerTrade.Enabled = false;
}
private void CheckboxIsWeapon_CheckedChanged(object sender, EventArgs e)
{
ComboWeapon.Enabled = CheckboxIsWeapon.Checked;
}
private void CheckboxIsEquip_CheckedChanged(object sender, EventArgs e)
{
ComboEquip.Enabled = CheckboxIsEquip.Checked;
}
private void CheckboxIsPurchasable_CheckedChanged(object sender, EventArgs e)
{
TextPrice.Enabled = CheckboxIsPurchasable.Checked;
}
private void CheckboxIsSellable_CheckedChanged(object sender, EventArgs e)
{
DateTimePickerSell.Enabled = !CheckboxIsSellable.Checked;
}
private void CheckboxIsTradable_CheckedChanged(object sender, EventArgs e)
{
DateTimePickerTrade.Enabled = !CheckboxIsTradable.Checked;
}
}
}

View File

@ -0,0 +1,171 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
partial class CreateSkill
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
TipName = new Label();
TextID = new TextBox();
TextName = new TextBox();
TipID = new Label();
BtnCreate = new Button();
TextCode = new TextBox();
LabelCode = new Label();
TipSkillType = new Label();
ComboSkillType = new ComboBox();
SuspendLayout();
//
// TipName
//
TipName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipName.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipName.Location = new Point(78, 95);
TipName.Name = "TipName";
TipName.Size = new Size(129, 27);
TipName.TabIndex = 0;
TipName.Text = "技能名称";
TipName.TextAlign = ContentAlignment.MiddleCenter;
//
// TextID
//
TextID.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextID.Font = new Font("等线", 14.25F);
TextID.Location = new Point(213, 45);
TextID.Name = "TextID";
TextID.Size = new Size(201, 27);
TextID.TabIndex = 0;
TextID.WordWrap = false;
//
// TextName
//
TextName.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextName.Font = new Font("等线", 14.25F);
TextName.Location = new Point(213, 95);
TextName.Name = "TextName";
TextName.Size = new Size(201, 27);
TextName.TabIndex = 1;
TextName.WordWrap = false;
//
// TipID
//
TipID.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipID.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipID.Location = new Point(78, 45);
TipID.Name = "TipID";
TipID.Size = new Size(129, 27);
TipID.TabIndex = 2;
TipID.Text = "技能编号";
TipID.TextAlign = ContentAlignment.MiddleCenter;
//
// BtnCreate
//
BtnCreate.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
BtnCreate.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
BtnCreate.Location = new Point(420, 216);
BtnCreate.Name = "BtnCreate";
BtnCreate.Size = new Size(103, 45);
BtnCreate.TabIndex = 4;
BtnCreate.Text = "创建";
BtnCreate.UseVisualStyleBackColor = true;
BtnCreate.Click += BtnCreate_Click;
//
// TextCode
//
TextCode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TextCode.Font = new Font("等线", 14.25F);
TextCode.Location = new Point(199, 226);
TextCode.Name = "TextCode";
TextCode.Size = new Size(215, 27);
TextCode.TabIndex = 3;
TextCode.WordWrap = false;
//
// LabelCode
//
LabelCode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
LabelCode.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
LabelCode.Location = new Point(23, 226);
LabelCode.Name = "LabelCode";
LabelCode.Size = new Size(170, 27);
LabelCode.TabIndex = 34;
LabelCode.Text = "代号(存档标识)";
LabelCode.TextAlign = ContentAlignment.MiddleCenter;
//
// TipSkillType
//
TipSkillType.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
TipSkillType.Font = new Font("等线", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
TipSkillType.Location = new Point(78, 145);
TipSkillType.Name = "TipSkillType";
TipSkillType.Size = new Size(129, 27);
TipSkillType.TabIndex = 35;
TipSkillType.Text = "技能类型";
TipSkillType.TextAlign = ContentAlignment.MiddleCenter;
//
// ComboSkillType
//
ComboSkillType.Font = new Font("Microsoft YaHei UI", 14.25F, FontStyle.Regular, GraphicsUnit.Point, 134);
ComboSkillType.FormattingEnabled = true;
ComboSkillType.Items.AddRange(new object[] { "魔法", "战技", "爆发技", "被动", "物品" });
ComboSkillType.Location = new Point(213, 141);
ComboSkillType.Name = "ComboSkillType";
ComboSkillType.Size = new Size(201, 33);
ComboSkillType.TabIndex = 57;
//
// CreateSkill
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(535, 273);
Controls.Add(ComboSkillType);
Controls.Add(TipSkillType);
Controls.Add(TextCode);
Controls.Add(LabelCode);
Controls.Add(BtnCreate);
Controls.Add(TextName);
Controls.Add(TipID);
Controls.Add(TextID);
Controls.Add(TipName);
Name = "CreateSkill";
StartPosition = FormStartPosition.CenterScreen;
Text = "技能创建器";
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label TipName;
private TextBox TextID;
private TextBox TextName;
private Label TipID;
private Button BtnCreate;
private TextBox TextCode;
private Label LabelCode;
private Label TipSkillType;
private ComboBox ComboSkillType;
}
}

View File

@ -0,0 +1,104 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class CreateSkill : Form
{
private SkillCreator SkillCreator { get; }
private Skill? EditSkill { get; }
public CreateSkill(SkillCreator creator, Skill? skill = null)
{
InitializeComponent();
SkillCreator = creator;
if (skill != null)
{
Text = "技能编辑器";
BtnCreate.Text = "编辑";
EditSkill = skill;
TextID.Text = skill.Id.ToString();
TextCode.Text = creator.LoadedSkills.Where(kv => kv.Value.Equals(skill)).Select(kv => kv.Key).FirstOrDefault() ?? "";
TextName.Text = skill.Name;
ComboSkillType.Text = SkillSet.GetSkillTypeName(skill.SkillType);
}
}
private void BtnCreate_Click(object sender, EventArgs e)
{
Skill s;
if (EditSkill != null)
{
s = EditSkill;
}
else
{
s = Factory.GetSkill();
}
string name;
if (TextID.Text.Trim() != "" && long.TryParse(TextID.Text.Trim(), out long id))
{
s.Id = id;
}
else
{
MessageBox.Show("ID不能为空。");
return;
}
if (TextName.Text.Trim() != "")
{
s.Name = TextName.Text.Trim();
}
else
{
MessageBox.Show("名称不能为空。");
return;
}
if (TextCode.Text.Trim() != "")
{
name = TextCode.Text.Trim();
}
else
{
MessageBox.Show("技能存档标识不能为空。");
return;
}
if (EditSkill != null)
{
MessageBox.Show("保存成功!");
Dispose();
return;
}
else
{
if (SkillCreator.Add(name, s))
{
ShowDetail d = new(null, SkillCreator, null);
d.SetText(-1, s, s.ToString());
d.Text = "预览模式";
d.ShowDialog();
d.Dispose();
if (MessageBox.Show("添加成功!是否继续添加?", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
{
Dispose();
return;
}
}
else
{
MessageBox.Show("添加失败!");
}
}
TextID.Text = "";
TextCode.Text = "";
TextName.Text = "";
ComboSkillType.Text = "";
}
}
}

View File

@ -46,13 +46,15 @@
= new Button(); = new Button();
= new Button(); = new Button();
= new Button(); = new Button();
= new Button();
= new Button();
.SuspendLayout(); .SuspendLayout();
SuspendLayout(); SuspendLayout();
// //
// 查看现有角色 // 查看现有角色
// //
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; .Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 103); .Location = new Point(460, 22);
.Name = "查看现有角色"; .Name = "查看现有角色";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 0; .TabIndex = 0;
@ -63,10 +65,10 @@
// 查看现有技能 // 查看现有技能
// //
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; .Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 144); .Location = new Point(460, 63);
.Name = "查看现有技能"; .Name = "查看现有技能";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 1; .TabIndex = 2;
.Text = "查看现有技能"; .Text = "查看现有技能";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -74,10 +76,10 @@
// 查看现有物品 // 查看现有物品
// //
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; .Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Location = new Point(460, 185); .Location = new Point(460, 104);
.Name = "查看现有物品"; .Name = "查看现有物品";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 2; .TabIndex = 4;
.Text = "查看现有物品"; .Text = "查看现有物品";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -88,7 +90,7 @@
.Location = new Point(564, 226); .Location = new Point(564, 226);
.Name = "创建角色"; .Name = "创建角色";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 3; .TabIndex = 9;
.Text = "创建角色"; .Text = "创建角色";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -99,7 +101,7 @@
.Location = new Point(564, 267); .Location = new Point(564, 267);
.Name = "创建技能"; .Name = "创建技能";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 4; .TabIndex = 11;
.Text = "创建技能"; .Text = "创建技能";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -110,7 +112,7 @@
.Location = new Point(564, 308); .Location = new Point(564, 308);
.Name = "创建物品"; .Name = "创建物品";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 5; .TabIndex = 13;
.Text = "创建物品"; .Text = "创建物品";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -121,7 +123,7 @@
.Location = new Point(460, 308); .Location = new Point(460, 308);
.Name = "删除物品"; .Name = "删除物品";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 8; .TabIndex = 12;
.Text = "删除物品"; .Text = "删除物品";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -132,7 +134,7 @@
.Location = new Point(460, 267); .Location = new Point(460, 267);
.Name = "删除技能"; .Name = "删除技能";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 7; .TabIndex = 10;
.Text = "删除技能"; .Text = "删除技能";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -143,7 +145,7 @@
.Location = new Point(460, 226); .Location = new Point(460, 226);
.Name = "删除角色"; .Name = "删除角色";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 6; .TabIndex = 8;
.Text = "删除角色"; .Text = "删除角色";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -175,7 +177,7 @@
.Location = new Point(460, 349); .Location = new Point(460, 349);
.Name = "全部保存"; .Name = "全部保存";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 12; .TabIndex = 14;
.Text = "全部保存"; .Text = "全部保存";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -186,7 +188,7 @@
.Location = new Point(564, 349); .Location = new Point(564, 349);
.Name = "保存角色"; .Name = "保存角色";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 11; .TabIndex = 15;
.Text = "保存角色"; .Text = "保存角色";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -197,7 +199,7 @@
.Location = new Point(460, 390); .Location = new Point(460, 390);
.Name = "保存技能"; .Name = "保存技能";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 10; .TabIndex = 16;
.Text = "保存技能"; .Text = "保存技能";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -208,7 +210,7 @@
.Location = new Point(564, 390); .Location = new Point(564, 390);
.Name = "保存物品"; .Name = "保存物品";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 13; .TabIndex = 17;
.Text = "保存物品"; .Text = "保存物品";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -217,10 +219,10 @@
// //
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; .Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Font = new Font("Microsoft YaHei UI", 8F); .Font = new Font("Microsoft YaHei UI", 8F);
.Location = new Point(564, 103); .Location = new Point(564, 22);
.Name = "为角色添加技能"; .Name = "为角色添加技能";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 14; .TabIndex = 1;
.Text = "为角色添加技能"; .Text = "为角色添加技能";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -229,10 +231,10 @@
// //
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; .Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Font = new Font("Microsoft YaHei UI", 8F); .Font = new Font("Microsoft YaHei UI", 8F);
.Location = new Point(564, 144); .Location = new Point(564, 63);
.Name = "为角色添加物品"; .Name = "为角色添加物品";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 15; .TabIndex = 3;
.Text = "为角色添加物品"; .Text = "为角色添加物品";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
@ -244,16 +246,42 @@
.Location = new Point(564, 185); .Location = new Point(564, 185);
.Name = "重新读取全部"; .Name = "重新读取全部";
.Size = new Size(98, 35); .Size = new Size(98, 35);
.TabIndex = 16; .TabIndex = 7;
.Text = "重新读取全部"; .Text = "重新读取全部";
.UseVisualStyleBackColor = true; .UseVisualStyleBackColor = true;
.Click += _Click; .Click += _Click;
// //
// 删除角色物品
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Font = new Font("Microsoft YaHei UI", 8F);
.Location = new Point(564, 145);
.Name = "删除角色物品";
.Size = new Size(98, 35);
.TabIndex = 6;
.Text = "删除角色物品";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 删除角色技能
//
.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
.Font = new Font("Microsoft YaHei UI", 8F);
.Location = new Point(564, 104);
.Name = "删除角色技能";
.Size = new Size(98, 35);
.TabIndex = 5;
.Text = "删除角色技能";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// EntityCreator // EntityCreator
// //
AutoScaleDimensions = new SizeF(7F, 17F); AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(674, 437); ClientSize = new Size(674, 437);
Controls.Add();
Controls.Add();
Controls.Add(); Controls.Add();
Controls.Add(); Controls.Add();
Controls.Add(); Controls.Add();
@ -272,6 +300,7 @@
Controls.Add(); Controls.Add();
Controls.Add(); Controls.Add();
Name = "EntityCreator"; Name = "EntityCreator";
StartPosition = FormStartPosition.CenterScreen;
Text = "实体创建器"; Text = "实体创建器";
.ResumeLayout(false); .ResumeLayout(false);
ResumeLayout(false); ResumeLayout(false);
@ -297,5 +326,7 @@
private Button ; private Button ;
private Button ; private Button ;
private Button ; private Button ;
private Button ;
private Button ;
} }
} }

View File

@ -0,0 +1,440 @@
using Microsoft.VisualBasic;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class EntityCreator : Form
{
private static GameModuleLoader? GameModuleLoader { get; set; } = null;
private CharacterCreator CharacterCreator { get; } = new();
private SkillCreator SkillCreator { get; } = new();
private ItemCreator ItemCreator { get; } = new();
private bool CheckSelectedIndex => .SelectedIndex != -1 && .SelectedIndex < .Items.Count;
private int nowClick = 0;
public EntityCreator()
{
InitializeComponent();
GameModuleLoader = LoadModules();
CharacterCreator.Load();
SkillCreator.Load();
ItemCreator.Load();
();
();
();
}
private void ()
{
.Items.Clear();
foreach (string name in CharacterCreator.LoadedCharacters.Keys)
{
.Items.Add(CharacterCreator.LoadedCharacters[name]);
}
nowClick = 0;
}
private void ()
{
.Items.Clear();
foreach (string name in SkillCreator.LoadedSkills.OrderBy(kv => kv.Value.Id).Select(kv => kv.Key))
{
.Items.Add(GetSkillDisplayName(SkillCreator, name));
}
nowClick = 1;
}
private void ()
{
.Items.Clear();
foreach (string name in ItemCreator.LoadedItems.OrderBy(kv => kv.Value.Id).Select(kv => kv.Key))
{
.Items.Add(GetItemDisplayName(ItemCreator, name));
}
nowClick = 2;
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 0)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 1)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (nowClick != 2)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
CharacterCreator.Save();
SkillCreator.Save();
ItemCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
CharacterCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
SkillCreator.Save();
MessageBox.Show("保存成功!");
}
private void _Click(object sender, EventArgs e)
{
ItemCreator.Save();
MessageBox.Show("保存成功!");
}
public static Skill? (long id, string name, SkillType type)
{
if (GameModuleLoader != null)
{
foreach (SkillModule module in GameModuleLoader.Skills.Values)
{
Skill? s = module.GetSkill(id, name, type);
if (s != null)
{
return s;
}
}
}
return null;
}
public static Item? (long id, string name, ItemType type)
{
if (GameModuleLoader != null)
{
foreach (ItemModule module in GameModuleLoader.Items.Values)
{
Item? i = module.GetItem(id, name, type);
if (i != null)
{
return i;
}
}
}
return null;
}
private void _MouseDoubleClick(object sender, EventArgs e)
{
if (CheckSelectedIndex)
{
ShowDetail d = new(CharacterCreator, SkillCreator, ItemCreator);
switch (nowClick)
{
case 0:
Character? character = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
d.SetText(nowClick, character, character?.GetInfo() ?? "");
d.ShowDialog();
break;
case 1:
Skill? s = SkillCreator.LoadedSkills.Where(kv => GetSkillDisplayName(SkillCreator, kv.Key) == .Items[.SelectedIndex].ToString()).Select(kv => kv.Value).FirstOrDefault();
if (s != null)
{
Skill? s2 = (s.Id, s.Name, s.SkillType);
if (s2 != null)
{
s = s2;
}
d.SetText(nowClick, s, s.ToString() ?? "");
d.ShowDialog();
}
break;
case 2:
Item? i = ItemCreator.LoadedItems.Where(kv => GetItemDisplayName(ItemCreator, kv.Key) == .Items[.SelectedIndex].ToString()).Select(kv => kv.Value).FirstOrDefault();
if (i != null)
{
Item? i2 = (i.Id, i.Name, i.ItemType);
if (i2 != null)
{
i.SetPropertyToItemModuleNew(i2);
i = i2;
}
d.SetText(nowClick, i, i.ToString() ?? "");
d.ShowDialog();
}
break;
default:
break;
}
d.Dispose();
}
}
private void ()
{
if (SkillCreator.LoadedSkills.Count != 0)
{
ShowList l = new();
l.AddListItem(SkillCreator.LoadedSkills.OrderBy(kv => kv.Value.Id).Where(kv => kv.Value.SkillType != SkillType.Item).Select(kv => GetSkillDisplayName(SkillCreator, kv.Key)).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Character? c = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
Skill? s = SkillCreator.LoadedSkills.Where(kv => GetSkillDisplayName(SkillCreator, kv.Key) == selected).Select(kv => kv.Value).FirstOrDefault();
if (c != null && s != null)
{
Skill? s2 = (s.Id, s.Name, s.SkillType);
if (s2 != null)
{
s = s2;
}
s.Character = c;
c.Skills.Add(s);
}
}
else
{
MessageBox.Show("技能列表为空!");
}
}
private void ()
{
if (ItemCreator.LoadedItems.Count != 0)
{
ShowList l = new();
l.AddListItem(ItemCreator.LoadedItems.OrderBy(kv => kv.Value.Id).Select(kv => GetItemDisplayName(ItemCreator, kv.Key)).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Character? c = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
Item? i = ItemCreator.LoadedItems.Where(kv => GetItemDisplayName(ItemCreator, kv.Key) == selected).Select(kv => kv.Value).FirstOrDefault();
if (c != null && i != null)
{
Item? i2 = (i.Id, i.Name, i.ItemType);
if (i2 != null)
{
i.SetPropertyToItemModuleNew(i2);
i = i2;
}
c.Equip(i);
}
}
else
{
MessageBox.Show("物品列表为空!");
}
}
private void ()
{
Character? c = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
if (c != null)
{
if (c.Skills.Count != 0)
{
ShowList l = new();
l.AddListItem(c.Skills.Select(s => s.GetIdName()).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Skill? s = c.Skills.Where(s => s.GetIdName() == selected).FirstOrDefault();
if (s != null) c.Skills.Remove(s);
}
else
{
MessageBox.Show("技能列表为空!");
}
}
}
private void ()
{
Character? c = CharacterCreator.LoadedCharacters.Values.Where(c => c.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault();
if (c != null)
{
if (c.Items.Count != 0)
{
ShowList l = new();
l.AddListItem(c.Items.Select(s => s.GetIdName()).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Item? i = c.Items.Where(i => i.GetIdName() == selected).FirstOrDefault();
if (i != null)
{
c.UnEquip(c.EquipSlot.GetEquipItemToSlot(i));
}
}
else
{
MessageBox.Show("物品列表为空!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0)
{
();
}
}
private void _Click(object sender, EventArgs e)
{
CharacterCreator.OpenCreator();
();
}
private void _Click(object sender, EventArgs e)
{
SkillCreator.OpenCreator();
();
}
private void _Click(object sender, EventArgs e)
{
ItemCreator.OpenCreator();
();
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 0 && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = CharacterCreator.LoadedCharacters.Where(ky => ky.Value.ToString() == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (CharacterCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 1 && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = SkillCreator.LoadedSkills.Where(kv => GetSkillDisplayName(SkillCreator, kv.Key) == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (SkillCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (CheckSelectedIndex && nowClick == 2 && MessageBox.Show("是否删除", "删除", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string name = ItemCreator.LoadedItems.Where(kv => GetItemDisplayName(ItemCreator, kv.Key) == .Items[.SelectedIndex].ToString()).FirstOrDefault().Key ?? "";
if (ItemCreator.Remove(name))
{
MessageBox.Show("删除成功!");
();
}
else
{
MessageBox.Show("删除失败!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (MessageBox.Show("重新读取会丢失未保存的数据,是否确认重新读取全部?", "重新读取全部", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
CharacterCreator.Load();
SkillCreator.Load();
ItemCreator.Load();
();
();
();
}
}
public static string GetSkillDisplayName(SkillCreator skillCreator, string name)
{
if (skillCreator.LoadedSkills.TryGetValue(name, out Skill? skill) && skill != null)
{
return $"[ {name} ] {skill.GetIdName()}";
}
return "";
}
public static string GetItemDisplayName(ItemCreator itemCreator, string name)
{
if (itemCreator.LoadedItems.TryGetValue(name, out Item? item) && item != null)
{
return $"[ {name} ] {item.GetIdName()}";
}
return "";
}
private static ItemType SelectItemType()
{
ShowList l = new();
l.AddListItem([ItemType.MagicCardPack, ItemType.Weapon, ItemType.Armor, ItemType.Shoes, ItemType.Accessory,
ItemType.Consumable, ItemType.MagicCard, ItemType.Collectible, ItemType.SpecialItem, ItemType.QuestItem, ItemType.GiftBox, ItemType.Others]);
l.Text = "选择一个物品类型";
l.ShowDialog();
return Enum.TryParse(l.SelectItem, out ItemType type) ? type : ItemType.Others;
}
private static GameModuleLoader LoadModules()
{
PluginLoader plugins = PluginLoader.LoadPlugins([]);
foreach (string plugin in plugins.Plugins.Keys)
{
Console.WriteLine(plugin + " is loaded.");
}
return GameModuleLoader.LoadGameModules(FunGameInfo.FunGame.FunGame_Desktop, []);
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -9,7 +9,7 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions
public void Load() public void Load()
{ {
EntityModuleConfig<Item> config = new("redbud.fun.entitycreator", "itemcreator"); EntityModuleConfig<Item> config = new("EntityCreator", "item.creator");
config.LoadConfig(); config.LoadConfig();
LoadedItems = new(config); LoadedItems = new(config);
} }
@ -26,12 +26,18 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions
public void Save() public void Save()
{ {
EntityModuleConfig<Item> config = new("redbud.fun.entitycreator", "itemcreator"); EntityModuleConfig<Item> config = new("EntityCreator", "item.creator");
foreach (string key in LoadedItems.Keys) foreach (string key in LoadedItems.Keys)
{ {
config.Add(key, LoadedItems[key]); config.Add(key, LoadedItems[key]);
} }
config.SaveConfig(); config.SaveConfig();
} }
public void OpenCreator(Item? item = null)
{
CreateItem creator = new(this, item);
creator.ShowDialog();
}
} }
} }

View File

@ -0,0 +1,130 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
partial class ShowDetail
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
= new RichTextBox();
= new Button();
= new Button();
= new Button();
= new Button();
= new Button();
SuspendLayout();
//
// richTextBox1
//
.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
.Location = new Point(12, 12);
.Name = "richTextBox1";
.ReadOnly = true;
.Size = new Size(584, 513);
.TabIndex = 0;
.Text = "";
//
// 编辑
//
.Font = new Font("等线", 18F, FontStyle.Regular, GraphicsUnit.Point, 134);
.Location = new Point(602, 456);
.Name = "编辑";
.Size = new Size(89, 69);
.TabIndex = 1;
.Text = "编辑";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 加技能
//
.Font = new Font("等线", 15F, FontStyle.Regular, GraphicsUnit.Point, 134);
.Location = new Point(602, 306);
.Name = "加技能";
.Size = new Size(89, 69);
.TabIndex = 2;
.Text = "加技能";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 加物品
//
.Font = new Font("等线", 15F, FontStyle.Regular, GraphicsUnit.Point, 134);
.Location = new Point(602, 381);
.Name = "加物品";
.Size = new Size(89, 69);
.TabIndex = 3;
.Text = "加物品";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 删物品
//
.Font = new Font("等线", 15F, FontStyle.Regular, GraphicsUnit.Point, 134);
.Location = new Point(602, 231);
.Name = "删物品";
.Size = new Size(89, 69);
.TabIndex = 5;
.Text = "删物品";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// 删技能
//
.Font = new Font("等线", 15F, FontStyle.Regular, GraphicsUnit.Point, 134);
.Location = new Point(602, 156);
.Name = "删技能";
.Size = new Size(89, 69);
.TabIndex = 4;
.Text = "删技能";
.UseVisualStyleBackColor = true;
.Click += _Click;
//
// ShowDetail
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(697, 537);
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Controls.Add();
Name = "ShowDetail";
StartPosition = FormStartPosition.CenterScreen;
Text = "ShowDetail";
ResumeLayout(false);
}
#endregion
private RichTextBox ;
private Button ;
private Button ;
private Button ;
private Button ;
private Button ;
}
}

View File

@ -0,0 +1,199 @@
using Milimoe.FunGame.Core.Entity;
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class ShowDetail : Form
{
private CharacterCreator? CharacterCreator { get; }
private SkillCreator? SkillCreator { get; }
private ItemCreator? ItemCreator { get; }
private int NowClick { get; set; } = -1;
private BaseEntity? BaseEntity { get; set; }
public ShowDetail(CharacterCreator? characterCreator, SkillCreator? skillCreator, ItemCreator? itemCreator)
{
InitializeComponent();
CharacterCreator = characterCreator;
SkillCreator = skillCreator;
ItemCreator = itemCreator;
Text = "详细信息查看";
}
public void SetText(int nowClick, BaseEntity? entity, string text)
{
NowClick = nowClick;
BaseEntity = entity;
if (nowClick == 0)
{
.Enabled = true;
.Enabled = true;
.Enabled = true;
.Enabled = true;
.Enabled = true;
}
else if (nowClick == 1)
{
.Enabled = false;
.Enabled = false;
.Enabled = false;
.Enabled = false;
.Enabled = true;
}
else if (nowClick == 2)
{
.Enabled = true;
.Enabled = false;
.Enabled = true;
.Enabled = false;
.Enabled = true;
}
else
{
.Enabled = false;
.Enabled = false;
.Enabled = false;
.Enabled = false;
.Enabled = false;
}
.Text = text;
}
private void _Click(object sender, EventArgs e)
{
if (NowClick == 0 && BaseEntity is Character c)
{
CharacterCreator?.OpenCreator(c);
}
else if (NowClick == 1 && BaseEntity is Skill s)
{
SkillCreator?.OpenCreator(s);
}
else if (NowClick == 2 && BaseEntity is Item i)
{
ItemCreator?.OpenCreator(i);
}
}
private void _Click(object sender, EventArgs e)
{
if (NowClick == 0 && ItemCreator != null && BaseEntity is Character c)
{
if (ItemCreator.LoadedItems.Count != 0)
{
ShowList l = new();
l.AddListItem(ItemCreator.LoadedItems.OrderBy(kv => kv.Value.Id).Select(kv => EntityCreator.GetItemDisplayName(ItemCreator, kv.Key)).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Item? i = ItemCreator.LoadedItems.Where(kv => EntityCreator.GetItemDisplayName(ItemCreator, kv.Key) == selected).Select(kv => kv.Value).FirstOrDefault();
if (c != null && i != null)
{
Item? i2 = EntityCreator.(i.Id, i.Name, i.ItemType);
if (i2 != null)
{
i.SetPropertyToItemModuleNew(i2);
i = i2;
}
c.Equip(i);
.Text = c.GetInfo();
}
}
else
{
MessageBox.Show("物品列表为空!");
}
}
}
private void _Click(object sender, EventArgs e)
{
if (NowClick == 0 && SkillCreator != null && BaseEntity is Character c)
{
if (SkillCreator.LoadedSkills.Count != 0)
{
ShowList l = new();
l.AddListItem(SkillCreator.LoadedSkills.OrderBy(kv => kv.Value.Id).Where(kv => kv.Value.SkillType != Core.Library.Constant.SkillType.Item).Select(kv => EntityCreator.GetSkillDisplayName(SkillCreator, kv.Key)).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Skill? s = SkillCreator.LoadedSkills.Where(kv => EntityCreator.GetSkillDisplayName(SkillCreator, kv.Key) == selected).Select(kv => kv.Value).FirstOrDefault();
if (c != null && s != null)
{
Skill? s2 = EntityCreator.(s.Id, s.Name, s.SkillType);
if (s2 != null)
{
s = s2;
}
s.Character = c;
c.Skills.Add(s);
.Text = c.GetInfo();
}
}
else
{
MessageBox.Show("技能列表为空!");
}
}
else if (NowClick == 2)
{
MessageBox.Show("再说吧,暂不支持。");
}
}
private void _Click(object sender, EventArgs e)
{
if (NowClick == 0 && BaseEntity is Character c)
{
if (c != null)
{
if (c.Items.Count != 0)
{
ShowList l = new();
l.AddListItem(c.Items.OrderBy(i => i.Id).Select(i => i.GetIdName()).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Item? i = c.Items.Where(i => i.GetIdName() == selected).FirstOrDefault();
if (i != null)
{
c.UnEquip(c.EquipSlot.GetEquipItemToSlot(i));
.Text = c.GetInfo();
}
}
else
{
MessageBox.Show("物品列表为空!");
}
}
}
}
private void _Click(object sender, EventArgs e)
{
if (NowClick == 0 && BaseEntity is Character c)
{
if (c != null)
{
if (c.Skills.Count != 0)
{
ShowList l = new();
l.AddListItem(c.Skills.OrderBy(s => s.Id).Select(s => s.GetIdName()).ToArray());
l.ShowDialog();
string selected = l.SelectItem;
Skill? s = c.Skills.Where(s => s.GetIdName() == selected).FirstOrDefault();
if (s != null)
{
c.Skills.Remove(s);
.Text = c.GetInfo();
}
}
else
{
MessageBox.Show("技能列表为空!");
}
}
}
else if (NowClick == 2)
{
MessageBox.Show("再说吧,暂不支持。");
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,6 +1,6 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions namespace Milimoe.FunGame.Testing.Desktop.Solutions
{ {
partial class Showlist partial class ShowList
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -48,8 +48,9 @@
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(508, 450); ClientSize = new Size(508, 450);
Controls.Add(); Controls.Add();
Name = "Showlist"; Name = "ShowList";
Text = "Showlist"; Text = "ShowList";
StartPosition = FormStartPosition.CenterScreen;
ResumeLayout(false); ResumeLayout(false);
} }

View File

@ -1,12 +1,13 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions namespace Milimoe.FunGame.Testing.Desktop.Solutions
{ {
public partial class Showlist : Form public partial class ShowList : Form
{ {
public string SelectItem { get; set; } = ""; public string SelectItem { get; set; } = "";
public Showlist() public ShowList()
{ {
InitializeComponent(); InitializeComponent();
Text = "双击选择一项";
} }
public void AddListItem(object[] items) public void AddListItem(object[] items)

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -9,7 +9,7 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions
public void Load() public void Load()
{ {
EntityModuleConfig<Skill> config = new("redbud.fun.entitycreator", "skillcreator"); EntityModuleConfig<Skill> config = new("EntityCreator", "skill.creator");
config.LoadConfig(); config.LoadConfig();
LoadedSkills = new(config); LoadedSkills = new(config);
} }
@ -26,12 +26,18 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions
public void Save() public void Save()
{ {
EntityModuleConfig<Skill> config = new("redbud.fun.entitycreator", "skillcreator"); EntityModuleConfig<Skill> config = new("EntityCreator", "skill.creator");
foreach (string key in LoadedSkills.Keys) foreach (string key in LoadedSkills.Keys)
{ {
config.Add(key, LoadedSkills[key]); config.Add(key, LoadedSkills[key]);
} }
config.SaveConfig(); config.SaveConfig();
} }
public void OpenCreator(Skill? skill = null)
{
CreateSkill creator = new(this, skill);
creator.ShowDialog();
}
} }
} }

View File

@ -1,59 +0,0 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
partial class ShowDetail
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
richTextBox1 = new RichTextBox();
SuspendLayout();
//
// richTextBox1
//
richTextBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
richTextBox1.Location = new Point(12, 12);
richTextBox1.Name = "richTextBox1";
richTextBox1.ReadOnly = true;
richTextBox1.Size = new Size(622, 453);
richTextBox1.TabIndex = 0;
richTextBox1.Text = "";
//
// ShowDetail
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(646, 477);
Controls.Add(richTextBox1);
Name = "ShowDetail";
Text = "ShowDetail";
ResumeLayout(false);
}
#endregion
private RichTextBox richTextBox1;
}
}

View File

@ -1,15 +0,0 @@
namespace Milimoe.FunGame.Testing.Desktop.Solutions
{
public partial class ShowDetail : Form
{
public ShowDetail()
{
InitializeComponent();
}
public void SetText(string text)
{
richTextBox1.Text = text;
}
}
}

View File

@ -7,11 +7,11 @@ namespace Milimoe.FunGame.Testing.Effects
{ {
public override long Id => Skill.Id; public override long Id => Skill.Id;
public override string Name => Skill.Name; public override string Name => Skill.Name;
public override string Description => $"增加角色 {实际冷却缩减加成 * 100:0.##}% 冷却缩减。" + (!TargetSelf ? $"来自:[ {Source} ] 的 [ {Item.Name} ]" : ""); public override string Description => $"增加角色 {实际冷却缩减加成 * 100:0.##}% 冷却缩减。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item; public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true; public override bool TargetSelf => true;
public Item Item { get; } public Item? Item { get; }
private readonly double = 0; private readonly double = 0;
public override void OnEffectGained(Character character) public override void OnEffectGained(Character character)
@ -24,7 +24,7 @@ namespace Milimoe.FunGame.Testing.Effects
character.ExCDR -= ; character.ExCDR -= ;
} }
public (Skill skill, Character? source, Item item, double exCdr) : base(skill) public (Skill skill, Character? source, Item? item, double exCdr) : base(skill)
{ {
ActionQueue = skill.ActionQueue; ActionQueue = skill.ActionQueue;
Source = source; Source = source;

View File

@ -8,11 +8,11 @@ namespace Milimoe.FunGame.Testing.Effects
{ {
public override long Id => Skill.Id; public override long Id => Skill.Id;
public override string Name => Skill.Name; public override string Name => Skill.Name;
public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ] 的 [ {Item.Name} ]" : ""); public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item; public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true; public override bool TargetSelf => true;
public Item Item { get; } public Item? Item { get; }
private readonly double = 2; private readonly double = 2;
public override void OnEffectGained(Character character) public override void OnEffectGained(Character character)
@ -41,7 +41,7 @@ namespace Milimoe.FunGame.Testing.Effects
} }
} }
public (Skill skill, Character? source, Item item, double reduce) : base(skill) public (Skill skill, Character? source, Item? item, double reduce) : base(skill)
{ {
ActionQueue = skill.ActionQueue; ActionQueue = skill.ActionQueue;
Source = source; Source = source;

View File

@ -7,11 +7,11 @@ namespace Milimoe.FunGame.Testing.Effects
{ {
public override long Id => Skill.Id; public override long Id => Skill.Id;
public override string Name => Skill.Name; public override string Name => Skill.Name;
public override string Description => $"增加角色 {实际攻击力加成} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ] 的 [ {Item.Name} ]" : ""); public override string Description => $"增加角色 {实际攻击力加成} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item; public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true; public override bool TargetSelf => true;
public Item Item { get; } public Item? Item { get; }
private readonly double = 0; private readonly double = 0;
public override void OnEffectGained(Character character) public override void OnEffectGained(Character character)
@ -24,7 +24,7 @@ namespace Milimoe.FunGame.Testing.Effects
character.ExATK2 -= ; character.ExATK2 -= ;
} }
public (Skill skill, Character? source, Item item, double exATK) : base(skill) public (Skill skill, Character? source, Item? item, double exATK) : base(skill)
{ {
ActionQueue = skill.ActionQueue; ActionQueue = skill.ActionQueue;
Source = source; Source = source;

View File

@ -8,11 +8,11 @@ namespace Milimoe.FunGame.Testing.Effects
{ {
public override long Id => Skill.Id; public override long Id => Skill.Id;
public override string Name => Skill.Name; public override string Name => Skill.Name;
public override string Description => $"减少角色的普通攻击 {实际硬直时间减少} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ] 的 [ {Item.Name} ]" : ""); public override string Description => $"减少角色的普通攻击 {实际硬直时间减少} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item; public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true; public override bool TargetSelf => true;
public Item Item { get; } public Item? Item { get; }
private readonly double = 2; private readonly double = 2;
public override void OnEffectGained(Character character) public override void OnEffectGained(Character character)
@ -25,7 +25,7 @@ namespace Milimoe.FunGame.Testing.Effects
character.NormalAttack.HardnessTime = Calculation.Round2Digits(character.NormalAttack.HardnessTime + ); ; character.NormalAttack.HardnessTime = Calculation.Round2Digits(character.NormalAttack.HardnessTime + ); ;
} }
public (Skill skill, Character? source, Item item, double reduce) : base(skill) public (Skill skill, Character? source, Item? item, double reduce) : base(skill)
{ {
ActionQueue = skill.ActionQueue; ActionQueue = skill.ActionQueue;
Source = source; Source = source;

View File

@ -7,11 +7,11 @@ namespace Milimoe.FunGame.Testing.Effects
{ {
public override long Id => Skill.Id; public override long Id => Skill.Id;
public override string Name => Skill.Name; public override string Name => Skill.Name;
public override string Description => $"增加角色 {实际物理护甲加成} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ] 的 [ {Item.Name} ]" : ""); public override string Description => $"增加角色 {实际物理护甲加成} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item; public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true; public override bool TargetSelf => true;
public Item Item { get; } public Item? Item { get; }
private readonly double = 0; private readonly double = 0;
public override void OnEffectGained(Character character) public override void OnEffectGained(Character character)
@ -24,7 +24,7 @@ namespace Milimoe.FunGame.Testing.Effects
character.ExDEF2 -= ; character.ExDEF2 -= ;
} }
public (Skill skill, Character? source, Item item, double exDef) : base(skill) public (Skill skill, Character? source, Item? item, double exDef) : base(skill)
{ {
ActionQueue = skill.ActionQueue; ActionQueue = skill.ActionQueue;
Source = source; Source = source;

View File

@ -1,12 +1,13 @@
using Milimoe.FunGame.Testing.Effects; using Milimoe.FunGame.Testing.Effects;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Skills;
namespace Milimoe.FunGame.Testing.Items namespace Milimoe.FunGame.Testing.Items
{ {
public class 10 : Item public class 10 : Item
{ {
public override long Id => 14001; public override long Id => (long)AccessoryID.10;
public override string Name => "攻击之爪 +10"; public override string Name => "攻击之爪 +10";
public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : "";
@ -18,6 +19,7 @@ namespace Milimoe.FunGame.Testing.Items
public class 30 : Item public class 30 : Item
{ {
public override long Id => (long)AccessoryID.30;
public override string Name => "攻击之爪 +30"; public override string Name => "攻击之爪 +30";
public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : "";
@ -29,6 +31,7 @@ namespace Milimoe.FunGame.Testing.Items
public class 50 : Item public class 50 : Item
{ {
public override long Id => (long)AccessoryID.50;
public override string Name => "攻击之爪 +50"; public override string Name => "攻击之爪 +50";
public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : ""; public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : "";
@ -40,12 +43,12 @@ namespace Milimoe.FunGame.Testing.Items
public class : Skill public class : Skill
{ {
public override long Id => 5001; public override long Id => (long)ItemPassiveID.;
public override string Name => "攻击之爪"; public override string Name => "攻击之爪";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public Item Item { get; } public Item? Item { get; }
public (Character? character, Item item, double exATK) : base(SkillType.Passive, character) public (Character? character = null, Item? item = null, double exATK = 0) : base(SkillType.Passive, character)
{ {
Level = 1; Level = 1;
Item = item; Item = item;

9
Library/Items/ItemID.cs Normal file
View File

@ -0,0 +1,9 @@
namespace Milimoe.FunGame.Testing.Items
{
public enum AccessoryID : long
{
10 = 14001,
30 = 14002,
50 = 14003,
}
}

View File

@ -7,14 +7,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3010; public override long Id => (long)SuperSkillID.;
public override string Name => "嗜血本能"; public override string Name => "嗜血本能";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 42 - 1 * (Level - 1); public override double CD => 42 - 1 * (Level - 1);
public override double HardnessTime { get; set; } = 12; public override double HardnessTime { get; set; } = 12;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -7,11 +7,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4010; public override long Id => (long)PassiveID.;
public override string Name => "累积之压"; public override string Name => "累积之压";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3006; public override long Id => (long)SuperSkillID.;
public override string Name => "精准打击"; public override string Name => "精准打击";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 40 - 1 * (Level - 1); public override double CD => 40 - 1 * (Level - 1);
public override double HardnessTime { get; set; } = 8; public override double HardnessTime { get; set; } = 8;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -5,11 +5,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4006; public override long Id => (long)PassiveID.;
public override string Name => "致命打击"; public override string Name => "致命打击";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -5,14 +5,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3004; public override long Id => (long)SuperSkillID.;
public override string Name => "三重叠加"; public override string Name => "三重叠加";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 35 - 2 * (Level - 1); public override double CD => 35 - 2 * (Level - 1);
public override double HardnessTime { get; set; } = 10; public override double HardnessTime { get; set; } = 10;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4004; public override long Id => (long)PassiveID.;
public override string Name => "灵能反射"; public override string Name => "灵能反射";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3005; public override long Id => (long)SuperSkillID.;
public override string Name => "变幻之心"; public override string Name => "变幻之心";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 30; public override double CD => 30;
public override double HardnessTime { get; set; } = 10; public override double HardnessTime { get; set; } = 10;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -5,11 +5,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4005; public override long Id => (long)PassiveID.;
public override string Name => "智慧与力量"; public override string Name => "智慧与力量";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class META马 : Skill public class META马 : Skill
{ {
public override long Id => 4001; public override long Id => (long)PassiveID.META马;
public override string Name => "META马"; public override string Name => "META马";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public META马(Character character) : base(SkillType.Passive, character) public META马(Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new META马特效(this)); Effects.Add(new META马特效(this));
} }

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3002; public override long Id => (long)SuperSkillID.;
public override string Name => "力量爆发"; public override string Name => "力量爆发";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 55; public override double CD => 55;
public override double HardnessTime { get; set; } = 0; public override double HardnessTime { get; set; } = 0;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4009; public override long Id => (long)PassiveID.;
public override string Name => "玻璃大炮"; public override string Name => "玻璃大炮";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3009; public override long Id => (long)SuperSkillID.;
public override string Name => "迅捷之势"; public override string Name => "迅捷之势";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 60 - 2 * (Level - 1); public override double CD => 60 - 2 * (Level - 1);
public override double HardnessTime { get; set; } = 15; public override double HardnessTime { get; set; } = 15;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4008; public override long Id => (long)PassiveID.;
public override string Name => "枯竭打击"; public override string Name => "枯竭打击";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3008; public override long Id => (long)SuperSkillID.;
public override string Name => "能量毁灭"; public override string Name => "能量毁灭";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 55 - 3 * (Level - 1); public override double CD => 55 - 3 * (Level - 1);
public override double HardnessTime { get; set; } = 25; public override double HardnessTime { get; set; } = 25;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4012; public override long Id => (long)PassiveID.;
public override string Name => "弱者猎手"; public override string Name => "弱者猎手";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -7,14 +7,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4012; public override long Id => (long)SuperSkillID.;
public override string Name => "血之狂欢"; public override string Name => "血之狂欢";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 45; public override double CD => 45;
public override double HardnessTime { get; set; } = 7; public override double HardnessTime { get; set; } = 7;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

54
Library/Skills/SkillID.cs Normal file
View File

@ -0,0 +1,54 @@
namespace Milimoe.FunGame.Testing.Skills
{
public enum MagicID : long
{
= 1001,
}
public enum SkillID : long
{
= 2001,
}
public enum SuperSkillID : long
{
= 3001,
= 3002,
= 3003,
= 3004,
= 3005,
= 3006,
= 3007,
= 3008,
= 3009,
= 3010,
= 3011,
= 3012,
}
public enum PassiveID : long
{
META马 = 4001,
= 4002,
= 4003,
= 4004,
= 4005,
= 4006,
= 4007,
= 4008,
= 4009,
= 4010,
= 4011,
= 4012,
}
public enum ItemPassiveID : long
{
= 5001,
}
public enum ItemActiveID : long
{
}
}

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3001; public override long Id => (long)SuperSkillID.;
public override string Name => "天赐之力"; public override string Name => "天赐之力";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 60; public override double CD => 60;
public override double HardnessTime { get; set; } = 15; public override double HardnessTime { get; set; } = 15;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4002; public override long Id => (long)PassiveID.;
public override string Name => "心灵之火"; public override string Name => "心灵之火";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3003; public override long Id => (long)SuperSkillID.;
public override string Name => "魔法涌流"; public override string Name => "魔法涌流";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 35; public override double CD => 35;
public override double HardnessTime { get; set; } = 10; public override double HardnessTime { get; set; } = 10;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4003; public override long Id => (long)PassiveID.;
public override string Name => "魔法震荡"; public override string Name => "魔法震荡";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 2001; public override long Id => (long)SkillID.;
public override string Name => "疾风步"; public override string Name => "疾风步";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 60; public override double EPCost => 60;
public override double CD => 35; public override double CD => 35;
public override double HardnessTime { get; set; } = 5; public override double HardnessTime { get; set; } = 5;
public (Character character) : base(SkillType.Skill, character) public (Character? character = null) : base(SkillType.Skill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -5,14 +5,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4011; public override long Id => (long)SuperSkillID.;
public override string Name => "平衡强化"; public override string Name => "平衡强化";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 55 - (1 * (Level - 1)); public override double CD => 55 - (1 * (Level - 1));
public override double HardnessTime { get; set; } = 12; public override double HardnessTime { get; set; } = 12;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4011; public override long Id => (long)PassiveID.;
public override string Name => "敏捷之刃"; public override string Name => "敏捷之刃";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,11 +6,11 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 4007; public override long Id => (long)PassiveID.;
public override string Name => "毁灭之势"; public override string Name => "毁灭之势";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character) public (Character? character = null) : base(SkillType.Passive, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,14 +6,14 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 3007; public override long Id => (long)SuperSkillID.;
public override string Name => "绝对领域"; public override string Name => "绝对领域";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => Math.Max(100, Character?.EP ?? 100); public override double EPCost => Math.Max(100, Character?.EP ?? 100);
public override double CD => 32 + (1 * (Level - 1)); public override double CD => 32 + (1 * (Level - 1));
public override double HardnessTime { get; set; } = 12; public override double HardnessTime { get; set; } = 12;
public (Character character) : base(SkillType.SuperSkill, character) public (Character? character = null) : base(SkillType.SuperSkill, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -6,7 +6,7 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public class : Skill public class : Skill
{ {
public override long Id => 2001; public override long Id => (long)MagicID.;
public override string Name => "冰霜攻击"; public override string Name => "冰霜攻击";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 30 + (50 * (Level - 1)); public override double MPCost => 30 + (50 * (Level - 1));
@ -14,7 +14,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override double CastTime => 6; public override double CastTime => 6;
public override double HardnessTime { get; set; } = 3; public override double HardnessTime { get; set; } = 3;
public (Character character) : base(SkillType.Magic, character) public (Character? character = null) : base(SkillType.Magic, character)
{ {
Effects.Add(new (this)); Effects.Add(new (this));
} }

View File

@ -1,6 +1,7 @@
using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon; using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Items; using Milimoe.FunGame.Testing.Items;
using Milimoe.FunGame.Testing.Skills; using Milimoe.FunGame.Testing.Skills;
@ -49,47 +50,108 @@ namespace Addons
{ {
get get
{ {
Character c = Factory.GetCharacter(); EntityModuleConfig<Skill> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleSkill);
List<Skill> list = []; config.LoadConfig();
list.Add(new (c)); foreach (string key in config.Keys)
list.Add(new (c)); {
list.Add(new META马(c)); Skill prev = config[key];
list.Add(new (c)); Skill? next = GetSkill(prev.Id, prev.Name, prev.SkillType);
list.Add(new (c)); if (next != null)
list.Add(new (c)); {
list.Add(new (c)); config[key] = next;
list.Add(new (c)); }
list.Add(new (c)); }
list.Add(new (c)); return [.. config.Values];
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
list.Add(new (c));
return list;
} }
} }
public override Skill? GetSkill(long id, string name) public override Skill? GetSkill(long id, string name, SkillType type)
{ {
string str = id + "." + name; if (type == SkillType.Magic)
if (Skills.Where(s => s.GetIdName() == str).FirstOrDefault() is Skill s)
{ {
return s; switch ((MagicID)id)
{
case MagicID.:
return new ();
}
} }
if (type == SkillType.Skill)
{
switch ((SkillID)id)
{
case SkillID.:
return new ();
}
}
if (type == SkillType.SuperSkill)
{
switch ((SuperSkillID)id)
{
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
}
}
if (type == SkillType.Passive)
{
switch ((PassiveID)id)
{
case PassiveID.META马:
return new META马();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
}
switch ((ItemPassiveID)id)
{
case ItemPassiveID.:
return new ();
}
}
return null; return null;
} }
} }
@ -108,19 +170,42 @@ namespace Addons
{ {
get get
{ {
List<Item> list = []; EntityModuleConfig<Item> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleItem);
list.Add(new 50()); config.LoadConfig();
return list; foreach (string key in config.Keys)
{
Item prev = config[key];
Item? next = GetItem(prev.Id, prev.Name, prev.ItemType);
if (next != null)
{
prev.SetPropertyToItemModuleNew(next);
config[key] = next;
}
}
return [.. config.Values];
} }
} }
public override Item? GetItem(long id, string name) public override Item? GetItem(long id, string name, ItemType type)
{ {
string str = id + "." + name; if (type == ItemType.MagicCardPack)
if (Items.Where(s => s.GetIdName() == str).FirstOrDefault() is Item i)
{ {
return i;
} }
if (type == ItemType.Accessory)
{
switch ((AccessoryID)id)
{
case AccessoryID.10:
return new 10();
case AccessoryID.30:
return new 30();
case AccessoryID.50:
return new 50();
}
}
return null; return null;
} }
} }

View File

@ -78,6 +78,8 @@ namespace Addons
EntityModuleConfig<Item> config3 = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleItem) EntityModuleConfig<Item> config3 = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleItem)
{ {
{ "攻击之爪10", new 10() },
{ "攻击之爪30", new 30() },
{ "攻击之爪50", new 50() } { "攻击之爪50", new 50() }
}; };
config3.SaveConfig(); config3.SaveConfig();

View File

@ -422,10 +422,10 @@ namespace Milimoe.FunGame.Testing.Tests
Item[] ; Item[] ;
if (totalTime == 0) if (totalTime == 0)
{ {
WriteLine("社区送温暖了,现在向所有人发放 [ 攻击之爪 +50 ]"); WriteLine("社区送温暖了,现在向所有人发放 [ 攻击之爪 +10 ]");
foreach (Character character in queue.Queue) foreach (Character character in queue.Queue)
{ {
= [new 50()]; = [new 10()];
foreach (Item item in ) foreach (Item item in )
{ {
queue.Equip(character, EquipItemToSlot.Accessory1, item); queue.Equip(character, EquipItemToSlot.Accessory1, item);