[CF-Devel] Change in equip method.

Mark Wedel mwedel at sonic.net
Sun Jun 2 19:47:57 CDT 2002


  Dropping this to the list for some prior discussion and to perhaps get some 
addtional refinements.  For the most part, this change will not be directly 
visible to the players (but such a change allows new features not currently 
possible).

Currently, the type of object determines how man you can wear, and if you can 
wear it at all.  It is hard coded that you can wear 2 rings, 1 helmet, 1 suit of 
armor, etc.  some of the flag_can_use_armor refine this in a very primitive way.

The change would basically modify equipable objects to specify whay body 
location (or equip location) they go on.  For example, helmets would have a line 
added like 'equip_location head', armor would have 'equip_location torso', rings 
'equip_location finger', etc.  Objects could specify multiple locations - 
'equip_location weapon_hand,shield_hand' could be used to allow 2 handed weapons.

Internally, these verbal descriptions would get converted into a bitmask used in 
the object.  This imposes some limitations (can't have something like 
equip_location weapon_hand,weapon_hand' so say it should use 2 weapon hands). 
The advantage of using a bitmask for this is that it is small enough it can 
efficiently been sent to the client to make use of.

Now each monster would have a body type, like 'body_type humanoid' or 'body_type 
quadriped' or whatever else. Descriptions for them might be like:

humanoid:
head 1
torso 1
weapon_hand 1
shield_hand 1
finger 2
neck 1
feet 1
...

  And the quadriped (horse or other 4 legged creature):

feet 2
weapon_hand 0
shield_hand 0
...

  This is where the semantic differnce of using body location vs equip_location 
comes in.  Saying a humanoid has 2 fingers and 1 feet isn't really right.  But 
it means that they are only allowed 2 fingers and 1 pair of boots.  If instead 
these are described as 'ring' and 'boot', it makes more sense.

  As I type this, going with equipment type location may make more sense - you 
could add to the quadriped something like:

barding 1

  Which means it really needs special armor.

  Now the player/monsters will have a copy of the body_type information in the 
object structure in addition to the one in the archetype.  Whenever an object is 
equipped/unequipped, this copy information is added.

  So for example, when you equip something, the equip logic sees what flags 
(equip location) are set.  Then looks in the body_spaces information in the 
object to see if there are spaces available.  IF so, it applies the object, and 
updates teh body_spaces information.  If not, it unapplies the needed spaces if 
applicable.

  One thing this allows in addition to two handed weapons is further refinement 
for different races.  Eq, the fireborn could be set up with 'rings 3 and amulets 
2' to let them wear more of those protective devices since they can't wear 
anything else.  The Q should certainly be allowed to wear a shield, even if it 
can wear armor.  You could add ettin races, which let you were 2 helmets, etc.

  Now, for things like religions or classes which prevent use of certain items, 
the logic there could add appropriate force objects that use up the slots for 
the objects.  Eg, a force for a god that doesn't allow weapon use would have 
something like 'equip_location weapon_hand'.  Force objects would be special in 
the sense that they bypass the normal equip logic and just use up the slots, so 
even if the race doesn't have a weapon_hand, the force will still be equipped.

  Now the only really noticable aspect to this to players would be changing the 
range locations.  They current range location is really a leftover from long 
ago.  With this change, I would make it so there is only 1 range slot (which 
horns, bows, wands, skill tools, etc, would all vie for).  This simplifies the 
code a great deal on the server, and probably makes more sense anyway.

  I'm not sure how noticable this really would be to most people - I pretty much 
never use teh ability to rotate through the range of row slots - much easier to 
bind the actions to certain keys.

  Thoughts/suggestions?


    
    


More information about the crossfire mailing list