DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ TanPelts()

void Barrel_ColorBase::TanPelts ( ItemBase lime,
PlayerBase player )
inlineprotected

См. определение в файле Barrel_ColorBase.c строка 264

265 {
266 EntityAI item;
267 int item_count = GetInventory().GetCargo().GetItemCount();
268 int pelt_count = 0;
269 int lime_amount = Math.Floor(lime.GetQuantity()/GameConstants.BAREL_LIME_PER_PELT);
270
271
272 for (int i = 0; i < item_count; i++)
273 {
274 item = GetInventory().GetCargo().GetItem(i);
275 if ( item.IsPeltBase() )
276 {
277 pelt_count = g_Game.ConfigGetInt("cfgVehicles " + item.GetType() + " peltGain");
278 if ( pelt_count <= lime_amount )
279 {
280 TanLeatherLambda lambda = new TanLeatherLambda(item, "TannedLeather", player, pelt_count);
281 lambda.SetTransferParams(true, true, true);
282 player.ServerReplaceItemWithNew(lambda);
283
284 lime_amount -= pelt_count;
285 if ( lime_amount <= 0 )
286 {
287 lime.Delete();
288 break;
289 }
290 }
291 }
292 }
293 if ( lime )
294 {
295 lime.SetQuantity(lime_amount*GameConstants.BAREL_LIME_PER_PELT);
296 }
297 if ( pelt_count > 0 )
298 {
299 Lock(30);
300 }
301 }
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:3868
void Lock(float actiontime)
Определения Barrel_ColorBase.c:165
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfWoodenPlanks.c:88

Перекрестные ссылки GameConstants::BAREL_LIME_PER_PELT, Math::Floor(), g_Game, Lock() и ItemBase::SetQuantity().

Используется в DetermineAction().