diff --git a/fsharp/ygosim/src/Board.fs b/fsharp/ygosim/src/Board.fs index 921e9f3..7474b2b 100644 --- a/fsharp/ygosim/src/Board.fs +++ b/fsharp/ygosim/src/Board.fs @@ -191,6 +191,8 @@ module Summon = let freeZones = 5 - possibleTributes + requiredTributes + printfn "%i" freeZones + Some(requiredTributes <= possibleTributes && freeZones > 0) | None -> None @@ -211,12 +213,9 @@ module Summon = let performNormalSummon client board = let free = freeMonsterZones <| board ^. Board.currentPlayer - - printfn "%A" free - let zone = chooseZone client free - printfn "%A" zone + let turn = board ^. Board.turn diff --git a/fsharp/ygosim/src/Card.fs b/fsharp/ygosim/src/Card.fs index d491e32..909fd68 100644 --- a/fsharp/ygosim/src/Card.fs +++ b/fsharp/ygosim/src/Card.fs @@ -107,8 +107,9 @@ module Card = type MonsterCardDetails = { attack: int defense: int + level: int attribute: Attribute - level: int } + race: Race } module MonsterCardDetails = let inline attack f card = f card.attack <&> fun v -> { card with attack = v } diff --git a/fsharp/ygosim/src/Program.fs b/fsharp/ygosim/src/Program.fs index 28ab318..2c0237d 100644 --- a/fsharp/ygosim/src/Program.fs +++ b/fsharp/ygosim/src/Program.fs @@ -4,7 +4,7 @@ open Board.Board open Board.Game open Board.Client - open Card + open Card.Card let printState state = match state with @@ -14,8 +14,18 @@ [] let main _ = - let sampleCard = Card.Spell ({name= "sampleCard"; text="something"; effects = []}, {spellType = Card.ContinuosSpell}) - let board = over Board.currentPlayer <| toDeckBottom sampleCard <| emptyBoard + let sampleCard = + Monster ({ name= "sampleCard" + text="something" + effects = []} + ,{ attack = 0 + defense = 0 + level = 3 + attribute = Fire + race = Warrior }) + + + let board = over Board.firstPlayer <| toDeckBottom sampleCard <| emptyBoard let client action = match action with @@ -27,7 +37,10 @@ printfn "New phse: %A" phase 0 | ChooseZone free -> - List.head free + printfn "What Zone do wou want to use? %A" free + let i = System.Console.ReadLine() |> int + + free.[i] | _ -> printfn "Something unkown happened" 0