213 lines
7.3 KiB
C#

using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Items;
using Milimoe.FunGame.Testing.Skills;
namespace Addons
{
public class ExampleGameModuleConstant
{
public const string Example = "fungame.example.gamemode";
public const string ExampleCharacter = "fungame.example.character";
public const string ExampleSkill = "fungame.example.skill";
public const string ExampleItem = "fungame.example.item";
}
public class ExampleCharacterModule : CharacterModule
{
public override string Name => ExampleGameModuleConstant.ExampleCharacter;
public override string Description => "My First CharacterModule";
public override string Version => "1.0.0";
public override string Author => "FunGamer";
public override List<Character> Characters
{
get
{
EntityModuleConfig<Character> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleCharacter);
config.LoadConfig();
return [.. config.Values];
}
}
}
public class ExampleSkillModule : SkillModule
{
public override string Name => ExampleGameModuleConstant.ExampleSkill;
public override string Description => "My First SkillModule";
public override string Version => "1.0.0";
public override string Author => "FunGamer";
public override List<Skill> Skills
{
get
{
EntityModuleConfig<Skill> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleSkill);
config.LoadConfig();
foreach (string key in config.Keys)
{
Skill prev = config[key];
Skill? next = GetSkill(prev.Id, prev.Name, prev.SkillType);
if (next != null)
{
config[key] = next;
}
}
return [.. config.Values];
}
}
public override Skill? GetSkill(long id, string name, SkillType type)
{
if (type == SkillType.Magic)
{
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;
}
}
public class ExampleItemModule : ItemModule
{
public override string Name => ExampleGameModuleConstant.ExampleItem;
public override string Description => "My First ItemModule";
public override string Version => "1.0.0";
public override string Author => "FunGamer";
public override List<Item> Items
{
get
{
EntityModuleConfig<Item> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleItem);
config.LoadConfig();
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, ItemType type)
{
if (type == ItemType.MagicCardPack)
{
}
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;
}
}
}