Created
July 4, 2016 21:18
-
-
Save vgaltes/ee3b6f8b510aa50baefae2af7234c073 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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