测试工厂模式

This commit is contained in:
milimoe 2024-10-25 19:27:00 +08:00
parent 775c90c594
commit 69a6198363
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
58 changed files with 1391 additions and 657 deletions

View File

@ -205,33 +205,33 @@ namespace Milimoe.FunGame.Testing.Desktop.Solutions
public static Skill? (long id, string name, SkillType type)
{
if (GameModuleLoader != null)
{
foreach (SkillModule module in GameModuleLoader.Skills.Values)
{
Skill? s = module.GetSkill(id, name, type);
if (s != null)
{
return s;
}
}
}
//if (GameModuleLoader != null)
//{
// foreach (SkillModule module in GameModuleLoader.Skills.Values)
// {
// Skill? s = module.GetSkill(id, name, type);
// if (s != null)
// {
// return s;
// }
// }
//}
return null;
}
public static Item? (long id, string name, ItemType type)
{
if (GameModuleLoader != null)
{
foreach (ItemModule module in GameModuleLoader.Items.Values)
{
Item? i = module.GetItem(id, name, type);
if (i != null)
{
return i;
}
}
}
//if (GameModuleLoader != null)
//{
// foreach (ItemModule module in GameModuleLoader.Items.Values)
// {
// Item? i = module.GetItem(id, name, type);
// if (i != null)
// {
// return i;
// }
// }
//}
return null;
}

View File

@ -1,7 +1,7 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
namespace Milimoe.FunGame.Testing.ItemEffects
{
public class : Effect
{
@ -24,12 +24,12 @@ namespace Milimoe.FunGame.Testing.Effects
character.ExCDR -= ;
}
public (Skill skill, Character? source, Item? item, double exCdr) : base(skill)
public (Skill skill, double exCdr, Character? source = null, Item? item = null) : base(skill)
{
GamingQueue = skill.GamingQueue;
= exCdr;
Source = source;
Item = item;
= exCdr;
}
}
}

View File

@ -1,14 +1,13 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
namespace Milimoe.FunGame.Testing.ItemEffects
{
public class : Effect
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少:0.##} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
@ -19,12 +18,12 @@ namespace Milimoe.FunGame.Testing.Effects
{
foreach (Skill s in character.Skills)
{
s.HardnessTime = Calculation.Round2Digits(s.HardnessTime - );
s.HardnessTime -= ;
}
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
{
if (s != null)
s.HardnessTime = Calculation.Round2Digits(s.HardnessTime - );
s.HardnessTime -= ;
}
}
@ -32,21 +31,21 @@ namespace Milimoe.FunGame.Testing.Effects
{
foreach (Skill s in character.Skills)
{
s.HardnessTime = Calculation.Round2Digits(s.HardnessTime + );
s.HardnessTime += ;
}
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
{
if (s != null)
s.HardnessTime = Calculation.Round2Digits(s.HardnessTime + );
s.HardnessTime += ;
}
}
public (Skill skill, Character? source, Item? item, double reduce) : base(skill)
public (Skill skill, double reduce, Character? source = null, Item? item = null) : base(skill)
{
GamingQueue = skill.GamingQueue;
= reduce;
Source = source;
Item = item;
= reduce;
}
}
}

View File

@ -1,13 +1,13 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
namespace Milimoe.FunGame.Testing.ItemEffects
{
public class : Effect
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"增加角色 {实际攻击力加成} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override string Description => $"增加角色 {实际攻击力加成:0.##} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
@ -24,12 +24,12 @@ namespace Milimoe.FunGame.Testing.Effects
character.ExATK2 -= ;
}
public (Skill skill, Character? source, Item? item, double exATK) : base(skill)
public (Skill skill, double exATK, Character? source = null, Item? item = null) : base(skill)
{
GamingQueue = skill.GamingQueue;
= exATK;
Source = source;
Item = item;
= exATK;
}
}
}

View File

@ -1,14 +1,13 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
namespace Milimoe.FunGame.Testing.ItemEffects
{
public class : Effect
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"减少角色的普通攻击 {实际硬直时间减少} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override string Description => $"减少角色的普通攻击 {实际硬直时间减少:0.##} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
@ -17,20 +16,20 @@ namespace Milimoe.FunGame.Testing.Effects
public override void OnEffectGained(Character character)
{
character.NormalAttack.HardnessTime = Calculation.Round2Digits(character.NormalAttack.HardnessTime - ); ;
character.NormalAttack.HardnessTime -= ;
}
public override void OnEffectLost(Character character)
{
character.NormalAttack.HardnessTime = Calculation.Round2Digits(character.NormalAttack.HardnessTime + ); ;
character.NormalAttack.HardnessTime += ;
}
public (Skill skill, Character? source, Item? item, double reduce) : base(skill)
public (Skill skill, double reduce, Character? source = null, Item? item = null) : base(skill)
{
GamingQueue = skill.GamingQueue;
= reduce;
Source = source;
Item = item;
= reduce;
}
}
}

View File

@ -1,13 +1,13 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
namespace Milimoe.FunGame.Testing.ItemEffects
{
public class : Effect
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"增加角色 {实际物理护甲加成} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override string Description => $"增加角色 {实际物理护甲加成:0.##} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
@ -24,12 +24,12 @@ namespace Milimoe.FunGame.Testing.Effects
character.ExDEF2 -= ;
}
public (Skill skill, Character? source, Item? item, double exDef) : base(skill)
public (Skill skill, double exDef, Character? source = null, Item? item = null) : base(skill)
{
GamingQueue = skill.GamingQueue;
= exDef;
Source = source;
Item = item;
= exDef;
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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

@ -1,40 +1,40 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
namespace Milimoe.FunGame.Testing.OpenEffects
{
public class ExATK : Effect
{
public override long Id => 8001;
public override long Id => (long)EffectID.ExATK;
public override string Name => "攻击力加成";
public override string Description => $"增加角色 {实际攻击力加成} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.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;
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExATK2 += ;
character.ExATK2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExATK2 -= ;
character.ExATK2 -= ;
}
public ExATK(Skill skill, Character? source, Item? item) : base(skill)
public ExATK(Skill skill, Character? source = null, Item? item = null) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
IEnumerable<string> keys = skill.OtherArgs.Keys.Where(s => s.Equals("exatk", StringComparison.CurrentCultureIgnoreCase));
if (keys.Any() && double.TryParse(skill.OtherArgs[keys.First()].ToString(), out double exATK))
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;
= exATK;
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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

@ -1,40 +1,40 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
namespace Milimoe.FunGame.Testing.OpenEffects
{
public class ExDEF : Effect
{
public override long Id => 8002;
public override long Id => (long)EffectID.ExDEF;
public override string Name => "物理护甲加成";
public override string Description => $"增加角色 {实际物理护甲加成} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.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;
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExDEF2 += ;
character.ExDEF2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExDEF2 -= ;
character.ExDEF2 -= ;
}
public ExDEF(Skill skill, Character? source, Item? item) : base(skill)
public ExDEF(Skill skill, Character? source = null, Item? item = null) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
IEnumerable<string> keys = skill.OtherArgs.Keys.Where(s => s.Equals("exdef", StringComparison.CurrentCultureIgnoreCase));
if (keys.Any() && double.TryParse(skill.OtherArgs[keys.First()].ToString(), out double exDEF))
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;
= exDEF;
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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,123 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.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 += ;
character.MDF.Starmark += ;
character.MDF.PurityNatural += ;
character.MDF.PurityContemporary += ;
character.MDF.Bright += ;
character.MDF.Shadow += ;
character.MDF.Element += ;
character.MDF.Fleabane += ;
character.MDF.Particle += ;
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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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

@ -1,40 +1,40 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
namespace Milimoe.FunGame.Testing.OpenEffects
{
public class ExSTR : Effect
{
public override long Id => 8003;
public override long Id => (long)EffectID.ExSTR;
public override string Name => "力量加成";
public override string Description => $"增加角色 {实际力量加成} 点力量。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.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;
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExDEF2 += ;
character.ExDEF2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExDEF2 -= ;
character.ExDEF2 -= ;
}
public ExSTR(Skill skill, Character? source, Item? item) : base(skill)
public ExSTR(Skill skill, Character? source = null, Item? item = null) : base(skill)
{
GamingQueue = skill.GamingQueue;
Source = source;
Item = item;
if (skill.OtherArgs.Count > 0)
{
IEnumerable<string> keys = skill.OtherArgs.Keys.Where(s => s.Equals("exstr", StringComparison.CurrentCultureIgnoreCase));
if (keys.Any() && double.TryParse(skill.OtherArgs[keys.First()].ToString(), out double exSTR))
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;
= exSTR;
}
}
}

View File

@ -0,0 +1,42 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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 Milimoe.FunGame.Testing.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 = null, Item? item = null) : 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;
}
}
}
}
}

