mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-22 03:49:35 +08:00
添加技能
This commit is contained in:
parent
e06975f872
commit
6019c53a70
@ -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
|
||||
|
@ -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<Item> 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)
|
||||
{
|
||||
|
42
OshimaModules/Effects/SkillEffects/提升友方行动速度.cs
Normal file
42
OshimaModules/Effects/SkillEffects/提升友方行动速度.cs
Normal file
@ -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<Character> targets, Dictionary<string, object> others)
|
||||
{
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {target} ] 的行动速度提升了 {SPD:0.##} !持续时间:{持续时间}!");
|
||||
ExSPD e = new(Skill, new Dictionary<string, object>()
|
||||
{
|
||||
{ "exspd", SPD }
|
||||
}, caster);
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(target);
|
||||
GamingQueue?.LastRound.Effects.TryAdd(target, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
42
OshimaModules/Effects/SkillEffects/降低敌方行动速度.cs
Normal file
42
OshimaModules/Effects/SkillEffects/降低敌方行动速度.cs
Normal file
@ -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<Character> targets, Dictionary<string, object> others)
|
||||
{
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {target} ] 的行动速度降低了 {SPD:0.##} !持续时间:{持续时间}!");
|
||||
ExSPD e = new(Skill, new Dictionary<string, object>()
|
||||
{
|
||||
{ "exspd", SPD }
|
||||
}, caster);
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(target);
|
||||
GamingQueue?.LastRound.Effects.TryAdd(target, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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 天赐之力(),
|
||||
|
24
OshimaModules/Skills/魔法/时间减速.cs
Normal file
24
OshimaModules/Skills/魔法/时间减速.cs
Normal file
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
28
OshimaModules/Skills/魔法/时间加速.cs
Normal file
28
OshimaModules/Skills/魔法/时间加速.cs
Normal file
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user