⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 monster.h

📁 S.C.O.U.R.G.E.是一款类似Rogue的游戏
💻 H
字号:
/***************************************************************************                          monster.h  -  description                             -------------------    begin                : Mon Jul 7 2003    copyright            : (C) 2003 by Gabor Torok    email                : cctorok@yahoo.com ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#ifndef MONSTER_H#define MONSTER_H#include <vector>#include <map>#include "../constants.h"#include "rpgitem.h"#include "spell.h"/**  *@author Gabor Torok  */using namespace std;  class Monster  { private:  char *type;  int hp;  int mp;  int level;  char *model_name;  char *skin_name;  char description[300];  int money;  int speed;  int baseArmor;  int rareness;  float scale;  int w;  int d;  int h;  vector<RpgItem*> items;  vector<Spell*> spells;  static map<int, vector<Monster*>* > monsters;  static map<string, Monster*> monstersByName;public:  Monster(char *type, int level, int hp, int mp, char *model, char *skin, int rareness, int baseArmor, float scale, int w, int d, int h);  ~Monster();  inline float getScale() { return scale; }  inline int getWidth() { return w; }  inline int getDepth() { return d; }  inline int getHeight() { return h; }  inline int getBaseArmor() { return baseArmor; }  inline int getRareness() { return rareness; }  inline char *getType() { return type; };  inline int getHp() { return hp; }    inline int getMp() { return mp; }    inline int getLevel() { return level; }    inline char *getModelName() { return model_name; }  inline char *getSkinName() { return skin_name; }  inline char *getDescription() { return description; }  inline int getSpeed() { return speed; }  inline int getStartingItemCount() { return items.size(); }  inline RpgItem *getStartingItem(int index) { return items[index]; }  inline void addItem(RpgItem *item) { items.push_back(item); }  inline int getStartingSpellCount() { return spells.size(); }  inline Spell *getStartingSpell(int index) { return spells[index]; }  inline void addSpell(Spell *spell) { spells.push_back(spell); }  static void initMonsters();  static Monster *getRandomMonster(int level);  static Monster *getMonsterByName(char *name); protected:  inline void setSpeed(int speed) { this->speed = speed; }};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -