mirror of
https://github.com/milimoe/FunGame-Testing.git
synced 2025-04-22 12:19:34 +08:00
213 lines
7.3 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|