mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-23 04:19:36 +08:00
百分比特效添加 OnAttributeChanged
This commit is contained in:
parent
8359b9e018
commit
aa697daee5
@ -765,11 +765,11 @@ namespace Oshima.Core.Utils
|
||||
|
||||
if (id == 9)
|
||||
{
|
||||
Skill 玻璃大炮 = new 玻璃大炮(character)
|
||||
Skill 破釜沉舟 = new 破釜沉舟(character)
|
||||
{
|
||||
Level = passiveLevel
|
||||
};
|
||||
character.Skills.Add(玻璃大炮);
|
||||
character.Skills.Add(破釜沉舟);
|
||||
|
||||
Skill 迅捷之势 = new 迅捷之势(character)
|
||||
{
|
||||
|
@ -255,11 +255,11 @@ namespace Oshima.Core.Utils
|
||||
|
||||
if (c == character9)
|
||||
{
|
||||
Skill 玻璃大炮 = new 玻璃大炮(c)
|
||||
Skill 破釜沉舟 = new 破釜沉舟(c)
|
||||
{
|
||||
Level = 1
|
||||
};
|
||||
c.Skills.Add(玻璃大炮);
|
||||
c.Skills.Add(破釜沉舟);
|
||||
|
||||
Skill 迅捷之势 = new 迅捷之势(c)
|
||||
{
|
||||
|
@ -25,6 +25,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
character.ExAGI -= 实际加成;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(Character character)
|
||||
{
|
||||
// 刷新加成
|
||||
OnEffectLost(character);
|
||||
OnEffectGained(character);
|
||||
}
|
||||
|
||||
public ExAGI2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
|
@ -25,6 +25,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
character.ExATK2 -= 实际加成;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(Character character)
|
||||
{
|
||||
// 刷新加成
|
||||
OnEffectLost(character);
|
||||
OnEffectGained(character);
|
||||
}
|
||||
|
||||
public ExATK2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
|
@ -25,6 +25,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
character.ExDEF2 -= 实际加成;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(Character character)
|
||||
{
|
||||
// 刷新加成
|
||||
OnEffectLost(character);
|
||||
OnEffectGained(character);
|
||||
}
|
||||
|
||||
public ExDEF2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
|
@ -25,6 +25,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
character.ExINT -= 实际加成;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(Character character)
|
||||
{
|
||||
// 刷新加成
|
||||
OnEffectLost(character);
|
||||
OnEffectGained(character);
|
||||
}
|
||||
|
||||
public ExINT2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
|
@ -25,6 +25,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
character.ExHP2 -= 实际加成;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(Character character)
|
||||
{
|
||||
// 刷新加成
|
||||
OnEffectLost(character);
|
||||
OnEffectGained(character);
|
||||
}
|
||||
|
||||
public ExMaxHP2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
|
@ -25,6 +25,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
character.ExMP2 -= 实际加成;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(Character character)
|
||||
{
|
||||
// 刷新加成
|
||||
OnEffectLost(character);
|
||||
OnEffectGained(character);
|
||||
}
|
||||
|
||||
public ExMaxMP2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
|
@ -25,6 +25,13 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
character.ExSTR -= 实际加成;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(Character character)
|
||||
{
|
||||
// 刷新加成
|
||||
OnEffectLost(character);
|
||||
OnEffectGained(character);
|
||||
}
|
||||
|
||||
public ExSTR2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
|
@ -63,7 +63,7 @@ namespace Oshima.FunGame.OshimaModules
|
||||
(long)PassiveID.致命打击 => new 致命打击(),
|
||||
(long)PassiveID.毁灭之势 => new 毁灭之势(),
|
||||
(long)PassiveID.枯竭打击 => new 枯竭打击(),
|
||||
(long)PassiveID.玻璃大炮 => new 玻璃大炮(),
|
||||
(long)PassiveID.破釜沉舟 => new 破釜沉舟(),
|
||||
(long)PassiveID.累积之压 => new 累积之压(),
|
||||
(long)PassiveID.敏捷之刃 => new 敏捷之刃(),
|
||||
(long)PassiveID.弱者猎手 => new 弱者猎手(),
|
||||
|
@ -1,17 +1,22 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
using Oshima.FunGame.OshimaModules.Effects.OpenEffects;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Skills
|
||||
{
|
||||
public class 玻璃大炮 : Skill
|
||||
public class 破釜沉舟 : Skill
|
||||
{
|
||||
public override long Id => (long)PassiveID.玻璃大炮;
|
||||
public override string Name => "玻璃大炮";
|
||||
public override long Id => (long)PassiveID.破釜沉舟;
|
||||
public override string Name => "破釜沉舟";
|
||||
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
|
||||
|
||||
public 玻璃大炮(Character? character = null) : base(SkillType.Passive, character)
|
||||
public 破釜沉舟(Character? character = null) : base(SkillType.Passive, character)
|
||||
{
|
||||
Effects.Add(new 玻璃大炮特效(this));
|
||||
Effects.Add(new 破釜沉舟特效(this));
|
||||
Effects.Add(new ExMaxHP2(this, new()
|
||||
{
|
||||
{ "exhp", -0.3 }
|
||||
}));
|
||||
}
|
||||
|
||||
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
|
||||
@ -20,11 +25,11 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
}
|
||||
}
|
||||
|
||||
public class 玻璃大炮特效(Skill skill) : Effect(skill)
|
||||
public class 破釜沉舟特效(Skill skill) : Effect(skill)
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"生命值高于 30% 时,受到额外的 [ {高于30额外伤害下限}~{高于30额外伤害上限}% ] 伤害,但是获得 [ 累计所受伤害的 {高于30的加成下限}~{高于30的加成上限}% ] 伤害加成;生命值低于等于 30% 时,不会受到额外的伤害,仅能获得 [ 累计受到的伤害 {低于30的加成下限}~{低于30的加成上限}% ] 伤害加成。" +
|
||||
public override string Description => $"最大生命值减少 30%。破釜沉舟:生命值高于 30% 时,受到额外的 [ {高于30额外伤害下限}~{高于30额外伤害上限}% ] 伤害,但是获得 [ 累计所受伤害的 {高于30的加成下限}~{高于30的加成上限}% ] 伤害加成;生命值低于等于 30% 时,不会受到额外的伤害,仅能获得 [ 累计受到的伤害 {低于30的加成下限}~{低于30的加成上限}% ] 伤害加成。" +
|
||||
$"在没有受到任何伤害的时候,将获得 {常规伤害加成 * 100:0.##}% 伤害加成。" + (累计受到的伤害 > 0 ? $"(当前累计受到伤害:{累计受到的伤害:0.##})" : "");
|
||||
|
||||
private double 累计受到的伤害 = 0;
|
||||
@ -63,7 +68,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
if (character == Skill.Character)
|
||||
{
|
||||
这次的伤害加成 = 伤害加成(damage);
|
||||
WriteLine($"[ {character} ] 发动了玻璃大炮,获得了 {这次的伤害加成:0.##} 点伤害加成!");
|
||||
WriteLine($"[ {character} ] 发动了破釜沉舟,获得了 {这次的伤害加成:0.##} 点伤害加成!");
|
||||
累计受到的伤害 = 0;
|
||||
return 这次的伤害加成;
|
||||
}
|
||||
@ -76,7 +81,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
// 额外受到伤害
|
||||
double 系数 = (Random.Shared.Next(高于30额外伤害下限, 高于30额外伤害上限) + 0.0) / 100;
|
||||
这次受到的额外伤害 = damage * 系数;
|
||||
WriteLine($"[ {enemy} ] 的玻璃大炮触发,将额外受到 {这次受到的额外伤害:0.##} 点伤害!");
|
||||
WriteLine($"[ {enemy} ] 的破釜沉舟触发,将额外受到 {这次受到的额外伤害:0.##} 点伤害!");
|
||||
}
|
||||
else 这次受到的额外伤害 = 0;
|
||||
return 这次受到的额外伤害;
|
||||
@ -93,7 +98,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
if (enemy.HP < 0 && 受到伤害之前的HP - damage + 这次受到的额外伤害 > 0)
|
||||
{
|
||||
enemy.HP = 10;
|
||||
WriteLine($"[ {enemy} ] 的玻璃大炮触发,保护了自己不进入死亡!!");
|
||||
WriteLine($"[ {enemy} ] 的破釜沉舟触发,保护了自己不进入死亡!!");
|
||||
}
|
||||
}
|
||||
}
|
@ -91,7 +91,7 @@
|
||||
致命打击 = 4006,
|
||||
毁灭之势 = 4007,
|
||||
枯竭打击 = 4008,
|
||||
玻璃大炮 = 4009,
|
||||
破釜沉舟 = 4009,
|
||||
累积之压 = 4010,
|
||||
敏捷之刃 = 4011,
|
||||
弱者猎手 = 4012,
|
||||
|
Loading…
x
Reference in New Issue
Block a user