//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
PowerUp::PowerUp(const lisp::Lisp& lisp)
{
lisp.get("x", bbox.p1.x);
lisp.get("y", bbox.p1.y);
PowerUp::PowerUp(const lisp::Lisp& lisp)
{
lisp.get("x", bbox.p1.x);
lisp.get("y", bbox.p1.y);
lisp.get("script", script);
no_physics = false;
lisp.get("disable-physics", no_physics);
lisp.get("script", script);
no_physics = false;
lisp.get("disable-physics", no_physics);
- ScriptInterpreter::add_script_object(Sector::current(), "powerup-script",
- script);
+ std::istringstream stream(script);
+ Sector::current()->run_script(stream, "powerup-script");
sound_manager->play("sounds/grow.wav");
} else if (sprite_name == "images/powerups/fireflower/fireflower.sprite") {
sound_manager->play("sounds/grow.wav");
} else if (sprite_name == "images/powerups/fireflower/fireflower.sprite") {
sound_manager->play("sounds/fire-flower.wav");
} else if (sprite_name == "images/powerups/star/star.sprite") {
player->make_invincible();
} else if (sprite_name == "images/powerups/1up/1up.sprite") {
sound_manager->play("sounds/fire-flower.wav");
} else if (sprite_name == "images/powerups/star/star.sprite") {
player->make_invincible();
} else if (sprite_name == "images/powerups/1up/1up.sprite") {