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

◆ BleachClothes()

void Barrel_ColorBase::BleachClothes ( ItemBase bleach,
PlayerBase player )
inlineprotected

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

355 {
356 EntityAI item;
357 int bleach_amount = bleach.GetQuantity();
358 int item_count = GetInventory().GetCargo().GetItemCount();
359 string item_name = "";
360
361 for (int i = 0; i < item_count; i++)
362 {
363 item = GetInventory().GetCargo().GetItem(i);
364 if ( item.IsClothing() )
365 {
366 if ( bleach_amount >= GameConstants.BAREL_BLEACH_PER_CLOTH )
367 {
368 if ( ( GetGame().ObjectIsKindOf (item, "TShirt_ColorBase") && !GetGame().ObjectIsKindOf (item, "TShirt_White") ) || ( GetGame().ObjectIsKindOf (item, "Armband_ColorBase") && !GetGame().ObjectIsKindOf (item, "Armband_White") ) ) //cannot bleach white items...?
369 {
370 int index = item.GetType().IndexOf("_");
371 string itemtype = item.GetType().Substring( 0, index + 1 );
372 ItemBase itemIB = ItemBase.Cast(item);
373 MiscGameplayFunctions.TurnItemIntoItem(itemIB,itemtype+"White",player);
374
375 bleach_amount -= GameConstants.BAREL_BLEACH_PER_CLOTH;
376 }
377 if ( GetGame().IsKindOf (item.GetDisplayName(), "LeatherSack_ColorBase") )
378 {
379 item_name = "LeatherSack_Natural";
380 }
381 else if ( GetGame().IsKindOf (item.GetDisplayName(), "LeatherStorageVest_ColorBase") )
382 {
383 item_name = "LeatherStorageVest_Natural";
384 }
385 else if ( GetGame().IsKindOf (item.GetDisplayName(), "LeatherJacket_ColorBase") )
386 {
387 item_name = "LeatherJacket_Natural";
388 }
389 else if ( GetGame().IsKindOf (item.GetDisplayName(), "LeatherPants_ColorBase") )
390 {
391 item_name = "LeatherPants_Natural";
392 }
393 else if ( GetGame().IsKindOf (item.GetDisplayName(), "LeatherMoccasinsShoes_ColorBase") )
394 {
395 item_name = "LeatherMoccasinsShoes_Natural";
396 }
397 else if ( GetGame().IsKindOf (item.GetDisplayName(), "LeatherHat_ColorBase") )
398 {
399 item_name = "LeatherHat_Natural";
400 }
401 if ( item_name != "" )
402 {
403 TurnItemIntoItemLambda lambda = new TurnItemIntoItemLambda(item, item_name, player);
404 lambda.SetTransferParams(true, true, true);
405 player.ServerReplaceItemWithNew(lambda);
406 bleach_amount -= GameConstants.BAREL_BLEACH_PER_CLOTH;
407 }
408 }
409 else
410 {
411 bleach.Delete();
412 break;
413 }
414 }
415 }
416 if ( bleach )
417 {
418 bleach.SetQuantity(bleach_amount);
419 }
420 if ( item_name != "" )
421 {
422 Lock(10);
423 }
424 }
class LogManager EntityAI
class GP5GasMask extends MaskBase ItemBase
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
proto native CGame GetGame()

Перекрестные ссылки GameConstants::BAREL_BLEACH_PER_CLOTH, GetGame(), Lock() и ItemBase::SetQuantity().

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