Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
INVENTORY

Interface User Interface. More...

Functions

T_void InventoryAddObjectToInventory (E_inventoryType which, T_word16 objID, T_byte8 numToAdd)
 
E_Boolean InventoryAutoEquipItemInMouseHand (T_void)
 
T_void InventoryAutoStoreItemInMouseHand (T_void)
 
E_Boolean InventoryCanTakeItem (T_3dObject *item)
 
E_Boolean InventoryCanUseItem (T_inventoryItemStruct *p_inv)
 
E_Boolean InventoryCanUseItemInReadyHand (T_void)
 
E_Boolean InventoryCheckClassCanUseArmor (T_inventoryItemStruct *p_inv, E_Boolean showMessage)
 
E_Boolean InventoryCheckClassCanUseWeapon (T_inventoryItemStruct *p_inv, E_Boolean showMessage)
 
T_inventoryItemStructInventoryCheckItemInInventoryArea (T_word16 x, T_word16 y)
 
T_inventoryItemStructInventoryCheckItemInMouseHand (T_void)
 
T_inventoryItemStructInventoryCheckItemInReadyHand (T_void)
 
T_3dObjectInventoryCheckObjectInEquipmentArea (T_word16 x, T_word16 y)
 
T_3dObjectInventoryCheckObjectInInventoryArea (T_word16 x, T_word16 y)
 
T_3dObjectInventoryCheckObjectInMouseHand (T_void)
 
T_3dObjectInventoryCheckObjectInReadyHand (T_void)
 
T_void InventoryClear (E_inventoryType which)
 
T_void InventoryClearObjectInMouseHand (T_void)
 
T_void InventoryCloseStoreInventory (T_void)
 
E_Boolean InventoryCreateObjectInHand (T_word16 itemTypeNum)
 
T_void InventoryDebugDump (E_inventoryType which)
 
T_void InventoryDestroyItemInMouseHand (T_void)
 
E_Boolean InventoryDestroyOn (E_effectTriggerType trigger, E_equipLocations location)
 
T_word16 InventoryDestroyRandomEquippedItem (T_void)
 
T_word16 InventoryDestroyRandomStoredItem (T_void)
 
E_Boolean InventoryDestroySpecificItem (E_inventoryType whichInventory, T_word16 objectType, T_word16 numToDestroy)
 
E_Boolean InventoryDoEffect (E_effectTriggerType trigger, E_equipLocations location)
 
T_void InventoryDrawEquipmentWindow (T_void)
 
T_void InventoryDrawInventoryWindow (E_inventoryType which)
 
T_void InventoryDrawReadyArea (T_void)
 
E_Boolean InventoryEquipmentWindowIsAt (T_word16 locx, T_word16 locy)
 
T_void InventoryFindInventoryItemPage (E_inventoryType which, T_inventoryItemStruct *thisitem)
 
E_inventoryType InventoryFindInventoryWindow (T_word16 locx, T_word16 locy)
 
T_void InventoryFinish (T_void)
 
E_equipArmorTypes InventoryGetArmorType (E_equipLocations location)
 
T_void InventoryGoThroughAll (T_inventoryGoThroughAllCallback callback)
 
T_word16 InventoryHasItem (E_inventoryType whichInventory, T_word16 objectType)
 
T_void InventoryIdentifyAll (T_void)
 
T_void InventoryIdentifyReadied (T_void)
 
T_void InventoryInit (T_void)
 
E_Boolean InventoryInventoryWindowIsAt (T_word16 locx, T_word16 locy)
 
E_Boolean InventoryIsUseableByClass (T_inventoryItemStruct *p_inv)
 
T_void InventoryMoveInventoryWindowLocation (E_inventoryType type, T_word16 dx, T_word16 dy)
 
E_Boolean InventoryObjectIsInMouseHand (T_void)
 
E_Boolean InventoryObjectIsInReadyHand (T_void)
 
T_void InventoryOpenStoreInventory (T_void)
 
T_void InventoryPlayWeaponAttackSound (T_void)
 
T_void InventoryPlayWeaponHitSound (T_void)
 
T_void InventoryReadItemsList (FILE *fp)
 
E_Boolean InventoryReadyBoxIsAt (T_word16 locx, T_word16 locy)
 
T_void InventoryRemoveEquippedEffects (T_void)
 
T_void InventoryRemoveObjectFromInventory (E_inventoryType which, T_word16 objID, T_byte8 numToRemove)
 
T_void InventoryReorder (E_inventoryType which, E_Boolean multipage)
 
T_void InventoryResetUse (T_void)
 
T_void InventoryRestoreEquippedEffects (T_void)
 
T_void InventorySelectLastInventoryPage (E_inventoryType which)
 
T_void InventorySelectNextInventoryPage (E_inventoryType which)
 
