From f23ee96cac4e749e1c8d9a5e74eff99b97577d5d Mon Sep 17 00:00:00 2001 From: mollusk Date: Sun, 15 Oct 2017 11:10:52 -0700 Subject: [PATCH] corrected syntax formatting of all files --- battle.go | 11 ++++------- characters.go | 15 ++++++--------- weapons.go | 2 -- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/battle.go b/battle.go index 598c1c5..ed454a9 100644 --- a/battle.go +++ b/battle.go @@ -5,8 +5,6 @@ import ( "time" ) - - func Battle(hero, enemy Character) { speed := time.Second * 1 @@ -16,11 +14,10 @@ func Battle(hero, enemy Character) { heroInitiative := rand.Intn(7) + hero.Initiative enemyInitiative := rand.Intn(7) + enemy.Initiative - - if heroInitiative == enemyInitiative{ - if flipCoin() == "heads"{ - heroInitiative -=1 - }else{ + if heroInitiative == enemyInitiative { + if flipCoin() == "heads" { + heroInitiative -= 1 + } else { enemyInitiative -= 1 } } diff --git a/characters.go b/characters.go index 619472c..e4281fe 100644 --- a/characters.go +++ b/characters.go @@ -1,18 +1,15 @@ package main - - type Character struct { Name string Health int Damage int - Weapons (map[string] Weapon) + Weapons (map[string]Weapon) Spell Spell Initiative int - Gear PaperDoll + Gear PaperDoll } - var ( player = Character{ @@ -20,16 +17,16 @@ var ( Health: 100, Damage: 30, Spell: firearrow, - Weapons: make(map[string] Weapon), + Weapons: make(map[string]Weapon), Initiative: 4, - Gear: PaperDoll{Weapon: Broadsword}} + Gear: PaperDoll{Weapon: Broadsword}} goblin = Character{ Name: "Goblin", Health: 100, Damage: 20, - Weapons: make(map[string] Weapon), + Weapons: make(map[string]Weapon), Initiative: 3, - Gear: PaperDoll{Weapon: GoblinClaw}} + Gear: PaperDoll{Weapon: GoblinClaw}} ) diff --git a/weapons.go b/weapons.go index 11a6983..6ecfeb8 100644 --- a/weapons.go +++ b/weapons.go @@ -8,10 +8,8 @@ type Weapon struct { type PaperDoll struct { Weapon Weapon - } - var ( Broadsword = Weapon{ Name: "Broadsword",