418 |
} |
} |
419 |
|
|
420 |
//---------------------------------------- |
//---------------------------------------- |
421 |
|
// Springboard |
422 |
|
//---------------------------------------- |
423 |
|
namespace |
424 |
|
{ |
425 |
|
class Springboard : public Item { |
426 |
|
CLONEOBJ(Springboard); |
427 |
|
public: |
428 |
|
Springboard() : Item("it-springboard") {} |
429 |
|
|
430 |
|
bool actor_hit(Actor *a) { |
431 |
|
const double ITEM_RADIUS = 0.3; |
432 |
|
px::V2 item_center(get_pos().x + 0.5, get_pos().y + 0.5); |
433 |
|
double dist = length(a->get_pos()-item_center); |
434 |
|
if (dist < ITEM_RADIUS) { |
435 |
|
set_anim("it-springboard_anim"); |
436 |
|
SendMessage(a, "jump"); |
437 |
|
} |
438 |
|
return false; |
439 |
|
} |
440 |
|
|
441 |
|
void animcb() { |
442 |
|
set_model("it-springboard"); |
443 |
|
} |
444 |
|
}; |
445 |
|
} |
446 |
|
|
447 |
|
|
448 |
|
//---------------------------------------- |
449 |
// Explosion |
// Explosion |
450 |
//---------------------------------------- |
//---------------------------------------- |
451 |
namespace |
namespace |
1180 |
void actor_enter(Actor *a) { |
void actor_enter(Actor *a) { |
1181 |
SendMessage(this, "crack"); |
SendMessage(this, "crack"); |
1182 |
|
|
1183 |
if( get_type() < 3) { |
if( get_type() <= 3) { |
1184 |
Item *it; |
Item *it; |
1185 |
GridPos p; |
GridPos p; |
1186 |
|
|
1233 |
} |
} |
1234 |
void message(const string &msg, const Value &val) { |
void message(const string &msg, const Value &val) { |
1235 |
if (msg == "crack") { |
if (msg == "crack") { |
1236 |
set_attrib("type", Value(int_attrib("type") + 1)); |
set_attrib("type", Value(int_attrib("type") + 1)); |
1237 |
|
play_sound("crack"); |
1238 |
init_model(); |
init_model(); |
1239 |
} |
} |
1240 |
} |
} |
1312 |
Register(new Spade); |
Register(new Spade); |
1313 |
Register(new Spring1); |
Register(new Spring1); |
1314 |
Register(new Spring2); |
Register(new Spring2); |
1315 |
|
Register(new Springboard); |
1316 |
Register(new Sword); |
Register(new Sword); |
1317 |
Register(new TinyHill); |
Register(new TinyHill); |
1318 |
Register(new TinyHollow); |
Register(new TinyHollow); |