1637 {
1638 EntityAI entity = player.GetInventory().CreateInInventory(
"Splint");
1639 if (!entity)
1640 entity = player.SpawnEntityOnGroundOnCursorDir("Splint", 0.5);
1641
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
1652 {
1653
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 {
1664 break;
1665
1668 break;
1669
1672 break;
1673
1676 break;
1677
1678 default:
1679 break;
1680 }
1681 }
1682 }
1683 }
1684
1685 attachment.Delete();
1686 }
1687 }
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