添加 OpenEffects

This commit is contained in:
milimoe 2024-10-24 01:13:51 +08:00
parent 48e40f864d
commit b2368e54a4
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
27 changed files with 1370 additions and 111 deletions

View File

@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging;
using Milimoe.FunGame.Core.Api.Transmittal;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Library.Exception;
using Milimoe.FunGame.Core.Library.SQLScript.Common;
using Oshima.Core.Constant;
namespace Oshima.Core.Controllers
@ -30,7 +31,7 @@ namespace Oshima.Core.Controllers
SQLHelper? sql = Statics.RunningPlugin.SQLHelper;
if (sql != null)
{
sql.ExecuteDataSet("Select Max(LoginTime) LastTime From ServerLoginLogs");
sql.ExecuteDataSet(ServerLoginLogs.Select_GetLastLoginTime());
if (sql.Success && DateTime.TryParse(sql.DataSet.Tables[0].Rows[0]["LastTime"].ToString(), out DateTime date))
{
string month = date.ToString("MMM", CultureInfo.InvariantCulture);

View File

@ -0,0 +1,154 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Items;
using Oshima.FunGame.OshimaModules.OpenEffects;
using Oshima.FunGame.OshimaModules.Skills;
namespace Oshima.FunGame.OshimaModules
{
public class EntityFactory
{
public static Skill? GetSkill(long id, SkillType type)
{
if (type == SkillType.Magic)
{
switch ((MagicID)id)
{
case MagicID.:
return new ();
}
}
if (type == SkillType.Skill)
{
switch ((SkillID)id)
{
case SkillID.:
return new ();
}
}
if (type == SkillType.SuperSkill)
{
switch ((SuperSkillID)id)
{
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
}
}
if (type == SkillType.Passive)
{
switch ((PassiveID)id)
{
case PassiveID.META马:
return new META马();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
}
switch ((ItemPassiveID)id)
{
case ItemPassiveID.:
return new ();
}
}
return null;
}
public static Item? GetItem(long id, ItemType type)
{
if (type == ItemType.MagicCardPack)
{
}
if (type == ItemType.Accessory)
{
switch ((AccessoryID)id)
{
case AccessoryID.10:
return new 10();
case AccessoryID.30:
return new 30();
case AccessoryID.50:
return new 50();
}
}
return null;
}
public static Effect? GetEffect(long id, Skill skill, Character? source = null, Item? item = null)
{
return (EffectID)id switch
{
EffectID.ExATK => new ExATK(skill, source, item),
EffectID.ExDEF => new ExDEF(skill, source, item),
EffectID.ExSTR => new ExSTR(skill, source, item),
EffectID.ExAGI => new ExAGI(skill, source, item),
EffectID.ExINT => new ExINT(skill, source, item),
EffectID.SkillHardTimeReduce => new SkillHardTimeReduce(skill, source, item),
EffectID.NormalAttackHardTimeReduce => new NormalAttackHardTimeReduce(skill, source, item),
EffectID.AccelerationCoefficient => new AccelerationCoefficient(skill, source, item),
EffectID.ExSPD => new ExSPD(skill, source, item),
EffectID.ExActionCoefficient => new ExActionCoefficient(skill, source, item),
EffectID.ExCDR => new ExCDR(skill, source, item),
EffectID.ExMaxHP => new ExMaxHP(skill, source, item),
EffectID.ExMaxMP => new ExMaxMP(skill, source, item),
EffectID.ExCritRate => new ExCritRate(skill, source, item),
EffectID.ExCritDMG => new ExCritDMG(skill, source, item),
EffectID.ExEvadeRate => new ExEvadeRate(skill, source, item),
EffectID.PhysicalPenetration => new PhysicalPenetration(skill, source, item),
EffectID.MagicalPenetration => new MagicalPenetration(skill, source, item),
EffectID.ExPDR => new ExPDR(skill, source, item),
EffectID.ExMDF => new ExMDF(skill, source, item),
EffectID.ExHR => new ExHR(skill, source, item),
EffectID.ExMR => new ExMR(skill, source, item),
_ => null
};
}
}
}

View File

@ -1,7 +1,6 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Items;
namespace Oshima.FunGame.OshimaModules
{
@ -27,32 +26,88 @@ namespace Oshima.FunGame.OshimaModules
prev.SetPropertyToItemModuleNew(next);
config[key] = next;
}
Item item = config[key];
HashSet<Skill> skills = item.Skills.Passives;
if (item.Skills.Active != null) skills.Add(item.Skills.Active);
List<Skill> skilllist = [.. skills];
foreach (Skill skill in skilllist)
{
Skill? newSkill = EntityFactory.GetSkill(skill.Id, skill.SkillType);
if (newSkill != null)
{
if (newSkill.IsActive)
{
item.Skills.Active = newSkill;
}
else
{
item.Skills.Passives.Remove(skill);
item.Skills.Passives.Add(newSkill);
}
}
Skill s = newSkill ?? skill;
List<Effect> effects = [.. s.Effects];
foreach (Effect effect in effects)
{
skill.Effects.Remove(effect);
Effect? newEffect = EntityFactory.GetEffect(effect.Id, skill);
if (newEffect != null)
{
skill.Effects.Add(newEffect);
}
}
}
}
return [.. config.Values];
}
}
public override Item? GetItem(long id, string name, ItemType type)
protected override void AfterLoad()
{
if (type == ItemType.MagicCardPack)
Factory.OpenFactory.RegisterFactory(args =>
{
if (args.TryGetValue("id", out object? value) && value is long id && args.TryGetValue("itemtype", out value) && value is int type)
{
Item? item = EntityFactory.GetItem(id, (ItemType)type);
if (item != null)
{
HashSet<Skill> skills = item.Skills.Passives;
if (item.Skills.Active != null) skills.Add(item.Skills.Active);
List<Skill> skilllist = [.. skills];
foreach (Skill skill in skilllist)
{
item.Skills.Passives.Remove(skill);
Skill newSkill = EntityFactory.GetSkill(skill.Id, skill.SkillType) ?? new OpenSkill(skill.Id, skill.Name);
if (newSkill != null)
{
if (newSkill.IsActive)
{
item.Skills.Active = newSkill;
}
if (type == ItemType.Accessory)
else
{
switch ((AccessoryID)id)
{
case AccessoryID.10:
return new 10();
case AccessoryID.30:
return new 30();
case AccessoryID.50:
return new 50();
item.Skills.Passives.Add(newSkill);
}
}
Skill s = newSkill ?? skill;
List<Effect> effects = [.. s.Effects];
foreach (Effect effect in effects)
{
skill.Effects.Remove(effect);
Effect? newEffect = EntityFactory.GetEffect(effect.Id, skill);
if (newEffect != null)
{
skill.Effects.Add(newEffect);
}
}
}
return item;
}
}
return null;
}
});
}
public override Item? GetItem(long id, string name, ItemType type) => EntityFactory.GetItem(id, type);
}
}

