1631 {
1632 EntityAI entity = player.GetInventory().CreateInInventory(
"Splint");
1633 if (!entity)
1634 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1635
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
1646 {
1647
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 {
1658 break;
1659
1662 break;
1663
1666 break;
1667
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.
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