Reworked weapon system to be more dynamic

This commit is contained in:
mollusk 2017-10-11 06:32:40 -07:00
parent 1bb390c415
commit 65c896dd17

View File

@ -1,14 +1,18 @@
package main package main
type Character struct { type Character struct {
Name string Name string
Health int Health int
Damage int Damage int
Weapons [5]Weapon Weapons (map[string] Weapon)
Spell Spell Spell Spell
Initiative int Initiative int
Gear PaperDoll
} }
var ( var (
player = Character{ player = Character{
@ -16,14 +20,16 @@ var (
Health: 100, Health: 100,
Damage: 30, Damage: 30,
Spell: firearrow, Spell: firearrow,
Weapons: [5]Weapon{Broadsword}, Weapons: make(map[string] Weapon),
Initiative: 4} Initiative: 4,
Gear: PaperDoll{Weapon: Broadsword}}
goblin = Character{ goblin = Character{
Name: "Goblin", Name: "Goblin",
Health: 100, Health: 100,
Damage: 20, Damage: 20,
Weapons: [5]Weapon{GoblinClaw}, Weapons: make(map[string] Weapon),
Initiative: 3} Initiative: 3,
Gear: PaperDoll{Weapon: GoblinClaw}}
) )