1770 {
1771 EntityAI entity = player.GetInventory().CreateInInventory(
"Splint");
1772 if (!entity)
1773 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1774
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
1785 {
1786
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 {
1797 break;
1798
1801 break;
1802
1805 break;
1806
1809 break;
1810
1811 default:
1812 break;
1813 }
1814 }
1815 }
1816 }
1817
1818 attachment.Delete();
1819 }
1820 }
Super root of all classes in Enforce script.
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
const float DAMAGE_RUINED_VALUE
const float DAMAGE_DAMAGED_VALUE
const float DAMAGE_WORN_VALUE
const int STATE_BADLY_DAMAGED