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.
// maintenance droids else if (Object.InheritsFrom(fixObj, "Maintenance")) { hp = Property.Get(fixObj, "HitPoints"); maxHP = Property.Get(fixObj, "MAX_HP"); if (playerMaintSkill < objSkillRequired) { addMiscText("WrenchierSkillReq", "Maintaining this device requires a skill of %d.", objSkillRequired); } else if (hp >= maxHP) { addMiscText("WrenchierUnused", "Device already in good condition."); } else { // repair droid 5 HP per point of maint skill (default droids have a max HP of 100) hp += playerMaintSkill * 5; if (hp > maxHP) { hp = maxHP; } Property.SetSimple(fixObj, "HitPoints", hp); consumeTool(); } } // security droids else if (Object.InheritsFrom(fixObj, "Security")) { hp = Property.Get(fixObj, "HitPoints"); maxHP = Property.Get(fixObj, "MAX_HP"); if (playerMaintSkill < objSkillRequired) { addMiscText("WrenchierSkillReq", "Maintaining this device requires a skill of %d.", objSkillRequired); } else if (hp >= maxHP) { addMiscText("WrenchierUnused", "Device already in good condition."); } else { // repair droid 5 HP per point of maint skill (default droids have a max HP of 160) hp += playerMaintSkill * 5; if (hp > maxHP) { hp = maxHP; } Property.SetSimple(fixObj, "HitPoints", hp); consumeTool(); } } // assault droids else if (Object.InheritsFrom(fixObj, "Assault")) { hp = Property.Get(fixObj, "HitPoints"); maxHP = Property.Get(fixObj, "MAX_HP"); if (playerMaintSkill < objSkillRequired) { addMiscText("WrenchierSkillReq", "Maintaining this device requires a skill of %d.", objSkillRequired); } else if (hp >= maxHP) { addMiscText("WrenchierUnused", "Device already in good condition."); } else { // repair droid 5 HP per point of maint skill (default droids have a max HP of 200) hp += playerMaintSkill * 5; if (hp > maxHP) { hp = maxHP; } Property.SetSimple(fixObj, "HitPoints", hp); consumeTool(); } }
All that duplicated code because you don't know how to do OR in an if statement. Sigh.
Hey, I said I've done programming before. Never said I was a pro.