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

◆ TryTransformIntoStick()

void FlammableBase::TryTransformIntoStick ( )
inlineprotected

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

473 {
474 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
475 if ( m_IsBeingDestructed || (player && player.IsPlayerDisconnected()) )
476 return;
477
478 if ( CanTransformIntoStick() )
479 {
480 m_IsBeingDestructed = true;
481 if (player)
482 {
483 // Transform object into wooden stick
485
486 TorchLambda lambda = new TorchLambda(this, m_DecraftResult);
487 player.ServerReplaceItemInHandsWithNew(lambda);
488 }
489 else
490 {
491 // Create wooden stick and delete Torch
492 vector pos = GetPosition();
493 vector ori = GetOrientation();
494
495 if ( GetType() == "WoodenStick" )
496 ori = ori + Vector(0,90,0);
497
498 ItemBase stick = ItemBase.Cast( GetGame().CreateObjectEx(m_DecraftResult, pos, ECE_PLACE_ON_SURFACE) );
500 stick.SetPosition(pos);
501 stick.PlaceOnSurface();
502
503 if ( stick.GetType() == "LongWoodenStick" )
504 {
505 pos = stick.GetPosition() + Vector(0,-0.3,0);
506 stick.SetPosition(pos);
507 }
508
509 stick.SetOrientation(ori);
510 GetGame().ObjectDelete(this);
511 }
512 }
513 }
eBleedingSourceType GetType()
Определения BleedingSource.c:63
vector GetOrientation()
Определения AreaDamageManager.c:306
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
class GP5GasMask extends MaskBase ItemBase
proto native void ObjectDelete(Object obj)
void ApplyResultModifications(ItemBase result)
Определения Torch.c:852
bool CanTransformIntoStick()
Определения Torch.c:464
bool m_IsBeingDestructed
Определения Torch.c:11
void StopAllParticles()
Определения Torch.c:523
string m_DecraftResult
Определения Torch.c:25
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

Перекрестные ссылки ApplyResultModifications(), CanTransformIntoStick(), ECE_PLACE_ON_SURFACE, GetGame(), GetOrientation(), GetPosition, GetType(), m_DecraftResult, m_IsBeingDestructed, CGame::ObjectDelete(), StopAllParticles() и Vector().

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