T_void InventorySetDefaultInventoryForClass (T_void)
 
T_void InventorySetInventoryWindowLocation (E_inventoryType type, T_word16 x1, T_word16 y1, T_word16 x2, T_word16 y2, T_byte8 gx, T_byte8 gy, T_byte8 maxpages)
 
T_void InventorySetMouseHandPointer (T_doubleLinkListElement element)
 
T_void InventorySetObjectInMouseHand (T_doubleLinkListElement element)
 
E_Boolean InventoryShouldDestroyOn (E_effectTriggerType trigger, E_equipLocations location)
 
E_Boolean InventoryTakeItemFromWorld (T_3dObject *item, E_Boolean autoStore)
 
T_inventoryItemStructInventoryTakeObject (E_inventoryType which, T_3dObject *item)
 
E_Boolean InventoryThrowObjectIntoWorld (T_word16 x, T_word16 y)
 
T_doubleLinkListElement InventoryTransferItemBetweenInventories (T_inventoryItemStruct *p_inv, E_inventoryType source, E_inventoryType dest)
 
T_void InventoryTransferToAmmo (T_void)
 
T_void InventoryTransferToEquipment (T_word16 x, T_word16 y)
 
T_void InventoryTransferToFinances (T_void)
 
T_void InventoryTransferToInventory (T_word16 x, T_word16 y)
 
T_void InventoryTransferToReadyHand (T_void)
 
T_void InventoryUpdatePlayerEquipmentBodyParts (T_void)
 
T_void InventoryUseItem (T_inventoryItemStruct *p_inv)
 
T_void InventoryUseItemInReadyHand (T_buttonID buttonID)
 
E_Boolean InventoryWeaponIsBow (T_void)
 
T_void InventoryWriteItemsList (FILE *fp)
 

Detailed Description

Interface User Interface.

User Interface management and storing routines.

See Also
http://www.amuletsandarmor.com/AALicense.txt

Function Documentation

T_void InventoryAddObjectToInventory ( E_inventoryType  which,
T_word16  objID,
T_byte8  numToAdd 
)
E_Boolean InventoryAutoEquipItemInMouseHand ( T_void  )
T_void InventoryAutoStoreItemInMouseHand ( T_void  )
E_Boolean InventoryCanTakeItem ( T_3dObject item)
E_Boolean InventoryCanUseItem ( T_inventoryItemStruct p_inv)
E_Boolean InventoryCanUseItemInReadyHand ( T_void  )
E_Boolean InventoryCheckClassCanUseArmor ( T_inventoryItemStruct p_inv,
E_Boolean  showMessage 
)
E_Boolean InventoryCheckClassCanUseWeapon ( T_inventoryItemStruct p_inv,
E_Boolean  showMessage 
)
T_inventoryItemStruct* InventoryCheckItemInInventoryArea ( T_word16  x,
T_word16  y 
)
T_inventoryItemStruct* InventoryCheckItemInMouseHand ( T_void  )
T_inventoryItemStruct* InventoryCheckItemInReadyHand ( T_void  )
T_3dObject* InventoryCheckObjectInEquipmentArea ( T_word16  x,
T_word16  y 
)
T_3dObject* InventoryCheckObjectInInventoryArea ( T_word16  x,
T_word16  y 
)
T_3dObject* InventoryCheckObjectInMouseHand ( T_void  )
T_3dObject* InventoryCheckObjectInReadyHand ( T_void  )
T_void InventoryClear ( E_inventoryType  which)
T_void InventoryClearObjectInMouseHand ( T_void  )
T_void InventoryCloseStoreInventory ( T_void  )
E_Boolean InventoryCreateObjectInHand ( T_word16  itemTypeNum)
T_void InventoryDebugDump ( E_inventoryType  which)
T_void InventoryDestroyItemInMouseHand ( T_void  )
E_Boolean InventoryDestroyOn ( E_effectTriggerType  trigger,
E_equipLocations  location 
)
T_word16 InventoryDestroyRandomEquippedItem ( T_void  )
T_word16 InventoryDestroyRandomStoredItem ( T_void  )
E_Boolean InventoryDestroySpecificItem ( E_inventoryType  whichInventory,
T_word16  objectType,
T_word16  numToDestroy 
)
E_Boolean InventoryDoEffect ( E_effectTriggerType  trigger,
E_equipLocations  location 
)
T_void InventoryDrawEquipmentWindow ( T_void  )
T_void InventoryDrawInventoryWindow ( E_inventoryType  which)
T_void InventoryDrawReadyArea ( T_void  )
E_Boolean InventoryEquipmentWindowIsAt ( T_word16  locx,
T_word16  locy 
)
T_void InventoryFindInventoryItemPage ( E_inventoryType  which,
T_inventoryItemStruct thisitem 
)
E_inventoryType InventoryFindInventoryWindow ( T_word16  locx,
T_word16  locy 
)
T_void InventoryFinish ( T_void  )
E_equipArmorTypes InventoryGetArmorType ( E_equipLocations  location)
T_void InventoryGoThroughAll ( T_inventoryGoThroughAllCallback  callback)
T_word16 InventoryHasItem ( E_inventoryType  whichInventory,
T_word16  objectType 
)
T_void InventoryIdentifyAll ( T_void  )
T_void InventoryIdentifyReadied ( T_void  )
T_void InventoryInit ( T_void  )
E_Boolean InventoryInventoryWindowIsAt ( T_word16  locx,
T_word16  locy 
)
E_Boolean InventoryIsUseableByClass ( T_inventoryItemStruct p_inv)
T_void InventoryMoveInventoryWindowLocation ( E_inventoryType  type,
T_word16  dx,
T_word16  dy 
)
E_Boolean InventoryObjectIsInMouseHand ( T_void  )
E_Boolean InventoryObjectIsInReadyHand ( T_void  )
T_void InventoryOpenStoreInventory ( T_void  )
T_void InventoryPlayWeaponAttackSound ( T_void  )
T_void InventoryPlayWeaponHitSound ( T_void  )
T_void InventoryReadItemsList ( FILE *  fp)
E_Boolean InventoryReadyBoxIsAt ( T_word16  locx,
T_word16  locy 
)
T_void InventoryRemoveEquippedEffects ( T_void  )
T_void InventoryRemoveObjectFromInventory ( E_inventoryType  which,
T_word16  objID,
T_byte8  numToRemove 
)
T_void InventoryReorder ( E_inventoryType  which,
E_Boolean  multipage 
)
T_void InventoryResetUse ( T_void  )
T_void InventoryRestoreEquippedEffects ( T_void  )

