427 {
429 float r = 0;
430 float g = 0;
431 float b = 0;
432 float a = 1;
433 int item_count = GetInventory().GetCargo().GetItemCount();
434 bool was_colored = false;
435 if ( rci )
436 {
437 r = rci.GetQuantity()/10;
438 r = Math.Clamp(r, 0, 0.78);
439 }
440 if ( gci )
441 {
442 g = gci.GetQuantity()/10;
443 g = Math.Clamp(g, 0, 0.78);
444 }
445 if ( bci )
446 {
447 b = bci.GetQuantity()/10;
448 b = Math.Clamp(b, 0, 0.78);
449 }
450 for (int i = 0; i < item_count; i++)
451 {
452 item = GetInventory().GetCargo().GetItem(i);
453 if ( item.IsClothing() )
454 {
455 if (
GetGame().ObjectIsKindOf (item,
"TShirt_White") ||
GetGame().ObjectIsKindOf (item,
"Armband_White") )
456 {
458 int index = itemIB.GetType().IndexOf("_");
459 string itemtype = itemIB.GetType().Substring( 0, index + 1 );
460
461 ColourClothesLambda clambda = new ColourClothesLambda(itemIB, itemtype + "Dyed", player, r, g, b, a);
462 clambda.SetTransferParams(true, true, true);
463 MiscGameplayFunctions.TurnItemIntoItemEx(player, clambda);
464 was_colored = true;
465 }
466 }
467 }
468
469 if ( was_colored )
470 {
471 if ( rci )
472 {
473
474 rci.Delete();
475 }
476 if ( gci )
477 {
478
479 gci.Delete();
480 }
481 if ( bci )
482 {
483
484 bci.Delete();
485 }
487 }
488 }
class GP5GasMask extends MaskBase ItemBase
void Lock(float actiontime)
proto native CGame GetGame()