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

Go to the source code of this file.

Functions

static method_ret armour_improver_type_apply (object *lighter, object *applier, int aflags)
 
static void improve_armour (object *op, object *improver, object *armour)
 
void init_type_armour_improver (void)
 

Detailed Description

Armour improvement scrolls.

Definition in file armour_improver.cpp.

Function Documentation

◆ armour_improver_type_apply()

static method_ret armour_improver_type_apply ( object scroll,
object applier,
int  aflags 
)
static

Applies a scroll of Enchant Armour.

Parameters
scrollscroll to apply.
applierobject attempting to apply the scroll. Should be a player.
aflagsspecial flags (always apply/unapply).
Returns
METHOD_OK if applier is a player, METHOD_UNHANDLED else.

Definition at line 144 of file armour_improver.cpp.

References ARMOUR, BOOTS, BRACERS, CLOAK, draw_ext_info(), find_marked_object(), FLAG_WIZCAST, get_map_flags(), GLOVES, HELMET, improve_armour(), object::map, METHOD_OK, METHOD_UNHANDLED, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_SUCCESS, NDI_UNIQUE, P_NO_MAGIC, PLAYER, QUERY_FLAG, SHIELD, object::type, nlohmann::detail::void(), object::x, and object::y.

Referenced by init_type_armour_improver().

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

◆ improve_armour()

static void improve_armour ( object op,
object improver,
object armour 
)
static

This code deals with the armour improvment scrolls. Change limits on improvement - let players go up to +5 no matter what level, but they are limited by item power. Try to use same improvement code as in the common/treasure.c file, so that if you make a +2 full helm, it will be just the same as one you find in a shop.

Parameters
opplayer improving the armor.
improverimprovement scroll.
armourarmour to improve.

Definition at line 59 of file armour_improver.cpp.

References AP_UNAPPLY, apply_special(), Settings::armor_max_enchant, draw_ext_info(), esrv_update_item(), fix_object(), FLAG_APPLIED, object::item_power, Settings::item_power_factor, llevInfo, LOG(), object::magic, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, NDI_UNIQUE, object::nrof, object_decrease_nrof_by_one, object_insert_in_ob(), object_split(), give::op, PLAYER, QUERY_FLAG, set_abs_magic(), settings, object::title, Ice::tmp, UPD_NAME, UPD_NROF, UPD_WEIGHT, and object::weight.

Referenced by armour_improver_type_apply().

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

◆ init_type_armour_improver()

void init_type_armour_improver ( void  )

Initializer for the ARMOUR_IMPROVER object type.

Definition at line 39 of file armour_improver.cpp.

References ARMOUR_IMPROVER, armour_improver_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: