1 /**
2  ** npcdollinf.h - NPC Paperdoll information from 'paperdol_info.txt'.
3  **
4  ** Written: 06/01/2008 - Marzo
5  **/
6 
7 #ifndef INCL_NPCDOLLINF_H
8 #define INCL_NPCDOLLINF_H   1
9 
10 /*
11 Copyright (C) 2008 The Exult Team
12 
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License
15 as published by the Free Software Foundation; either version 2
16 of the License, or (at your option) any later version.
17 
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 GNU General Public License for more details.
22 
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26 */
27 
28 #include "baseinf.h"
29 #include "exult_constants.h"
30 
31 #include <iosfwd>
32 
33 class Shape_info;
34 class Paperdoll_npc_functor;
35 
36 /*
37  *  Information about an NPC's paperdoll.
38  */
39 class Paperdoll_npc : public Base_info {
40 	bool        is_female;          // Is the NPC Female (or more specifically not male)
41 	bool        translucent;        // If the paperdoll should be drawn translucently or not
42 
43 	// Body info
44 	short       body_shape;         // Body Shape
45 	short       body_frame;         // Body Frame
46 
47 	short       head_shape;         // Head Shape
48 	short       head_frame;         // Normal Head Frame
49 	short       head_frame_helm;    // Frame when wearing a helm
50 
51 	short       arms_shape;         // Shape for Arms
52 	short       arms_frame[3];      // Frames for arms.
53 public:
54 	friend class Shape_info;
55 	friend class Paperdoll_npc_functor;
56 	// Read in from file.
57 	bool read(std::istream &in, int version, Exult_Game game);
58 	// Write out.
59 	void write(std::ostream &out, int shapenum, Exult_Game game);
60 
is_npc_female()61 	bool is_npc_female() const {
62 		return is_female;
63 	}
set_is_female(bool tf)64 	void set_is_female(bool tf) {
65 		if (is_female != tf) {
66 			set_modified(true);
67 			is_female = tf;
68 		}
69 	}
is_translucent()70 	bool is_translucent() const {
71 		return translucent;
72 	}
set_translucent(bool tf)73 	void set_translucent(bool tf) {
74 		if (translucent != tf) {
75 			set_modified(true);
76 			translucent = tf;
77 		}
78 	}
get_body_shape()79 	int get_body_shape() const {
80 		return body_shape;
81 	}
set_body_shape(short s)82 	void set_body_shape(short s) {
83 		if (body_shape != s) {
84 			set_modified(true);
85 			body_shape = s;
86 		}
87 	}
get_body_frame()88 	int get_body_frame() const {
89 		return body_frame;
90 	}
set_body_frame(short s)91 	void set_body_frame(short s) {
92 		if (body_frame != s) {
93 			set_modified(true);
94 			body_frame = s;
95 		}
96 	}
get_head_shape()97 	int get_head_shape() const {
98 		return head_shape;
99 	}
set_head_shape(short s)100 	void set_head_shape(short s) {
101 		if (head_shape != s) {
102 			set_modified(true);
103 			head_shape = s;
104 		}
105 	}
get_head_frame()106 	int get_head_frame() const {
107 		return head_frame;
108 	}
set_head_frame(short s)109 	void set_head_frame(short s) {
110 		if (head_frame != s) {
111 			set_modified(true);
112 			head_frame = s;
113 		}
114 	}
get_head_frame_helm()115 	int get_head_frame_helm() const {
116 		return head_frame_helm;
117 	}
set_head_frame_helm(short s)118 	void set_head_frame_helm(short s) {
119 		if (head_frame_helm != s) {
120 			set_modified(true);
121 			head_frame_helm = s;
122 		}
123 	}
get_arms_shape()124 	int get_arms_shape() const {
125 		return arms_shape;
126 	}
set_arms_shape(short s)127 	void set_arms_shape(short s) {
128 		if (arms_shape != s) {
129 			set_modified(true);
130 			arms_shape = s;
131 		}
132 	}
get_arms_frame(int type)133 	int get_arms_frame(int type) const {
134 		return arms_frame[type];
135 	}
set_arms_frame(int type,short s)136 	void set_arms_frame(int type, short s) {
137 		if (arms_frame[type] != s) {
138 			set_modified(true);
139 			arms_frame[type] = s;
140 		}
141 	}
set_arms_frames(short a0,short a1,short a2)142 	void set_arms_frames(short a0, short a1, short a2) {
143 		set_arms_frame(0, a0);
144 		set_arms_frame(1, a1);
145 		set_arms_frame(2, a2);
146 	}
get_info_flag()147 	static int get_info_flag() {
148 		return 0x80;
149 	}
150 	enum { is_binary = 0, entry_size = 0 };
151 };
152 
153 #endif
154