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 #include "uniquei.h"
22 
23 REGISTER_CLASS(XGlamdring);
XGlamdring()24 XGlamdring::XGlamdring() : XWeapon(IT_BROADSWORD)
25 {
26 	strcpy(name, "rune-covered broadsword");
27 	it = IT_BROADSWORD;
28 	view = '|';
29 	weight = 700;
30 	value = 2000;
31 	_DV = 0;
32 	_PV = 0;
33 	_HIT = 12;
34 	dice.Setup(4, 5, 10);
35 	RNG = 0;
36 	if (r)
37 		delete r;
38 	if (s)
39 		delete s;
40 	r = new XResistance("poison:1d1+99 stun:1d1+99 confuse:1d1+99 fire:1d1+99 cold:1d1+99");
41 	s = new XStats("St:1d1+9 Dx:1d1+9 To:1d1+9");
42 	brt = (BRAND_TYPE)(BR_FIRE | BR_COLD | BR_DEMONSLAYER);
43 	special_property = SPP_NONE;
44 }
45 
toString(char * buf)46 void XGlamdring::toString(char * buf)
47 {
48 	GetArtifactName(buf, "broadsword named \"Glamdring\"");
49 }
50 
51 REGISTER_CLASS(XDeathHack);
XDeathHack()52 XDeathHack::XDeathHack() : XWeapon(IT_LONGDAGGER)
53 {
54 	strcpy(name, "rune-covered long dagger");
55 	it = IT_LONGDAGGER;
56 	weight = 70;
57 	value = 500;
58 	_DV = 0;
59 	_PV = 0;
60 	_HIT = 6;
61 	dice.Setup(2, 3, 12);
62 	RNG = 0;
63 	if (r)
64 		delete r;
65 	if (s)
66 		delete s;
67 	r = new XResistance("");
68 	s = new XStats("");
69 	brt = (BRAND_TYPE)(BR_COLD | BR_DEMONSLAYER);
70 	special_property = SPP_NONE;
71 }
72 
toString(char * buf)73 void XDeathHack::toString(char * buf)
74 {
75 	GetArtifactName(buf, "long dagger named \"Death Hack\"");
76 }
77 
78 
79 REGISTER_CLASS(XAvanorDefender);
80 XGUID XAvanorDefender::avanordefender_guid = 0;
XAvanorDefender()81 XAvanorDefender::XAvanorDefender() : XWeapon(IT_LONGSWORD)
82 {
83 	strcpy(name, "rune-covered long sword");
84 	it = IT_LONGSWORD;
85 	weight = 110;
86 	value = 3000;
87 	_DV = 0;
88 	_PV = 0;
89 	_HIT = 18;
90 	dice.Setup(4, 4, 15);
91 	RNG = 0;
92 	if (r)
93 		delete r;
94 	if (s)
95 		delete s;
96 	r = new XResistance("poison:0d0+100 stun:0d0+100 confuse:0d0+100 fire:0d0+100 cold:0d0+100");
97 	s = new XStats("St:0d0+10 To:0d0+10");
98 	brt = (BRAND_TYPE)(BR_COLD | BR_FIRE | BR_DEMONSLAYER);
99 	special_property = SPP_NONE;
100 	avanordefender_guid = xguid;
101 }
102 
toString(char * buf)103 void XAvanorDefender::toString(char * buf)
104 {
105 	GetArtifactName(buf, "long sword named \"Avanor's Defender\"");
106 }
107 
Restore(XFile * f)108 void XAvanorDefender::Restore(XFile * f)
109 {
110 	XWeapon::Restore(f);
111 	avanordefender_guid = xguid;
112 }
113 
114 REGISTER_CLASS(XForestBrotherCloak);
XForestBrotherCloak()115 XForestBrotherCloak::XForestBrotherCloak() : XCloak(IT_CLOAK)
116 {
117 	strcpy(name, "forest brother's cloak");
118 	it = IT_FORESTBROTHERCLOAK;
119 	color = xGREEN;
120 	weight = 20;
121 	value = 100;
122 	_DV = 3;
123 	_PV = 1;
124 	_HIT = 0;
125 	dice.Setup(1, 2, 0);
126 	RNG = 0;
127 	if (r)
128 		delete r;
129 	if (s)
130 		delete s;
131 	r = new XResistance("poison:0d0+20 stun:0d0+20");
132 	s = new XStats("");
133 	brt = BR_NONE;
134 	special_property = SPP_NONE;
135 }
136 
toString(char * buf)137 void XForestBrotherCloak::toString(char * buf)
138 {
139 	XCloak::toString(buf);
140 }
141 
142 REGISTER_CLASS(XGreatElementalRing);
XGreatElementalRing()143 XGreatElementalRing::XGreatElementalRing() : XRing()
144 {
145 	if (r)
146 		delete r;
147 	if (s)
148 		delete s;
149 	r = new XResistance("fire:1d1+79 cold:1d1+79 acid:1d1+79 see_invisible:0d0+20");
150 	s = new XStats("Wi:1d1+4");
151 	strcpy(name, "Great Elemental Ring");
152 }
153 
154 
155 
156 REGISTER_CLASS(XAvanorScepter);
XAvanorScepter()157 XAvanorScepter::XAvanorScepter() : XWeapon(IT_CLUB)
158 {
159 	strcpy(name, "ancient scepter");
160 	it = IT_CLUB;
161 	view = '|';
162 	color = xYELLOW;
163 	weight = 400;
164 	value = 12000;
165 	_DV = 0;
166 	_PV = 0;
167 	_HIT = 8;
168 	dice.Setup(1, 12, 10);
169 	RNG = 0;
170 	if (r)
171 		delete r;
172 	if (s)
173 		delete s;
174 	r = new XResistance("stun:1d1+99 confuse:1d1+99 fire:1d1+99 cold:1d1+99 see_invisible:0d0+20");
175 	s = new XStats("St:1d1+15");
176 	brt = (BRAND_TYPE)(BR_FIRE | BR_COLD | BR_DEMONSLAYER);
177 	special_property = SPP_NONE;
178 }
179 
toString(char * buf)180 void XAvanorScepter::toString(char * buf)
181 {
182 	GetArtifactName(buf, "scepter of Avanor");
183 }
184 
185 REGISTER_CLASS(XAvanorCrown);
XAvanorCrown()186 XAvanorCrown::XAvanorCrown() : XCap(IT_CAP)
187 {
188 	strcpy(name, "golden crown");
189 	it = IT_CAP;
190 	view = '[';
191 	color = xYELLOW;
192 	weight = 100;
193 	value = 8000;
194 	_DV = 2;
195 	_PV = 2;
196 	_HIT = 0;
197 	dice.Setup(0, 0, 0);
198 	RNG = 0;
199 	if (r)
200 		delete r;
201 	if (s)
202 		delete s;
203 	r = new XResistance("stun:1d1+99 confuse:1d1+99 fire:1d1+99 cold:1d1+99 acid:1d1+99 see_invisible:0d0+20");
204 	s = new XStats("St:0d0+5 Dx:0d0+5 To:0d0+5 Wi:0d0+5 Ma:0d0+5");
205 	special_property = SPP_NONE;
206 }
207 
toString(char * buf)208 void XAvanorCrown::toString(char * buf)
209 {
210 	GetArtifactName(buf, "crown of Avanor");
211 }
212 
213 
214 REGISTER_CLASS(XAvanorMitre);
XAvanorMitre()215 XAvanorMitre::XAvanorMitre() : XCap(IT_CAP)
216 {
217 	strcpy(name, "holy mitre");
218 	it = IT_CAP;
219 	view = '[';
220 	color = xWHITE;
221 	weight = 100;
222 	value = 8000;
223 	_DV = 3;
224 	_PV = 2;
225 	_HIT = 0;
226 	dice.Setup(0, 0, 0);
227 	RNG = 0;
228 	if (r)
229 		delete r;
230 	if (s)
231 		delete s;
232 	r = new XResistance("stun:1d1+99 confuse:1d1+99 fire:1d1+99 cold:1d1+99 acid:1d1+99 see_invisible:0d0+20");
233 	s = new XStats("Wi:0d0+10");
234 	special_property = SPP_NONE;
235 }
236 
toString(char * buf)237 void XAvanorMitre::toString(char * buf)
238 {
239 	GetArtifactName(buf, "holy mitre of Avanor");
240 }
241 
242 REGISTER_CLASS(XTorinAxe);
XTorinAxe()243 XTorinAxe::XTorinAxe() : XWeapon(IT_GREATAXE)
244 {
245 	strcpy(name, "ancient axe");
246 	it = IT_GREATAXE;
247 	view = '\\';
248 	weight = 1200;
249 	value = 12000;
250 	_DV = 0;
251 	_PV = 0;
252 	_HIT = 8;
253 	dice.Setup(2, 8, 5);
254 	RNG = 0;
255 	if (r)
256 		delete r;
257 	if (s)
258 		delete s;
259 	r = new XResistance("stun:1d1+99 confuse:1d1+99 see_invisible:0d0+20");
260 	s = new XStats("To:1d1+10");
261 	brt = (BRAND_TYPE)(BR_COLD);
262 	special_property = SPP_NONE;
263 }
264 
toString(char * buf)265 void XTorinAxe::toString(char * buf)
266 {
267 	GetArtifactName(buf, "Axe of Torin");
268 }
269 
270 REGISTER_CLASS(XTorinShield);
XTorinShield()271 XTorinShield::XTorinShield() : XShield(IT_MEDIUMSHIELD)
272 {
273 	strcpy(name, "ancient shield");
274 	it = IT_MEDIUMSHIELD;
275 	view = ')';
276 	weight = 100;
277 	value = 8000;
278 	_DV = 12;
279 	_PV = 2;
280 	_HIT = 0;
281 	dice.Setup(0, 0, 0);
282 	RNG = 0;
283 	if (r)
284 		delete r;
285 	if (s)
286 		delete s;
287 	r = new XResistance("stun:1d1+99 confuse:1d1+99 fire:1d1+99 cold:1d1+99 acid:1d1+99 see_invisible:0d0+20");
288 	s = new XStats("To:0d0+5");
289 	special_property = SPP_NONE;
290 }
291 
toString(char * buf)292 void XTorinShield::toString(char * buf)
293 {
294 	GetArtifactName(buf, "Shield of Torin");
295 }
296 
297 REGISTER_CLASS(XDwarfCrown);
XDwarfCrown()298 XDwarfCrown::XDwarfCrown() : XCap(IT_CAP)
299 {
300 	strcpy(name, "mithril crown");
301 	it = IT_CAP;
302 	view = '[';
303 	color = xLIGHTCYAN;
304 	weight = 100;
305 	value = 8000;
306 	_DV = 2;
307 	_PV = 2;
308 	_HIT = 0;
309 	dice.Setup(0, 0, 0);
310 	RNG = 0;
311 	if (r)
312 		delete r;
313 	if (s)
314 		delete s;
315 	r = new XResistance("stun:1d1+99 confuse:1d1+99 fire:1d1+99 cold:1d1+99 acid:1d1+99 see_invisible:0d0+20");
316 	s = new XStats("St:0d0+5 Dx:0d0+5 To:0d0+5 Wi:0d0+5 Ma:0d0+5");
317 	special_property = SPP_NONE;
318 }
319 
toString(char * buf)320 void XDwarfCrown::toString(char * buf)
321 {
322 	GetArtifactName(buf, "dwarven crown");
323 }
324 
325 
326 
327 REGISTER_CLASS(XBlackClub);
XBlackClub()328 XBlackClub::XBlackClub() : XWeapon(IT_CLUB)
329 {
330 	strcpy(name, "black club");
331 	it = IT_CLUB;
332 	view = '/';
333 	color = xDARKGRAY;
334 	weight = 8000;
335 	value = 10000;
336 	_DV = -10;
337 	_PV = 0;
338 	_HIT = -15;
339 	dice.Setup(2, 20, 0);
340 	RNG = 0;
341 	if (r)
342 		delete r;
343 	if (s)
344 		delete s;
345 	r = new XResistance("fire:0d0+50");
346 	s = new XStats("");
347 	brt = (BRAND_TYPE)(BR_FIRE);
348 	special_property = SPP_NONE;
349 }
350 
toString(char * buf)351 void XBlackClub::toString(char * buf)
352 {
353 	GetArtifactName(buf, "club of black obsidian");
354 }
355