442 |
px::V2 item_center(get_pos().x + 0.5, get_pos().y + 0.5); |
px::V2 item_center(get_pos().x + 0.5, get_pos().y + 0.5); |
443 |
double dist = length(a->get_pos()-item_center); |
double dist = length(a->get_pos()-item_center); |
444 |
if (dist < ITEM_RADIUS) { |
if (dist < ITEM_RADIUS) { |
445 |
set_anim("it-springboard_anim"); |
set_anim("it-springboard_anim"); |
446 |
SendMessage(a, "jump"); |
SendMessage(a, "jump"); |
447 |
} |
} |
448 |
return false; |
return false; |
961 |
void |
void |
962 |
ShogunDot::stone_change(Stone *st) |
ShogunDot::stone_change(Stone *st) |
963 |
{ |
{ |
964 |
if (activated && st == 0) { |
if (activated) { |
965 |
assert(0); // no proper message was sent to ShogunDot |
assert(st != 0); // if fails : ShogunStone disappeared w/o sending proper message to ShogunDot |
966 |
|
} |
967 |
|
else { |
968 |
|
if (st) { // some Stone on inactive ShogunDot |
969 |
|
SendMessage(st, "renotify"); // ask stone to notify me (again) |
970 |
|
|
971 |
|
// if ShogunDot was set _after_ ShogunStone during level startup, |
972 |
|
// the ShogunDot does not get activated. |
973 |
|
} |
974 |
} |
} |
975 |
} |
} |
976 |
|
|
1285 |
class Crack : public Item { |
class Crack : public Item { |
1286 |
CLONEOBJ(Crack); |
CLONEOBJ(Crack); |
1287 |
public: |
public: |
1288 |
Crack() : Item("it-crack"),anim_end(false) |
Crack() : Item("it-crack"),anim_end(false) |
1289 |
{ set_attrib("type", 0.0); |
{ set_attrib("type", 0.0); |
1290 |
} |
} |
1291 |
private: |
private: |
1292 |
bool anim_end; |
bool anim_end; |
1293 |
|
|
1294 |
int get_type() const { return int_attrib("type"); } |
int get_type() const { return int_attrib("type"); } |
1295 |
|
|
1296 |
void init_model() { |
void init_model() { |
1297 |
if (int t=get_type()) { |
if (int t=get_type()) { |
1298 |
if( t > 3) |
if( t > 3) |
1299 |
set_anim("it-crack_anim1"); |
set_anim("it-crack_anim1"); |
1300 |
//SetItem(get_pos(), MakeItem("it-debris")); |
//SetItem(get_pos(), MakeItem("it-debris")); |
1301 |
else { |
else { |
1302 |
char modelname[20]; |
char modelname[20]; |
1323 |
if( get_type() <= 3) { |
if( get_type() <= 3) { |
1324 |
Item *it; |
Item *it; |
1325 |
GridPos p; |
GridPos p; |
1326 |
|
|
1327 |
p = move(get_pos(),enigma::NORTH); |
p = move(get_pos(),enigma::NORTH); |
1328 |
it = GetItem(p); |
it = GetItem(p); |
1329 |
|
|
1330 |
if( it) |
if( it) |
1331 |
SendMessage( it, "crack"); |
SendMessage( it, "crack"); |
1332 |
else { |
else { |
1334 |
if( fl->get_kind() != "fl-abyss") |
if( fl->get_kind() != "fl-abyss") |
1335 |
SetItem(p, MakeItem("it-crack")); |
SetItem(p, MakeItem("it-crack")); |
1336 |
} |
} |
1337 |
|
|
1338 |
p = move(get_pos(),enigma::EAST); |
p = move(get_pos(),enigma::EAST); |
1339 |
it = GetItem(p); |
it = GetItem(p); |
1340 |
if( it) |
if( it) |
1344 |
if( fl->get_kind() != "fl-abyss") |
if( fl->get_kind() != "fl-abyss") |
1345 |
SetItem(p, MakeItem("it-crack")); |
SetItem(p, MakeItem("it-crack")); |
1346 |
} |
} |
1347 |
|
|
1348 |
p = move(get_pos(),enigma::SOUTH); |
p = move(get_pos(),enigma::SOUTH); |
1349 |
it = GetItem(p); |
it = GetItem(p); |
1350 |
if( it) |
if( it) |
1354 |
if( fl->get_kind() != "fl-abyss") |
if( fl->get_kind() != "fl-abyss") |
1355 |
SetItem(p, MakeItem("it-crack")); |
SetItem(p, MakeItem("it-crack")); |
1356 |
} |
} |
1357 |
|
|
1358 |
p = move(get_pos(),enigma::WEST); |
p = move(get_pos(),enigma::WEST); |
1359 |
it = GetItem(p); |
it = GetItem(p); |
1360 |
if( it) |
if( it) |
1430 |
public: |
public: |
1431 |
Rubberband() : Item ("it-rubberband") {} |
Rubberband() : Item ("it-rubberband") {} |
1432 |
}; |
}; |
1433 |
|
|
1434 |
} |
} |
1435 |
|
|
1436 |
|
|