Crossfire Server, Trunk
potion.cpp File Reference
#include "global.h"
#include <string.h>
#include "ob_methods.h"
#include "ob_types.h"
#include "sounds.h"
#include "sproto.h"
+ Include dependency graph for potion.cpp:

Go to the source code of this file.

Functions

void init_type_potion (void)
 
static method_ret potion_type_apply (object *potion, object *applier, int aflags)
 

Detailed Description

The implementation of the Potion class of objects.

Definition in file potion.cpp.

Function Documentation

◆ init_type_potion()

void init_type_potion ( void  )

Initializer for the potion object type.

Definition at line 33 of file potion.cpp.

References POTION, potion_type_apply(), and register_apply().

Referenced by register_all_ob_types().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ potion_type_apply()

static method_ret potion_type_apply ( object potion,
object applier,
int  aflags 
)
static

Handles applying a potion, dust, balm, or figurine.

Parameters
potionThe potion to apply
applierThe object attempting to apply the potion
aflagsSpecial flags (always apply/unapply)
Returns
METHOD_OK unless failure for some reason.

Definition at line 44 of file potion.cpp.

References add_string(), apply_handle_yield(), arch_to_object(), AT_DEPLETE, AT_GODPOWER, object::attacktype, cast_spell(), change_abil(), change_resist_msg, CLEAR_FLAG, object::contr, create_archetype(), object::dam_modifier, drain_stat(), draw_ext_info(), draw_ext_info_format(), EXPLODING_FIREBALL, object::facing, fix_object(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_REMOVED, dragon_attune::force, FORCE_NAME, free_string(), identify(), INS_ON_TOP, object::inv, object::level, player::levgrace, player::levhp, player::levsp, object::map, MAX_BUF, living::maxhp, METHOD_OK, MIN, MOVE_PER_SECOND, MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, MSG_TYPE_APPLY_FAILURE, MSG_TYPE_APPLY_SUCCESS, give::name, object::name, NDI_RED, NDI_UNIQUE, NROFATTACKS, object_decrease_nrof_by_one, object_insert_in_map_at(), object_insert_in_ob(), object::other_arch, play_sound_map(), PLAYER, POTION_RESIST_EFFECT, PREFER_LOW, QUERY_FLAG, random_roll(), remove_depletion(), object::resist, SET_FLAG, SOUND_TYPE_ITEM, object::stats, store_spell_expiry(), object::type, object::value, nlohmann::detail::void(), object::x, and object::y.

Referenced by init_type_potion().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: