add student and librarian

This commit is contained in:
stryan 2021-11-14 14:59:53 -05:00
parent bb73c648cd
commit 13060571dc
2 changed files with 19 additions and 6 deletions

12
game.go
View File

@ -245,7 +245,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
return g.CardBuffer
case "d":
//draw: return player hand
if !g.CanDraw || g.QueuedEffect != nil {
if !g.CanDraw || g.QueuedEffect != nil || g.BottomBuffer != 0 {
return nil
}
if len(cmd_s) != 2 || !g.CanDraw {
@ -273,7 +273,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
g.HasDrawn = true
return DeckFromCards(curr.Hand)
case "b":
if g.BottomBuffer == 0 || g.ScryBuffer == 0 {
if g.BottomBuffer == 0 || g.ScryBuffer != 0 {
return nil
}
if len(cmd_s) != 2 {
@ -302,7 +302,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
if len(cmd_s) != 3 {
return nil
}
if !g.HasDrawn || g.QueuedEffect != nil {
if !g.HasDrawn || g.QueuedEffect != nil || g.BottomBuffer != 0 {
return nil
}
x_i, err := strconv.Atoi(cmd_s[1])
@ -326,7 +326,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
if len(cmd_s) != 3 {
return nil
}
if !g.HasDrawn || g.QueuedEffect != nil {
if !g.HasDrawn || g.QueuedEffect != nil || g.BottomBuffer != 0 {
return nil
}
x_i, err := strconv.Atoi(cmd_s[1])
@ -379,7 +379,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
fmt.Println("not enough arguments")
return nil
}
if !g.HasDrawn || g.QueuedEffect != nil {
if !g.HasDrawn || g.QueuedEffect != nil || g.BottomBuffer != 0 {
return nil
}
x_i, err := strconv.Atoi(cmd_s[1])
@ -415,7 +415,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
fmt.Println("not enough arguments")
return nil
}
if !g.HasDrawn || g.QueuedEffect == nil {
if !g.HasDrawn || g.QueuedEffect == nil || g.BottomBuffer != 0 {
return nil
}
board, err := strconv.Atoi(cmd_s[1])

View File

@ -60,6 +60,10 @@ func OracleEnters(c *Card, g *Game) {
return
case Scholar:
AddPlayerEffect(g.GetPlayer(c.Owner), &Effect{c.Id, uuid.Nil, 2, 1, true})
case Student:
AddPlayerEffect(g.GetPlayer(c.Owner), &Effect{c.Id, uuid.Nil, 4, 2, true})
case Librarian:
AddPlayerEffect(g.GetPlayer(c.Owner), &Effect{c.Id, uuid.Nil, 1, 1, true})
case ShieldWall, Tree:
c.Counters = 0
case HealthPotion:
@ -273,6 +277,10 @@ func OraclePlayerEffect(p *Player, g *Game) {
}
for _, e := range p.Effects {
switch e.ID {
case 1:
g.CanDraw = true
g.HasDrawn = false
RemovePlayerEffect(e.Owner, p)
case 2:
g.CardBuffer = DeckFromCards(g.GetDeck(p.Id).Scry(1))
g.CanDraw = true
@ -282,6 +290,11 @@ func OraclePlayerEffect(p *Player, g *Game) {
g.ScryBuffer = e.Modifier
g.BottomBuffer = e.Modifier - 1
RemovePlayerEffect(e.Owner, p)
case 4:
g.ScryBuffer = e.Modifier
g.CanDraw = true
g.HasDrawn = false
RemovePlayerEffect(e.Owner, p)
}
}
}