53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
/*
|
|
* @Author: 白哉
|
|
* @Description:
|
|
* @Date: 2025年09月12日 星期四 17:09:18
|
|
* @Modify:
|
|
*/
|
|
|
|
using RuntimeData;
|
|
using System;
|
|
using MemoryPack;
|
|
using TH1_Logic.Core;
|
|
|
|
namespace Logic.Skill
|
|
{
|
|
public partial class ReisenFrenchKillSkill : SkillBase
|
|
{
|
|
public UnitFullType FullType;
|
|
|
|
|
|
public ReisenFrenchKillSkill()
|
|
{
|
|
IsPermanent = true;
|
|
TurnsLimit = 0;
|
|
Score = 4;
|
|
}
|
|
|
|
public override SkillType GetSkillType()
|
|
{
|
|
return SkillType.REISENFRENCHKILL;
|
|
}
|
|
private void UpdateFullType(UnitData self)
|
|
{
|
|
FullType.UnitType = UnitType.KaguyaFrenchReisenIllusion;
|
|
FullType.GiantType = GiantType.None;
|
|
FullType.UnitLevel = self.UnitFullType.UnitLevel;
|
|
}
|
|
public override void OnDamageOther(MapData mapData, SettlementInfo info)
|
|
{
|
|
if (!info.IsKill || info.DamageOrigin == null || info.DamageTargetGrid == null) return;
|
|
if (mapData.GetUnitDataByGid(info.DamageTargetGrid.Id, out _)) return;
|
|
if (!mapData.GetPlayerDataByUnitId(info.DamageOrigin.Id, out var player)) return;
|
|
if (!mapData.GetCapitalCityDataByPlayerId(player.Id, out var capitalCity)) return;
|
|
UpdateFullType(info.DamageOrigin);
|
|
if (mapData.AddUnitData(info.DamageTargetGrid.Id, capitalCity.Id, FullType, out var unit))
|
|
{
|
|
info.DamageOrigin.HeroTask(mapData)?.OnSkillActivation(mapData,SkillType.REISENFRENCHKILL,1);
|
|
Main.PlayerLogic.UpdateSightByRadius(mapData,player,unit.Grid(mapData),unit.GetSightRange(mapData));
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|