Skip to content

Commit

Permalink
Fix randomness of spell choosing
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Jan 1, 2021
1 parent 08cdbde commit e4b4aa2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sprite_sheet.go: sprite_sheet.png utils/sprite_sheet_gen/main.go
character/yaml.go: character/characters.yaml utils/character_gen/main.go
go run utils/character_gen/main.go > character/yaml.go

mayhem: sprite_sheet.go character/yaml.go *.go */*.go go.mod go.sum
mayhem: sprite_sheet.go character/yaml.go *.go */*.go */*/*.go go.mod go.sum
go build

.PHONY: test
Expand Down
6 changes: 3 additions & 3 deletions spells/iface/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package iface

import (
"math/rand"
"github.com/bobtfish/mayhem/rand"

"github.com/bobtfish/mayhem/fx"
"github.com/bobtfish/mayhem/grid"
Expand Down Expand Up @@ -57,10 +57,10 @@ func ChooseSpells() []Spell {
spells[i] = AllSpells[idx]
}

for i := 0; i < len(AllSpells); i++ {
/*for i := 0; i < len(AllSpells); i++ {
if AllSpells[i].GetName() == "Magic Bolt" {
spells[1] = AllSpells[i]
}
}
}*/
return spells
}
3 changes: 2 additions & 1 deletion spellswithscreen/lightning.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package spellswithscreen

import (
"fmt"
"math/rand"
"time"

"github.com/bobtfish/mayhem/rand"

"github.com/bobtfish/mayhem/fx"
"github.com/bobtfish/mayhem/game"
"github.com/bobtfish/mayhem/grid"
Expand Down

0 comments on commit e4b4aa2

Please sign in to comment.