DrainWeapon
| Flag: | DrainWeapon |
| File(s): | rules(md).ini |
| Values: | Boolean values: yes or no, true or false, 1 or 0 |
| Default: | no |
| Applicable to: | Weapons |
Specifies whether or not this weapon should "drain" a target it is attacking, rather than dealing damage to it. In vanilla, it is used for the secondary weapon of Floating Disk.
Notes
This weapon can only fire on objects that have passed standard target filtering and possess Drainable=yes, but if the target is not a building it will simply keep draining without producing any effect. For building targets:
- By default, it will put the building into LowPower state.
- If the building has ResourceDestination=yes, then every number of frames defined by [CombatDamage]→DrainMoneyFrameDelay= it will transfer funds of the amount defined by [CombatDamage]→DrainMoneyAmount= from the building's owner to the firer's owner.
- If the building's Power= is set to a non-negative value, then during sustained attack the building's owner will be put into LowPower state, and trigger the LowPower animation of the owner's buildings if possible, just like being infiltrated by a Spy into a Power Plant.
The weapon does not actually fire; it only aims at and affects the building or its owner. While this weapon is firing, it plays the animation defined by [CombatDamage]→DrainAnimationType=. This weapon can only fire when the unit is directly above the target building[1]; otherwise the unit will immediately lose the target. For this you need a vehicle as the firer, give it BalloonHover=yes and give the weapon a projectile with Vertical=yes.
Bugs/Side-Effects/Unexpected Limitations
If the firer is not a vehicle type but e.g. an infantry, then it can use this weapon when overlapping with building cell #0, but it will never stop naturally, even if the infantry leaves.
References
Starting from Ares 0.6, the power of buildings with a positive Power value when being drained can be controlled via Drain.Local and Drain.Amount instead of always shutting down the entire owner's power supply. Refer to Ares documentation.
Starting from Ares 0.7, [BuildingType]→IsPassable=yes can allow technos without Locomotor={92612C46-F71F-11d1-AC9F-006008055BB5} (Jumpjet) to satisfy the weapon firing condition.
- This does not mean they will correctly acquire the target position as well; often you need to manually move them to the building's cell #0 to succeed.
Footnotes
- ↑ Specifically, the position of the firer on the horizontal plane needs to be kept within any cell within the Foundation area of the target building.