From c7c822bdd723db68072ac7166d8b9a9b8a29b9b1 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@gmail.com> Date: Fri, 20 Sep 2019 15:27:32 +0200 Subject: [PATCH] add limb prosthetic conversion functions --- src/js/itemAvailability.js | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index 26237b5bdbe..b70979fde29 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -188,3 +188,46 @@ window.addProsthetic = function(slave, prosthetic) { slave.readyProsthetics.push({id: prosthetic}); } }; + +/** + * @param {string} prosthetic + * @returns {number} + */ +window.prostheticToLimb = function(prosthetic) { + switch (prosthetic) { + case "basicL": + return 2; + case "sexL": + return 3; + case "beautyL": + return 4; + case "combatL": + return 5; + case "cyberneticL": + return 6; + default: + return 0; + } +}; + +/** + * + * @param {number} limb + * @returns {string} + */ +window.limbToProsthetic = function(limb) { + switch (limb) { + case 2: + return "basicL"; + case 3: + return "sexL"; + case 4: + return "beautyL"; + case 5: + return "combatL"; + case 6: + return "cyberneticL"; + default: + return ""; + } +}; -- GitLab