… | |
… | |
299 | if (op->type == WEAPON) |
299 | if (op->type == WEAPON) |
300 | { |
300 | { |
301 | for (i = 1; i < NROFATTACKS; i++) |
301 | for (i = 1; i < NROFATTACKS; i++) |
302 | if (op->attacktype & (1 << i)) |
302 | if (op->attacktype & (1 << i)) |
303 | enc++; |
303 | enc++; |
|
|
304 | |
304 | if (op->slaying) |
305 | if (op->slaying) |
305 | enc += 2; /* What it slays is probably more relevent */ |
306 | enc += 2; /* What it slays is probably more relevent */ |
306 | } |
307 | } |
|
|
308 | |
307 | /* Items the player can equip */ |
309 | /* Items the player can equip */ |
308 | if ((op->type == WEAPON) || (op->type == ARMOUR) || (op->type == HELMET) || |
310 | if ((op->type == WEAPON) || (op->type == ARMOUR) || (op->type == HELMET) || |
309 | (op->type == SHIELD) || (op->type == RING) || |
311 | (op->type == SHIELD) || (op->type == RING) || |
310 | (op->type == BOOTS) || (op->type == GLOVES) || |
312 | (op->type == BOOTS) || (op->type == GLOVES) || |
311 | (op->type == AMULET) || (op->type == GIRDLE) || (op->type == BRACERS) || (op->type == CLOAK)) |
313 | (op->type == AMULET) || (op->type == GIRDLE) || (op->type == BRACERS) || (op->type == CLOAK)) |
… | |
… | |
314 | enc += op->stats.hp; /* hp regen */ |
316 | enc += op->stats.hp; /* hp regen */ |
315 | enc += op->stats.sp; /* mana regen */ |
317 | enc += op->stats.sp; /* mana regen */ |
316 | enc += op->stats.grace; /* grace regen */ |
318 | enc += op->stats.grace; /* grace regen */ |
317 | enc += op->stats.exp; /* speed bonus */ |
319 | enc += op->stats.exp; /* speed bonus */ |
318 | } |
320 | } |
|
|
321 | |
319 | enc += op->stats.luck; |
322 | enc += op->stats.luck; |
320 | |
323 | |
321 | /* Do spell paths now */ |
324 | /* Do spell paths now */ |
322 | for (i = 1; i < NRSPELLPATHS; i++) |
325 | for (i = 1; i < NRSPELLPATHS; i++) |
323 | { |
326 | { |
… | |
… | |
355 | int i; |
358 | int i; |
356 | |
359 | |
357 | for (i = 0; i < item_types_size; i++) |
360 | for (i = 0; i < item_types_size; i++) |
358 | if (item_types[i].number == itemtype) |
361 | if (item_types[i].number == itemtype) |
359 | return &item_types[i]; |
362 | return &item_types[i]; |
|
|
363 | |
360 | return NULL; |
364 | return NULL; |
361 | } |
365 | } |
362 | |
366 | |
363 | /* returns the typedata that has a name equal to itemtype, if there |
367 | /* returns the typedata that has a name equal to itemtype, if there |
364 | * isn't one, return the plural name that matches, if there still isn't |
368 | * isn't one, return the plural name that matches, if there still isn't |
… | |
… | |
369 | int i; |
373 | int i; |
370 | |
374 | |
371 | for (i = 0; i < item_types_size; i++) |
375 | for (i = 0; i < item_types_size; i++) |
372 | if (!strcmp (item_types[i].name, name)) |
376 | if (!strcmp (item_types[i].name, name)) |
373 | return &item_types[i]; |
377 | return &item_types[i]; |
|
|
378 | |
374 | for (i = 0; i < item_types_size; i++) |
379 | for (i = 0; i < item_types_size; i++) |
375 | if (!strcmp (item_types[i].name_pl, name)) |
380 | if (!strcmp (item_types[i].name_pl, name)) |
376 | { |
381 | { |
377 | LOG (llevInfo, |
382 | LOG (llevInfo, |
378 | "get_typedata_by_name: I have been sent the plural %s, the singular form %s is preffered\n", name, item_types[i].name); |
383 | "get_typedata_by_name: I have been sent the plural %s, the singular form %s is prefered\n", name, item_types[i].name); |
379 | return &item_types[i]; |
384 | return &item_types[i]; |
380 | } |
385 | } |
|
|
386 | |
381 | return NULL; |
387 | return NULL; |
382 | } |
388 | } |
383 | |
389 | |
384 | /* describe_resistance generates the visible naming for resistances. |
390 | /* describe_resistance generates the visible naming for resistances. |
385 | * returns a static array of the description. This can return |
391 | * returns a static array of the description. This can return |