by SwordGrunt » Tue Feb 16, 2016 6:17 pm
Currently, PowerDrain is hardcoded to return half of all damage dealt as health directly to the player.
It would be very useful for any kind of scoring system to be able to "drain" something other than health, namely an inventory item; normally this is being done by A_GiveToTarget when monsters are killed, which has the downsides of not allowing compatibility between mods (as monsters whose death states do not contain the instruction will be useless for a scoring system of this type) and, particularly on larger monsters, only giving credit to the final blow even if another player has contributed more for the kill (or possibly not awarding anything whatsoever if a non-player entity deals the killing blow).
At the same time, defining the strength of the Drain powerup, even if no inventory item is specified, would still add flexibility to the default health draining functionality.
Essentially, this means two existing powerup properties would be used by the Drain powerup:
Powerup.Strength amount
The percentage of damage the powerup drains as health (or an inventory item if Powerup.Mode is used), defaulting to 50, which is the current fixed amount. This is assuming an integer value is required; a floating point would be much more appropriate for this property.
Powerup.Mode class
The item to be given by the powerup each time damage is dealt, defaulting to "Health", which simply heals the player as it does currently.
Currently, [b]PowerDrain[/b] is hardcoded to return half of all damage dealt as health directly to the player.
It would be very useful for any kind of scoring system to be able to "drain" something [i]other than health[/i], namely an [b]inventory item;[/b] normally this is being done by A_GiveToTarget when monsters are killed, which has the downsides of not allowing compatibility between mods (as monsters whose death states do not contain the instruction will be useless for a scoring system of this type) and, particularly on larger monsters, only giving credit to the final blow even if another player has contributed more for the kill (or possibly not awarding anything whatsoever if a non-player entity deals the killing blow).
At the same time, defining the [b]strength[/b] of the Drain powerup, even if no inventory item is specified, would still add flexibility to the default health draining functionality.
Essentially, this means two existing powerup properties would be used by the Drain powerup:
[b]Powerup.Strength[/b] [i]amount[/i]
The percentage of damage the powerup drains as health (or an inventory item if [i]Powerup.Mode[/i] is used), defaulting to 50, which is the current fixed amount. This is assuming an integer value is required; a floating point would be much more appropriate for this property.
[b]Powerup.Mode[/b] [i]class[/i]
The item to be given by the powerup each time damage is dealt, defaulting to "Health", which simply heals the player as it does currently.