56 lines
1.7 KiB
C#
56 lines
1.7 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description: 恋死亡恐惧技能
|
|
* @Date: 2026年03月06日
|
|
* @Modify:
|
|
*/
|
|
|
|
using RuntimeData;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using MemoryPack;
|
|
using TH1Renderer;
|
|
using UnityEngine;
|
|
|
|
namespace Logic.Skill
|
|
{
|
|
public partial class KoishiDeathFearSkill : SkillBase
|
|
{
|
|
public KoishiDeathFearSkill()
|
|
{
|
|
IsPermanent = true;
|
|
TurnsLimit = 0;
|
|
Score = 4;
|
|
}
|
|
|
|
public override SkillType GetSkillType()
|
|
{
|
|
return SkillType.KoishiDeathFear;
|
|
}
|
|
|
|
public override void BeforeDisappear(MapData mapData, UnitData self)
|
|
{
|
|
var grid = self.Grid(mapData);
|
|
if (grid == null) return;
|
|
var aroundBuf = RentAroundBuf();
|
|
mapData.GridMap.GetAroundGridData(1, 1, grid, aroundBuf);
|
|
foreach (var around in aroundBuf)
|
|
{
|
|
if (around == grid) continue;
|
|
around.RealUnit(mapData,out var target);
|
|
if (target == null) continue;
|
|
// 友军/刚破盟单位跳过(与 UnitActionLogic、YuugiDashProSkill 等范围效果路径一致)
|
|
if (mapData.IsLeagueOrJustBreakByUnit(self.Id, target.Id)) continue;
|
|
// 与项目内其它"加 KomeijiFear"路径保持一致:免疫者跳过
|
|
if (target.GetSkill(SkillType.KomeijiFearImmune, out _)) continue;
|
|
target.AddOrOverrideSkill(SkillType.KomeijiFear, mapData, self.Id);
|
|
// 播放恐惧VFX
|
|
around.Renderer(mapData)?.PlayVFXInSight(new GridVFXParams(GridVFXType.KomeijiFear));
|
|
}
|
|
ReturnAroundBuf();
|
|
}
|
|
}
|
|
}
|
|
|