From e4b4aa216837ed9fbc6a8d03af7e23679f7f921b Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Fri, 1 Jan 2021 20:49:45 +0000 Subject: [PATCH] Fix randomness of spell choosing --- Makefile | 2 +- spells/iface/main.go | 6 +++--- spellswithscreen/lightning.go | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5e2e253..6805132 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/spells/iface/main.go b/spells/iface/main.go index 4fe16d7..4816599 100644 --- a/spells/iface/main.go +++ b/spells/iface/main.go @@ -1,7 +1,7 @@ package iface import ( - "math/rand" + "github.com/bobtfish/mayhem/rand" "github.com/bobtfish/mayhem/fx" "github.com/bobtfish/mayhem/grid" @@ -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 } diff --git a/spellswithscreen/lightning.go b/spellswithscreen/lightning.go index 5bf3f50..48201b0 100644 --- a/spellswithscreen/lightning.go +++ b/spellswithscreen/lightning.go @@ -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"