新的技能测试,进度(10/12)

This commit is contained in:
milimoe 2024-09-12 01:24:45 +08:00
parent aeb5674d0d
commit 3178fa0569
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
29 changed files with 988 additions and 68 deletions

View File

@ -98,7 +98,7 @@ namespace FunGame.Testing.Characters
c.InitialAGI = 7;
c.AGIGrowth = 0.7;
c.InitialINT = 17;
c.INTGrowth = 0.7;
c.INTGrowth = 1.7;
c.InitialSPD = 300;
c.InitialHR = 4;
c.InitialMR = 2;

View File

@ -7,7 +7,7 @@ namespace Milimoe.FunGame.Testing.Effects
{
public override long Id => 4101;
public override string Name => "眩晕";
public override string Description => $"此角色被眩晕了,不能行动。来自:[ " + _sourceCharacter + " ] 的 [ " + Skill.Name + " ]";
public override string Description => $"此角色被眩晕了,不能行动。来自:[ {Source} ] 的 [ {Skill.Name} ]";
public override EffectControlType ControlType => EffectControlType.Stun;
public override bool TargetSelf => true;
public override Character Source => _sourceCharacter;
@ -33,7 +33,7 @@ namespace Milimoe.FunGame.Testing.Effects
{
if (_durative) RemainDuration = Duration;
else RemainDurationTurn = DurationTurn;
character.CharacterEffectStates.Add(this, CharacterState.NotActionable);
character.CharacterEffectStates.Add(this, [CharacterState.NotActionable]);
character.UpdateCharacterState();
InterruptCasting(character, Source);
}
@ -43,10 +43,5 @@ namespace Milimoe.FunGame.Testing.Effects
character.CharacterEffectStates.Remove(this);
character.UpdateCharacterState();
}
public override void OnTurnStart(Character character)
{
}
}
}

View File

@ -0,0 +1,24 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Effects
{
public class : Effect
{
public override long Id => 4102;
public override string Name => "累积之压标记";
public override string Description => $"此角色持有累积之压标记,已累计 {MarkLevel} 层。来自:[ {Source} ]";
public override EffectControlType ControlType => EffectControlType.Mark;
public override bool TargetSelf => true;
public override Character Source => _sourceCharacter;
public int MarkLevel { get; set; } = 1;
private readonly Character _sourceCharacter;
public (Skill skill, Character sourceCharacter) : base(skill)
{
ActionQueue = skill.ActionQueue;
_sourceCharacter = sourceCharacter;
}
}
}

View File

@ -108,6 +108,12 @@ if (list.Count > 3)
};
c.Skills.Add();
Skill = new (c)
{
Level = slevel
};
c.Skills.Add();
if (c == character1)
{
Skill META马 = new META马(c)
@ -182,18 +188,85 @@ if (list.Count > 3)
};
c.Skills.Add();
}
if (c == character9)
if (c== character6)
{
Skill = new (c)
Skill = new (c)
{
Level = 1
};
c.Skills.Add();
Skill = new (c)
{
Level = slevel
};
c.Skills.Add();
c.Skills.Add();
}
if (c== character7)
{
Skill = new (c)
{
Level = 1
};
c.Skills.Add();
Skill = new (c)
{
Level = slevel
};
c.Skills.Add();
}
if (c== character8)
{
Skill = new (c)
{
Level = 1
};
c.Skills.Add();
Skill = new (c)
{
Level = slevel
};
c.Skills.Add();
}
if (c == character9)
{
Skill = new (c)
{
Level = 1
};
c.Skills.Add();
Skill = new (c)
{
Level = slevel
};
c.Skills.Add();
}
if (c == character10)
{
Skill = new (c)
{
Level = 1
};
c.Skills.Add();
Skill = new (c)
{
Level = slevel
};
c.Skills.Add();
}
if (c != character1 && c != character2 && c != character3 && c != character4 &&
c != character5)
c != character5 && c != character6 && c != character7 && c != character8 &&
c != character9 && c != character10) //&& c != character11 && c != character12)
{
Skill = new (c)
{

View File

@ -0,0 +1,65 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Effects;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 3010;
public override string Name => "嗜血标记";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100;
public override double CD => 42 - 1 * (Level - 1);
public override double HardnessTime => 12;
public (Character character) : base(SkillType.SuperSkill, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 秒内,攻击拥有标记的角色将根据标记层数获得 {吸血 * 100:f2}% 吸血每层。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 30;
public HashSet<Character> { get; } = [];
private double => Calculation.Round4Digits(0.03 * Level);
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (character == Skill.Character && damageResult != DamageResult.Evaded && character.HP < character.MaxHP)
{
int = 0;
if (enemy.Effects.Where(e => e is ).FirstOrDefault() is e)
{
= e.MarkLevel;
}
else if (.Remove(enemy))
{
= 4;
}
double = Calculation.Round2Digits( * damage);
character.HP += ;
WriteLine($"[ {character} ] 回复了 {实际吸血} 点生命值!");
}
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))
{
.Clear();
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}
}

