20 |
#include "stones.hh" |
#include "stones.hh" |
21 |
#include "objects.hh" |
#include "objects.hh" |
22 |
#include "object_mixins.hh" |
#include "object_mixins.hh" |
23 |
|
#include "game.hh" |
24 |
|
#include "world.hh" |
25 |
|
|
26 |
using namespace std; |
using namespace std; |
27 |
using namespace world; |
using namespace world; |
30 |
//---------------------------------------- |
//---------------------------------------- |
31 |
// EasyModeStone |
// EasyModeStone |
32 |
// |
// |
|
// |
|
33 |
// I'm not quite sure what this one is supposed to do, but a stone |
// I'm not quite sure what this one is supposed to do, but a stone |
34 |
// like this appears in all Per.Oxyd landscapes that look different in |
// like this appears in all Per.Oxyd landscapes that look different in |
35 |
// easy mode. For now, this stone simply does nothing. |
// easy mode. For now, this stone simply does nothing. |
41 |
public: |
public: |
42 |
EasyModeStone() : Stone("st-easymode") {} |
EasyModeStone() : Stone("st-easymode") {} |
43 |
|
|
44 |
|
void on_creation() { |
45 |
|
if (enigma::Difficulty == DIFFICULTY_EASY) { |
46 |
|
SetFloor (get_pos(), MakeFloor ("fl-normal")); |
47 |
|
} else { |
48 |
|
KillItem (get_pos()); |
49 |
|
} |
50 |
|
KillStone (get_pos()); |
51 |
|
} |
52 |
|
|
53 |
StoneResponse collision_response(const StoneContact &sc) { |
StoneResponse collision_response(const StoneContact &sc) { |
54 |
return STONE_PASS; |
return STONE_PASS; |
55 |
} |
} |
106 |
}; |
}; |
107 |
} |
} |
108 |
|
|
109 |
|
|
110 |
|
//---------------------------------------- |
111 |
|
// Grate3 |
112 |
|
// |
113 |
|
// Horses and small marbles can move through this stone, but normal |
114 |
|
// marbles can't. |
115 |
|
//---------------------------------------- |
116 |
|
namespace |
117 |
|
{ |
118 |
|
class Grate3 : public Stone { |
119 |
|
SINGLETONOBJ(Grate3); |
120 |
|
public: |
121 |
|
Grate3() : Stone("st-grate3") {} |
122 |
|
|
123 |
|
StoneResponse collision_response(const StoneContact &sc) { |
124 |
|
string actorkind = sc.actor->get_kind(); |
125 |
|
if (actorkind == "ac-horse" || actorkind == "ac-whiteball-small") |
126 |
|
return STONE_PASS; |
127 |
|
else |
128 |
|
return STONE_REBOUND; |
129 |
|
} |
130 |
|
}; |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
void stones::Init() |
void stones::Init() |
135 |
{ |
{ |
136 |
Register (new EasyModeStone); |
Register (new EasyModeStone); |
137 |
|
Register (new Grate3); |
138 |
Register (new RotatorStone (true)); |
Register (new RotatorStone (true)); |
139 |
Register (new RotatorStone (false)); |
Register (new RotatorStone (false)); |
140 |
} |
} |