1 /* 2 This file is part of "Avanor, the Land of Mystery" roguelike game 3 Home page: http://www.avanor.com/ 4 Copyright (C) 2000-2003 Vadim Gaidukevich 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 */ 20 21 #ifndef __ITEM_MISC_H 22 #define __ITEM_MISC_H 23 24 #include "xanyfood.h" 25 26 class XBatWing : public XAnyFood 27 { 28 public: 29 DECLARE_CREATOR(XBatWing, XAnyFood); XBatWing()30 XBatWing() 31 { 32 color = xBROWN; 33 it = IT_BATWING; 34 food_nutrio = 10; 35 consume_nutrio = 10; 36 strcpy(name, "bat wing"); 37 value = 100; 38 weight = 2; 39 40 } XBatWing(XBatWing * copy)41 XBatWing(XBatWing * copy) : XAnyFood(copy) {} MakeCopy()42 virtual XObject * MakeCopy() {return new XBatWing(this);} 43 }; 44 45 46 class XRatTail : public XAnyFood 47 { 48 public: 49 DECLARE_CREATOR(XRatTail, XAnyFood); XRatTail()50 XRatTail() 51 { 52 color = xBROWN; 53 it = IT_RATTAIL; 54 food_nutrio = 10; 55 consume_nutrio = 10; 56 strcpy(name, "rat tail"); 57 value = 100; 58 weight = 3; 59 60 } XRatTail(XRatTail * copy)61 XRatTail(XRatTail * copy) : XAnyFood(copy) {} MakeCopy()62 virtual XObject * MakeCopy() {return new XRatTail(this);} 63 }; 64 65 66 class XBone : public XAnyFood 67 { 68 public: 69 DECLARE_CREATOR(XBone, XAnyFood); XBone()70 XBone() 71 { 72 color = xWHITE; 73 it = IT_BONE; 74 food_nutrio = 10; 75 consume_nutrio = 10; 76 strcpy(name, "bone"); 77 value = 1; 78 weight = 5; 79 } XBone(XBone * copy)80 XBone(XBone * copy) : XAnyFood(copy) {} MakeCopy()81 virtual XObject * MakeCopy() {return new XBone(this);} 82 }; 83 84 85 class XChest : public XItem 86 { 87 public: 88 XItemList contain; 89 DECLARE_CREATOR(XChest, XItem); 90 XChest(int item_count, ITEM_MASK imask, int low_v, int high_v); XChest(XChest * copy)91 XChest(XChest * copy) {assert(0);} Compare(XObject * o)92 int Compare(XObject * o) {return -1;} MakeCopy()93 virtual XObject * MakeCopy() {return new XChest(this);} 94 int Add(XItem * item); 95 virtual void toString(char * buf); 96 virtual void Store(XFile * f); 97 virtual void Restore(XFile * f); 98 }; 99 100 101 class XAncientMachinePart : public XItem 102 { 103 public: 104 DECLARE_CREATOR(XAncientMachinePart, XItem); XAncientMachinePart()105 XAncientMachinePart() 106 { 107 color = xDARKGRAY; 108 view = ']'; 109 strcpy(name, "ancient machine part"); 110 value = 1000; 111 weight = 15; 112 im = IM_TOOL; 113 bp = BP_OTHER; 114 it = IT_ANCIENTMACHINEPART; 115 } XAncientMachinePart(XAncientMachinePart * copy)116 XAncientMachinePart(XAncientMachinePart * copy) : XItem(copy) {} MakeCopy()117 virtual XObject * MakeCopy() {return new XAncientMachinePart(this);} toString(char * buf)118 virtual void toString(char * buf) {GetFullName(buf);} 119 120 }; 121 122 123 #endif 124