From 08cdbde88418bbd4d1fe093b96d9392ce114b042 Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Fri, 1 Jan 2021 20:40:39 +0000 Subject: [PATCH] Woohoo, lightning works --- character/character.go | 7 +++-- game/window.go | 2 +- main.go | 4 +-- otherspells/main.go | 13 ++++---- player/player.go | 6 ++-- player/spell.go | 33 ++++++++------------ screen/castspell.go | 4 +-- screen/turnmenu.go | 7 +++-- spells/iface/main.go | 16 ++++++---- spells/lawspells.go | 9 +++--- spells/main.go | 56 +--------------------------------- spellswithscreen/lightning.go | 57 +++++++++++++++++------------------ 12 files changed, 79 insertions(+), 135 deletions(-) diff --git a/character/character.go b/character/character.go index 724bf88..362cdf2 100644 --- a/character/character.go +++ b/character/character.go @@ -14,6 +14,7 @@ import ( "github.com/bobtfish/mayhem/render" screeniface "github.com/bobtfish/mayhem/screen/iface" "github.com/bobtfish/mayhem/spells" + spelliface "github.com/bobtfish/mayhem/spells/iface" ) // Abstract character that can be created @@ -67,7 +68,7 @@ func LoadCharacterTemplates() { fmt.Printf("Character spell %s has no 'base_casting_chance', setting chance to 100\n", v.Name) v.BaseCastingChance = 100 } - spells.CreateSpell(CharacterSpell{ + spelliface.CreateSpell(CharacterSpell{ Name: v.Name, LawRating: v.LawChaos, CastingChance: v.BaseCastingChance, @@ -93,7 +94,7 @@ func LoadCharacterTemplates() { // We know that the spells array is initialised now, add the disbelieve spell // This is done here as character depends on spells, and so we can't have spell depend on character - spells.AllSpells[0] = DisbelieveSpell{spells.ASpell{ + spelliface.AllSpells[0] = DisbelieveSpell{spells.ASpell{ Name: "Disbelieve", LawRating: 0, Reuseable: true, @@ -127,7 +128,7 @@ type CharacterSpell struct { } // Spell interface begin -func (s CharacterSpell) TakeOverScreen(grid *grid.GameGrid, cleanup func(), nextScreen screeniface.GameScreen, source, target logical.Vec) screeniface.GameScreen { +func (s CharacterSpell) TakeOverScreen(ctx screeniface.GameCtx, cleanupFunc func(), nextScreen screeniface.GameScreen, playeerIdx int, target logical.Vec) screeniface.GameScreen { return nil } func (s CharacterSpell) GetName() string { diff --git a/game/window.go b/game/window.go index e739e41..9a7b02f 100644 --- a/game/window.go +++ b/game/window.go @@ -54,7 +54,7 @@ func (gw *Window) Update(screen screeniface.GameScreen) screeniface.GameScreen { newScreen := screen.Step(gw) gw.Window.Update() if newScreen != screen { - fmt.Printf("New screen %T %V", newScreen, newScreen) + fmt.Printf("New screen %T %+v\n", newScreen, newScreen) newScreen.Enter(gw) return newScreen } diff --git a/main.go b/main.go index f29c24a..fb60a5d 100644 --- a/main.go +++ b/main.go @@ -19,11 +19,9 @@ import ( screeniface "github.com/bobtfish/mayhem/screen/iface" _ "github.com/bobtfish/mayhem/otherspells" + _ "github.com/bobtfish/mayhem/spellswithscreen" ) -// _ "github.com/bobtfish/mayhem/spellswithscreen" -//) - func loadSpriteSheet() io.Reader { data, err := base64.StdEncoding.DecodeString(sprite_sheet_base64) if err != nil { diff --git a/otherspells/main.go b/otherspells/main.go index d39f388..4a53986 100644 --- a/otherspells/main.go +++ b/otherspells/main.go @@ -11,6 +11,7 @@ import ( "github.com/bobtfish/mayhem/player" "github.com/bobtfish/mayhem/rand" "github.com/bobtfish/mayhem/spells" + spelliface "github.com/bobtfish/mayhem/spells/iface" ) type OtherSpell struct { @@ -23,7 +24,7 @@ func (s OtherSpell) DoCast(illusion bool, target logical.Vec, grid *grid.GameGri } func init() { - spells.CreateSpell(OtherSpell{ + spelliface.CreateSpell(OtherSpell{ ASpell: spells.ASpell{ Name: "Raise Dead", LawRating: -1, @@ -43,7 +44,7 @@ func init() { return true, nil }, }) - spells.CreateSpell(OtherSpell{ + spelliface.CreateSpell(OtherSpell{ ASpell: spells.ASpell{ Name: "Subversion", CastingChance: 100, @@ -63,7 +64,7 @@ func init() { return false, nil }, }) - spells.CreateSpell(OtherSpell{ + spelliface.CreateSpell(OtherSpell{ ASpell: spells.ASpell{ // 1 chance only, makes creatures belonging to player explode Name: "Vengeance", CastingChance: 80, @@ -74,7 +75,7 @@ func init() { return ExplodeCreatures(target, grid) }, }) - spells.CreateSpell(OtherSpell{ + spelliface.CreateSpell(OtherSpell{ ASpell: spells.ASpell{ // 1 chance only, doesn't kill player - makes their creatures explode maybe? Name: "Decree", CastingChance: 80, @@ -86,7 +87,7 @@ func init() { return ExplodeCreatures(target, grid) }, }) - spells.CreateSpell(OtherSpell{ + spelliface.CreateSpell(OtherSpell{ ASpell: spells.ASpell{ // 3 tries, doesn't kill player - makes their creatures explode Name: "Dark Power", CastingChance: 50, @@ -99,7 +100,7 @@ func init() { return ExplodeCreatures(target, grid) }, }) - spells.CreateSpell(OtherSpell{ + spelliface.CreateSpell(OtherSpell{ ASpell: spells.ASpell{ // 3 tries, doesn't kill player - makes their creatures explode Name: "Justice", CastingChance: 50, diff --git a/player/player.go b/player/player.go index 4bf0abc..eb4319e 100644 --- a/player/player.go +++ b/player/player.go @@ -7,7 +7,7 @@ import ( "github.com/bobtfish/mayhem/fx" "github.com/bobtfish/mayhem/logical" "github.com/bobtfish/mayhem/rand" - "github.com/bobtfish/mayhem/spells" + spelliface "github.com/bobtfish/mayhem/spells/iface" ) func NewPlayer() Player { @@ -18,14 +18,14 @@ func NewPlayer() Player { MagicResistance: rand.Intn(2) + 6, // 6-8 Movement: 1, ChosenSpell: -1, - Spells: spells.ChooseSpells(), + Spells: spelliface.ChooseSpells(), Alive: true, } } type Player struct { Name string - Spells []spells.Spell + Spells []spelliface.Spell HumanPlayer bool CharacterIcon logical.Vec ChosenSpell int diff --git a/player/spell.go b/player/spell.go index 813c0d7..a0a2f10 100644 --- a/player/spell.go +++ b/player/spell.go @@ -9,6 +9,7 @@ import ( "github.com/bobtfish/mayhem/grid" "github.com/bobtfish/mayhem/logical" "github.com/bobtfish/mayhem/spells" + spelliface "github.com/bobtfish/mayhem/spells/iface" ) type PlayerSpell struct { @@ -17,27 +18,19 @@ type PlayerSpell struct { } func (s PlayerSpell) CanCast(target grid.GameObject) bool { - _, ok := target.(*Player) - return ok + // CanCast is never called, as CastRange is 0 + return true } func (s PlayerSpell) DoCast(illusion bool, target logical.Vec, grid *grid.GameGrid, castor grid.GameObject) (bool, *fx.Fx) { if illusion { panic("PlayerSpells should never be illusions") } - tile := grid.GetGameObject(target) - player, isPlayer := tile.(*Player) + // Player spells are always on the castor, and the target vec could be the thing they're riding, so just + // use the castor + player, isPlayer := castor.(*Player) if !isPlayer { - // FIXME - bug here if a player is mounted! panic(fmt.Sprintf("Player spell '%s' cast on non player - should never happen", s.Name)) - /*rideable, isRideable := tile.(*movable.Rideable) - if !isRideable - panic(fmt.Sprintf("Player spell '%s' cast on non player - should never happen", s.Name)) - } - player = rideable.GetRider(); - if player == nil { - panic(fmt.Sprintf("Player spell '%s' cast on non player - should never happen", s.Name)) - }*/ } s.MutateFunc(player) return true, nil @@ -45,7 +38,7 @@ func (s PlayerSpell) DoCast(illusion bool, target logical.Vec, grid *grid.GameGr // Setup all the player spells. func init() { - spells.CreateSpell(PlayerSpell{ + spelliface.CreateSpell(PlayerSpell{ ASpell: spells.ASpell{ Name: "Magic Armour", LawRating: 1, @@ -58,7 +51,7 @@ func init() { p.Defence += 4 }, }) - spells.CreateSpell(PlayerSpell{ + spelliface.CreateSpell(PlayerSpell{ ASpell: spells.ASpell{ Name: "Magic Shield", LawRating: 1, @@ -71,7 +64,7 @@ func init() { p.Defence += 2 }, }) - spells.CreateSpell(PlayerSpell{ + spelliface.CreateSpell(PlayerSpell{ ASpell: spells.ASpell{ Name: "Magic Knife", LawRating: 1, @@ -84,7 +77,7 @@ func init() { p.HasMagicWeapon = true }, }) - spells.CreateSpell(PlayerSpell{ + spelliface.CreateSpell(PlayerSpell{ ASpell: spells.ASpell{ Name: "Magic Sword", LawRating: 1, @@ -97,7 +90,7 @@ func init() { p.HasMagicWeapon = true }, }) - spells.CreateSpell(PlayerSpell{ + spelliface.CreateSpell(PlayerSpell{ ASpell: spells.ASpell{ Name: "Magic Bow", LawRating: 1, @@ -110,7 +103,7 @@ func init() { p.RangedCombat = 3 }, }) - spells.CreateSpell(PlayerSpell{ + spelliface.CreateSpell(PlayerSpell{ ASpell: spells.ASpell{ Name: "Shadow Form", CastingChance: 80, @@ -122,7 +115,7 @@ func init() { } }, }) - spells.CreateSpell(PlayerSpell{ + spelliface.CreateSpell(PlayerSpell{ ASpell: spells.ASpell{ Name: "Magic Wings", CastingChance: 60, diff --git a/screen/castspell.go b/screen/castspell.go index dd3c4b3..9a129f2 100644 --- a/screen/castspell.go +++ b/screen/castspell.go @@ -192,10 +192,10 @@ func (screen *DoSpellCast) Step(ctx screeniface.GameCtx) screeniface.GameScreen nextScreen := NextSpellCastOrMove(screen.PlayerIdx, ctx, false) // FIXME - /*takeOver := spell.TakeOverScreen(screen.WithCursor.Grid, cleanupFunc, nextScreen, p.BoardPosition, targetVec) + takeOver := spell.TakeOverScreen(ctx, cleanupFunc, nextScreen, screen.PlayerIdx, screen.Target) if takeOver != nil { return takeOver - }*/ + } // Do the spell cast here var success bool diff --git a/screen/turnmenu.go b/screen/turnmenu.go index 1b3bfd4..442c54a 100644 --- a/screen/turnmenu.go +++ b/screen/turnmenu.go @@ -10,10 +10,11 @@ import ( "github.com/bobtfish/mayhem/player" screeniface "github.com/bobtfish/mayhem/screen/iface" "github.com/bobtfish/mayhem/spells" + spelliface "github.com/bobtfish/mayhem/spells/iface" ) type ExamineOneSpellScreen struct { - Spell spells.Spell + Spell spelliface.Spell ReturnScreen screeniface.GameScreen } @@ -55,7 +56,7 @@ func (screen *SpellListScreen) Enter(ctx screeniface.GameCtx) { } spell := screen.Player.Spells[i] td.DrawTextColor( - fmt.Sprintf("%s%s%s", intToChar(i), spells.LawRatingSymbol(spell), spell.GetName()), + fmt.Sprintf("%s%s%s", intToChar(i), spelliface.LawRatingSymbol(spell), spell.GetName()), logical.V(mod, 8-(i/2)), spells.CastingChanceColor(spell.GetCastingChance(ctx.GetLawRating())), win, @@ -68,7 +69,7 @@ func (screen *SpellListScreen) Enter(ctx screeniface.GameCtx) { // Begin Examine Spells list screen type ExamineSpellsScreen struct { SpellListScreen - SpellToExamine *spells.Spell + SpellToExamine *spelliface.Spell } //func (screen *ExamineSpellsScreen) Enter(ctx screeniface.GameCtx) { diff --git a/spells/iface/main.go b/spells/iface/main.go index 6474402..4fe16d7 100644 --- a/spells/iface/main.go +++ b/spells/iface/main.go @@ -6,6 +6,8 @@ import ( "github.com/bobtfish/mayhem/fx" "github.com/bobtfish/mayhem/grid" "github.com/bobtfish/mayhem/logical" + + screeniface "github.com/bobtfish/mayhem/screen/iface" ) type Spell interface { @@ -21,6 +23,8 @@ type Spell interface { IsReuseable() bool CastFx() *fx.Fx NeedsLineOfSight() bool + + TakeOverScreen(screeniface.GameCtx, func(), screeniface.GameScreen, int, logical.Vec) screeniface.GameScreen } func LawRatingSymbol(s Spell) string { @@ -52,11 +56,11 @@ func ChooseSpells() []Spell { idx := rand.Intn(len(AllSpells)-1) + 1 spells[i] = AllSpells[idx] } - /* - for i := 0; i < len(AllSpells); i++ { - if AllSpells[i].GetName() == "Magic Bolt" { - spells[1] = AllSpells[i] - } - }*/ + + for i := 0; i < len(AllSpells); i++ { + if AllSpells[i].GetName() == "Magic Bolt" { + spells[1] = AllSpells[i] + } + } return spells } diff --git a/spells/lawspells.go b/spells/lawspells.go index 08bf882..10a3ccf 100644 --- a/spells/lawspells.go +++ b/spells/lawspells.go @@ -4,6 +4,7 @@ import ( "github.com/bobtfish/mayhem/fx" "github.com/bobtfish/mayhem/grid" "github.com/bobtfish/mayhem/logical" + spelliface "github.com/bobtfish/mayhem/spells/iface" ) type LawSpell struct { @@ -15,25 +16,25 @@ func (s LawSpell) DoCast(illusion bool, target logical.Vec, grid *grid.GameGrid, } func init() { - CreateSpell(LawSpell{ASpell{ + spelliface.CreateSpell(LawSpell{ASpell{ Name: "Law-1", CastingChance: 100, LawRating: 4, NoCastFx: true, }}) - CreateSpell(LawSpell{ASpell{ + spelliface.CreateSpell(LawSpell{ASpell{ Name: "Law-2", CastingChance: 60, LawRating: 8, NoCastFx: true, }}) - CreateSpell(LawSpell{ASpell{ + spelliface.CreateSpell(LawSpell{ASpell{ Name: "Chaos-1", CastingChance: 80, LawRating: -4, NoCastFx: true, }}) - CreateSpell(LawSpell{ASpell{ + spelliface.CreateSpell(LawSpell{ASpell{ Name: "Chaos-2", CastingChance: 60, LawRating: -8, diff --git a/spells/main.go b/spells/main.go index f7245db..e584b1b 100644 --- a/spells/main.go +++ b/spells/main.go @@ -12,22 +12,6 @@ import ( screeniface "github.com/bobtfish/mayhem/screen/iface" ) -type Spell interface { - GetName() string - GetLawRating() int - GetCastingChance(int) int - GetCastRange() int - CanCast(grid.GameObject) bool - CanCastAsIllusion() bool - DoCast(bool, logical.Vec, *grid.GameGrid, grid.GameObject) (bool, *fx.Fx) - CastQuantity() int - CastSucceeds(bool, int) bool - IsReuseable() bool - CastFx() *fx.Fx - NeedsLineOfSight() bool - TakeOverScreen(*grid.GameGrid, func(), screeniface.GameScreen, logical.Vec, logical.Vec) screeniface.GameScreen -} - type ASpell struct { Name string LawRating int @@ -39,7 +23,7 @@ type ASpell struct { NoLineOfSightNeeded bool } -func (s ASpell) TakeOverScreen(grid *grid.GameGrid, cleanup func(), nextScreen screeniface.GameScreen, source, target logical.Vec) screeniface.GameScreen { +func (s ASpell) TakeOverScreen(ctx screeniface.GameCtx, cleanupFunc func(), nextScreen screeniface.GameScreen, playeerIdx int, target logical.Vec) screeniface.GameScreen { return nil } func (s ASpell) CastFx() *fx.Fx { @@ -103,19 +87,6 @@ func (s ASpell) NeedsLineOfSight() bool { return !s.NoLineOfSightNeeded } -func LawRatingSymbol(s Spell) string { - if s == nil { - panic("nil spell") - } - if s.GetLawRating() == 0 { - return "-" - } - if s.GetLawRating() < 0 { - return "*" - } - return "^" -} - func CastingChanceColor(chance int) color.Color { switch { case chance >= 100: @@ -130,28 +101,3 @@ func CastingChanceColor(chance int) color.Color { return render.GetColor(255, 0, 255) } } - -func ChooseSpells() []Spell { - spells := make([]Spell, 14) - spells[0] = AllSpells[0] - for i := 1; i < 14; i++ { - idx := rand.Intn(len(AllSpells)-1) + 1 - spells[i] = AllSpells[idx] - } - /* - for i := 0; i < len(AllSpells); i++ { - if AllSpells[i].GetName() == "Magic Bolt" { - spells[1] = AllSpells[i] - } - }*/ - return spells -} - -var AllSpells []Spell - -func CreateSpell(s Spell) { - if AllSpells == nil { - AllSpells = make([]Spell, 1) // Deliberately leave room for disbelieve spell as number 0 - } - AllSpells = append(AllSpells, s) -} diff --git a/spellswithscreen/lightning.go b/spellswithscreen/lightning.go index 584d7dc..5bf3f50 100644 --- a/spellswithscreen/lightning.go +++ b/spellswithscreen/lightning.go @@ -6,26 +6,30 @@ import ( "time" "github.com/bobtfish/mayhem/fx" + "github.com/bobtfish/mayhem/game" "github.com/bobtfish/mayhem/grid" "github.com/bobtfish/mayhem/logical" "github.com/bobtfish/mayhem/movable" - "github.com/bobtfish/mayhem/player" "github.com/bobtfish/mayhem/render" screens "github.com/bobtfish/mayhem/screen" screeniface "github.com/bobtfish/mayhem/screen/iface" "github.com/bobtfish/mayhem/spells" - + spelliface "github.com/bobtfish/mayhem/spells/iface" "github.com/faiface/pixel" - "github.com/faiface/pixel/pixelgl" ) +// FIXME this is duplicate +func DrawBoard(ctx screeniface.GameCtx) *pixel.Batch { + return ctx.GetGrid().DrawBatch(render.NewSpriteDrawer(ctx.GetSpriteSheet()).WithOffset(render.GameBoardV())) +} + type ScreenSpell struct { spells.ASpell - TakeOverFunc func(*grid.GameGrid, []*player.Player, func(), screeniface.GameScreen, logical.Vec, logical.Vec) screeniface.GameScreen + TakeOverFunc func(screeniface.GameCtx, func(), screeniface.GameScreen, int, logical.Vec) screeniface.GameScreen } -func (s ScreenSpell) TakeOverScreen(grid *grid.GameGrid, players []*player.Player, cleanupFunc func(), nextScreen screeniface.GameScreen, source, target logical.Vec) screeniface.GameScreen { - return s.TakeOverFunc(grid, players, cleanupFunc, nextScreen, source, target) +func (s ScreenSpell) TakeOverScreen(ctx screeniface.GameCtx, cleanupFunc func(), nextScreen screeniface.GameScreen, playerIdx int, target logical.Vec) screeniface.GameScreen { + return s.TakeOverFunc(ctx, cleanupFunc, nextScreen, playerIdx, target) } func (s ScreenSpell) DoCast(illusion bool, target logical.Vec, grid *grid.GameGrid, owner grid.GameObject) (bool, *fx.Fx) { @@ -37,30 +41,25 @@ func (s ScreenSpell) CastFx() *fx.Fx { } type LightningSpellScreen struct { - Grid *grid.GameGrid NextScreen screeniface.GameScreen CleanupFunc func() // This is a closure that removes the spell from the player after casting, called when leaving - Source logical.Vec Target logical.Vec Anim []logical.Vec AnimCount int Lightning bool - Players []*player.Player -} - -func (screen *LightningSpellScreen) DrawBoard(ss pixel.Picture, win *pixelgl.Window) *pixel.Batch { - sd := render.NewSpriteDrawer(ss).WithOffset(render.GameBoardV()) - return screen.Grid.DrawBatch(sd) } -func (screen *LightningSpellScreen) Enter(ss pixel.Picture, win *pixelgl.Window) { +func (screen *LightningSpellScreen) Enter(ctx screeniface.GameCtx) { //fmt.Printf("FOO\n") } // 25 Y, 0 X -func (screen *LightningSpellScreen) Step(ss pixel.Picture, win *pixelgl.Window) screeniface.GameScreen { - batch := screen.DrawBoard(ss, win) +func (screen *LightningSpellScreen) Step(ctx screeniface.GameCtx) screeniface.GameScreen { + batch := DrawBoard(ctx) + ss := ctx.GetSpriteSheet() + grid := ctx.GetGrid() + win := ctx.GetWindow() screen.AnimCount++ //fmt.Printf("Source is X%dY%d Target is X%dY%d\n", screen.Source.X, screen.Source.Y, screen.Target.X, screen.Target.Y) //fmt.Printf("AnimCount is %d Path is %d, %d\n", screen.AnimCount, screen.Anim[screen.AnimCount].X, screen.Anim[screen.AnimCount].Y) @@ -81,7 +80,7 @@ func (screen *LightningSpellScreen) Step(ss pixel.Picture, win *pixelgl.Window) batch.Draw(win) if screen.AnimCount+1 == len(screen.Anim) { - ob := screen.Grid.GetGameObject(screen.Target) + ob := grid.GetGameObject(screen.Target) a, isAttackable := ob.(movable.Attackable) if isAttackable { chance := rand.Intn(5) // Defence is 1-5 for a player @@ -90,11 +89,12 @@ func (screen *LightningSpellScreen) Step(ss pixel.Picture, win *pixelgl.Window) } fmt.Printf("Chance %d > Defence %d\n", chance, a.GetDefence()) if chance > a.GetDefence() { - died := screen.Grid.GetGameObjectStack(screen.Target).RemoveTopObject() - if screens.KillIfPlayer(died, screen.Grid) { - if screens.WeHaveAWinner(screen.Players) { + died := grid.GetGameObjectStack(screen.Target).RemoveTopObject() + if screens.KillIfPlayer(died, grid) { + players := ctx.(*game.Window).GetPlayers() + if screens.WeHaveAWinner(players) { return &screens.WinnerScreen{ - Players: screen.Players, + Players: players, } } } @@ -110,10 +110,12 @@ func (screen *LightningSpellScreen) Step(ss pixel.Picture, win *pixelgl.Window) } func init() { - lightningTakeOver := func(isLightning bool) func(grid *grid.GameGrid, players []*player.Player, cleanupFunc func(), nextScreen screeniface.GameScreen, source, target logical.Vec) screeniface.GameScreen { - return func(grid *grid.GameGrid, players []*player.Player, cleanupFunc func(), nextScreen screeniface.GameScreen, source, target logical.Vec) screeniface.GameScreen { + //ctx screeniface.GameCtx, cleanupFunc func(), nextScreen screeniface.GameScreen, playeerIdx int, target logical.Vec) screeniface.GameScreen + lightningTakeOver := func(isLightning bool) func(ctx screeniface.GameCtx, cleanupFunc func(), nextScreen screeniface.GameScreen, playerIdx int, target logical.Vec) screeniface.GameScreen { + return func(ctx screeniface.GameCtx, cleanupFunc func(), nextScreen screeniface.GameScreen, playerIdx int, target logical.Vec) screeniface.GameScreen { four := logical.V(4, 4) mtarget := target.Multiply(four) + source := ctx.(*game.Window).GetPlayers()[playerIdx].BoardPosition msource := source.Multiply(four) anim := mtarget.Subtract(msource).Path() for i, s := range anim { @@ -122,18 +124,15 @@ func init() { anim = append(anim, mtarget) return &LightningSpellScreen{ Lightning: isLightning, - Grid: grid, NextScreen: nextScreen, CleanupFunc: cleanupFunc, - Source: source, Target: target, Anim: anim, AnimCount: -1, - Players: players, } } } - spells.CreateSpell(ScreenSpell{ + spelliface.CreateSpell(ScreenSpell{ ASpell: spells.ASpell{ // Uses disbelive animation if it kills a thing. No corpse Name: "Lightning", CastingChance: 100, @@ -141,7 +140,7 @@ func init() { }, TakeOverFunc: lightningTakeOver(true), }) - spells.CreateSpell(ScreenSpell{ + spelliface.CreateSpell(ScreenSpell{ ASpell: spells.ASpell{ // as above, just less strong Name: "Magic Bolt", CastingChance: 100,