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

◆ GetLocalProperties()

void GetLocalProperties ( EntityAI entity,
array< ref Param > properties,
bool client = false )

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

513 {
514 if(!entity)
515 return;
516 ItemBase item = ItemBase.Cast(entity);
517
518 if(!client)
519 {
520 // -------- DEBUG OUTPUT ------
521 Param1<string> debug_output = new Param1<string>(entity.GetDebugText());
522 properties.Insert(debug_output);
523 if(!item)
524 return;
525 // -------- AGENTS ------------
526 int num_of_agents = FillWithAgents(item, properties);
527 Param1<int> agents_count = new Param1<int>(num_of_agents);
528 properties.InsertAt(agents_count,1);// hard coded index 1 !!
529 }
530 if(!item)
531 return;
532 // ------ INDIVIDUAL VARS------
533 int number_of_items = 0;
534 Param2<string, float> quantity = new Param2<string, float>("quantity", item.GetQuantity() );
535 properties.Insert(quantity);
536 number_of_items++;
537 //-----------------------------
538 Param2<string, float> liquid_type = new Param2<string, float>("liquid_type", item.GetLiquidType() );
539 properties.Insert(liquid_type);
540 number_of_items++;
541 //-----------------------------
542 Param2<string, float> wetness = new Param2<string, float>("wetness", item.GetWet() );
543 properties.Insert(wetness);
544 number_of_items++;
545 //-----------------------------
546 Param2<string, float> temperature = new Param2<string, float>("temperature", item.GetTemperature() );
547 properties.Insert(temperature);
548 number_of_items++;
549 //-----------------------------
550 Param2<string, float> frozen = new Param2<string, float>("frozen", item.GetIsFrozen() );
551 properties.Insert(frozen);
552 number_of_items++;
553 //-----------------------------
554 Param2<string, float> FTProgress = new Param2<string, float>("F/T pgs", item.GetFreezeThawProgress() );
555 properties.Insert(FTProgress);
556 number_of_items++;
557 //-----------------------------
558 #ifdef DEVELOPER
559 Param2<string, float> FTChangeTime = new Param2<string, float>("LastChangeTime", item.m_LastFTChangeTime );
560 properties.Insert(FTChangeTime);
561 number_of_items++;
562 //-----------------------------
563 Param2<string, float> FTRemainingTime = new Param2<string, float>("FTTimeRemaining", item.m_PresumedTimeRemaining );
564 properties.Insert(FTRemainingTime);
565 number_of_items++;
566 #endif
567 //-----------------------------
568 Param2<string, float> OverheatPgs = new Param2<string, float>("Overheat pgs", item.GetItemOverheatProgress() );
569 properties.Insert(OverheatPgs);
570 number_of_items++;
571 //-----------------------------
572 Edible_Base food;
573 if (Class.CastTo(food,item) && food.GetFoodStage() != null)
574 {
575 Param2<string, float> CookingTime = new Param2<string, float>("CookingTime", food.GetCookingTime() );
576 properties.Insert(CookingTime);
577 number_of_items++;
578 //-----------------------------
579 Param2<string, float> DecayTime = new Param2<string, float>("DecayTime (remaining)", food.GetDecayTimer() );
580 properties.Insert(DecayTime);
581 number_of_items++;
582 //-----------------------------
583 Param2<string, float> DecayDelta = new Param2<string, float>("DecayDelta (last)", food.GetDecayDelta() );
584 properties.Insert(DecayDelta);
585 number_of_items++;
586 }
587 //-----------------------------
588 Param2<string, float> energy = new Param2<string, float>("energy", item.GetEnergy() );
589 properties.Insert(energy);
590 number_of_items++;
591 //-----------------------------
593 if(!client)
594 {
595 health = new Param2<string, float>("health", item.GetHealth("", "") );
596 }
597 else
598 {
599 health = new Param2<string, float>("NO SYNC",0 );
600 }
601 properties.Insert(health);
602 number_of_items++;
603 //-----------------------------
604 /*int r,g,b,a;
605 item.GetColor(r,g,b,a);
606 Param2<string, float> p2r = new Param2<string, float>("R",r);
607 properties.Insert(p2r);
608 number_of_items++;
609 Param2<string, float> p2g = new Param2<string, float>("G",g);
610 properties.Insert(p2g);
611 number_of_items++;
612 Param2<string, float> p2b = new Param2<string, float>("B",b);
613 properties.Insert(p2b);
614 number_of_items++;
615 Param2<string, float> p2a = new Param2<string, float>("A",a);
616 properties.Insert(p2a);
617 number_of_items++;*/
618 //-----------------------------
619 if(!client)
620 {
621 Param1<int> item_count = new Param1<int>(number_of_items);
622 properties.InsertAt(item_count,2);
623 }
624 }
int FillWithAgents(ItemBase item, array< ref Param > properties)
Определения PluginItemDiagnostic.c:626
Super root of all classes in Enforce script.
Определения EnScript.c:11
float GetDecayDelta()
Определения Edible_Base.c:1055
float GetDecayTimer()
Определения Edible_Base.c:1050
float GetCookingTime()
Определения Edible_Base.c:657
override FoodStage GetFoodStage()
Определения Edible_Base.c:361
Определения Edible_Base.c:2
Определения InventoryItem.c:731
Определения PPEConstants.c:68
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), FillWithAgents(), Edible_Base::GetCookingTime(), Edible_Base::GetDecayDelta(), Edible_Base::GetDecayTimer() и Edible_Base::GetFoodStage().

Используется в GeneratePropertiesObject() и OnRPC().