mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-22 03:49:35 +08:00
添加封技和沉默技能
This commit is contained in:
parent
ae01f8db8c
commit
954144f5b9
@ -42,7 +42,7 @@ namespace Oshima.Core.Utils
|
|||||||
Skills.AddRange([new 疾风步()]);
|
Skills.AddRange([new 疾风步()]);
|
||||||
|
|
||||||
Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(), new 回复术(), new 治愈术(),
|
Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(), new 回复术(), new 治愈术(),
|
||||||
new 时间加速(), new 时间减速()]);
|
new 时间加速(), new 时间减速(), new 沉默十字(), new 反魔法领域()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Item> GenerateMagicCards(int count, QualityType? qualityType = null)
|
public static List<Item> GenerateMagicCards(int count, QualityType? qualityType = null)
|
||||||
|
46
OshimaModules/Effects/PassiveEffects/封技.cs
Normal file
46
OshimaModules/Effects/PassiveEffects/封技.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using Milimoe.FunGame.Core.Entity;
|
||||||
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
|
||||||
|
namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects
|
||||||
|
{
|
||||||
|
public class 封技 : Effect
|
||||||
|
{
|
||||||
|
public override long Id => 4103;
|
||||||
|
public override string Name => "封技";
|
||||||
|
public override string Description => $"此角色被封技了,不能使用技能(魔法、战技和爆发技)。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||||
|
public override EffectType EffectType => EffectType.Silence;
|
||||||
|
public override Character Source => _sourceCharacter;
|
||||||
|
public override bool Durative => _durative;
|
||||||
|
public override double Duration => _duration;
|
||||||
|
public override int DurationTurn => _durationTurn;
|
||||||
|
|
||||||
|
private readonly Character _sourceCharacter;
|
||||||
|
private readonly bool _durative;
|
||||||
|
private readonly double _duration;
|
||||||
|
private readonly int _durationTurn;
|
||||||
|
|
||||||
|
public 封技(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||||
|
{
|
||||||
|
GamingQueue = skill.GamingQueue;
|
||||||
|
_sourceCharacter = sourceCharacter;
|
||||||
|
_durative = durative;
|
||||||
|
_duration = duration;
|
||||||
|
_durationTurn = durationTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEffectGained(Character character)
|
||||||
|
{
|
||||||
|
if (_durative) RemainDuration = Duration;
|
||||||
|
else RemainDurationTurn = DurationTurn;
|
||||||
|
character.CharacterEffectStates.Add(this, [CharacterState.SkillRestricted]);
|
||||||
|
character.UpdateCharacterState();
|
||||||
|
InterruptCasting(character, Source);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEffectLost(Character character)
|
||||||
|
{
|
||||||
|
character.CharacterEffectStates.Remove(this);
|
||||||
|
character.UpdateCharacterState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
|||||||
{
|
{
|
||||||
public override long Id => Skill.Id;
|
public override long Id => Skill.Id;
|
||||||
public override string Name => Skill.Name;
|
public override string Name => Skill.Name;
|
||||||
public override string Description => $"提升目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}友方角色 {SPD:0.##} 点行动速度。";
|
public override string Description => $"提升目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}友方角色 {SPD:0.##} 点行动速度 {持续时间}。";
|
||||||
|
|
||||||
private double SPD => Level > 0 ? Math.Abs(基础数值速度 + 基础速度等级成长 * (Level - 1)) : Math.Abs(基础数值速度);
|
private double SPD => Level > 0 ? Math.Abs(基础数值速度 + 基础速度等级成长 * (Level - 1)) : Math.Abs(基础数值速度);
|
||||||
private double 基础数值速度 { get; set; } = 65;
|
private double 基础数值速度 { get; set; } = 65;
|
||||||
|
37
OshimaModules/Effects/SkillEffects/造成封技.cs
Normal file
37
OshimaModules/Effects/SkillEffects/造成封技.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
using Milimoe.FunGame.Core.Entity;
|
||||||
|
using Oshima.FunGame.OshimaModules.Effects.PassiveEffects;
|
||||||
|
|
||||||
|
namespace Oshima.FunGame.OshimaModules.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} 个" : "")}敌人造成封技 {封技时间},无法使用技能(魔法、战技和爆发技),并打断当前施法。";
|
||||||
|
|
||||||
|
private string 封技时间 => _durative && _duration > 0 ? _duration + " 时间" : (!_durative && _durationTurn > 0 ? _durationTurn + " 回合" : "0 时间");
|
||||||
|
private readonly bool _durative;
|
||||||
|
private readonly double _duration;
|
||||||
|
private readonly int _durationTurn;
|
||||||
|
|
||||||
|
public 造成封技(Skill skill, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||||
|
{
|
||||||
|
GamingQueue = skill.GamingQueue;
|
||||||
|
_durative = durative;
|
||||||
|
_duration = duration;
|
||||||
|
_durationTurn = durationTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
|
||||||
|
{
|
||||||
|
foreach (Character enemy in targets)
|
||||||
|
{
|
||||||
|
WriteLine($"[ {caster} ] 对 [ {enemy} ] 造成了封技和施法解除!持续时间:{封技时间}!");
|
||||||
|
封技 e = new(Skill, caster, false, 0, 1);
|
||||||
|
enemy.Effects.Add(e);
|
||||||
|
e.OnEffectGained(enemy);
|
||||||
|
GamingQueue?.LastRound.Effects.TryAdd(enemy, e.EffectType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
|||||||
{
|
{
|
||||||
public override long Id => Skill.Id;
|
public override long Id => Skill.Id;
|
||||||
public override string Name => Skill.Name;
|
public override string Name => Skill.Name;
|
||||||
public override string Description => $"降低目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人 {Math.Abs(SPD):0.##} 点行动速度。";
|
public override string Description => $"降低目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人 {Math.Abs(SPD):0.##} 点行动速度 {持续时间}。";
|
||||||
|
|
||||||
private double SPD => Level > 0 ? -Math.Abs(基础数值速度 + 基础速度等级成长 * (Level - 1)) : -Math.Abs(基础数值速度);
|
private double SPD => Level > 0 ? -Math.Abs(基础数值速度 + 基础速度等级成长 * (Level - 1)) : -Math.Abs(基础数值速度);
|
||||||
private double 基础数值速度 { get; set; } = 30;
|
private double 基础数值速度 { get; set; } = 30;
|
||||||
|
@ -40,6 +40,8 @@ namespace Oshima.FunGame.OshimaModules
|
|||||||
(long)MagicID.治愈术 => new 治愈术(),
|
(long)MagicID.治愈术 => new 治愈术(),
|
||||||
(long)MagicID.时间加速 => new 时间加速(),
|
(long)MagicID.时间加速 => new 时间加速(),
|
||||||
(long)MagicID.时间减速 => new 时间减速(),
|
(long)MagicID.时间减速 => new 时间减速(),
|
||||||
|
(long)MagicID.沉默十字 => new 沉默十字(),
|
||||||
|
(long)MagicID.反魔法领域 => new 反魔法领域(),
|
||||||
(long)SkillID.疾风步 => new 疾风步(),
|
(long)SkillID.疾风步 => new 疾风步(),
|
||||||
(long)SuperSkillID.力量爆发 => new 力量爆发(),
|
(long)SuperSkillID.力量爆发 => new 力量爆发(),
|
||||||
(long)SuperSkillID.天赐之力 => new 天赐之力(),
|
(long)SuperSkillID.天赐之力 => new 天赐之力(),
|
||||||
|
27
OshimaModules/Skills/魔法/反魔法领域.cs
Normal file
27
OshimaModules/Skills/魔法/反魔法领域.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using Milimoe.FunGame.Core.Entity;
|
||||||
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
using Oshima.FunGame.OshimaModules.Effects.SkillEffects;
|
||||||
|
|
||||||
|
namespace Oshima.FunGame.OshimaModules.Skills
|
||||||
|
{
|
||||||
|
public class 反魔法领域 : Skill
|
||||||
|
{
|
||||||
|
public override long Id => (long)MagicID.反魔法领域;
|
||||||
|
public override string Name => "反魔法领域";
|
||||||
|
public override string Description => Effects.Count > 0 ? string.Join("\r\n", Effects.Select(e => e.Description)) : "";
|
||||||
|
public override double MPCost => Level > 0 ? 85 + (80 * (Level - 1)) : 85;
|
||||||
|
public override double CD => Level > 0 ? 75 + (2 * (Level - 1)) : 75;
|
||||||
|
public override double CastTime => 15;
|
||||||
|
public override double HardnessTime { get; set; } = 10;
|
||||||
|
|
||||||
|
public override List<Character> SelectTargets(Character caster, List<Character> enemys, List<Character> teammates)
|
||||||
|
{
|
||||||
|
return [.. enemys];
|
||||||
|
}
|
||||||
|
|
||||||
|
public 反魔法领域(Character? character = null) : base(SkillType.Magic, character)
|
||||||
|
{
|
||||||
|
Effects.Add(new 造成封技(this, true, 15, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
OshimaModules/Skills/魔法/沉默十字.cs
Normal file
22
OshimaModules/Skills/魔法/沉默十字.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using Milimoe.FunGame.Core.Entity;
|
||||||
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
using Oshima.FunGame.OshimaModules.Effects.SkillEffects;
|
||||||
|
|
||||||
|
namespace Oshima.FunGame.OshimaModules.Skills
|
||||||
|
{
|
||||||
|
public class 沉默十字 : Skill
|
||||||
|
{
|
||||||
|
public override long Id => (long)MagicID.沉默十字;
|
||||||
|
public override string Name => "沉默十字";
|
||||||
|
public override string Description => Effects.Count > 0 ? string.Join("\r\n", Effects.Select(e => e.Description)) : "";
|
||||||
|
public override double MPCost => Level > 0 ? 65 + (65 * (Level - 1)) : 65;
|
||||||
|
public override double CD => Level > 0 ? 65 + (1.5 * (Level - 1)) : 65;
|
||||||
|
public override double CastTime => 10;
|
||||||
|
public override double HardnessTime { get; set; } = 10;
|
||||||
|
|
||||||
|
public 沉默十字(Character? character = null) : base(SkillType.Magic, character)
|
||||||
|
{
|
||||||
|
Effects.Add(new 造成封技(this, false, 0, 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user