View File

@ -1,7 +1,7 @@
using Milimoe.FunGame.Testing.Effects;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Skills;
using Milimoe.FunGame.Testing.ItemEffects;
namespace Milimoe.FunGame.Testing.Items
{
@ -52,7 +52,7 @@ namespace Milimoe.FunGame.Testing.Items
{
Level = 1;
Item = item;
Effects.Add(new (this, character, item, exATK));
Effects.Add(new (this, exATK, character, item));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()

View File

@ -1,6 +1,6 @@
using Milimoe.FunGame.Testing.Effects;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.ItemEffects;
namespace FunGame.Testing.Items
{
@ -22,7 +22,6 @@ namespace FunGame.Testing.Items
public override long Id => 5002;
public override string Name => "独奏弓";
public override string Description => $"增加角色 {攻击力加成} 点攻击力,减少普通攻击 {硬直时间减少} 硬直时间。";
public Item Item { get; }
private readonly double = 80;
private readonly double = 2;
@ -31,8 +30,8 @@ namespace FunGame.Testing.Items
{
Level = 1;
Item = item;
Effects.Add(new (this, character, item, ));
Effects.Add(new (this, character, item, ));
Effects.Add(new (this, , character, item));
Effects.Add(new (this, , character, item));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Effects;
@ -30,7 +29,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override double Duration => 30;
public HashSet<Character> { get; } = [];
private double => Calculation.Round4Digits(0.03 * Level);
private double => 0.03 * Level;
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
@ -45,9 +44,9 @@ namespace Milimoe.FunGame.Testing.Skills
{
= 4;
}
double = Calculation.Round2Digits( * * damage);
double = * * damage;
character.HP += ;
WriteLine($"[ {character} ] 回复了 {实际吸血} 点生命值!");
WriteLine($"[ {character} ] 回复了 {实际吸血:0.##} 点生命值!");
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Effects;
@ -57,7 +56,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
// 移除标记
enemy.Effects.Remove(e);
double = Calculation.Round2Digits(enemy.MaxHP * );
double = enemy.MaxHP * ;
WriteLine($"[ {character} ] 发动了累积之压!将对 [ {enemy} ] 造成眩晕和额外伤害!");
// 眩晕
IEnumerable<Effect> effects3 = enemy.Effects.Where(e => e is && e.Skill == Skill);

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -39,12 +38,12 @@ namespace Milimoe.FunGame.Testing.Skills
{
= 0;
}
if (character == Skill.Character)
{
double = Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
if ( > 0) WriteLine($"[ {character} ] 的伤害提升了 {实际伤害提升} 点!");
double = damage * ;
damage += ;
if ( > 0) WriteLine($"[ {character} ] 的伤害提升了 {实际伤害提升:0.##} 点!");
}
}
return false;
@ -52,7 +51,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override void OnTimeElapsed(Character character, double eapsed)
{
= Calculation.Round4Digits( + * eapsed);
+= * eapsed;
WriteLine($"[ {character} ] 的 [ {Name} ] 效果增加了,当前总提升:{累计伤害 * 100:0.##}%。");
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -23,13 +22,13 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 时间内无法受到任何伤害,且敏捷提升 {系数 * 100:0.##}% [ {敏捷提升} ]。此技能会消耗至少 100 点能量。";
public override string Description => $"{Duration:0.##} 时间内无法受到任何伤害,且敏捷提升 {系数 * 100:0.##}% [ {敏捷提升:0.##} ]。此技能会消耗至少 100 点能量。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => Calculation.Round2Digits(16 + * 0.03);
public override double Duration => 16 + * 0.03;
private double => Calculation.Round4Digits(0.3 + 0.03 * (Level - 1));
private double => Calculation.Round2Digits( * Skill.Character?.BaseAGI ?? 0);
private double => 0.3 + 0.03 * (Level - 1);
private double => * Skill.Character?.BaseAGI ?? 0;
private double = 0;
private double = 0;
@ -37,7 +36,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
= ;
character.ExAGI += ;
WriteLine($"[ {character} ] 的敏捷提升了 {系数 * 100:0.##}% [ {实际敏捷提升} ] ");
WriteLine($"[ {character} ] 的敏捷提升了 {系数 * 100:0.##}% [ {实际敏捷提升:0.##} ] ");
}
public override void OnEffectLost(Character character)

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -28,8 +27,8 @@ namespace Milimoe.FunGame.Testing.Skills
public override bool Durative => true;
public override double Duration => 30;
private double => Calculation.Round4Digits(0.2 + 0.03 * (Level - 1));
private double => Calculation.Round4Digits(0.8 + 0.04 * (Level - 1));
private double => 0.2 + 0.03 * (Level - 1);
private double => 0.8 + 0.04 * (Level - 1);
private double = 0;
private double = 0;

View File

@ -40,7 +40,7 @@ namespace Milimoe.FunGame.Testing.Skills
e. = 0;
}
}
public override void OnEffectLost(Character character)
{
IEnumerable<Effect> effects = character.Effects.Where(e => e is );

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -25,19 +24,13 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"每释放 {触发硬直次数} 次魔法才会触发硬直时间,且魔法命中时基于 25% 智力 [ {获得额外能量值} ] 获得额外能量值。";
public override string Description => $"每释放 {触发硬直次数:0.##} 次魔法才会触发硬直时间,且魔法命中时基于 25% 智力 [ {获得额外能量值:0.##} ] 获得额外能量值。";
public override bool TargetSelf => true;
public bool { get; set; } = false;
public int { get; set; } = 2;
public int { get; set; } = 0;
public double
{
get
{
return Calculation.Round2Digits(0.25 * Skill.Character?.INT ?? 0);
}
}
public double => 0.25 * Skill.Character?.INT ?? 0;
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
@ -45,13 +38,13 @@ namespace Milimoe.FunGame.Testing.Skills
{
double = ;
character.EP += ;
WriteLine("[ " + character + " ] 发动了灵能反射!额外获得了 " + + " 能量!");
WriteLine($"[ {character} ] 发动了灵能反射!额外获得了 {实际获得能量值:0.##} 能量!");
IEnumerable<Effect> effects = character.Effects.Where(e => e is );
if (effects.Any() && effects.First() is e)
{
double = Calculation.Round2Digits( * 10);
double = * 10;
character.MP += ;
WriteLine("[ " + character + " ] 发动了三重叠加!回复了 " + + " 魔法值!");
WriteLine($"[ {character} ] 发动了三重叠加!回复了 {获得的魔法值:0.##} 魔法值!");
}
}
}
@ -63,7 +56,7 @@ namespace Milimoe.FunGame.Testing.Skills
AlterHardnessTime(character, ref baseHardnessTime, ref isCheckProtected);
}
}
public override void AlterHardnessTimeAfterCastSkill(Character character, Skill skill, ref double baseHardnessTime, ref bool isCheckProtected)
{
if (skill.SkillType == SkillType.Magic)

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -26,8 +25,8 @@ namespace Milimoe.FunGame.Testing.Skills
public override string Description => $"检查 [ 智慧与力量 ] 的模式。在力量模式下,立即回复 {生命值回复 * 100:0.##}% 生命值;智力模式下,下一次魔法伤害提升 {伤害提升 * 100:0.##}%。";
public override bool TargetSelf => true;
private double => Calculation.Round4Digits(0.25 + 0.03 * (Level - 1));
private double => Calculation.Round4Digits(0.55 + 0.25 * (Level - 1));
private double => 0.25 + 0.03 * (Level - 1);
private double => 0.55 + 0.25 * (Level - 1);
public override void OnEffectGained(Character character)
{
@ -44,9 +43,9 @@ namespace Milimoe.FunGame.Testing.Skills
if (character == Skill.Character && isMagicDamage)
{
double = ;
double = Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
WriteLine("[ " + character + " ] 发动了变幻之心!伤害提升了 " + + " 点!");
double = damage * ;
damage += ;
WriteLine($"[ {character} ] 发动了变幻之心!伤害提升了 {实际伤害提升:0.##} 点!");
character.Effects.Remove(this);
OnEffectLost(character);
}
@ -59,9 +58,9 @@ namespace Milimoe.FunGame.Testing.Skills
{
if (caster.PrimaryAttribute == PrimaryAttribute.STR)
{
double = Calculation.Round2Digits( * caster.MaxHP);
double = * caster.MaxHP;
caster.HP += ;
WriteLine("[ " + caster + " ] 回复了 " + + " 点生命值!");
WriteLine($"[ {caster} ] 回复了 {回复的生命:0.##} 点生命值!");
}
else if (caster.PrimaryAttribute == PrimaryAttribute.INT)
{

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -25,14 +24,14 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"META马专属被动力量+5力量成长+0.5在受到伤害时获得的能量提升50%,每回合开始还能获得额外的 [ {EP} ] 能量值。";
public override string Description => $"META马专属被动力量+5力量成长+0.5在受到伤害时获得的能量提升50%,每回合开始还能获得额外的 [ {EP:0.##} ] 能量值。";
public override bool TargetSelf => true;
public static double EP => 10;
public override void AlterEPAfterGetDamage(Character character, ref double baseEP)
{
baseEP = Calculation.Round2Digits(baseEP * 1.5);
if (Skill.Character != null) WriteLine("[ " + Skill.Character + " ] 发动了META马专属被动本次获得了 " + baseEP + " 能量!");
baseEP *= 1.5;
if (Skill.Character != null) WriteLine($"[ {Skill.Character} ] 发动了META马专属被动本次获得了 {baseEP:0.##} 能量!");
}
public override void OnTurnStart(Character character)
@ -40,7 +39,7 @@ namespace Milimoe.FunGame.Testing.Skills
if (character.EP < 200)
{
character.EP += EP;
WriteLine("[ " + character + " ] 发动了META马专属被动本次获得了 " + EP + " 能量!");
WriteLine($"[ {character} ] 发动了META马专属被动本次获得了 {EP:0.##} 能量!");
}
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -23,19 +22,20 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => "力量爆发";
public override string Description => $"获得 150% 力量 [ {攻击力加成} ] 的攻击力加成,持续 {Duration} 时间。";
public override string Description => $"获得 150% 力量 [ {攻击力加成:0.##} ] 的攻击力加成,但每次攻击都会损失 9% 当前生命值 [ {当前生命值:0.##} ]持续 {Duration:0.##} 时间。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 10 + 1 * (Level - 1);
private double => Calculation.Round2Digits(Skill.Character?.STR * 1.5 ?? 0);
private double => Skill.Character?.STR * 1.5 ?? 0;
private double => Skill.Character?.HP * 0.09 ?? 0;
private double = 0;
public override void OnEffectGained(Character character)
{
= ;
character.ExATK2 += ;
WriteLine($"[ {character} ] 的攻击力增加了 [ {实际攻击力加成} ] ");
WriteLine($"[ {character} ] 的攻击力增加了 [ {实际攻击力加成:0.##} ] ");
}
public override void OnEffectLost(Character character)
@ -44,6 +44,16 @@ namespace Milimoe.FunGame.Testing.Skills
character.ExATK2 -= ;
}
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (character == Skill.Character && isNormalAttack)
{
double = ;
character.HP -= ;
WriteLine($"[ {character} ] 由于自身力量过于强大而被反噬,损失了 [ {生命值减少:0.##} ] 点生命值!");
}
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
RemainDuration = Duration;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -26,7 +25,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"生命值高于 30% 时,受到额外的 [ {高于30额外伤害下限}~{高于30额外伤害上限}% ] 伤害,但是获得 [ 累计所受伤害的 {高于30的加成下限}~{高于30的加成上限}% ] 伤害加成;生命值低于等于 30% 时,不会受到额外的伤害,仅能获得 [ 累计受到的伤害 {低于30的加成下限}~{低于30的加成上限}% ] 伤害加成。" +
$"在没有受到任何伤害的时候,将获得 {常规伤害加成 * 100:0.##}% 伤害加成。" + ( > 0 ? $"(当前累计受到伤害:{累计受到的伤害}" : "");
$"在没有受到任何伤害的时候,将获得 {常规伤害加成 * 100:0.##}% 伤害加成。" + ( > 0 ? $"(当前累计受到伤害:{累计受到的伤害:0.##}" : "");
public override bool TargetSelf => true;
private double = 0;
@ -34,8 +33,8 @@ namespace Milimoe.FunGame.Testing.Skills
private double HP = 0;
private double = 0;
private readonly double = 0.35;
private readonly int 30 = 40;
private readonly int 30 = 20;
private readonly int 30 = 30;
private readonly int 30 = 15;
private readonly int 30 = 100;
private readonly int 30 = 80;
private readonly int 30 = 60;
@ -49,15 +48,15 @@ namespace Milimoe.FunGame.Testing.Skills
{
if (character.HP > character.MaxHP * 0.3)
{
= Calculation.Round4Digits(1.0 + ((new Random().Next(30, 30) + 0.0) / 100));
= 1.0 + ((Random.Shared.Next(30, 30) + 0.0) / 100);
}
else
{
= Calculation.Round4Digits(1.0 + ((new Random().Next(30, 30) + 0.0) / 100));
= 1.0 + ((Random.Shared.Next(30, 30) + 0.0) / 100);
}
return Calculation.Round2Digits( * );
return * ;
}
return Calculation.Round2Digits( * damage);
return * damage;
}
public override void AlterExpectedDamageBeforeCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType)
@ -65,8 +64,8 @@ namespace Milimoe.FunGame.Testing.Skills
if (character == Skill.Character)
{
= (damage);
damage = Calculation.Round2Digits(damage + );
WriteLine($"[ {character} ] 发动了玻璃大炮,获得了 {这次的伤害加成} 点伤害加成!");
damage += ;
WriteLine($"[ {character} ] 发动了玻璃大炮,获得了 {这次的伤害加成:0.##} 点伤害加成!");
= 0;
}
@ -76,10 +75,10 @@ namespace Milimoe.FunGame.Testing.Skills
if (enemy.HP > enemy.MaxHP * 0.3)
{
// 额外受到伤害
double = Calculation.Round4Digits((new Random().Next(30, 30) + 0.0) / 100);
= Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
WriteLine($"[ {enemy} ] 的玻璃大炮触发,将额外受到 {这次受到的额外伤害} 点伤害!");
double = (Random.Shared.Next(30, 30) + 0.0) / 100;
= damage * ;
damage += ;
WriteLine($"[ {enemy} ] 的玻璃大炮触发,将额外受到 {这次受到的额外伤害:0.##} 点伤害!");
}
else = 0;
}
@ -89,7 +88,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
if (enemy == Skill.Character && damageResult != DamageResult.Evaded)
{
= Calculation.Round2Digits( + damage);
+= damage;
if (enemy.HP < 0 && HP - damage + > 0)
{
enemy.HP = 10;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -23,13 +22,13 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 时间内普通攻击转为魔法伤害且硬直时间减少50%,并基于 {智力系数 * 100:0.##}% 智力 [{智力加成}] 强化普通攻击伤害。";
public override string Description => $"{Duration:0.##} 时间内普通攻击转为魔法伤害且硬直时间减少50%,并基于 {智力系数 * 100:0.##}% 智力 [ {智力加成:0.##} ] 强化普通攻击伤害。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 40;
private double => Calculation.Round4Digits(1.4 + 0.4 * (Level - 1));
private double => Calculation.Round2Digits( * Skill.Character?.INT ?? 0);
private double => 1.4 + 0.4 * (Level - 1);
private double => * Skill.Character?.INT ?? 0;
public override void OnEffectGained(Character character)
{
@ -45,13 +44,13 @@ namespace Milimoe.FunGame.Testing.Skills
{
if (character == Skill.Character && isNormalAttack)
{
damage = Calculation.Round2Digits(damage + );
damage += ;
}
}
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.5);
baseHardnessTime *= 0.5;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -35,13 +34,13 @@ namespace Milimoe.FunGame.Testing.Skills
if (character == Skill.Character && damageResult != DamageResult.Evaded && !)
{
// 减少能量
double EP = new Random().Next(10, 25);
double EP = Random.Shared.Next(10, 25);
enemy.EP -= EP;
WriteLine($"[ {character} ] 发动了枯竭打击![ {enemy} ] 的能量值被减少了 {EP} 点!现有能量:{enemy.EP}。");
WriteLine($"[ {character} ] 发动了枯竭打击![ {enemy} ] 的能量值被减少了 {EP:0.##} 点!现有能量:{enemy.EP:0.##}。");
// 额外伤害
if (enemy.EP >= 0 && enemy.EP < 50 || enemy.EP >= 100 && enemy.EP < 150)
{
double = Calculation.Round2Digits(damage * 0.3);
double = damage * 0.3;
WriteLine($"[ {character} ] 发动了枯竭打击!将造成额外伤害!");
= true;
DamageToEnemy(character, enemy, isMagicDamage, magicType, );

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -24,13 +23,13 @@ namespace Milimoe.FunGame.Testing.Skills
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对所有角色造成 " +
$"{能量系数 * 100:0.##}% 其现有能量值 + {智力系数 * 100:0.##}% 智力 [ {智力伤害} ] 的魔法伤害。";
$"{能量系数 * 100:0.##}% 其现有能量值 + {智力系数 * 100:0.##}% 智力 [ {智力伤害:0.##} ] 的魔法伤害。";
public override bool TargetSelf => false;
public override double TargetRange => 999;
private double => Calculation.Round4Digits(0.55 * Level);
private double => Calculation.Round2Digits( * Skill.Character?.INT ?? 0);
private double => Calculation.Round4Digits(0.75 * Level);
private double => 0.55 * Level;
private double => * Skill.Character?.INT ?? 0;
private double => 0.75 * Level;
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
@ -38,7 +37,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
WriteLine($"[ {caster} ] 正在毁灭 [ {c} ] 的能量!!");
double ep = c.EP;
DamageToEnemy(caster, c, true, MagicType, Calculation.Round2Digits(ep * + ));
DamageToEnemy(caster, c, true, MagicType, ep * + );
}
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -32,14 +31,14 @@ namespace Milimoe.FunGame.Testing.Skills
{
if (character == Skill.Character && (enemy.HP / enemy.MaxHP) <= (character.HP / character.MaxHP))
{
double = Calculation.Round2Digits(damage * 0.5);
damage = Calculation.Round2Digits(damage + );
double = damage * 0.5;
damage += ;
}
}
public override bool AlterEnemyListBeforeAction(Character character, List<Character> enemys, List<Character> teammates, List<Skill> skills, Dictionary<Character, int> continuousKilling, Dictionary<Character, int> earnedMoney)
{
IEnumerable<Character> list = [.. enemys.OrderBy(e => Calculation.Round4Digits(e.HP / e.MaxHP))];
IEnumerable<Character> list = [.. enemys.OrderBy(e => e.HP / e.MaxHP)];
if (list.Any())
{
enemys.Clear();

View File

@ -1,7 +1,5 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Effects;
namespace Milimoe.FunGame.Testing.Skills
{
@ -24,7 +22,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"获得 40% 吸血,持续 {Duration} 时间。";
public override string Description => $"获得 40% 吸血,持续 {Duration:0.##} 时间。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 30;
@ -33,9 +31,9 @@ namespace Milimoe.FunGame.Testing.Skills
{
if (character == Skill.Character && damageResult != DamageResult.Evaded && character.HP < character.MaxHP)
{
double = Calculation.Round2Digits(0.4 * damage);
double = 0.4 * damage;
character.HP += ;
WriteLine($"[ {character} ] 回复了 {实际吸血} 点生命值!");
WriteLine($"[ {character} ] 回复了 {实际吸血:0.##} 点生命值!");
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -23,15 +22,15 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 时间内,增加 40% 攻击力 [ {攻击力提升} ]、30% 物理穿透和 25% 闪避率(不可叠加),普通攻击硬直时间额外减少 20%,基于 {系数 * 100:0.##}% 敏捷 [ {伤害加成} ] 强化普通攻击的伤害。在持续时间内,【心灵之火】的冷却时间降低至 3 时间。";
public override string Description => $"{Duration:0.##} 时间内,增加 40% 攻击力 [ {攻击力提升:0.##} ]、30% 物理穿透和 25% 闪避率(不可叠加),普通攻击硬直时间额外减少 20%,基于 {系数 * 100:0.##}% 敏捷 [ {伤害加成:0.##} ] 强化普通攻击的伤害。在持续时间内,【心灵之火】的冷却时间降低至 3 时间。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
public override bool Durative => true;
public override double Duration => 40;
private double => Calculation.Round4Digits(1.2 * (1 + 0.6 * (Skill.Level - 1)));
private double => Calculation.Round2Digits( * Skill.Character?.AGI ?? 0);
private double => Calculation.Round2Digits(0.4 * Skill.Character?.BaseATK ?? 0);
private double => 1.2 * (1 + 0.6 * (Skill.Level - 1));
private double => * Skill.Character?.AGI ?? 0;
private double => 0.4 * Skill.Character?.BaseATK ?? 0;
private double = 0;
public override void OnEffectGained(Character character)
@ -68,13 +67,13 @@ namespace Milimoe.FunGame.Testing.Skills
{
if (character == Skill.Character && isNormalAttack)
{
damage = Calculation.Round2Digits(damage + );
damage += ;
}
}
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8);
baseHardnessTime *= 0.8;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -53,7 +52,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
if ( > 0)
{
= Calculation.Round2Digits( - elapsed);
-= elapsed;
if ( <= 0)
{
= 0;
@ -63,7 +62,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8);
baseHardnessTime *= 0.8;
}
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -23,12 +22,12 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => "魔法涌流";
public override string Description => $"{Duration} 时间内,增加所有伤害的 {减伤比例 * 100:0.##}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。";
public override string Description => $"{Duration:0.##} 时间内,增加所有伤害的 {减伤比例 * 100:0.##}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 25;
private double => Calculation.Round2Digits(0.1 + 0.02 * (Level -1));
private double => 0.1 + 0.02 * (Level - 1);
private double = 0;
public override void OnEffectGained(Character character)
@ -46,7 +45,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
if (enemy == Skill.Character)
{
damage = Calculation.Round2Digits(damage * (1 - ));
damage *= 1 - ;
}
return false;
}

View File

@ -22,7 +22,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"敏捷提高 20%,然后将目前的力量补充到与敏捷持平,持续 {Duration} 时间。";
public override string Description => $"敏捷提高 20%,然后将目前的力量补充到与敏捷持平,持续 {Duration:0.##} 时间。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 30;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -28,7 +27,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override string Description => $"每次普通攻击都将附带基于 {敏捷系数 * 100:0.##}% 敏捷 [ {敏捷伤害} ] 的魔法伤害。";
public override bool TargetSelf => true;
private double => Calculation.Round2Digits( * Skill.Character?.AGI ?? 0);
private double => * Skill.Character?.AGI ?? 0;
private readonly double = 2.5;
private bool = false;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -23,13 +22,13 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"进入不可选中状态,获得 100 行动速度,提高 8% 暴击率,持续 {Duration} 时间。破隐一击:在持续时间内,首次造成伤害会附加 {系数 * 100:0.##}% 敏捷 [ {伤害加成} ] 的强化伤害,并解除不可选中状态。";
public override string Description => $"进入不可选中状态,获得 100 行动速度,提高 8% 暴击率,持续 {Duration:0.##} 时间。破隐一击:在持续时间内,首次造成伤害会附加 {系数 * 100:0.##}% 敏捷 [ {伤害加成:0.##} ] 的强化伤害,并解除不可选中状态。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 12 + (1 * (Level - 1));
private double => Calculation.Round4Digits(0.5 + 0.5 * (Skill.Level - 1));
private double => Calculation.Round2Digits( * Skill.Character?.AGI ?? 0);
private double => 0.5 + 0.5 * (Skill.Level - 1);
private double => * Skill.Character?.AGI ?? 0;
private bool { get; set; } = true;
private bool { get; set; } = false;
@ -64,8 +63,8 @@ namespace Milimoe.FunGame.Testing.Skills
character.CharacterEffectTypes.Remove(this);
character.UpdateCharacterState();
double d = ;
damage = Calculation.Round2Digits(damage + d);
WriteLine($"[ {character} ] 触发了疾风步破隐一击,获得了 [ {d} ] 点伤害加成!");
damage += d;
WriteLine($"[ {character} ] 触发了疾风步破隐一击,获得了 [ {d:0.##} ] 点伤害加成!");
}
return false;
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -24,7 +23,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {Calculation.Round2Digits(90 + 60 * (Skill.Level - 1))} + {Calculation.Round2Digits((1.2 + 1.8 * (Skill.Level - 1)) * 100)}% 智力 [ {Damage} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override string Description => $"对目标敌人造成 {90 + 60 * (Skill.Level - 1):0.##} + {(1.2 + 1.8 * (Skill.Level - 1)) * 100:0.##}% 智力 [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
@ -35,7 +34,7 @@ namespace Milimoe.FunGame.Testing.Skills
double d = 0;
if (Skill.Character != null)
{
d = Calculation.Round2Digits(90 + 60 * (Skill.Level - 1) + (1.2 + 1.8 * (Skill.Level - 1)) * Skill.Character.INT);
d = 90 + 60 * (Skill.Level - 1) + (1.2 + 1.8 * (Skill.Level - 1)) * Skill.Character.INT;
}
return d;
}

View File

@ -1,7 +1,7 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.OpenEffects;
using Milimoe.FunGame.Testing.Items;
using Milimoe.FunGame.Testing.Skills;
@ -25,13 +25,13 @@ namespace Addons
public override string Author => "FunGamer";
public override List<Character> Characters
public override Dictionary<string, Character> Characters
{
get
{
EntityModuleConfig<Character> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleCharacter);
config.LoadConfig();
return [.. config.Values];
return config;
}
}
}
@ -46,113 +46,97 @@ namespace Addons
public override string Author => "FunGamer";
public override List<Skill> Skills
public override Dictionary<string, Skill> Skills
{
get
{
EntityModuleConfig<Skill> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleSkill);
config.LoadConfig();
foreach (string key in config.Keys)
{
Skill prev = config[key];
Skill? next = GetSkill(prev.Id, prev.Name, prev.SkillType);
if (next != null)
{
config[key] = next;
}
}
return [.. config.Values];
return Factory.GetGameModuleInstances<Skill>(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleSkill);
}
}
public override Skill? GetSkill(long id, string name, SkillType type)
protected override Factory.EntityFactoryDelegate<Skill> SkillFactory()
{
if (type == SkillType.Magic)
return (id, name, args) =>
{
switch ((MagicID)id)
Skill skill = id switch
{
case MagicID.:
return new ();
}
}
(long)MagicID. => new (),
(long)SkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)SuperSkillID. => new (),
(long)PassiveID.META马 => new META马(),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)PassiveID. => new (),
(long)ItemPassiveID. => new (),
_ => new OpenSkill(id, name)
};
if (type == SkillType.Skill)
if (skill is OpenSkill && args.TryGetValue("others", out object? value) && value is Dictionary<string, object> dict)
{
foreach (string key in dict.Keys)
{
skill.OtherArgs[key] = dict[key];
}
}
return skill;
};
}
protected override Factory.EntityFactoryDelegate<Effect> EffectFactory()
{
return (id, name, args) =>
{
switch ((SkillID)id)
if (args.TryGetValue("skill", out object? value) && value is Skill skill)
{
case SkillID.:
return new ();
return (EffectID)id switch
{
EffectID.ExATK => new ExATK(skill),
EffectID.ExDEF => new ExDEF(skill),
EffectID.ExSTR => new ExSTR(skill),
EffectID.ExAGI => new ExAGI(skill),
EffectID.ExINT => new ExINT(skill),
EffectID.SkillHardTimeReduce => new SkillHardTimeReduce(skill),
EffectID.NormalAttackHardTimeReduce => new NormalAttackHardTimeReduce(skill),
EffectID.AccelerationCoefficient => new AccelerationCoefficient(skill),
EffectID.ExSPD => new ExSPD(skill),
EffectID.ExActionCoefficient => new ExActionCoefficient(skill),
EffectID.ExCDR => new ExCDR(skill),
EffectID.ExMaxHP => new ExMaxHP(skill),
EffectID.ExMaxMP => new ExMaxMP(skill),
EffectID.ExCritRate => new ExCritRate(skill),
EffectID.ExCritDMG => new ExCritDMG(skill),
EffectID.ExEvadeRate => new ExEvadeRate(skill),
EffectID.PhysicalPenetration => new PhysicalPenetration(skill),
EffectID.MagicalPenetration => new MagicalPenetration(skill),
EffectID.ExPDR => new ExPDR(skill),
EffectID.ExMDF => new ExMDF(skill),
EffectID.ExHR => new ExHR(skill),
EffectID.ExMR => new ExMR(skill),
_ => null
};
}
}
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;
return null;
};
}
}
@ -166,47 +150,26 @@ namespace Addons
public override string Author => "FunGamer";
public override List<Item> Items
public override Dictionary<string, Item> Items
{
get
{
EntityModuleConfig<Item> config = new(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleItem);
config.LoadConfig();
foreach (string key in config.Keys)
{
Item prev = config[key];
Item? next = GetItem(prev.Id, prev.Name, prev.ItemType);
if (next != null)
{
prev.SetPropertyToItemModuleNew(next);
config[key] = next;
}
}
return [.. config.Values];
return Factory.GetGameModuleInstances<Item>(ExampleGameModuleConstant.Example, ExampleGameModuleConstant.ExampleItem);
}
}
public override Item? GetItem(long id, string name, ItemType type)
protected override Factory.EntityFactoryDelegate<Item> ItemFactory()
{
if (type == ItemType.MagicCardPack)
return (id, name, args) =>
{
}
if (type == ItemType.Accessory)
{
switch ((AccessoryID)id)
return id switch
{
case AccessoryID.10:
return new 10();
case AccessoryID.30:
return new 30();
case AccessoryID.50:
return new 50();
}
}
return null;
(long)AccessoryID.10 => new 10(),
(long)AccessoryID.30 => new 30(),
(long)AccessoryID.50 => new 50(),
_ => null,
};
};
}
}
}

