chore: initialize OshimaBot repository (rename from Enhancement)
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
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 META马 : Skill
|
||||
{
|
||||
public override long Id => (long)PassiveID.META马;
|
||||
public override string Name => "META马";
|
||||
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
|
||||
|
||||
public META马(Character? character = null) : base(SkillType.Passive, character)
|
||||
{
|
||||
Effects.Add(new META马特效(this));
|
||||
}
|
||||
|
||||
public override IEnumerable<Effect> AddPassiveEffectToCharacter()
|
||||
{
|
||||
return Effects;
|
||||
}
|
||||
}
|
||||
|
||||
public class META马特效(Skill skill) : Effect(skill)
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"META马专属被动:初始力量+5,力量成长+0.5;在受到伤害时,获得的能量提升50%,每回合开始还能获得额外的 [ {EP:0.##} ] 能量值。";
|
||||
|
||||
public static double EP => 7;
|
||||
|
||||
public override AlterEPResult AlterEPAfterGetDamage(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return default;
|
||||
double baseEP = ctx.BaseEP * 1.5;
|
||||
if (Skill.Character != null) WriteLine($"[ {Skill.Character} ] 发动了META马专属被动!本次获得了 {baseEP:0.##} 能量!");
|
||||
return new AlterEPResult { BaseEP = baseEP };
|
||||
}
|
||||
|
||||
public override void OnTurnStart(TurnContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
List<Character> enemys = ctx.Enemys;
|
||||
List<Character> teammates = ctx.Teammates;
|
||||
List<Skill> skills = ctx.Skills;
|
||||
List<Item> items = ctx.Items;
|
||||
if (character.EP < 200)
|
||||
{
|
||||
character.EP += EP;
|
||||
WriteLine($"[ {character} ] 发动了META马专属被动!本次获得了 {EP:0.##} 能量!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.InitialSTR += 5;
|
||||
character.STRGrowth += 0.5;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.InitialSTR -= 5;
|
||||
character.STRGrowth -= 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
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 string DispelDescription => Effects.Count > 0 ? Effects.First().DispelDescription : "";
|
||||
public override double EPCost => 100;
|
||||
public override double CD => 55;
|
||||
public override double HardnessTime { get; set; } = 0;
|
||||
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()}释放「熵灭」的力量,获得 135% 力量 [ {攻击力加成:0.##} ] 的攻击力加成,但每次普通攻击命中时都会损失自身 6% 当前生命值 [ {当前生命值:0.##} ],持续 {Duration:0.##} {GameplayEquilibriumConstant.InGameTime}。";
|
||||
public override bool Durative => true;
|
||||
public override double Duration => 10 + 2 * (Level - 1);
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
|
||||
private double 攻击力加成 => Skill.Character?.STR * 1.35 ?? 0;
|
||||
private double 当前生命值 => Skill.Character?.HP * 0.06 ?? 0;
|
||||
private double 实际攻击力加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
实际攻击力加成 = 攻击力加成;
|
||||
character.ExATK2 += 实际攻击力加成;
|
||||
WriteLine($"[ {character} ] 的攻击力增加了 [ {实际攻击力加成:0.##} ] !");
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
// 恢复到原始攻击力
|
||||
character.ExATK2 -= 实际攻击力加成;
|
||||
}
|
||||
|
||||
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 && isNormalAttack && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical))
|
||||
{
|
||||
double 生命值减少 = 当前生命值;
|
||||
character.HP -= 生命值减少;
|
||||
WriteLine($"[ {character} ] 由于自身力量过于强大而被反噬,损失了 [ {生命值减少:0.##} ] 点生命值!");
|
||||
}
|
||||
}
|
||||
|
||||
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.DamageBoost);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user