[CF-Devel] Equiip change summary.

Mark Wedel mwedel at sonic.net
Mon Jun 10 02:49:38 CDT 2002


  I thought it would be best to summarize the change of equip method for items 
and post a summary before I start doing it for final comments.

  Brief summary: Instead of a fixed number of items being allowed (eg, 2 rings, 
1 sword, etc) and and fairly course use of some flags (can armor negates all 
armor types, just not torso), creatures will be given various number of body 
locations to equip items, and items will use some number of these locations.

  More in depth:

An array of 8 bit values will be added to the object structure.  This array will 
  hold the number of slots that the specific location holds.  For example, if 
the first element is heads, then for humands this would be one.  The load/save 
could would automatically translate more readable naems and store them into the 
array.  A secondary array will be needed to hold calculated values, so that the 
program doesn't have to look at all the players items to see if this one could 
be equipped.

  It should be noted that except for the load/save translation of this array, 
the rest of the code really will not care what is in each element.  When a 
player tries to equip something, the code will add the slots used by the item to 
those the player already has used up, and if this total is greater than the 
character has allowed, the equip will not be allowed.

  The more sensible verbose names used in the save files and archetypes will be 
like:

num_heads
num_fingers
num_arms
num_feet
num_wrists
etc.

  Items will have negative values for these, showing that in fact they use them 
up.  The monsters themselves will have positive values.  I know the negative may 
be a little odd, but I think in the longer term, it may be more sensible in that 
if you see a weapon with num_arms 2 and also see the monster with num_arms two, 
it may be a bit more confusing for what is really happening.

  Note that these locations are used to determine potentially many different 
item types.  While it may make sense to just say the number of hands should 
determine number of rings, weapons, and gloves, doing so makes it very difficult 
for the code to remain its modularity if letting players equip the same things 
desired (if the array is only 2 hands, and rings, weapons, and gloves all use 
these hands, you won't be able to equip much).  That is why there are arms 
(weapons/shields), fingers (rings), wrists (braces), and hands (gloves).

  Creatures of different body types would just have different types (eg, 
num_dragon_feet for example).  Thus, boots for them would need to also have the 
num_dragon_feet set instead of normal feet.  It will be trivial to add such new 
body locations as needed - just a couple lines in the load/save code will be all 
it takes (and appropriate arch changes).

  For classes or gods that restrict what the player can use, it will just have 
the appropriate num_... with negative values, effectively using up slots.

  while humanoids would have 2 arms, and in theory could use 2 weapons 
simultaneously, this will not be allowed.  Similarly, they will not be allowed 
to use two shields at the same time.  This could get changed in the future - 
this is more a balance issue.  This would be a special hardcoded case in the code.

  Two handed weapons would be allowed.  Bows would also use two hands.  If 
attempting to equip an item would require an item of a different type unequip, 
or there are multiple items needed to unequip to use such an item, or a choice 
of items, the server will not automatically unequip them.

  Monsters would use similarly look at this information to determine what items 
they can use - this would take the place of the can_use... flags (some may still 
be needed, like those that do not actually have a lot, like using spellbooks).



    
    


More information about the crossfire mailing list