220 |
|
|
221 |
|
|
222 |
//---------------------------------------- |
//---------------------------------------- |
223 |
|
// Killerball |
224 |
|
//---------------------------------------- |
225 |
|
namespace |
226 |
|
{ |
227 |
|
class Killerball : public Actor { |
228 |
|
CLONEACTOR(Killerball); |
229 |
|
public: |
230 |
|
|
231 |
|
Killerball() : Actor ("ac-killerball", V2()) { |
232 |
|
world::ActorInfo *ai = get_actorinfo(); |
233 |
|
ai->radius = 13/64.0; |
234 |
|
ai->mass = 0.7; |
235 |
|
} |
236 |
|
bool is_dead() { return false; } |
237 |
|
|
238 |
|
void on_hit(Actor *a) { |
239 |
|
SendMessage(a, "shatter"); |
240 |
|
} |
241 |
|
}; |
242 |
|
} |
243 |
|
|
244 |
|
|
245 |
|
//---------------------------------------- |
246 |
// CannonBall |
// CannonBall |
247 |
//---------------------------------------- |
//---------------------------------------- |
248 |
namespace |
namespace |
670 |
set_attrib("mouseforce", Value(true)); |
set_attrib("mouseforce", Value(true)); |
671 |
set_attrib("color", Value(0.0)); |
set_attrib("color", Value(0.0)); |
672 |
set_attrib("blackball", Value(true)); |
set_attrib("blackball", Value(true)); |
673 |
|
set_attrib("player", Value(0.0)); |
674 |
|
set_attrib("controllers", Value(1.0)); |
675 |
} |
} |
676 |
}; |
}; |
677 |
|
|
683 |
set_attrib("mouseforce", Value(true)); |
set_attrib("mouseforce", Value(true)); |
684 |
set_attrib("color", Value(1.0)); |
set_attrib("color", Value(1.0)); |
685 |
set_attrib("whiteball", Value(true)); |
set_attrib("whiteball", Value(true)); |
686 |
|
set_attrib("player", Value(1.0)); |
687 |
|
set_attrib("controllers", Value(2.0)); |
688 |
} |
} |
689 |
}; |
}; |
690 |
|
|
696 |
set_attrib("mouseforce", Value(true)); |
set_attrib("mouseforce", Value(true)); |
697 |
set_attrib("color", Value(1.0)); |
set_attrib("color", Value(1.0)); |
698 |
set_attrib("whiteball", Value(true)); |
set_attrib("whiteball", Value(true)); |
699 |
|
set_attrib("controllers", Value(3.0)); |
700 |
} |
} |
701 |
|
|
702 |
void on_hit(Actor *a) { |
void on_hit(Actor *a) { |
703 |
if (dynamic_cast<BlackBall*>(a) && |
if (dynamic_cast<BlackBall*>(a) && |
704 |
int_attrib("mouseforce") != 0) // passive small whiteball do not shatter (see PerOxyd Linkgame #60) |
int_attrib("mouseforce") != 0) |
705 |
|
// passive small whiteball do not shatter (see PerOxyd Linkgame #60) |
706 |
{ |
{ |
707 |
// collision between WhiteBall_Small and blackball shatters blackball |
// collision between WhiteBall_Small and blackball shatters blackball |
708 |
SendMessage(a, "shatter"); |
SendMessage(a, "shatter"); |