// $Id$
-//
+//
// SuperTux
-// Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// 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.
-//
+//
// 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.
+
#include <config.h>
#include "block.hpp"
-#include "msg.hpp"
+#include "log.hpp"
#include <stdexcept>
case 4: contents = CONTENT_1UP; break;
case 5: contents = CONTENT_ICEGROW; break;
default:
- msg_warning << "Invalid box contents" << std::endl;
+ log_warning << "Invalid box contents" << std::endl;
contents = CONTENT_COIN;
break;
}
} else if(contentstring == "custom") {
contents = CONTENT_CUSTOM;
} else {
- msg_warning << "Invalid box contents '" << contentstring << "'" << std::endl;
+ log_warning << "Invalid box contents '" << contentstring << "'" << std::endl;
}
} else {
if(contents == CONTENT_CUSTOM) {
throw std::runtime_error(
"Only MovingObjects are allowed inside BonusBlocks");
} else {
- msg_warning << "Invalid element '" << token << "' in bonusblock" << std::endl;
+ log_warning << "Invalid element '" << token << "' in bonusblock" << std::endl;
}
}
}
void
BonusBlock::try_open()
{
- if(sprite->get_action_name() == "empty") {
+ if(sprite->get_action() == "empty") {
sound_manager->play("sounds/brick.wav");
return;
}
switch(contents) {
case CONTENT_COIN:
Sector::current()->add_object(new BouncyCoin(get_pos()));
- player.get_status()->incCoins();
+ player.get_status()->add_coins(1);
break;
case CONTENT_FIREGROW:
void
Brick::hit(Player& )
{
- if(sprite->get_action_name() == "empty")
+ if(sprite->get_action() == "empty")
return;
try_break(true);
void
Brick::try_break(bool playerhit)
{
- if(sprite->get_action_name() == "empty")
+ if(sprite->get_action() == "empty")
return;
sound_manager->play("sounds/brick.wav");
if(coin_counter > 0) {
sector->add_object(new BouncyCoin(get_pos()));
coin_counter--;
- player.get_status()->incCoins();
+ player.get_status()->add_coins(1);
if(coin_counter == 0)
sprite->set_action("empty");
start_bounce();