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

◆ RemoveSplint()

static void RemoveSplint ( PlayerBase player)
staticprotected

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

1770 {
1771 EntityAI entity = player.GetInventory().CreateInInventory("Splint");
1772 if (!entity)
1773 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1774
1775 EntityAI attachment;
1776 ItemBase new_item = ItemBase.Cast(entity);
1777 Class.CastTo(attachment, player.GetItemOnSlot("Splint_Right"));
1778 if ( attachment && attachment.GetType() == "Splint_Applied" )
1779 {
1780 if (new_item)
1781 {
1782 MiscGameplayFunctions.TransferItemProperties(attachment,new_item);
1783
1784 if (g_Game.IsServer())
1785 {
1786 //Lower health level of splint after use
1787 if (new_item.GetHealthLevel() < 4)
1788 {
1789 int newDmgLevel = new_item.GetHealthLevel() + 1;
1790
1791 float max = new_item.GetMaxHealth("","");
1792
1793 switch ( newDmgLevel )
1794 {
1796 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_BADLY_DAMAGED_VALUE );
1797 break;
1798
1800 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_DAMAGED_VALUE );
1801 break;
1802
1804 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_WORN_VALUE );
1805 break;
1806
1808 new_item.SetHealth( "", "", max * GameConstants.DAMAGE_RUINED_VALUE );
1809 break;
1810
1811 default:
1812 break;
1813 }
1814 }
1815 }
1816 }
1817
1818 attachment.Delete();
1819 }
1820 }
DayZGame g_Game
Определения DayZGame.c:4074
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:924
const float DAMAGE_RUINED_VALUE
Определения 3_Game/DayZ/constants.c:925
const float DAMAGE_DAMAGED_VALUE
Определения 3_Game/DayZ/constants.c:923
const float DAMAGE_WORN_VALUE
Определения 3_Game/DayZ/constants.c:922
const int STATE_RUINED
Определения 3_Game/DayZ/constants.c:909
const int STATE_WORN
Определения 3_Game/DayZ/constants.c:912
const int STATE_DAMAGED
Определения 3_Game/DayZ/constants.c:911
const int STATE_BADLY_DAMAGED
Определения 3_Game/DayZ/constants.c:910

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