View File

@ -0,0 +1,90 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Testing.Effects;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 4010;
public override string Name => "累积之压";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character)
{
Effects.Add(new (this));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
{
return Effects;
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"每次造成伤害都可以叠一层标记,累计 4 层时回收该角色所有标记并造成眩晕 1 回合,额外对该角色造成 {系数 * 100:f2}% 最大生命值的物理伤害。";
public override bool TargetSelf => true;
private readonly double = 0.12;
private bool = false;
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (character == Skill.Character && damageResult != DamageResult.Evaded && !)
{
// 叠标记
IEnumerable<Effect> effects = enemy.Effects.Where(e => e is );
if (effects.Any() && effects.First() is e)
{
e.MarkLevel++;
IEnumerable<Effect> effects2 = character.Effects.Where(e => e is );
if (effects2.Any() && effects2.First() is e2)
{
if (e.MarkLevel >= 4)
{
e2..Add(enemy);
}
else
{
e2..Remove(enemy);
}
}
if (e.MarkLevel >= 4)
{
// 移除标记
enemy.Effects.Remove(e);
double = Calculation.Round2Digits(enemy.MaxHP * );
WriteLine($"[ {character} ] 发动了累积之压!将对 [ {enemy} ] 造成眩晕和额外伤害!");
// 眩晕
IEnumerable<Effect> effects3 = enemy.Effects.Where(e => e is && e.Skill == Skill);
if (effects3.Any())
{
effects3.First().RemainDurationTurn++;
}
else
{
e3 = new(Skill, character, false, 0, 1);
enemy.Effects.Add(e3);
e3.OnEffectGained(enemy);
}
= true;
DamageToEnemy(character, enemy, false, magicType, );
}
}
else
{
enemy.Effects.Add(new (Skill, character));
}
}
if (character == Skill.Character && )
{
= false;
}
}
}
}

View File

@ -0,0 +1,64 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 3006;
public override string Name => "精准打击";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100;
public override double CD => 40 - 1 * (Level - 1);
public override double HardnessTime => 8;
public (Character character) : base(SkillType.SuperSkill, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"30 时间内暴击率提升 {暴击率提升 * 100:f2}%,暴击伤害再提升 {暴击伤害提升 * 100:f2}%。";
public override bool TargetSelf => true;
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;
private double = 0;
public override void OnEffectGained(Character character)
{
= ;
= ;
character.ExCritRate += ;
WriteLine($"[ {character} ] 的暴击率提升了 [ {实际暴击率提升 * 100:f2}% ] ");
character.ExCritDMG += ;
WriteLine($"[ {character} ] 的暴击伤害提升了 [ {实际暴击伤害提升 * 100:f2}% ] ");
}
public override void OnEffectLost(Character character)
{
character.ExCritRate -= ;
character.ExCritDMG -= ;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))
{
= 0;
= 0;
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}
}

View File

@ -31,5 +31,10 @@ namespace Milimoe.FunGame.Testing.Skills
{
character.ExCritDMG += 0.3;
}
public override void OnEffectLost(Character character)
{
character.ExCritDMG -= 0.3;
}
}
}

View File

@ -49,13 +49,13 @@ namespace Milimoe.FunGame.Testing.Skills
}
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
= ;
if (!actor.Effects.Contains(this))
if (!caster.Effects.Contains(this))
{
actor.Effects.Add(this);
OnEffectGained(actor);
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}

View File

