Crossfire Server, Trunk  R22010
potion.c 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.c:

Go to the source code of this file.


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

Detailed Description

The implementation of the Potion class of objects.

Definition in file potion.c.

Function Documentation

◆ init_type_potion()

void init_type_potion ( void  )

Initializer for the potion object type.

Definition at line 34 of file potion.c.

References 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 ( ob_methods context,
object *  potion,
object *  applier,
int  aflags 

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

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

Definition at line 46 of file potion.c.

References add_string(), apply_handle_yield(), arch_to_object(), AT_DEPLETE, AT_GODPOWER, cast_spell(), change_abil(), change_resist_msg, CLEAR_FLAG, create_archetype(), drain_stat(), draw_ext_info(), draw_ext_info_format(), EXPLODING_FIREBALL, fix_object(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_REMOVED, FORCE_NAME, free_string(), identify(), MAX_BUF, METHOD_OK, MIN, MOVE_PER_SECOND, MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, MSG_TYPE_APPLY_FAILURE, MSG_TYPE_APPLY_SUCCESS, treasureliststruct::name, NDI_RED, NDI_UNIQUE, NROFATTACKS, object_decrease_nrof_by_one, object_insert_in_map_at(), object_insert_in_ob(), play_sound_map(), PREFER_LOW, QUERY_FLAG, random_roll(), remove_depletion(), SET_FLAG, snprintf, SOUND_TYPE_ITEM, and store_spell_expiry().

Referenced by init_type_potion().

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