51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
/*
|
||
* @Author: 白哉
|
||
* @Description:
|
||
* @Date: 2025年09月12日 星期四 17:09:18
|
||
* @Modify:
|
||
*/
|
||
|
||
using RuntimeData;
|
||
using System;
|
||
using MemoryPack;
|
||
using TH1_Logic.Core;
|
||
using Unity.VisualScripting;
|
||
|
||
namespace Logic.Skill
|
||
{
|
||
public partial class MokouFrenchEggSkill : SkillBase
|
||
{
|
||
public UnitFullType FullType;
|
||
|
||
|
||
public MokouFrenchEggSkill()
|
||
{
|
||
IsPermanent = true;
|
||
TurnsLimit = 0;
|
||
Score = 4;
|
||
}
|
||
|
||
public override SkillType GetSkillType()
|
||
{
|
||
return SkillType.MOKOUFRENCHEGG;
|
||
}
|
||
|
||
private void UpdateFullType(UnitData self)
|
||
{
|
||
FullType.UnitType = UnitType.KaguyaFrenchMokouEgg;
|
||
FullType.GiantType = GiantType.None;
|
||
FullType.UnitLevel = self.UnitFullType.UnitLevel;
|
||
}
|
||
|
||
public override void OnDamaged(MapData mapData, SettlementInfo info)
|
||
{
|
||
if (info == null || !info.IsKill || info.DamageTargetGrid == null || info.DamageTargetCity == null) return;
|
||
UpdateFullType(info.DamageTarget);
|
||
//如果要复活的位置上有地方单位,先将对方passiveMove开
|
||
if (mapData.GetUnitDataByGid(info.DamageTargetGrid.Id, out var unit))
|
||
Main.UnitLogic.PassiveMoveAway(mapData,unit);
|
||
mapData.AddUnitData(info.DamageTargetGrid.Id, info.DamageTargetCity.Id, FullType,out var _);
|
||
}
|
||
}
|
||
}
|