@ -55,7 +55,7 @@ namespace Milimoe.FunGame.Testing.Skills
}
}
public override void AlterHardnessTimeAfterCastSkill(Character character, ref double baseHardnessTime)
public override void AlterHardnessTimeAfterCastSkill(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
++;
if ( < )

View File

@ -52,23 +52,23 @@ namespace Milimoe.FunGame.Testing.Skills
}
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
IEnumerable<Effect> effects = actor.Effects.Where(e => e is );
IEnumerable<Effect> effects = caster.Effects.Where(e => e is );
if (effects.Any())
{
if (actor.PrimaryAttribute == PrimaryAttribute.STR)
if (caster.PrimaryAttribute == PrimaryAttribute.STR)
{
double = Calculation.Round2Digits( * actor.MaxHP);
actor.HP += ;
WriteLine("[ " + actor + " ] 发动了变幻之心!回复了 " + + " 点生命值!");
double = Calculation.Round2Digits( * caster.MaxHP);
caster.HP += ;
WriteLine("[ " + caster + " ] 回复了 " + + " 点生命值!");
}
else if (actor.PrimaryAttribute == PrimaryAttribute.INT)
else if (caster.PrimaryAttribute == PrimaryAttribute.INT)
{
if (!actor.Effects.Contains(this))
if (!caster.Effects.Contains(this))
{
actor.Effects.Add(this);
OnEffectGained(actor);
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}

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

View File

@ -44,14 +44,14 @@ namespace Milimoe.FunGame.Testing.Skills
character.ExATK2 -= ;
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!actor.Effects.Contains(this))
if (!caster.Effects.Contains(this))
{
= 0;
actor.Effects.Add(this);
OnEffectGained(actor);
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}

View File

@ -0,0 +1,91 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 4009;
public override string Name => "玻璃大炮";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character)
{
Effects.Add(new (this));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
{
return Effects;
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"生命值高于30%时,受到额外的 [ 20~40% ] 伤害,但是获得 [ 上次所受伤害的 80% ] 伤害加成生命值低于等于30%时,不会受到额外的伤害,但是仅能获得 [ 上次所受伤害的 30% ] 伤害加成。" +
$"在没有受到任何伤害的时候,将获得 {常规伤害加成 * 100:f2}% 伤害加成。(当前伤害加成:{伤害加成 * 100:f2}%";
public override bool TargetSelf => true;
private double = 0;
private double = 0;
private double = 0;
private readonly double = 0.2;
private readonly double 30 = 0.8;
private readonly double 30 = 0.3;
private double
{
get
{
double = ;
Character? character = Skill.Character;
if (character is null) return ;
if ( != 0)
{
if (character.HP > character.MaxHP * 0.3)
{
= 30;
}
else
{
= 30;
}
}
return ;
}
}
public override void AlterExpectedDamageBeforeCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType)
{
if (character == Skill.Character)
{
= Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
WriteLine($"[ {character} ] 发动了玻璃大炮,获得了 {这次的伤害加成} 点伤害加成!");
}
if (enemy == Skill.Character)
{
if (character.HP > character.MaxHP * 0.3)
{
// 额外受到伤害
double = Calculation.Round4Digits((new Random().Next(20, 40) + 0.0) / 100);
= Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
WriteLine($"[ {character} ] 的玻璃大炮触发,将额外受到 {这次受到的额外伤害} 点伤害!");
}
}
}
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (enemy == Skill.Character && damageResult != DamageResult.Evaded)
{
= damage;
}
}
}
}

View File

@ -0,0 +1,67 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 3009;
public override string Name => "迅捷之势";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100;
public override double CD => 60 - 2 * (Level - 1);
public override double HardnessTime => 15;
public (Character character) : base(SkillType.SuperSkill, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 秒内普通攻击转为魔法伤害且硬直时间减少50%,并基于 {智力系数 * 100:f2}% 智力 [{智力加成}] 强化普通攻击伤害。";
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);
public override void OnEffectGained(Character character)
{
character.NormalAttack.SetMagicType(true, character.MagicType);
}
public override void OnEffectLost(Character character)
{
character.NormalAttack.SetMagicType(false, character.MagicType);
}
public override void AlterExpectedDamageBeforeCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType)
{
if (character == Skill.Character && isNormalAttack)
{
damage = Calculation.Round2Digits(damage + );
}
}
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.5);
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))
{
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}
}

View File

