1624 {
1625 EntityAI entity = player.GetInventory().CreateInInventory(
"Splint");
1626 if (!entity)
1627 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1628
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
1639 {
1640
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 {
1651 break;
1652
1655 break;
1656
1659 break;
1660
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.
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
const float DAMAGE_RUINED_VALUE
const float DAMAGE_DAMAGED_VALUE
const float DAMAGE_WORN_VALUE
const int STATE_BADLY_DAMAGED