chore: initialize OshimaBot repository (rename from Enhancement)

This commit is contained in:
2026-11-09 19:38:28 +08:00
commit f9052358a9
414 changed files with 36653 additions and 0 deletions
@@ -0,0 +1,89 @@
using FunGame.Core.Entity;
using FunGame.Core.Library.Constant;
using FunGame.Core.Model.EffectContext;
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 => 100;
public override double CD => 55 - (1 * (Level - 1));
public override double HardnessTime { get; set; } = 9;
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 => $"敏捷提高 20% [ {敏捷提升:0.##} ] 点。若当前总力量低于敏捷,则获得额外力量提升,使得总力量等于敏捷的 {平衡系数 * 100:0.##}%{(Skill.Character != null ? $" [ {Skill.Character.AGI * 平衡系数:0.##} ]" : "")},持续 {Duration:0.##} {GameplayEquilibriumConstant.InGameTime}。";
public override bool Durative => true;
public override double Duration => 30;
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
private double 敏捷提升 => (0.2 * Skill.Character?.BaseAGI) ?? 0.2;
private double 平衡系数 => 0.5 + 0.1 * (Skill.Level - 1);
private double 本次提升的敏捷 = 0;
private double 本次提升的力量 = 0;
public override void OnEffectGained(HookContext ctx)
{
if (ctx.Trigger is not Character character) return;
double pastHP = character.HP;
double pastMaxHP = character.MaxHP;
double pastMP = character.MP;
double pastMaxMP = character.MaxMP;
本次提升的敏捷 = character.BaseAGI * 0.2;
character.ExAGI += 本次提升的敏捷;
本次提升的力量 = 0;
double 平衡敏捷 = character.AGI * 平衡系数;
if (character.STR < 平衡敏捷)
{
本次提升的力量 = 平衡敏捷 - character.STR;
character.ExSTR += 本次提升的力量;
}
character.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
WriteLine($"[ {character} ] 敏捷提升了 {本次提升的敏捷:0.##} 点,力量提升了 {本次提升的力量:0.##} 点!");
}
public override void OnEffectLost(HookContext ctx)
{
if (ctx.Trigger is not Character character) return;
double pastHP = character.HP;
double pastMaxHP = character.MaxHP;
double pastMP = character.MP;
double pastMaxMP = character.MaxMP;
character.ExAGI -= character.BaseAGI * 0.2;
character.ExSTR -= 本次提升的力量;
character.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
}
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;
本次提升的力量 = 0;
caster.Effects.Add(this);
OnEffectGained(new HookContext(GamingQueue, caster));
}
GamingQueue?.AddApplyEffects(caster, EffectType.DamageBoost, EffectType.Lifesteal);
}
}
}