chore: initialize OshimaBot repository (rename from Enhancement)
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class GetEP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.GetEP;
|
||||
public override string Name => "立即获得能量值";
|
||||
public override string Description => $"{Skill.TargetDescription()}立即获得 {实际获得:0.##} 点能量值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 实际获得 = 0;
|
||||
|
||||
public GetEP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("ep", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double ep) && ep > 0)
|
||||
{
|
||||
实际获得 = ep;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.EP += 实际获得;
|
||||
WriteLine($"[ {target} ] 获得了 {实际获得:0.##} 点能量值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.EP += 实际获得;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class GetEXP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.GetEXP;
|
||||
public override string Name => "立即获得经验值";
|
||||
public override string Description => $"{Skill.TargetDescription()}立即获得 {实际获得:0.##} 点经验值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 实际获得 = 0;
|
||||
|
||||
public GetEXP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exp) && exp > 0)
|
||||
{
|
||||
实际获得 = exp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.EXP += 实际获得;
|
||||
WriteLine($"[ {target} ] 获得了 {实际获得:0.##} 点经验值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.EXP += 实际获得;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class RecoverHP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.RecoverHP;
|
||||
public override string Name => "立即回复生命值";
|
||||
public override string Description => $"立即回复{Skill.TargetDescription()} {实际回复:0.##} 点生命值({(能复活 ? "" : "不")}可用于复活)。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 实际回复 = 0;
|
||||
private readonly bool 能复活 = false;
|
||||
|
||||
public RecoverHP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("hp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double hp) && hp > 0)
|
||||
{
|
||||
实际回复 = hp;
|
||||
}
|
||||
key = Values.Keys.FirstOrDefault(s => s.Equals("respawn", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && bool.TryParse(Values[key].ToString(), out bool respawn) && respawn)
|
||||
{
|
||||
能复活 = respawn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
HealToTarget(caster, target, 实际回复, 能复活);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.HP += 实际回复;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class RecoverHP2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.RecoverHP2;
|
||||
public override string Name => "立即回复生命值";
|
||||
public override string Description => $"立即回复{Skill.TargetDescription()} {回复比例 * 100:0.##}% 最大生命值({(能复活 ? "" : "不")}可用于复活)。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 回复比例 = 0;
|
||||
private readonly bool 能复活 = false;
|
||||
|
||||
public RecoverHP2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("hp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double hp) && hp > 0)
|
||||
{
|
||||
回复比例 = hp;
|
||||
}
|
||||
key = Values.Keys.FirstOrDefault(s => s.Equals("respawn", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && bool.TryParse(Values[key].ToString(), out bool respawn) && respawn)
|
||||
{
|
||||
能复活 = respawn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
HealToTarget(caster, target, 回复比例 * (target?.MaxHP ?? 0), 能复活);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.HP += 回复比例 * (target?.MaxHP ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class RecoverMP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.RecoverMP;
|
||||
public override string Name => "立即回复魔法值";
|
||||
public override string Description => $"立即回复{Skill.TargetDescription()} {实际回复:0.##} 点魔法值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 实际回复 = 0;
|
||||
|
||||
public RecoverMP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("mp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double mp) && mp > 0)
|
||||
{
|
||||
实际回复 = mp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.MP += 实际回复;
|
||||
WriteLine($"[ {target} ] 回复了 {实际回复:0.##} 点魔法值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.MP += 实际回复;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class RecoverMP2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.RecoverMP2;
|
||||
public override string Name => "立即回复魔法值";
|
||||
public override string Description => $"立即回复{Skill.TargetDescription()} {回复比例 * 100:0.##}% 最大魔法值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 回复比例 = 0;
|
||||
|
||||
public RecoverMP2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("mp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double mp) && mp > 0)
|
||||
{
|
||||
回复比例 = mp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
double mp = 回复比例 * target.MaxMP;
|
||||
target.MP += mp;
|
||||
WriteLine($"[ {target} ] 回复了 {mp:0.##} 点魔法值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.MP += 回复比例 * (target?.MaxHP ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user