@ -0,0 +1,57 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 4008;
public override string Name => "枯竭打击";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character)
{
Effects.Add(new (this));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
{
return Effects;
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"每次造成伤害都会随机减少对方 [ 10~25 ] 点能量值,对能量值低于一半的角色额外造成 30% 伤害。对于枯竭打击而言能量值大于100且小于150时视为低于一半。";
public override bool TargetSelf => true;
private bool = false;
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (character == Skill.Character && damageResult != DamageResult.Evaded && !)
{
// 减少能量
double EP = new Random().Next(10, 25);
enemy.EP -= EP;
WriteLine($"[ {character} ] 发动了枯竭打击![ {enemy} ] 的能量值被减少了 {EP} 点!现有能量:{enemy.EP}。");
// 伤害提升
if (enemy.EP >= 0 && enemy.EP < 50 || enemy.EP >= 100 && enemy.EP < 150)
{
double = Calculation.Round2Digits(damage * 0.3);
WriteLine($"[ {character} ] 发动了枯竭打击!将造成额外伤害!");
= true;
DamageToEnemy(character, enemy, isMagicDamage, magicType, );
}
}
if (character == Skill.Character && )
{
= false;
}
}
}
}

View File

@ -0,0 +1,44 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 3008;
public override string Name => "能量毁灭";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100;
public override double CD => 55 - 3 * (Level - 1);
public override double HardnessTime => 15;
public (Character character) : base(SkillType.SuperSkill, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对所有角色造成 " +
$"600% 其现有能量值 + {智力系数 * 100:f2}% 智力 [ {智力伤害} ] 的魔法伤害。";
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);
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
foreach (Character c in enemys)
{
WriteLine($"[ {caster} ] 正在毁灭 [ {c} ] 的能量!!");
double ep = c.EP;
DamageToEnemy(caster, c, true, MagicType, Calculation.Round2Digits(ep * 6.0 + ));
}
}
}
}

View File

@ -0,0 +1,30 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 4012;
public override string Name => "弱者猎手";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character)
{
Effects.Add(new (this));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
{
return Effects;
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"优先攻击血量更低的角色对生命值低于自己的角色造成150%伤害。";
public override bool TargetSelf => true;
}
}

View File

@ -0,0 +1,90 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 4012;
public override string Name => "血之狂欢";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character)
{
Effects.Add(new (this));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
{
return Effects;
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"30秒内获得50%吸血。";
public override bool TargetSelf => true;
private double = 0;
private double = 0;
public override void OnAttributeChanged(Character character)
{
if (Skill.Character != null)
{
if (Skill.Character.PrimaryAttribute == PrimaryAttribute.INT)
{
double diff = character.ExSTR - ;
character.ExINT = + character.BaseSTR + diff;
}
else if (Skill.Character.PrimaryAttribute == PrimaryAttribute.STR)
{
double diff = character.ExINT - ;
character.ExSTR = + character.BaseINT + diff;
}
}
}
public override void OnTimeElapsed(Character character, double elapsed)
{
if (Skill.Character != null)
{
Character c = Skill.Character;
if (c.HP < c.MaxHP * 0.3)
{
if (c.PrimaryAttribute == PrimaryAttribute.INT)
{
double pastHP = c.HP;
double pastMaxHP = c.MaxHP;
double pastMP = c.MP;
double pastMaxMP = c.MaxMP;
c.PrimaryAttribute = PrimaryAttribute.STR;
= c.ExINT;
= c.ExSTR;
c.ExINT = -c.BaseINT;
c.ExSTR = + c.BaseINT + ;
c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
}
}
else
{
if (c.PrimaryAttribute == PrimaryAttribute.STR)
{
double pastHP = c.HP;
double pastMaxHP = c.MaxHP;
double pastMP = c.MP;
double pastMaxMP = c.MaxMP;
c.PrimaryAttribute = PrimaryAttribute.INT;
= c.ExINT;
= c.ExSTR;
c.ExINT = + c.BaseSTR + ;
c.ExSTR = -c.BaseSTR;
c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
}
}
}
}
}
}

View File

@ -60,18 +60,18 @@ namespace Milimoe.FunGame.Testing.Skills
}
}
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime)
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8);
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!actor.Effects.Contains(this))
if (!caster.Effects.Contains(this))
{
actor.Effects.Add(this);
OnEffectGained(actor);
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}

View File

@ -28,7 +28,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override string Description => $"普通攻击硬直时间减少 20%。";
public override bool TargetSelf => true;
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime)
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8);
}

View File