View File

@ -1,8 +1,6 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Items;
using Oshima.FunGame.OshimaModules.Skills;
namespace Oshima.FunGame.OshimaModules
{
@ -22,104 +20,27 @@ namespace Oshima.FunGame.OshimaModules
foreach (string key in config.Keys)
{
Skill prev = config[key];
Skill? next = GetSkill(prev.Id, prev.Name, prev.SkillType);
Skill? next = EntityFactory.GetSkill(prev.Id, prev.SkillType);
if (next != null)
{
config[key] = next;
}
Skill skill = config[key];
List<Effect> effects = [.. skill.Effects];
foreach (Effect effect in effects)
{
Effect? newEffect = EntityFactory.GetEffect(effect.Id, skill);
if (newEffect != null)
{
skill.Effects.Remove(effect);
skill.Effects.Add(newEffect);
}
}
}
return [.. config.Values];
}
}
public override Skill? GetSkill(long id, string name, SkillType type)
{
if (type == SkillType.Magic)
{
switch ((MagicID)id)
{
case MagicID.:
return new ();
}
}
if (type == SkillType.Skill)
{
switch ((SkillID)id)
{
case SkillID.:
return new ();
}
}
if (type == SkillType.SuperSkill)
{
switch ((SuperSkillID)id)
{
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
case SuperSkillID.:
return new ();
}
}
if (type == SkillType.Passive)
{
switch ((PassiveID)id)
{
case PassiveID.META马:
return new META马();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
case PassiveID.:
return new ();
}
switch ((ItemPassiveID)id)
{
case ItemPassiveID.:
return new ();
}
}
return null;
}
public override Skill? GetSkill(long id, string name, SkillType type) => EntityFactory.GetSkill(id, type);
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class AccelerationCoefficient : Effect
{
public override long Id => (long)EffectID.AccelerationCoefficient;
public override string Name => "加速系数加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 加速系数。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.AccelerationCoefficient += ;
}
public override void OnEffectLost(Character character)
{
character.AccelerationCoefficient -= ;
}
public AccelerationCoefficient(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exacc", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exACC))
{
= exACC;
}
}
}
}
}

