添加新的技能

This commit is contained in:
milimoe 2024-09-11 00:54:38 +08:00
parent d2938baf67
commit aeb5674d0d
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
9 changed files with 347 additions and 41 deletions

View File

@ -153,6 +153,36 @@ if (list.Count > 3)
c.Skills.Add(); c.Skills.Add();
} }
if (c== character4)
{
Skill = new (c)
{
Level = 1
};
c.Skills.Add();
Skill = new (c)
{
Level = slevel
};
c.Skills.Add();
}
if (c== character5)
{
Skill = new (c)
{
Level = 1
};
c.Skills.Add();
Skill = new (c)
{
Level = slevel
};
c.Skills.Add();
}
if (c == character9) if (c == character9)
{ {
Skill = new (c) Skill = new (c)
@ -162,7 +192,8 @@ if (list.Count > 3)
c.Skills.Add(); c.Skills.Add();
} }
if (c != character1 && c != character2 && c != character3) if (c != character1 && c != character2 && c != character3 && c != character4 &&
c != character5)
{ {
Skill = new (c) Skill = new (c)
{ {
@ -187,6 +218,26 @@ if (list.Count > 3)
int i = 1; int i = 1;
while (i < 999) while (i < 999)
{ {
if (i == 998)
{
Console.WriteLine($"=== 终局审判 ===");
Dictionary<Character, double> = [];
foreach (Character c in characters)
{
.TryAdd(c, Calculation.Round4Digits(c.HP / c.MaxHP));
}
double max = .Values.Max();
Character winner = .Keys.Where(c => [c] == max).First();
Console.WriteLine("[ " + winner + " ] 成为了天选之人!!");
foreach (Character c in characters.Where(c => c != winner && c.HP > 0))
{
Console.WriteLine("[ " + winner + " ] 对 [ " + c + " ] 造成了 99999999999 点真实伤害。");
actionQueue.DeathCalculation(winner, c);
}
actionQueue.EndGameInfo(winner);
break;
}
// 检查是否有角色可以行动 // 检查是否有角色可以行动
Character? characterToAct = actionQueue.NextCharacter(); Character? characterToAct = actionQueue.NextCharacter();

View File

@ -0,0 +1,62 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 3004;
public override string Name => "三重叠加";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100;
public override double CD => 35 - 2 * (Level - 1);
public override double HardnessTime => 10;
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 => "三重叠加";
public override string Description => $"使 [ 灵能反射 ] 的当前释放魔法次数归零,并且最大消除次数提高到 {灵能反射次数},并且在魔法命中时能够回复所回复能量值的 10 倍魔法值,持续 {技能持续次数} 次(灵能反射每消除次数达到最大时算一次)。" +
$"(剩余:{剩余持续次数} 次)";
public override bool TargetSelf => true;
public int { get; set; } = 0;
private readonly int = 3;
private readonly int = 2;
public override void OnEffectGained(Character character)
{
IEnumerable<Effect> effects = character.Effects.Where(e => e is );
if (effects.Any() && effects.First() is e)
{
e. = 3;
e. = 0;
}
}
public override void OnEffectLost(Character character)
{
IEnumerable<Effect> effects = character.Effects.Where(e => e is );
if (effects.Any() && effects.First() is e)
{
e. = 2;
}
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
= ;
if (!actor.Effects.Contains(this))
{
actor.Effects.Add(this);
OnEffectGained(actor);
}
}
}
}

View File

@ -1,30 +0,0 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills
{
public class : Skill
{
public override long Id => 4004;
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

@ -0,0 +1,84 @@
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 => 4004;
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 => $"每释放 {触发硬直次数} 次魔法才会触发硬直时间,且魔法命中时基于 25% 智力 [{获得额外能量值}] 获得额外能量值。";
public override bool TargetSelf => true;
public int { get; set; } = 2;
public int { get; set; } = 0;
public double
{
get
{
return Calculation.Round2Digits(0.25 * Skill.Character?.INT ?? 0);
}
}
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
if (character == Skill.Character && isMagicDamage && damageResult != DamageResult.Evaded && character.EP < 200)
{
double = ;
character.EP += ;
WriteLine("[ " + character + " ] 发动了灵能反射!额外获得了 " + + " 能量!");
IEnumerable<Effect> effects = character.Effects.Where(e => e is );
if (effects.Any() && effects.First() is e)
{
double = Calculation.Round2Digits( * 10);
character.MP += ;
WriteLine("[ " + character + " ] 发动了三重叠加!额外获得了 " + + " 魔法值!");
}
}
}
public override void AlterHardnessTimeAfterCastSkill(Character character, ref double baseHardnessTime)
{
++;
if ( < )
{
baseHardnessTime = 0;
WriteLine($"[ {character} ] 发动了灵能反射,消除了硬直时间!!");
}
else
{
= 0;
IEnumerable<Effect> effects = character.Effects.Where(e => e is );
if (effects.Any() && effects.First() is e)
{
baseHardnessTime = 0;
WriteLine($"[ {character} ] 发动了灵能反射,消除了硬直时间!!");
e.--;
if (e. == 0)
{
character.Effects.Remove(e);
e.OnEffectLost(character);
}
}
}
}
}
}

View File

@ -0,0 +1,77 @@
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 => 3005;
public override string Name => "变幻之心";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100;
public override double CD => 30;
public override double HardnessTime => 10;
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 => "变幻之心";
public override string Description => $"检查 [ 智慧与力量 ] 的模式。在力量模式下,立即回复 {生命值回复 * 100}% 生命值;智力模式下,下一次魔法伤害提升 {伤害提升 * 100}%。";
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));
public override void OnEffectGained(Character character)
{
Skill.IsInEffect = true;
}
public override void OnEffectLost(Character character)
{
Skill.IsInEffect = false;
}
public override void AlterExpectedDamageBeforeCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType)
{
if (character == Skill.Character && isMagicDamage)
{
double = ;
double = Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
WriteLine("[ " + character + " ] 发动了变幻之心!伤害提升了 " + + " 点!");
character.Effects.Remove(this);
OnEffectLost(character);
}
}
public override void OnSkillCasted(Character actor, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
IEnumerable<Effect> effects = actor.Effects.Where(e => e is );
if (effects.Any())
{
if (actor.PrimaryAttribute == PrimaryAttribute.STR)
{
double = Calculation.Round2Digits( * actor.MaxHP);
actor.HP += ;
WriteLine("[ " + actor + " ] 发动了变幻之心!回复了 " + + " 点生命值!");
}
else if (actor.PrimaryAttribute == PrimaryAttribute.INT)
{
if (!actor.Effects.Contains(this))
{
actor.Effects.Add(this);
OnEffectGained(actor);
}
}
}
}
}
}

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; using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Testing.Skills namespace Milimoe.FunGame.Testing.Skills
@ -24,7 +25,68 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public override long Id => Skill.Id; public override long Id => Skill.Id;
public override string Name => Skill.Name; public override string Name => Skill.Name;
public override string Description => $"当生命值低于 30% 时,智力转化为力量;当生命值高于或等于 30% 时,力量转化为智力。"; public override string Description => $"当生命值低于 30% 时,智力转化为力量;当生命值高于或等于 30% 时,力量转化为智力。" +
(Skill.Character != null ? "(当前模式:" + CharacterSet.GetPrimaryAttributeName(Skill.Character.PrimaryAttribute) + "" : "");
public override bool TargetSelf => true; 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

