Rappa Skill

This commit is contained in:
Somebody
2024-10-27 10:01:46 +08:00
parent fea7615a29
commit b5b0331f13
4 changed files with 45 additions and 19 deletions

View File

@@ -560,5 +560,6 @@ public enum MissionFinishTypeEnum
RogueUnlockMedalCnt = 260030,
RogueMagicFinishWithAllScepterFuncType = 260031,
MusicRhythmFinishAllLevel = 260032,
MusicRhythmFinishAnyLevel = 260033
MusicRhythmFinishAnyLevel = 260033,
RogueMagicFinishExtraLayerWithDifficulty = 260034
}

View 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);
}
}

View File

@@ -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;

View File

@@ -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