View File

@ -0,0 +1,115 @@
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public enum EffectID : long
{
/// <summary>
/// exatk
/// </summary>
ExATK = 8001,
/// <summary>
/// exdef
/// </summary>
ExDEF = 8002,
/// <summary>
/// exstr
/// </summary>
ExSTR = 8003,
/// <summary>
/// exagi
/// </summary>
ExAGI = 8004,
/// <summary>
/// exint
/// </summary>
ExINT = 8005,
/// <summary>
/// shtr
/// </summary>
SkillHardTimeReduce = 8006,
/// <summary>
/// nahtr
/// </summary>
NormalAttackHardTimeReduce = 8007,
/// <summary>
/// exacc
/// </summary>
AccelerationCoefficient = 8008,
/// <summary>
/// exspd
/// </summary>
ExSPD = 8009,
/// <summary>
/// exac
/// </summary>
ExActionCoefficient = 8010,
/// <summary>
/// excdr
/// </summary>
ExCDR = 8011,
/// <summary>
/// exhp
/// </summary>
ExMaxHP = 8012,
/// <summary>
/// exmp
/// </summary>
ExMaxMP = 8013,
/// <summary>
/// excr
/// </summary>
ExCritRate = 8014,
/// <summary>
/// excrd
/// </summary>
ExCritDMG = 8015,
/// <summary>
/// exer
/// </summary>
ExEvadeRate = 8016,
/// <summary>
/// expp
/// </summary>
PhysicalPenetration = 8017,
/// <summary>
/// exmp
/// </summary>
MagicalPenetration = 8018,
/// <summary>
/// expdr
/// </summary>
ExPDR = 8019,
/// <summary>
/// mdftype, mdfvalue
/// </summary>
ExMDF = 8020,
/// <summary>
/// exhr
/// </summary>
ExHR = 8021,
/// <summary>
/// exmr
/// </summary>
ExMR = 8022
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExAGI : Effect
{
public override long Id => (long)EffectID.ExAGI;
public override string Name => "敏捷加成";
public override string Description => $"增加角色 {实际加成:0.##} 点敏捷。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExAGI += ;
}
public override void OnEffectLost(Character character)
{
character.ExAGI -= ;
}
public ExAGI(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exagi", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exAGI))
{
= exAGI;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExATK : Effect
{
public override long Id => (long)EffectID.ExATK;
public override string Name => "攻击力加成";
public override string Description => $"增加角色 {实际加成:0.##} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExATK2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExATK2 -= ;
}
public ExATK(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exatk", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exATK))
{
= exATK;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExActionCoefficient : Effect
{
public override long Id => (long)EffectID.ExActionCoefficient;
public override string Name => "行动系数加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 行动系数。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExActionCoefficient += ;
}
public override void OnEffectLost(Character character)
{
character.ExActionCoefficient -= ;
}
public ExActionCoefficient(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exac", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exAC))
{
= exAC;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExCDR : Effect
{
public override long Id => (long)EffectID.ExCDR;
public override string Name => "冷却缩减加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 冷却缩减。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExCDR += ;
}
public override void OnEffectLost(Character character)
{
character.ExCDR -= ;
}
public ExCDR(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("excdr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exCDR))
{
= exCDR;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExCritDMG : Effect
{
public override long Id => (long)EffectID.ExCritDMG;
public override string Name => "暴击伤害加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 暴击伤害。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExCritDMG += ;
}
public override void OnEffectLost(Character character)
{
character.ExCritDMG -= ;
}
public ExCritDMG(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("excrd", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exCRD))
{
= exCRD;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExCritRate : Effect
{
public override long Id => (long)EffectID.ExCritRate;
public override string Name => "暴击率加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 暴击率。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExCritRate += ;
}
public override void OnEffectLost(Character character)
{
character.ExCritRate -= ;
}
public ExCritRate(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("excr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exCR))
{
= exCR;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExDEF : Effect
{
public override long Id => (long)EffectID.ExDEF;
public override string Name => "物理护甲加成";
public override string Description => $"增加角色 {实际加成:0.##} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExDEF2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExDEF2 -= ;
}
public ExDEF(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exdef", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exDEF))
{
= exDEF;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExEvadeRate : Effect
{
public override long Id => (long)EffectID.ExEvadeRate;
public override string Name => "闪避率加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 闪避率。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExEvadeRate += ;
}
public override void OnEffectLost(Character character)
{
character.ExEvadeRate -= ;
}
public ExEvadeRate(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exer", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exER))
{
= exER;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExHR : Effect
{
public override long Id => (long)EffectID.ExHR;
public override string Name => "生命回复加成";
public override string Description => $"增加角色 {实际加成:0.##} 点生命回复。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExHR += ;
}
public override void OnEffectLost(Character character)
{
character.ExHR -= ;
}
public ExHR(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exhr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exHR))
{
= exHR;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
 using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExINT : Effect
{
public override long Id => (long)EffectID.ExINT;
public override string Name => "智力加成";
public override string Description => $"增加角色 {实际加成:0.##} 点智力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExINT += ;
}
public override void OnEffectLost(Character character)
{
character.ExINT -= ;
}
public ExINT(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exint", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exINT))
{
= exINT;
}
}
}
}
}

View File

@ -0,0 +1,115 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExMDF : Effect
{
public override long Id => (long)EffectID.ExMDF;
public override string Name => "魔法抗性加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% {CharacterSet.GetMagicResistanceName(魔法类型)}。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
private readonly MagicType = MagicType.None;
public override void OnEffectGained(Character character)
{
switch ()
{
case MagicType.Starmark:
character.MDF.Starmark += ;
break;
case MagicType.PurityNatural:
character.MDF.PurityNatural += ;
break;
case MagicType.PurityContemporary:
character.MDF.PurityContemporary += ;
break;
case MagicType.Bright:
character.MDF.Bright += ;
break;
case MagicType.Shadow:
character.MDF.Shadow += ;
break;
case MagicType.Element:
character.MDF.Element += ;
break;
case MagicType.Fleabane:
character.MDF.Fleabane += ;
break;
case MagicType.Particle:
character.MDF.Particle += ;
break;
case MagicType.None:
default:
character.MDF.None += ;
break;
}
}
public override void OnEffectLost(Character character)
{
switch ()
{
case MagicType.Starmark:
character.MDF.Starmark -= ;
break;
case MagicType.PurityNatural:
character.MDF.PurityNatural -= ;
break;
case MagicType.PurityContemporary:
character.MDF.PurityContemporary -= ;
break;
case MagicType.Bright:
character.MDF.Bright -= ;
break;
case MagicType.Shadow:
character.MDF.Shadow -= ;
break;
case MagicType.Element:
character.MDF.Element -= ;
break;
case MagicType.Fleabane:
character.MDF.Fleabane -= ;
break;
case MagicType.Particle:
character.MDF.Particle -= ;
break;
case MagicType.None:
default:
character.MDF.None -= ;
break;
}
}
public ExMDF(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("mdfType", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && int.TryParse(skill.OtherArgs[key].ToString(), out int mdfType))
{
if (Enum.IsDefined(typeof(MagicType), mdfType))
{
= (MagicType)mdfType;
}
else
{
= MagicType.None;
}
}
key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("mdfvalue", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double mdfValue))
{
= mdfValue;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExMR : Effect
{
public override long Id => (long)EffectID.ExMR;
public override string Name => "魔法回复加成";
public override string Description => $"增加角色 {实际加成:0.##} 点魔法回复。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExMR += ;
}
public override void OnEffectLost(Character character)
{
character.ExMR -= ;
}
public ExMR(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exmr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exMR))
{
= exMR;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExMaxHP : Effect
{
public override long Id => (long)EffectID.ExMaxHP;
public override string Name => "最大生命值加成";
public override string Description => $"增加角色 {实际加成:0.##} 点最大生命值。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExHP2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExHP2 -= ;
}
public ExMaxHP(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exhp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exHP))
{
= exHP;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExMaxMP : Effect
{
public override long Id => (long)EffectID.ExMaxMP;
public override string Name => "最大魔法值加成";
public override string Description => $"增加角色 {实际加成:0.##} 点最大魔法值。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExMP2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExMP2 -= ;
}
public ExMaxMP(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exmp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exMP))
{
= exMP;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExPDR : Effect
{
public override long Id => (long)EffectID.ExPDR;
public override string Name => "物理伤害减免加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 物理伤害减免。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExPDR += ;
}
public override void OnEffectLost(Character character)
{
character.ExPDR -= ;
}
public ExPDR(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("expdr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exPDR))
{
= exPDR;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExSPD : Effect
{
public override long Id => (long)EffectID.ExSPD;
public override string Name => "行动速度加成";
public override string Description => $"增加角色 {实际加成:0.##} 点行动速度。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExSPD += ;
}
public override void OnEffectLost(Character character)
{
character.ExSPD -= ;
}
public ExSPD(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exspd", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exSPD))
{
= exSPD;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class ExSTR : Effect
{
public override long Id => (long)EffectID.ExSTR;
public override string Name => "力量加成";
public override string Description => $"增加角色 {实际加成:0.##} 点力量。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExDEF2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExDEF2 -= ;
}
public ExSTR(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exstr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exSTR))
{
= exSTR;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class MagicalPenetration : Effect
{
public override long Id => (long)EffectID.MagicalPenetration;
public override string Name => "魔法穿透加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 魔法穿透。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.MagicalPenetration += ;
}
public override void OnEffectLost(Character character)
{
character.MagicalPenetration -= ;
}
public MagicalPenetration(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("exmp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exMP))
{
= exMP;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class NormalAttackHardTimeReduce : Effect
{
public override long Id => (long)EffectID.NormalAttackHardTimeReduce;
public override string Name => Skill.Name;
public override string Description => $"减少角色的普通攻击 {实际硬直时间减少:0.##} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.NormalAttack.HardnessTime -= ;
}
public override void OnEffectLost(Character character)
{
character.NormalAttack.HardnessTime += ;
}
public NormalAttackHardTimeReduce(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("nahtr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double nahtr))
{
= nahtr;
}
}
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class PhysicalPenetration : Effect
{
public override long Id => (long)EffectID.PhysicalPenetration;
public override string Name => "物理穿透加成";
public override string Description => $"增加角色 {实际加成 * 100:0.##}% 物理穿透。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.PhysicalPenetration += ;
}
public override void OnEffectLost(Character character)
{
character.PhysicalPenetration -= ;
}
public PhysicalPenetration(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("expp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double exPP))
{
= exPP;
}
}
}
}
}

View File

@ -0,0 +1,58 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.OpenEffects
{
public class SkillHardTimeReduce : Effect
{
public override long Id => (long)EffectID.SkillHardTimeReduce;
public override string Name => Skill.Name;
public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少:0.##} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item? Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
foreach (Skill s in character.Skills)
{
s.HardnessTime -= ;
}
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
{
if (s != null)
s.HardnessTime -= ;
}
}
public override void OnEffectLost(Character character)
{
foreach (Skill s in character.Skills)
{
s.HardnessTime += ;
}
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
{
if (s != null)
s.HardnessTime += ;
}
}
public SkillHardTimeReduce(Skill skill, Character? source, Item? item) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
string key = skill.OtherArgs.Keys.FirstOrDefault(s => s.Equals("shtr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
if (key.Length > 0 && double.TryParse(skill.OtherArgs[key].ToString(), out double shtr))
{
= shtr;
}
}
}
}
}