src/weapon/weapon_cfg.cpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  *  Wormux is a convivial mass murder game.
00003  *  Copyright (C) 2001-2004 Lawrence Azzoug.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00018  ******************************************************************************
00019  * Base classes for weapons configuration.
00020  *****************************************************************************/
00021 
00022 #include "weapon_cfg.h"
00023 #include <iostream>
00024 //-----------------------------------------------------------------------------
00025 
00026 void EmptyWeaponConfig::LoadXml(xmlpp::Element *elem) 
00027 {}
00028 
00029 //-----------------------------------------------------------------------------
00030 
00031 WeaponConfig::WeaponConfig() 
00032 { damage = 10; }
00033 
00034 void WeaponConfig::LoadXml(xmlpp::Element *elem) 
00035 {
00036   XmlReader::ReadUint(elem, "damage", damage);  
00037 }
00038 
00039 //-----------------------------------------------------------------------------
00040 
00041 ExplosiveWeaponConfig::ExplosiveWeaponConfig()
00042 {
00043   timeout = 0; 
00044   allow_change_timeout = false;
00045   explosion_range = 0 ;
00046   particle_range = explosion_range;
00047   blast_range = 0 ;
00048   blast_force = 0 ;
00049 }
00050 
00051 void ExplosiveWeaponConfig::LoadXml(xmlpp::Element *elem) 
00052 {
00053   WeaponConfig::LoadXml (elem);
00054   XmlReader::ReadUint(elem, "timeout", timeout);
00055   XmlReader::ReadBool(elem, "allow_change_timeout", allow_change_timeout);
00056   XmlReader::ReadUint(elem, "explosion_range", explosion_range);
00057   XmlReader::ReadUint(elem, "particle_range", particle_range);
00058   XmlReader::ReadDouble(elem, "blast_range", blast_range);
00059   XmlReader::ReadDouble(elem, "blast_force", blast_force);
00060 }
00061 
00062 //-----------------------------------------------------------------------------
00063 
00064 // timeout before explosion
00065 // max_strength
00066 // min_angle, max_angle
00067 // coeff rebond ?
00068 // nb_replay
00069 // can_change_weapon
00070 // force, longueur (baseball)
00071 // nbr_obus

Generated on Mon Jan 1 13:11:00 2007 for Wormux by  doxygen 1.4.7