Re: CODE: Profencies

From: Pandion (s337239@student.uq.edu.au)
Date: 07/11/96


On Thu, 11 Jul 1996, Imps of MB2 wrote:

> 
> Oops..excuse the typo..
> It's once again 4:00am here and i'm working overtime :P
> 
> I would like to add profencies to my mud.
> As in, players woudl be able to practice the use of WEAPONS:
> ie: (sword)  [good]
>     (axe)    [superb]
>     (rapier) [not learned]
> 
> You get the idea. Any step by step instructions would really help.
> 

I've done it.  The way I did it was to change the w_type weapon hit type 
defined in the obj file to the category of the weapon... ie instead of 3 
being TYPE_SLASHING, it becomes CATEGORY_SWORD_LONG, etc etc.  Adding 
skills is a separate thing.  Then in fight.c, where you determine wielded 
(and hence wtype) call a little procedure to convert obj val 3 {the bit 
which says GET_OBJ_VAL(obj, 3)} from weapon category to wtype... so 
CATEGORY_SWORD_LONG would be defined as category 3, using 
TYPE_SLASHING... get my drift ?  I'm not sure if you do (and I apologise 
for the haste but I am writing this while eating :)...

hmm let me try to re-explain

1> obj val 3, change it from weapon dam type to weapon category..
	before, it specified TYPE_SLASHING.. now it should specifiy the 
	weapon category, ie CATEGORY_SWORD_LONG...

the above is not really a code change, more a change of THINKING...

2> in fight.c where obj val 3 is read into w_type, write a conversion thing, 
	such as get_wtype() which converts the integer category into the
	wtype, for example, CATEGORY_SWORD_LONG converts to TYPE_SLASHING, 
	CATEGORY_BLUNT converts to TYPE_CRUSH etc etc etc... just a case 
	statement :)
	 ... called example "wtype = get_wtype(GET_OBJ_VAL(wielded, 3));"
	ONLY call this where a char is wielding a weapon.. in all other 
	cases, wtype is either TYPE_HIT (covered somewhere), or is a number
	in the mob file, neither requires conversion from category since
	neither are a category...

3> then write a nice proficiency menu, I hate showing weapon profs on the 
	prac list, it looks so stupid next to fireball :)

Oh and edit all the act.wizard.c stuff for statting objects.  And define 
some weapon categories in structs.h or spells.h (mine are in spells.h, blush)

confused ?  good !!!  So was I !!!

Hope i've helped somehow..

Hmm, actually I might be willing to make a snippet out of the whole thing 
and upload it to the appropriate place - right now i'm a little bogged 
down but who knows ?  Anyways, I hope i've helped..

Chris



This archive was generated by hypermail 2b30 : 12/07/00 PST