1296 |
CLONEOBJ(Crack); |
CLONEOBJ(Crack); |
1297 |
public: |
public: |
1298 |
Crack() : Item("it-crack"),anim_end(false) |
Crack() : Item("it-crack"),anim_end(false) |
1299 |
{ set_attrib("type", 0.0); |
{ |
1300 |
|
set_attrib("type", 0.0); |
1301 |
|
set_attrib("fixed", 0.0); |
1302 |
} |
} |
1303 |
private: |
private: |
1304 |
bool anim_end; |
bool anim_end; |
1305 |
|
|
1306 |
int get_type() const { return int_attrib("type"); } |
int get_type() const { return int_attrib("type"); } |
1307 |
|
int get_fixed() const { return int_attrib("fixed"); } |
1308 |
|
|
1309 |
void init_model() { |
void init_model() { |
1310 |
if (int t=get_type()) { |
if (int t=get_type()) { |
1331 |
} |
} |
1332 |
} |
} |
1333 |
void actor_enter(Actor *a) { |
void actor_enter(Actor *a) { |
1334 |
|
if (get_fixed()) |
1335 |
|
return; |
1336 |
|
|
1337 |
SendMessage(this, "crack"); |
SendMessage(this, "crack"); |
1338 |
|
|
1339 |
if( get_type() <= 3) { |
if( get_type() <= 3) { |
1388 |
return false; |
return false; |
1389 |
} |
} |
1390 |
void message(const string &msg, const Value &val) { |
void message(const string &msg, const Value &val) { |
1391 |
if (msg == "crack") { |
if ((msg == "crack") && (get_fixed() == 0)) { |
1392 |
set_attrib("type", Value(int_attrib("type") + 1)); |
set_attrib("type", Value(int_attrib("type") + 1)); |
1393 |
play_sound("crack"); |
play_sound("crack"); |
1394 |
init_model(); |
init_model(); |