Manual:DIL Manual/ability costs
Jump to navigation
Jump to search
Contents
ability_costs
Field (integer, read-only; units: PC).
pc.ability_costs[i] : integer
The player's racial modifier for training ability i: the race line for the player's race in vme/etc/abilities.def, for example 2 for an elf's magic and -3 for a dwarf's. Added to the profession's modifier it sets how much training the ability costs: the higher the sum, the cheaper, and below 1 the player can train it only once per level. It is not the cost itself. i is an ABIL_ constant from vme.h, ABIL_MAG (0) to ABIL_HP (7).
Notes
- Players only. On an NPC, an object, a room or null it fails, and also when
iis outside 0 to 7. - It is 0 when the player's race is outside the table (100 or more).
- vmc accepts an assignment, but it never works: at run time the program logs "DIL SERIOUS: ... Type error in lvalue assignemt" and stops.
Example
dilbegin string race_bonus(pc : unitptr, i : integer);
var
n : integer;
code
{
n := pc.ability_costs[i];
if (n > 0)
return ("+" + itoa(n));
return (itoa(n));
}
dilend
Shows a player's racial modifier for an ability, with its sign.