]>
Commit | Line | Data |
---|---|---|
e99a4410 | 1 | #include "level.h" |
2 | ||
42106907 | 3 | Level::Level() |
e99a4410 | 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 | ||
42106907 | 18 | void Level::setStrength(range &s) |
e99a4410 | 19 | { |
20 | strength.high = s.high; | |
21 | strength.low = s.low; | |
22 | } | |
23 | ||
42106907 | 24 | void Level::setGold(range &g) |
e99a4410 | 25 | { |
26 | gold.high = g.high; | |
27 | gold.low = g.low; | |
28 | } | |
29 | ||
42106907 | 30 | void Level::setExp(range &e) |
e99a4410 | 31 | { |
32 | exp.high = e.high; | |
33 | exp.low = e.low; | |
34 | } | |
35 | ||
42106907 | 36 | void Level::setHP(range &h) |
e99a4410 | 37 | { |
38 | hp.high = h.high; | |
39 | hp.low = h.low; | |
40 | } | |
42106907 | 41 | |
42 | Monster 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 | } |