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

Comparing deliantra/server/common/item.C (file contents):
Revision 1.58 by root, Mon Oct 12 14:00:57 2009 UTC vs.
Revision 1.60 by root, Thu Oct 15 20:12:35 2009 UTC

170 {SPELLBOOK, "spellbook", "spellbooks", SK_LITERACY, 0}, 170 {SPELLBOOK, "spellbook", "spellbooks", SK_LITERACY, 0},
171 {CLOAK, "cloak", "cloaks", SK_SMITHERY, 0}, 171 {CLOAK, "cloak", "cloaks", SK_SMITHERY, 0},
172 {SPINNER, "spinner", "spinners", 0, 0}, 172 {SPINNER, "spinner", "spinners", 0, 0},
173 {GATE, "gate", "gates", 0, 0}, 173 {GATE, "gate", "gates", 0, 0},
174 {BUTTON, "button", "buttons", 0, 0}, 174 {BUTTON, "button", "buttons", 0, 0},
175 {CF_HANDLE, "cf handle", "cf handles", 0, 0}, 175 {T_HANDLE, "cf handle", "cf handles", 0, 0},
176 {HOLE, "hole", "holes", 0, 0}, 176 {HOLE, "hole", "holes", 0, 0},
177 {TRAPDOOR, "trapdoor", "trapdoors", 0, 0}, 177 {TRAPDOOR, "trapdoor", "trapdoors", 0, 0},
178 {SIGN, "sign", "signs", 0, 0}, 178 {SIGN, "sign", "signs", 0, 0},
179 {BOOTS, "boots", "boots", SK_SMITHERY, 0}, 179 {BOOTS, "boots", "boots", SK_SMITHERY, 0},
180 {GLOVES, "gloves", "gloves", SK_SMITHERY, 0}, 180 {GLOVES, "gloves", "gloves", SK_SMITHERY, 0},
381 * but do put a newline at the end. Useful when dumping to files 381 * but do put a newline at the end. Useful when dumping to files
382 */ 382 */
383const char * 383const char *
384describe_resistance (const object *op, int newline) 384describe_resistance (const object *op, int newline)
385{ 385{
386 static char buf[VERY_BIG_BUF]; 386 static dynbuf_text buf; buf.clear ();
387 char buf1[VERY_BIG_BUF];
388 int tmpvar;
389 387
390 buf[0] = 0; 388 for (int i = 0; i < NROFATTACKS; i++)
391 for (tmpvar = 0; tmpvar < NROFATTACKS; tmpvar++)
392 {
393 if (op->resist[tmpvar] && (op->type != FLESH || atnr_is_dragon_enabled (tmpvar) == 1)) 389 if (op->resist[i] && (op->type != FLESH || atnr_is_dragon_enabled (i) == 1))
394 { 390 buf.printf (newline ? "%s %d\n" : "(%s %+d)", resist_plus[i], op->resist[i]);
395 if (!newline)
396 sprintf (buf1, "(%s %+d)", resist_plus[tmpvar], op->resist[tmpvar]);
397 else
398 sprintf (buf1, "%s %d\n", resist_plus[tmpvar], op->resist[tmpvar]);
399
400 strcat (buf, buf1);
401 }
402 }
403 391
404 return buf; 392 return buf;
405} 393}
406 394
407 395

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines