2026-05-06 01:59:03 +08:00

43 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Description: 城市被 Cloak 偷金币的标记技能。挂在 CityData 上。
* StealerPlayerId 记录偷家、StolenAmount 在攻击瞬间锁定金额。
* 城主回合开始时 GetCityCoinPerTurn 因有此标记返 0
* 同回合 Cloak 玩家 PlayerLogic.StartNextTurn 时把 StolenAmount 入账给偷家;
* 城主回合结束时此 skill 自删。
*/
using System;
using MemoryPack;
using RuntimeData;
namespace Logic.Skill
{
public partial class CityStolenSkill : SkillBase
{
public uint StealerPlayerId;
public int StolenAmount;
public CityStolenSkill()
{
IsPermanent = true;
TurnsLimit = 0;
Score = 0;
}
public override SkillType GetSkillType()
{
return SkillType.CITYSTOLEN;
}
public override void OnTurnEnd(IdentifierBase self, MapData mapData)
{
// CityData.OnTurnEnd 只在城主玩家回合末尾被调用,所以一进这里就说明城主当回合已结算完毕,可清除标记
if (self is not CityData city) return;
city.RemoveSkill(SkillType.CITYSTOLEN, mapData);
city.CityInfoRenderer(mapData)?.InstantUpdateCityInfo();
}
}
}