damageCard :: Monad m => CardID -> Int -> StateT GameState m ()
damageCard cID amount = do
  prevent <- use $ card cID.damageToPrevent
  process prevent
  where
    process prevent
      | prevent >= amount =
        _card cID.damageToPrevent -= amount
      | prevent == 0 = do
        _card cID.damage += amount
      | prevent < amount = do
        _card cID.damageToPrevent .= 0
        _card cID.damage += (amount - prevent)
damageCard :: Monad m => CardID -> Int -> StateT GameState m ()
damageCard cID amount = do
  prevent <- use $ card cID.damageToPrevent
  process prevent
  where
    process prevent
      | prevent >= amount =
        _card cID.damageToPrevent -= amount
      | prevent == 0 = do
        _card cID.damage += amount
      | prevent < amount = do
        _card cID.damageToPrevent .= 0
        _card cID.damage += (amount - prevent)
damageCard cID amount = do
  prevent <- use $ card cID.damageToPrevent
  process prevent
  where
    process prevent
      | prevent >= amount =
        _card cID.damageToPrevent -= amount
      | prevent == 0 = do
        _card cID.damage += amount
      | prevent < amount = do
        _card cID.damageToPrevent .= 0
        _card cID.damage += (amount - prevent)