1 /* Battle Tanks Game 2 * Copyright (C) 2006-2009 Battle Tanks team 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 /* 20 * Additional rights can be granted beyond the GNU General Public License 21 * on the terms provided in the Exception. If you modify this file, 22 * you may extend this exception to your version of the file, 23 * but you are not obligated to do so. If you do not wish to provide this 24 * exception without modification, you must delete this exception statement 25 * from your version and license this file solely under the GPL without exception. 26 */ 27 28 #include "object.h" 29 #include "registrar.h" 30 #include "team.h" 31 32 class CTFBase : public Object { 33 public: tick(const float dt)34 void tick(const float dt) { 35 Object::tick(dt); 36 } 37 CTFBase()38 CTFBase() : Object("ctf-base") { 39 impassability = 0; 40 hp = -1; 41 set_directions_number(1); 42 pierceable = true; 43 } 44 clone() const45 virtual Object * clone() const { return new CTFBase(*this); } 46 on_spawn()47 void on_spawn() { 48 play("main", true); 49 spawn("ctf-flag", mrt::format_string("ctf-flag-%s", Team::get_color(Team::get_team(this)))); 50 } 51 52 private: 53 }; 54 55 REGISTER_OBJECT("ctf-base", CTFBase, ()); 56