# 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.sc2mod

NativeLib.galaxy

// L3859
PlayerAddChargeUsed(lp_inPlayer, lp_inCharge, (-1.0 * PlayerGetChargeUsed(lp_inPlayer, lp_inCharge)))
// L3213
PlayerAddChargeUsed(lp_inPlayer, lp_inCharge, (-1.0 * PlayerGetChargeUsed(lp_inPlayer, lp_inCharge)))

# mods/heroesdata.stormmod

GameDataHelperLib.galaxy

// L1706
PlayerAddChargeUsed(lp_killingPlayer, "Abil/LostVikingsVikingBribery", -1.0)

# mods/heroesdata.stormmod

GameLib.galaxy

// L8115
PlayerAddChargeUsed(lp_player, lv_chargeLink, (-lv_chargeCount))

# mods/heroesdata.stormmod

SupportLib.galaxy

// L1655
PlayerAddChargeUsed(lv_ownerofUnit, lv_cooldownLink, -1.0)

# mods/heromods/dva.stormmod

LibHDVA.galaxy

// L199
PlayerAddChargeUsed(lp_player, "Abil/DVaMechSelfDestruct", (CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "DVaMechSelfDestruct", "Cost.Charge.CountMax", lp_player) - PlayerGetChargeUsed(lp_player, "Abil/DVaMechSelfDestruct")))
// L747
PlayerAddChargeUsed(lv_abathurPlayer, "Abil/DVaMechSelfDestruct", (lv_selfDestructChargeMax - PlayerGetChargeUsed(lv_abathurPlayer, "Abil/DVaMechSelfDestruct")))
// L1048
PlayerAddChargeUsed(lv_dVaPlayer, "Abil/DVaMechSelfDestruct", -1.0)

# mods/heromods/maiev.stormmod

LibHMAI.galaxy

// L95
PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievFanOfKnivesNaishasMemento", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievFanOfKnivesNaishasMemento", "Cost.Charge.CountMax", c_playerAny)))
// L96
PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbHuntress", "Cost.Charge.CountMax", c_playerAny)))
// L97
PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievShadowOrbShadowStrike", "Cost.Charge.CountMax", c_playerAny)))
// L98
PlayerAddChargeUsed(lv_respecPlayer, CatalogFieldValueGet(c_gameCatalogAbil, "MaievSpiritOfVengeanceShadowOrbVengeance", "Cost.Charge.Link", c_playerAny), (-1.0 * CatalogFieldValueGetAsFixed(c_gameCatalogAbil, "MaievSpiritOfVengeanceShadowOrbVengeance", "Cost.Charge.CountMax", c_playerAny)))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L5689
PlayerAddChargeUsed(lp_player, lp_cooldownName, lv_intendedChargesUsed)
// L5826
PlayerAddChargeUsed(lp_player, "Abil/DeployPowerTowerStetmann", (lv_newmaxcharges - lv_oldmaxcharges))
// L5941
PlayerAddChargeUsed(lp_player, "Abil/SIStukovInfestStructureUpgraded", 3.0)
// L5945
PlayerAddChargeUsed(lp_player, "Abil/SIStukovInfestStructureUpgraded", 2.0)
// L17093
PlayerAddChargeUsed(lv_player, "Abil/DehakaNydusDestroyerTopBar", (3.0 - lv_dehakaNydusDestroyerTopBarCharges))
// L20166
PlayerAddChargeUsed(lv_player, "HHStarportTrainWraith", (5.0 - lv_hHStarportTrainWraithCharges))
// L20171
PlayerAddChargeUsed(lv_player, "HHStarportTrainViking", (5.0 - lv_hHStarportTrainVikingCharges))
// L20176
PlayerAddChargeUsed(lv_player, "HHStarportTrainBattlecruiser", (5.0 - lv_hHStarportTrainBattlecruiserCharges))
// L20181
PlayerAddChargeUsed(lv_player, "HHStarportTrainRaven", (5.0 - lv_hHStarportTrainRavenCharges))
// L20391
PlayerAddChargeUsed(UnitGetOwner(EventPlayerEffectUsedUnit(c_effectUnitCaster)), "Abil/HHBomberPlatformAreaBombTopBarOrder", -1.0)

# mods/starcoop/starcoop.sc2mod

LibCOUI.galaxy

// L5348
PlayerAddChargeUsed(lp_tychusPlayer, "Abil/TychusTrain", -1.0)