float PercHealth (int current, string shipName, int healthType) { ship myShip=LoadShip(shipName); float fcurrent = current; float fpoints; if(healthType==1) fpoints = myShip.shieldHitPoints; else if(healthType==2) fpoints = myShip.armorHitPoints; else if(healthType==3) fpoints = myShip.hullHitPoints; return (fcurrent/fpoints) * 100; }