@ -23,7 +23,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => "魔法涌流";
public override string Description => $"{Duration} 秒内,增加所有伤害的 {减伤比例 * 100}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。";
public override string Description => $"{Duration} 秒内,增加所有伤害的 {减伤比例 * 100:f2}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 25;
@ -42,22 +42,23 @@ namespace Milimoe.FunGame.Testing.Skills
character.NormalAttack.SetMagicType(false, character.MagicType);
}
public override void AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
public override bool AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (enemy == Skill.Character)
{
damage = Calculation.Round2Digits(damage * (1 - ));
}
return false;
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!actor.Effects.Contains(this))
if (!caster.Effects.Contains(this))
{
= 0;
actor.Effects.Add(this);
OnEffectGained(actor);
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}

View File

@ -23,7 +23,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"进入不可选中状态,获得 100 行动速度,提高 15% 闪避率和 15% 暴击率,持续 {Duration} 时间。破隐一击:在持续时间内,首次造成伤害会附加 {Calculation.Round2Digits((1.5 + 1.5 * (Skill.Level - 1)) * 100)}% 敏捷 [ {伤害加成} ] 的强化伤害,并解除不可选中状态。";
public override string Description => $"进入不可选中状态,获得 100 行动速度,提高 8% 暴击率,持续 {Duration} 时间。破隐一击:在持续时间内,首次造成伤害会附加 {Calculation.Round2Digits((1.5 + 1.5 * (Skill.Level - 1)) * 100)}% 敏捷 [ {伤害加成} ] 的强化伤害,并解除不可选中状态。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 15 + (2 * (Level - 1));
@ -46,10 +46,10 @@ namespace Milimoe.FunGame.Testing.Skills
public override void OnEffectGained(Character character)
{
Skill.IsInEffect = true;
character.IsUnselectable = true;
character.CharacterEffectControlTypes.Add(this, [EffectControlType.Unselectable]);
character.UpdateCharacterState();
character.ExSPD += 100;
character.ExEvadeRate += 0.15;
character.ExCritRate += 0.15;
character.ExCritRate += 0.08;
}
public override void OnEffectLost(Character character)
@ -58,35 +58,37 @@ namespace Milimoe.FunGame.Testing.Skills
if (!)
{
// 在没有打出破隐一击的情况下,恢复角色状态
character.IsUnselectable = false;
character.CharacterEffectControlTypes.Remove(this);
character.UpdateCharacterState();
}
character.ExSPD -= 100;
character.ExEvadeRate -= 0.15;
character.ExCritRate -= 0.15;
character.ExCritRate -= 0.08;
}
public override void AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
public override bool AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (character == Skill.Character && )
{
= false;
= true;
character.IsUnselectable = false;
character.CharacterEffectControlTypes.Remove(this);
character.UpdateCharacterState();
double d = ;
damage = Calculation.Round2Digits(damage + d);
WriteLine($"[ {character} ] 触发了疾风步破隐一击,获得了 [ {d} ] 点伤害加成!");
}
return false;
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
if (!actor.Effects.Contains(this))
if (!caster.Effects.Contains(this))
{
= true;
= false;
RemainDuration = Duration;
actor.Effects.Add(this);
OnEffectGained(actor);
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}

View File

@ -0,0 +1,90 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 4011;
public override string Name => "平衡强化";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character)
{
Effects.Add(new (this));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
{
return Effects;
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"敏捷提高20%然后将目前的力量补充到与敏捷持平持续30秒。";
public override bool TargetSelf => true;
private double = 0;
private double = 0;
public override void OnAttributeChanged(Character character)
{
if (Skill.Character != null)
{
if (Skill.Character.PrimaryAttribute == PrimaryAttribute.INT)
{
double diff = character.ExSTR - ;
character.ExINT = + character.BaseSTR + diff;
}
else if (Skill.Character.PrimaryAttribute == PrimaryAttribute.STR)
{
double diff = character.ExINT - ;
character.ExSTR = + character.BaseINT + diff;
}
}
}
public override void OnTimeElapsed(Character character, double elapsed)
{
if (Skill.Character != null)
{
Character c = Skill.Character;
if (c.HP < c.MaxHP * 0.3)
{
if (c.PrimaryAttribute == PrimaryAttribute.INT)
{
double pastHP = c.HP;
double pastMaxHP = c.MaxHP;
double pastMP = c.MP;
double pastMaxMP = c.MaxMP;
c.PrimaryAttribute = PrimaryAttribute.STR;
= c.ExINT;
= c.ExSTR;
c.ExINT = -c.BaseINT;
c.ExSTR = + c.BaseINT + ;
c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
}
}
else
{
if (c.PrimaryAttribute == PrimaryAttribute.STR)
{
double pastHP = c.HP;
double pastMaxHP = c.MaxHP;
double pastMP = c.MP;
double pastMaxMP = c.MaxMP;
c.PrimaryAttribute = PrimaryAttribute.INT;
= c.ExINT;
= c.ExSTR;
c.ExINT = + c.BaseSTR + ;
c.ExSTR = -c.BaseSTR;
c.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
}
}
}
}
}
}

