添加技能

This commit is contained in:
milimoe 2024-11-19 23:26:12 +08:00
parent e06975f872
commit 6019c53a70
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
7 changed files with 146 additions and 13 deletions

View File

@ -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

View File

@ -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)
{

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

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

View File

@ -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 (),

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

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