Related to issue #895521: Hover units and Cloak Generators

Hover units couldn't be cloaked by Cloak Generators because they only cloak units on the ground. Now, everything lower than or equal to [General]HoverHeight= will be cloaked.
Customizable CloakSound

[AudioVisual]CloakSound= has been deglobalized and split into two tags:

[TechnoType]CloakSound= (soundmd entry): Played when a unit submerges.
[TechnoType]DecloakSound= (soundmd entry): Played when a unit emerges.

Both tags default to [AudioVisual]CloakSound=. It does not matter whether the unit cloaks itself or whether it is cloaked by a Cloak Generator.
Related to issue #896200: Powered units are still cloaked when offline

Recoded the methods responsible for deciding whether a unit is allowed or disallowed to cloak.

Deactivated units (both PoweredBy= and PoweredUnit=) and units whose driver have been killed are not eligible for cloaking any more, and they will uncloak automatically.
Related to issue #896110: Hover units cannot cloak

Merged the previous fix with the latest cloak changes.
Moved the cloak and uncloak sound hooks to the new Hooks.Cloak.cpp file.
Related to issue #894978: Restore the "CloakStop" function

CloakStop has been fixed. It failed, because an additional check for a techno's Cloakable member overwrote the result of the IsCloakable() method.

Additionally, Is_Moving_Now() has been replaced by Is_Moving(), because it doesn't check the current speed in case the unit is turning, thus the techno stays uncloaked.
Some refactoring of the cloak functions.

The function that checks whether a techno can cloak on its own at the moment is called from within the IsCloakable() check.
Check for CloakDisallowed() instead of for IsCloakable() a) IsCloakable() is called from CloakDisallowed() b) Units under EMP and in range of a Cloak Generator would flicker.
Related to issue #896279: Cloak Generators vs Sonar SonarPulse SW

As long as a sonar effect is active, units can't cloak, whether they are in range of a Cloak Generator or not.

This implementation makes the old handling obsolete, thus it has been removed.
SensorArray fixes

Buildings with SensorArray=yes use SensorsSight= to detect stealth and subterranean units, as in Tiberian Sun.

SensorArrays were not supposed to be powered, to change owner (by capture or mind-control), and weren't updated for temporal weapons. All of this should work now as one would expect.

The bug that the sensor effect would stay active even if the array was destroyed is fixed. It was because SensorsSight was used to activate the effect, while CloakRadiusInCells was used to remove it. If the latter was smaller, the bug happened.

The logic was also changed to not add the same array more than once (same for removal).

Newly added EVA events, which should be self-explanatory: EVA_CloakedUnitDetected and EVA_SubterraneanUnitDetected.
Implemented a global decloak sound

[AudioVisual]DecloakSound= (soundmd entry, defaults to [AudioVisual]CloakSound=)

This is used as default value for the techno-specific DecloakSound=.
Cloak now affects units regardless of their flying height

Moved the height check to the cloak generator handling. Thus, units self-cloak just fine, but cloak generators will not reach uncloakable units above HoverHeight.

This way, the game does not second-guess units being allowed to cloak (either by Cloakable=yes or by veterancy).
Customizable cloak height

[General]CloakHeight= (integer, defaults to [General]HoverHeight=)
The height under which units are affected by cloak generators. Units moving above this height will not be affected (though they can still self-cloak). Yuri's Revenge original value is 0.
Redraw buildings if they have been detected by Sensor Arrays
Detected submerged units will display their health bar
Related to #1203221: Cloaking ejects parasites

Parasites aren't thrown out any more when a unit cloaks. They will cloak, keeping the parasite inside.

YR handles parasites manually. The ParasiteClass is informed about invalidated pointers through the victim, not through the owner. The ParasiteClass doesn't get the state of the pointer passed, though; it always sees pointers as being removed from the game. If the victim is handling itself being announced as invalid, it just clears the pointer to the parasite owner, breaking the link.

Now, the ParasiteClass gets the real value and can decide whether it should stay or exit. It only exits when the victim is removed. The parasite owner is only cleared if the victim leaves the battlefield (which it isn't when it cloaks).
Related to #896360: Powered cloakable buildings

[BuildingType]Cloakable.Powered= (boolean, defaults to no)
Whether this building will uncloak in low-power situations. Otherwise the building will stay cloaked.
Prevent objects from being cloaked

This can be used to create Tiberium Wars stealth generators like the Disruption Tower.

[TechnoType]Cloakable.Allowed= (boolean, defaults to yes)
If set to no, this object is not allowed to be cloaked (neither through self-cloak nor through Cloak Generators).
Related to #1227300: Cloakable.Allowed and cloak crates

Cloak crate bonus will be replaced with money if a Cloakable.Allowed=no unit collects them.
Related to #1227331: SensorArrays will use SensorsSight for radial indicator

Previously, it used CloakRadiusInCells like CloakGenerator=yes.