mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-02 20:26:03 +08:00
Rappa Skill
This commit is contained in:
@@ -560,5 +560,6 @@ public enum MissionFinishTypeEnum
|
||||
RogueUnlockMedalCnt = 260030,
|
||||
RogueMagicFinishWithAllScepterFuncType = 260031,
|
||||
MusicRhythmFinishAllLevel = 260032,
|
||||
MusicRhythmFinishAnyLevel = 260033
|
||||
MusicRhythmFinishAnyLevel = 260033,
|
||||
RogueMagicFinishExtraLayerWithDifficulty = 260034
|
||||
}
|
||||
26
GameServer/Game/Battle/Skill/Action/MazeRemoveMazeBuff.cs
Normal file
26
GameServer/Game/Battle/Skill/Action/MazeRemoveMazeBuff.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using EggLink.DanhengServer.GameServer.Game.Player;
|
||||
using EggLink.DanhengServer.GameServer.Game.Scene.Entity;
|
||||
using EggLink.DanhengServer.GameServer.Game.Scene;
|
||||
|
||||
namespace EggLink.DanhengServer.GameServer.Game.Battle.Skill.Action;
|
||||
|
||||
public class MazeRemoveMazeBuff(int buffId) : IMazeSkillAction
|
||||
{
|
||||
public int BuffId { get; } = buffId;
|
||||
|
||||
public async ValueTask OnAttack(AvatarSceneInfo avatar, List<EntityMonster> entities)
|
||||
{
|
||||
await System.Threading.Tasks.Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async ValueTask OnCast(AvatarSceneInfo avatar, PlayerInstance player)
|
||||
{
|
||||
await avatar.RemoveBuff(BuffId);
|
||||
}
|
||||
|
||||
public async ValueTask OnHitTarget(AvatarSceneInfo avatar, List<EntityMonster> entities)
|
||||
{
|
||||
foreach (var entity in entities)
|
||||
await entity.RemoveBuff(BuffId);
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class MazeSkill
|
||||
Actions.Add(new MazeAddMazeBuff(task.ID, task.LifeTime.GetLifeTime()));
|
||||
break;
|
||||
case TaskTypeEnum.RemoveMazeBuff:
|
||||
Actions.RemoveAll(a => a is MazeAddMazeBuff buff && buff.BuffId == task.ID);
|
||||
Actions.Add(new MazeRemoveMazeBuff(task.ID));
|
||||
break;
|
||||
case TaskTypeEnum.AdventureModifyTeamPlayerHP:
|
||||
break;
|
||||
|
||||
@@ -21,34 +21,33 @@ public class HandlerSceneCastSkillCsReq : Handler
|
||||
|
||||
if (caster != null)
|
||||
{
|
||||
// Check if normal attack or technique was used
|
||||
if (req.MazeAbilityStr != "")
|
||||
{
|
||||
// overwrite whole skill
|
||||
// overwrite
|
||||
AbilityInfo? ability = null;
|
||||
caster.AvatarInfo.Excel?.MazeAbility.TryGetValue(req.MazeAbilityStr, out ability);
|
||||
if (ability != null)
|
||||
{
|
||||
mazeSkill = MazeSkillManager.GetSkill(caster.AvatarInfo.GetAvatarId(), ability, req);
|
||||
mazeSkill.OnCast(caster, player);
|
||||
|
||||
await connection.SendPacket(new PacketSceneCastSkillScRsp(req.CastEntityId, []));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (req.SkillIndex > 0)
|
||||
{
|
||||
// Cast skill effects
|
||||
if (caster.AvatarInfo.Excel != null && caster.AvatarInfo.Excel!.MazeSkill != null)
|
||||
{
|
||||
mazeSkill = MazeSkillManager.GetSkill(caster.AvatarInfo.GetAvatarId(), (int)req.SkillIndex, req);
|
||||
mazeSkill.OnCast(caster, player);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mazeSkill = MazeSkillManager.GetSkill(caster.AvatarInfo.GetAvatarId(), 0, req);
|
||||
// Check if normal attack or technique was used
|
||||
if (req.SkillIndex > 0)
|
||||
{
|
||||
// Cast skill effects
|
||||
if (caster.AvatarInfo.Excel != null && caster.AvatarInfo.Excel!.MazeSkill != null)
|
||||
{
|
||||
mazeSkill = MazeSkillManager.GetSkill(caster.AvatarInfo.GetAvatarId(), (int)req.SkillIndex, req);
|
||||
mazeSkill.OnCast(caster, player);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mazeSkill = MazeSkillManager.GetSkill(caster.AvatarInfo.GetAvatarId(), 0, req);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +68,7 @@ public class HandlerSceneCastSkillCsReq : Handler
|
||||
foreach (var id in req.HitTargetEntityIdList)
|
||||
hitTargetEntityIdList.Add(id);
|
||||
// Start battle
|
||||
await connection.Player!.BattleManager!.StartBattle(req, mazeSkill!, [.. hitTargetEntityIdList]);
|
||||
await connection.Player!.BattleManager!.StartBattle(req, mazeSkill, [.. hitTargetEntityIdList]);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user