Crossfire Server, Trunk
|
Go to the source code of this file.
Functions | |
void | init_type_lightable (void) |
static uint8_t | is_better_lighter (object *new, object *old) |
static method_ret | lightable_type_apply (object *lightable, object *applier, int aflags) |
Implementation of the Lightable class of objects.
This allows us to make lightable objects be lit by simply applying them, rather than by marking the lightable item, then applying the lighter.
Definition in file lightable.c.
void init_type_lightable | ( | void | ) |
Initializer for the LIGHTABLE object type.
Definition at line 32 of file lightable.c.
References LIGHTABLE, lightable_type_apply(), and register_apply().
Referenced by register_all_ob_types().
Method to clean up priority calculations
Priority goes in this order: WEAPON -> highest priority, use first encountered SKILL -> flame touch or clawing only LIGHTER -> next priority, prioritize ones with speed, as they will decay on their own. SPELL -> next priority, lower mana cost is better (ignores level scaling, since we are using that spell in a careful, low-energy way) SKILL, SKILL_TOOL -> fire magic skills only. Uses 10 mana.
new | The item we are checking to see if it's better. |
old | The previous best tool we found. Can be NULL. |
Definition at line 56 of file lightable.c.
References liv::grace, LIGHTER, SK_CLAWING, SK_FLAME_TOUCH, SKILL, SKILL_TOOL, liv::sp, obj::speed, SPELL, obj::stats, obj::subtype, obj::type, and WEAPON.
Referenced by lightable_type_apply().
|
static |
Attempt to find a lighter, wielded fire weapon, or fire spell to light with.
lightable | The lightable object we applied. |
applier | The object applying the lightable object. Usually will be a player, but not guaranteed. |
aflags | special flags (always apply/unapply) |
Definition at line 106 of file lightable.c.
References apply_manual(), AT_FIRE, obj::attacktype, obj::contr, obj::count, obj::current_weapon, do_light(), draw_ext_info_format(), find_marked_object(), FLAG_CURSED, FLAG_DAMNED, FOR_INV_FINISH, FOR_INV_PREPARE, liv::grace, is_better_lighter(), LIGHTER, pl::mark, pl::mark_count, METHOD_OK, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, obj::name, NDI_UNIQUE, PLAYER, QUERY_FLAG, SK_CLAWING, SK_FIRE_MAGIC, SK_FLAME_TOUCH, SK_PYROMANCY, SKILL, SKILL_TOOL, liv::sp, SPELL, obj::stats, obj::subtype, Ice::tmp, obj::type, and WEAPON.
Referenced by init_type_lightable().