-
Notifications
You must be signed in to change notification settings - Fork 1
/
UndeadMonster.cpp
152 lines (114 loc) · 3.31 KB
/
UndeadMonster.cpp
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// --------------------------------------------------------------------------------------------------------------------------------
// DEMISERL
// Copyright 2014 Corremn
//
// $LastChangedBy$
// $LastChangedDate$
// $LastChangedRevision$
// $HeadURL: $
// --------------------------------------------------------------------------------------------------------------------------------
#include "UndeadMonster.h"
#include "numbergenerator.h"
using namespace Random;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
UndeadMonster::UndeadMonster() :Monster()
{
}
UndeadMonster::~UndeadMonster()
{
}
int UndeadMonster::Create(int subtype, int level)
{
type = 1; //mUndead;
SetResistance(bPoison, 10);
SetResistance(bFire, -5);
SetResistance(bLightning, -5);
undead = 1;
switch (subtype)
{
case skeleton: return createSkeleton();
case zombie: return createZombie();
case ghoul: return createGhoul();
case vampire: return createVampire();
default: throw std::exception("Invalid undead type passed into monster creator"); break;
}
return 0;
}
int UndeadMonster::createSkeleton()
{
symbol = 'z';
name = ("skeleton");
setDescription("A walking skeleton brought back to life to guard the inner mountain. ");
setColor(230, 230, 230);
stamina = 5 + getInt(3, 1);
skill = 7 + getInt(3, 1);
luck = 6 + getInt(7, 1);
sight_range = 6;
max_stamina = stamina;
humanoid = true;
experience = 5;
return 1;
}
int UndeadMonster::createZombie()
{
symbol = 'z';
name = ("shambling zombie");
setDescription("This poor soul has be returned from death to do its masters bidding. ");
setColor(134, 85, 70);
stamina = 6 + getInt(3, 1);
skill = 8 + getInt(3, 1);
luck = 6 + getInt(3, 1);
sight_range = 5;
max_stamina = stamina;
humanoid = true;
SetResistance(bFrost, 5);
experience = 8;
return 1;
}
int UndeadMonster::createGhoul()
{
symbol = 'c';
name = ("rotting ghoul");
setDescription("A rotting corpse, no wait its moving and coming straight towards you. ");
SetBrand(bParalysis, 2);
setColor(128, 128, 128);
stamina = 7 + getInt(3, 1);
skill = 8 + getInt(3, 1);
luck = 7 + getInt(3, 1);
sight_range = 5;
max_stamina = stamina;
humanoid = true;
experience = 10;
SetResistance(bFrost, 5);
return 1;
}
int UndeadMonster::createVampire()
{
symbol = 'V';
stamina = 8 + getInt(3, 1);
skill = 10 + getInt(3, 1);
luck = 8 + getInt(3, 1);
if (Random::getInt(2, 0))
{
name = ("big scary vampire");
setDescription("This gig and scary vampire is big and scary. ");
setColor(100, 100, 200);
experience = 15;
}
else
{
name = ("vampire");
setDescription("A vampire with hypnotic eyes. ");
skill--;
setColor(100, 100, 140);
experience = 13;
}
SetBrand(bConfusion, 2);
sight_range = 5;
max_stamina = stamina;
humanoid = true;
SetResistance(bFrost, 5);
return 1;
}