| 93 | } |
| 94 | |
| 95 | void ItemDependency::consume(StateRef<Base> base) |
| 96 | { |
| 97 | for (auto &e : agentItemsConsumed) |
| 98 | { |
| 99 | int mult = e.first->type == AEquipmentType::Type::Ammo ? e.first->max_ammo : 1; |
| 100 | if (e.first->bioStorage) |
| 101 | { |
| 102 | base->inventoryBioEquipment[e.first.id] -= e.second * mult; |
| 103 | } |
| 104 | else |
| 105 | { |
| 106 | base->inventoryAgentEquipment[e.first.id] -= e.second * mult; |
| 107 | } |
| 108 | } |
| 109 | for (auto &e : vehicleItemsConsumed) |
| 110 | { |
| 111 | base->inventoryVehicleEquipment[e.first.id] -= e.second; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | void ItemDependency::produceRemains(StateRef<Base> base) |
| 116 | { |