# Add Charge Used For Player

Grammar — Add inVal charges used for charge inCharge for player inPlayer
FlagsNative | Action

Consumes the specified number of charges for the specified player charge link.

# Arguments

  • int — Player
  • string — Charge
  • fixed — Value

Returns — void

native void PlayerAddChargeUsed(
	int inPlayer,
	string inCharge,
	fixed inVal,
);

Category: Player / Charges And Cooldowns

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3859

    // Automatic Variable Declarations
    // Implementation
    PlayerAddChargeUsed(lp_inPlayer, lp_inCharge, (-1.0 * PlayerGetChargeUsed(lp_inPlayer, lp_inCharge)));
}

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3213

    // Automatic Variable Declarations
    // Implementation
    PlayerAddChargeUsed(lp_inPlayer, lp_inCharge, (-1.0 * PlayerGetChargeUsed(lp_inPlayer, lp_inCharge)));
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:1706

        PlayerScoreValueSetFromInt(lp_killingPlayer, "LostVikingsVikingBriberyStackScore", UnitBehaviorCount(lv_vikingUnit, "LostVikingsVikingBriberyStacks"));
        if ((ModI(UnitBehaviorCount(lv_vikingUnit, "LostVikingsVikingBriberyStacks"), 40) == 0)) {
            PlayerAddChargeUsed(lp_killingPlayer, "Abil/LostVikingsVikingBribery", -1.0);
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:8115

                lv_chargeCount = CatalogFieldValueGetAsInt(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Charge.CountMax", UnitGetOwner(lv_itUnit));
                UnitAddChargeUsed(lv_itUnit, lv_chargeLink, (-lv_chargeCount));
                PlayerAddChargeUsed(lp_player, lv_chargeLink, (-lv_chargeCount));
            }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SupportLib.galaxy:1655

            lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lv_abilLink, "Cost[" + IntToString(0) + "].Charge.Link", lv_ownerofUnit);
            UnitAddChargeUsed(lp_unit, lv_chargeLink, -1.0);
            PlayerAddChargeUsed(lv_ownerofUnit, lv_cooldownLink, -1.0);
        }

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:199

    libGame_gv_players[lp_player].lv_heroUnit = lv_dVaPilotUnit;
    libAIAI_gv_aIHeroes[lp_player].lv_currentHeroUnit = lv_dVaMechUnit;
    PlayerAddChargeUsed(lp_player, "Abil/DVaMechSelfDestruct", (CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "DVaMechSelfDestruct", "Cost.Charge.CountMax", lp_player) - PlayerGetChargeUsed(lp_player, "Abil/DVaMechSelfDestruct")));
    UnitGroupClear(libGame_gv_players[lp_player].lv_heroUnitGroup);
    UnitGroupAdd(libGame_gv_players[lp_player].lv_heroUnitGroup, lv_dVaMechUnit);

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:747

    }

    PlayerAddChargeUsed(lv_abathurPlayer, "Abil/DVaMechSelfDestruct", (lv_selfDestructChargeMax - PlayerGetChargeUsed(lv_abathurPlayer, "Abil/DVaMechSelfDestruct")));
    return true;
}

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:1048

    lv_damageTakenPercent += libHDVA_gv_dVaDefensiveChargeRemainder[lv_dVaPlayer];
    while ((lv_damageTakenPercent > libHDVA_gv_dVASelfDestructHealthpercentageneededtogenerate1charge)) {
        PlayerAddChargeUsed(lv_dVaPlayer, "Abil/DVaMechSelfDestruct", -1.0);
        lv_damageTakenPercent -= libHDVA_gv_dVASelfDestructHealthpercentageneededtogenerate1charge;
    }

mods/heromods/maiev.stormmodbase.stormdata/LibHMAI.galaxy:95

    }

    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievFanOfKnivesNaishasMemento", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievFanOfKnivesNaishasMemento", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.CountMax", c_playerAny)));

