


/inherit/item.c(1)                             /inherit/item.c(1)


DDEESSCCRRIIPPTTIIOONN
       //iinnhheerriitt//iitteemm..cc  is  the base object for all items. `Item'
       is any non-living object that player can carry or interact
       with.  Excluding  players, monsters and rooms, most object
       fall into this category.



IINNHHEERRIITTEEDD
       /inherit/item.c inherits //iinnhheerriitt//bbaassee..cc


VVAARRIIAABBLLEESS
       _i_n_t _x_d_i_m_, _y_d_i_m_, _z_d_i_m
              These variables describe the physical  size  of  an
              object.  For the sake of simplicity these variables
              define the smallest bbooxx the item can  fit  in.  The
              order of these (width, height, depth) is not impor              tant.


       _i_n_t _w_e_i_g_h_t
              Weight defines the weight  of  an  item  in  ggrraammss..
              Objects without weight cannot be created.


       _s_t_r_i_n_g _s_m_e_l_l_, _s_t_r_i_n_g _t_a_s_t_e_, _s_t_r_i_n_g _l_i_s_t_e_n
              Instead  of  items  being just visual, smell, taste
              and possible sounds can be  defined  into  them  to
              make  them  more unique. These aren't mandatory but
              it's recommended to include them in your items.


       _i_n_t _h_p_, _i_n_t _m_a_x_h_p
              These define the condition of an item.  Every  time
              the item is damaged, hitpoints are reduced and when
              they reach zero the  item  is  useless  and  beyond
              repair.


       _i_n_t _n_o___g_e_t
              If  no_get  is 1, the item cannot be taken or moved
              by players. 0 is the default.


       _i_n_t _l_i_g_h_t
              `light' describes the amount of light  item  emits.
              It  can  vary from -2 to +2.  -2 and +2 are magical
              lights while -1 to +1 are mundane. One  should  use
              set_light() function for defining this variable.


       _m_a_p_p_i_n_g _m_a_t_e_r_i_a_l_s
              This  defines  the  materials  the  item is created



                        MAJIK INHERITABLES                      1





/inherit/item.c(1)                             /inherit/item.c(1)


              from. This variable shouldn't be accessed directly,
              but  through  the set_material() function described
              below.  Every item should have a material.


       _m_a_p_p_i_n_g _p_r_o_p_e_r_t_i_e_s
              This defines the special properties of an item, for
              example stat bonuses when held. This should be also
              accessed through set_property() function.



FFUUNNCCTTIIOONNSS
       _i_n_t _g_e_t_(_o_b_j_e_c_t _t_a_r_g_e_t_)
              get() is meant for moving items. It checks  whether
              the  item  can  be  moved  and updates light levels
              accordingly.


       _i_n_t _q_u_e_r_y___v_a_l_u_e_(_)
              query_value() tries to approximate the value of  an
              item from weight and material of an item.


       _v_o_i_d _w_e_a_r_(_)
              Every  time  when item is worn, the wear() function
              is called. Normally this isn't defined, but you may
              create  special  effects  (emotes,  ...)  with this
              function.


       _v_o_i_d _u_n_w_e_a_r_(_)
              unwear() is called when player removes an item.  It
              behaves exactly like wear().


       _m_i_x_e_d _s_e_t___m_a_t_e_r_i_a_l_(_s_t_r_i_n_g _m_a_t_e_r_i_a_l _| _m_a_p_p_i_n_g _m_a_t_e_r_i_a_l_s_)
              One  must  define the material for each object. The
              set_material() works in two ways.

              First, you can just give the name of the  material,
              and  the item will be made from that material only.

              TTHHOOBB-->>sseett__mmaatteerriiaall((""wwoooodd""));;

              Second, you can give mapping as  an  argument  when
              you  want  your  item  to be consisted from several
              materials.

              TTHHOOBB-->>sseett__mmaatteerriiaall(( (([[ wwoooodd :: 9900,, iirroonn :: 1100 ]])) ));;

              would set item to be 90% wood and 10% iron.





                        MAJIK INHERITABLES                      2





/inherit/item.c(1)                             /inherit/item.c(1)


       _s_t_r_i_n_g _q_u_e_r_y___c_o_n_d_(_)
              query_cond() returns the verbal approximation  from
              the  condition of an item.  The condition string is
              dependent on the per cent of hitpoints left.


       _s_t_r_i_n_g _q_u_e_r_y___w_e_i_g_h_t_s_t_r_(_)
              query_weightstr() returns the verbal  approximation
              for the weight of an item.


       _i_n_t _q_u_e_r_y___l_o_n_g_e_s_t___d_i_m_(_)
              This  function  returns the longest dimension of an
              object, for example the length of a sword.


       _i_n_t _q_u_e_r_y___v_o_l_u_m_e_(_)
              query_volume() returns approximation of total  vol              ume  needed by an item to be stored in a container.


       _s_t_r_i_n_g _i_d_e_n_t_i_f_y_(_)
              identify() returns special and detailed information
              about  item,  including exact weight and approxima              tion of item's properties and materials.


       _i_n_t _s_e_t___l_i_g_h_t_(_i_n_t _l_i_g_h_t_l_e_v_e_l_)
              set_light() defines the light level  of  an  object
              (see variable `light' above).



























                        MAJIK INHERITABLES                      3


