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)); + } + } +}