# Player Charge Used
Grammar — Charges used of charge inCharge for player inPlayer
Flags —Native
|Function
Returns the number of charges used for the specified player charge link.
# Arguments
int
— Playerstring
— Charge
Returns — fixed
native fixed PlayerGetChargeUsed(
int inPlayer,
string inCharge,
);
# Related
Category: Player / Charges And Cooldowns
- Add Charge Remaining Regen Time For Player —
void
— PlayerAddChargeRegenRemaining - Add Charge Full Regen Time For Player —
void
— PlayerAddChargeRegenFull - Add Charge Used For Player —
void
— PlayerAddChargeUsed - Remove Charge Used For Player —
void
— libNtve_gf_PlayerRemoveChargeUsed - Charge Regen Remaining For Player —
fixed
— PlayerGetChargeRegen - Charge Regen Full For Player —
fixed
— PlayerGetChargeRegenFull - Player Charge Used —
fixed
— PlayerGetChargeUsed - Pause/Unpause All Charges For Player —
void
— PlayerPauseAllCharges - Add Cooldown For Player —
void
— PlayerAddCooldown - Remove Cooldown For Player —
void
— libNtve_gf_PlayerRemoveCooldown - Player Cooldown —
fixed
— PlayerGetCooldown - Pause/Unpause All Cooldowns For Player —
void
— PlayerPauseAllCooldowns
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/NativeLib.galaxy:3859
// Automatic Variable Declarations
// Implementation
PlayerAddChargeUsed(lp_inPlayer, lp_inCharge, (-1.0 * PlayerGetChargeUsed(lp_inPlayer, lp_inCharge)));
}
mods/core.stormmod — base.stormdata/TriggerLibs/NativeLib.galaxy:3213
// Automatic Variable Declarations
// Implementation
PlayerAddChargeUsed(lp_inPlayer, lp_inCharge, (-1.0 * PlayerGetChargeUsed(lp_inPlayer, lp_inCharge)));
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/UILib.galaxy:6867
if ((lv_chargesMax > 0)) {
lv_chargeLink = CatalogFieldValueGet(c_gameCatalogAbil, lp_ability, "Cost.Charge.Link", lp_player);
lv_chargesUsed = PlayerGetChargeUsed(lp_player, lv_chargeLink);
if ((lv_chargesUsed >= IntToFixed(lv_chargesMax))) {
lv_cooldownTime = PlayerGetChargeRegen(lp_player, lv_chargeLink);
mods/heromods/dva.stormmod — base.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.stormmod — base.stormdata/LibHDVA.galaxy:339
libGame_gf_CameraUpdateCameraForPlayer(lp_player);
UnitSetPropertyFixed(lv_dVaMechUnit, c_unitPropLifePercent, lp_respawnedMechHealthPercentage);
UnitSetPropertyFixed(lv_dVaMechUnit, c_unitPropEnergy, (UnitGetPropertyFixed(lv_dVaMechUnit, c_unitPropEnergyMax, c_unitPropCurrent) - PlayerGetChargeUsed(lp_player, "Abil/DVaMechSelfDestruct")));
libUIUI_gf_UIHeroConsoleShowHideUnitStatusFrameForPlayer(true, lp_player);
libNtve_gf_MakeUnitUncommandable(lv_dVaMechUnit, false);
mods/heromods/dva.stormmod — base.stormdata/LibHDVA.galaxy:747
}
PlayerAddChargeUsed(lv_abathurPlayer, "Abil/DVaMechSelfDestruct", (lv_selfDestructChargeMax - PlayerGetChargeUsed(lv_abathurPlayer, "Abil/DVaMechSelfDestruct")));
return true;
}
mods/heromods/dva.stormmod — base.stormdata/LibHDVA.galaxy:1018
}
if (!((PlayerGetChargeUsed(lv_dVaPlayer, "Abil/DVaMechSelfDestruct") > 0.0))) {
return false;
}
mods/heromods/dva.stormmod — base.stormdata/LibHDVA.galaxy:1051
lv_damageTakenPercent -= libHDVA_gv_dVASelfDestructHealthpercentageneededtogenerate1charge;
}
UnitSetPropertyFixed(lv_dVaMechUnit, c_unitPropEnergy, (UnitGetPropertyFixed(lv_dVaMechUnit, c_unitPropEnergyMax, c_unitPropCurrent) - PlayerGetChargeUsed(lv_dVaPlayer, "Abil/DVaMechSelfDestruct")));
libHDVA_gv_dVaDefensiveChargeRemainder[lv_dVaPlayer] = lv_damageTakenPercent;
return true;
mods/heromods/dva.stormmod — base.stormdata/LibHDVA.galaxy:1095
UnitBehaviorRemove(lv_dVaPilotUnit, "Mounted", 1);
libNtve_gf_MakeUnitUncommandable(libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], true);
UnitSetPropertyFixed(libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], c_unitPropEnergy, (UnitGetPropertyFixed(libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], c_unitPropEnergyMax, c_unitPropCurrent) - PlayerGetChargeUsed(lv_dVaPlayer, "Abil/DVaMechSelfDestruct")));
UnitCreateEffectUnit(lv_dVaPilotUnit, "DVaMechCallMechApplyStun", libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer]);
UnitBehaviorAdd(libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], "CapturePointAllowed", libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], 1);
mods/heromods/dva.stormmod — base.stormdata/LibHDVA.galaxy:1143
UnitGroupAdd(libGame_gv_players[lv_dVaPlayer].lv_heroUnitGroup, lv_dVaPilotUnit);
UnitBehaviorRemove(lv_dVaPilotUnit, "Mounted", 1);
UnitSetPropertyFixed(libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], c_unitPropEnergy, (UnitGetPropertyFixed(lv_dVaMechUnit, c_unitPropEnergyMax, c_unitPropCurrent) - PlayerGetChargeUsed(lv_dVaPlayer, "Abil/DVaMechSelfDestruct")));
return true;
}
mods/heromods/dva.stormmod — base.stormdata/LibHDVA.galaxy:1217
libUIUI_gf_UIHeroConsoleSetUpForPlayer(libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], lv_dVaPlayer);
libUIUI_gf_HeroConsoleUnitStatusBarsSetUnitForBars(libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], lv_dVaPlayer);
UnitSetPropertyFixed(lv_dVaMechUnit, c_unitPropEnergy, (UnitGetPropertyFixed(libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], c_unitPropEnergyMax, c_unitPropCurrent) - PlayerGetChargeUsed(lv_dVaPlayer, "Abil/DVaMechSelfDestruct")));
libGame_gf_SendEventHeroUnitSwappedForPlayer(lv_dVaPilotUnit, libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], lv_dVaPlayer);
libGame_gf_SendEventCheckUnitForAbilityRedirect(lv_dVaPilotUnit, libHDVA_gv_dVaCallMechMechBeingSummoned[lv_dVaPlayer], false, UnitGetPosition(lv_dVaPilotUnit));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:5686
// Variable Initialization
lv_currentRegenTime = PlayerGetChargeRegen(lp_player, lp_cooldownName);
lv_currentChargesUsed = PlayerGetChargeUsed(lp_player, lp_cooldownName);
lv_intendedChargesUsed = (lp_maxChargeCount - lv_currentChargesUsed - 1.0);
lv_intendedRegenTime = (lp_maxRegenTime - lv_currentRegenTime);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:10296
// Implementation
while (true) {
while (!((PlayerGetChargeUsed(lp_stetmannPlayer, lv_abilchargename) == 0.0) && (TimerGetRemaining(lv_remindercooldowntimer) <= 0.0))) {
Wait(lv_pollinginterval, c_timeGame);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:10300
}
Wait(lv_reminderdelay, c_timeReal);
if ((PlayerGetChargeUsed(lp_stetmannPlayer, lv_abilchargename) == 0.0)) {
if ((libCOMI_gv_cM_AbilityTransmission_StetelliteReminder_First == true)) {
DialogControlSetAnimationState(libCOUI_gv_cU_GPPanel[lp_stetmannPlayer], PlayerGroupSingle(lp_stetmannPlayer), "ReminderStetellites", "FirstReminder");
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:10310
libCOMI_gf_CM_CommanderVOSend(lp_stetmannPlayer, SoundLink("StetmannCommander_PowerTowerReminder", -1), PlayerGroupSingle(lp_stetmannPlayer));
TimerStart(lv_remindercooldowntimer, lv_remindercooldown, false, c_timeReal);
while (!((PlayerGetChargeUsed(lp_stetmannPlayer, lv_abilchargename) > 0.0))) {
Wait(lv_pollinginterval, c_timeGame);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17095
PlayerAddCooldown(lv_player, "Abil/DehakaGlevigTopBar", 120.0);
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.sc2mod — base.sc2data/LibCOMI.galaxy:20168
UnitBehaviorAddPlayer(lv_starport, "PermanentlyInvulnerable", lv_player, 1);
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");
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:20173
PlayerAddChargeRegenRemaining(lv_player, "HHStarportTrainWraith", (libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "HHStarportTrainHorner", "InfoArray[" + IntToString(0) + "].Charge.TimeStart", lv_player) - lv_hHStarportTrainWraithCooldown));
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");
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:20178
PlayerAddChargeRegenRemaining(lv_player, "HHStarportTrainViking", (libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "HHStarportTrainHorner", "InfoArray[" + IntToString(1) + "].Charge.TimeStart", lv_player) - lv_hHStarportTrainVikingCooldown));
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");
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:20183
PlayerAddChargeRegenRemaining(lv_player, "HHStarportTrainBattlecruiser", (libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, "HHStarportTrainHorner", "InfoArray[" + IntToString(2) + "].Charge.TimeStart", lv_player) - lv_hHStarportTrainBattlecruiserCooldown));
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");
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:23915
lv_oldmaxcharges = CatalogFieldValueGetAsInt(c_gameCatalogAbil, lv_abillink, "InfoArray[" + IntToString(0) + "].Charge.CountMax", libCOMI_gf_EventStetmannPowerTowerPlayer());
lv_oldrechargetime = libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogAbil, lv_abillink, "InfoArray[" + IntToString(0) + "].Charge.TimeUse", libCOMI_gf_EventStetmannPowerTowerPlayer());
lv_oldchargesused = RoundI(PlayerGetChargeUsed(libCOMI_gf_EventStetmannPowerTowerPlayer(), lv_powertowerabilstring));
libNtve_gf_SetUpgradeLevelForPlayer(libCOMI_gf_EventStetmannPowerTowerPlayer(), "DeployPowerTowerTechLevel", libCOMI_gf_EventStetmannPowerTowerTechLevel("StetmannPowerTowerTechLevelNew"));
lv_newmaxcharges = CatalogFieldValueGetAsInt(c_gameCatalogAbil, lv_abillink, "InfoArray[" + IntToString(0) + "].Charge.CountMax", libCOMI_gf_EventStetmannPowerTowerPlayer());
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:4566
DialogControlSetAnimationState(libCOUI_gv_cU_GPPanel[lp_player], PlayerGroupSingle(lp_player), "ActiveZone", "Speed");
libCOUI_gf_CU_SetStetelliteChargeMax(lp_player);
libCOUI_gf_CU_DrawStetelliteChargePips(lp_player, (libCOUI_gv_cU_StetmannMaxStetelliteCharges - RoundI(PlayerGetChargeUsed(lp_player, "Abil/DeployPowerTowerStetmann"))), libCOUI_gv_cU_StetmannMaxStetelliteCharges);
TriggerEnable(libCOUI_gt_CU_StetelliteChargesChanged, true);
TriggerEnable(libCOUI_gt_CU_StetelliteMaxChargesChanged, true);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:9521
libCOUI_gf_CU_SetStetelliteChargeMax(lv_stetmann);
libCOUI_gf_CU_DrawStetelliteChargePips(lv_stetmann, (libCOUI_gv_cU_StetmannMaxStetelliteCharges - RoundI(PlayerGetChargeUsed(lv_stetmann, "Abil/DeployPowerTowerStetmann"))), libCOUI_gv_cU_StetmannMaxStetelliteCharges);
return true;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:9559
}
libCOUI_gf_CU_DrawStetelliteChargePips(lv_stetmann, (libCOUI_gv_cU_StetmannMaxStetelliteCharges - RoundI(PlayerGetChargeUsed(lv_stetmann, "Abil/DeployPowerTowerStetmann"))), libCOUI_gv_cU_StetmannMaxStetelliteCharges);
return true;
}