[ Index ]

PHP Cross Reference of miniNEAB Engine

title

Body

[close]

/ -> objects_util.php (summary)

Functions which deals with objects and inventory used in the game.

Author: Alain Bertrand - (c) 2005-2006
File Size: 522 lines (15 kb)
Included or required: 11 times
Referenced: 0 times
Includes or requires: 0 files

Defines 17 functions

  inventory_other_add()
  is_craftable()
  know_blueprint()
  unweare()
  weare()
  store_weared()
  clean_used()
  used_level()
  quick_restore()
  macro_inventory_add()
  find_best_object()
  inventory_add()
  furniture_add()
  inventory_check()
  object_info()
  object_link()
  use_object()

Functions
Functions that are not part of a class:

inventory_other_add($userid,$item,$quantity,$used=100)   X-Ref
Adds an item to someone else (not the current player)

param: integer $userid (user which will receive/lose this item)
param: integer $item (item to receive/remove)
param: integer $quantity (if negative it will remove it)
param: integer $used (the quality of the object, where 100 is perfect)

is_craftable($id)   X-Ref
Checks if an item is craftable

param: integer $id
return: boolean

know_blueprint($id)   X-Ref
Checks if the player knows the blueprint of this item.

param: integer $id
return: boolean

unweare($slot,$store=true)   X-Ref
Unwear a slot (specify the slot name)

param: string $slot (slot to unwear)
param: boolean $store (true the stats needs to be re-calculated)
return: integer (returns the ID of the object which was in this slot)

weare($slot,$id,$store=true)   X-Ref
Wears an object

param: string $slot (slot to wear)
param: integer $id (id of the object to wear)
param: boolean $store (true the stats needs to be re-calculated)
return: integer

store_weared()   X-Ref
Stores in one shoot all the stats and the slots


clean_used($id)   X-Ref
Cleanup the used table

param: integer $id (object id)

used_level($id)   X-Ref
Returns the usage level of a given item.

param: integer $id (object id)
return: integer

quick_restore($id)   X-Ref
Restore a quick slot.

param: integer $id (slot number between 0 and 3)
return: string (to display)

macro_inventory_add($item,$quantity)   X-Ref
Adds an item to the inventory and display a message.

param: integer $item
param: integer $quantity

find_best_object($item)   X-Ref
Finds the level of the less used item specified.

param: integer $item
return: integer

inventory_add($item,$quantity,$used=100)   X-Ref
Adds an item to the inventory. (no message)

param: integer $item
param: integer $quantity
param: integer $used
return: integer the new quantity the player have

furniture_add($item,$quantity)   X-Ref
Adds a player dungeon furniture.

param: integer $item
param: integer $quantity

inventory_check($item,$used=-1)   X-Ref
Checks if the player have this item.

param: integer $item (item to check)
param: integer $used (level of usage (-1 == any))
return: integer (number of those items owned)

object_info($item)   X-Ref
Retreive the information about an object.

param: integer $item
return: array

object_link($id,$name)   X-Ref
Create an html link to pop up a window which shows info about the object

param: integer $id (object to inspect)
param: string $name (name used in the link)
return: string (html code)

use_object($id,$max=0)   X-Ref
Decrease the usage level (== more used)

param: integer $id (id of the object)
param: integer $max (max level in case it's the first time we use this object)
return: boolean (false == now the object is destroyed)



Generated: Sun Mar 11 17:28:20 2007 Cross-referenced by PHPXref 0.7