📄 items.h
字号:
/* BladeMaster 2, a text, rougelike(kinda), arena combat simulation game. Copyright (C) 2002 Blademaster 2 Team, see CREDITS Clone of BladeMaster by Logicom, Inc. Copyright(C) 1990/1993 In no means affliated with the original Blademaster or the original Blademaster creators/programmers. 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. This program is distributed in the hope that it will be useful, 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 Useful contact information: Website: blademaster2.sourceforge.net Project page: www.sf.net/projects/blademaster2/ Project Lead (see CREDITS for other members of the developement team) E-Mail: ilswyn@users.sourceforge.net AIM: ilswyn*/#ifndef ITEMS_H#define ITEMS_H// Virtual Base Class.// getRating can be used for calculating certain things. // Eg. A weapon with a high rating may slow down a fighter // with a low experience levelclass Item{ protected: // Not in use yet: /* int retail; int rating; */ public: // Not in use yet: /* enum Special { POISON, DISEASE, PARALYSIS, A_POISON, A_DISEASE, A_PARALYSIS } = 0; */ virtual const string getName() const = 0; // Not in use yet: /* virtual const int getRetail() const = 0; // Retail value in gp virtual const int getRating() const = 0; // This is used for calculations virtual const Special getSpecial() const = 0; */};//Used for Melee Weapons.class Weapon : virtual public Item{ protected: string weapon_name; int min_damage; int max_damage; //int accuracy; // Not in use public: virtual const string getName() const { return weapon_name; } const int getMinDmg() { return min_damage; } const int getMaxDmg() { return max_damage; } //const int getAccuracy() const ; // Not in use void setWeaponName(string data) { weapon_name = data; } void setMinDmg(int data) { min_damage = data; } void setMaxDmg(int data) { max_damage = data; } int do_attack(ArenaObject*);};class RangeWeapon : public Weapon{ /* enum AmmoType { SLING_BULLET, ARROW }; const AmmoType getAmmoType() const ;*/};class Armor : virtual public Item{ protected: string armor_name; int ac; public: Armor(); ~Armor(); const string getName() const { return armor_name; } const int getAC() { return ac; } void setArmorName(string data) { armor_name = data; } void setArmorClass(int data) { ac = data; }};// No range weapons yet../*class Ammo : virtual public Item{ public: const AmmoType getAmmoType() const;}*/#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -