Skip to content

Instantly share code, notes, and snippets.

@vgaltes
Created July 4, 2016 21:18
Show Gist options
  • Save vgaltes/ee3b6f8b510aa50baefae2af7234c073 to your computer and use it in GitHub Desktop.
Save vgaltes/ee3b6f8b510aa50baefae2af7234c073 to your computer and use it in GitHub Desktop.
let noMoreThanOneThousand characterFrom playerTo distance amount =
match playerTo with
| Thing t -> None
| Character c ->
if amount < 1000 - c.Health then Some (amount)
else Some (1000 - c.Health)
let sameFactionNotAllowed characterFrom playerTo distance amount =
match playerTo with
| Thing _ -> Some(amount)
| Character c ->
let setFrom = set characterFrom.Factions
let setTo = set c.Factions
if setFrom |> Set.isEmpty && setTo |> Set.isEmpty then Some(amount)
elif Set.intersect setFrom setTo |> Set.isEmpty then Some(amount)
else None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment