# Charge Count
Grammar — Charge remainingMax count of item inItem
Flags —Native
|Function
Returns the current/max charges for the item.
# Arguments
unit
— Itembool
<preset::ChargeRemaingMaxOption> — Remaining/Max
Returns — fixed
native fixed ItemGetChargeCount(
unit inItem,
bool remainingMax,
);
# Related
Category: Item / Basic
- Set Charge Remaining —
void
— ItemSetChargeCount - Charge Count —
fixed
— ItemGetChargeCount
# Examples
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:469
if (lv_item == null) { break; }
lv_slot = UnitInventorySlot(lv_item);
lv_itItemStack = ItemGetChargeCount(lv_item, false);
lv_container = UnitInventoryContainer(lv_item);
UnitInventoryCreate(lv_target, UnitGetType(lv_item));
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:1404
if (lv_itItem == null) { break; }
if ((UnitGetType(lv_itItem) == lv_itemType)) {
ItemSetChargeCount(lv_itItem, (ItemGetChargeCount(lv_itItem, false)-1));
if ((ItemGetChargeCount(lv_itItem, false) <= 0.0)) {
UnitInventoryRemove(lv_itItem);
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:1405
if ((UnitGetType(lv_itItem) == lv_itemType)) {
ItemSetChargeCount(lv_itItem, (ItemGetChargeCount(lv_itItem, false)-1));
if ((ItemGetChargeCount(lv_itItem, false) <= 0.0)) {
UnitInventoryRemove(lv_itItem);
}