mods/heromods/maiev.stormmodbase.stormdata/LibHMAI.galaxy:96


    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievFanOfKnivesNaishasMemento", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievFanOfKnivesNaishasMemento", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievSpiritOfVengeanceShadowOrbVengeance", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievSpiritOfVengeanceShadowOrbVengeance", "Cost.Charge.CountMax", c_playerAny)));

mods/heromods/maiev.stormmodbase.stormdata/LibHMAI.galaxy:97

    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievFanOfKnivesNaishasMemento", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievFanOfKnivesNaishasMemento", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievSpiritOfVengeanceShadowOrbVengeance", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievSpiritOfVengeanceShadowOrbVengeance", "Cost.Charge.CountMax", c_playerAny)));
    return true;

mods/heromods/maiev.stormmodbase.stormdata/LibHMAI.galaxy:98

    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.CountMax", c_playerAny)));
    PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievSpiritOfVengeanceShadowOrbVengeance", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievSpiritOfVengeanceShadowOrbVengeance", "Cost.Charge.CountMax", c_playerAny)));
    return true;
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:5692

    // Implementation
    PlayerAddChargeRegenRemaining(lp_player, lp_cooldownName, lv_intendedRegenTime);
    PlayerAddChargeUsed(lp_player, lp_cooldownName, lv_intendedChargesUsed);
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:5829

        lv_oldmaxcharges = RoundI(libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "DeployPowerTowerStetmann", "InfoArray[" + IntToString(lv_oldchargelevel) + "].Charge.CountMax", lp_player));
        lv_newmaxcharges = RoundI(libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "DeployPowerTowerStetmann", "InfoArray[" + IntToString(libCOMI_gv_cM_Stetmann_StetelliteChargesLevel) + "].Charge.CountMax", lp_player));
        PlayerAddChargeUsed(lp_player, "Abil/DeployPowerTowerStetmann", (lv_newmaxcharges - lv_oldmaxcharges));
        PlayerAddChargeRegenRemaining(lp_player, "Abil/DeployPowerTowerStetmann", 0.0);
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:5944


    // Implementation
    PlayerAddChargeUsed(lp_player, "Abil/SIStukovInfestStructureUpgraded", 3.0);
    PlayerAddChargeRegenRemaining(lp_player, "Abil/SIStukovInfestStructureUpgraded", lv_initialCoolup);
    Wait(lv_initialCoolup, c_timeGame);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:5948

    Wait(lv_initialCoolup, c_timeGame);
    libNtve_gf_PlayerRemoveChargeUsed(lp_player, "Abil/SIStukovInfestStructureUpgraded");
    PlayerAddChargeUsed(lp_player, "Abil/SIStukovInfestStructureUpgraded", 2.0);
    PlayerAddChargeRegenRemaining(lp_player, "Abil/SIStukovInfestStructureUpgraded", lv_cooldown);
    return true;

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:17096

        lv_dehakaNydusDestroyerTopBarCooldown = PlayerGetChargeRegen(lv_player, "Abil/DehakaNydusDestroyerTopBar");
        lv_dehakaNydusDestroyerTopBarCharges = PlayerGetChargeUsed(lv_player, "Abil/DehakaNydusDestroyerTopBar");
        PlayerAddChargeUsed(lv_player, "Abil/DehakaNydusDestroyerTopBar", (3.0 - lv_dehakaNydusDestroyerTopBarCharges));
        PlayerAddChargeRegenRemaining(lv_player, "Abil/DehakaNydusDestroyerTopBar", (libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "DehakaNydusDestroyerTopBar", "InfoArray[" + IntToString(0) + "].Charge.TimeStart", lv_player) - lv_dehakaNydusDestroyerTopBarCooldown));
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:20169

    libNtve_gf_PlayerRemoveChargeUsed(lv_player, "HHStarportTrainWraith");
    lv_hHStarportTrainWraithCharges = PlayerGetChargeUsed(lv_player, "HHStarportTrainWraith");
    PlayerAddChargeUsed(lv_player, "HHStarportTrainWraith", (5.0 - lv_hHStarportTrainWraithCharges));
    lv_hHStarportTrainWraithCooldown = PlayerGetChargeRegen(lv_player, "HHStarportTrainWraith");
    PlayerAddChargeRegenRemaining(lv_player, "HHStarportTrainWraith", (libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "HHStarportTrainHorner", "InfoArray[" + IntToString(0) + "].Charge.TimeStart", lv_player) - lv_hHStarportTrainWraithCooldown));

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:20174

    libNtve_gf_PlayerRemoveChargeUsed(lv_player, "HHStarportTrainViking");
    lv_hHStarportTrainVikingCharges = PlayerGetChargeUsed(lv_player, "HHStarportTrainViking");
    PlayerAddChargeUsed(lv_player, "HHStarportTrainViking", (5.0 - lv_hHStarportTrainVikingCharges));
    lv_hHStarportTrainVikingCooldown = PlayerGetChargeRegen(lv_player, "HHStarportTrainViking");
    PlayerAddChargeRegenRemaining(lv_player, "HHStarportTrainViking", (libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "HHStarportTrainHorner", "InfoArray[" + IntToString(1) + "].Charge.TimeStart", lv_player) - lv_hHStarportTrainVikingCooldown));

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:20179

    libNtve_gf_PlayerRemoveChargeUsed(lv_player, "HHStarportTrainBattlecruiser");
    lv_hHStarportTrainBattlecruiserCharges = PlayerGetChargeUsed(lv_player, "HHStarportTrainBattlecruiser");
    PlayerAddChargeUsed(lv_player, "HHStarportTrainBattlecruiser", (5.0 - lv_hHStarportTrainBattlecruiserCharges));
    lv_hHStarportTrainBattlecruiserCooldown = PlayerGetChargeRegen(lv_player, "HHStarportTrainBattlecruiser");
    PlayerAddChargeRegenRemaining(lv_player, "HHStarportTrainBattlecruiser", (libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "HHStarportTrainHorner", "InfoArray[" + IntToString(2) + "].Charge.TimeStart", lv_player) - lv_hHStarportTrainBattlecruiserCooldown));

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:20184

    libNtve_gf_PlayerRemoveChargeUsed(lv_player, "HHStarportTrainRaven");
    lv_hHStarportTrainRavenCharges = PlayerGetChargeUsed(lv_player, "HHStarportTrainRaven");
    PlayerAddChargeUsed(lv_player, "HHStarportTrainRaven", (5.0 - lv_hHStarportTrainRavenCharges));
    lv_hHStarportTrainRavenCooldown = PlayerGetChargeRegen(lv_player, "HHStarportTrainRaven");
    PlayerAddChargeRegenRemaining(lv_player, "HHStarportTrainRaven", (libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "HHStarportTrainHorner", "InfoArray[" + IntToString(3) + "].Charge.TimeStart", lv_player) - lv_hHStarportTrainRavenCooldown));

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:20394

    Wait(0.01, c_timeGame);
    libCOMI_gf_CM_Horner_BomberStatusCheck(UnitGetOwner(EventPlayerEffectUsedUnit(c_effectUnitCaster)));
    PlayerAddChargeUsed(UnitGetOwner(EventPlayerEffectUsedUnit(c_effectUnitCaster)), "Abil/HHBomberPlatformAreaBombTopBarOrder", -1.0);
    return true;
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOUI.galaxy:5348

    libNtve_gf_SetDialogItemCurrentValue(libCOUI_gv_cU_TychusSquadAvailabilityProgressBars[lp_squadIndex], lp_duration, PlayerGroupAll());
    DialogControlSetAnimationState(libCOUI_gv_cU_TychusSquadUnitFrames[lp_squadIndex], PlayerGroupAll(), "AvailabilityState", "Available");
    PlayerAddChargeUsed(lp_tychusPlayer, "Abil/TychusTrain", -1.0);
    TriggerSendEvent("TychusHeroAvailable");
}