1638 |
1638 |
1639 |
1639 |
1640 elseif cat[cIndex] == loc("Health Modification Mode") then |
1640 elseif cat[cIndex] == loc("Health Modification Mode") then |
1641 |
1641 |
1642 sGear = GetClosestGear() |
1642 sGear = GetClosestGear() |
1643 if (sGear ~= nil) and (GetGearType(sGear) == gtHedgehog) then |
1643 local gt = GetGearType(sGear) |
|
1644 if gt == gtHedgehog or gt == gtExplosives or (gt == gtCase and GetGearPos(sGear) == 0x2) then |
1644 if pMode[pIndex][2] == "set" then |
1645 if pMode[pIndex][2] == "set" then |
1645 SetHealth(sGear, pMode[pIndex][1]) |
1646 SetHealth(sGear, pMode[pIndex][1]) |
1646 elseif pMode[pIndex][2] == "mod" then |
1647 elseif pMode[pIndex][2] == "mod" then |
1647 local newHealth = math.max(1, GetHealth(sGear) + tonumber(pMode[pIndex][1])) |
1648 local newHealth = math.max(1, GetHealth(sGear) + tonumber(pMode[pIndex][1])) |
1648 SetHealth(sGear, newHealth) |
1649 SetHealth(sGear, newHealth) |
1649 end |
1650 end |
1650 else |
1651 else |
1651 AddCaption(loc("Please click on a hedgehog."),0xffba00ff,capgrpVolume) |
1652 AddCaption(loc("Please click on a hedgehog, barrel or health crate."),0xffba00ff,capgrpVolume) |
1652 end |
1653 end |
1653 |
1654 |
1654 elseif cat[cIndex] == loc("Sprite Modification Mode") then |
1655 elseif cat[cIndex] == loc("Sprite Modification Mode") then |
1655 |
1656 |
1656 SelectClosestSprite() |
1657 SelectClosestSprite() |
3187 |
3188 |
3188 elseif cat[cIndex] == loc("Health Modification Mode") then |
3189 elseif cat[cIndex] == loc("Health Modification Mode") then |
3189 |
3190 |
3190 ShowMission ( |
3191 ShowMission ( |
3191 loc("HEALTH MODIFICATION MODE"), |
3192 loc("HEALTH MODIFICATION MODE"), |
3192 loc("Use this mode to set the health of hogs."), |
3193 loc("Use this mode to set the health of hogs, health crates and barrels."), |
3193 loc("Set Health: [Left Click]") .. "|" .. |
3194 loc("Set Health: [Left Click]") .. "|" .. |
3194 loc("[Left], [Right]: Change health value.") .. "|" .. |
3195 loc("[Left], [Right]: Change health value.") .. "|" .. |
3195 " " .. "|" .. |
3196 " " .. "|" .. |
3196 loc("Change Placement Mode: [Up], [Down]") .. "|" .. |
3197 loc("Change Placement Mode: [Up], [Down]") .. "|" .. |
3197 loc("Toggle Help: Precise+1") .. "|" .. |
3198 loc("Toggle Help: Precise+1") .. "|" .. |