@ -65,7 +65,7 @@ namespace Milimoe.FunGame.Testing.Skills
character.ExCritRate -= 0.15; character.ExCritRate -= 0.15;
} }
public override void AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, bool isCritical) public override void AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{ {
if (character == Skill.Character && ) if (character == Skill.Character && )
{ {

View File

@ -10,7 +10,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override string Name => "魔法涌流"; public override string Name => "魔法涌流";
public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double EPCost => 100; public override double EPCost => 100;
public override double CD => 65; public override double CD => 35;
public override double HardnessTime => 10; public override double HardnessTime => 10;
public (Character character) : base(SkillType.SuperSkill, character) public (Character character) : base(SkillType.SuperSkill, character)
@ -23,12 +23,12 @@ namespace Milimoe.FunGame.Testing.Skills
{ {
public override long Id => Skill.Id; public override long Id => Skill.Id;
public override string Name => "魔法涌流"; public override string Name => "魔法涌流";
public override string Description => $"{Duration} 秒内,增加所有伤害的20%伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。"; public override string Description => $"{Duration} 秒内,增加所有伤害的 {减伤比例 * 100}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。";
public override bool TargetSelf => true; public override bool TargetSelf => true;
public override bool Durative => true; public override bool Durative => true;
public override double Duration => 50; public override double Duration => 25;
private double => Calculation.Round2Digits(0.2 + 0.02 * (Level -1)); private double => Calculation.Round2Digits(0.1 + 0.02 * (Level -1));
private double = 0; private double = 0;
public override void OnEffectGained(Character character) public override void OnEffectGained(Character character)
@ -42,7 +42,7 @@ namespace Milimoe.FunGame.Testing.Skills
character.NormalAttack.SetMagicType(false, character.MagicType); character.NormalAttack.SetMagicType(false, character.MagicType);
} }
public override void AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, bool isCritical) public override void AlterActualDamageAfterCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{ {
if (enemy == Skill.Character) if (enemy == Skill.Character)
{ {

View File

@ -28,9 +28,9 @@ namespace Milimoe.FunGame.Testing.Skills
public override string Description => $"造成魔法伤害时有 35% 几率使敌人眩晕 1 回合。"; public override string Description => $"造成魔法伤害时有 35% 几率使敌人眩晕 1 回合。";
public override bool TargetSelf => true; public override bool TargetSelf => true;
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, bool isCritical) public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{ {
if (character == Skill.Character && isMagicDamage && new Random().NextDouble() < 0.35) if (character == Skill.Character && isMagicDamage && damageResult != DamageResult.Evaded && new Random().NextDouble() < 0.35)
{ {
IEnumerable<Effect> effects = enemy.Effects.Where(e => e is && e.Skill == Skill); IEnumerable<Effect> effects = enemy.Effects.Where(e => e is && e.Skill == Skill);
if (effects.Any()) if (effects.Any())