}
void
+BadGuy::run_dead_script()
+{
+ if (countMe) Sector::current()->get_level()->stats.badguys++;
+
+ // start dead-script
+ if(dead_script != "") {
+ std::istringstream stream(dead_script);
+ Sector::current()->run_script(stream, "dead-script");
+ }
+}
+
+void
BadGuy::set_state(State state)
{
if(this->state == state)
* screen (his sprite is turned upside-down)
*/
virtual void kill_fall();
+
+ /** Call this, if you use custom kill_fall() or kill_squashed(GameObject& object) */
+ virtual void run_dead_script();
/** Writes out the badguy into the included lisp::Writer. Useful e.g. when
* converting an old-format level to the new format.
Bomb* bomb = new Bomb(get_pos(), dir, sprite_name );
Sector::current()->add_object(bomb);
bomb->explode();
+
+ run_dead_script();
}
void