chore: initialize OshimaBot repository (rename from Enhancement)
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
|
||||
namespace OshimaBot.Content.Skills
|
||||
{
|
||||
public class 少女绮想 : Skill
|
||||
{
|
||||
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)
|
||||
{
|
||||
Effects.Add(new 少女绮想特效(this));
|
||||
}
|
||||
|
||||
public override IEnumerable<Effect> AddPassiveEffectToCharacter()
|
||||
{
|
||||
return Effects;
|
||||
}
|
||||
}
|
||||
|
||||
public class 少女绮想特效(Skill skill) : Effect(skill)
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"{Skill.SkillOwner()}进入祈祷的心境。每经过 {时间流逝} {GameplayEquilibriumConstant.InGameTime},提升 {伤害提升 * 100:0.##}% 所有伤害,无上限。受到伤害时清零;造成伤害后,累计提升减少总量的 30%。(下一次提升在:{下一次提升:0.##} {GameplayEquilibriumConstant.InGameTime}后{(累计伤害 > 0 ? $",当前总提升:{累计伤害 * 100:0.##}%" : "")})";
|
||||
|
||||
private readonly double 时间流逝 = 7;
|
||||
private readonly double 伤害提升 = 0.21;
|
||||
private double 累计伤害 = 0;
|
||||
private double 下一次提升 = 7;
|
||||
|
||||
public override AlterActualDamageResult AlterActualDamageAfterCalculation(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character || ctx.Enemy is not Character enemy) return default;
|
||||
double damage = ctx.Damage;
|
||||
bool isNormalAttack = ctx.IsNormalAttack;
|
||||
DamageType damageType = ctx.DamageType;
|
||||
MagicType magicType = ctx.MagicType;
|
||||
DamageResult damageResult = ctx.DamageResult;
|
||||
Dictionary<Effect, double> totalDamageBonus = ctx.TotalDamageBonus;
|
||||
if ((damageResult == DamageResult.Normal || damageResult == DamageResult.Critical) && character == Skill.Character)
|
||||
{
|
||||
double 实际伤害提升 = damage * 累计伤害;
|
||||
if (实际伤害提升 > 0) WriteLine($"[ {character} ] 的伤害提升了 {累计伤害 * 100:0.##}% [ {实际伤害提升:0.##} ] 点!");
|
||||
累计伤害 *= 0.7;
|
||||
return new AlterActualDamageResult { DamageDelta = 实际伤害提升 };
|
||||
|
||||
}
|
||||
return default;
|
||||
|
||||
}
|
||||
|
||||
public override void AfterDamageCalculation(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character || ctx.Enemy is not Character enemy) return;
|
||||
double damage = ctx.Damage;
|
||||
double actualDamage = ctx.ActualDamage;
|
||||
bool isNormalAttack = ctx.IsNormalAttack;
|
||||
DamageType damageType = ctx.DamageType;
|
||||
MagicType magicType = ctx.MagicType;
|
||||
DamageResult damageResult = ctx.DamageResult;
|
||||
if ((damageResult == DamageResult.Normal || damageResult == DamageResult.Critical) && enemy == Skill.Character && actualDamage > 0 && !enemy.Effects.Where(e => e is 绝对领域特效 && e.Skill.Character == character).Any())
|
||||
{
|
||||
累计伤害 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTimeElapsed(TimeLapseContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
double eapsed = ctx.Elapsed;
|
||||
if (GamingQueue != null)
|
||||
{
|
||||
下一次提升 -= eapsed;
|
||||
if (下一次提升 <= 0)
|
||||
{
|
||||
累计伤害 += 伤害提升;
|
||||
下一次提升 += 时间流逝;
|
||||
WriteLine($"[ {character} ] 的 [ {Name} ] 效果增加了,当前总提升:{累计伤害 * 100:0.##}%。");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using FunGame.Core.Model.Framework;
|
||||
|
||||
namespace OshimaBot.Content.Skills
|
||||
{
|
||||
public class 绝对领域 : Skill
|
||||
{
|
||||
public override long Id => (long)SuperSkillID.绝对领域;
|
||||
public override string Name => "绝对领域";
|
||||
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
|
||||
public override string DispelDescription => Effects.Count > 0 ? Effects.First().DispelDescription : "";
|
||||
public override double EPCost => Math.Max(100, Character?.EP ?? 100);
|
||||
public override double CD => 60;
|
||||
public override double HardnessTime { get; set; } = 5;
|
||||
public override bool CanSelectSelf => true;
|
||||
public override bool CanSelectEnemy => false;
|
||||
|
||||
public 绝对领域(Character? character = null) : base(SkillType.SuperSkill, character)
|
||||
{
|
||||
Effects.Add(new 绝对领域特效(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class 绝对领域特效(Skill skill) : Effect(skill)
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"{Skill.SkillOwner()}展开绝对领域。在 {Duration:0.##} {GameplayEquilibriumConstant.InGameTime}内,敏捷提升 {系数 * 100:0.##}% [ {敏捷提升:0.##} ],无法受到任何伤害,但不免疫负面效果。此技能会消耗至少 100 点能量,每额外消耗 10 能量,持续时间提升 1 {GameplayEquilibriumConstant.InGameTime}。";
|
||||
public override bool Durative => true;
|
||||
public override double Duration => 释放时的能量值 >= 100 ? 13 + (释放时的能量值 - 100) * 0.1 : 14;
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
|
||||
private double 系数 => 0.2 + 0.015 * (Level - 1);
|
||||
private double 敏捷提升 => 系数 * Skill.Character?.BaseAGI ?? 0;
|
||||
private double 实际敏捷提升 = 0;
|
||||
private double 释放时的能量值 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
实际敏捷提升 = 敏捷提升;
|
||||
character.ExAGI += 实际敏捷提升;
|
||||
WriteLine($"[ {character} ] 的敏捷提升了 {系数 * 100:0.##}% [ {实际敏捷提升:0.##} ] !");
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExAGI -= 实际敏捷提升;
|
||||
}
|
||||
|
||||
public override AlterActualDamageResult AlterActualDamageAfterCalculation(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character || ctx.Enemy is not Character enemy) return default;
|
||||
double damage = ctx.Damage;
|
||||
bool isNormalAttack = ctx.IsNormalAttack;
|
||||
DamageType damageType = ctx.DamageType;
|
||||
MagicType magicType = ctx.MagicType;
|
||||
DamageResult damageResult = ctx.DamageResult;
|
||||
Dictionary<Effect, double> totalDamageBonus = ctx.TotalDamageBonus;
|
||||
if (enemy == Skill.Character && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical))
|
||||
{
|
||||
WriteLine($"[ {enemy} ] 发动了绝对领域,巧妙的化解了此伤害!");
|
||||
return new AlterActualDamageResult { IsEvaded = true };
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public override BeforeApplyTrueDamageResult BeforeApplyTrueDamage(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character || ctx.Enemy is not Character enemy) return default;
|
||||
double damage = ctx.Damage;
|
||||
bool isNormalAttack = ctx.IsNormalAttack;
|
||||
DamageResult damageResult = ctx.DamageResult;
|
||||
if (enemy == Skill.Character && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical))
|
||||
{
|
||||
WriteLine($"[ {enemy} ] 发动了绝对领域,巧妙的化解了此伤害!");
|
||||
return new BeforeApplyTrueDamageResult { NullifyDamage = true };
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public override void OnSkillCasting(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
List<Grid> grids = ctx.Grids;
|
||||
释放时的能量值 = caster.EP;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
List<Grid> grids = ctx.Grids;
|
||||
Dictionary<string, object> others = ctx.Others;
|
||||
RemainDuration = Duration;
|
||||
if (!caster.Effects.Contains(this))
|
||||
{
|
||||
实际敏捷提升 = 0;
|
||||
caster.Effects.Add(this);
|
||||
OnEffectGained(new HookContext(GamingQueue, caster));
|
||||
}
|
||||
GamingQueue?.AddApplyEffects(caster, EffectType.Invulnerable);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user