-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.lua
More file actions
55 lines (40 loc) · 1.54 KB
/
player.lua
File metadata and controls
55 lines (40 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require('lib/middleclass/middleclass')
require('cardcontainer')
Player = class("Player")
knights = {
'Lancelot', --Arythea
'Percival', --Goldyx
'Galahad', --Norowas
'Gareth', --Tovak
}
function Player:initialize( knight, starting_fame, starting_level, starting_influence )
--Initialize the player: Set their knight
self.knight = knight
--Build their starting deck
--TODO: Write a function that takes in a knight and returns a CardContainer object full of that knight's deck
self.cards = _build_deck( knight )
--Set up their empty unit deck
self.units = CardContainer:new()
--Set up their Common Skills deck
--TODO: Write a function that takes in a knight and returns a CardContainer object full of that knight's common skills
self.common_skills = _build_common_skills( knight )
--Set up their level / xp / fame
self.fame = starting_fame or 0
self.level = starting_level or 1
--Set up their influence
self.influence = starting_influence or 0
--Set up their inventory (crystal energy)
--TODO: Figure out if Inventory is just a deck, and if not, build an Inventory data structure and an init function
self.inventory = {}
--Set up their conquests list
self.conquests = {}
--Set up their tactic holder
self.tactic_card = nil
function _build_deck( knight )
--TODO: Get all the cards, stuff them in the deck, shuffle the deck
local deck = CardContainer:new()
return deck
function _build_common_skills( knight )
--TODO: Get all the skills, stuff them in the deck, shuffle the deck
local skills = CardContainer:new()
return skills