View File

@ -38,7 +38,7 @@ namespace Milimoe.FunGame.Testing.Tests
GameModuleLoader modules = GameModuleLoader.LoadGameModules(FunGameInfo.FunGame.FunGame_Desktop, []);
foreach (CharacterModule cm in modules.Characters.Values)
{
foreach (Character c in cm.Characters)
foreach (Character c in cm.Characters.Values)
{
Console.WriteLine(c.Name);
list.Add(c);

View File

@ -1,11 +1,11 @@
using System.Text;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Model;
using Milimoe.FunGame.Testing.Items;
using Milimoe.FunGame.Testing.Skills;
using Milimoe.FunGame.Testing.Items;
using MilimoeFunGame.Testing.Characters;
using Milimoe.FunGame.Core.Interface.Entity;
namespace Milimoe.FunGame.Testing.Tests
{
@ -13,7 +13,7 @@ namespace Milimoe.FunGame.Testing.Tests
{
public FunGameSimulation()
{
LoadModules();
InitCharacter();
bool printout = true;
List<string> strs = StartGame(printout);
@ -29,6 +29,7 @@ namespace Milimoe.FunGame.Testing.Tests
}
public static List<Character> Characters { get; } = [];
public static List<Item> Items { get; } = [];
public static Dictionary<Character, CharacterStatistics> CharacterStatistics { get; } = [];
public static PluginConfig StatsConfig { get; } = new(nameof(FunGameSimulation), nameof(CharacterStatistics));
public static bool IsRuning { get; set; } = false;
@ -294,11 +295,11 @@ namespace Milimoe.FunGame.Testing.Tests
if (PrintOut) characters.ForEach(c => Console.WriteLine(c.GetInfo()));
// 创建顺序表并排序
ActionQueue ActionQueue = new(characters, WriteLine);
ActionQueue actionQueue = new(characters, WriteLine);
if (PrintOut) Console.WriteLine();
// 显示初始顺序表
ActionQueue.DisplayQueue();
actionQueue.DisplayQueue();
if (PrintOut) Console.WriteLine();
// 总游戏时长
@ -306,8 +307,9 @@ namespace Milimoe.FunGame.Testing.Tests
// 开始空投
Msg = "";
(ActionQueue, totalTime);
(actionQueue);
if (isWeb) result.Add("=== 空投 ===\r\n" + Msg);
double = 80;
// 总回合数
int i = 1;
@ -320,7 +322,7 @@ namespace Milimoe.FunGame.Testing.Tests
Dictionary<Character, double> = [];
foreach (Character c in characters)
{
.TryAdd(c, Calculation.Round4Digits(c.HP / c.MaxHP));
.TryAdd(c, c.HP / c.MaxHP);
}
double max = .Values.Max();
Character winner = .Keys.Where(c => [c] == max).First();
@ -328,15 +330,15 @@ namespace Milimoe.FunGame.Testing.Tests
foreach (Character c in characters.Where(c => c != winner && c.HP > 0))
{
WriteLine("[ " + winner + " ] 对 [ " + c + " ] 造成了 99999999999 点真实伤害。");
ActionQueue.DeathCalculation(winner, c);
actionQueue.DeathCalculation(winner, c);
}
ActionQueue.EndGameInfo(winner);
actionQueue.EndGameInfo(winner);
result.Add(Msg);
break;
}
// 检查是否有角色可以行动
Character? characterToAct = ActionQueue.NextCharacter();
Character? characterToAct = actionQueue.NextCharacter();
// 处理回合
if (characterToAct != null)
@ -344,23 +346,34 @@ namespace Milimoe.FunGame.Testing.Tests
WriteLine($"=== Round {i++} ===");
WriteLine("现在是 [ " + characterToAct + " ] 的回合!");
bool isGameEnd = ActionQueue.ProcessTurn(characterToAct);
bool isGameEnd = actionQueue.ProcessTurn(characterToAct);
if (isGameEnd)
{
result.Add(Msg);
break;
}
ActionQueue.DisplayQueue();
actionQueue.DisplayQueue();
WriteLine("");
}
// 模拟时间流逝
totalTime += ActionQueue.TimeLapse();
double timeLapse = actionQueue.TimeLapse();
totalTime += timeLapse;
-= timeLapse;
if (ActionQueue.Eliminated.Count > deaths)
if ( <= 0)
{
deaths = ActionQueue.Eliminated.Count;
// 空投
Msg = "";
(actionQueue);
if (isWeb) result.Add("=== 空投 ===\r\n" + Msg);
= 100;
}
if (actionQueue.Eliminated.Count > deaths)
{
deaths = actionQueue.Eliminated.Count;
if (!isWeb)
{
string roundMsg = Msg;
@ -378,7 +391,7 @@ namespace Milimoe.FunGame.Testing.Tests
if (PrintOut)
{
Console.WriteLine("--- End ---");
Console.WriteLine("总游戏时长:" + Calculation.Round2Digits(totalTime));
Console.WriteLine($"总游戏时长:{totalTime:0.##}");
Console.WriteLine("");
}
@ -387,10 +400,10 @@ namespace Milimoe.FunGame.Testing.Tests
int top = isWeb ? 12 : 6;
Msg = $"=== 伤害排行榜 TOP{top} ===\r\n";
int count = 1;
foreach (Character character in ActionQueue.CharacterStatistics.OrderByDescending(d => d.Value.TotalDamage).Select(d => d.Key))
foreach (Character character in actionQueue.CharacterStatistics.OrderByDescending(d => d.Value.TotalDamage).Select(d => d.Key))
{
StringBuilder builder = new();
CharacterStatistics stats = ActionQueue.CharacterStatistics[character];
CharacterStatistics stats = actionQueue.CharacterStatistics[character];
builder.AppendLine($"{count}. [ {character.ToStringWithLevel()} ] {stats.Kills} / {stats.Assists}");
builder.AppendLine($"存活时长:{stats.LiveTime} / 存活回合数:{stats.LiveRound} / 行动回合数:{stats.ActionTurn}");
builder.AppendLine($"总计伤害:{stats.TotalDamage} / 总计物理伤害:{stats.TotalPhysicalDamage} / 总计魔法伤害:{stats.TotalMagicDamage}");
@ -450,7 +463,7 @@ namespace Milimoe.FunGame.Testing.Tests
}
if (totalStats.LiveRound != 0) totalStats.DamagePerRound = Calculation.Round2Digits(totalStats.TotalDamage / totalStats.LiveRound);
if (totalStats.ActionTurn != 0) totalStats.DamagePerTurn = Calculation.Round2Digits(totalStats.TotalDamage / totalStats.ActionTurn);
if (totalStats.LiveTime !=0) totalStats.DamagePerSecond = Calculation.Round2Digits(totalStats.TotalDamage / totalStats.LiveTime);
if (totalStats.LiveTime != 0) totalStats.DamagePerSecond = Calculation.Round2Digits(totalStats.TotalDamage / totalStats.LiveTime);
}
}
result.Add(Msg);
@ -458,12 +471,21 @@ namespace Milimoe.FunGame.Testing.Tests
// 显示每个角色的信息
if (isWeb)
{
for (i = ActionQueue.Eliminated.Count - 1; i >= 0; i--)
for (i = actionQueue.Eliminated.Count - 1; i >= 0; i--)
{
Character character = ActionQueue.Eliminated[i];
Character character = actionQueue.Eliminated[i];
result.Add($"=== 角色 [ {character} ] ===\r\n{character.GetInfo()}");
}
}
else
{
Character? character = actionQueue.Eliminated.LastOrDefault();
if (character != null)
{
Msg = "";
WriteLine($"\r\n\r\n=== 本次冠军角色 [ {character} ] ===\r\n{character.GetInfo()}");
}
}
lock (StatsConfig)
{
@ -493,48 +515,40 @@ namespace Milimoe.FunGame.Testing.Tests
if (PrintOut) Console.WriteLine(str);
}
public static void (ActionQueue queue, double totalTime)
public static void (ActionQueue queue)
{
Item[] ;
if (totalTime == 0)
Item a = Items[Random.Shared.Next(Items.Count)];
a.SetGamingQueue(queue);
Item[] = [a];
WriteLine($"社区送温暖了,现在向所有人发放 [ {a.Name} ]");
foreach (Character character in queue.Queue)
{
WriteLine("社区送温暖了,现在向所有人发放 [ 攻击之爪 +10 ]");
foreach (Character character in queue.Queue)
foreach (Item item in )
{
= [new 10()];
foreach (Item item in )
{
queue.Equip(character, EquipItemToSlot.Accessory1, item);
}
queue.Equip(character, item.Copy(1));
}
}
WriteLine("");
}
public static void LoadModules()
public static void InitCharacter()
{
PluginLoader plugins = PluginLoader.LoadPlugins([]);
foreach (string plugin in plugins.Plugins.Keys)
{
Console.WriteLine(plugin + " is loaded.");
}
Characters.Add(OshimaCharacters.Oshima);
Characters.Add(OshimaCharacters.Xinyin);
Characters.Add(OshimaCharacters.Yang);
Characters.Add(OshimaCharacters.NanGanyu);
Characters.Add(OshimaCharacters.NiuNan);
Characters.Add(OshimaCharacters.Mayor);
Characters.Add(OshimaCharacters.);
Characters.Add(OshimaCharacters.QingXiang);
Characters.Add(OshimaCharacters.QWQAQW);
Characters.Add(OshimaCharacters.ColdBlue);
Characters.Add(OshimaCharacters.绿);
Characters.Add(OshimaCharacters.QuDuoduo);
Dictionary<string, string> plugindllsha512 = [];
foreach (string pfp in PluginLoader.PluginFilePaths.Keys)
foreach (Character c in Characters)
{
string text = Encryption.FileSha512(PluginLoader.PluginFilePaths[pfp]);
plugindllsha512.Add(pfp, text);
if (PrintOut) Console.WriteLine(pfp + $" is {text}.");
}
GameModuleLoader modules = GameModuleLoader.LoadGameModules(FunGameInfo.FunGame.FunGame_Desktop, []);
foreach (CharacterModule cm in modules.Characters.Values)
{
foreach (Character c in cm.Characters)
{
if (PrintOut) Console.WriteLine(c.Name);
Characters.Add(c);
CharacterStatistics.Add(c, new());
}
CharacterStatistics.Add(c, new());
}
StatsConfig.LoadConfig();
@ -546,22 +560,9 @@ namespace Milimoe.FunGame.Testing.Tests
}
}
Dictionary<string, string> moduledllsha512 = [];
foreach (string mfp in GameModuleLoader.ModuleFilePaths.Keys)
{
string text = Encryption.FileSha512(GameModuleLoader.ModuleFilePaths[mfp]);
moduledllsha512.Add(mfp, text);
if (PrintOut) Console.WriteLine(mfp + $" is {text}.");
}
foreach (string moduledll in moduledllsha512.Keys)
{
string server = moduledllsha512[moduledll];
if (plugindllsha512.TryGetValue(moduledll, out string? client) && client != "" && server == client)
{
Console.WriteLine(moduledll + $" is checked pass.");
}
}
Dictionary<string, Item> exitem = Factory.GetGameModuleInstances<Item>(nameof(SkillJSONTest), nameof(Item));
Items.AddRange(exitem.Values);
Items.AddRange([new 10(), new 30(), new 50()]);
}
}
}

