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

◆ TryTransformIntoStick()

void FlammableBase::TryTransformIntoStick ( )
inlineprotected

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

480 {
481 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
482 if ( m_IsBeingDestructed || (player && player.IsPlayerDisconnected()) )
483 return;
484
485 if ( CanTransformIntoStick() )
486 {
487 m_IsBeingDestructed = true;
488 if (player)
489 {
490 // Transform object into wooden stick
492
493 TorchLambda lambda = new TorchLambda(this, m_DecraftResult);
494 player.ServerReplaceItemInHandsWithNew(lambda);
495 }
496 else
497 {
498 // Create wooden stick and delete Torch
499 vector pos = GetPosition();
500 vector ori = GetOrientation();
501
502 if ( GetType() == "WoodenStick" )
503 ori = ori + Vector(0,90,0);
504
505 ItemBase stick = ItemBase.Cast( g_Game.CreateObjectEx(m_DecraftResult, pos, ECE_PLACE_ON_SURFACE) );
507 stick.SetPosition(pos);
508 stick.PlaceOnSurface();
509
510 if ( stick.GetType() == "LongWoodenStick" )
511 {
512 pos = stick.GetPosition() + Vector(0,-0.3,0);
513 stick.SetPosition(pos);
514 }
515
516 stick.SetOrientation(ori);
517 g_Game.ObjectDelete(this);
518 }
519 }
520 }
eBleedingSourceType GetType()
vector GetOrientation()
Определения AreaDamageManager.c:306
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
DayZGame g_Game
Определения DayZGame.c:3942
class GP5GasMask extends MaskBase ItemBase
void ApplyResultModifications(ItemBase result)
Определения Torch.c:859
bool CanTransformIntoStick()
Определения Torch.c:471
bool m_IsBeingDestructed
Определения Torch.c:17
void StopAllParticles()
Определения Torch.c:530
string m_DecraftResult
Определения Torch.c:31
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

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

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