fsharp(ygosim): feat: basic normal summoning zone cli input
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
d48af38573
commit
9cc3e22dbd
|
@ -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
|
||||
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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 @@
|
|||
|
||||
[<EntryPoint>]
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue