lazy push
This commit is contained in:
parent
14d9d4db4c
commit
953ca6d38c
10
src/Cogs/Puts.hs
Normal file
10
src/Cogs/Puts.hs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
module Cogs.Puts where
|
||||||
|
|
||||||
|
-- == Cogs - Puts ==
|
||||||
|
-- Get info about put cards
|
||||||
|
-- ====
|
||||||
|
|
||||||
|
import ComBoard.Types
|
||||||
|
import Cogs.Cards
|
||||||
|
|
||||||
|
|
@ -38,3 +38,14 @@ initBS = BoardState
|
|||||||
, bsCardLib = gCardLib
|
, bsCardLib = gCardLib
|
||||||
, bsGameLog = []
|
, bsGameLog = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mcCardSym :: MainCharacter -> CardSym
|
||||||
|
mcCardSym Shinji = S01_Shinji
|
||||||
|
mcCardSym Asuka = S02_Asuka
|
||||||
|
mcCardSym Rei = S03_Rei
|
||||||
|
mcCardSym Misato = S04_Misato
|
||||||
|
mcCardSym Ritsuko = S05_Ritsuko
|
||||||
|
mcCardSym Gendo = S06_Gendo
|
||||||
|
|
||||||
|
-- meCardSym :: MainEva -> CardSym
|
||||||
|
-- meCardSym UnitOne =
|
||||||
|
@ -24,6 +24,7 @@ type Traits = [Trait]
|
|||||||
data Mark = Circle | Triangle deriving (Show)
|
data Mark = Circle | Triangle deriving (Show)
|
||||||
type LineMark = (Mark, Faction)
|
type LineMark = (Mark, Faction)
|
||||||
type LineMarks = [LineMark]
|
type LineMarks = [LineMark]
|
||||||
|
type Speaker = Either
|
||||||
data CardInfo = CardInfo
|
data CardInfo = CardInfo
|
||||||
{ ciName :: String
|
{ ciName :: String
|
||||||
, ciFaction :: Faction
|
, ciFaction :: Faction
|
||||||
@ -63,7 +64,8 @@ type Group = [MainCharacter]
|
|||||||
type Groups = [Group]
|
type Groups = [Group]
|
||||||
type Angels = [Angel]
|
type Angels = [Angel]
|
||||||
type Downed = [MainCharacter]
|
type Downed = [MainCharacter]
|
||||||
type PutCards = [(Either MainCharacter MainEva, CardSym)]
|
type PutEva = [(MainEva, [CardSym])]
|
||||||
|
type PutMainCharacter = [(MainCharacter, [CardSym])
|
||||||
|
|
||||||
-- Game types
|
-- Game types
|
||||||
type ActivePlayers = [PlayerId]
|
type ActivePlayers = [PlayerId]
|
||||||
|
@ -8,4 +8,15 @@ module Leads.Lines where
|
|||||||
import ComBoard.Types
|
import ComBoard.Types
|
||||||
import Toolbox.Utils
|
import Toolbox.Utils
|
||||||
|
|
||||||
|
-- PlayerId announces a line and target
|
||||||
|
announceLine :: PlayerId -> CardSym -> Maybe CardSym -> MainCharacter -> BoardState -> BoardState
|
||||||
|
announceLine p l c t bs
|
||||||
|
| not $ isInHand p c bs = addGameError (playerName p bs ++ " doesnt have " ++ getCardLine c bs) bs
|
||||||
|
| isJust c && inPutCards c bs =
|
||||||
|
| isDowned mc bs = addGameError (show mc ++ " is downed, cannot speak") bs
|
||||||
|
|
|
||||||
|
where
|
||||||
|
mc = defCharsFaction (ciFaction . getCardInfo c)
|
||||||
|
f Nothing = mcCardSym mc
|
||||||
|
f Just cs = cs
|
||||||
|
speaker = f c
|
||||||
|
Loading…
Reference in New Issue
Block a user