From 6019c53a70a81af08a06bf4c0da8fbe8d661d078 Mon Sep 17 00:00:00 2001 From: milimoe Date: Tue, 19 Nov 2024 23:26:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8A=80=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OshimaCore/Controllers/FunGameController.cs | 16 ++----- OshimaCore/Utils/FunGameService.cs | 5 ++- .../Effects/SkillEffects/提升友方行动速度.cs | 42 +++++++++++++++++++ .../Effects/SkillEffects/降低敌方行动速度.cs | 42 +++++++++++++++++++ OshimaModules/Modules/SkillModule.cs | 2 + OshimaModules/Skills/魔法/时间减速.cs | 24 +++++++++++ OshimaModules/Skills/魔法/时间加速.cs | 28 +++++++++++++ 7 files changed, 146 insertions(+), 13 deletions(-) create mode 100644 OshimaModules/Effects/SkillEffects/提升友方行动速度.cs create mode 100644 OshimaModules/Effects/SkillEffects/降低敌方行动速度.cs create mode 100644 OshimaModules/Skills/魔法/时间减速.cs create mode 100644 OshimaModules/Skills/魔法/时间加速.cs diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index c7ca4d3..34e3ff1 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -690,17 +690,9 @@ namespace Oshima.Core.Controllers { User user = FunGameService.GetUser(pc); - int reduce = useMaterials > 0 && useMaterials > 10 ? (int)useMaterials : 10; - - if (reduce % 10 != 0 && reduce > reduce % 10) - { - reduce -= reduce % 10; - } - else - { - return NetworkUtility.JsonSerialize($"{General.GameplayEquilibriumConstant.InGameMaterial} {reduce}һʧܣ"); - } - if (user.Inventory.Materials >= reduce) + int reduce = (int)useMaterials >= 10 ? (int)useMaterials : 10; + reduce -= reduce % 10; + if (reduce >= 10 && user.Inventory.Materials >= reduce) { int reward = reduce / 10 * 2000; user.Inventory.Credits += reward; @@ -711,7 +703,7 @@ namespace Oshima.Core.Controllers } else { - return NetworkUtility.JsonSerialize($"{General.GameplayEquilibriumConstant.InGameMaterial} {reduce}һʧܣ"); + return NetworkUtility.JsonSerialize($"{General.GameplayEquilibriumConstant.InGameMaterial} {reduce} 10 {General.GameplayEquilibriumConstant.InGameMaterial}һ 2000 {General.GameplayEquilibriumConstant.InGameCurrency}"); } } else diff --git a/OshimaCore/Utils/FunGameService.cs b/OshimaCore/Utils/FunGameService.cs index c33cc9c..60f5989 100644 --- a/OshimaCore/Utils/FunGameService.cs +++ b/OshimaCore/Utils/FunGameService.cs @@ -41,7 +41,8 @@ namespace Oshima.Core.Utils Skills.AddRange([new 疾风步()]); - Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(), new 回复术(), new 治愈术()]); + Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(), new 回复术(), new 治愈术(), + new 时间加速(), new 时间减速()]); } public static List GenerateMagicCards(int count, QualityType? qualityType = null) @@ -554,6 +555,7 @@ namespace Oshima.Core.Utils break; case 6: + if ((int)type > (int)QualityType.Orange) type = QualityType.Orange; Item mfk = GenerateMagicCard(type); SetSellAndTradeTime(mfk); user.Inventory.Items.Add(mfk); @@ -562,6 +564,7 @@ namespace Oshima.Core.Utils case 0: default: + if ((int)type > (int)QualityType.Orange) type = QualityType.Orange; Item? mfkb = GenerateMagicCardPack(3, type); if (mfkb != null) { diff --git a/OshimaModules/Effects/SkillEffects/提升友方行动速度.cs b/OshimaModules/Effects/SkillEffects/提升友方行动速度.cs new file mode 100644 index 0000000..89aaa67 --- /dev/null +++ b/OshimaModules/Effects/SkillEffects/提升友方行动速度.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Oshima.FunGame.OshimaModules.Effects.OpenEffects; + +namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects +{ + public class 提升友方行动速度 : Effect + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"提升目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}友方角色 {SPD:0.##} 点行动速度。"; + + private double SPD { get; set; } = 0; + private string 持续时间 => _durative && _duration > 0 ? _duration + " 时间" : (!_durative && _durationTurn > 0 ? _durationTurn + " 回合" : "0 时间"); + private readonly bool _durative; + private readonly double _duration; + private readonly int _durationTurn; + + public 提升友方行动速度(Skill skill, double spd, bool durative = true, double duration = 40, int durationTurn = 0) : base(skill) + { + GamingQueue = skill.GamingQueue; + SPD = Math.Abs(spd); + _durative = durative; + _duration = duration; + _durationTurn = durationTurn; + } + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + foreach (Character target in targets) + { + WriteLine($"[ {target} ] 的行动速度提升了 {SPD:0.##} !持续时间:{持续时间}!"); + ExSPD e = new(Skill, new Dictionary() + { + { "exspd", SPD } + }, caster); + target.Effects.Add(e); + e.OnEffectGained(target); + GamingQueue?.LastRound.Effects.TryAdd(target, e.EffectType); + } + } + } +} diff --git a/OshimaModules/Effects/SkillEffects/降低敌方行动速度.cs b/OshimaModules/Effects/SkillEffects/降低敌方行动速度.cs new file mode 100644 index 0000000..2d672b8 --- /dev/null +++ b/OshimaModules/Effects/SkillEffects/降低敌方行动速度.cs @@ -0,0 +1,42 @@ +using Milimoe.FunGame.Core.Entity; +using Oshima.FunGame.OshimaModules.Effects.OpenEffects; + +namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects +{ + public class 降低敌方行动速度 : Effect + { + public override long Id => Skill.Id; + public override string Name => Skill.Name; + public override string Description => $"降低目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人 {SPD:0.##} 点行动速度。"; + + private double SPD { get; set; } = 0; + private string 持续时间 => _durative && _duration > 0 ? _duration + " 时间" : (!_durative && _durationTurn > 0 ? _durationTurn + " 回合" : "0 时间"); + private readonly bool _durative; + private readonly double _duration; + private readonly int _durationTurn; + + public 降低敌方行动速度(Skill skill, double spd, bool durative = true, double duration = 40, int durationTurn = 0) : base(skill) + { + GamingQueue = skill.GamingQueue; + SPD = -Math.Abs(spd); + _durative = durative; + _duration = duration; + _durationTurn = durationTurn; + } + + public override void OnSkillCasted(Character caster, List targets, Dictionary others) + { + foreach (Character target in targets) + { + WriteLine($"[ {target} ] 的行动速度降低了 {SPD:0.##} !持续时间:{持续时间}!"); + ExSPD e = new(Skill, new Dictionary() + { + { "exspd", SPD } + }, caster); + target.Effects.Add(e); + e.OnEffectGained(target); + GamingQueue?.LastRound.Effects.TryAdd(target, e.EffectType); + } + } + } +} diff --git a/OshimaModules/Modules/SkillModule.cs b/OshimaModules/Modules/SkillModule.cs index 982ca53..2cde3e3 100644 --- a/OshimaModules/Modules/SkillModule.cs +++ b/OshimaModules/Modules/SkillModule.cs @@ -38,6 +38,8 @@ namespace Oshima.FunGame.OshimaModules (long)MagicID.暗物质 => new 暗物质(), (long)MagicID.回复术 => new 回复术(), (long)MagicID.治愈术 => new 治愈术(), + (long)MagicID.时间加速 => new 时间加速(), + (long)MagicID.时间减速 => new 时间减速(), (long)SkillID.疾风步 => new 疾风步(), (long)SuperSkillID.力量爆发 => new 力量爆发(), (long)SuperSkillID.天赐之力 => new 天赐之力(), diff --git a/OshimaModules/Skills/魔法/时间减速.cs b/OshimaModules/Skills/魔法/时间减速.cs new file mode 100644 index 0000000..b733cf7 --- /dev/null +++ b/OshimaModules/Skills/魔法/时间减速.cs @@ -0,0 +1,24 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.SkillEffects; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 时间减速 : Skill + { + public override long Id => (long)MagicID.时间减速; + public override string Name => "时间减速"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => Level > 0 ? 110 + (100 * (Level - 1)) : 110; + public override double CD => Level > 0 ? 60 - (1 * (Level - 1)) : 60; + public override double CastTime => Level > 0 ? 7 + (1.5 * (Level - 1)) : 7; + public override double HardnessTime { get; set; } = 8; + + private double SPD => Level > 0 ? 30 + 20 * (Level - 1) : 30; + + public 时间减速(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 降低敌方行动速度(this, SPD)); + } + } +} diff --git a/OshimaModules/Skills/魔法/时间加速.cs b/OshimaModules/Skills/魔法/时间加速.cs new file mode 100644 index 0000000..7b47c88 --- /dev/null +++ b/OshimaModules/Skills/魔法/时间加速.cs @@ -0,0 +1,28 @@ +using Milimoe.FunGame.Core.Entity; +using Milimoe.FunGame.Core.Library.Constant; +using Oshima.FunGame.OshimaModules.Effects.SkillEffects; + +namespace Oshima.FunGame.OshimaModules.Skills +{ + public class 时间加速 : Skill + { + public override long Id => (long)MagicID.时间加速; + public override string Name => "时间加速"; + public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; + public override double MPCost => Level > 0 ? 100 + (115 * (Level - 1)) : 100; + public override double CD => Level > 0 ? 75 - (1 * (Level - 1)) : 75; + public override double CastTime => Level > 0 ? 2 + (1.5 * (Level - 1)) : 2; + public override double HardnessTime { get; set; } = 6; + public override bool CanSelectSelf => true; + public override bool CanSelectEnemy => false; + public override bool CanSelectTeammate => true; + public override int CanSelectTargetCount => 1; + + private double SPD => Level > 0 ? 65 + 25 * (Level - 1) : 65; + + public 时间加速(Character? character = null) : base(SkillType.Magic, character) + { + Effects.Add(new 提升友方行动速度(this, SPD)); + } + } +}