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

◆ RemoveSplint()

static void RemoveSplint ( PlayerBase player)
staticprotected

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

1624 {
1625 EntityAI entity = player.GetInventory().CreateInInventory("Splint");
1626 if (!entity)
1627 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1628
1629 EntityAI attachment;
1630 ItemBase new_item = ItemBase.Cast(entity);
1631 Class.CastTo(attachment, player.GetItemOnSlot("Splint_Right"));
1632 if ( attachment && attachment.GetType() == "Splint_Applied" )
1633 {
1634 if (new_item)
1635 {
1636 MiscGameplayFunctions.TransferItemProperties(attachment,new_item);
1637
1638 if (GetGame().IsServer())
1639 {
1640 //Lower health level of splint after use
1641 if (new_item.GetHealthLevel() < 4)
1642 {
1643 int newDmgLevel = new_item.GetHealthLevel() + 1;
1644
1645 float max = new_item.GetMaxHealth("","");
1646
1647 switch ( newDmgLevel )
1648 {
1650 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_BADLY_DAMAGED_VALUE );
1651 break;
1652
1654 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_DAMAGED_VALUE );
1655 break;
1656
1658 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_WORN_VALUE );
1659 break;
1660
1662 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_RUINED_VALUE );
1663 break;
1664
1665 default:
1666 break;
1667 }
1668 }
1669 }
1670 }
1671
1672 attachment.Delete();
1673 }
1674 }
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения Building.c:6
Определения constants.c:659
Определения InventoryItem.c:731
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const float DAMAGE_BADLY_DAMAGED_VALUE
Определения constants.c:861
const float DAMAGE_RUINED_VALUE
Определения constants.c:862
const float DAMAGE_DAMAGED_VALUE
Определения constants.c:860
const float DAMAGE_WORN_VALUE
Определения constants.c:859
const int STATE_RUINED
Определения constants.c:846
const int STATE_WORN
Определения constants.c:849
const int STATE_DAMAGED
Определения constants.c:848
const int STATE_BADLY_DAMAGED
Определения constants.c:847

Перекрестные ссылки Class::CastTo(), GameConstants::DAMAGE_BADLY_DAMAGED_VALUE, GameConstants::DAMAGE_DAMAGED_VALUE, GameConstants::DAMAGE_RUINED_VALUE, GameConstants::DAMAGE_WORN_VALUE, GetGame(), GameConstants::STATE_BADLY_DAMAGED, GameConstants::STATE_DAMAGED, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.