Skip to content

Conversation

NetsuNegi
Copy link
Contributor

@NetsuNegi NetsuNegi commented Aug 9, 2025

  • Now you can make vehicle disguise to other vehicles, like spy.
  • 现在你可以让载具伪装成载具了,就像间谍那样.

In rulesmd.ini:

[SOMETECHNO]      ; InfantryType or UnitType 
DefaultDisguise=    ; InfantryType or UnitType

@NetsuNegi NetsuNegi added ❓New feature Needs testing ⚙️T1 T1 maintainer review is sufficient labels Aug 9, 2025
Copy link

github-actions bot commented Aug 9, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Copy link
Contributor

@CrimRecya CrimRecya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a problem that could lead to a crash.
Others look good, and I think we can make them clearer.
And, I'm not sure if there's anything else that need to process.

@@ -504,6 +523,234 @@ DEFINE_HOOK(0x74691D, UnitClass_UpdateDisguise_EMP, 0x6)
return 0x746931;
}

DEFINE_HOOK(0x7466DC, UnitClass_DisguiseAs_DisguiseAsVehicle, 0x6)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEFINE_HOOK(0x7466D8, UnitClass_DisguiseAs_DisguiseAsVehicle, 0xA) may be better?

Comment on lines +571 to +629
DEFINE_HOOK(0x73C655, UnitClass_DrawSHP_TechnoType, 0x6)
{
enum { ApplyDisguiseType = 0x73C65B };

GET(UnitClass*, pThis, EBP);

if (pThis->IsDisguised() && !pThis->IsClearlyVisibleTo(HouseClass::CurrentPlayer))
{
const auto pTargetType = pThis->GetDisguise(true);

if (pTargetType && pTargetType->WhatAmI() == UnitTypeClass::AbsID)
{
R->ECX(pTargetType);
return ApplyDisguiseType;
}
}

return 0;
}

DEFINE_HOOK(0x73C69D, UnitClass_DrawSHP_TechnoType2, 0x6)
{
enum { ApplyDisguiseType = 0x73C6A3 };

GET(UnitClass*, pThis, EBP);

if (pThis->IsDisguised() && !pThis->IsClearlyVisibleTo(HouseClass::CurrentPlayer))
{
const auto pTargetType = pThis->GetDisguise(true);

if (pTargetType && pTargetType->WhatAmI() == UnitTypeClass::AbsID)
{
R->ECX(pThis->GetDisguise(true));
return ApplyDisguiseType;
}
}

return 0;
}

DEFINE_HOOK(0x73C702, UnitClass_DrawSHP_TechnoType3, 0x6)
{
enum { ApplyDisguiseType = 0x73C708 };

GET(UnitClass*, pThis, EBP);

if (pThis->IsDisguised() && !pThis->IsClearlyVisibleTo(HouseClass::CurrentPlayer))
{
const auto pTargetType = pThis->GetDisguise(true);

if (pTargetType && pTargetType->WhatAmI() == UnitTypeClass::AbsID)
{
R->ECX(pThis->GetDisguise(true));
return ApplyDisguiseType;
}
}

return 0;
}
Copy link
Contributor

@CrimRecya CrimRecya Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look the same, I think they should be able to be encapsulated into a function ObjectTypeClass* GetUnitDisguiseAs(UnitClass* pThis)?

return 0;
}

DEFINE_HOOK(0x73C725, UnitClass_DrawSHP_HasTurret, 0x5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's 0x6 instead of 0x5.

Comment on lines +683 to +696
if (pType != pThis->Type)
{
if (pType->TurretCount > 0 && !pType->IsGattling)
return 0x73B8EC;
else
return 0x73B92F;
}
else
{
if (!pType->HasMultipleTurrets() || pType->IsGattling)
return 0x73B92F;
else
return 0x73B8FC;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can make it clearer

	if (!pType->HasMultipleTurrets() || pType->IsGattling)
		return 0x73B92F;

	return pType != pThis->Type ? 0x73B8EC : 0x73B8FC;

Comment on lines +704 to +724
if (pType != pThis->Type)
{
if (pType->TurretCount > 0 && !pType->IsGattling)
{
if (pThis->CurrentTurretNumber < 0)
R->Stack<int>(0x1C, 0);

return 0x73BC35;
}
else
{
return 0x73BD79;
}
}
else
{
if (!pType->HasMultipleTurrets() || pType->IsGattling)
return 0x73BD79;
else
return 0x73BC49;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, it can also return 0x73BD79; first if (!pType->HasMultipleTurrets() || pType->IsGattling)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs testing ❓New feature ⚙️T1 T1 maintainer review is sufficient
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants