]> jfr.im git - irc/gameservirc.git/blame_incremental - gameserv/level.cpp
Finally got level.h/cpp compiling into the project... beginning to store
[irc/gameservirc.git] / gameserv / level.cpp
... / ...
CommitLineData
1#include "level.h"
2
3Level::Level()
4{
5 strength.high = 0;
6 strength.low = 0;
7
8 gold.high = 0;
9 gold.low = 0;
10
11 exp.high = 0;
12 exp.low = 0;
13
14 hp.high = 0;
15 hp.low = 0;
16}
17
18void Level::setStrength(range &s)
19{
20 strength.high = s.high;
21 strength.low = s.low;
22}
23
24void Level::setGold(range &g)
25{
26 gold.high = g.high;
27 gold.low = g.low;
28}
29
30void Level::setExp(range &e)
31{
32 exp.high = e.high;
33 exp.low = e.low;
34}
35
36void Level::setHP(range &h)
37{
38 hp.high = h.high;
39 hp.low = h.low;
40}
41
42Monster Level::randomMonster()
43{
44 Monster temp(monsters.random());
45 temp.strength = strength.random();
46 temp.gold = gold.random();
47 temp.exp = exp.random();
48 temp.hp = hp.random();
49 temp.maxhp = temp.hp;
50 return temp;
51}