How do I express that a value needs to be between two separate values (a minimum and a maximum), but should be used as is if it does fall within those limits?
More specifically, I currently have it written as X ≤ Y ≤ Z, but I want to also specify that Y is the default while X and Z only come into effect if Y falls outside of their limit. Or, if more information is needed, this is the formula I have as it currently stands:
Hit rate = ((1 + Attacker's Luk / 25) / 150) ≤ ((1 - (0 ≤ ((Defender's Melee or Pierce or Magic - Attacker's Bonus) / 150) ≤ 1)) * (1 - (0 ≤ ((Defender's Block or Parry or Dodge - Attacker's Bonus) / 150 * (1 - Attacker's Crit / 200)) ≤ 1))) ≤ 0.9933
(Defender's Melee or Pierce or Magic - Attacker's Bonus) / 150) for example needs to be ≤ 1 and ≥ 0 because it's a chance between 0 and 100%, and the final value should be solved down to X ≤ Y ≤ 0.9933, where Y is the final chance to successfully hit and should be the value used unless X is higher or 0.9933 is lower.