1 // 2 // nazghul - an old-school RPG engine 3 // Copyright (C) 2002, 2003 Gordon McNutt 4 // 5 // This program is free software; you can redistribute it and/or modify it 6 // under the terms of the GNU General Public License as published by the Free 7 // Software Foundation; either version 2 of the License, or (at your option) 8 // any later version. 9 // 10 // This program is distributed in the hope that it will be useful, but WITHOUT 11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 // more details. 14 // 15 // You should have received a copy of the GNU General Public License along with 16 // this program; if not, write to the Free Foundation, Inc., 59 Temple Place, 17 // Suite 330, Boston, MA 02111-1307 USA 18 // 19 // Gordon McNutt 20 // gmcnutt@users.sourceforge.net 21 // 22 #ifndef occ_h 23 #define occ_h 24 25 #include "list.h" 26 #include "closure.h" 27 28 #define occ_ref(occ) ((occ)->refcount++) 29 30 struct typical_items { 31 int prob; 32 class ObjectType *type; 33 int n_max; 34 }; 35 36 struct occ { 37 struct list list; 38 char *tag; 39 char *name; 40 float magic; 41 42 int hp_mod; /* part of base hp contributed by occupation */ 43 int hp_mult; /* additional hp per-level contributed by occupation */ 44 int mp_mod; /* similar, for mana */ 45 int mp_mult; /* similar, for mana */ 46 47 int hit_mod; /* unused */ 48 int def_mod; /* unused */ 49 int dam_mod; /* unused */ 50 int arm_mod; /* unused */ 51 52 int xpval; /* reward for killing this type */ 53 int refcount; 54 55 struct gob *gob; 56 struct skill_set *skills; 57 }; 58 59 extern struct occ *occ_new(const char *tag, 60 const char *name, 61 float magic, 62 int hp_mod, 63 int hp_mult, 64 int mp_mod, 65 int mp_mult, 66 int hit_mod, 67 int def_mod, 68 int dam_mod, 69 int arm_mod); 70 71 extern void occ_unref(struct occ *occ); 72 extern void occ_set_skills(struct occ *occ, struct skill_set *skills); 73 74 #endif 75