View File

@ -1,10 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Effects;
using Milimoe.FunGame.Testing.Items;
using Milimoe.FunGame.Testing.Skills;
using MilimoeFunGame.Testing.Characters;
using Addons;
namespace Milimoe.FunGame.Testing.Tests
{
@ -12,228 +6,14 @@ namespace Milimoe.FunGame.Testing.Tests
{
public SkillJSONTest()
{
//EntityModuleConfig<Character> config = new(nameof(SkillJSONTest), nameof(Character))
//{
// { "Oshima", OshimaCharacters.Oshima },
// { "Xinyin", OshimaCharacters.Xinyin },
// { "Yang", OshimaCharacters.Yang },
// { "NanGanyu", OshimaCharacters.NanGanyu },
// { "NiuNan", OshimaCharacters.NiuNan },
// { "Mayor", OshimaCharacters.Mayor },
// { "马猴烧酒", OshimaCharacters.马猴烧酒 },
// { "QingXiang", OshimaCharacters.QingXiang },
// { "QWQAQW", OshimaCharacters.QWQAQW },
// { "ColdBlue", OshimaCharacters.ColdBlue },
// { "绿拱门", OshimaCharacters.绿拱门 },
// { "QuDuoduo", OshimaCharacters.QuDuoduo }
//};
//config.SaveConfig();
EntityModuleConfig<Skill> config2 = new(nameof(SkillJSONTest), nameof(Skill));
Character c = Factory.GetCharacter();
List<Skill> listSkill = [];
listSkill.Add(new (c));
foreach (Skill s in listSkill)
{
config2.Add(s.Name, s);
}
config2.SaveConfig();
config2.LoadConfig();
foreach (string key in config2.Keys)
{
Skill prev = config2[key];
Skill? next = GetSkill(prev.Id, prev.Name, prev.SkillType);
if (next != null)
{
config2[key] = next;
}
Skill skill = config2[key];
foreach (Effect effect in skill.Effects.ToList())
{
Effect? newEffect = GetEffect(effect.Id, effect.Name, skill);
if (newEffect != null)
{
skill.Effects.Remove(effect);
skill.Effects.Add(newEffect);
}
}
}
Console.WriteLine(string.Join("\r\n", config2.Values));
EntityModuleConfig<Item> config3 = new(nameof(SkillJSONTest), nameof(Item)); ;
//EntityModuleConfig<Item> config3 = new(nameof(SkillJSONTest), nameof(Item))
//{
// { "攻击之爪10", new 攻击之爪10() }
//};
//config3.SaveConfig();
config3.LoadConfig();
foreach (string key in config3.Keys)
{
Item prev = config3[key];
Item? next = GetItem(prev.Id, prev.Name, prev.ItemType);
if (next != null)
{
prev.SetPropertyToItemModuleNew(next);
config3[key] = next;
}
Item item = config3[key];
HashSet<Skill> skills = item.Skills.Passives;
if (item.Skills.Active != null) skills.Add(item.Skills.Active);
foreach (Skill skill in skills.ToList())
{
Skill? newSkill = GetSkill(skill.Id, skill.Name, 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;
foreach (Effect effect in s.Effects.ToList())
{
Effect? newEffect = GetEffect(effect.Id, effect.Name, skill);
if (newEffect != null)
{
skill.Effects.Remove(effect);
skill.Effects.Add(newEffect);
}
}
}
}
Console.WriteLine(string.Join("\r\n", config3.Values));
}
public static Item? GetItem(long id, string name, ItemType type)
{
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 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 static Effect? GetEffect(long id, string name, Skill skill)
{
switch (id)
{
case 8001:
return new ExATK(skill, null, null);
case 8002:
return new ExDEF(skill, null, null);
case 8003:
return new ExSTR(skill, null, null);
default:
break;
}
return null;
//Factory.CreateGameModuleEntityConfig<Item>(nameof(SkillJSONTest), nameof(Item), []);
ExampleCharacterModule cm = new();
cm.Load();
ExampleItemModule im = new();
im.Load();
ExampleSkillModule sm = new();
sm.Load();
_ = new FunGameSimulation();
}
}
}