/* A powerup that doubles all damage the player inflicts, but also doubles all
 * damage the player takes.
 *
 * DEPENDS ON:
 * realm667.pickup.DoubleDamage.wad (sprites)
 */

actor Anachrony_HalfProtectionPower : PowerProtection
{
    damagefactor "normal", 2
}

actor Anachrony_HalfProtectionGiver : PowerupGiver
{
    +INVENTORY.AUTOACTIVATE
    +INVENTORY.ALWAYSPICKUP
    inventory.maxamount 0
    powerup.type Anachrony_HalfProtectionPower
    powerup.duration -30
    powerup.color "A02000", 0.3
}

actor Anachrony_DoubleDamagePower : PowerDamage
{
    damagefactor "normal", 2
}

actor Anachrony_DoubleDamageGiver : PowerupGiver
{
    +INVENTORY.AUTOACTIVATE
    inventory.maxamount 0
    powerup.type Anachrony_DoubleDamagePower
    // No color; we're relying on the half protection's color
    powerup.duration -30
}

actor Anachrony_DoomSphere : CustomInventory 13301
{
	//$Category Powerups
	//$Title Doom Sphere
    +COUNTITEM
    +NOGRAVITY
    +INVENTORY.AUTOACTIVATE
    +INVENTORY.ALWAYSPICKUP
    inventory.maxamount 0
    inventory.pickupmessage "Double Damage!"
    // Copied from PowerupGiver
    +INVENTORY.FANCYPICKUPSOUND
    inventory.pickupsound "misc/p_pkup"

    states {
    Spawn:
        DDMG ABC 6 Bright
        loop
    Pickup:
        DDMG A 0 A_GiveInventory("Anachrony_DoubleDamageGiver", 1)
        DDMG A 0 A_GiveInventory("Anachrony_HalfProtectionGiver", 1)
        stop
    }
}
