-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAgent.go
68 lines (57 loc) · 1.22 KB
/
Agent.go
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
56
57
58
59
60
61
62
63
64
65
66
67
68
package main
type Agenter interface {
Attack(target Agenter) []FormattedString
TakeDamage(amount int, typeOfDamge int)
Respawn() []FormattedString
AddTarget(target Agenter)
GetName() string
GetDescription() string
GetDefense() int
GetRoomID() int
GetLevel() int
IsDead() bool
SendMessage(interface{})
}
type Agent struct {
Name string
currentHP int
MaxHitPoints int
RoomIN int
Level int
Defense int
Attack int
// PersonalInv Inventory
// EquippedArmour ArmourSet
//Core Stats
Strength int
Constitution int
Dexterity int
Wisdom int
Charisma int
Inteligence int
}
func (a *Agent) SetAgentStats(charData *CharacterXML) {
a.Strength = charData.Strength
a.Wisdom = charData.Wisdom
a.Inteligence = charData.Inteligence
a.Dexterity = charData.Dexterity
a.Charisma = charData.Charisma
a.Constitution = charData.Constitution
a.currentHP = charData.HP
a.MaxHitPoints = charData.HP
a.Name = charData.Name
a.RoomIN = charData.RoomIN
a.Level = charData.Level
}
func (a *Agent) GetLevel() int {
return a.Level
}
func (a *Agent) incrementLevel() {
a.Level++
}
func (a *Agent) incrementAttack() {
a.Attack++
}
func (a *Agent) incrementDefense() {
a.Defense++
}