00001 /* 00002 * The Mana World 00003 * Copyright (C) 2004 The Mana World Development Team 00004 * 00005 * This file is part of The Mana World. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00022 #ifndef MONSTERINFO_H 00023 #define MONSTERINFO_H 00024 00025 #include "being.h" 00026 00027 #include <list> 00028 #include <map> 00029 #include <string> 00030 #include <vector> 00031 00032 enum MonsterSoundEvent 00033 { 00034 MONSTER_EVENT_HIT, 00035 MONSTER_EVENT_MISS, 00036 MONSTER_EVENT_HURT, 00037 MONSTER_EVENT_DIE 00038 }; 00039 00040 struct MonsterAttack 00041 { 00042 std::string particleEffect; 00043 SpriteAction action; 00044 }; 00045 00052 class MonsterInfo 00053 { 00054 public: 00055 MonsterInfo(); 00056 00057 ~MonsterInfo(); 00058 00059 void setName(const std::string &name) { mName = name; } 00060 00061 void addSprite(const std::string &filename) 00062 { mSprites.push_back(filename); } 00063 00064 void setTargetCursorSize(Being::TargetCursorSize targetCursorSize) 00065 { mTargetCursorSize = targetCursorSize; } 00066 00067 void addSound(MonsterSoundEvent event, const std::string &filename); 00068 00069 void addParticleEffect(const std::string &filename); 00070 00071 const std::string &getName() const 00072 { return mName; } 00073 00074 const std::list<std::string>& getSprites() const 00075 { return mSprites; } 00076 00077 Being::TargetCursorSize getTargetCursorSize() const 00078 { return mTargetCursorSize; } 00079 00080 const std::string &getSound(MonsterSoundEvent event) const; 00081 00082 void addMonsterAttack(int id, 00083 const std::string &particleEffect, 00084 SpriteAction action); 00085 00086 const std::string &getAttackParticleEffect(int attackType) const; 00087 00088 SpriteAction getAttackAction(int attackType) const; 00089 00090 const std::list<std::string>& getParticleEffects() const 00091 { return mParticleEffects; } 00092 00093 private: 00094 std::string mName; 00095 std::list<std::string> mSprites; 00096 Being::TargetCursorSize mTargetCursorSize; 00097 std::map<MonsterSoundEvent, std::vector<std::string>* > mSounds; 00098 std::map<int, MonsterAttack*> mMonsterAttacks; 00099 std::list<std::string> mParticleEffects; 00100 }; 00101 00102 #endif // MONSTERINFO_H