chore: initialize OshimaBot repository (rename from Enhancement)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace OshimaBot.Game.Constants
|
||||
{
|
||||
public class OshimaGameModuleConstant
|
||||
{
|
||||
public const string General = "oshima-studios";
|
||||
public const string WebAPI = "oshima.fungame.webapi";
|
||||
public const string FastAuto = "oshima.fungame.fastauto";
|
||||
public const string Character = "oshima.fungame.characters";
|
||||
public const string Skill = "oshima.fungame.skills";
|
||||
public const string Item = "oshima.fungame.items";
|
||||
public const string Description = "Oshima Studios Presents";
|
||||
public const string Version = "1.0.0";
|
||||
public const string Author = "Oshima Studios";
|
||||
public const string FastAutoMap = "oshima.fungame.fastauto.map";
|
||||
public const string Anonymous = "oshima.fungame.anonymous";
|
||||
public const string AnonymousMap = "oshima.fungame.anonymous.map";
|
||||
public const string Server = "oshima.fungame.server";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using OshimaBot.Game.Constants;
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using OshimaBot.Content.Characters;
|
||||
using CM = FunGame.Core.Library.Module.CharacterModule;
|
||||
|
||||
namespace OshimaBot.Game.Modules
|
||||
{
|
||||
public class CharacterModule : CM
|
||||
{
|
||||
public override string Name => OshimaGameModuleConstant.Character;
|
||||
public override string Description => OshimaGameModuleConstant.Description;
|
||||
public override string Version => OshimaGameModuleConstant.Version;
|
||||
public override string Author => OshimaGameModuleConstant.Author;
|
||||
public Dictionary<string, Character> KnownCharacters { get; } = [];
|
||||
|
||||
public override Dictionary<string, Character> Characters
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<string, Character> characters = Factory.GetGameModuleInstances<Character>(OshimaGameModuleConstant.General, OshimaGameModuleConstant.Character);
|
||||
if (KnownCharacters.Count == 0 && characters.Count > 0)
|
||||
{
|
||||
foreach (string key in characters.Keys)
|
||||
{
|
||||
KnownCharacters[key] = characters[key];
|
||||
}
|
||||
}
|
||||
return characters;
|
||||
}
|
||||
}
|
||||
|
||||
protected override Factory.EntityFactoryDelegate<Character> CharacterFactory()
|
||||
{
|
||||
return (id, name, args) =>
|
||||
{
|
||||
return id switch
|
||||
{
|
||||
1 => new OshimaShiya(),
|
||||
2 => new XinYin(),
|
||||
3 => new Yang(),
|
||||
4 => new NanGanYu(),
|
||||
5 => new NiuNan(),
|
||||
6 => new DokyoMayor(),
|
||||
7 => new MagicalGirl(),
|
||||
8 => new QingXiang(),
|
||||
9 => new QWQAQW(),
|
||||
10 => new ColdBlue(),
|
||||
11 => new Dddovo(),
|
||||
12 => new Quduoduo(),
|
||||
13 => new ShiYu(),
|
||||
14 => new XReouni(),
|
||||
15 => new Neptune(),
|
||||
16 => new CHAOS(),
|
||||
17 => new Ryuko(),
|
||||
18 => new TheGodK(),
|
||||
_ => null,
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
using OshimaBot.Game.Constants;
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using OshimaBot.Content.Items;
|
||||
using IM = FunGame.Core.Library.Module.ItemModule;
|
||||
|
||||
namespace OshimaBot.Game.Modules
|
||||
{
|
||||
public class ItemModule : IM
|
||||
{
|
||||
public override string Name => OshimaGameModuleConstant.Item;
|
||||
public override string Description => OshimaGameModuleConstant.Description;
|
||||
public override string Version => OshimaGameModuleConstant.Version;
|
||||
public override string Author => OshimaGameModuleConstant.Author;
|
||||
public Dictionary<string, Item> KnownItems { get; } = [];
|
||||
|
||||
public override Dictionary<string, Item> Items
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<string, Item> items = Factory.GetGameModuleInstances<Item>(OshimaGameModuleConstant.General, OshimaGameModuleConstant.Item);
|
||||
if (KnownItems.Count == 0 && items.Count > 0)
|
||||
{
|
||||
foreach (string key in items.Keys)
|
||||
{
|
||||
KnownItems[key] = items[key];
|
||||
}
|
||||
}
|
||||
return items;
|
||||
}
|
||||
}
|
||||
|
||||
protected override Factory.EntityFactoryDelegate<Item> ItemFactory()
|
||||
{
|
||||
return (id, name, args) =>
|
||||
{
|
||||
return id switch
|
||||
{
|
||||
(long)WeaponID.糖糖一周年纪念武器 => new 糖糖一周年纪念武器(),
|
||||
(long)ArmorID.糖糖一周年纪念防具 => new 糖糖一周年纪念防具(),
|
||||
(long)ShoesID.糖糖一周年纪念鞋子 => new 糖糖一周年纪念鞋子(),
|
||||
(long)AccessoryID.攻击之爪10 => new 攻击之爪10(),
|
||||
(long)AccessoryID.攻击之爪25 => new 攻击之爪25(),
|
||||
(long)AccessoryID.攻击之爪40 => new 攻击之爪40(),
|
||||
(long)AccessoryID.攻击之爪55 => new 攻击之爪55(),
|
||||
(long)AccessoryID.攻击之爪70 => new 攻击之爪70(),
|
||||
(long)AccessoryID.攻击之爪85 => new 攻击之爪85(),
|
||||
(long)AccessoryID.攻击之爪100 => new 攻击之爪100(),
|
||||
(long)AccessoryID.糖糖一周年纪念饰品1 => new 糖糖一周年纪念饰品1(),
|
||||
(long)AccessoryID.糖糖一周年纪念饰品2 => new 糖糖一周年纪念饰品2(),
|
||||
(long)AccessoryID.行军医箱1 => new 行军医箱1(),
|
||||
(long)AccessoryID.行军医箱2 => new 行军医箱2(),
|
||||
(long)AccessoryID.行军医箱3 => new 行军医箱3(),
|
||||
(long)AccessoryID.共鸣核心1 => new 共鸣核心1(),
|
||||
(long)AccessoryID.共鸣核心2 => new 共鸣核心2(),
|
||||
(long)AccessoryID.共鸣核心3 => new 共鸣核心3(),
|
||||
(long)AccessoryID.接力信标1 => new 接力信标1(),
|
||||
(long)AccessoryID.接力信标2 => new 接力信标2(),
|
||||
(long)AccessoryID.接力信标3 => new 接力信标3(),
|
||||
(long)AccessoryID.应急装置1 => new 应急装置1(),
|
||||
(long)AccessoryID.应急装置2 => new 应急装置2(),
|
||||
(long)AccessoryID.应急装置3 => new 应急装置3(),
|
||||
(long)AccessoryID.万能钥匙1 => new 万能钥匙1(),
|
||||
(long)AccessoryID.万能钥匙2 => new 万能钥匙2(),
|
||||
(long)AccessoryID.万能钥匙3 => new 万能钥匙3(),
|
||||
(long)AccessoryID.节拍器1 => new 节拍器1(),
|
||||
(long)AccessoryID.节拍器2 => new 节拍器2(),
|
||||
(long)AccessoryID.节拍器3 => new 节拍器3(),
|
||||
(long)ConsumableID.小经验书 => new 小经验书(),
|
||||
(long)ConsumableID.中经验书 => new 中经验书(),
|
||||
(long)ConsumableID.大经验书 => new 大经验书(),
|
||||
(long)CollectibleID.青松 => new 青松(),
|
||||
(long)CollectibleID.流星石 => new 流星石(),
|
||||
(long)CollectibleID.向日葵 => new 向日葵(),
|
||||
(long)CollectibleID.金铃花 => new 金铃花(),
|
||||
(long)CollectibleID.琉璃珠 => new 琉璃珠(),
|
||||
(long)CollectibleID.鸣草 => new 鸣草(),
|
||||
(long)CollectibleID.马尾 => new 马尾(),
|
||||
(long)CollectibleID.鬼兜虫 => new 鬼兜虫(),
|
||||
(long)CollectibleID.烈焰花花蕊 => new 烈焰花花蕊(),
|
||||
(long)CollectibleID.堇瓜 => new 堇瓜(),
|
||||
(long)CollectibleID.水晶球 => new 水晶球(),
|
||||
(long)CollectibleID.薰衣草 => new 薰衣草(),
|
||||
(long)CollectibleID.青石 => new 青石(),
|
||||
(long)CollectibleID.莲花 => new 莲花(),
|
||||
(long)CollectibleID.陶罐 => new 陶罐(),
|
||||
(long)CollectibleID.海灵芝 => new 海灵芝(),
|
||||
(long)CollectibleID.四叶草 => new 四叶草(),
|
||||
(long)CollectibleID.露珠 => new 露珠(),
|
||||
(long)CollectibleID.茉莉花 => new 茉莉花(),
|
||||
(long)CollectibleID.绿萝 => new 绿萝(),
|
||||
(long)CollectibleID.檀木扇 => new 檀木扇(),
|
||||
(long)CollectibleID.鸟蛋 => new 鸟蛋(),
|
||||
(long)CollectibleID.竹笋 => new 竹笋(),
|
||||
(long)CollectibleID.晶核 => new 晶核(),
|
||||
(long)CollectibleID.手工围巾 => new 手工围巾(),
|
||||
(long)CollectibleID.柳条篮 => new 柳条篮(),
|
||||
(long)CollectibleID.风筝 => new 风筝(),
|
||||
(long)CollectibleID.羽毛 => new 羽毛(),
|
||||
(long)CollectibleID.发光髓 => new 发光髓(),
|
||||
(long)CollectibleID.紫罗兰 => new 紫罗兰(),
|
||||
(long)CollectibleID.松果 => new 松果(),
|
||||
(long)CollectibleID.电气水晶 => new 电气水晶(),
|
||||
(long)CollectibleID.薄荷 => new 薄荷(),
|
||||
(long)CollectibleID.竹节 => new 竹节(),
|
||||
(long)CollectibleID.铁砧 => new 铁砧(),
|
||||
(long)CollectibleID.冰雾花 => new 冰雾花(),
|
||||
(long)CollectibleID.海草 => new 海草(),
|
||||
(long)CollectibleID.磐石 => new 磐石(),
|
||||
(long)CollectibleID.砂砾 => new 砂砾(),
|
||||
(long)CollectibleID.铁甲贝壳 => new 铁甲贝壳(),
|
||||
(long)CollectibleID.蜥蜴尾巴 => new 蜥蜴尾巴(),
|
||||
(long)CollectibleID.古老钟摆 => new 古老钟摆(),
|
||||
(long)CollectibleID.枯藤 => new 枯藤(),
|
||||
(long)SpecialItemID.升华之印 => new 升华之印(),
|
||||
(long)SpecialItemID.流光之印 => new 流光之印(),
|
||||
(long)SpecialItemID.永恒之印 => new 永恒之印(),
|
||||
(long)SpecialItemID.技能卷轴 => new 技能卷轴(),
|
||||
(long)SpecialItemID.智慧之果 => new 智慧之果(),
|
||||
(long)SpecialItemID.奥术符文 => new 奥术符文(),
|
||||
(long)SpecialItemID.混沌之核 => new 混沌之核(),
|
||||
(long)SpecialItemID.奖券 => new 奖券(),
|
||||
(long)SpecialItemID.十连奖券 => new 十连奖券(),
|
||||
(long)SpecialItemID.改名卡 => new 改名卡(),
|
||||
(long)SpecialItemID.原初之印 => new 原初之印(),
|
||||
(long)SpecialItemID.创生之印 => new 创生之印(),
|
||||
(long)SpecialItemID.法则精粹 => new 法则精粹(),
|
||||
(long)SpecialItemID.大师锻造券 => new 大师锻造券(),
|
||||
(long)SpecialItemID.钻石 => new 钻石(),
|
||||
(long)SpecialItemID.探索许可 => new 探索许可(),
|
||||
(long)ConsumableID.小回复药 => new 小回复药(),
|
||||
(long)ConsumableID.中回复药 => new 中回复药(),
|
||||
(long)ConsumableID.大回复药 => new 大回复药(),
|
||||
(long)ConsumableID.魔力填充剂1 => new 魔力填充剂1(),
|
||||
(long)ConsumableID.魔力填充剂2 => new 魔力填充剂2(),
|
||||
(long)ConsumableID.魔力填充剂3 => new 魔力填充剂3(),
|
||||
(long)ConsumableID.能量饮料1 => new 能量饮料1(),
|
||||
(long)ConsumableID.能量饮料2 => new 能量饮料2(),
|
||||
(long)ConsumableID.能量饮料3 => new 能量饮料3(),
|
||||
(long)ConsumableID.复苏药1 => new 复苏药1(),
|
||||
(long)ConsumableID.复苏药2 => new 复苏药2(),
|
||||
(long)ConsumableID.复苏药3 => new 复苏药3(),
|
||||
(long)ConsumableID.全回复药 => new 全回复药(),
|
||||
(long)GiftBoxID.年夜饭 => new 年夜饭(),
|
||||
(long)GiftBoxID.蛇年大吉 => new 蛇年大吉(),
|
||||
(long)GiftBoxID.新春快乐 => new 新春快乐(),
|
||||
(long)GiftBoxID.毕业礼包 => new 毕业礼包(),
|
||||
(long)GiftBoxID.魔法卡礼包 => new 魔法卡礼包(),
|
||||
(long)GiftBoxID.探索助力礼包 => new 探索助力礼包(),
|
||||
(long)GiftBoxID.一周年纪念礼包 => new 一周年纪念礼包(),
|
||||
(long)GiftBoxID.一周年纪念套装 => new 一周年纪念套装(),
|
||||
(long)GiftBoxID.冬至快乐 => new 冬至快乐(),
|
||||
(long)GiftBoxID.圣诞礼包 => new 圣诞礼包(),
|
||||
(long)GiftBoxID.元旦快乐 => new 元旦快乐(),
|
||||
_ => null,
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
using OshimaBot.Game.Constants;
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using OshimaBot.Content.Effects.ItemEffects;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
using OshimaBot.Content.Items;
|
||||
using OshimaBot.Content.Skills;
|
||||
using SM = FunGame.Core.Library.Module.SkillModule;
|
||||
|
||||
namespace OshimaBot.Game.Modules
|
||||
{
|
||||
public class SkillModule : SM
|
||||
{
|
||||
public override string Name => OshimaGameModuleConstant.Skill;
|
||||
public override string Description => OshimaGameModuleConstant.Description;
|
||||
public override string Version => OshimaGameModuleConstant.Version;
|
||||
public override string Author => OshimaGameModuleConstant.Author;
|
||||
public Dictionary<string, Skill> KnownSkills { get; } = [];
|
||||
|
||||
public override Dictionary<string, Skill> Skills
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<string, Skill> skills = Factory.GetGameModuleInstances<Skill>(OshimaGameModuleConstant.General, OshimaGameModuleConstant.Skill);
|
||||
if (KnownSkills.Count == 0 && skills.Count > 0)
|
||||
{
|
||||
foreach (string key in skills.Keys)
|
||||
{
|
||||
KnownSkills[key] = skills[key];
|
||||
}
|
||||
}
|
||||
return skills;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void AfterLoad()
|
||||
{
|
||||
General.GameplayEquilibriumConstant.InGameTime = "秒";
|
||||
General.GameplayEquilibriumConstant.InGameMaterial = "钻石";
|
||||
General.GameplayEquilibriumConstant.UseMagicType = [MagicType.None];
|
||||
}
|
||||
|
||||
protected override Factory.EntityFactoryDelegate<Skill> SkillFactory()
|
||||
{
|
||||
return (id, name, args) =>
|
||||
{
|
||||
return id switch
|
||||
{
|
||||
(long)MagicID.冰霜攻击 => new 冰霜攻击(),
|
||||
(long)MagicID.火之矢 => new 火之矢(),
|
||||
(long)MagicID.水之矢 => new 水之矢(),
|
||||
(long)MagicID.石之锤 => new 石之锤(),
|
||||
(long)MagicID.风之轮 => new 风之轮(),
|
||||
(long)MagicID.心灵之霞 => new 心灵之霞(),
|
||||
(long)MagicID.次元上升 => new 次元上升(),
|
||||
(long)MagicID.暗物质 => new 暗物质(),
|
||||
(long)MagicID.回复术 => new 回复术(),
|
||||
(long)MagicID.治愈术 => new 治愈术(),
|
||||
(long)MagicID.复苏术 => new 复苏术(),
|
||||
(long)MagicID.圣灵术 => new 圣灵术(),
|
||||
(long)MagicID.时间加速 => new 时间加速(),
|
||||
(long)MagicID.时间减速 => new 时间减速(),
|
||||
(long)MagicID.反魔法领域 => new 反魔法领域(),
|
||||
(long)MagicID.沉默十字 => new 沉默十字(),
|
||||
(long)MagicID.虚弱领域 => new 虚弱领域(),
|
||||
(long)MagicID.混沌烙印 => new 混沌烙印(),
|
||||
(long)MagicID.凝胶稠絮 => new 凝胶稠絮(),
|
||||
(long)MagicID.大地之墙 => new 大地之墙(),
|
||||
(long)MagicID.盖亚之盾 => new 盖亚之盾(),
|
||||
(long)MagicID.风之守护 => new 风之守护(),
|
||||
(long)MagicID.结晶防护 => new 结晶防护(),
|
||||
(long)MagicID.强音之力 => new 强音之力(),
|
||||
(long)MagicID.神圣祝福 => new 神圣祝福(),
|
||||
(long)MagicID.根源屏障 => new 根源屏障(),
|
||||
(long)MagicID.灾难冲击波 => new 灾难冲击波(),
|
||||
(long)MagicID.银色荆棘 => new 银色荆棘(),
|
||||
(long)MagicID.等离子之波 => new 等离子之波(),
|
||||
(long)MagicID.地狱之门 => new 地狱之门(),
|
||||
(long)MagicID.钻石星尘 => new 钻石星尘(),
|
||||
(long)MagicID.死亡咆哮 => new 死亡咆哮(),
|
||||
(long)MagicID.鬼魅之痛 => new 鬼魅之痛(),
|
||||
(long)MagicID.导力停止 => new 导力停止(),
|
||||
(long)MagicID.冰狱冥嚎 => new 冰狱冥嚎(),
|
||||
(long)MagicID.火山咆哮 => new 火山咆哮(),
|
||||
(long)MagicID.水蓝轰炸 => new 水蓝轰炸(),
|
||||
(long)MagicID.岩石之息 => new 岩石之息(),
|
||||
(long)MagicID.弧形日珥 => new 弧形日珥(),
|
||||
(long)MagicID.苍白地狱 => new 苍白地狱(),
|
||||
(long)MagicID.破碎虚空 => new 破碎虚空(),
|
||||
(long)MagicID.弧光消耗 => new 弧光消耗(),
|
||||
(long)MagicID.回复术改 => new 回复术改(),
|
||||
(long)MagicID.回复术复 => new 回复术复(),
|
||||
(long)MagicID.治愈术复 => new 治愈术复(),
|
||||
(long)MagicID.风之守护复 => new 风之守护复(),
|
||||
(long)MagicID.强音之力复 => new 强音之力复(),
|
||||
(long)MagicID.结晶防护复 => new 结晶防护复(),
|
||||
(long)MagicID.神圣祝福复 => new 神圣祝福复(),
|
||||
(long)MagicID.时间加速改 => new 时间加速改(),
|
||||
(long)MagicID.时间减速改 => new 时间减速改(),
|
||||
(long)MagicID.时间加速复 => new 时间加速复(),
|
||||
(long)MagicID.时间减速复 => new 时间减速复(),
|
||||
(long)MagicID.十二宫星环 => new 十二宫星环(),
|
||||
(long)MagicID.时间剥夺 => new 时间剥夺(),
|
||||
(long)SkillID.疾风步 => new 疾风步(),
|
||||
(long)SkillID.助威 => new 助威(),
|
||||
(long)SkillID.挑拨 => new 挑拨(),
|
||||
(long)SkillID.绞丝棍 => new 绞丝棍(),
|
||||
(long)SkillID.金刚击 => new 金刚击(),
|
||||
(long)SkillID.旋风轮 => new 旋风轮(),
|
||||
(long)SkillID.双连击 => new 双连击(),
|
||||
(long)SkillID.绝影 => new 绝影(),
|
||||
(long)SkillID.胧 => new 胧(),
|
||||
(long)SkillID.魔眼 => new 魔眼(),
|
||||
(long)SkillID.天堂之吻 => new 天堂之吻(),
|
||||
(long)SkillID.回复弹 => new 回复弹(),
|
||||
(long)SkillID.养命功 => new 养命功(),
|
||||
(long)SkillID.镜花水月 => new 镜花水月(),
|
||||
(long)SkillID.剑风闪 => new 剑风闪(),
|
||||
(long)SkillID.鲨鱼锚击 => new 鲨鱼锚击(),
|
||||
(long)SkillID.疾走 => new 疾走(),
|
||||
(long)SkillID.闪现 => new 闪现(),
|
||||
(long)SkillID.风之鞭 => new 风之鞭(),
|
||||
(long)SkillID.拘束之鞭 => new 拘束之鞭(),
|
||||
(long)SkillID.狐媚暗随 => new 狐媚暗随(),
|
||||
(long)SkillID.快速狙击 => new 快速狙击(),
|
||||
(long)SkillID.精准射击 => new 精准射击(),
|
||||
(long)SkillID.欢乐激发 => new 欢乐激发(),
|
||||
(long)SkillID.乱心安魂曲 => new 乱心安魂曲(),
|
||||
(long)SkillID.斗魂 => new 斗魂(),
|
||||
(long)SkillID.岚 => new 岚(),
|
||||
(long)SkillID.公牛之怒 => new 公牛之怒(),
|
||||
(long)SkillID.火焰碎击 => new 火焰碎击(),
|
||||
(long)SkillID.螺旋之刃 => new 螺旋之刃(),
|
||||
(long)SkillID.霸王疾风 => new 霸王疾风(),
|
||||
(long)SkillID.导力装甲 => new 导力装甲(),
|
||||
(long)SkillID.回复原状 => new 回复原状(),
|
||||
(long)SkillID.强打 => new 强打(),
|
||||
(long)SkillID.龙神功 => new 龙神功(),
|
||||
(long)SkillID.月华掌 => new 月华掌(),
|
||||
(long)SkillID.雷神脚 => new 雷神脚(),
|
||||
(long)SkillID.弓刃交错 => new 弓刃交错(),
|
||||
(long)SkillID.神圣祈祷 => new 神圣祈祷(),
|
||||
(long)SkillID.牺牲之箭 => new 牺牲之箭(),
|
||||
(long)SkillID.石化之矢 => new 石化之矢(),
|
||||
(long)SkillID.死亡制裁 => new 死亡制裁(),
|
||||
(long)SkillID.落叶 => new 落叶(),
|
||||
(long)SkillID.风花阵 => new 风花阵(),
|
||||
(long)SkillID.陀螺舞 => new 陀螺舞(),
|
||||
(long)SkillID.光破斩 => new 光破斩(),
|
||||
(long)SkillID.跳跃点射 => new 跳跃点射(),
|
||||
(long)SkillID.光鬼斩 => new 光鬼斩(),
|
||||
(long)SkillID.雷索吸缚 => new 雷索吸缚(),
|
||||
(long)SkillID.狂刃剑舞 => new 狂刃剑舞(),
|
||||
(long)SkillID.无相飞刀 => new 无相飞刀(),
|
||||
(long)SkillID.破邪显正 => new 破邪显正(),
|
||||
(long)SkillID.号令 => new 号令(),
|
||||
(long)SkillID.千剑之雨 => new 千剑之雨(),
|
||||
(long)SkillID.无尽剑制 => new 无尽剑制(),
|
||||
(long)SkillID.灾难一掷 => new 灾难一掷(),
|
||||
(long)SkillID.血腥旋转 => new 血腥旋转(),
|
||||
(long)SkillID.断罪斩 => new 断罪斩(),
|
||||
// 决策点维度(2026-09-23 新增)
|
||||
(long)SkillID.战术部署 => new 战术部署(),
|
||||
(long)SkillID.过载 => new 过载(),
|
||||
(long)SuperSkillID.催战鼓 => new 催战鼓(),
|
||||
(long)SkillID.抢夺命运 => new 抢夺命运(),
|
||||
(long)SkillID.命运剥夺 => new 命运剥夺(),
|
||||
(long)SkillID.命运馈赠 => new 命运馈赠(),
|
||||
(long)SkillID.命运之赐 => new 命运之赐(),
|
||||
(long)SuperSkillID.熵灭极诣 => new 熵灭极诣(),
|
||||
(long)SuperSkillID.千羽瞬华 => new 千羽瞬华(),
|
||||
(long)SuperSkillID.咒怨洪流 => new 咒怨洪流(),
|
||||
(long)SuperSkillID.三相灵枢 => new 三相灵枢(),
|
||||
(long)SuperSkillID.变幻之心 => new 变幻之心(),
|
||||
(long)SuperSkillID.零式灭杀 => new 零式灭杀(),
|
||||
(long)SuperSkillID.绝对领域 => new 绝对领域(),
|
||||
(long)SuperSkillID.残香凋零 => new 残香凋零(),
|
||||
(long)SuperSkillID.宿命时律 => new 宿命时律(),
|
||||
(long)SuperSkillID.极寒渴望 => new 极寒渴望(),
|
||||
(long)SuperSkillID.身心一境 => new 身心一境(),
|
||||
(long)SuperSkillID.饕餮盛宴 => new 饕餮盛宴(),
|
||||
(long)SuperSkillID.放监 => new 放监(),
|
||||
(long)SuperSkillID.归元环 => new 归元环(),
|
||||
(long)SuperSkillID.海王星的野望 => new 海王星的野望(),
|
||||
(long)SuperSkillID.全军出击 => new 全军出击(),
|
||||
(long)SuperSkillID.宿命之潮 => new 宿命之潮(),
|
||||
(long)SuperSkillID.神之因果 => new 神之因果(),
|
||||
(long)SuperSkillID.樱花无双击 => new 樱花无双击(),
|
||||
(long)SuperSkillID.漆黑之牙 => new 漆黑之牙(),
|
||||
(long)SuperSkillID.女王之怒 => new 女王之怒(),
|
||||
(long)SuperSkillID.裁决塔罗 => new 裁决塔罗(),
|
||||
(long)SuperSkillID.光明之环 => new 光明之环(),
|
||||
(long)SuperSkillID.圣星光旋 => new 圣星光旋(),
|
||||
(long)SuperSkillID.炎龙倒海 => new 炎龙倒海(),
|
||||
(long)SuperSkillID.卫星激光 => new 卫星激光(),
|
||||
(long)SuperSkillID.泰山玄武靠 => new 泰山玄武靠(),
|
||||
(long)SuperSkillID.星杯领域 => new 星杯领域(),
|
||||
(long)SuperSkillID.魔枪洛亚 => new 魔枪洛亚(),
|
||||
(long)SuperSkillID.八叶灭杀 => new 八叶灭杀(),
|
||||
(long)SuperSkillID.樱花残月 => new 樱花残月(),
|
||||
(long)SuperSkillID.圣洁祝福 => new 圣洁祝福(),
|
||||
(long)SuperSkillID.天堂阻灭 => new 天堂阻灭(),
|
||||
(long)SuperSkillID.歼灭 => new 歼灭(),
|
||||
(long)PassiveID.META马 => new META马(),
|
||||
(long)PassiveID.心灵之弦 => new 心灵之弦(),
|
||||
(long)PassiveID.蚀魂震击 => new 蚀魂震击(),
|
||||
(long)PassiveID.灵能反射 => new 灵能反射(),
|
||||
(long)PassiveID.双生流转 => new 双生流转(),
|
||||
(long)PassiveID.零式崩解 => new 零式崩解(),
|
||||
(long)PassiveID.少女绮想 => new 少女绮想(),
|
||||
(long)PassiveID.暗香疏影 => new 暗香疏影(),
|
||||
(long)PassiveID.破釜沉舟 => new 破釜沉舟(),
|
||||
(long)PassiveID.累积之压 => new 累积之压(),
|
||||
(long)PassiveID.银隼之赐 => new 银隼之赐(),
|
||||
(long)PassiveID.弱者猎手 => new 弱者猎手(),
|
||||
(long)PassiveID.开宫 => new 开宫(),
|
||||
(long)PassiveID.八卦阵 => new 八卦阵(),
|
||||
(long)PassiveID.深海之戟 => new 深海之戟(),
|
||||
(long)PassiveID.概念之骰 => new 概念之骰(),
|
||||
(long)PassiveID.掠夺者 => new 掠夺者(),
|
||||
(long)PassiveID.雇佣兵团 => new 雇佣兵团(),
|
||||
(long)PassiveID.不息之流 => new 不息之流(),
|
||||
(long)PassiveID.征服者 => new 征服者(),
|
||||
(long)PassiveID.致命节奏 => new 致命节奏(),
|
||||
(long)PassiveID.强攻 => new 强攻(),
|
||||
(long)PassiveID.电刑 => new 电刑(),
|
||||
(long)PassiveID.黑暗收割 => new 黑暗收割(),
|
||||
(long)PassiveID.迅捷步法 => new 迅捷步法(),
|
||||
(long)PassiveID.贪欲猎手 => new 贪欲猎手(),
|
||||
(long)PassiveID.丛刃 => new 丛刃(),
|
||||
(long)PassiveID.召唤艾黎 => new 召唤艾黎(),
|
||||
(long)PassiveID.相位猛冲 => new 相位猛冲(),
|
||||
(long)PassiveID.奥术彗星 => new 奥术彗星(),
|
||||
(long)PassiveID.风暴聚集 => new 风暴聚集(),
|
||||
(long)PassiveID.不灭之握 => new 不灭之握(),
|
||||
(long)PassiveID.余震 => new 余震(),
|
||||
(long)PassiveID.守护者 => new 守护者(),
|
||||
(long)PassiveID.骸骨镀层 => new 骸骨镀层(),
|
||||
(long)PassiveID.冰川增幅 => new 冰川增幅(),
|
||||
(long)PassiveID.先攻 => new 先攻(),
|
||||
(long)PassiveID.饼干配送 => new 饼干配送(),
|
||||
(long)PassiveID.折射 => new 折射(),
|
||||
(long)PassiveID.恩赐解脱 => new 恩赐解脱(),
|
||||
(long)PassiveID.静电场 => new 静电场(),
|
||||
(long)PassiveID.竭心光环 => new 竭心光环(),
|
||||
(long)PassiveID.海妖外壳 => new 海妖外壳(),
|
||||
(long)PassiveID.自然蔽护 => new 自然蔽护(),
|
||||
(long)PassiveID.勇气之霎 => new 勇气之霎(),
|
||||
(long)PassiveID.深海重击 => new 深海重击(),
|
||||
(long)PassiveID.反击螺旋 => new 反击螺旋(),
|
||||
(long)PassiveID.刀光谍影 => new 刀光谍影(),
|
||||
(long)PassiveID.幽冥剧毒 => new 幽冥剧毒(),
|
||||
// 辅助型通用被动(2026-09-22 新增):给予队友治疗 / 护盾 / 增益
|
||||
(long)PassiveID.生命链接 => new 生命链接(),
|
||||
(long)PassiveID.共鸣护盾 => new 共鸣护盾(),
|
||||
(long)PassiveID.战地巡诊 => new 战地巡诊(),
|
||||
(long)PassiveID.同袍之誓 => new 同袍之誓(),
|
||||
(long)PassiveID.援护号令 => new 援护号令(),
|
||||
(long)PassiveID.战术余裕 => new 战术余裕(),
|
||||
(long)ItemPassiveID.万能钥匙 => new 万能钥匙技能(),
|
||||
(long)ItemPassiveID.节拍器 => new 节拍器技能(),
|
||||
(long)ItemPassiveID.攻击之爪 => new 攻击之爪技能(),
|
||||
(long)ItemPassiveID.糖糖一周年纪念武器 => new 糖糖一周年纪念武器技能(),
|
||||
(long)ItemPassiveID.糖糖一周年纪念防具 => new 糖糖一周年纪念防具技能(),
|
||||
(long)ItemPassiveID.糖糖一周年纪念鞋子 => new 糖糖一周年纪念鞋子技能(),
|
||||
(long)ItemPassiveID.糖糖一周年纪念饰品1 => new 糖糖一周年纪念饰品技能1(),
|
||||
(long)ItemPassiveID.糖糖一周年纪念饰品2 => new 糖糖一周年纪念饰品技能2(),
|
||||
(long)ItemActiveID.经验书 => new 经验书技能(),
|
||||
(long)ItemActiveID.礼包 => new 礼包技能(),
|
||||
(long)ItemActiveID.应急装置 => new 应急装置技能(),
|
||||
_ => null
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
protected override Factory.EffectFactoryDelegate EffectFactory()
|
||||
{
|
||||
return (id, name, skill, args) =>
|
||||
{
|
||||
args ??= [];
|
||||
return (EffectID)id switch
|
||||
{
|
||||
EffectID.ExATK => new ExATK(skill, args),
|
||||
EffectID.ExDEF => new ExDEF(skill, args),
|
||||
EffectID.ExSTR => new ExSTR(skill, args),
|
||||
EffectID.ExAGI => new ExAGI(skill, args),
|
||||
EffectID.ExINT => new ExINT(skill, args),
|
||||
EffectID.SkillHardTimeReduce => new SkillHardTimeReduce(skill, args),
|
||||
EffectID.NormalAttackHardTimeReduce => new NormalAttackHardTimeReduce(skill, args),
|
||||
EffectID.AccelerationCoefficient => new AccelerationCoefficient(skill, args),
|
||||
EffectID.ExSPD => new ExSPD(skill, args),
|
||||
EffectID.ExActionCoefficient => new ExActionCoefficient(skill, args),
|
||||
EffectID.ExCDR => new ExCDR(skill, args),
|
||||
EffectID.ExMaxHP => new ExMaxHP(skill, args),
|
||||
EffectID.ExMaxMP => new ExMaxMP(skill, args),
|
||||
EffectID.ExCritRate => new ExCritRate(skill, args),
|
||||
EffectID.ExCritDMG => new ExCritDMG(skill, args),
|
||||
EffectID.ExEvadeRate => new ExEvadeRate(skill, args),
|
||||
EffectID.PhysicalPenetration => new PhysicalPenetration(skill, args),
|
||||
EffectID.MagicalPenetration => new MagicalPenetration(skill, args),
|
||||
EffectID.ExPDR => new ExPDR(skill, args),
|
||||
EffectID.ExMDF => new ExMDF(skill, args),
|
||||
EffectID.ExHR => new ExHR(skill, args),
|
||||
EffectID.ExMR => new ExMR(skill, args),
|
||||
EffectID.ExATK2 => new ExATK2(skill, args),
|
||||
EffectID.ExDEF2 => new ExDEF2(skill, args),
|
||||
EffectID.ExSTR2 => new ExSTR2(skill, args),
|
||||
EffectID.ExAGI2 => new ExAGI2(skill, args),
|
||||
EffectID.ExINT2 => new ExINT2(skill, args),
|
||||
EffectID.SkillHardTimeReduce2 => new SkillHardTimeReduce2(skill, args),
|
||||
EffectID.NormalAttackHardTimeReduce2 => new NormalAttackHardTimeReduce2(skill, args),
|
||||
EffectID.ExMaxHP2 => new ExMaxHP2(skill, args),
|
||||
EffectID.ExMaxMP2 => new ExMaxMP2(skill, args),
|
||||
EffectID.DynamicsEffect => new DynamicsEffect(skill, args),
|
||||
EffectID.IgnoreEvade => new IgnoreEvade(skill, args),
|
||||
EffectID.ExATR => new ExATR(skill, args),
|
||||
EffectID.ExMOV => new ExMOV(skill, args),
|
||||
EffectID.ExLifesteal => new ExLifesteal(skill, args),
|
||||
EffectID.RecoverHP => new RecoverHP(skill, args),
|
||||
EffectID.RecoverMP => new RecoverMP(skill, args),
|
||||
EffectID.RecoverHP2 => new RecoverHP2(skill, args),
|
||||
EffectID.RecoverMP2 => new RecoverMP2(skill, args),
|
||||
EffectID.GetEP => new GetEP(skill, args),
|
||||
EffectID.GetEXP => new GetEXP(skill, args),
|
||||
_ => null
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>OshimaBot.Game</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Constants\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OshimaBot.Content\OshimaBot.Content.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,32 @@
|
||||
using OshimaBot.Game.Modules;
|
||||
|
||||
namespace OshimaBot.Game.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 进程级游戏目录初始化。FunGame.Core 的工厂是全局状态,必须且只能初始化一次。
|
||||
/// </summary>
|
||||
public static class FunGameRuntime
|
||||
{
|
||||
private static readonly Lock Sync = new();
|
||||
private static bool _initialized;
|
||||
|
||||
public static DateTimeOffset StartedAt { get; private set; }
|
||||
|
||||
public static void EnsureInitialized()
|
||||
{
|
||||
lock (Sync)
|
||||
{
|
||||
if (_initialized) return;
|
||||
|
||||
new CharacterModule().Load();
|
||||
new SkillModule().Load();
|
||||
new ItemModule().Load();
|
||||
FunGameService.InitFunGame();
|
||||
FunGameSimulation.InitializeStatistics();
|
||||
|
||||
StartedAt = DateTimeOffset.UtcNow;
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,937 @@
|
||||
using OshimaBot.Game.Constants;
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.PrefabricatedEntity;
|
||||
using OshimaBot.Content.Characters;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
using OshimaBot.Content.Items;
|
||||
using OshimaBot.Content.Skills;
|
||||
using Milimoe.FunGameTesting.Others;
|
||||
|
||||
namespace OshimaBot.Game.Services
|
||||
{
|
||||
public class FunGameService
|
||||
{
|
||||
public static List<Character> Characters { get; } = [];
|
||||
public static List<Skill> Skills { get; } = [];
|
||||
public static List<Skill> PassiveSkills { get; } = [];
|
||||
public static List<Skill> CommonPassiveSkills { get; } = [];
|
||||
public static List<Skill> SuperSkills { get; } = [];
|
||||
public static List<Skill> CommonSuperSkills { get; } = [];
|
||||
public static List<Skill> Magics { get; } = [];
|
||||
public static List<Item> Equipment { get; } = [];
|
||||
public static List<Item> Items { get; } = [];
|
||||
public static List<Skill> ItemSkills { get; } = [];
|
||||
public static List<Item> AllItems { get; } = [];
|
||||
public static List<Skill> AllSkills { get; } = [];
|
||||
|
||||
public static void InitFunGame()
|
||||
{
|
||||
Characters.Add(new OshimaShiya());
|
||||
Characters.Add(new XinYin());
|
||||
Characters.Add(new Yang());
|
||||
Characters.Add(new NanGanYu());
|
||||
Characters.Add(new NiuNan());
|
||||
Characters.Add(new DokyoMayor());
|
||||
Characters.Add(new MagicalGirl());
|
||||
Characters.Add(new QingXiang());
|
||||
Characters.Add(new QWQAQW());
|
||||
Characters.Add(new ColdBlue());
|
||||
Characters.Add(new Dddovo());
|
||||
Characters.Add(new Quduoduo());
|
||||
Characters.Add(new ShiYu());
|
||||
Characters.Add(new XReouni());
|
||||
Characters.Add(new Neptune());
|
||||
Characters.Add(new CHAOS());
|
||||
Characters.Add(new Ryuko());
|
||||
Characters.Add(new TheGodK());
|
||||
|
||||
Skills.AddRange([new 疾风步(), new 助威(), new 挑拨(), new 绞丝棍(), new 金刚击(), new 旋风轮(), new 双连击(), new 绝影(), new 胧(), new 魔眼(),
|
||||
new 天堂之吻(), new 回复弹(), new 养命功(), new 镜花水月(), new 剑风闪(), new 鲨鱼锚击(), new 疾走(), new 闪现(),
|
||||
new 风之鞭(), new 拘束之鞭(), new 狐媚暗随(), new 快速狙击(), new 精准射击(), new 欢乐激发(), new 乱心安魂曲(), new 斗魂(), new 岚(), new 公牛之怒(),
|
||||
new 火焰碎击(), new 螺旋之刃(), new 霸王疾风(), new 导力装甲(), new 回复原状(), new 强打(), new 龙神功(), new 月华掌(), new 雷神脚(), new 弓刃交错(),
|
||||
new 神圣祈祷(), new 牺牲之箭(), new 石化之矢(), new 死亡制裁(), new 落叶(), new 风花阵(), new 陀螺舞(), new 光破斩(), new 跳跃点射(), new 光鬼斩(),
|
||||
new 雷索吸缚(), new 狂刃剑舞(), new 无相飞刀(), new 破邪显正(), new 号令(), new 千剑之雨(), new 无尽剑制(), new 灾难一掷(), new 血腥旋转(),
|
||||
new 抢夺命运(), new 命运剥夺(), new 命运馈赠(), new 命运之赐(), new 断罪斩(),
|
||||
// 决策点维度(2026-09-23 新增)
|
||||
new 战术部署(), new 过载(),
|
||||
// 决策点/节奏维度(2026-09-23 新增)
|
||||
new 战术余裕()]);
|
||||
|
||||
SuperSkills.AddRange([new 极寒渴望(), new 身心一境(), new 绝对领域(), new 零式灭杀(), new 三相灵枢(), new 变幻之心(), new 熵灭极诣(), new 残香凋零(), new 饕餮盛宴(),
|
||||
new 宿命时律(), new 千羽瞬华(), new 咒怨洪流(), new 放监(), new 归元环(), new 海王星的野望(), new 全军出击(), new 宿命之潮(), new 神之因果()]);
|
||||
|
||||
PassiveSkills.AddRange([new META马(), new 心灵之弦(), new 蚀魂震击(), new 灵能反射(), new 双生流转(), new 零式崩解(), new 少女绮想(), new 暗香疏影(), new 破釜沉舟(),
|
||||
new 累积之压(), new 银隼之赐(), new 弱者猎手(), new 开宫(), new 八卦阵(), new 深海之戟(), new 雇佣兵团(), new 不息之流(), new 概念之骰()]);
|
||||
|
||||
CommonPassiveSkills.AddRange([new 征服者(), new 致命节奏(), new 强攻(), new 电刑(), new 黑暗收割(), new 迅捷步法(), new 贪欲猎手(),
|
||||
new 丛刃(), new 召唤艾黎(), new 相位猛冲(), new 奥术彗星(), new 风暴聚集(), new 不灭之握(), new 余震(), new 守护者(), new 骸骨镀层(), new 冰川增幅(),
|
||||
new 先攻(), new 饼干配送(), new 折射(), new 恩赐解脱(), new 静电场(), new 竭心光环(), new 海妖外壳(), new 自然蔽护(), new 勇气之霎(),
|
||||
new 深海重击(), new 反击螺旋(), new 刀光谍影(), new 幽冥剧毒(), new 掠夺者(),
|
||||
// 辅助型通用被动(2026-09-22 新增):给予队友治疗 / 护盾 / 增益
|
||||
new 生命链接(), new 共鸣护盾(), new 战地巡诊(), new 同袍之誓(), new 援护号令()]);
|
||||
|
||||
CommonSuperSkills.AddRange([new 樱花无双击(), new 漆黑之牙(), new 女王之怒(), new 裁决塔罗(), new 光明之环(), new 圣星光旋(), new 炎龙倒海(), new 卫星激光(), new 泰山玄武靠(),
|
||||
new 星杯领域(), new 魔枪洛亚(), new 八叶灭杀(), new 樱花残月(), new 圣洁祝福(), new 天堂阻灭(), new 歼灭(), new 催战鼓()]);
|
||||
|
||||
Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(),
|
||||
new 回复术(), new 治愈术(), new 复苏术(), new 圣灵术(), new 时间加速(), new 时间减速(), new 反魔法领域(), new 沉默十字(), new 虚弱领域(), new 混沌烙印(), new 凝胶稠絮(),
|
||||
new 大地之墙(), new 盖亚之盾(), new 风之守护(), new 结晶防护(), new 强音之力(), new 神圣祝福(), new 根源屏障(), new 灾难冲击波(), new 银色荆棘(), new 等离子之波(),
|
||||
new 地狱之门(), new 钻石星尘(), new 死亡咆哮(), new 鬼魅之痛(), new 导力停止(), new 冰狱冥嚎(), new 火山咆哮(), new 水蓝轰炸(), new 岩石之息(), new 弧形日珥(), new 苍白地狱(), new 破碎虚空(),
|
||||
new 弧光消耗(), new 回复术改(), new 回复术复(), new 治愈术复(), new 风之守护复(), new 强音之力复(), new 结晶防护复(), new 神圣祝福复(), new 时间加速改(), new 时间减速改(),
|
||||
new 时间加速复(), new 时间减速复(), new 十二宫星环(), new 时间剥夺()]);
|
||||
|
||||
Dictionary<string, Item> exItems = Factory.GetGameModuleInstances<Item>(OshimaGameModuleConstant.General, OshimaGameModuleConstant.Item);
|
||||
Equipment.AddRange(exItems.Values.Where(i => (int)i.ItemType >= 0 && (int)i.ItemType < 5));
|
||||
Equipment.AddRange([new 攻击之爪10(), new 攻击之爪25(), new 攻击之爪40(), new 攻击之爪55(), new 攻击之爪70(), new 攻击之爪85(), new 糖糖一周年纪念武器(),
|
||||
new 糖糖一周年纪念防具(), new 糖糖一周年纪念鞋子(), new 糖糖一周年纪念饰品1(), new 糖糖一周年纪念饰品2(),
|
||||
new 行军医箱1(), new 行军医箱2(), new 行军医箱3(),
|
||||
new 共鸣核心1(), new 共鸣核心2(), new 共鸣核心3(),
|
||||
new 接力信标1(), new 接力信标2(), new 接力信标3(),
|
||||
new 应急装置1(), new 应急装置2(), new 应急装置3(),
|
||||
// 决策点/节奏维度(2026-09-23 新增)
|
||||
new 万能钥匙1(), new 万能钥匙2(), new 万能钥匙3(),
|
||||
new 节拍器1(), new 节拍器2(), new 节拍器3()]);
|
||||
|
||||
Items.AddRange(exItems.Values.Where(i => (int)i.ItemType > 4));
|
||||
Items.AddRange([new 小经验书(), new 中经验书(), new 大经验书(), new 升华之印(), new 流光之印(), new 永恒之印(), new 技能卷轴(), new 智慧之果(), new 奥术符文(), new 混沌之核(),
|
||||
new 小回复药(), new 中回复药(), new 大回复药(), new 魔力填充剂1(), new 魔力填充剂2(), new 魔力填充剂3(), new 能量饮料1(), new 能量饮料2(), new 能量饮料3(), new 年夜饭(), new 蛇年大吉(), new 新春快乐(), new 毕业礼包(),
|
||||
new 复苏药1(), new 复苏药2(), new 复苏药3(), new 全回复药(), new 魔法卡礼包(), new 奖券(), new 十连奖券(), new 改名卡(), new 原初之印(), new 创生之印(), new 法则精粹(), new 大师锻造券(),
|
||||
new 一周年纪念礼包(), new 一周年纪念套装(), new 冬至快乐(), new 圣诞礼包(), new 元旦快乐()
|
||||
]);
|
||||
|
||||
AllItems.AddRange(Equipment);
|
||||
AllItems.AddRange(Items);
|
||||
|
||||
Skill?[] activeSkills = [.. Equipment.Select(i => i.Skills.Active), .. Items.Select(i => i.Skills.Active)];
|
||||
foreach (Skill? skill in activeSkills)
|
||||
{
|
||||
if (skill != null)
|
||||
{
|
||||
ItemSkills.Add(skill);
|
||||
}
|
||||
}
|
||||
ItemSkills.AddRange([.. Equipment.SelectMany(i => i.Skills.Passives), .. Items.SelectMany(i => i.Skills.Passives)]);
|
||||
|
||||
AllSkills.AddRange(Magics);
|
||||
AllSkills.AddRange(Skills);
|
||||
AllSkills.AddRange(PassiveSkills);
|
||||
AllSkills.AddRange(CommonPassiveSkills);
|
||||
AllSkills.AddRange(ItemSkills);
|
||||
AllSkills.AddRange(SuperSkills);
|
||||
AllSkills.AddRange(CommonSuperSkills);
|
||||
}
|
||||
|
||||
public static void Reload()
|
||||
{
|
||||
Characters.Clear();
|
||||
Equipment.Clear();
|
||||
Skills.Clear();
|
||||
SuperSkills.Clear();
|
||||
CommonSuperSkills.Clear();
|
||||
PassiveSkills.Clear();
|
||||
CommonPassiveSkills.Clear();
|
||||
Magics.Clear();
|
||||
AllItems.Clear();
|
||||
ItemSkills.Clear();
|
||||
AllSkills.Clear();
|
||||
InitFunGame();
|
||||
}
|
||||
|
||||
public static void AddCharacterSkills(Character character, int passiveLevel, int skillLevel, int superLevel)
|
||||
{
|
||||
long id = character.Id;
|
||||
Math.Sign(skillLevel);
|
||||
if (id == 1)
|
||||
{
|
||||
Skill META马 = new META马(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(META马);
|
||||
|
||||
Skill 熵灭极诣 = new 熵灭极诣(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(熵灭极诣);
|
||||
}
|
||||
|
||||
if (id == 2)
|
||||
{
|
||||
Skill 心灵之弦 = new 心灵之弦(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(心灵之弦);
|
||||
|
||||
Skill 千羽瞬华 = new 千羽瞬华(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(千羽瞬华);
|
||||
}
|
||||
|
||||
if (id == 3)
|
||||
{
|
||||
Skill 蚀魂震击 = new 蚀魂震击(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(蚀魂震击);
|
||||
|
||||
Skill 咒怨洪流 = new 咒怨洪流(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(咒怨洪流);
|
||||
}
|
||||
|
||||
if (id == 4)
|
||||
{
|
||||
Skill 灵能反射 = new 灵能反射(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(灵能反射);
|
||||
|
||||
Skill 三相灵枢 = new 三相灵枢(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(三相灵枢);
|
||||
}
|
||||
|
||||
if (id == 5)
|
||||
{
|
||||
Skill 双生流转 = new 双生流转(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(双生流转);
|
||||
|
||||
Skill 变幻之心 = new 变幻之心(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(变幻之心);
|
||||
}
|
||||
|
||||
if (id == 6)
|
||||
{
|
||||
Skill 零式崩解 = new 零式崩解(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(零式崩解);
|
||||
|
||||
Skill 零式灭杀 = new 零式灭杀(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(零式灭杀);
|
||||
}
|
||||
|
||||
if (id == 7)
|
||||
{
|
||||
Skill 少女绮想 = new 少女绮想(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(少女绮想);
|
||||
|
||||
Skill 绝对领域 = new 绝对领域(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(绝对领域);
|
||||
}
|
||||
|
||||
if (id == 8)
|
||||
{
|
||||
Skill 暗香疏影 = new 暗香疏影(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(暗香疏影);
|
||||
|
||||
Skill 残香凋零 = new 残香凋零(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(残香凋零);
|
||||
}
|
||||
|
||||
if (id == 9)
|
||||
{
|
||||
Skill 破釜沉舟 = new 破釜沉舟(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(破釜沉舟);
|
||||
|
||||
Skill 宿命时律 = new 宿命时律(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(宿命时律);
|
||||
}
|
||||
|
||||
if (id == 10)
|
||||
{
|
||||
Skill 累积之压 = new 累积之压(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(累积之压);
|
||||
|
||||
Skill 极寒渴望 = new 极寒渴望(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(极寒渴望);
|
||||
}
|
||||
|
||||
if (id == 11)
|
||||
{
|
||||
Skill 银隼之赐 = new 银隼之赐(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(银隼之赐);
|
||||
|
||||
Skill 身心一境 = new 身心一境(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(身心一境);
|
||||
}
|
||||
|
||||
if (id == 12)
|
||||
{
|
||||
Skill 弱者猎手 = new 弱者猎手(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(弱者猎手);
|
||||
|
||||
Skill 饕餮盛宴 = new 饕餮盛宴(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(饕餮盛宴);
|
||||
}
|
||||
|
||||
if (id == 13)
|
||||
{
|
||||
Skill 开宫 = new 开宫(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(开宫);
|
||||
|
||||
Skill 放监 = new 放监(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(放监);
|
||||
}
|
||||
|
||||
if (id == 14)
|
||||
{
|
||||
Skill 八卦阵 = new 八卦阵(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(八卦阵);
|
||||
|
||||
Skill 归元环 = new 归元环(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(归元环);
|
||||
}
|
||||
|
||||
if (id == 15)
|
||||
{
|
||||
Skill 深海之戟 = new 深海之戟(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(深海之戟);
|
||||
|
||||
Skill 海王星的野望 = new 海王星的野望(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(海王星的野望);
|
||||
}
|
||||
|
||||
if (id == 16)
|
||||
{
|
||||
Skill 雇佣兵团 = new 雇佣兵团(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(雇佣兵团);
|
||||
|
||||
Skill 全军出击 = new 全军出击(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(全军出击);
|
||||
}
|
||||
|
||||
if (id == 17)
|
||||
{
|
||||
Skill 不息之流 = new 不息之流(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(不息之流);
|
||||
|
||||
Skill 宿命之潮 = new 宿命之潮(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(宿命之潮);
|
||||
}
|
||||
|
||||
if (id == 18)
|
||||
{
|
||||
Skill 概念之骰 = new 概念之骰(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(概念之骰);
|
||||
|
||||
Skill 神之因果 = new 神之因果(character)
|
||||
{
|
||||
Level = superLevel
|
||||
};
|
||||
character.Skills.Add(神之因果);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Item> GenerateMagicCards(Random random, int count, QualityType? qualityType = null, long[]? magicIds = null, (int str, int agi, int intelligence)[]? values = null)
|
||||
{
|
||||
List<Item> items = [];
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
long magicId = 0;
|
||||
if (magicIds != null && magicIds.Length > i) magicId = magicIds[i];
|
||||
(int str, int agi, int intelligence) = (0, 0, 0);
|
||||
if (values != null && values.Length > i)
|
||||
{
|
||||
str = values[i].str;
|
||||
agi = values[i].agi;
|
||||
intelligence = values[i].intelligence;
|
||||
}
|
||||
items.Add(GenerateMagicCard(random, qualityType, magicId, str, agi, intelligence));
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
public static Item GenerateMagicCard(Random random, QualityType? qualityType = null, long magicId = 0, int str = 0, int agi = 0, int intelligence = 0)
|
||||
{
|
||||
Item item = new()
|
||||
{
|
||||
Id = CreateItemId("16", random),
|
||||
Name = RandomNames.GenerateRandomChineseName(random),
|
||||
ItemType = ItemType.MagicCard,
|
||||
RemainUseTimes = 1
|
||||
};
|
||||
|
||||
GenerateAndAddSkillToMagicCard(random, item, qualityType, magicId, str, agi, intelligence);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
public static void GenerateAndAddSkillToMagicCard(Random random, Item item, QualityType? qualityType = null, long magicId = 0, int str = 0, int agi = 0, int intelligence = 0)
|
||||
{
|
||||
int total = str + agi + intelligence;
|
||||
if (total == 0)
|
||||
{
|
||||
if (qualityType != null)
|
||||
{
|
||||
item.QualityType = qualityType.Value;
|
||||
if (item.QualityType > QualityType.Gold) item.QualityType = QualityType.Gold;
|
||||
total = item.QualityType switch
|
||||
{
|
||||
QualityType.Green => random.Next(7, 13),
|
||||
QualityType.Blue => random.Next(13, 19),
|
||||
QualityType.Purple => random.Next(19, 25),
|
||||
QualityType.Orange => random.Next(25, 31),
|
||||
QualityType.Red => random.Next(31, 37),
|
||||
QualityType.Gold => random.Next(37, 43),
|
||||
_ => random.Next(1, 7)
|
||||
};
|
||||
}
|
||||
else total = random.Next(1, 43);
|
||||
|
||||
// 随机决定将多少个属性赋给其中一个属性,确保至少一个不为零
|
||||
int nonZeroAttributes = random.Next(1, Math.Min(4, total + 1)); // 随机决定非零属性的数量,确保在 total = 1 时最多只有1个非零属性
|
||||
|
||||
// 根据非零属性数量分配属性点
|
||||
if (nonZeroAttributes == 1)
|
||||
{
|
||||
// 只有一个属性不为零
|
||||
int attribute = random.Next(0, 3);
|
||||
if (attribute == 0) str = total;
|
||||
else if (attribute == 1) agi = total;
|
||||
else intelligence = total;
|
||||
}
|
||||
else if (nonZeroAttributes == 2 && total >= 2)
|
||||
{
|
||||
// 两个属性不为零
|
||||
int first = random.Next(1, total); // 第一个属性的值
|
||||
int second = total - first; // 第二个属性的值
|
||||
|
||||
int attribute = random.Next(0, 3);
|
||||
if (attribute == 0)
|
||||
{
|
||||
str = first;
|
||||
}
|
||||
else if (attribute == 1)
|
||||
{
|
||||
agi = first;
|
||||
}
|
||||
else
|
||||
{
|
||||
intelligence = first;
|
||||
}
|
||||
|
||||
attribute = random.Next(0, 3);
|
||||
while ((attribute == 0 && str > 0) || (attribute == 1 && agi > 0) || (attribute == 2 && intelligence > 0))
|
||||
{
|
||||
attribute = random.Next(0, 3);
|
||||
}
|
||||
|
||||
if (attribute == 0)
|
||||
{
|
||||
str = second;
|
||||
}
|
||||
else if (attribute == 1)
|
||||
{
|
||||
agi = second;
|
||||
}
|
||||
else
|
||||
{
|
||||
intelligence = second;
|
||||
}
|
||||
}
|
||||
else if (total >= 3)
|
||||
{
|
||||
// 三个属性都不为零
|
||||
str = random.Next(1, total - 1); // 第一个属性的值
|
||||
agi = random.Next(1, total - str); // 第二个属性的值
|
||||
intelligence = total - str - agi; // 剩下的值给第三个属性
|
||||
}
|
||||
}
|
||||
|
||||
if (item.QualityType == QualityType.White)
|
||||
{
|
||||
if (total > 6 && total <= 12)
|
||||
{
|
||||
item.QualityType = QualityType.Green;
|
||||
}
|
||||
else if (total > 12 && total <= 18)
|
||||
{
|
||||
item.QualityType = QualityType.Blue;
|
||||
}
|
||||
else if (total > 18 && total <= 24)
|
||||
{
|
||||
item.QualityType = QualityType.Purple;
|
||||
}
|
||||
else if (total > 24 && total <= 30)
|
||||
{
|
||||
item.QualityType = QualityType.Orange;
|
||||
}
|
||||
else if (total > 30 && total <= 36)
|
||||
{
|
||||
item.QualityType = QualityType.Red;
|
||||
}
|
||||
else if (total > 36)
|
||||
{
|
||||
item.QualityType = QualityType.Gold;
|
||||
}
|
||||
}
|
||||
|
||||
Skill? magic = null;
|
||||
if (magicId != 0)
|
||||
{
|
||||
magic = Magics.FirstOrDefault(m => m.Id == magicId);
|
||||
}
|
||||
magic ??= Magics[random.Next(Magics.Count)].Copy();
|
||||
magic.AssociatedItemGuid = item.Guid;
|
||||
magic.Level = (int)item.QualityType switch
|
||||
{
|
||||
2 => 2,
|
||||
3 => 2,
|
||||
4 => 3,
|
||||
5 => 4,
|
||||
6 => 5,
|
||||
_ => 1
|
||||
};
|
||||
if (magic.Level > 1)
|
||||
{
|
||||
item.Name += $" +{magic.Level - 1}";
|
||||
}
|
||||
item.Skills.Active = magic;
|
||||
|
||||
Skill skill = Factory.OpenFactory.GetInstance<Skill>(item.Id, "动态矩阵", []);
|
||||
GenerateAndAddEffectsToMagicCard(skill, str, agi, intelligence);
|
||||
|
||||
skill.Level = 1;
|
||||
List<string> strings = [];
|
||||
if (str > 0) strings.Add($"{str:0.##} 点力量");
|
||||
if (agi > 0) strings.Add($"{agi:0.##} 点敏捷");
|
||||
if (intelligence > 0) strings.Add($"{intelligence:0.##} 点智力");
|
||||
item.Description = $"包含魔法:{item.Skills.Active.Name + (item.Skills.Active.Level > 1 ? $" +{item.Skills.Active.Level - 1}" : "")}\r\n" +
|
||||
$"增加角色属性:{string.Join(",", strings)}";
|
||||
item.Skills.Passives.Add(skill);
|
||||
}
|
||||
|
||||
public static void GenerateAndAddEffectsToMagicCard(Skill skill, int str, int agi, int intelligence)
|
||||
{
|
||||
if (str > 0)
|
||||
{
|
||||
skill.Effects.Add(Factory.OpenFactory.GetInstance((long)EffectID.ExSTR, "", skill, new()
|
||||
{
|
||||
{ "exstr", str }
|
||||
}));
|
||||
}
|
||||
|
||||
if (agi > 0)
|
||||
{
|
||||
skill.Effects.Add(Factory.OpenFactory.GetInstance((long)EffectID.ExAGI, "", skill, new()
|
||||
{
|
||||
{ "exagi", agi }
|
||||
}));
|
||||
}
|
||||
|
||||
if (intelligence > 0)
|
||||
{
|
||||
skill.Effects.Add(Factory.OpenFactory.GetInstance((long)EffectID.ExINT, "", skill, new()
|
||||
{
|
||||
{ "exint", intelligence }
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public static Item? ConflateMagicCardPack(Random random, IEnumerable<Item> magicCards)
|
||||
{
|
||||
if (magicCards.Any())
|
||||
{
|
||||
List<Skill> magics = [.. magicCards.Where(i => i.Skills.Active != null).Select(i => i.Skills.Active!)];
|
||||
List<Skill> passives = [.. magicCards.SelectMany(i => i.Skills.Passives)];
|
||||
Item item = new()
|
||||
{
|
||||
Id = CreateItemId("10", random),
|
||||
Name = RandomNames.GenerateRandomChineseName(random),
|
||||
ItemType = ItemType.MagicCardPack
|
||||
};
|
||||
double str = 0, agi = 0, intelligence = 0;
|
||||
foreach (Skill skill in passives)
|
||||
{
|
||||
Skill newSkill = skill.Copy();
|
||||
foreach (Effect effect in newSkill.Effects)
|
||||
{
|
||||
switch ((EffectID)effect.Id)
|
||||
{
|
||||
case EffectID.ExSTR:
|
||||
if (effect is ExSTR exstr)
|
||||
{
|
||||
str += exstr.Value;
|
||||
}
|
||||
break;
|
||||
case EffectID.ExAGI:
|
||||
if (effect is ExAGI exagi)
|
||||
{
|
||||
agi += exagi.Value;
|
||||
}
|
||||
break;
|
||||
case EffectID.ExINT:
|
||||
if (effect is ExINT exint)
|
||||
{
|
||||
intelligence += exint.Value;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
newSkill.Level = skill.Level;
|
||||
newSkill.Item = item;
|
||||
item.Skills.Passives.Add(newSkill);
|
||||
}
|
||||
List<string> strings = [];
|
||||
if (str > 0) strings.Add($"{str:0.##} 点力量");
|
||||
if (agi > 0) strings.Add($"{agi:0.##} 点敏捷");
|
||||
if (intelligence > 0) strings.Add($"{intelligence:0.##} 点智力");
|
||||
foreach (Skill skill in magics)
|
||||
{
|
||||
IEnumerable<Skill> has = item.Skills.Magics.Where(m => m.Id == skill.Id);
|
||||
if (has.Any() && has.First() is Skill s)
|
||||
{
|
||||
s.Level += skill.Level;
|
||||
if (s.Level > 1) s.Name = s.Name.Split(' ')[0] + $" +{s.Level - 1}";
|
||||
}
|
||||
else
|
||||
{
|
||||
Skill magic = skill.Copy();
|
||||
magic.AssociatedItemGuid = item.Guid;
|
||||
magic.Level = skill.Level;
|
||||
item.Skills.Magics.Add(magic);
|
||||
}
|
||||
}
|
||||
item.Description = $"包含魔法:{string.Join(",", item.Skills.Magics.Select(m => m.Name + (m.Level > 1 ? $" +{m.Level - 1}" : "")))}\r\n" +
|
||||
$"增加角色属性:{string.Join(",", strings)}";
|
||||
double total = str + agi + intelligence;
|
||||
if (total > 18 && total <= 36)
|
||||
{
|
||||
item.QualityType = QualityType.Green;
|
||||
}
|
||||
else if (total > 36 && total <= 54)
|
||||
{
|
||||
item.QualityType = QualityType.Blue;
|
||||
}
|
||||
else if (total > 54 && total <= 72)
|
||||
{
|
||||
item.QualityType = QualityType.Purple;
|
||||
}
|
||||
else if (total > 72 && total <= 90)
|
||||
{
|
||||
item.QualityType = QualityType.Orange;
|
||||
}
|
||||
else if (total > 90 && total <= 108)
|
||||
{
|
||||
item.QualityType = QualityType.Red;
|
||||
}
|
||||
else if (total > 108)
|
||||
{
|
||||
item.QualityType = QualityType.Gold;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Item? GenerateMagicCardPack(Random random, int magicCardCount, QualityType? qualityType = null, long[]? magicIds = null, (int str, int agi, int intelligence)[]? values = null)
|
||||
{
|
||||
List<Item> magicCards = GenerateMagicCards(random, magicCardCount, qualityType, magicIds, values);
|
||||
Item? magicCardPack = ConflateMagicCardPack(random, magicCards);
|
||||
return magicCardPack;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 以核心库 MagicCardPack 为载体的卡包(新做法):三围写入原生 AttributeBoosts(exstr/exagi/exint),
|
||||
/// 不再生成 Ex 被动特效技能。魔法合并 / 品质映射 / 描述口径与 ConflateMagicCardPack 保持一致。
|
||||
/// </summary>
|
||||
public static Item? GenerateCoreMagicCardPack(Random random, int magicCardCount, QualityType? qualityType = null, long[]? magicIds = null, (int str, int agi, int intelligence)[]? values = null)
|
||||
{
|
||||
List<Item> magicCards = GenerateMagicCards(random, magicCardCount, qualityType, magicIds, values);
|
||||
return ConflateCoreMagicCardPack(random, magicCards);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将若干魔法卡合成为核心库 MagicCardPack。
|
||||
/// 说明:不修改原 ConflateMagicCardPack / 卡片生成流程;三围取自卡片被动技能的 Ex 特效(typed 优先、参数 Values 兜底)。
|
||||
/// 宿主未注册特效工厂时 OpenFactory 只会产出 Id=0 且参数丢失的泛型 Effect——新方法与旧方法在该类宿主下的取值表现一致。
|
||||
/// </summary>
|
||||
public static Item? ConflateCoreMagicCardPack(Random random, IEnumerable<Item> magicCards)
|
||||
{
|
||||
if (!magicCards.Any())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
List<Skill> magics = [.. magicCards.Where(i => i.Skills.Active != null).Select(i => i.Skills.Active!)];
|
||||
double str = 0, agi = 0, intelligence = 0;
|
||||
foreach (Item card in magicCards)
|
||||
{
|
||||
foreach (Skill skill in card.Skills.Passives)
|
||||
{
|
||||
foreach (Effect effect in skill.Effects)
|
||||
{
|
||||
double ex = 0, ag = 0, it = 0;
|
||||
switch (effect)
|
||||
{
|
||||
case ExSTR s: ex = s.Value; break;
|
||||
case ExAGI a: ag = a.Value; break;
|
||||
case ExINT i: it = i.Value; break;
|
||||
default:
|
||||
foreach (KeyValuePair<string, object> kv in effect.Values)
|
||||
{
|
||||
if (kv.Key.Equals("exstr", StringComparison.OrdinalIgnoreCase) && double.TryParse(kv.Value.ToString(), out double sx)) ex = sx;
|
||||
else if (kv.Key.Equals("exagi", StringComparison.OrdinalIgnoreCase) && double.TryParse(kv.Value.ToString(), out double ax)) ag = ax;
|
||||
else if (kv.Key.Equals("exint", StringComparison.OrdinalIgnoreCase) && double.TryParse(kv.Value.ToString(), out double ix)) it = ix;
|
||||
}
|
||||
break;
|
||||
}
|
||||
str += ex;
|
||||
agi += ag;
|
||||
intelligence += it;
|
||||
}
|
||||
}
|
||||
}
|
||||
MagicCardPack item = new(new Dictionary<string, object>
|
||||
{
|
||||
{ "exstr", str },
|
||||
{ "exagi", agi },
|
||||
{ "exint", intelligence }
|
||||
})
|
||||
{
|
||||
Id = CreateItemId("10", random),
|
||||
Name = RandomNames.GenerateRandomChineseName(random)
|
||||
};
|
||||
List<string> strings = [];
|
||||
if (str > 0) strings.Add($"{str:0.##} 点力量");
|
||||
if (agi > 0) strings.Add($"{agi:0.##} 点敏捷");
|
||||
if (intelligence > 0) strings.Add($"{intelligence:0.##} 点智力");
|
||||
foreach (Skill skill in magics)
|
||||
{
|
||||
IEnumerable<Skill> has = item.Skills.Magics.Where(m => m.Id == skill.Id);
|
||||
if (has.Any() && has.First() is Skill s)
|
||||
{
|
||||
s.Level += skill.Level;
|
||||
if (s.Level > 1) s.Name = s.Name.Split(' ')[0] + $" +{s.Level - 1}";
|
||||
}
|
||||
else
|
||||
{
|
||||
Skill magic = skill.Copy();
|
||||
magic.AssociatedItemGuid = item.Guid;
|
||||
magic.Level = skill.Level;
|
||||
item.Skills.Magics.Add(magic);
|
||||
}
|
||||
}
|
||||
item.Description = $"包含魔法:{string.Join(",", item.Skills.Magics.Select(m => m.Name + (m.Level > 1 ? $" +{m.Level - 1}" : "")))}\r\n" +
|
||||
$"增加角色属性:{string.Join(",", strings)}";
|
||||
double total = str + agi + intelligence;
|
||||
if (total > 18 && total <= 36)
|
||||
{
|
||||
item.QualityType = QualityType.Green;
|
||||
}
|
||||
else if (total > 36 && total <= 54)
|
||||
{
|
||||
item.QualityType = QualityType.Blue;
|
||||
}
|
||||
else if (total > 54 && total <= 72)
|
||||
{
|
||||
item.QualityType = QualityType.Purple;
|
||||
}
|
||||
else if (total > 72 && total <= 90)
|
||||
{
|
||||
item.QualityType = QualityType.Orange;
|
||||
}
|
||||
else if (total > 90 && total <= 108)
|
||||
{
|
||||
item.QualityType = QualityType.Red;
|
||||
}
|
||||
else if (total > 108)
|
||||
{
|
||||
item.QualityType = QualityType.Gold;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
public static double CalculateRating(CharacterStatistics stats, Team? team = null, CharacterStatistics[]? allStats = null)
|
||||
{
|
||||
double k = stats.Kills;
|
||||
double a = stats.Assists;
|
||||
double d = Math.Max(0, stats.Deaths);
|
||||
double dmg = stats.TotalDamage + (stats.TotalTrueDamage * 0.2);
|
||||
double heal = stats.TotalHeal + stats.TotalShield;
|
||||
double cc = stats.ControlTime;
|
||||
double taken = stats.TotalTakenDamage;
|
||||
double live = stats.LiveTime;
|
||||
|
||||
if (team != null)
|
||||
{
|
||||
double teamTotalDmg = allStats?.Sum(s => s.TotalDamage + s.TotalTrueDamage * 0.2) ?? dmg;
|
||||
double teamTotalHeal = allStats?.Sum(s => s.TotalHeal + s.TotalShield) ?? heal;
|
||||
int playerCount = allStats?.Length ?? 1;
|
||||
|
||||
double dmgShare = dmg / Math.Max(2.3, teamTotalDmg);
|
||||
double healShare = heal / Math.Max(1, teamTotalHeal);
|
||||
double roleContribution = Math.Max(dmgShare, healShare) * playerCount * 0.6;
|
||||
double roleScore = Math.Min(1.0, roleContribution);
|
||||
|
||||
double kdaRatio = (k * 1.4 + a * 0.2) / (d + 1.8);
|
||||
double kdaScore = Math.Min(1.0, (kdaRatio / 3.0) * 0.4);
|
||||
|
||||
double ccScore = Math.Min(0.10, (cc / 60.0) * 0.05);
|
||||
double tankScore = Math.Min(0.10, (taken / (d + 1) / 10000.0) * 0.1);
|
||||
|
||||
double totalRating = roleScore + kdaScore + ccScore + tankScore;
|
||||
|
||||
double avgDeaths = allStats?.Average(s => s.Deaths) ?? d;
|
||||
if (d > avgDeaths && kdaRatio < 1.0) totalRating *= 0.75;
|
||||
|
||||
return Math.Round(Math.Max(0.01, totalRating), 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
int rank = stats.LastRank;
|
||||
int totalPlayers = allStats?.Length ?? 10;
|
||||
double maxKills = allStats?.Max(s => s.Kills) ?? k;
|
||||
double maxDmg = allStats?.Max(s => s.TotalDamage + s.TotalTrueDamage * 0.2) ?? dmg;
|
||||
|
||||
double rankScore = ((totalPlayers - rank + 1.0) / totalPlayers) * 0.8;
|
||||
|
||||
double killPart = (k * 1.7 + a * 0.1) / Math.Max(1, maxKills + 1);
|
||||
double dmgPart = (dmg / Math.Max(1, maxDmg * 1.8)) * 0.1;
|
||||
double combatScore = Math.Min(0.8, killPart * 0.4 + dmgPart);
|
||||
|
||||
double utilityScore = Math.Min(0.2, (cc / 60.0) * 0.04 + (heal / Math.Max(1, maxDmg)) * 0.05);
|
||||
|
||||
double totalRating = rankScore + combatScore + utilityScore;
|
||||
|
||||
if (k == 0)
|
||||
{
|
||||
totalRating *= 0.6;
|
||||
}
|
||||
|
||||
if (rank == 1 && k > 0)
|
||||
{
|
||||
if (k >= maxKills) totalRating += 0.15;
|
||||
}
|
||||
|
||||
if (rank > 5 && k >= maxKills * 0.8 && k > 0)
|
||||
{
|
||||
totalRating += 0.15;
|
||||
}
|
||||
|
||||
return Math.Round(Math.Max(0.01, totalRating), 4);
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetCharacterRating(Dictionary<Character, CharacterStatistics> statistics, bool isTeam, List<Team> teams)
|
||||
{
|
||||
foreach (Character character in statistics.Keys)
|
||||
{
|
||||
Team? team = null;
|
||||
CharacterStatistics[]? teammateStats = null;
|
||||
if (isTeam)
|
||||
{
|
||||
team = teams.FirstOrDefault(t => t.IsOnThisTeam(character));
|
||||
if (team != null)
|
||||
{
|
||||
teammateStats = [.. statistics.Where(kv => team.Members.Contains(kv.Key)).Select(kv => kv.Value)];
|
||||
}
|
||||
}
|
||||
statistics[character].Rating = CalculateRating(statistics[character], team, teammateStats);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用本局随机源生成物品 Id(原 <see cref="Verification.CreateVerifyCode"/> 依赖 DateTime.Now + new Random(),不可复现)
|
||||
/// </summary>
|
||||
/// <param name="prefix">Id 前缀("16"=魔法卡,"10"=卡包)</param>
|
||||
/// <param name="random">本局随机源</param>
|
||||
public static long CreateItemId(string prefix, Random random)
|
||||
{
|
||||
return Convert.ToInt64(prefix + random.Next(10_000_000, 100_000_000).ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,97 @@
|
||||
namespace OshimaBot.Game.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="FunGameSimulation.StartSimulationGame"/> 的参数包,替代原先一长串位置 / 命名参数
|
||||
/// <para/>· 用法:<c>new SimulationOptions { IsTeam = true, BindToCharacter = true }</c>
|
||||
/// <para/>· <see cref="MaxRespawnTimesMix"/> 在 <c>new</c> 时默认为 1(与旧版可选参数默认值一致),
|
||||
/// <see cref="BindToCharacter"/> 默认为 <c>true</c>(角色绑定的回合奖励默认启用),其余字段默认为 false
|
||||
/// </summary>
|
||||
public struct SimulationOptions
|
||||
{
|
||||
/// <summary>控制台输出开关(旧参数 printout)</summary>
|
||||
public bool PrintOut { get; set; }
|
||||
|
||||
/// <summary>Web 模式:影响回合消息的收集与输出</summary>
|
||||
public bool IsWeb { get; set; }
|
||||
|
||||
/// <summary>团队模式(TeamGamingQueue),否则为混战模式(MixGamingQueue)</summary>
|
||||
public bool IsTeam { get; set; }
|
||||
|
||||
/// <summary>死斗模式输出逐回合详情</summary>
|
||||
public bool DeathMatchRoundDetail { get; set; }
|
||||
|
||||
/// <summary>混战模式的最大复活次数</summary>
|
||||
public int MaxRespawnTimesMix { get; set; }
|
||||
|
||||
/// <summary>启用商店(仅团队模式生效)</summary>
|
||||
public bool UseStore { get; set; }
|
||||
|
||||
/// <summary>是否加载地图</summary>
|
||||
public bool HasMap { get; set; }
|
||||
|
||||
/// <summary>调试模式(输出更多运行细节)</summary>
|
||||
public bool IsDebug { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用「角色绑定的回合奖励」(对应 <c>InitRoundRewards</c> 的 bindToCharacter)。<para/>
|
||||
/// <b>默认 true</b>:不启用时【命运XX】系技能(抢夺 / 剥夺 / 馈赠)与【强运】会全部静默失效。
|
||||
/// </summary>
|
||||
public bool BindToCharacter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始角色等级(默认 10)。局内会由空投 <c>DropItems</c> 每 40 时间单位 +8 逐步提升,
|
||||
/// 直到 <c>GameplayEquilibriumConstant.MaxLevel</c>(60)。<para/>
|
||||
/// 平衡测试可设为 60 <b>直接拉满</b>,使实测口径与《数值设计手册·判定基准》的 Lv60 标尺一致
|
||||
/// —— 否则一局里前 ~60% 时长在低等级,会把实测值稀释(实测普攻每目标伤害在 t≈280 前只有满级的 1/5)。
|
||||
/// </summary>
|
||||
public int CharacterLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始战技 / 魔法 / 爆发技等级(默认 2)。空投每次 +1,上限:战技·爆发技 6、魔法 8。
|
||||
/// 拉满用 6(战技·爆发技封顶)或 8(魔法封顶)。
|
||||
/// </summary>
|
||||
public int SkillLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始普攻等级(默认 2)。空投每次 +1,上限 <c>MaxNormalAttackLevel</c>(8)。
|
||||
/// </summary>
|
||||
public int NormalAttackLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 周期空投开关(默认 <c>true</c>,即保持原有对局行为)。<para/>
|
||||
/// · <c>true</c>:每 <b>40 时间单位</b>空投一次,发装备 + 魔法卡包并提升等级 —— 对局持续成长(实战态)。<br/>
|
||||
/// · <c>false</c>:只在开局发放一次(<c>DropItems(..., addLevel: false)</c>),此后装备与技能池保持恒定 —— <b>定态</b>。
|
||||
/// <para/>
|
||||
/// 定态用于测量「技能在固定装备/固定技能池下的收益」:可消除局内数值漂移带来的异方差
|
||||
/// (实测渐进态下普攻每目标伤害从 149 涨到 1136,同一技能的样本跨 7.6 倍量级)。
|
||||
/// 注意:开局那次空投不能省,否则角色没有装备、也没有魔法卡包附带的魔法。
|
||||
/// </summary>
|
||||
public bool EnablePeriodicDrop { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 固定武器 Id(默认 <c>0</c> = 不固定,按品质随机抽取)。<para/>
|
||||
/// 40 件武器**全部**带攻击力副属性,且 <c>exatk</c> 跨度 20(品质0)– 170(品质5)= <b>8.5×</b>,
|
||||
/// 副属性还各不相同(<c>excr</c>/<c>exppt</c>/<c>exmpt</c>/<c>excrd</c>/<c>exspd</c>/<c>exls</c>/<c>exatk2</c>),
|
||||
/// 武器类型倍率另有 0.85–1.20 的 1.41× 跨度。固定武器可一次性消除这些变量
|
||||
/// (防具/鞋/饰品中仅 2 件带攻击力,占比 2/107,影响可忽略)。<para/>
|
||||
/// 平衡测试建议配合 <see cref="EnablePeriodicDrop"/>=false 使用,
|
||||
/// 推荐值 <c>11575</c>(羔羊颂·品质5 单手剑,<c>exatk 110 + excr 0.3</c>,单手剑倍率 1.0 中性)。
|
||||
/// </summary>
|
||||
public long FixedWeaponId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 构造参数包:<see cref="MaxRespawnTimesMix"/> 默认 1,等级默认为 10 / 2 / 2(与旧版硬编码一致),
|
||||
/// <see cref="EnablePeriodicDrop"/> 与 <see cref="BindToCharacter"/> 默认 true,其余布尔默认 false
|
||||
/// </summary>
|
||||
public SimulationOptions()
|
||||
{
|
||||
MaxRespawnTimesMix = 1;
|
||||
CharacterLevel = 10;
|
||||
SkillLevel = 2;
|
||||
NormalAttackLevel = 2;
|
||||
EnablePeriodicDrop = true;
|
||||
// 角色绑定的回合奖励默认启用:否则命运系技能与强运全部静默失效
|
||||
BindToCharacter = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user