51 lines
3.0 KiB
PowerShell
51 lines
3.0 KiB
PowerShell
param(
|
|
[string]$UnitLogicFile = "Unity/Assets/Scripts/TH1_Logic/Unit/UnitLogic.cs",
|
|
[string]$ReviveSkillFile = "Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/MokouFrenchReviveSkill.cs",
|
|
[string]$MoveKillSkillFile = "Unity/Assets/Scripts/TH1_Logic/Skill/AllSkill/MokouFrenchMoveKillSkill.cs",
|
|
[string]$MoveKillFragmentFile = "Unity/Assets/Scripts/TH1_Anim/Fragments/FragmentMoveKill.cs"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$repoRoot = git rev-parse --show-toplevel 2>$null
|
|
if (-not $repoRoot) {
|
|
throw "Not inside a git repository."
|
|
}
|
|
$repoRoot = [System.IO.Path]::GetFullPath($repoRoot.Trim())
|
|
|
|
function Read-RepoFile([string]$relativePath) {
|
|
$fullPath = Join-Path $repoRoot $relativePath
|
|
if (-not (Test-Path -LiteralPath $fullPath)) {
|
|
throw "Required file not found: $fullPath"
|
|
}
|
|
return Get-Content -LiteralPath $fullPath -Raw -Encoding UTF8
|
|
}
|
|
|
|
function Assert-Contains([string]$text, [string]$needle, [string]$label) {
|
|
if (-not $text.Contains($needle)) {
|
|
throw "Mokou revived move-kill guardrail failed: $label missing '$needle'."
|
|
}
|
|
}
|
|
|
|
$unitLogicText = Read-RepoFile $UnitLogicFile
|
|
$reviveSkillText = Read-RepoFile $ReviveSkillFile
|
|
$moveKillSkillText = Read-RepoFile $MoveKillSkillFile
|
|
$fragmentText = Read-RepoFile $MoveKillFragmentFile
|
|
|
|
Assert-Contains $reviveSkillText 'newUnit.AddSkill_Legacy(SkillType.MokouFrenchMoveKill' 'revived Lv3+ Mokou must receive the move-kill marker'
|
|
Assert-Contains $moveKillSkillText 'self.GiantType != GiantType.FrenchMokou' 'move-kill marker must be limited to Mokou'
|
|
Assert-Contains $moveKillSkillText 'attackDistance <= self.GetAttackRange(mapData)' 'Mokou move-kill must allow current attack range'
|
|
|
|
Assert-Contains $unitLogicText 'activeSettlement.IsKill || !unit2.IsAlive()' 'attack settlement must treat death replacement kills as kills'
|
|
Assert-Contains $unitLogicText 'TryMoveAttackerToKilledTarget(mapData, unit1, unit2, grid2, attackDistance, ref fragmentType)' 'attack kill path must use shared move-kill helper'
|
|
Assert-Contains $unitLogicText 'private bool CanMoveAttackerToKilledTarget' 'move-kill predicate must stay centralized'
|
|
Assert-Contains $unitLogicText 'SkillType.MokouFrenchMoveKill' 'central move-kill predicate must include revived Mokou'
|
|
Assert-Contains $unitLogicText 'CheckUnitAbleForGrid_RealTimeStatus(mapData, attacker, targetGrid)' 'Mokou move-kill must still obey ordinary standing rules'
|
|
Assert-Contains $unitLogicText 'MoveToLogic(mapData, attacker, targetGrid, MoveType.AttackMove)' 'move-kill helper must use attack move logic'
|
|
Assert-Contains $unitLogicText 'fragmentType = FragmentType.MoveKill' 'successful helper movement must select MoveKill fragment'
|
|
|
|
Assert-Contains $fragmentText 'if (_attackInfo.ProjectileType != ProjectileType.Melee)' 'MoveKill fragment must preserve ranged handling'
|
|
Assert-Contains $fragmentText 'Data.OriginUnitRenderer.AnimManager.EnqueueAnim(UnitAtomAnimType.Move, animData)' 'ranged MoveKill must move the attacker renderer after impact'
|
|
|
|
Write-Host "Mokou revived move-kill guardrail passed."
|