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

◆ RemoveSplint()

static void RemoveSplint ( PlayerBase player)
staticprotected

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

1637 {
1638 EntityAI entity = player.GetInventory().CreateInInventory("Splint");
1639 if (!entity)
1640 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1641
1642 EntityAI attachment;
1643 ItemBase new_item = ItemBase.Cast(entity);
1644 Class.CastTo(attachment, player.GetItemOnSlot("Splint_Right"));
1645 if ( attachment && attachment.GetType() == "Splint_Applied" )
1646 {
1647 if (new_item)
1648 {
1649 MiscGameplayFunctions.TransferItemProperties(attachment,new_item);
1650
1651 if (g_Game.IsServer())
1652 {
1653 //Lower health level of splint after use
1654 if (new_item.GetHealthLevel() < 4)
1655 {
1656 int newDmgLevel = new_item.GetHealthLevel() + 1;
1657
1658 float max = new_item.GetMaxHealth("","");
1659
1660 switch ( newDmgLevel )
1661 {
1663 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_BADLY_DAMAGED_VALUE );
1664 break;
1665
1667 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_DAMAGED_VALUE );
1668 break;
1669
1671 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_WORN_VALUE );
1672 break;
1673
1675 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_RUINED_VALUE );
1676 break;
1677
1678 default:
1679 break;
1680 }
1681 }
1682 }
1683 }
1684
1685 attachment.Delete();
1686 }
1687 }
DayZGame g_Game
Определения DayZGame.c:3942
Super root of all classes in Enforce script.
Определения EnScript.c:11
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/DayZ/constants.c:866
const float DAMAGE_RUINED_VALUE
Определения 3_Game/DayZ/constants.c:867
const float DAMAGE_DAMAGED_VALUE
Определения 3_Game/DayZ/constants.c:865
const float DAMAGE_WORN_VALUE
Определения 3_Game/DayZ/constants.c:864
const int STATE_RUINED
Определения 3_Game/DayZ/constants.c:851
const int STATE_WORN
Определения 3_Game/DayZ/constants.c:854
const int STATE_DAMAGED
Определения 3_Game/DayZ/constants.c:853
const int STATE_BADLY_DAMAGED
Определения 3_Game/DayZ/constants.c:852

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