ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/skill_util.C
(Generate patch)

Comparing deliantra/server/server/skill_util.C (file contents):
Revision 1.22 by root, Fri Dec 22 16:34:00 2006 UTC vs.
Revision 1.47 by root, Sun May 13 19:56:57 2007 UTC

1/* 1/*
2 CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game
3 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
4 Copryight (C) 2002 Mark Wedel & Crossfire Development Team 5 * Copryight (C) 2002 Mark Wedel & Crossfire Development Team
5 Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
6 7 *
7 This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 11 * (at your option) any later version.
11 12 *
12 This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details. 16 * GNU General Public License for more details.
16 17 *
17 You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 21 *
21 The author can be reached via e-mail to <crossfire@schmorp.de> 22 * The author can be reached via e-mail to <crossfire@schmorp.de>
22*/ 23 */
23 24
24/* Created July 95 to separate skill utilities from actual skills -b.t. */ 25/* Created July 95 to separate skill utilities from actual skills -b.t. */
25 26
26/* Reconfigured skills code to allow linking of skills to experience 27/* Reconfigured skills code to allow linking of skills to experience
27 * categories. This is done solely through the init_new_exp_system() fctn. 28 * categories. This is done solely through the init_new_exp_system() fctn.
39 40
40/* #define SKILL_UTIL_DEBUG */ 41/* #define SKILL_UTIL_DEBUG */
41 42
42#include <global.h> 43#include <global.h>
43#include <object.h> 44#include <object.h>
44#ifndef __CEXTRACT__
45# include <sproto.h> 45#include <sproto.h>
46#endif
47#include <living.h> /* for defs of STR,CON,DEX,etc. -b.t. */ 46#include <living.h> /* for defs of STR,CON,DEX,etc. -b.t. */
48#include <spells.h> 47#include <spells.h>
49 48
50/* Table of unarmed attack skills. Terminated by -1. This 49const uint8_t skill_flags[NUM_SKILLS] = {
51 * is also the list that we should try to use skills when 50 0, // SK_NONE
52 * automatically applying one for the player. 51# define def(uc, flags) flags,
53 */ 52# include "skillinc.h"
54static uint8 unarmed_skills[] = { 53# undef def
55 SK_KARATE,
56 SK_CLAWING,
57 SK_FLAME_TOUCH,
58 SK_SPARK_TOUCH,
59 SK_SHIVER,
60 SK_ACID_SPLASH,
61 SK_POISON_NAIL,
62 SK_PUNCHING,
63 (uint8)-1
64}; 54};
65 55
66static int attack_hth (object *pl, int dir, const char *string, object *skill); 56static int attack_hth (object *pl, int dir, const char *string, object *skill);
67static int attack_melee_weapon (object *op, int dir, const char *string, object *skill); 57static int attack_melee_weapon (object *op, int dir, const char *string, object *skill);
68 58
71 * subtypes. 61 * subtypes.
72 */ 62 */
73void 63void
74init_skills (void) 64init_skills (void)
75{ 65{
76 int i;
77 archetype *at;
78
79 for (at = first_archetype; at != NULL; at = at->next) 66 for (archetype *at = first_archetype; at; at = at->next)
80 if (at->clone.type == SKILL) 67 if (at->clone.type == SKILL)
81 { 68 {
82 if (skill_names[at->clone.subtype] != NULL) 69 if (skill_names[at->clone.subtype])
83 LOG (llevError, "init_skills: multiple skill using same subtype %d, %s, %s\n", 70 LOG (llevError, "init_skills: multiple skill using same subtype %d, %s, %s\n",
84 at->clone.subtype, &skill_names[at->clone.subtype], &at->clone.skill); 71 at->clone.subtype, &skill_names[at->clone.subtype], &at->clone.skill);
85 else 72 else
86 skill_names[at->clone.subtype] = at->clone.skill; 73 skill_names[at->clone.subtype] = at->clone.skill;
87 } 74 }
88 75
89 /* This isn't really an error if there is no skill subtype set, but 76 /* This isn't really an error if there is no skill subtype set, but
90 * checking for this may catch some user errors. 77 * checking for this may catch some user errors.
91 */ 78 */
92 for (i = 1; i < NUM_SKILLS; i++) 79 for (int i = 1; i < NUM_SKILLS; i++)
93 {
94 if (!skill_names[i]) 80 if (!skill_names[i])
95 LOG (llevError, "init_skills: skill subtype %d doesn't have a name?\n", i); 81 LOG (llevError, "init_skills: skill subtype %d doesn't have a name?\n", i);
96 }
97} 82}
98 83
99/* This function goes through the player inventory and sets 84/* This function goes through the player inventory and sets
100 * up the last_skills[] array in the player object. 85 * up the last_skills[] array in the player object.
101 * the last_skills[] is used to more quickly lookup skills - 86 * the last_skills[] is used to more quickly lookup skills -
102 * mostly used for sending exp. 87 * mostly used for sending exp.
103 */ 88 */
104void 89void
105link_player_skills (object *op) 90link_player_skills (object *op)
106{ 91{
107 object *tmp;
108
109 for (tmp = op->inv; tmp; tmp = tmp->below) 92 for (object *tmp = op->inv; tmp; tmp = tmp->below)
110 {
111 if (tmp->type == SKILL) 93 if (tmp->type == SKILL)
112 { 94 {
113 /* This is really a warning, hence no else below */ 95 /* This is really a warning, hence no else below */
114 if (op->contr->last_skill_ob[tmp->subtype] && op->contr->last_skill_ob[tmp->subtype] != tmp) 96 if (op->contr->last_skill_ob[tmp->subtype] && op->contr->last_skill_ob[tmp->subtype] != tmp)
115 {
116 LOG (llevError, "Multiple skills with the same subtype? %s, %s\n", 97 LOG (llevError, "Multiple skills with the same subtype? %s, %s\n",
117 &op->contr->last_skill_ob[tmp->subtype]->skill, &tmp->skill); 98 &op->contr->last_skill_ob[tmp->subtype]->skill, &tmp->skill);
118 } 99
119 if (tmp->subtype >= NUM_SKILLS) 100 if (tmp->subtype >= NUM_SKILLS)
120 {
121 LOG (llevError, "Invalid subtype number %d (range 0-%d)\n", tmp->subtype, NUM_SKILLS); 101 LOG (llevError, "Invalid subtype number %d (range 0-%d)\n", tmp->subtype, NUM_SKILLS);
122 }
123 else 102 else
124 { 103 {
125 op->contr->last_skill_ob[tmp->subtype] = tmp; 104 op->contr->last_skill_ob[tmp->subtype] = tmp;
126 op->contr->last_skill_exp[tmp->subtype] = -1; 105 op->contr->ns->last_skill_exp[tmp->subtype] = -1; //TODO: this should go
127 } 106 }
128 } 107 }
129 }
130} 108}
131 109
132/* This returns the skill pointer of the given name (the 110/* This returns the skill pointer of the given name (the
133 * one that accumlates exp, has the level, etc). 111 * one that accumlates exp, has the level, etc).
134 * 112 *
137 * tool, this code will equip it. 115 * tool, this code will equip it.
138 */ 116 */
139object * 117object *
140find_skill_by_name (object *who, const char *name) 118find_skill_by_name (object *who, const char *name)
141{ 119{
142 object *skill = NULL, *skill_tool = NULL, *tmp;
143
144 if (!name) 120 if (!name)
145 return NULL; 121 return 0;
122
123 object *skill = 0, *skill_tool = 0;
146 124
147 /* We make sure the length of the string in the object is greater 125 /* We make sure the length of the string in the object is greater
148 * in length than the passed string. Eg, if we have a skill called 126 * in length than the passed string. Eg, if we have a skill called
149 * 'hi', we don't want to match if the user passed 'high' 127 * 'hi', we don't want to match if the user passed 'high'
150 */ 128 */
151 for (tmp = who->inv; tmp != NULL; tmp = tmp->below) 129 for (object *tmp = who->inv; tmp; tmp = tmp->below)
152 { 130 {
153 if (tmp->type == SKILL && !strncasecmp (name, tmp->skill, strlen (name)) && (size_t) strlen (tmp->skill) >= strlen (name)) 131 if (tmp->type == SKILL && !strncasecmp (name, tmp->skill, strlen (name)) && strlen (tmp->skill) >= strlen (name))
154 skill = tmp; 132 skill = tmp;
155 133
156 /* Try to find appropriate skilltool. If the player has one already 134 /* Try to find appropriate skilltool. If the player has one already
157 * applied, we try to keep using that one. 135 * applied, we try to keep using that one.
158 */ 136 */
159 else if (tmp->type == SKILL_TOOL && !strncasecmp (name, tmp->skill, strlen (name)) && (size_t) strlen (tmp->skill) >= strlen (name)) 137 else if (tmp->type == SKILL_TOOL && !strncasecmp (name, tmp->skill, strlen (name)) && strlen (tmp->skill) >= strlen (name))
160 { 138 {
161 if (QUERY_FLAG (tmp, FLAG_APPLIED)) 139 if (QUERY_FLAG (tmp, FLAG_APPLIED))
162 skill_tool = tmp; 140 skill_tool = tmp;
163 else if (!skill_tool || !QUERY_FLAG (skill_tool, FLAG_APPLIED)) 141 else if (!skill_tool || !QUERY_FLAG (skill_tool, FLAG_APPLIED))
164 skill_tool = tmp; 142 skill_tool = tmp;
165 } 143 }
166 } 144 }
145
167 /* If this is a skill that can be used without a tool, return it */ 146 /* If this is a skill that can be used without a tool, return it */
168 if (skill && QUERY_FLAG (skill, FLAG_CAN_USE_SKILL)) 147 if (skill && QUERY_FLAG (skill, FLAG_CAN_USE_SKILL))
169 return skill; 148 return skill;
170 149
171 /* Player has a tool to use the skill. IF not applied, apply it - 150 /* Player has a tool to use the skill. If not applied, apply it -
172 * if not successful, return null. If they do have the skill tool 151 * if not successful, return null. If they do have the skill tool
173 * but not the skill itself, give it to them. 152 * but not the skill itself, give it to them.
174 */ 153 */
175 if (skill_tool) 154 if (skill_tool)
176 { 155 {
177 if (!QUERY_FLAG (skill_tool, FLAG_APPLIED)) 156 if (!QUERY_FLAG (skill_tool, FLAG_APPLIED))
178 {
179 if (apply_special (who, skill_tool, 0)) 157 if (apply_special (who, skill_tool, 0))
180 return NULL; 158 return 0;
181 } 159
182 if (!skill) 160 if (!skill)
183 { 161 {
184 skill = give_skill_by_name (who, skill_tool->skill); 162 skill = give_skill_by_name (who, skill_tool->skill);
185 link_player_skills (who); 163 link_player_skills (who);
186 } 164 }
165
187 return skill; 166 return skill;
188 } 167 }
168
189 return NULL; 169 return 0;
190} 170}
191
192 171
193/* This returns the skill pointer of the given name (the 172/* This returns the skill pointer of the given name (the
194 * one that accumlates exp, has the level, etc). 173 * one that accumlates exp, has the level, etc).
195 * 174 *
196 * It is presumed that the player will be needing to actually 175 * It is presumed that the player will be needing to actually
202 * this replaces find_skill. 181 * this replaces find_skill.
203 */ 182 */
204object * 183object *
205find_skill_by_number (object *who, int skillno) 184find_skill_by_number (object *who, int skillno)
206{ 185{
186 if (!IN_RANGE_EXC (skillno, 1, NUM_SKILLS))
187 return 0;
188
207 object *skill = NULL, *skill_tool = NULL, *tmp; 189 object *skill = NULL, *skill_tool = NULL;
208 190
209 if (skillno < 1 || skillno >= NUM_SKILLS)
210 return NULL;
211
212 for (tmp = who->inv; tmp != NULL; tmp = tmp->below) 191 for (object *tmp = who->inv; tmp; tmp = tmp->below)
213 { 192 {
214 if (tmp->type == SKILL && tmp->subtype == skillno) 193 if (tmp->type == SKILL && tmp->subtype == skillno)
215 skill = tmp; 194 skill = tmp;
216 195
217 /* Try to find appropriate skilltool. If the player has one already 196 /* Try to find appropriate skilltool. If the player has one already
223 skill_tool = tmp; 202 skill_tool = tmp;
224 else if (!skill_tool || !QUERY_FLAG (skill_tool, FLAG_APPLIED)) 203 else if (!skill_tool || !QUERY_FLAG (skill_tool, FLAG_APPLIED))
225 skill_tool = tmp; 204 skill_tool = tmp;
226 } 205 }
227 } 206 }
207
228 /* If this is a skill that can be used without a tool, return it */ 208 /* If this is a skill that can be used without a tool, return it */
229 if (skill && QUERY_FLAG (skill, FLAG_CAN_USE_SKILL)) 209 if (skill && QUERY_FLAG (skill, FLAG_CAN_USE_SKILL))
230 return skill; 210 return skill;
231 211
232 /* Player has a tool to use the skill. IF not applied, apply it - 212 /* Player has a tool to use the skill. If not applied, apply it -
233 * if not successful, return null. If they do have the skill tool 213 * if not successful, return null. If they do have the skill tool
234 * but not the skill itself, give it to them. 214 * but not the skill itself, give it to them.
235 */ 215 */
236 if (skill_tool) 216 if (skill_tool)
237 { 217 {
238 if (!QUERY_FLAG (skill_tool, FLAG_APPLIED)) 218 if (!QUERY_FLAG (skill_tool, FLAG_APPLIED))
254} 234}
255 235
256/* This changes the objects skill to new_skill. 236/* This changes the objects skill to new_skill.
257 * note that this function doesn't always need to get used - 237 * note that this function doesn't always need to get used -
258 * you can now add skill exp to the player without the chosen_skill being 238 * you can now add skill exp to the player without the chosen_skill being
259 * set. This function is of most interest to players to update 239 * set. This function is of most interest to players to update
260 * the various range information. 240 * the various range information.
261 * if new_skill is null, this just unapplies the skill.
262 * flag has the current meaning:
263 * 0x1: If set, don't update the range pointer. This is useful when we
264 * need to ready a new skill, but don't want to clobber range.
265 * return 1 on success, 0 on error 241 * return 1 on success, 0 on error
266 */ 242 */
267
268int 243int
269change_skill (object *who, object *new_skill, int flag) 244change_skill (object *who, object *new_skill, int flag)
270{ 245{
271 int old_range;
272
273 if (who->type != PLAYER) 246 if (who->type != PLAYER)
274 return 0; 247 return 0;
275 248
276 old_range = who->contr->shoottype; 249#if 0
277 250 // optimise this supposedly common case
278 if (who->chosen_skill && who->chosen_skill == new_skill)
279 {
280 /* optimization for changing skill to current skill */
281 if (who->type == PLAYER && !(flag & 0x1))
282 who->contr->shoottype = range_skill;
283
284 return 1;
285 }
286
287 // move skill to front, so it will be preferred next time
288 new_skill->remove ();
289 who->insert (new_skill);
290
291 if (!new_skill || who->chosen_skill) 251 if (new_skill == who->chosen_skill)
292 if (who->chosen_skill) 252 return 1;
293 apply_special (who, who->chosen_skill, AP_UNAPPLY); 253#endif
294 254
295 /* Only goal in this case was to unapply a skill */
296 if (!new_skill) 255 if (!new_skill)
256 {
257 LOG (llevError | logBacktrace, "change_skill called on %s with NULL skill\n",
258 who->debug_desc ());
297 return 0; 259 return 0;
260 }
261
262 // the skill could be readied already because it is used by a weapon.
263 who->change_weapon (0);
264 new_skill->inv_splay ();
298 265
299 if (apply_special (who, new_skill, AP_APPLY)) 266 if (apply_special (who, new_skill, AP_APPLY))
300 return 0; 267 return 0;
301 268
302 if (flag & 0x1)
303 who->contr->shoottype = (rangetype)old_range;
304
305 return 1; 269 return 1;
306} 270}
307 271
308/* This function just clears the chosen_skill and range_skill values 272/* This function just clears the chosen_skill and range_skill values
309 * inthe player. 273 * in the player.
310 */ 274 */
311void 275void
312clear_skill (object *who) 276clear_skill (object *who)
313{ 277{
314 who->chosen_skill = NULL; 278 who->chosen_skill = 0;
315 CLEAR_FLAG (who, FLAG_READY_SKILL); 279 CLEAR_FLAG (who, FLAG_READY_SKILL);
280
316 if (who->type == PLAYER) 281 if (who->type == PLAYER)
317 { 282 if (who->contr->ranged_ob && who->contr->ranged_ob->type == SKILL)
318 who->contr->ranges[range_skill] = NULL; 283 who->contr->ranged_ob = 0;
319 if (who->contr->shoottype == range_skill)
320 who->contr->shoottype = range_none;
321 }
322} 284}
323 285
324/* do_skill() - Main skills use function-similar in scope to cast_spell(). 286/* do_skill() - Main skills use function-similar in scope to cast_spell().
325 * We handle all requests for skill use outside of some combat here. 287 * We handle all requests for skill use outside of some combat here.
326 * We require a separate routine outside of fire() so as to allow monsters 288 * We require a separate routine outside of fire() so as to allow monsters
329 * exp - no caller needed that info, but it also prevented the callers 291 * exp - no caller needed that info, but it also prevented the callers
330 * from know if a skill was actually used, as many skills don't 292 * from know if a skill was actually used, as many skills don't
331 * give any exp for their direct use (eg, throwing). 293 * give any exp for their direct use (eg, throwing).
332 * It returns 0 if no skill was used. 294 * It returns 0 if no skill was used.
333 */ 295 */
334
335int 296int
336do_skill (object *op, object *part, object *skill, int dir, const char *string) 297do_skill (object *op, object *part, object *skill, int dir, const char *string)
337{ 298{
338 int success = 0, exp = 0; 299 int success = 0, exp = 0;
339 int did_alc = 0; 300 int did_alc = 0;
340 object *tmp, *next;
341 301
342 if (!skill) 302 if (!skill)
343 return 0; 303 return 0;
344 304
345 /* The code below presumes that the skill points to the object that 305 /* The code below presumes that the skill points to the object that
347 * go and try to find the actual real skill pointer, and if the 307 * go and try to find the actual real skill pointer, and if the
348 * the player doesn't have a bucket for that, create one. 308 * the player doesn't have a bucket for that, create one.
349 */ 309 */
350 if (skill->type != SKILL && op->type == PLAYER) 310 if (skill->type != SKILL && op->type == PLAYER)
351 { 311 {
352 for (tmp = op->inv; tmp != NULL; tmp = tmp->below) 312 for (object *tmp = op->inv; tmp; tmp = tmp->below)
353 {
354 if (tmp->type == SKILL && tmp->skill == skill->skill) 313 if (tmp->type == SKILL && tmp->skill == skill->skill)
355 break; 314 {
315 skill = tmp;
316 goto found;
356 } 317 }
357 if (!tmp) 318
358 tmp = give_skill_by_name (op, skill->skill); 319 skill = give_skill_by_name (op, skill->skill);
359 skill = tmp; 320found: ;
360 } 321 }
361 322
362 // skill, by_whom, on_which_object, which direction, skill_argument 323 // skill, by_whom, on_which_object, which direction, skill_argument
363 if (INVOKE_OBJECT (USE_SKILL, skill, ARG_OBJECT (op), ARG_OBJECT (part), ARG_INT (dir), ARG_STRING (string))) 324 if (INVOKE_OBJECT (USE_SKILL, skill, ARG_OBJECT (op), ARG_OBJECT (part), ARG_INT (dir), ARG_STRING (string)))
364 return 0; 325 return 0;
365 326
366 switch (skill->subtype) 327 switch (skill->subtype)
367 { 328 {
368 case SK_LEVITATION: 329 case SK_LEVITATION:
369 /* Not 100% sure if this will work with new movement code - 330 /* Not 100% sure if this will work with new movement code -
370 * the levitation skill has move_type for flying, so when 331 * the levitation skill has move_type for flying, so when
371 * equipped, that should transfer to player, when not, 332 * equipped, that should transfer to player, when not,
372 * shouldn't. 333 * shouldn't.
373 */ 334 */
374 if (QUERY_FLAG (skill, FLAG_APPLIED)) 335 if (QUERY_FLAG (skill, FLAG_APPLIED))
375 { 336 {
376 CLEAR_FLAG (skill, FLAG_APPLIED); 337 CLEAR_FLAG (skill, FLAG_APPLIED);
377 new_draw_info (NDI_UNIQUE, 0, op, "You come to earth."); 338 new_draw_info (NDI_UNIQUE, 0, op, "You come to earth.");
378 } 339 }
379 else 340 else
380 { 341 {
381 SET_FLAG (skill, FLAG_APPLIED); 342 SET_FLAG (skill, FLAG_APPLIED);
382 new_draw_info (NDI_UNIQUE, 0, op, "You rise into the air!."); 343 new_draw_info (NDI_UNIQUE, 0, op, "You rise into the air!.");
383 } 344 }
345
384 op->update_stats (); 346 op->update_stats ();
385 success = 1; 347 success = 1;
386 break; 348 break;
387 349
388 case SK_STEALING: 350 case SK_STEALING:
389 exp = success = steal (op, dir, skill); 351 exp = success = steal (op, dir, skill);
390 break; 352 break;
391 353
392 case SK_LOCKPICKING: 354 case SK_LOCKPICKING:
393 exp = success = pick_lock (op, dir, skill); 355 exp = success = pick_lock (op, dir, skill);
394 break; 356 break;
395 357
396 case SK_HIDING: 358 case SK_HIDING:
397 exp = success = hide (op, skill); 359 exp = success = hide (op, skill);
398 break; 360 break;
399 361
400 case SK_JUMPING: 362 case SK_JUMPING:
401 success = jump (op, dir, skill); 363 success = jump (op, dir, skill);
402 break; 364 break;
403 365
404 case SK_INSCRIPTION: 366 case SK_INSCRIPTION:
405 exp = success = write_on_item (op, string, skill); 367 exp = success = write_on_item (op, string, skill);
406 break; 368 break;
407 369
408 case SK_MEDITATION: 370 case SK_MEDITATION:
409 meditate (op, skill); 371 meditate (op, skill);
410 success = 1; 372 success = 1;
411 break; 373 break;
412 /* note that the following 'attack' skills gain exp through hit_player() */ 374 /* note that the following 'attack' skills gain exp through hit_player() */
413 375
414 case SK_KARATE: 376 case SK_KARATE:
415 (void) attack_hth (op, dir, "karate-chopped", skill); 377 attack_hth (op, dir, "karate-chopped", skill);
416 break; 378 break;
417 379
418 case SK_PUNCHING: 380 case SK_PUNCHING:
419 (void) attack_hth (op, dir, "punched", skill); 381 attack_hth (op, dir, "punched", skill);
420 break; 382 break;
421 383
422 case SK_FLAME_TOUCH: 384 case SK_FLAME_TOUCH:
423 (void) attack_hth (op, dir, "flamed", skill); 385 attack_hth (op, dir, "flamed", skill);
424 break; 386 break;
425 387
426 case SK_SPARK_TOUCH: 388 case SK_SPARK_TOUCH:
427 (void) attack_hth (op, dir, "zapped", skill); 389 attack_hth (op, dir, "zapped", skill);
428 break; 390 break;
429 391
430 case SK_SHIVER: 392 case SK_SHIVER:
431 (void) attack_hth (op, dir, "froze", skill); 393 attack_hth (op, dir, "froze", skill);
432 break; 394 break;
433 395
434 case SK_ACID_SPLASH: 396 case SK_ACID_SPLASH:
435 (void) attack_hth (op, dir, "dissolved", skill); 397 attack_hth (op, dir, "dissolved", skill);
436 break; 398 break;
437 399
438 case SK_POISON_NAIL: 400 case SK_POISON_NAIL:
439 (void) attack_hth (op, dir, "injected poison into", skill); 401 attack_hth (op, dir, "injected poison into", skill);
440 break; 402 break;
441 403
442 case SK_CLAWING: 404 case SK_CLAWING:
443 (void) attack_hth (op, dir, "clawed", skill); 405 attack_hth (op, dir, "clawed", skill);
444 break; 406 break;
445 407
446 case SK_ONE_HANDED_WEAPON: 408 case SK_ONE_HANDED_WEAPON:
447 case SK_TWO_HANDED_WEAPON: 409 case SK_TWO_HANDED_WEAPON:
448 (void) attack_melee_weapon (op, dir, NULL, skill); 410 attack_melee_weapon (op, dir, NULL, skill);
449 break; 411 break;
450 412
451 case SK_FIND_TRAPS: 413 case SK_FIND_TRAPS:
452 exp = success = find_traps (op, skill); 414 exp = success = find_traps (op, skill);
453 break; 415 break;
454 416
455 case SK_SINGING: 417 case SK_SINGING:
456 exp = success = singing (op, dir, skill); 418 exp = success = singing (op, dir, skill);
457 break; 419 break;
458 420
459 case SK_ORATORY: 421 case SK_ORATORY:
460 exp = success = use_oratory (op, dir, skill); 422 exp = success = use_oratory (op, dir, skill);
461 break; 423 break;
462 424
463 case SK_SMITHERY: 425 case SK_SMITHERY:
464 case SK_BOWYER: 426 case SK_BOWYER:
465 case SK_JEWELER: 427 case SK_JEWELER:
466 case SK_ALCHEMY: 428 case SK_ALCHEMY:
467 case SK_THAUMATURGY: 429 case SK_THAUMATURGY:
468 case SK_LITERACY: 430 case SK_LITERACY:
469 case SK_WOODSMAN: 431 case SK_WOODSMAN:
470 /* first, we try to find a cauldron, and do the alchemy thing. 432 /* first, we try to find a cauldron, and do the alchemy thing.
471 * failing that, we go and identify stuff. 433 * failing that, we go and identify stuff.
472 */ 434 */
473 for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = next) 435 for (object *next, *tmp = GET_MAP_OB (op->map, op->x, op->y); tmp; tmp = next)
474 { 436 {
475 next = tmp->above; 437 next = tmp->above;
476 438
477 if (QUERY_FLAG (tmp, FLAG_IS_CAULDRON)) 439 if (QUERY_FLAG (tmp, FLAG_IS_CAULDRON))
478 { 440 {
479 attempt_do_alchemy (op, tmp); 441 attempt_do_alchemy (op, tmp);
480 442
481 if (QUERY_FLAG (tmp, FLAG_APPLIED)) 443 if (QUERY_FLAG (tmp, FLAG_APPLIED))
482 esrv_send_inventory (op, tmp); 444 esrv_send_inventory (op, tmp);
483 445
484 did_alc = 1; 446 did_alc = 1;
485 } 447 }
486 } 448 }
487 449
488 if (did_alc == 0) 450 if (did_alc == 0)
489 exp = success = skill_ident (op, skill);
490
491 break;
492
493 case SK_DET_MAGIC:
494 case SK_DET_CURSE:
495 exp = success = skill_ident (op, skill); 451 exp = success = skill_ident (op, skill);
452
496 break; 453 break;
497 454
455 case SK_DET_MAGIC:
456 case SK_DET_CURSE:
457 exp = success = skill_ident (op, skill);
458 break;
459
498 case SK_DISARM_TRAPS: 460 case SK_DISARM_TRAPS:
499 exp = success = remove_trap (op, dir, skill); 461 exp = success = remove_trap (op, dir, skill);
500 break; 462 break;
501 463
502 case SK_THROWING: 464 case SK_THROWING:
503 success = skill_throw (op, part, dir, string, skill); 465 success = skill_throw (op, part, dir, string, skill);
504 break; 466 break;
505 467
506 case SK_SET_TRAP: 468 case SK_SET_TRAP:
507 new_draw_info (NDI_UNIQUE, 0, op, "This skill is not currently implemented."); 469 new_draw_info (NDI_UNIQUE, 0, op, "This skill is not currently implemented.");
508 break; 470 break;
509 471
510 case SK_USE_MAGIC_ITEM: 472 case SK_USE_MAGIC_ITEM:
511 case SK_MISSILE_WEAPON: 473 case SK_MISSILE_WEAPON:
512 new_draw_info (NDI_UNIQUE, 0, op, "There is no special attack for this skill."); 474 new_draw_info (NDI_UNIQUE, 0, op, "There is no special attack for this skill.");
513 break; 475 break;
514 476
515 case SK_PRAYING: 477 case SK_PRAYING:
516 success = pray (op, skill); 478 success = pray (op, skill);
517 break; 479 break;
518 480
519 case SK_BARGAINING: 481 case SK_BARGAINING:
520 success = describe_shop (op); 482 success = describe_shop (op);
521 break; 483 break;
522 484
523 case SK_SORCERY: 485 case SK_SORCERY:
524 case SK_EVOCATION: 486 case SK_EVOCATION:
525 case SK_PYROMANCY: 487 case SK_PYROMANCY:
526 case SK_SUMMONING: 488 case SK_SUMMONING:
527 case SK_CLIMBING: 489 case SK_CLIMBING:
528 new_draw_info (NDI_UNIQUE, 0, op, "This skill is already in effect."); 490 new_draw_info (NDI_UNIQUE, 0, op, "This skill is already in effect.");
529 break; 491 break;
530 492
531 default: 493 default:
532 LOG (llevDebug, "%s attempted to use unknown skill: %d\n", query_name (op), op->chosen_skill->stats.sp); 494 LOG (llevDebug, "%s attempted to use unknown skill: %d\n", query_name (op), op->chosen_skill->stats.sp);
533 break; 495 break;
534 } 496 }
535 497
536 /* For players we now update the speed_left from using the skill. 498 /* For players we now update the speed_left from using the skill.
537 * Monsters have no skill use time because of the random nature in 499 * Monsters have no skill use time because of the random nature in
538 * which use_monster_skill is called already simulates this. 500 * which use_monster_skill is called already simulates this.
539 * If certain skills should take more/less time, that should be 501 * If certain skills should take more/less time, that should be
540 * in the code for the skill itself. 502 * in the code for the skill itself.
541 */ 503 */
542 504
543 if (op->type == PLAYER) 505 if (op->type == PLAYER)
544 op->speed_left -= 1.0; 506 op->speed_left -= 1.f;
545 507
546 /* this is a good place to add experience for successfull use of skills. 508 /* this is a good place to add experience for successfull use of skills.
547 * Note that add_exp() will figure out player/monster experience 509 * Note that add_exp() will figure out player/monster experience
548 * gain problems. 510 * gain problems.
549 */ 511 */
577 * op is the object that was 'defeated'. 539 * op is the object that was 'defeated'.
578 * skill is the skill used. If no skill is used, it should just 540 * skill is the skill used. If no skill is used, it should just
579 * point back to who. 541 * point back to who.
580 * 542 *
581 */ 543 */
582
583int 544int
584calc_skill_exp (object *who, object *op, object *skill) 545calc_skill_exp (object *who, object *op, object *skill)
585{ 546{
586 int op_exp = 0, op_lvl = 0; 547 int op_exp = 0, op_lvl = 0;
587 float base, value, lvl_mult = 0.0; 548 float base, value, lvl_mult = 0.0;
676 * This one actually teaches the player the skill as something 637 * This one actually teaches the player the skill as something
677 * they can equip. 638 * they can equip.
678 * Return 0 if the player knows the skill, 1 if the 639 * Return 0 if the player knows the skill, 1 if the
679 * player learns the skill, 2 otherwise. 640 * player learns the skill, 2 otherwise.
680 */ 641 */
681
682int 642int
683learn_skill (object *pl, object *scroll) 643learn_skill (object *pl, object *scroll)
684{ 644{
685 object *tmp; 645 object *tmp;
686 646
722 link_player_skills (pl); 682 link_player_skills (pl);
723 return 1; 683 return 1;
724} 684}
725 685
726/* Gives a percentage clipped to 0% -> 100% of a/b. */ 686/* Gives a percentage clipped to 0% -> 100% of a/b. */
727
728/* Probably belongs in some global utils-type file? */ 687/* Probably belongs in some global utils-type file? */
729static int 688static int
730clipped_percent (sint64 a, sint64 b) 689clipped_percent (sint64 a, sint64 b)
731{ 690{
732 int rv; 691 int rv;
805 } 764 }
806 765
807 clear_win_info (op); 766 clear_win_info (op);
808 new_draw_info (NDI_UNIQUE, 0, op, "Player skills:"); 767 new_draw_info (NDI_UNIQUE, 0, op, "Player skills:");
809 if (num_skills_found > 1) 768 if (num_skills_found > 1)
810 qsort (skills, num_skills_found, MAX_BUF, (int (*)(const void *, const void *)) strcmp); 769 qsort (skills, num_skills_found, MAX_BUF, (int (*)(const void *, const void *)) std::strcmp);
811 770
812 for (i = 0; i < num_skills_found; i++) 771 for (i = 0; i < num_skills_found; i++)
813 {
814 new_draw_info (NDI_UNIQUE, 0, op, skills[i]); 772 new_draw_info (NDI_UNIQUE, 0, op, skills[i]);
815 }
816 773
817 new_draw_info_format (NDI_UNIQUE, 0, op, "You can handle %d weapon improvements.", op->level / 5 + 5); 774 new_draw_info_format (NDI_UNIQUE, 0, op, "You can handle %d weapon improvements.", op->level / 5 + 5);
818 775
819 cp = determine_god (op); 776 cp = determine_god (op);
820 new_draw_info_format (NDI_UNIQUE, 0, op, "You worship %s.", cp ? cp : "no god at current time"); 777 new_draw_info_format (NDI_UNIQUE, 0, op, "You worship %s.", cp ? cp : "no god at current time");
827 * direction that the user is facing. Returns false if we are unable to 784 * direction that the user is facing. Returns false if we are unable to
828 * change to the requested skill, or were unable to use the skill properly. 785 * change to the requested skill, or were unable to use the skill properly.
829 * This is tricky because skills can have spaces. We basically roll 786 * This is tricky because skills can have spaces. We basically roll
830 * our own find_skill_by_name so we can try to do better string matching. 787 * our own find_skill_by_name so we can try to do better string matching.
831 */ 788 */
832
833int 789int
834use_skill (object *op, const char *string) 790use_skill (object *op, const char *string)
835{ 791{
836 object *skop; 792 object *skop;
837 size_t len; 793 size_t len;
885} 841}
886 842
887static bool 843static bool
888hth_skill_p (object *skill) 844hth_skill_p (object *skill)
889{ 845{
890 for (unsigned int i = 0; i < sizeof (unarmed_skills); ++i) 846 return (skill_flags [skill->subtype] & (SF_COMBAT | SF_NEED_WEAPON)) == SF_COMBAT;
891 if (skill->subtype == unarmed_skills[i])
892 return 1;
893
894 return 0;
895} 847}
896 848
897/* This finds the first unarmed skill the player has, and returns it. 849/* This finds the first unarmed skill the player has, and returns it.
898 */ 850 */
899static object * 851static object *
913 * tmp is the targetted monster. 865 * tmp is the targetted monster.
914 * op is what is attacking 866 * op is what is attacking
915 * string is passed along to describe what messages to describe 867 * string is passed along to describe what messages to describe
916 * the damage. 868 * the damage.
917 */ 869 */
918
919static int 870static int
920do_skill_attack (object *tmp, object *op, const char *string, object *skill) 871do_skill_attack (object *tmp, object *op, const char *string, object *skill)
921{ 872{
922 int success;
923
924 if (INVOKE_OBJECT (SKILL_ATTACK, op, ARG_OBJECT (tmp), ARG_STRING (string), ARG_OBJECT (skill))) 873 if (INVOKE_OBJECT (SKILL_ATTACK, op, ARG_OBJECT (tmp), ARG_STRING (string), ARG_OBJECT (skill)))
925 return RESULT_INT (0); 874 return RESULT_INT (0);
926 875
927 /* For Players only: if there is no ready weapon, and no "attack" skill 876 /* For Players only: if there is no ready weapon, and no "attack" skill
928 * is readied either then try to find a skill for the player to use. 877 * is readied either then try to find a skill for the player to use.
929 * it is presumed that if skill is set, it is a valid attack skill (eg, 878 * it is presumed that if skill is set, it is a valid attack skill (eg,
930 * the caller should have set it appropriately). We still want to pass 879 * the caller should have set it appropriately). We still want to pass
931 * through that code if skill is set to change to the skill. 880 * through that code if skill is set to change to the skill.
932 */ 881 */
933 if (op->type == PLAYER) 882 if (player *pl = op->contr)
934 { 883 {
935 if (!QUERY_FLAG (op, FLAG_READY_WEAPON)) 884 if (!pl->combat_ob)
936 { 885 {
937 if (!skill) 886 if (QUERY_FLAG (op, FLAG_READY_WEAPON))
938 { 887 {
939 /* See if the players chosen skill is a combat skill, and use 888 for (tmp = op->inv; tmp; tmp = tmp->below)
940 * it if appropriate. 889 if (tmp->type == WEAPON && QUERY_FLAG (tmp, FLAG_APPLIED))
941 */ 890 break;
942 if (op->chosen_skill && hth_skill_p (op->chosen_skill)) 891
943 skill = op->chosen_skill; 892 if (!tmp)
944 else
945 { 893 {
946 skill = find_player_hth_skill (op); 894 LOG (llevError, "Could not find applied weapon on %s\n", &op->name);
895 return 0;
896 }
947 897
898 change_skill (op, find_skill_by_name (op, tmp->skill), 1);
899 }
900 else
901 {
948 if (!skill) 902 if (!skill)
903 {
904 /* See if the players chosen skill is a combat skill, and use
905 * it if appropriate.
906 */
907 if (op->chosen_skill && hth_skill_p (op->chosen_skill))
908 skill = op->chosen_skill;
909 else
949 { 910 {
911 skill = find_player_hth_skill (op);
912
913 if (!skill)
914 {
950 new_draw_info (NDI_BLACK, 0, op, "You have no unarmed combat skills!"); 915 new_draw_info (NDI_BLACK, 0, op, "You have no unarmed combat skills!");
951 return 0; 916 return 0;
917 }
952 } 918 }
953 } 919 }
920
921 /* now try to ready the new skill */
922 if (!change_skill (op, skill, 0))
923 { /* oh oh, trouble! */
924 new_draw_info_format (NDI_UNIQUE, 0, op, "Couldn't change to skill %s", &skill->name);
925 return 0;
926 }
954 } 927 }
955 928
956 /* now try to ready the new skill */ 929 if (!pl->combat_ob)
957 if (!change_skill (op, skill, 0)) 930 {
958 { /* oh oh, trouble! */ 931 LOG (llevError, "Could not find anything to attack on %s\n", &op->name);
959 new_draw_info_format (NDI_UNIQUE, 0, tmp, "Couldn't change to skill %s", &skill->name);
960 return 0; 932 return 0;
961 } 933 }
962 } 934 }
963 else 935
936 if (!op->change_weapon (pl->combat_ob))
937 return 0;
938
939 /* lose invisiblity/hiding status for running attacks */
940 if (pl->tmp_invis)
964 { 941 {
965 /* Seen some crashes below where current_weapon is not set, 942 pl->tmp_invis = 0;
966 * even though the flag says it is. So if current weapon isn't set, 943 op->invisible = 0;
967 * do some work in trying to find the object to use. 944 op->hide = 0;
968 */ 945 update_object (op, UP_OBJ_CHANGE);
969 if (!op->current_weapon)
970 {
971 object *tmp;
972
973 LOG (llevError, "Player %s does not have current weapon set but flag_ready_weapon is set\n", &op->name);
974 for (tmp = op->inv; tmp; tmp = tmp->below)
975 if (tmp->type == WEAPON && QUERY_FLAG (tmp, FLAG_APPLIED))
976 break;
977
978 if (!tmp)
979 {
980 LOG (llevError, "Could not find applied weapon on %s\n", &op->name);
981 op->current_weapon = NULL;
982 return 0;
983 }
984 else
985 {
986 op->current_weapon = tmp;
987 }
988 }
989
990 change_skill (op, find_skill_by_name (op, op->current_weapon->skill), 1);
991 } 946 }
992 } 947 }
993 948
994 /* lose invisiblity/hiding status for running attacks */
995
996 if (op->type == PLAYER && op->contr->tmp_invis)
997 {
998 op->contr->tmp_invis = 0;
999 op->invisible = 0;
1000 op->hide = 0;
1001 update_object (op, UP_OBJ_FACE);
1002 }
1003
1004 success = attack_ob (tmp, op); 949 int success = attack_ob (tmp, op);
1005 950
1006 /* print appropriate messages to the player */ 951 /* print appropriate messages to the player */
1007 952
1008 if (success && string != NULL && tmp && !QUERY_FLAG (tmp, FLAG_FREED)) 953 if (success && string && tmp && !QUERY_FLAG (tmp, FLAG_FREED))
1009 { 954 {
1010 if (op->type == PLAYER) 955 if (op->type == PLAYER)
1011 new_draw_info_format (NDI_UNIQUE, 0, op, "You %s %s!", string, query_name (tmp)); 956 new_draw_info_format (NDI_UNIQUE, 0, op, "You %s %s!", string, query_name (tmp));
1012 else if (tmp->type == PLAYER) 957 else if (tmp->type == PLAYER)
1013 new_draw_info_format (NDI_UNIQUE, 0, tmp, "%s %s you!", query_name (op), string); 958 new_draw_info_format (NDI_UNIQUE, 0, tmp, "%s %s you!", query_name (op), string);
1014 } 959 }
960
1015 return success; 961 return success;
1016} 962}
1017
1018 963
1019/* skill_attack() - Core routine for use when we attack using a skills 964/* skill_attack() - Core routine for use when we attack using a skills
1020 * system. In essence, this code handles 965 * system. In essence, this code handles
1021 * all skill-based attacks, ie hth, missile and melee weapons should be 966 * all skill-based attacks, ie hth, missile and melee weapons should be
1022 * treated here. If an opponent is already supplied by move_player(), 967 * treated here. If an opponent is already supplied by move_player(),
1025 * 970 *
1026 * This is called by move_player() and attack_hth() 971 * This is called by move_player() and attack_hth()
1027 * 972 *
1028 * Initial implementation by -bt thomas@astro.psu.edu 973 * Initial implementation by -bt thomas@astro.psu.edu
1029 */ 974 */
1030
1031int 975int
1032skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill) 976skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill)
1033{ 977{
1034 sint16 tx, ty; 978 sint16 tx, ty;
1035 maptile *m; 979 maptile *m;
1042 ty = freearr_y[dir]; 986 ty = freearr_y[dir];
1043 987
1044 /* If we don't yet have an opponent, find if one exists, and attack. 988 /* If we don't yet have an opponent, find if one exists, and attack.
1045 * Legal opponents are the same as outlined in move_player_attack() 989 * Legal opponents are the same as outlined in move_player_attack()
1046 */ 990 */
1047 991 if (!tmp)
1048 if (tmp == NULL)
1049 { 992 {
1050 m = pl->map; 993 m = pl->map;
1051 tx = pl->x + freearr_x[dir]; 994 tx = pl->x + freearr_x[dir];
1052 ty = pl->y + freearr_y[dir]; 995 ty = pl->y + freearr_y[dir];
1053 996
1063 if ((QUERY_FLAG (tmp, FLAG_ALIVE) && tmp->stats.hp >= 0) || QUERY_FLAG (tmp, FLAG_CAN_ROLL) || tmp->type == LOCKED_DOOR) 1006 if ((QUERY_FLAG (tmp, FLAG_ALIVE) && tmp->stats.hp >= 0) || QUERY_FLAG (tmp, FLAG_CAN_ROLL) || tmp->type == LOCKED_DOOR)
1064 { 1007 {
1065 /* Don't attack party members */ 1008 /* Don't attack party members */
1066 if ((pl->type == PLAYER && tmp->type == PLAYER) && (pl->contr->party != NULL && pl->contr->party == tmp->contr->party)) 1009 if ((pl->type == PLAYER && tmp->type == PLAYER) && (pl->contr->party != NULL && pl->contr->party == tmp->contr->party))
1067 return 0; 1010 return 0;
1011
1068 break; 1012 break;
1069 } 1013 }
1070 } 1014 }
1015
1071 if (!tmp) 1016 if (!tmp)
1072 { 1017 {
1073 if (pl->type == PLAYER) 1018 if (pl->type == PLAYER)
1074 new_draw_info (NDI_UNIQUE, 0, pl, "There is nothing to attack!"); 1019 new_draw_info (NDI_UNIQUE, 0, pl, "There is nothing to attack!");
1020
1075 return 0; 1021 return 0;
1076 } 1022 }
1077 1023
1078 return do_skill_attack (tmp, pl, string, skill); 1024 return do_skill_attack (tmp, pl, string, skill);
1079} 1025}
1080
1081 1026
1082/* attack_hth() - this handles all hand-to-hand attacks -b.t. */ 1027/* attack_hth() - this handles all hand-to-hand attacks -b.t. */
1083 1028
1084/* July 5, 1995 - I broke up attack_hth() into 2 parts. In the first 1029/* July 5, 1995 - I broke up attack_hth() into 2 parts. In the first
1085 * (attack_hth) we check for weapon use, etc in the second (the new 1030 * (attack_hth) we check for weapon use, etc in the second (the new
1086 * function skill_attack() we actually attack. 1031 * function skill_attack() we actually attack.
1087 */ 1032 */
1088
1089static int 1033static int
1090attack_hth (object *pl, int dir, const char *string, object *skill) 1034attack_hth (object *pl, int dir, const char *string, object *skill)
1091{ 1035{
1092 object *enemy = NULL, *weapon; 1036 object *enemy = NULL, *weapon;
1093 1037
1102 if (pl->type == PLAYER) 1046 if (pl->type == PLAYER)
1103 { 1047 {
1104 new_draw_info (NDI_UNIQUE, 0, pl, "You unwield your weapon in order to attack."); 1048 new_draw_info (NDI_UNIQUE, 0, pl, "You unwield your weapon in order to attack.");
1105 esrv_update_item (UPD_FLAGS, pl, weapon); 1049 esrv_update_item (UPD_FLAGS, pl, weapon);
1106 } 1050 }
1051
1107 break; 1052 break;
1108 } 1053 }
1109 } 1054 }
1055
1110 return skill_attack (enemy, pl, dir, string, skill); 1056 return skill_attack (enemy, pl, dir, string, skill);
1111} 1057}
1112
1113 1058
1114/* attack_melee_weapon() - this handles melee weapon attacks -b.t. 1059/* attack_melee_weapon() - this handles melee weapon attacks -b.t.
1115 * For now we are just checking to see if we have a ready weapon here. 1060 * For now we are just checking to see if we have a ready weapon here.
1116 * But there is a real neato possible feature of this scheme which 1061 * But there is a real neato possible feature of this scheme which
1117 * bears mentioning: 1062 * bears mentioning:
1118 * Since we are only calling this from do_skill() in the future 1063 * Since we are only calling this from do_skill() in the future
1119 * we may make this routine handle 'special' melee weapons attacks 1064 * we may make this routine handle 'special' melee weapons attacks
1120 * (like disarming manuever with sai) based on player SK_level and 1065 * (like disarming manuever with sai) based on player SK_level and
1121 * weapon type. 1066 * weapon type.
1122 */ 1067 */
1123
1124static int 1068static int
1125attack_melee_weapon (object *op, int dir, const char *string, object *skill) 1069attack_melee_weapon (object *op, int dir, const char *string, object *skill)
1126{ 1070{
1127 1071
1128 if (!QUERY_FLAG (op, FLAG_READY_WEAPON)) 1072 if (!QUERY_FLAG (op, FLAG_READY_WEAPON))
1129 { 1073 {
1130 if (op->type == PLAYER) 1074 if (op->type == PLAYER)
1131 new_draw_info (NDI_UNIQUE, 0, op, "You have no ready weapon to attack with!"); 1075 new_draw_info (NDI_UNIQUE, 0, op, "You have no ready weapon to attack with!");
1076
1132 return 0; 1077 return 0;
1133 } 1078 }
1079
1134 return skill_attack (NULL, op, dir, string, skill); 1080 return skill_attack (NULL, op, dir, string, skill);
1135 1081
1136} 1082}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines