Crossfire Server, Trunk
|
Go to the source code of this file.
Functions | |
void | init_type_lightable (void) |
static uint8_t | is_better_lighter (object *current, 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.cpp.
void init_type_lightable | ( | void | ) |
Initializer for the LIGHTABLE object type.
Definition at line 32 of file lightable.cpp.
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.
current | 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.cpp.
References replace::current, living::grace, LIGHTER, SK_CLAWING, SK_FLAME_TOUCH, SKILL, SKILL_TOOL, living::sp, object::speed, SPELL, object::stats, object::subtype, object::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.cpp.
References apply_manual(), AT_FIRE, object::attacktype, object::contr, object::count, object::current_weapon, do_light(), draw_ext_info_format(), find_marked_object(), FLAG_CURSED, FLAG_DAMNED, FOR_INV_FINISH, FOR_INV_PREPARE, living::grace, is_better_lighter(), LIGHTER, player::mark, player::mark_count, METHOD_OK, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, object::name, NDI_UNIQUE, PLAYER, QUERY_FLAG, SK_CLAWING, SK_FIRE_MAGIC, SK_FLAME_TOUCH, SK_PYROMANCY, SKILL, SKILL_TOOL, living::sp, SPELL, object::stats, object::subtype, Ice::tmp, object::type, and WEAPON.
Referenced by init_type_lightable().