Vinifera icon indicating copy to clipboard operation
Vinifera copied to clipboard

Implements `TransformsInto` for UnitType's.

Open Rampastring opened this issue 2 years ago • 2 comments

Closes #611 , Closes #715

This patch makes it possible for vehicles to transform into other vehicles on deploy.

This behaviour is controlled by a new TransformsInto=<unit type> key for UnitTypes. If it points to a valid UnitType, the unit is transformed into the specified unit type when deployed.

Also, in DTA we have a use-case where we want the transform to have a cooldown. This can be optionally enabled by giving the unit TransformRequiresFullCharge=yes. This re-uses the Mobile EMP's Charge logic: when this key is set, the unit is required to have full charge or it isn't able to transform.

Finally, for implementing this without having the transform break the build limits of units, I had to re-implement a part of the build limit checking for this patch. While at it, I also fixed #611 .

Remarks

If the unit also has DeploysInto= pointing to a building type, the DeploysInto logic is prioritized over unit transformation.

The unit transformation logic, however, is prioritized over the Mobile EMP blast logic.

Rampastring avatar Dec 03 '22 02:12 Rampastring