chore: initialize OshimaBot repository (rename from Enhancement)
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 吸取生命值 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"吸取{Skill.TargetDescription()}的{(是否是百分比 ? $" {Calculation.PercentageCheck(Earned) * 100:0.##}% 当前" : $"至多 {Earned:0.##} 点")}生命值(每个角色)," +
|
||||
$"并将吸取总量的 {转化百分比 * 100:0.##}% 转化为自身生命值。";
|
||||
|
||||
private double Earned => Skill.Level > 0 ? 基础数值 + 等级成长 * (Skill.Level - 1) : 基础数值;
|
||||
private double 基础数值 { get; set; } = 200;
|
||||
private double 等级成长 { get; set; } = 100;
|
||||
private bool 是否是百分比 { get; set; } = false;
|
||||
private double 转化百分比 { get; set; } = 1;
|
||||
|
||||
public 吸取生命值(Skill skill, double 基础数值, double 等级成长, bool 是否是百分比 = false, double 转化百分比 = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值 = 基础数值;
|
||||
this.等级成长 = 等级成长;
|
||||
this.是否是百分比 = 是否是百分比;
|
||||
this.转化百分比 = Calculation.PercentageCheck(转化百分比);
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
double total = 0;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
double earned = Earned;
|
||||
if (是否是百分比)
|
||||
{
|
||||
earned = target.HP * earned;
|
||||
}
|
||||
else if (earned > target.HP)
|
||||
{
|
||||
earned = target.HP;
|
||||
}
|
||||
if (earned > 0)
|
||||
{
|
||||
target.HP -= earned;
|
||||
total += earned;
|
||||
GamingQueue?.CalculateCharacterDamageStatistics(caster, target, earned, FunGame.Core.Library.Constant.DamageType.True);
|
||||
}
|
||||
}
|
||||
total *= 转化百分比;
|
||||
caster.HP += total;
|
||||
WriteLine($"[ {caster} ] 吸取了 [ {string.Join(" ] / [ ", targets)} ] 的 {total:0.##} 点生命值!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 吸取能量值 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"吸取{Skill.TargetDescription()}的{(是否是百分比 ? $" {Calculation.PercentageCheck(Earned) * 100:0.##}% 当前" : $"至多 {Earned:0.##} 点")}能量值(每个角色)," +
|
||||
$"并将吸取总量的 {转化百分比 * 100:0.##}% 转化为自身能量值。";
|
||||
|
||||
private double Earned => Skill.Level > 0 ? 基础数值 + 等级成长 * (Skill.Level - 1) : 基础数值;
|
||||
private double 基础数值 { get; set; } = 5;
|
||||
private double 等级成长 { get; set; } = 1;
|
||||
private bool 是否是百分比 { get; set; } = false;
|
||||
private double 转化百分比 { get; set; } = 1;
|
||||
|
||||
public 吸取能量值(Skill skill, double 基础数值, double 等级成长, bool 是否是百分比 = false, double 转化百分比 = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值 = 基础数值;
|
||||
this.等级成长 = 等级成长;
|
||||
this.是否是百分比 = 是否是百分比;
|
||||
this.转化百分比 = Calculation.PercentageCheck(转化百分比);
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
double total = 0;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
double earned = Earned;
|
||||
if (是否是百分比)
|
||||
{
|
||||
earned = target.EP * earned;
|
||||
}
|
||||
else if (earned > target.EP)
|
||||
{
|
||||
earned = target.EP;
|
||||
}
|
||||
if (earned > 0)
|
||||
{
|
||||
target.EP -= earned;
|
||||
total += earned;
|
||||
}
|
||||
}
|
||||
total *= 转化百分比;
|
||||
caster.EP += total;
|
||||
WriteLine($"[ {caster} ] 吸取了 [ {string.Join(" ] / [ ", targets)} ] 的 {total:0.##} 点能量值!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 吸取魔法值 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"吸取{Skill.TargetDescription()}的{(是否是百分比 ? $" {Calculation.PercentageCheck(Earned) * 100:0.##}% 当前" : $"至多 {Earned:0.##} 点")}魔法值(每个角色)," +
|
||||
$"并将吸取总量的 {转化百分比 * 100:0.##}% 转化为自身魔法值。";
|
||||
|
||||
private double Earned => Skill.Level > 0 ? 基础数值 + 等级成长 * (Skill.Level - 1) : 基础数值;
|
||||
private double 基础数值 { get; set; } = 150;
|
||||
private double 等级成长 { get; set; } = 75;
|
||||
private bool 是否是百分比 { get; set; } = false;
|
||||
private double 转化百分比 { get; set; } = 1;
|
||||
|
||||
public 吸取魔法值(Skill skill, double 基础数值, double 等级成长, bool 是否是百分比 = false, double 转化百分比 = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值 = 基础数值;
|
||||
this.等级成长 = 等级成长;
|
||||
this.是否是百分比 = 是否是百分比;
|
||||
this.转化百分比 = Calculation.PercentageCheck(转化百分比);
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
double total = 0;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
double earned = Earned;
|
||||
if (是否是百分比)
|
||||
{
|
||||
earned = target.MP * earned;
|
||||
}
|
||||
else if (earned > target.MP)
|
||||
{
|
||||
earned = target.MP;
|
||||
}
|
||||
if (earned > 0)
|
||||
{
|
||||
target.MP -= earned;
|
||||
total += earned;
|
||||
}
|
||||
}
|
||||
total *= 转化百分比;
|
||||
caster.MP += total;
|
||||
WriteLine($"[ {caster} ] 吸取了 [ {string.Join(" ] / [ ", targets)} ] 的 {total:0.##} 点魔法值!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 基于属性的伤害 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成 {BaseDamage:0.##} + {AttributeCoefficient * 100:0.##}% {CharacterSet.GetPrimaryAttributeName(基于属性)} [ {Damage:0.##} ] 点{CharacterSet.GetDamageTypeName(DamageType, MagicType)}。";
|
||||
private double BaseDamage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害;
|
||||
private double AttributeCoefficient => Skill.Level > 0 ? 基础属性系数 + 基础系数等级成长 * (Skill.Level - 1) : 基础属性系数;
|
||||
private double Damage
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Skill.Character != null)
|
||||
{
|
||||
double paValue = 基于属性 switch
|
||||
{
|
||||
PrimaryAttribute.STR => Skill.Character.STR,
|
||||
PrimaryAttribute.AGI => Skill.Character.AGI,
|
||||
_ => Skill.Character.INT,
|
||||
};
|
||||
return BaseDamage + AttributeCoefficient * paValue;
|
||||
}
|
||||
return BaseDamage;
|
||||
}
|
||||
}
|
||||
|
||||
private PrimaryAttribute 基于属性 { get; set; } = PrimaryAttribute.INT;
|
||||
private double 基础数值伤害 { get; set; } = 100;
|
||||
private double 基础伤害等级成长 { get; set; } = 50;
|
||||
private double 基础属性系数 { get; set; } = 0.4;
|
||||
private double 基础系数等级成长 { get; set; } = 0.4;
|
||||
private DamageType DamageType { get; set; } = DamageType.Magical;
|
||||
|
||||
public 基于属性的伤害(Skill skill, PrimaryAttribute 基于属性, double 基础数值伤害, double 基础伤害等级成长, double 基础属性系数, double 基础系数等级成长, DamageType damageType = DamageType.Magical, MagicType magicType = MagicType.None) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基于属性 = 基于属性;
|
||||
this.基础数值伤害 = 基础数值伤害;
|
||||
this.基础伤害等级成长 = 基础伤害等级成长;
|
||||
this.基础属性系数 = 基础属性系数;
|
||||
this.基础系数等级成长 = 基础系数等级成长;
|
||||
DamageType = damageType;
|
||||
MagicType = magicType;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
DamageToEnemy(caster, enemy, DamageType, MagicType, Damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 基于攻击力的伤害_带基础伤害 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成 {BaseDamage:0.##} + {ATKCoefficient * 100:0.##}% 攻击力 [ {Damage:0.##} ] 点{CharacterSet.GetDamageTypeName(DamageType, MagicType)}。";
|
||||
|
||||
private double BaseDamage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害;
|
||||
private double ATKCoefficient => Skill.Level > 0 ? 基础攻击力系数 + 基础系数等级成长 * (Skill.Level - 1) : 基础攻击力系数;
|
||||
private double Damage => BaseDamage + (ATKCoefficient * Skill.Character?.ATK ?? 0);
|
||||
private double 基础数值伤害 { get; set; } = 100;
|
||||
private double 基础伤害等级成长 { get; set; } = 50;
|
||||
private double 基础攻击力系数 { get; set; } = 0.2;
|
||||
private double 基础系数等级成长 { get; set; } = 0.2;
|
||||
private DamageType DamageType { get; set; } = DamageType.Magical;
|
||||
|
||||
public 基于攻击力的伤害_带基础伤害(Skill skill, double 基础数值伤害, double 基础伤害等级成长, double 基础攻击力系数, double 基础系数等级成长, DamageType damageType = DamageType.Magical, MagicType magicType = MagicType.None) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值伤害 = 基础数值伤害;
|
||||
this.基础伤害等级成长 = 基础伤害等级成长;
|
||||
this.基础攻击力系数 = 基础攻击力系数;
|
||||
this.基础系数等级成长 = 基础系数等级成长;
|
||||
DamageType = damageType;
|
||||
MagicType = magicType;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
DamageToEnemy(caster, enemy, DamageType, MagicType, Damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 基于攻击力的伤害_无基础伤害 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成 {ATKCoefficient * 100:0.##}% 攻击力 [ {Damage:0.##} ] 点{CharacterSet.GetDamageTypeName(DamageType, MagicType)}。";
|
||||
|
||||
private double ATKCoefficient => Skill.Level > 0 ? 基础攻击力系数 + 基础系数等级成长 * (Skill.Level - 1) : 基础攻击力系数;
|
||||
private double Damage => ATKCoefficient * Skill.Character?.ATK ?? 0;
|
||||
private double 基础攻击力系数 { get; set; } = 1.5;
|
||||
private double 基础系数等级成长 { get; set; } = 0.25;
|
||||
private DamageType DamageType { get; set; } = DamageType.Magical;
|
||||
|
||||
public 基于攻击力的伤害_无基础伤害(Skill skill, double 基础攻击力系数, double 基础系数等级成长, DamageType damageType = DamageType.Magical, MagicType magicType = MagicType.None) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础攻击力系数 = 基础攻击力系数;
|
||||
this.基础系数等级成长 = 基础系数等级成长;
|
||||
DamageType = damageType;
|
||||
MagicType = magicType;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
DamageToEnemy(caster, enemy, DamageType, MagicType, Damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 基于核心属性的伤害 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成 {BaseDamage:0.##} + {AttributeCoefficient * 100:0.##}% {CharacterSet.GetPrimaryAttributeName(Skill.Character?.PrimaryAttribute ?? PrimaryAttribute.INT)} [ {Damage:0.##} ] 点{CharacterSet.GetDamageTypeName(DamageType, MagicType)}。";
|
||||
|
||||
private double BaseDamage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害;
|
||||
private double AttributeCoefficient => Skill.Level > 0 ? 基础属性系数 + 基础系数等级成长 * (Skill.Level - 1) : 基础属性系数;
|
||||
private double Damage => BaseDamage + (AttributeCoefficient * Skill.Character?.PrimaryAttributeValue ?? 0);
|
||||
private double 基础数值伤害 { get; set; } = 100;
|
||||
private double 基础伤害等级成长 { get; set; } = 50;
|
||||
private double 基础属性系数 { get; set; } = 0.4;
|
||||
private double 基础系数等级成长 { get; set; } = 0.4;
|
||||
private DamageType DamageType { get; set; } = DamageType.Magical;
|
||||
|
||||
public 基于核心属性的伤害(Skill skill, double 基础数值伤害, double 基础伤害等级成长, double 基础属性系数, double 基础系数等级成长, DamageType damageType = DamageType.Magical, MagicType magicType = MagicType.None) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值伤害 = 基础数值伤害;
|
||||
this.基础伤害等级成长 = 基础伤害等级成长;
|
||||
this.基础属性系数 = 基础属性系数;
|
||||
this.基础系数等级成长 = 基础系数等级成长;
|
||||
DamageType = damageType;
|
||||
MagicType = magicType;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
DamageToEnemy(caster, enemy, DamageType, MagicType, Damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 增加混合护盾值 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{Skill.TargetDescription()}提供 {护盾值:0.##} 点混合护盾值。";
|
||||
|
||||
private double 护盾值 => Level > 0 ? Math.Abs(基础数值护盾 + 基础护盾等级成长 * (Level - 1)) : Math.Abs(基础数值护盾);
|
||||
private double 基础数值护盾 { get; set; } = 200;
|
||||
private double 基础护盾等级成长 { get; set; } = 100;
|
||||
|
||||
public 增加混合护盾值(Skill skill, double 基础数值护盾, double 基础护盾等级成长) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值护盾 = 基础数值护盾;
|
||||
this.基础护盾等级成长 = 基础护盾等级成长;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.Shield.Mix += 护盾值;
|
||||
WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点混合护盾值!");
|
||||
GamingQueue?.AddApplyEffects(target, EffectType.Shield);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 增加物理护盾_护盾值型 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{Skill.TargetDescription()}提供 {护盾值:0.##} 点物理护盾值。";
|
||||
|
||||
private double 护盾值 => Level > 0 ? Math.Abs(基础数值护盾 + 基础护盾等级成长 * (Level - 1)) : Math.Abs(基础数值护盾);
|
||||
private double 基础数值护盾 { get; set; } = 200;
|
||||
private double 基础护盾等级成长 { get; set; } = 100;
|
||||
|
||||
public 增加物理护盾_护盾值型(Skill skill, double 基础数值护盾, double 基础护盾等级成长) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值护盾 = 基础数值护盾;
|
||||
this.基础护盾等级成长 = 基础护盾等级成长;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.Shield[false] += 护盾值;
|
||||
WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点物理护盾值!");
|
||||
GamingQueue?.AddApplyEffects(target, EffectType.Shield);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 增加物理护盾_特效持续型 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{Skill.TargetDescription()}提供 {护盾值:0.##} 点物理护盾,持续 {持续时间}。";
|
||||
|
||||
private string 持续时间 => _durative && _duration > 0 ? _duration + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? _durationTurn + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 护盾值 => Level > 0 ? Math.Abs(基础数值护盾 + 基础护盾等级成长 * (Level - 1)) : Math.Abs(基础数值护盾);
|
||||
private double 基础数值护盾 { get; set; } = 200;
|
||||
private double 基础护盾等级成长 { get; set; } = 100;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 增加物理护盾_特效持续型(Skill skill, double 基础数值护盾, double 基础护盾等级成长, bool durative = false, double duration = 0, int durationTurn = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值护盾 = 基础数值护盾;
|
||||
this.基础护盾等级成长 = 基础护盾等级成长;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点物理护盾!");
|
||||
物理护盾 e = new(Skill, target, caster, 护盾值, _durative, _duration, _durationTurn)
|
||||
{
|
||||
ParentEffect = ParentEffect
|
||||
};
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
e.DispelledType = DispelledType;
|
||||
GamingQueue?.AddApplyEffects(target, EffectType.Shield);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 增加魔法护盾_护盾值型 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{Skill.TargetDescription()}提供 {护盾值:0.##} 点魔法护盾值。";
|
||||
|
||||
private double 护盾值 => Level > 0 ? Math.Abs(基础数值护盾 + 基础护盾等级成长 * (Level - 1)) : Math.Abs(基础数值护盾);
|
||||
private double 基础数值护盾 { get; set; } = 200;
|
||||
private double 基础护盾等级成长 { get; set; } = 100;
|
||||
|
||||
public 增加魔法护盾_护盾值型(Skill skill, double 基础数值护盾, double 基础护盾等级成长) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值护盾 = 基础数值护盾;
|
||||
this.基础护盾等级成长 = 基础护盾等级成长;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.Shield[true, MagicType.None] += 护盾值;
|
||||
WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点魔法护盾值!");
|
||||
GamingQueue?.AddApplyEffects(target, EffectType.Shield);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 增加魔法护盾_特效持续型 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{Skill.TargetDescription()}提供 {护盾值:0.##} 点魔法护盾,持续 {持续时间}。";
|
||||
|
||||
private string 持续时间 => _durative && _duration > 0 ? _duration + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? _durationTurn + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 护盾值 => Level > 0 ? Math.Abs(基础数值护盾 + 基础护盾等级成长 * (Level - 1)) : Math.Abs(基础数值护盾);
|
||||
private double 基础数值护盾 { get; set; } = 200;
|
||||
private double 基础护盾等级成长 { get; set; } = 100;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 增加魔法护盾_特效持续型(Skill skill, double 基础数值护盾, double 基础护盾等级成长, bool durative = false, double duration = 0, int durationTurn = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值护盾 = 基础数值护盾;
|
||||
this.基础护盾等级成长 = 基础护盾等级成长;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点魔法护盾!");
|
||||
魔法护盾 e = new(Skill, target, caster, 护盾值, _durative, _duration, _durationTurn)
|
||||
{
|
||||
ParentEffect = ParentEffect
|
||||
};
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
e.DispelledType = DispelledType;
|
||||
GamingQueue?.AddApplyEffects(target, EffectType.Shield);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 弱驱散特效 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"弱驱散{Skill.TargetDescription()}。";
|
||||
public override DispelType DispelType => DispelType.Weak;
|
||||
|
||||
public 弱驱散特效(Skill skill) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
Dictionary<Character, bool> isTeammateDictionary = GamingQueue?.GetIsTeammateDictionary(caster, targets) ?? [];
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {caster} ] 弱驱散了 [ {target} ] !");
|
||||
bool isEnemy = true;
|
||||
if (isTeammateDictionary.TryGetValue(target, out bool value))
|
||||
{
|
||||
isEnemy = !value;
|
||||
}
|
||||
Dispel(caster, target, isEnemy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 强驱散特效 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"强驱散{Skill.TargetDescription()}。";
|
||||
public override DispelType DispelType => DispelType.Strong;
|
||||
|
||||
public 强驱散特效(Skill skill) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
Dictionary<Character, bool> isTeammateDictionary = GamingQueue?.GetIsTeammateDictionary(caster, targets) ?? [];
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {caster} ] 强驱散了 [ {target} ] !");
|
||||
bool isEnemy = true;
|
||||
if (isTeammateDictionary.TryGetValue(target, out bool value))
|
||||
{
|
||||
isEnemy = !value;
|
||||
}
|
||||
Dispel(caster, target, isEnemy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 打断施法 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}施加打断施法效果:中断其正在进行的吟唱。";
|
||||
public override EffectType EffectType => EffectType.InterruptCasting;
|
||||
|
||||
public 打断施法(Skill skill) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
if (!CheckExemption(caster, target, this))
|
||||
{
|
||||
InterruptCasting(target, caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 提升友方行动速度 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"提升{Skill.TargetDescription()} {SPD:0.##} 点行动速度 {持续时间}。并缩短目标 30% 的行动等待时间(当前硬直时间)。";
|
||||
|
||||
private double SPD => Level > 0 ? Math.Abs(基础数值速度 + 基础速度等级成长 * (Level - 1)) : Math.Abs(基础数值速度);
|
||||
private double 基础数值速度 { get; set; } = 65;
|
||||
private double 基础速度等级成长 { get; set; } = 25;
|
||||
private string 持续时间 => _durative && _duration > 0 ? _duration + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? _durationTurn + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 提升友方行动速度(Skill skill, double 基础数值速度, double 基础速度等级成长, bool durative = true, double duration = 40, int durationTurn = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值速度 = 基础数值速度;
|
||||
this.基础速度等级成长 = 基础速度等级成长;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {target} ] 的行动速度提升了 {SPD:0.##} 点,行动等待时间(当前硬直时间)被缩短了 30%!持续时间:{持续时间}!");
|
||||
ExSPD e = new(Skill, new Dictionary<string, object>()
|
||||
{
|
||||
{ "exspd", SPD }
|
||||
}, caster)
|
||||
{
|
||||
Name = Name,
|
||||
Durative = _durative,
|
||||
Duration = _duration,
|
||||
DurationTurn = _durationTurn
|
||||
};
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
e.EffectType = EffectType.Haste;
|
||||
GamingQueue?.AddApplyEffects(target, e.EffectType);
|
||||
GamingQueue?.ChangeCharacterHardnessTime(target, -0.3, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 施加免疫 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}施加{CharacterSet.GetImmuneTypeName(ImmuneType)},持续 {持续时间}。";
|
||||
public override DispelledType DispelledType => _dispelledType;
|
||||
|
||||
private ImmuneType ImmuneType { get; set; } = ImmuneType.None;
|
||||
private string 持续时间 => _durative && _duration > 0 ? 实际持续时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际持续时间 => _durative && _duration > 0 ? (_duration + _levelGrowth * (Level - 1) * MagicEfficacy) : (!_durative && _durationTurn > 0 ? ((int)Math.Round(_durationTurn + _levelGrowth * (Level - 1) * MagicEfficacy, 0, MidpointRounding.ToPositiveInfinity)) : 0);
|
||||
private DispelledType _dispelledType = DispelledType.Weak;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
|
||||
public 施加免疫(Skill skill, ImmuneType type, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
ImmuneType = type;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
_dispelledType = type switch
|
||||
{
|
||||
ImmuneType.All => DispelledType.Strong,
|
||||
ImmuneType.Special => DispelledType.Special,
|
||||
_ => DispelledType.Weak
|
||||
};
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
if (target.HP <= 0) continue;
|
||||
WriteLine($"[ {caster} ] 获得了{CharacterSet.GetImmuneTypeName(ImmuneType)}!持续 {持续时间}!");
|
||||
switch (ImmuneType)
|
||||
{
|
||||
case ImmuneType.Physical:
|
||||
{
|
||||
EffectType = EffectType.PhysicalImmune;
|
||||
物理免疫 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
_dispelledType = DispelledType.Weak;
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
break;
|
||||
}
|
||||
case ImmuneType.Magical:
|
||||
{
|
||||
EffectType = EffectType.MagicalImmune;
|
||||
魔法免疫 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
_dispelledType = DispelledType.Weak;
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
break;
|
||||
}
|
||||
case ImmuneType.Skilled:
|
||||
{
|
||||
EffectType = EffectType.SkilledImmune;
|
||||
技能免疫 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
_dispelledType = DispelledType.Weak;
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
break;
|
||||
}
|
||||
case ImmuneType.All:
|
||||
{
|
||||
EffectType = EffectType.AllImmune;
|
||||
完全免疫 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
_dispelledType = DispelledType.Strong;
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
break;
|
||||
}
|
||||
}
|
||||
GamingQueue?.AddApplyEffects(target, EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 施加持续性弱驱散 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"持续弱驱散{Skill.TargetDescription()}{(_durativeWithoutDuration ? _durationString : $",持续 {持续时间}")}。\r\n持续性驱散是持续性临时驱散,它会在持续时间结束之后恢复目标尚未结束的特效。";
|
||||
public override DispelType DispelType => DispelType.DurativeWeak;
|
||||
|
||||
private string 持续时间 => _durative && _duration > 0 ? 实际持续时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际持续时间 => _durative && _duration > 0 ? (_duration + _levelGrowth * (Level - 1) * MagicEfficacy) : (!_durative && _durationTurn > 0 ? ((int)Math.Round(_durationTurn + _levelGrowth * (Level - 1) * MagicEfficacy, 0, MidpointRounding.ToPositiveInfinity)) : 0);
|
||||
private readonly bool _durativeWithoutDuration;
|
||||
private readonly string _durationString;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
|
||||
public 施加持续性弱驱散(Skill skill, bool durativeWithoutDuration = false, string durationString = "", bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_durativeWithoutDuration = durativeWithoutDuration;
|
||||
_durationString = durationString;
|
||||
if (!_durativeWithoutDuration)
|
||||
{
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
Dictionary<Character, bool> isTeammateDictionary = GamingQueue?.GetIsTeammateDictionary(caster, targets) ?? [];
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {caster} ] 对 [ {target} ] 施加了持续性弱驱散!持续时间:{持续时间}!");
|
||||
bool isDebuff = true;
|
||||
if (isTeammateDictionary.TryGetValue(target, out bool value))
|
||||
{
|
||||
isDebuff = !value;
|
||||
}
|
||||
if (target == caster)
|
||||
{
|
||||
isDebuff = false;
|
||||
}
|
||||
if (target.Effects.FirstOrDefault(e => e is 持续性弱驱散 && e.Source == Source) is 持续性弱驱散 e && e.DurativeWithoutDuration == _durativeWithoutDuration && e.Durative == _durative && e.IsDebuff == isDebuff)
|
||||
{
|
||||
if (_duration > e.Duration) e.Duration = _duration;
|
||||
if (_durationTurn > e.DurationTurn) e.DurationTurn = _durationTurn;
|
||||
e.DispelledType = DispelledType;
|
||||
e.ParentEffect = ParentEffect;
|
||||
}
|
||||
else
|
||||
{
|
||||
e = new(Skill, caster, _durativeWithoutDuration, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
e.IsDebuff = isDebuff;
|
||||
e.DispelledType = DispelledType;
|
||||
e.ParentEffect = ParentEffect;
|
||||
}
|
||||
GamingQueue?.AddApplyEffects(target, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 施加持续性强驱散 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"持续强驱散{Skill.TargetDescription()}{(_durativeWithoutDuration ? _durationString : $",持续 {持续时间}")}。\r\n持续性驱散是持续性临时驱散,它会在持续时间结束之后恢复目标尚未结束的特效。";
|
||||
public override DispelType DispelType => DispelType.DurativeStrong;
|
||||
|
||||
private string 持续时间 => _durative && _duration > 0 ? 实际持续时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际持续时间 => _durative && _duration > 0 ? (_duration + _levelGrowth * (Level - 1) * MagicEfficacy) : (!_durative && _durationTurn > 0 ? ((int)Math.Round(_durationTurn + _levelGrowth * (Level - 1) * MagicEfficacy, 0, MidpointRounding.ToPositiveInfinity)) : 0);
|
||||
private readonly bool _durativeWithoutDuration;
|
||||
private readonly string _durationString;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
|
||||
public 施加持续性强驱散(Skill skill, bool durativeWithoutDuration = false, string durationString = "", bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_durativeWithoutDuration = durativeWithoutDuration;
|
||||
_durationString = durationString;
|
||||
if (!_durativeWithoutDuration)
|
||||
{
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
Dictionary<Character, bool> isTeammateDictionary = GamingQueue?.GetIsTeammateDictionary(caster, targets) ?? [];
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {caster} ] 对 [ {target} ] 施加了持续性强驱散!持续时间:{持续时间}!");
|
||||
bool isDebuff = true;
|
||||
if (isTeammateDictionary.TryGetValue(target, out bool value))
|
||||
{
|
||||
isDebuff = !value;
|
||||
}
|
||||
if (target == caster)
|
||||
{
|
||||
isDebuff = false;
|
||||
}
|
||||
if (target.Effects.FirstOrDefault(e => e is 持续性强驱散 && e.Source == Source) is 持续性强驱散 e && e.DurativeWithoutDuration == _durativeWithoutDuration && e.Durative == _durative && e.IsDebuff == isDebuff)
|
||||
{
|
||||
if (_duration > e.Duration) e.Duration = _duration;
|
||||
if (_durationTurn > e.DurationTurn) e.DurationTurn = _durationTurn;
|
||||
e.DispelledType = DispelledType;
|
||||
e.ParentEffect = ParentEffect;
|
||||
}
|
||||
else
|
||||
{
|
||||
e = new(Skill, caster, _durativeWithoutDuration, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
e.IsDebuff = isDebuff;
|
||||
e.DispelledType = DispelledType;
|
||||
e.ParentEffect = ParentEffect;
|
||||
}
|
||||
GamingQueue?.AddApplyEffects(target, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using OshimaBot.Content.Effects;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 施加概率增益 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
SetDescription();
|
||||
return $"{概率文本}对{Skill.TargetDescription()}施加{GetEffectTypeName(_effectType)} {持续时间}。{(_description != "" ? _description : "")}";
|
||||
}
|
||||
}
|
||||
public override EffectType EffectType => _effectType;
|
||||
public override DispelledType DispelledType => _dispelledType;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private string 概率文本 => ActualProbability == 1 ? "" : $"{ActualProbability * 100:0.##}% 概率";
|
||||
/// <summary>
|
||||
/// 实际命中概率 —— 统一走 <see cref="EfficacyHit.命中率"/>(2026-09-23 统一口径)。
|
||||
/// <para/>✅ **为什么本效果类被战技 / 爆发技混用也安全**(Admin 指出,已实测核对):
|
||||
/// 全库 **55 处**重写 `MagicBottleneck` 的技能**清一色是魔法**(`SkillType.Magic`),
|
||||
/// 战技 / 爆发技 / 物品 / 被动**都不重写** ⇒ 它们的 `MagicBottleneck` 取基类默认 **0**
|
||||
/// ⇒ `MagicEfficacy` 在 `瓶颈 == 0` 时**直接返回 1.0**(不是浮点近似,是精确值)
|
||||
/// ⇒ 统一公式 `(基础 + 成长×(Lv−1)) × 1.0` 与旧公式 `基础 + 成长×(Lv−1)×1.0` **完全等价**。
|
||||
/// <para/>同理,那批「基础概率 ≥ 1 且无成长」的**必中型控制**(石化之矢 / 无相飞刀 / 陀螺舞 /
|
||||
/// 鲨鱼锚击 / 裁决塔罗 …)全是战技或爆发技 ⇒ `clamp(1.0 × 1.0) = 1.0` ⇒ **仍然必中**。
|
||||
/// <para/>所以**无需按技能类型或必中性分流**,一个分支都不用 —— 这是机制保证的结果,不是巧合。
|
||||
/// </summary>
|
||||
private double ActualProbability => EfficacyHit.命中率(_probability, _probabilityLevelGrowth, Level, MagicEfficacy);
|
||||
private string 持续时间 => _durative && _duration > 0 ? $"{实际持续时间:0.##}" + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际持续时间 => _durative && _duration > 0 ? (_duration + _levelGrowth * (Level - 1) * MagicEfficacy) : (!_durative && _durationTurn > 0 ? ((int)Math.Round(_durationTurn + _levelGrowth * (Level - 1) * MagicEfficacy, 0, MidpointRounding.ToPositiveInfinity)) : 0);
|
||||
private readonly EffectType _effectType;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
private readonly double _probability;
|
||||
private readonly double _probabilityLevelGrowth;
|
||||
private readonly object[] _args;
|
||||
private DispelledType _dispelledType = DispelledType.Weak;
|
||||
private string _description = "";
|
||||
|
||||
public 施加概率增益(Skill skill, EffectType effectType, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0, double probability = 0, double probabilityLevelGrowth = 0, params object[] args) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_effectType = effectType;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
_probability = probability;
|
||||
_probabilityLevelGrowth = probabilityLevelGrowth;
|
||||
_args = args;
|
||||
SetDescription();
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
if (target.HP <= 0 || Random.NextDouble() > ActualProbability) continue;
|
||||
Effect? e = null;
|
||||
double duration = _duration + _levelGrowth * (Level - 1);
|
||||
int durationTurn = Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1));
|
||||
string tip = "";
|
||||
switch (_effectType)
|
||||
{
|
||||
case EffectType.HealOverTime:
|
||||
bool isPercentage = false;
|
||||
double durationHeal = 0;
|
||||
double durationHealPercent = 0;
|
||||
double durationHealLevelGrowth = 0;
|
||||
if (_args.Length > 0 && _args[0] is bool _)
|
||||
{
|
||||
isPercentage = (bool)_args[0];
|
||||
}
|
||||
if (_args.Length > 1 && _args[1] is double _)
|
||||
{
|
||||
durationHeal = (double)_args[1];
|
||||
}
|
||||
if (_args.Length > 2 && _args[2] is double _)
|
||||
{
|
||||
durationHealPercent = (double)_args[2];
|
||||
}
|
||||
if (_args.Length > 3 && _args[3] is double _)
|
||||
{
|
||||
durationHealLevelGrowth = (double)_args[3];
|
||||
}
|
||||
if (isPercentage && durationHealPercent > 0 || !isPercentage && durationHeal > 0)
|
||||
{
|
||||
if (Level > 0)
|
||||
{
|
||||
durationHeal += durationHealLevelGrowth * (Level - 1);
|
||||
durationHealPercent += durationHealLevelGrowth * (Level - 1);
|
||||
}
|
||||
string healString = $"每{GameplayEquilibriumConstant.InGameTime}回复 {(isPercentage ? $"{durationHealPercent * 100:0.##}% 当前生命值" : durationHeal.ToString("0.##"))} 点生命值";
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 施加了{GetEffectTypeName(_effectType)}! [ {target} ] 每{GameplayEquilibriumConstant.InGameTime}{healString}!持续时间:{持续时间}!";
|
||||
e = new 持续回复(Skill, target, caster, _durative, duration, durationTurn, isPercentage, durationHeal, durationHealPercent)
|
||||
{
|
||||
EffectType = _effectType
|
||||
};
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (e != null && !CheckExemption(caster, target, e))
|
||||
{
|
||||
WriteLine(tip);
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
GamingQueue?.AddApplyEffects(target, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetDescription()
|
||||
{
|
||||
switch (_effectType)
|
||||
{
|
||||
case EffectType.HealOverTime:
|
||||
_dispelledType = DispelledType.Weak;
|
||||
bool isPercentage = false;
|
||||
double durationHeal = 0;
|
||||
double durationHealPercent = 0;
|
||||
double durationHealLevelGrowth = 0;
|
||||
if (_args.Length > 0 && _args[0] is bool _)
|
||||
{
|
||||
isPercentage = (bool)_args[0];
|
||||
}
|
||||
if (_args.Length > 1 && _args[1] is double _)
|
||||
{
|
||||
durationHeal = (double)_args[1];
|
||||
}
|
||||
if (_args.Length > 2 && _args[2] is double _)
|
||||
{
|
||||
durationHealPercent = (double)_args[2];
|
||||
}
|
||||
if (_args.Length > 3 && _args[3] is double _)
|
||||
{
|
||||
durationHealLevelGrowth = (double)_args[3];
|
||||
}
|
||||
if (isPercentage && durationHealPercent > 0 || !isPercentage && durationHeal > 0)
|
||||
{
|
||||
if (Level > 0) durationHeal += durationHealLevelGrowth * (Level - 1);
|
||||
if (Level > 0) durationHealPercent += durationHealLevelGrowth * (Level - 1);
|
||||
string healString = $"每{GameplayEquilibriumConstant.InGameTime}回复 {(isPercentage ? $"{durationHealPercent * 100:0.##}% 当前生命值" : durationHeal.ToString("0.##"))} 点生命值";
|
||||
_description = $"{GetEffectTypeName(_effectType)}:每{GameplayEquilibriumConstant.InGameTime}{healString}!持续时间:{持续时间}!";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetEffectTypeName(EffectType type)
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
_ => SkillSet.GetEffectTypeName(type)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using OshimaBot.Content.Effects;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.Framework;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 施加概率负面 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
SetDescription();
|
||||
return $"{概率文本}对{Skill.TargetDescription()}造成{GetEffectTypeName(_effectType)} {持续时间}。{(_description != "" ? _description : "")}";
|
||||
}
|
||||
}
|
||||
public override EffectType EffectType => _effectType;
|
||||
public override DispelledType DispelledType => _dispelledType;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private string 概率文本 => ActualProbability == 1 ? "" : $"{ActualProbability * 100:0.##}% 概率";
|
||||
/// <summary>
|
||||
/// 实际命中概率 —— 统一走 <see cref="EfficacyHit.命中率"/>(2026-09-23 统一口径)。
|
||||
/// <para/>✅ **为什么本效果类被战技 / 爆发技混用也安全**(Admin 指出,已实测核对):
|
||||
/// 全库 **55 处**重写 `MagicBottleneck` 的技能**清一色是魔法**(`SkillType.Magic`),
|
||||
/// 战技 / 爆发技 / 物品 / 被动**都不重写** ⇒ 它们的 `MagicBottleneck` 取基类默认 **0**
|
||||
/// ⇒ `MagicEfficacy` 在 `瓶颈 == 0` 时**直接返回 1.0**(不是浮点近似,是精确值)
|
||||
/// ⇒ 统一公式 `(基础 + 成长×(Lv−1)) × 1.0` 与旧公式 `基础 + 成长×(Lv−1)×1.0` **完全等价**。
|
||||
/// <para/>同理,那批「基础概率 ≥ 1 且无成长」的**必中型控制**(石化之矢 / 无相飞刀 / 陀螺舞 /
|
||||
/// 鲨鱼锚击 / 裁决塔罗 …)全是战技或爆发技 ⇒ `clamp(1.0 × 1.0) = 1.0` ⇒ **仍然必中**。
|
||||
/// <para/>所以**无需按技能类型或必中性分流**,一个分支都不用 —— 这是机制保证的结果,不是巧合。
|
||||
/// </summary>
|
||||
private double ActualProbability => EfficacyHit.命中率(_probability, _probabilityLevelGrowth, Level, MagicEfficacy);
|
||||
private string 持续时间 => _durative && _duration > 0 ? $"{实际持续时间:0.##}" + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际持续时间 => _durative && _duration > 0 ? (_duration + _levelGrowth * (Level - 1) * MagicEfficacy) : (!_durative && _durationTurn > 0 ? ((int)Math.Round(_durationTurn + _levelGrowth * (Level - 1) * MagicEfficacy, 0, MidpointRounding.ToPositiveInfinity)) : 0);
|
||||
private readonly EffectType _effectType;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
private readonly double _probability;
|
||||
private readonly double _probabilityLevelGrowth;
|
||||
private readonly object[] _args;
|
||||
private DispelledType _dispelledType = DispelledType.Weak;
|
||||
private string _description = "";
|
||||
|
||||
public 施加概率负面(Skill skill, EffectType effectType, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0, double probability = 0, double probabilityLevelGrowth = 0, params object[] args) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_effectType = effectType;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
_probability = probability;
|
||||
_probabilityLevelGrowth = probabilityLevelGrowth;
|
||||
_args = args;
|
||||
SetDescription();
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
if (target.HP <= 0 || Random.NextDouble() > ActualProbability) continue;
|
||||
Effect? e = null;
|
||||
double duration = _duration + _levelGrowth * (Level - 1);
|
||||
int durationTurn = Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1));
|
||||
string tip = "";
|
||||
switch (_effectType)
|
||||
{
|
||||
case EffectType.Silence:
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了封技和施法解除!持续时间:{持续时间}!";
|
||||
e = new 封技(Skill, caster, _durative, duration, durationTurn);
|
||||
break;
|
||||
case EffectType.Confusion:
|
||||
tip = $"[ {target} ] 陷入了混乱!!持续时间:{持续时间}!";
|
||||
e = new 混乱(Skill, caster, _durative, duration, durationTurn);
|
||||
break;
|
||||
case EffectType.Taunt:
|
||||
tip = $"[ {target} ] 被 [ {caster} ] 嘲讽了!持续时间:{持续时间}!";
|
||||
e = new 愤怒(Skill, caster, caster, _durative, duration, durationTurn);
|
||||
break;
|
||||
case EffectType.Delay:
|
||||
double healingReductionPercent = 0.3;
|
||||
if (_args.Length > 0 && _args[0] is double healingReduce)
|
||||
{
|
||||
healingReductionPercent = healingReduce;
|
||||
}
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了迟滞!普通攻击和技能的硬直时间、当前行动等待时间延长了 {healingReductionPercent * 100:0.##}%!持续时间:{持续时间}!";
|
||||
e = new 迟滞(Skill, caster, _durative, duration, durationTurn, healingReductionPercent);
|
||||
break;
|
||||
case EffectType.Stun:
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了眩晕!持续时间:{持续时间}!";
|
||||
e = new 眩晕(Skill, caster, _durative, duration, durationTurn);
|
||||
break;
|
||||
case EffectType.Freeze:
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了冻结!持续时间:{持续时间}!";
|
||||
e = new 冻结(Skill, caster, _durative, duration, durationTurn);
|
||||
break;
|
||||
case EffectType.Petrify:
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了石化!持续时间:{持续时间}!";
|
||||
e = new 石化(Skill, caster, _durative, duration, durationTurn);
|
||||
break;
|
||||
case EffectType.Vulnerable:
|
||||
DamageType damageType = DamageType.Magical;
|
||||
if (_args.Length > 0 && _args[0] is DamageType dt)
|
||||
{
|
||||
damageType = dt;
|
||||
}
|
||||
double exDamagePercent = 0;
|
||||
if (_args.Length > 1 && _args[1] is double percent)
|
||||
{
|
||||
exDamagePercent = percent;
|
||||
}
|
||||
if (exDamagePercent > 0)
|
||||
{
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了易伤,额外受到 {exDamagePercent * 100:0.##}% {CharacterSet.GetDamageTypeName(damageType)}!持续时间:{持续时间}!";
|
||||
e = new 易伤(Skill, target, caster, _durative, duration, durationTurn, damageType, exDamagePercent);
|
||||
}
|
||||
break;
|
||||
case EffectType.Bleed:
|
||||
bool isPercentage = false;
|
||||
double durationDamage = 0;
|
||||
double durationDamagePercent = 0;
|
||||
double durationDamageLevelGrowth = 0;
|
||||
if (_args.Length > 0 && _args[0] is bool isPerc)
|
||||
{
|
||||
isPercentage = isPerc;
|
||||
}
|
||||
if (_args.Length > 1 && _args[1] is double durDamage)
|
||||
{
|
||||
durationDamage = durDamage;
|
||||
}
|
||||
if (_args.Length > 2 && _args[2] is double durDamagePercent)
|
||||
{
|
||||
durationDamagePercent = durDamagePercent;
|
||||
}
|
||||
if (_args.Length > 3 && _args[3] is double durDamageLevelGrowth)
|
||||
{
|
||||
durationDamageLevelGrowth = durDamageLevelGrowth;
|
||||
}
|
||||
if (isPercentage && durationDamagePercent > 0 || !isPercentage && durationDamage > 0)
|
||||
{
|
||||
if (Level > 0) durationDamage += durationDamageLevelGrowth * (Level - 1);
|
||||
if (Level > 0) durationDamagePercent += durationDamageLevelGrowth * (Level - 1);
|
||||
string damageString = isPercentage ? $"流失 {durationDamagePercent * 100:0.##}% 当前生命值" : $"流失 {durationDamage:0.##} 点生命值";
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了气绝! [ {target} ] 进入行动受限状态且每{GameplayEquilibriumConstant.InGameTime}{damageString}!持续时间:{持续时间}!";
|
||||
e = new 气绝(Skill, target, caster, _durative, duration, durationTurn, isPercentage, durationDamage, durationDamagePercent);
|
||||
}
|
||||
break;
|
||||
case EffectType.Cripple:
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了战斗不能,禁止普通攻击和使用技能(魔法、战技和爆发技)!持续时间:{持续时间}!";
|
||||
e = new 战斗不能(Skill, caster, _durative, duration, durationTurn);
|
||||
break;
|
||||
case EffectType.Disarm:
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了缴械!持续时间:{持续时间}!";
|
||||
e = new 缴械(Skill, caster, _durative, duration, durationTurn);
|
||||
break;
|
||||
case EffectType.Burn:
|
||||
case EffectType.Poison:
|
||||
isPercentage = false;
|
||||
durationDamage = 0;
|
||||
durationDamagePercent = 0;
|
||||
durationDamageLevelGrowth = 0;
|
||||
damageType = DamageType.Magical;
|
||||
DamageCalculationOptions? options = null;
|
||||
if (_args.Length > 0 && _args[0] is bool _)
|
||||
{
|
||||
isPercentage = (bool)_args[0];
|
||||
}
|
||||
if (_args.Length > 1 && _args[1] is double _)
|
||||
{
|
||||
durationDamage = (double)_args[1];
|
||||
}
|
||||
if (_args.Length > 2 && _args[2] is double _)
|
||||
{
|
||||
durationDamagePercent = (double)_args[2];
|
||||
}
|
||||
if (_args.Length > 3 && _args[3] is double _)
|
||||
{
|
||||
durationDamageLevelGrowth = (double)_args[3];
|
||||
}
|
||||
if (_args.Length > 0 && _args[4] is DamageType _)
|
||||
{
|
||||
damageType = (DamageType)_args[4];
|
||||
}
|
||||
if (_args.Length > 0 && _args[5] is DamageCalculationOptions _)
|
||||
{
|
||||
options = (DamageCalculationOptions)_args[5];
|
||||
}
|
||||
if (isPercentage && durationDamagePercent > 0 || !isPercentage && durationDamage > 0)
|
||||
{
|
||||
if (Level > 0) durationDamage += durationDamageLevelGrowth * (Level - 1);
|
||||
if (Level > 0) durationDamagePercent += durationDamageLevelGrowth * (Level - 1);
|
||||
string damageString = isPercentage ? $"受到 {durationDamagePercent * 100:0.##}% 当前生命值的" : $"受到 {durationDamage:0.##} 点" + CharacterSet.GetDamageTypeName(damageType);
|
||||
tip = $"[ {caster} ] 对 [ {target} ] 造成了{GetEffectTypeName(_effectType)}! [ {target} ] 每{GameplayEquilibriumConstant.InGameTime}{damageString}!持续时间:{持续时间}!";
|
||||
e = new 持续伤害(Skill, target, caster, _durative, duration, durationTurn, isPercentage, durationDamage, durationDamagePercent, damageType, options)
|
||||
{
|
||||
EffectType = _effectType
|
||||
};
|
||||
}
|
||||
break;
|
||||
case EffectType.InterruptCasting:
|
||||
e = new 打断施法(Skill);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (e != null && !CheckExemption(caster, target, e))
|
||||
{
|
||||
if (e is 打断施法 ddsf)
|
||||
{
|
||||
ddsf.Activate(caster, [target]);
|
||||
continue;
|
||||
}
|
||||
WriteLine(tip);
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
GamingQueue?.AddApplyEffects(target, e.EffectType);
|
||||
if (e is 迟滞 cz)
|
||||
{
|
||||
cz.ApplyChange(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetDescription()
|
||||
{
|
||||
switch (_effectType)
|
||||
{
|
||||
case EffectType.Silence:
|
||||
_dispelledType = DispelledType.Weak;
|
||||
_description = "封技:不能使用技能(魔法、战技和爆发技),并解除当前施法。";
|
||||
break;
|
||||
case EffectType.Confusion:
|
||||
_dispelledType = DispelledType.Strong;
|
||||
_description = "混乱:进入行动受限状态,失控并随机行动,且所有指令均会在所有角色中随机选取目标。";
|
||||
break;
|
||||
case EffectType.Taunt:
|
||||
_dispelledType = DispelledType.Strong;
|
||||
_description = "愤怒:进入行动受限状态,失控并随机行动,行动回合内仅能对嘲讽者发起普通攻击。";
|
||||
break;
|
||||
case EffectType.Delay:
|
||||
double healingReductionPercent = 0.3;
|
||||
if (_args.Length > 0 && _args[0] is double healingReduce)
|
||||
{
|
||||
healingReductionPercent = healingReduce;
|
||||
}
|
||||
_dispelledType = DispelledType.Weak;
|
||||
_description = $"迟滞:普通攻击和技能的硬直时间、当前行动等待时间延长 {healingReductionPercent * 100:0.##}%。";
|
||||
break;
|
||||
case EffectType.Stun:
|
||||
_dispelledType = DispelledType.Strong;
|
||||
_description = "眩晕:进入完全行动不能状态。";
|
||||
break;
|
||||
case EffectType.Freeze:
|
||||
_dispelledType = DispelledType.Strong;
|
||||
_description = "冻结:进入完全行动不能状态。";
|
||||
break;
|
||||
case EffectType.Petrify:
|
||||
_dispelledType = DispelledType.Strong;
|
||||
_description = "石化:进入完全行动不能状态。";
|
||||
break;
|
||||
case EffectType.Vulnerable:
|
||||
DamageType damageType = DamageType.Magical;
|
||||
if (_args.Length > 0 && _args[0] is DamageType dt)
|
||||
{
|
||||
damageType = dt;
|
||||
}
|
||||
double exDamagePercent = 0;
|
||||
if (_args.Length > 1 && _args[1] is double percent)
|
||||
{
|
||||
exDamagePercent = percent;
|
||||
}
|
||||
if (exDamagePercent > 0)
|
||||
{
|
||||
_dispelledType = DispelledType.Weak;
|
||||
_description = $"易伤:额外受到 {exDamagePercent * 100:0.##}% {CharacterSet.GetDamageTypeName(damageType)}。";
|
||||
}
|
||||
break;
|
||||
case EffectType.Bleed:
|
||||
_dispelledType = DispelledType.Strong;
|
||||
bool isPercentage = false;
|
||||
double durationDamage = 0;
|
||||
double durationDamagePercent = 0;
|
||||
double durationDamageLevelGrowth = 0;
|
||||
if (_args.Length > 0 && _args[0] is bool isPerc)
|
||||
{
|
||||
isPercentage = isPerc;
|
||||
}
|
||||
if (_args.Length > 1 && _args[1] is double durDamage)
|
||||
{
|
||||
durationDamage = durDamage;
|
||||
}
|
||||
if (_args.Length > 2 && _args[2] is double durDamagePercent)
|
||||
{
|
||||
durationDamagePercent = durDamagePercent;
|
||||
}
|
||||
if (_args.Length > 3 && _args[3] is double durDamageLevelGrowth)
|
||||
{
|
||||
durationDamageLevelGrowth = durDamageLevelGrowth;
|
||||
}
|
||||
if (isPercentage && durationDamagePercent > 0 || !isPercentage && durationDamage > 0)
|
||||
{
|
||||
if (Level > 0) durationDamage += durationDamageLevelGrowth * (Level - 1);
|
||||
if (Level > 0) durationDamagePercent += durationDamageLevelGrowth * (Level - 1);
|
||||
string damageString = isPercentage ? $"流失 {durationDamagePercent * 100:0.##}% 当前生命值" : $"流失 {durationDamage:0.##} 点生命值";
|
||||
_description = $"气绝:进入行动受限状态并每{GameplayEquilibriumConstant.InGameTime}{damageString},此效果不会导致角色死亡。";
|
||||
}
|
||||
break;
|
||||
case EffectType.Cripple:
|
||||
_dispelledType = DispelledType.Strong;
|
||||
_description = "战斗不能:无法普通攻击和使用技能(魔法、战技和爆发技)。";
|
||||
break;
|
||||
case EffectType.Disarm:
|
||||
_dispelledType = DispelledType.Weak;
|
||||
_description = "缴械:无法普通攻击。";
|
||||
break;
|
||||
case EffectType.Burn:
|
||||
case EffectType.Poison:
|
||||
_dispelledType = DispelledType.Weak;
|
||||
isPercentage = false;
|
||||
durationDamage = 0;
|
||||
durationDamagePercent = 0;
|
||||
durationDamageLevelGrowth = 0;
|
||||
damageType = DamageType.Magical;
|
||||
if (_args.Length > 0 && _args[0] is bool _)
|
||||
{
|
||||
isPercentage = (bool)_args[0];
|
||||
}
|
||||
if (_args.Length > 1 && _args[1] is double _)
|
||||
{
|
||||
durationDamage = (double)_args[1];
|
||||
}
|
||||
if (_args.Length > 2 && _args[2] is double _)
|
||||
{
|
||||
durationDamagePercent = (double)_args[2];
|
||||
}
|
||||
if (_args.Length > 3 && _args[3] is double _)
|
||||
{
|
||||
durationDamageLevelGrowth = (double)_args[3];
|
||||
}
|
||||
if (_args.Length > 0 && _args[4] is DamageType _)
|
||||
{
|
||||
damageType = (DamageType)_args[4];
|
||||
}
|
||||
if (isPercentage && durationDamagePercent > 0 || !isPercentage && durationDamage > 0)
|
||||
{
|
||||
if (Level > 0) durationDamage += durationDamageLevelGrowth * (Level - 1);
|
||||
if (Level > 0) durationDamagePercent += durationDamageLevelGrowth * (Level - 1);
|
||||
string damageString = isPercentage ? $"受到 {durationDamagePercent * 100:0.##}% 当前生命值的" : $"受到 {durationDamage:0.##} 点" + CharacterSet.GetDamageTypeName(damageType);
|
||||
_description = $"{GetEffectTypeName(_effectType)}:每{GameplayEquilibriumConstant.InGameTime}{damageString}!持续时间:{持续时间}!";
|
||||
}
|
||||
break;
|
||||
case EffectType.InterruptCasting:
|
||||
_description = "打断施法:中断其正在进行的吟唱。";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetEffectTypeName(EffectType type)
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
EffectType.Taunt => "愤怒",
|
||||
EffectType.Silence => "封技",
|
||||
EffectType.Bleed => "气绝",
|
||||
EffectType.Cripple => "战斗不能",
|
||||
EffectType.Burn => "燃烧",
|
||||
EffectType.Poison => "中毒",
|
||||
_ => SkillSet.GetEffectTypeName(type)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 百分比回复生命值 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{Skill.TargetDescription()}回复 {百分比 * 100:0.##}% 最大生命值。{(CanRespawn ? "如果目标已死亡,将复活目标。" : "")}";
|
||||
|
||||
private double 基础回复 { get; set; } = 0.03;
|
||||
private double 回复成长 { get; set; } = 0.03;
|
||||
private double 百分比 => Skill.Level > 0 ? 基础回复 + 回复成长 * (Skill.Level - 1) : 基础回复;
|
||||
private bool CanRespawn { get; set; } = false;
|
||||
|
||||
public 百分比回复生命值(Skill skill, double 基础回复, double 回复成长, bool canRespawn = false) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础回复 = 基础回复;
|
||||
this.回复成长 = 回复成长;
|
||||
CanRespawn = canRespawn;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
double heal = 百分比 * target.MaxHP;
|
||||
HealToTarget(caster, target, heal, CanRespawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 纯数值伤害 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成 {Damage:0.##} 点{CharacterSet.GetDamageTypeName(DamageType, MagicType)}。";
|
||||
|
||||
private double Damage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害;
|
||||
private double 基础数值伤害 { get; set; } = 200;
|
||||
private double 基础伤害等级成长 { get; set; } = 100;
|
||||
private DamageType DamageType { get; set; } = DamageType.Magical;
|
||||
|
||||
public 纯数值伤害(Skill skill, double 基础数值伤害, double 基础伤害等级成长, DamageType damageType, MagicType magicType = MagicType.None) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值伤害 = 基础数值伤害;
|
||||
this.基础伤害等级成长 = 基础伤害等级成长;
|
||||
DamageType = damageType;
|
||||
MagicType = magicType;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
DamageToEnemy(caster, enemy, DamageType, MagicType, Damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 纯数值回复生命 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{Skill.TargetDescription()}回复 {Heal:0.##} 点生命值。{(CanRespawn ? "如果目标已死亡,将复活目标。" : "")}";
|
||||
|
||||
private double Heal => Skill.Level > 0 ? 基础回复 + 回复成长 * (Skill.Level - 1) : 基础回复;
|
||||
private double 基础回复 { get; set; } = 100;
|
||||
private double 回复成长 { get; set; } = 30;
|
||||
private bool CanRespawn { get; set; } = false;
|
||||
|
||||
public 纯数值回复生命(Skill skill, double 基础回复, double 回复成长, bool canRespawn = false) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础回复 = 基础回复;
|
||||
this.回复成长 = 回复成长;
|
||||
CanRespawn = canRespawn;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
HealToTarget(caster, target, Heal, CanRespawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 造成封技 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成封技 {封技时间},无法使用技能(魔法、战技和爆发技),并打断当前施法。";
|
||||
public override EffectType EffectType => EffectType.Silence;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private string 封技时间 => _durative && _duration > 0 ? 实际封技时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际封技时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际封技时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
|
||||
public 造成封技(Skill skill, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
封技 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
if (!CheckExemption(caster, enemy, e))
|
||||
{
|
||||
WriteLine($"[ {caster} ] 对 [ {enemy} ] 造成了封技和施法解除!持续时间:{封技时间}!");
|
||||
enemy.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, enemy));
|
||||
GamingQueue?.AddApplyEffects(enemy, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 造成气绝 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人造成气绝 {气绝时间}。气绝期间,目标行动受限且每{GameplayEquilibriumConstant.InGameTime}{DamageString},此生命流失效果不会导致角色死亡。";
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override EffectType EffectType => EffectType.Bleed;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private string 气绝时间 => _durative && _duration > 0 ? 实际气绝时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际气绝时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际气绝时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
private readonly bool _isPercentage;
|
||||
private readonly double _durationDamage;
|
||||
private readonly double _durationDamagePercent;
|
||||
private double Damage => _isPercentage ? _durationDamagePercent : _durationDamage;
|
||||
private string DamageString => _isPercentage ? $"流失 {Damage * 100:0.##}% 当前生命值" : $"流失 {Damage:0.##} 点生命值";
|
||||
|
||||
public 造成气绝(Skill skill, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0,
|
||||
bool isPercentage = true, double durationDamage = 100, double durationDamagePercent = 0.02) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
_isPercentage = isPercentage;
|
||||
_durationDamage = durationDamage;
|
||||
_durationDamagePercent = durationDamagePercent;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
气绝 e = new(Skill, enemy, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)), _isPercentage, _durationDamage, _durationDamagePercent);
|
||||
if (!CheckExemption(caster, enemy, e))
|
||||
{
|
||||
WriteLine($"[ {caster} ] 对 [ {enemy} ] 造成了气绝!持续时间:{气绝时间}!");
|
||||
enemy.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, enemy));
|
||||
GamingQueue?.AddApplyEffects(enemy, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 造成眩晕 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成眩晕 {眩晕时间}。";
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override EffectType EffectType => EffectType.Stun;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private string 眩晕时间 => _durative && _duration > 0 ? 实际眩晕时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际眩晕时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际眩晕时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
|
||||
public 造成眩晕(Skill skill, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
if (enemy.HP <= 0) continue;
|
||||
眩晕 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
if (!CheckExemption(caster, enemy, e))
|
||||
{
|
||||
WriteLine($"[ {caster} ] 眩晕了 [ {enemy} ] !持续时间:{眩晕时间}!");
|
||||
enemy.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, enemy));
|
||||
GamingQueue?.AddApplyEffects(enemy, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.PassiveEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 造成虚弱 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成虚弱 {虚弱时间},伤害降低 {ActualDamageReductionPercent * 100:0.##}%," +
|
||||
$"物理护甲降低 {ActualDEFReductionPercent * 100:0.##}%,魔法抗性降低 {ActualMDFReductionPercent * 100:0.##}%,治疗效果降低 {ActualHealingReductionPercent * 100:0.##}%。";
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override EffectType EffectType => EffectType.Weaken;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private string 虚弱时间 => _durative && _duration > 0 ? $"{实际虚弱时间:0.##} {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际虚弱时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际虚弱时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
private readonly double _damageReductionPercent;
|
||||
private readonly double _DEFReductionPercent;
|
||||
private readonly double _MDFReductionPercent;
|
||||
private readonly double _healingReductionPercent;
|
||||
private readonly double _damageReductionPercentLevelGrowth;
|
||||
private readonly double _DEFReductionPercentLevelGrowth;
|
||||
private readonly double _MDFReductionPercentLevelGrowth;
|
||||
private readonly double _healingReductionPercentLevelGrowth;
|
||||
private double ActualDamageReductionPercent => Level > 0 ? _damageReductionPercent + _damageReductionPercentLevelGrowth * (Level - 1) : _damageReductionPercent;
|
||||
private double ActualDEFReductionPercent => Level > 0 ? _DEFReductionPercent + _DEFReductionPercentLevelGrowth * (Level - 1) : _DEFReductionPercent;
|
||||
private double ActualMDFReductionPercent => Level > 0 ? _MDFReductionPercent + _MDFReductionPercentLevelGrowth * (Level - 1) : _MDFReductionPercent;
|
||||
private double ActualHealingReductionPercent => Level > 0 ? _healingReductionPercent + _healingReductionPercentLevelGrowth * (Level - 1) : _healingReductionPercent;
|
||||
|
||||
public 造成虚弱(Skill skill, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0,
|
||||
double damageReductionPercent = 0, double DEFReductionPercent = 0, double MDFReductionPercent = 0, double healingReductionPercent = 0,
|
||||
double damageReductionPercentLevelGrowth = 0, double DEFReductionPercentLevelGrowth = 0, double MDFReductionPercentLevelGrowth = 0, double healingReductionPercentLevelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
_damageReductionPercent = damageReductionPercent;
|
||||
_DEFReductionPercent = DEFReductionPercent;
|
||||
_MDFReductionPercent = MDFReductionPercent;
|
||||
_healingReductionPercent = healingReductionPercent;
|
||||
_damageReductionPercentLevelGrowth = damageReductionPercentLevelGrowth;
|
||||
_DEFReductionPercentLevelGrowth = DEFReductionPercentLevelGrowth;
|
||||
_MDFReductionPercentLevelGrowth = MDFReductionPercentLevelGrowth;
|
||||
_healingReductionPercentLevelGrowth = healingReductionPercentLevelGrowth;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character enemy in targets)
|
||||
{
|
||||
虚弱 e = new(Skill, enemy, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)), ActualDamageReductionPercent, ActualDEFReductionPercent, ActualMDFReductionPercent, ActualHealingReductionPercent);
|
||||
if (!CheckExemption(caster, enemy, e))
|
||||
{
|
||||
WriteLine($"[ {caster} ] 对 [ {enemy} ] 造成了虚弱!伤害降低 {ActualDamageReductionPercent * 100:0.##}%," +
|
||||
$"物理护甲降低 {ActualDEFReductionPercent * 100:0.##}%,魔法抗性降低 {ActualMDFReductionPercent * 100:0.##}%," +
|
||||
$"治疗效果降低 {ActualHealingReductionPercent * 100:0.##}%!持续时间:{虚弱时间}!");
|
||||
enemy.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, enemy));
|
||||
GamingQueue?.AddApplyEffects(enemy, e.EffectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.SkillEffects
|
||||
{
|
||||
public class 降低敌方行动速度 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"降低{Skill.TargetDescription()} {Math.Abs(SPD):0.##} 点行动速度 {持续时间}。并延长目标 30% 的行动等待时间(当前硬直时间)。";
|
||||
public override EffectType EffectType => EffectType.Slow;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private double SPD => Level > 0 ? -Math.Abs(基础数值速度 + 基础速度等级成长 * (Level - 1)) : -Math.Abs(基础数值速度);
|
||||
private double 基础数值速度 { get; set; } = 30;
|
||||
private double 基础速度等级成长 { get; set; } = 20;
|
||||
private string 持续时间 => _durative && _duration > 0 ? _duration + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? _durationTurn + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 降低敌方行动速度(Skill skill, double 基础数值速度, double 基础速度等级成长, bool durative = true, double duration = 40, int durationTurn = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
this.基础数值速度 = 基础数值速度;
|
||||
this.基础速度等级成长 = 基础速度等级成长;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
ExSPD e = new(Skill, new Dictionary<string, object>()
|
||||
{
|
||||
{ "exspd", SPD }
|
||||
}, caster)
|
||||
{
|
||||
Name = Name,
|
||||
Durative = _durative,
|
||||
Duration = _duration,
|
||||
DurationTurn = _durationTurn
|
||||
};
|
||||
if (!CheckExemption(caster, target, e))
|
||||
{
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, target));
|
||||
e.EffectType = EffectType.Slow;
|
||||
e.IsDebuff = true;
|
||||
WriteLine($"[ {target} ] 的行动速度降低了 {-SPD:0.##} 点,行动等待时间(当前硬直时间)被延长了 30%!持续时间:{持续时间}!");
|
||||
GamingQueue?.AddApplyEffects(target, e.EffectType);
|
||||
GamingQueue?.ChangeCharacterHardnessTime(target, 0.3, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user