hp is set at start of round, not start of group

This commit is contained in:
Branden J Brown 2024-01-21 00:25:51 -06:00
parent 4d2f5a43dc
commit 402e3768e5
2 changed files with 8 additions and 8 deletions

View File

@ -28,8 +28,9 @@ func NewGame() *Game {
}
func (g *Game) StartRound() {
g.PP[0].StartRound()
g.PP[1].StartRound()
g.HP = int8(g.RNG.Intn(3) + 2)
g.PP[0].StartRound(g.HP)
g.PP[1].StartRound(g.HP)
g.Round++
g.Group = 0
g.StartGroup()
@ -37,9 +38,8 @@ func (g *Game) StartRound() {
func (g *Game) StartGroup() {
items := g.RNG.Intn(4) + 1
g.HP = int8(g.RNG.Intn(3) + 2)
g.PP[0].StartGroup(&g.RNG, g.HP, items)
g.PP[1].StartGroup(&g.RNG, g.HP, items)
g.PP[0].StartGroup(&g.RNG, items)
g.PP[1].StartGroup(&g.RNG, items)
shells := g.RNG.Intn(6) + 2
for i := 0; i < shells/2; i++ {
g.ShellArray[i] = true

View File

@ -13,12 +13,12 @@ type Player struct {
Cuffs CuffState
}
func (p *Player) StartRound() {
func (p *Player) StartRound(hp int8) {
p.HP = hp
clear(p.Items[:])
}
func (p *Player) StartGroup(rng *RNG, hp int8, items int) {
p.HP = hp
func (p *Player) StartGroup(rng *RNG, items int) {
for i := 0; i < items; i++ {
k := slices.Index(p.Items[:], ItemNone)
if k < 0 {