if (G_equipEffectLevel==1)

T_void InventorySelectLastInventoryPage ( E_inventoryType  which)
T_void InventorySelectNextInventoryPage ( E_inventoryType  which)
T_void InventorySetDefaultInventoryForClass ( T_void  )
T_void InventorySetInventoryWindowLocation ( E_inventoryType  type,
T_word16  x1,
T_word16  y1,
T_word16  x2,
T_word16  y2,
T_byte8  gx,
T_byte8  gy,
T_byte8  maxpages 
)
T_void InventorySetMouseHandPointer ( T_doubleLinkListElement  element)
T_void InventorySetObjectInMouseHand ( T_doubleLinkListElement  element)
E_Boolean InventoryShouldDestroyOn ( E_effectTriggerType  trigger,
E_equipLocations  location 
)
E_Boolean InventoryTakeItemFromWorld ( T_3dObject item,
E_Boolean  autoStore 
)
T_inventoryItemStruct* InventoryTakeObject ( E_inventoryType  which,
T_3dObject item 
)
E_Boolean InventoryThrowObjectIntoWorld ( T_word16  x,
T_word16  y 
)

Where a thrown object starts

first, get a pointer to the object in the 'mouse hand'

Throw speed is based on the height of the mouse cursor.

Throw angle is based on the x of the mouse cursor.

Add it to my angle to get the absolute angle.

Now I need to calculate the starting coordinates of

the object being thrown. Start Z = my Z.

Add the delta Z to the player's height.

I need to place the object's center a distance

away from me equal to the sum of his and my radii.

To calculate X and Y, I need to move out from my center

along a line at the 'throwangle' angle. How far? Well,

it should start on or outside the circle which

circumscribes my bounding sqare. This circle has

radius sqrt(2) * halfwidth, so I'll use 1.5 * halfwidth

Tell the user the bad news.

We need to send a projectile packet to the server.

And, now that the server is about to create this new object,

we need to destroy our old copy.

The object is now out of our hands.

T_doubleLinkListElement InventoryTransferItemBetweenInventories ( T_inventoryItemStruct p_inv,
E_inventoryType  source,
E_inventoryType  dest 
)
T_void InventoryTransferToAmmo ( T_void  )
T_void InventoryTransferToEquipment ( T_word16  x,
T_word16  y 
)
T_void InventoryTransferToFinances ( T_void  )
T_void InventoryTransferToInventory ( T_word16  x,
T_word16  y 
)
T_void InventoryTransferToReadyHand ( T_void  )
T_void InventoryUpdatePlayerEquipmentBodyParts ( T_void  )
T_void InventoryUseItem ( T_inventoryItemStruct p_inv)
T_void InventoryUseItemInReadyHand ( T_buttonID  buttonID)
E_Boolean InventoryWeaponIsBow ( T_void  )
T_void InventoryWriteItemsList ( FILE *  fp)