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,63 @@
using FunGame.Core.Entity;
using FunGame.Core.Library.Constant;
using FunGame.Core.Model.EffectContext;
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 => $"每次造成伤害都会随机减少对方 [ 7~15 ] 点能量值,对能量值低于一半的角色额外造成 30% 伤害。对于暗香疏影而言,能量值大于 100 且小于 150 时,视为低于一半。";
private bool 是否是嵌套伤害 = false;
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 (character == Skill.Character && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical) && !是否是嵌套伤害 && enemy.HP > 0)
{
// 减少能量
double EP = Random.Next(7, 15);
enemy.EP -= EP;
WriteLine($"[ {character} ] 发动了暗香疏影![ {enemy} ] 的能量值被减少了 {EP:0.##} 点!现有能量:{enemy.EP:0.##}。");
// 额外伤害
if (enemy.EP >= 0 && enemy.EP < 50 || enemy.EP >= 100 && enemy.EP < 150)
{
double 额外伤害 = damage * 0.3;
WriteLine($"[ {character} ] 发动了暗香疏影!将造成额外伤害!");
是否是嵌套伤害 = true;
DamageToEnemy(character, enemy, damageType, magicType, 额外伤害);
}
}
if (character == Skill.Character && 是否是嵌套伤害)
{
是否是嵌套伤害 = false;
}
}
}
}
@@ -0,0 +1,60 @@
using FunGame.Core.Api;
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 double EPCost => 100;
public override double CD => 100 - 4 * (Level - 1);
public override double HardnessTime { get; set; } = 12;
public override bool CanSelectSelf => false;
public override bool CanSelectEnemy => true;
public 残香凋零(Character? character = null) : base(SkillType.SuperSkill, character)
{
CastAnywhere = true;
Effects.Add(new 残香凋零特效(this));
}
public override void OnTurnStart(Character character, List<Character> enemys, List<Character> teammates, List<Skill> skills, List<Item> items)
{
if (Character == character)
{
CanSelectTargetCount = enemys.Count;
if (CanSelectTargetCount > 6) CanSelectTargetCount = 6;
}
}
}
public class 残香凋零特效(Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Skill.SkillOwner()}释放能够动荡能量流的深渊之死气。对至多 6 个角色造成 " +
$"{能量系数 * 100:0.##}% 其现有能量值 + {智力系数 * 100:0.##}% 智力 [ {智力伤害:0.##} ] 的魔法伤害。";
private double 智力系数 => 0.2 * Level;
private double 智力伤害 => 智力系数 * Skill.Character?.INT ?? 0;
private double 能量系数 => 1 * Level;
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;
foreach (Character c in targets)
{
double ep = c.EP;
DamageToEnemy(caster, c, DamageType.Magical, MagicType, ep * 能量系数 + 智力伤害);
}
}
}
}