You can read and reply to posts and download all mods without registering.
We're an independent and non-profit fan-site. Find out more about us here.
It's a pretty big deal to be able to remove keys from medbeds in earlier, easier levels and take them with you, say, to the Rick. Shouldn't this require a skill of greater than 2? I know repair is underutilized but health is so critical later in the game that I feel the spammy nature of it should come at a greater cost. A side benefit would be that you would also be able to repair more weapons. What was your logic for the skill of 2?
class Wrenchier extends SqRootScript { function OnFrobToolEnd() { ShockGame.PreventSwap(); local fixObj = message().DstObjId; local state, hp, maxHP; local playerMaintSkill = Property.Get("Player", "BaseTechDesc", "Maintain"); local objSkillRequired = Property.Get(fixObj, "ReqTechDesc", "Maintain"); // enforce a minimum skill level if (objSkillRequired == 0) { objSkillRequired = 1; } // guns if (ShockGame.ValidGun(fixObj)) { state = Property.Get(fixObj, "ObjState"); hp = Property.Get(fixObj, "GunState", "Condition (%)"); if (state == eObjState.kObjStateUnresearched) { // do nothing } else if (state == eObjState.kObjStateBroken) { ShockGame.AddTranslatableText("WrenchOnBroken", "misc", "Player"); } else if (playerMaintSkill < objSkillRequired) { ShockGame.AddTranslatableTextInt("WrenchSkillReq", "misc", "Player", objSkillRequired); } else if (hp > 90) { ShockGame.AddTranslatableText("WrenchUnused", "misc", "Player"); } else if (state == eObjState.kObjStateNormal) { // repair gun 10% per point of maint skill hp += playerMaintSkill * 10.0; if (hp > 100.0) { hp = 100.0; } Property.Set(fixObj, "GunState", "Condition (%)", hp); consumeTool(); } } // turrets else if (Object.InheritsFrom(fixObj, "Turrets")) { hp = Property.Get(fixObj, "HitPoints"); maxHP = Property.Get(fixObj, "MAX_HP"); if (playerMaintSkill < objSkillRequired) { ShockGame.AddTranslatableTextInt("WrenchSkillReq", "misc", "Player", objSkillRequired); } else if (hp >= maxHP) { ShockGame.AddTranslatableText("WrenchUnused", "misc", "Player"); } else { // repair turret 5 HP per point of maint skill (default turrets have a max HP of 48) hp += playerMaintSkill * 5; if (hp > maxHP) { hp = maxHP; } Property.SetSimple(fixObj, "HitPoints", hp); consumeTool(); } } // non-repairable else { ShockGame.AddTranslatableText("WrenchOnNonGun", "misc", "Player"); } } function OnFrobInvEnd() { ShockGame.AddTranslatableText("HelpWrench", "misc", "Player"); } function consumeTool() { // decrease stack count Container.StackAdd(self, -1); if (!GetProperty("StackCount")) { ShockGame.DestroyInvObj(self); } // play success sound Sound.PlayEnvSchema(self, "Event Activate", 0, 0, eEnvSoundLoc.kEnvSoundAmbient); }}