diff --git a/OshimaCore/Controllers/TestController.cs b/OshimaCore/Controllers/TestController.cs index 3e04335..087c03b 100644 --- a/OshimaCore/Controllers/TestController.cs +++ b/OshimaCore/Controllers/TestController.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging; using Milimoe.FunGame.Core.Api.Transmittal; using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Library.Exception; +using Milimoe.FunGame.Core.Library.SQLScript.Common; using Oshima.Core.Constant; namespace Oshima.Core.Controllers @@ -30,7 +31,7 @@ namespace Oshima.Core.Controllers SQLHelper? sql = Statics.RunningPlugin.SQLHelper; if (sql != null) { - sql.ExecuteDataSet("Select Max(LoginTime) LastTime From ServerLoginLogs"); + sql.ExecuteDataSet(ServerLoginLogs.Select_GetLastLoginTime()); if (sql.Success && DateTime.TryParse(sql.DataSet.Tables[0].Rows[0]["LastTime"].ToString(), out DateTime date)) { string month = date.ToString("MMM", CultureInfo.InvariantCulture); diff --git a/OshimaModules/Modules/EntityFactory.cs b/OshimaModules/Modules/EntityFactory.cs new file mode 100644 index 0000000..3985c6e --- /dev/null +++ b/OshimaModules/Modules/EntityFactory.cs @@ -0,0 +1,154 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Items; +using Oshima.FunGame.OshimaModules.OpenEffects; +using Oshima.FunGame.OshimaModules.Skills; + +namespace Oshima.FunGame.OshimaModules +{ + public class EntityFactory + { + public static Skill? GetSkill(long id, 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 static Item? GetItem(long id, 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; + } + + public static Effect? GetEffect(long id, Skill skill, Character? source = null, Item? item = null) + { + return (EffectID)id switch + { + EffectID.ExATK => new ExATK(skill, source, item), + EffectID.ExDEF => new ExDEF(skill, source, item), + EffectID.ExSTR => new ExSTR(skill, source, item), + EffectID.ExAGI => new ExAGI(skill, source, item), + EffectID.ExINT => new ExINT(skill, source, item), + EffectID.SkillHardTimeReduce => new SkillHardTimeReduce(skill, source, item), + EffectID.NormalAttackHardTimeReduce => new NormalAttackHardTimeReduce(skill, source, item), + EffectID.AccelerationCoefficient => new AccelerationCoefficient(skill, source, item), + EffectID.ExSPD => new ExSPD(skill, source, item), + EffectID.ExActionCoefficient => new ExActionCoefficient(skill, source, item), + EffectID.ExCDR => new ExCDR(skill, source, item), + EffectID.ExMaxHP => new ExMaxHP(skill, source, item), + EffectID.ExMaxMP => new ExMaxMP(skill, source, item), + EffectID.ExCritRate => new ExCritRate(skill, source, item), + EffectID.ExCritDMG => new ExCritDMG(skill, source, item), + EffectID.ExEvadeRate => new ExEvadeRate(skill, source, item), + EffectID.PhysicalPenetration => new PhysicalPenetration(skill, source, item), + EffectID.MagicalPenetration => new MagicalPenetration(skill, source, item), + EffectID.ExPDR => new ExPDR(skill, source, item), + EffectID.ExMDF => new ExMDF(skill, source, item), + EffectID.ExHR => new ExHR(skill, source, item), + EffectID.ExMR => new ExMR(skill, source, item), + _ => null + }; + } + } +} diff --git a/OshimaModules/Modules/ItemModule.cs b/OshimaModules/Modules/ItemModule.cs index c2fe45a..db5e233 100644 --- a/OshimaModules/Modules/ItemModule.cs +++ b/OshimaModules/Modules/ItemModule.cs @@ -1,7 +1,6 @@ using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Library.Constant; -using Oshima.FunGame.OshimaModules.Items; namespace Oshima.FunGame.OshimaModules { @@ -27,32 +26,88 @@ namespace Oshima.FunGame.OshimaModules prev.SetPropertyToItemModuleNew(next); config[key] = next; } + Item item = config[key]; + HashSet skills = item.Skills.Passives; + if (item.Skills.Active != null) skills.Add(item.Skills.Active); + List skilllist = [.. skills]; + foreach (Skill skill in skilllist) + { + Skill? newSkill = EntityFactory.GetSkill(skill.Id, skill.SkillType); + if (newSkill != null) + { + if (newSkill.IsActive) + { + item.Skills.Active = newSkill; + } + else + { + item.Skills.Passives.Remove(skill); + item.Skills.Passives.Add(newSkill); + } + } + Skill s = newSkill ?? skill; + List effects = [.. s.Effects]; + foreach (Effect effect in effects) + { + skill.Effects.Remove(effect); + Effect? newEffect = EntityFactory.GetEffect(effect.Id, skill); + if (newEffect != null) + { + skill.Effects.Add(newEffect); + } + } + } } return [.. config.Values]; } } - public override Item? GetItem(long id, string name, ItemType type) + protected override void AfterLoad() { - if (type == ItemType.MagicCardPack) + Factory.OpenFactory.RegisterFactory(args => { - - } - - if (type == ItemType.Accessory) - { - switch ((AccessoryID)id) + if (args.TryGetValue("id", out object? value) && value is long id && args.TryGetValue("itemtype", out value) && value is int type) { - case AccessoryID.攻击之爪10: - return new 攻击之爪10(); - case AccessoryID.攻击之爪30: - return new 攻击之爪30(); - case AccessoryID.攻击之爪50: - return new 攻击之爪50(); + Item? item = EntityFactory.GetItem(id, (ItemType)type); + if (item != null) + { + HashSet skills = item.Skills.Passives; + if (item.Skills.Active != null) skills.Add(item.Skills.Active); + List skilllist = [.. skills]; + foreach (Skill skill in skilllist) + { + item.Skills.Passives.Remove(skill); + Skill newSkill = EntityFactory.GetSkill(skill.Id, skill.SkillType) ?? new OpenSkill(skill.Id, skill.Name); + if (newSkill != null) + { + if (newSkill.IsActive) + { + item.Skills.Active = newSkill; + } + else + { + item.Skills.Passives.Add(newSkill); + } + } + Skill s = newSkill ?? skill; + List effects = [.. s.Effects]; + foreach (Effect effect in effects) + { + skill.Effects.Remove(effect); + Effect? newEffect = EntityFactory.GetEffect(effect.Id, skill); + if (newEffect != null) + { + skill.Effects.Add(newEffect); + } + } + } + return item; + } } - } - - return null; + return null; + }); } + + public override Item? GetItem(long id, string name, ItemType type) => EntityFactory.GetItem(id, type); } } diff --git a/OshimaModules/Modules/SkillModule.cs b/OshimaModules/Modules/SkillModule.cs index 69429d3..c5c5f45 100644 --- a/OshimaModules/Modules/SkillModule.cs +++ b/OshimaModules/Modules/SkillModule.cs @@ -1,8 +1,6 @@ using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Library.Constant; -using Oshima.FunGame.OshimaModules.Items; -using Oshima.FunGame.OshimaModules.Skills; namespace Oshima.FunGame.OshimaModules { @@ -22,104 +20,27 @@ namespace Oshima.FunGame.OshimaModules foreach (string key in config.Keys) { Skill prev = config[key]; - Skill? next = GetSkill(prev.Id, prev.Name, prev.SkillType); + Skill? next = EntityFactory.GetSkill(prev.Id, prev.SkillType); if (next != null) { config[key] = next; } + Skill skill = config[key]; + List effects = [.. skill.Effects]; + foreach (Effect effect in effects) + { + Effect? newEffect = EntityFactory.GetEffect(effect.Id, skill); + if (newEffect != null) + { + skill.Effects.Remove(effect); + skill.Effects.Add(newEffect); + } + } } 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 override Skill? GetSkill(long id, string name, SkillType type) => EntityFactory.GetSkill(id, type); } } diff --git a/OshimaModules/OpenEffects/AccelerationCoefficient.cs b/OshimaModules/OpenEffects/AccelerationCoefficient.cs new file mode 100644 index 0000000..978bbd6 --- /dev/null +++ b/OshimaModules/OpenEffects/AccelerationCoefficient.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class AccelerationCoefficient : Effect + { + public override long Id => (long)EffectID.AccelerationCoefficient; + public override string Name => "加速系数加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 加速系数。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.AccelerationCoefficient += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.AccelerationCoefficient -= 实际加成; + } + + public AccelerationCoefficient(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exacc", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exACC)) + { + 实际加成 = exACC; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/EffectID.cs b/OshimaModules/OpenEffects/EffectID.cs new file mode 100644 index 0000000..9e53cb7 --- /dev/null +++ b/OshimaModules/OpenEffects/EffectID.cs @@ -0,0 +1,115 @@ +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public enum EffectID : long + { + /// + /// exatk + /// + ExATK = 8001, + + /// + /// exdef + /// + ExDEF = 8002, + + /// + /// exstr + /// + ExSTR = 8003, + + /// + /// exagi + /// + ExAGI = 8004, + + /// + /// exint + /// + ExINT = 8005, + + /// + /// shtr + /// + SkillHardTimeReduce = 8006, + + /// + /// nahtr + /// + NormalAttackHardTimeReduce = 8007, + + /// + /// exacc + /// + AccelerationCoefficient = 8008, + + /// + /// exspd + /// + ExSPD = 8009, + + /// + /// exac + /// + ExActionCoefficient = 8010, + + /// + /// excdr + /// + ExCDR = 8011, + + /// + /// exhp + /// + ExMaxHP = 8012, + + /// + /// exmp + /// + ExMaxMP = 8013, + + /// + /// excr + /// + ExCritRate = 8014, + + /// + /// excrd + /// + ExCritDMG = 8015, + + /// + /// exer + /// + ExEvadeRate = 8016, + + /// + /// expp + /// + PhysicalPenetration = 8017, + + /// + /// exmp + /// + MagicalPenetration = 8018, + + /// + /// expdr + /// + ExPDR = 8019, + + /// + /// mdftype, mdfvalue + /// + ExMDF = 8020, + + /// + /// exhr + /// + ExHR = 8021, + + /// + /// exmr + /// + ExMR = 8022 + } +} diff --git a/OshimaModules/OpenEffects/ExAGI.cs b/OshimaModules/OpenEffects/ExAGI.cs new file mode 100644 index 0000000..2edf437 --- /dev/null +++ b/OshimaModules/OpenEffects/ExAGI.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExAGI : Effect + { + public override long Id => (long)EffectID.ExAGI; + public override string Name => "敏捷加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点敏捷。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExAGI += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExAGI -= 实际加成; + } + + public ExAGI(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exagi", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exAGI)) + { + 实际加成 = exAGI; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExATK.cs b/OshimaModules/OpenEffects/ExATK.cs new file mode 100644 index 0000000..5c99e89 --- /dev/null +++ b/OshimaModules/OpenEffects/ExATK.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExATK : Effect + { + public override long Id => (long)EffectID.ExATK; + public override string Name => "攻击力加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExATK2 += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExATK2 -= 实际加成; + } + + public ExATK(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exatk", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exATK)) + { + 实际加成 = exATK; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExActionCoefficient.cs b/OshimaModules/OpenEffects/ExActionCoefficient.cs new file mode 100644 index 0000000..dd25d07 --- /dev/null +++ b/OshimaModules/OpenEffects/ExActionCoefficient.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExActionCoefficient : Effect + { + public override long Id => (long)EffectID.ExActionCoefficient; + public override string Name => "行动系数加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 行动系数。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExActionCoefficient += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExActionCoefficient -= 实际加成; + } + + public ExActionCoefficient(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exac", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exAC)) + { + 实际加成 = exAC; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExCDR.cs b/OshimaModules/OpenEffects/ExCDR.cs new file mode 100644 index 0000000..36a8db9 --- /dev/null +++ b/OshimaModules/OpenEffects/ExCDR.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExCDR : Effect + { + public override long Id => (long)EffectID.ExCDR; + public override string Name => "冷却缩减加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 冷却缩减。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExCDR += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExCDR -= 实际加成; + } + + public ExCDR(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("excdr", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exCDR)) + { + 实际加成 = exCDR; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExCritDMG.cs b/OshimaModules/OpenEffects/ExCritDMG.cs new file mode 100644 index 0000000..b6d025b --- /dev/null +++ b/OshimaModules/OpenEffects/ExCritDMG.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExCritDMG : Effect + { + public override long Id => (long)EffectID.ExCritDMG; + public override string Name => "暴击伤害加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 暴击伤害。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExCritDMG += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExCritDMG -= 实际加成; + } + + public ExCritDMG(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("excrd", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exCRD)) + { + 实际加成 = exCRD; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExCritRate.cs b/OshimaModules/OpenEffects/ExCritRate.cs new file mode 100644 index 0000000..699cd94 --- /dev/null +++ b/OshimaModules/OpenEffects/ExCritRate.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExCritRate : Effect + { + public override long Id => (long)EffectID.ExCritRate; + public override string Name => "暴击率加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 暴击率。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExCritRate += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExCritRate -= 实际加成; + } + + public ExCritRate(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("excr", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exCR)) + { + 实际加成 = exCR; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExDEF.cs b/OshimaModules/OpenEffects/ExDEF.cs new file mode 100644 index 0000000..716d9d2 --- /dev/null +++ b/OshimaModules/OpenEffects/ExDEF.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExDEF : Effect + { + public override long Id => (long)EffectID.ExDEF; + public override string Name => "物理护甲加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExDEF2 += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExDEF2 -= 实际加成; + } + + public ExDEF(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exdef", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exDEF)) + { + 实际加成 = exDEF; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExEvadeRate.cs b/OshimaModules/OpenEffects/ExEvadeRate.cs new file mode 100644 index 0000000..920d4f4 --- /dev/null +++ b/OshimaModules/OpenEffects/ExEvadeRate.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExEvadeRate : Effect + { + public override long Id => (long)EffectID.ExEvadeRate; + public override string Name => "闪避率加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 闪避率。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExEvadeRate += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExEvadeRate -= 实际加成; + } + + public ExEvadeRate(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exer", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exER)) + { + 实际加成 = exER; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExHR.cs b/OshimaModules/OpenEffects/ExHR.cs new file mode 100644 index 0000000..dada79c --- /dev/null +++ b/OshimaModules/OpenEffects/ExHR.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExHR : Effect + { + public override long Id => (long)EffectID.ExHR; + public override string Name => "生命回复加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点生命回复。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExHR += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExHR -= 实际加成; + } + + public ExHR(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exhr", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exHR)) + { + 实际加成 = exHR; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExINT.cs b/OshimaModules/OpenEffects/ExINT.cs new file mode 100644 index 0000000..b984075 --- /dev/null +++ b/OshimaModules/OpenEffects/ExINT.cs @@ -0,0 +1,42 @@ + using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExINT : Effect + { + public override long Id => (long)EffectID.ExINT; + public override string Name => "智力加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点智力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExINT += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExINT -= 实际加成; + } + + public ExINT(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exint", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exINT)) + { + 实际加成 = exINT; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExMDF.cs b/OshimaModules/OpenEffects/ExMDF.cs new file mode 100644 index 0000000..06441de --- /dev/null +++ b/OshimaModules/OpenEffects/ExMDF.cs @@ -0,0 +1,115 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExMDF : Effect + { + public override long Id => (long)EffectID.ExMDF; + public override string Name => "魔法抗性加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% {CharacterSet.GetMagicResistanceName(魔法类型)}。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + private readonly MagicType 魔法类型 = MagicType.None; + + public override void OnEffectGained(Character character) + { + switch (魔法类型) + { + case MagicType.Starmark: + character.MDF.Starmark += 实际加成; + break; + case MagicType.PurityNatural: + character.MDF.PurityNatural += 实际加成; + break; + case MagicType.PurityContemporary: + character.MDF.PurityContemporary += 实际加成; + break; + case MagicType.Bright: + character.MDF.Bright += 实际加成; + break; + case MagicType.Shadow: + character.MDF.Shadow += 实际加成; + break; + case MagicType.Element: + character.MDF.Element += 实际加成; + break; + case MagicType.Fleabane: + character.MDF.Fleabane += 实际加成; + break; + case MagicType.Particle: + character.MDF.Particle += 实际加成; + break; + case MagicType.None: + default: + character.MDF.None += 实际加成; + break; + } + } + + public override void OnEffectLost(Character character) + { + switch (魔法类型) + { + case MagicType.Starmark: + character.MDF.Starmark -= 实际加成; + break; + case MagicType.PurityNatural: + character.MDF.PurityNatural -= 实际加成; + break; + case MagicType.PurityContemporary: + character.MDF.PurityContemporary -= 实际加成; + break; + case MagicType.Bright: + character.MDF.Bright -= 实际加成; + break; + case MagicType.Shadow: + character.MDF.Shadow -= 实际加成; + break; + case MagicType.Element: + character.MDF.Element -= 实际加成; + break; + case MagicType.Fleabane: + character.MDF.Fleabane -= 实际加成; + break; + case MagicType.Particle: + character.MDF.Particle -= 实际加成; + break; + case MagicType.None: + default: + character.MDF.None -= 实际加成; + break; + } + } + + public ExMDF(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("mdfType", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && int.TryParse(skill.OtherArgs[key].ToString(), out int mdfType)) + { + if (Enum.IsDefined(typeof(MagicType), mdfType)) + { + 魔法类型 = (MagicType)mdfType; + } + else + { + 魔法类型 = MagicType.None; + } + } + key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("mdfvalue", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double mdfValue)) + { + 实际加成 = mdfValue; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExMR.cs b/OshimaModules/OpenEffects/ExMR.cs new file mode 100644 index 0000000..ad009e4 --- /dev/null +++ b/OshimaModules/OpenEffects/ExMR.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExMR : Effect + { + public override long Id => (long)EffectID.ExMR; + public override string Name => "魔法回复加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点魔法回复。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExMR += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExMR -= 实际加成; + } + + public ExMR(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exmr", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exMR)) + { + 实际加成 = exMR; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExMaxHP.cs b/OshimaModules/OpenEffects/ExMaxHP.cs new file mode 100644 index 0000000..fd709f5 --- /dev/null +++ b/OshimaModules/OpenEffects/ExMaxHP.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExMaxHP : Effect + { + public override long Id => (long)EffectID.ExMaxHP; + public override string Name => "最大生命值加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点最大生命值。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExHP2 += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExHP2 -= 实际加成; + } + + public ExMaxHP(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exhp", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exHP)) + { + 实际加成 = exHP; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExMaxMP.cs b/OshimaModules/OpenEffects/ExMaxMP.cs new file mode 100644 index 0000000..1f80322 --- /dev/null +++ b/OshimaModules/OpenEffects/ExMaxMP.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExMaxMP : Effect + { + public override long Id => (long)EffectID.ExMaxMP; + public override string Name => "最大魔法值加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点最大魔法值。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExMP2 += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExMP2 -= 实际加成; + } + + public ExMaxMP(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exmp", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exMP)) + { + 实际加成 = exMP; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExPDR.cs b/OshimaModules/OpenEffects/ExPDR.cs new file mode 100644 index 0000000..10e2d6b --- /dev/null +++ b/OshimaModules/OpenEffects/ExPDR.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExPDR : Effect + { + public override long Id => (long)EffectID.ExPDR; + public override string Name => "物理伤害减免加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 物理伤害减免。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExPDR += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExPDR -= 实际加成; + } + + public ExPDR(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("expdr", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exPDR)) + { + 实际加成 = exPDR; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExSPD.cs b/OshimaModules/OpenEffects/ExSPD.cs new file mode 100644 index 0000000..593059c --- /dev/null +++ b/OshimaModules/OpenEffects/ExSPD.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExSPD : Effect + { + public override long Id => (long)EffectID.ExSPD; + public override string Name => "行动速度加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点行动速度。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExSPD += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExSPD -= 实际加成; + } + + public ExSPD(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exspd", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exSPD)) + { + 实际加成 = exSPD; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/ExSTR.cs b/OshimaModules/OpenEffects/ExSTR.cs new file mode 100644 index 0000000..31fff98 --- /dev/null +++ b/OshimaModules/OpenEffects/ExSTR.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class ExSTR : Effect + { + public override long Id => (long)EffectID.ExSTR; + public override string Name => "力量加成"; + public override string Description => $"增加角色 {实际加成:0.##} 点力量。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.ExDEF2 += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.ExDEF2 -= 实际加成; + } + + public ExSTR(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exstr", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exSTR)) + { + 实际加成 = exSTR; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/MagicalPenetration.cs b/OshimaModules/OpenEffects/MagicalPenetration.cs new file mode 100644 index 0000000..97c3d85 --- /dev/null +++ b/OshimaModules/OpenEffects/MagicalPenetration.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class MagicalPenetration : Effect + { + public override long Id => (long)EffectID.MagicalPenetration; + public override string Name => "魔法穿透加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 魔法穿透。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.MagicalPenetration += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.MagicalPenetration -= 实际加成; + } + + public MagicalPenetration(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exmp", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exMP)) + { + 实际加成 = exMP; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/NormalAttackHardTimeReduce.cs b/OshimaModules/OpenEffects/NormalAttackHardTimeReduce.cs new file mode 100644 index 0000000..95deee0 --- /dev/null +++ b/OshimaModules/OpenEffects/NormalAttackHardTimeReduce.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class NormalAttackHardTimeReduce : Effect + { + public override long Id => (long)EffectID.NormalAttackHardTimeReduce; + public override string Name => Skill.Name; + public override string Description => $"减少角色的普通攻击 {实际硬直时间减少:0.##} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际硬直时间减少 = 0; + + public override void OnEffectGained(Character character) + { + character.NormalAttack.HardnessTime -= 实际硬直时间减少; + } + + public override void OnEffectLost(Character character) + { + character.NormalAttack.HardnessTime += 实际硬直时间减少; + } + + public NormalAttackHardTimeReduce(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("nahtr", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double nahtr)) + { + 实际硬直时间减少 = nahtr; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/PhysicalPenetration.cs b/OshimaModules/OpenEffects/PhysicalPenetration.cs new file mode 100644 index 0000000..d82fe53 --- /dev/null +++ b/OshimaModules/OpenEffects/PhysicalPenetration.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class PhysicalPenetration : Effect + { + public override long Id => (long)EffectID.PhysicalPenetration; + public override string Name => "物理穿透加成"; + public override string Description => $"增加角色 {实际加成 * 100:0.##}% 物理穿透。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际加成 = 0; + + public override void OnEffectGained(Character character) + { + character.PhysicalPenetration += 实际加成; + } + + public override void OnEffectLost(Character character) + { + character.PhysicalPenetration -= 实际加成; + } + + public PhysicalPenetration(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("expp", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exPP)) + { + 实际加成 = exPP; + } + } + } + } +} diff --git a/OshimaModules/OpenEffects/SkillHardTimeReduce.cs b/OshimaModules/OpenEffects/SkillHardTimeReduce.cs new file mode 100644 index 0000000..19b2ad7 --- /dev/null +++ b/OshimaModules/OpenEffects/SkillHardTimeReduce.cs @@ -0,0 +1,58 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; + +namespace Oshima.FunGame.OshimaModules.OpenEffects +{ + public class SkillHardTimeReduce : Effect + { + public override long Id => (long)EffectID.SkillHardTimeReduce; + public override string Name => Skill.Name; + public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少:0.##} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : ""); + public override EffectType EffectType => EffectType.Item; + public override bool TargetSelf => true; + + public Item? Item { get; } + private readonly double 实际硬直时间减少 = 0; + + public override void OnEffectGained(Character character) + { + foreach (Skill s in character.Skills) + { + s.HardnessTime -= 实际硬直时间减少; + } + foreach (Skill? s in character.Items.Select(i => i.Skills.Active)) + { + if (s != null) + s.HardnessTime -= 实际硬直时间减少; + } + } + + public override void OnEffectLost(Character character) + { + foreach (Skill s in character.Skills) + { + s.HardnessTime += 实际硬直时间减少; + } + foreach (Skill? s in character.Items.Select(i => i.Skills.Active)) + { + if (s != null) + s.HardnessTime += 实际硬直时间减少; + } + } + + public SkillHardTimeReduce(Skill skill, Character? source, Item? item) : base(skill) + { + GamingQueue = skill.GamingQueue; + Source = source; + Item = item; + if (skill.OtherArgs.Count > 0) + { + string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("shtr", StringComparison.CurrentCultureIgnoreCase)) ?? ""; + if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double shtr)) + { + 实际硬直时间减少 = shtr; + } + } + } + } +}