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

◆ RemoveSplint()

static void RemoveSplint ( PlayerBase player)
staticprotected

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

1631 {
1632 EntityAI entity = player.GetInventory().CreateInInventory("Splint");
1633 if (!entity)
1634 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1635
1636 EntityAI attachment;
1637 ItemBase new_item = ItemBase.Cast(entity);
1638 Class.CastTo(attachment, player.GetItemOnSlot("Splint_Right"));
1639 if ( attachment && attachment.GetType() == "Splint_Applied" )
1640 {
1641 if (new_item)
1642 {
1643 MiscGameplayFunctions.TransferItemProperties(attachment,new_item);
1644
1645 if (GetGame().IsServer())
1646 {
1647 //Lower health level of splint after use
1648 if (new_item.GetHealthLevel() < 4)
1649 {
1650 int newDmgLevel = new_item.GetHealthLevel() + 1;
1651
1652 float max = new_item.GetMaxHealth("","");
1653
1654 switch ( newDmgLevel )
1655 {
1657 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_BADLY_DAMAGED_VALUE );
1658 break;
1659
1661 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_DAMAGED_VALUE );
1662 break;
1663
1665 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_WORN_VALUE );
1666 break;
1667
1669 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_RUINED_VALUE );
1670 break;
1671
1672 default:
1673 break;
1674 }
1675 }
1676 }
1677 }
1678
1679 attachment.Delete();
1680 }
1681 }
Super root of all classes in Enforce script.
Определения EnScript.c:11
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
Определения 3_Game/constants.c:863
const float DAMAGE_RUINED_VALUE
Определения 3_Game/constants.c:864
const float DAMAGE_DAMAGED_VALUE
Определения 3_Game/constants.c:862
const float DAMAGE_WORN_VALUE
Определения 3_Game/constants.c:861
const int STATE_RUINED
Определения 3_Game/constants.c:848
const int STATE_WORN
Определения 3_Game/constants.c:851
const int STATE_DAMAGED
Определения 3_Game/constants.c:850
const int STATE_BADLY_DAMAGED
Определения 3_Game/constants.c:849

Перекрестные ссылки 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.