>>603 >>638
This is the actual code. Would you like to check it?


elementalScaling :: Float
elementalScaling = 0.05

elementalEffectiveness :: Maybe (Element Int) -> Maybe (Element Int) -> Float
-- Main elemental cycle: Lightning > Air > Earth > Water > Fire > Ice > Lightning
elementalEffectiveness (Just (Lightning !potency1)) (Just (Air !potency2)) = 1.2 + elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Air !potency1)) (Just (Earth !potency2)) = 1.2 + elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Earth !potency1)) (Just (Water !potency2)) = 1.2 + elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Water !potency1)) (Just (Fire !potency2)) = 1.2 + elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Fire !potency1)) (Just (Ice !potency2)) = 1.2 + elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Ice !potency1)) (Just (Lightning !potency2)) = 1.2 + elementalScaling * fromIntegral (potency1 - potency2)

-- Reverse of the main elemental cycle
elementalEffectiveness (Just (Air !potency1)) (Just (Lightning !potency2)) = 0.8 - elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Earth !potency1)) (Just (Air !potency2)) = 0.8 - elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Water !potency1)) (Just (Earth !potency2)) = 0.8 - elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Fire !potency1)) (Just (Water !potency2)) = 0.8 - elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Ice !potency1)) (Just (Fire !potency2)) = 0.8 - elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Lightning !potency1)) (Just (Ice !potency2)) = 0.8 - elementalScaling * fromIntegral (potency1 - potency2)

-- Main dark/light/normal cycle: Light > Dark > Normal > Light
elementalEffectiveness (Just (Light potency1)) (Just (Dark potency2)) = 1.2 + elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness (Just (Dark potency1)) Nothing = 1.2 + elementalScaling * fromIntegral (potency1 - 0)
elementalEffectiveness Nothing (Just (Light potency2)) = 1.2 + elementalScaling * fromIntegral (0 - potency2)

-- Reverse of the dark/light/normal cycle
elementalEffectiveness (Just (Dark potency1)) (Just (Light potency2)) = 0.8 - elementalScaling * fromIntegral (potency1 - potency2)
elementalEffectiveness Nothing (Just (Dark potency2)) = 0.8 - elementalScaling * fromIntegral (0 - potency2)
elementalEffectiveness (Just (Light potency1)) Nothing = 0.8 - elementalScaling * fromIntegral (potency1 - 0)

-- Neutral effectiveness for other combinations or lack of elements
elementalEffectiveness _ _ = 1.0