Manual:DIL Manual/abilities
Jump to navigation
Jump to search
Contents
abilities
Field (integer, read/write; units: characters).
ch.abilities[i] : integer
One of the character's abilities. i is an ABIL_ constant from vme.h: ABIL_MAG (0), ABIL_DIV, ABIL_STR, ABIL_DEX, ABIL_CON, ABIL_CHA, ABIL_BRA, ABIL_HP (7). Players raise them by training. In an NPC the zone file gives a share for each (MSET_ABILITY in wmacros.h; vmc wants them to add up to 100), and vmc turns the shares into values for the NPC's level.
The zones use them as the ability half of skill checks, and for things like carrying capacity (baseget.zon: 2 * pc.abilities[ABIL_STR]).
Notes
- It fails when
iis outside 0 to 7, and on an object, a room or null. - On an NPC any program can assign it. On a player only a program in a zone with access level 0 (the fourth column of
vme/etc/zonelist) can; what counts is the zone of the program running on the unit, not that of a function it calls. Elsewhere vmc accepts the assignment, but at run time the program logs "DIL SERIOUS: ... Type error in lvalue assignemt" and stops. Reading works in every zone. - Stored as a 16-bit number. Bonuses from equipment and spells are affects (
APF_ABILITY, see addaff()) that change this value while they last. Such an affect onABIL_HPalso recomputes max_hp; assigning the field does not.
Example
dilbegin integer carry_capacity(pc : unitptr);
code
{
return (100 + ((pc.baseweight - 100) / 2) + (2 * pc.abilities[ABIL_STR]));
}
dilend
How much weight a character can carry, as in baseget.zon.