View File

@ -0,0 +1,30 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 4011;
public override string Name => "敏捷之刃";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public (Character character) : base(SkillType.Passive, character)
{
Effects.Add(new (this));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
{
return Effects;
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"每次普通攻击都将附带基于敏捷的魔法伤害。";
public override bool TargetSelf => true;
}
}

View File

@ -1,4 +1,5 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
@ -24,7 +25,35 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"每时间提升 2.5% 所有伤害,无上限,但受到伤害时效果清零。";
public override string Description => $"每时间提升 5.5% 所有伤害,无上限,但受到伤害时效果清零。" + ( > 0 ? $"(当前总提升:{累计伤害 * 100:f2}%" : "");
public override bool TargetSelf => true;
private readonly double = 0.055;
private double = 0;
public override bool AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (damageResult != DamageResult.Evaded)
{
if (enemy == Skill.Character && damage > 0 && !enemy.Effects.Where(e => e is ).Any())
{
= 0;
}
if (character == Skill.Character)
{
double = Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
if ( > 0) WriteLine($"[ {character} ] 的伤害提升了 {实际伤害提升} 点!");
}
}
return false;
}
public override void OnTimeElapsed(Character character, double eapsed)
{
= Calculation.Round4Digits( + * eapsed);
WriteLine($"[ {character} ] 的 [ {Name} ] 效果增加了,当前总提升:{累计伤害 * 100:f2}%。");
}
}
}

View File

@ -0,0 +1,74 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 3007;
public override string Name => "绝对领域";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => Math.Max(100, Character?.EP ?? 100);
public override double CD => 32;
public override double HardnessTime => 12;
public (Character character) : base(SkillType.SuperSkill, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 时间内无法受到任何伤害,且敏捷提升 {系数 * 100:f2}% [ {敏捷提升} ]。此技能会消耗至少 100 点能量。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => Calculation.Round2Digits(20 + * 0.03);
private double => Calculation.Round4Digits(0.3 + 0.04 * (Level - 1));
private double => Calculation.Round2Digits( * Skill.Character?.BaseAGI ?? 0);
private double = 0;
private double = 0;
public override void OnEffectGained(Character character)
{
= ;
character.ExAGI += ;
WriteLine($"[ {character} ] 的敏捷提升了 {系数 * 100:f2}% [ {实际敏捷提升} ] ");
}
public override void OnEffectLost(Character character)
{
character.ExAGI -= ;
}
public override bool AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (enemy == Skill.Character && damageResult != DamageResult.Evaded)
{
WriteLine($"[ {enemy} ] 发动了绝对领域,巧妙的化解了此伤害!");
return true;
}
return false;
}
public override void OnSkillCasting(Character caster)
{
= caster.EP;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))
{
= 0;
caster.Effects.Add(this);
OnEffectGained(caster);
}
}
}
}

View File

@ -25,7 +25,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.GetMagicName(MagicType)}。";
public override string Description => $"对目标敌人造成 {Calculation.Round2Digits(90 + 60 * (Skill.Level - 1))} + {Calculation.Round2Digits((1.2 + 1.8 * (Skill.Level - 1)) * 100)}% 智力 [ {Damage} ] 点{CharacterSet.GetMagicName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
@ -42,10 +42,13 @@ namespace Milimoe.FunGame.Testing.Skills
}
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
Character enemy = enemys[new Random().Next(enemys.Count)];
DamageToEnemy(actor, enemy, true, MagicType, Damage);
if (enemys.Count > 0)
{
Character enemy = enemys[new Random().Next(enemys.Count)];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}
}
}

View File

@ -48,9 +48,6 @@ namespace Addons
get
{
List<Skill> list = [];
Skill s = Factory.GetSkill();
s.Name = "Example Skill";
list.Add(s);
return list;
}
}