Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

small hack



When I first started hacking on the crossfire code I wanted to add a little
feature to the game... I thought that if you are fighting a monster you
should be able to see what state he is in ... to this affect the following
diff file is provided. Run it on attack.c if you have patch (syntax:: patch
attack.c attack.diff). It works with the new verion .6 just fine for me. By
the way also define AKS_HACK in config.h..... If some of you think it worth
being a permanent part of crossfire tell me and I will send it to Mark.

Ripclaw
(Maintainer)

from here to end is attack.diff
----------------------------- CUT HERE -----------------------------------
36a37,40
> #ifdef AKS_HACKS
> char *aks_opstate(object *);
> #endif
> 
215a220,253
> #ifdef AKS_HACKS
> char *aks_opstate(object *op) {
> 	static char aks_msg[MAX_BUF];
> 	float aks_calc=0;
> 
> 	aks_calc = (float)op->stats.hp/(float)op->stats.maxhp;
> 
> 	if ((aks_calc==NULL) || (aks_calc<=0) || (aks_calc>1) || (QUERY_FLAG(op,FLAG_GENERATOR)) || (QUERY_FLAG(op,FLAG_TEAR_DOWN)))
> 		aks_msg[0]='\0';
> 	else if (aks_calc < 0.1)
> 		strcpy(aks_msg,"trails a river of crimson and moans pathetically.");
> 	else if (aks_calc < 0.2)
> 		strcpy(aks_msg,"screams in agony and hears death calling.");
> 	else if (aks_calc < 0.3)
> 		strcpy(aks_msg,"bellows in pain from your blow.");
> 	else if (aks_calc < 0.4)
> 		strcpy(aks_msg,"contemplates his navel and wishes to flee.");
> 	else if (aks_calc < 0.5)
> 		strcpy(aks_msg,"grunts and groans with each move.");
> 	else if (aks_calc < 0.6)
> 		strcpy(aks_msg,"has several wounds all over.");
> 	else if (aks_calc < 0.7)
> 		strcpy(aks_msg,"is starting to limp a bit.");
> 	else if (aks_calc < 0.8)
> 		strcpy(aks_msg,"has a few nicks here and there.");
> 	else if (aks_calc < 0.9)
> 		strcpy(aks_msg,"is in decent shape.");
> 	else if (aks_calc <= 1.0)
> 		strcpy(aks_msg,"is in mint condition.");
> 
> 	return(aks_msg);
> }
> #endif	
> 
226a265,267
> #ifdef AKS_HACKS
>   char aks_buf[MAX_BUF],*aks_msg;
> #endif
227a269,272
> #ifdef AKS_HACKS
>   aks_msg = '\0';
> #endif
> 
317a363,366
> #ifdef AKS_HACKS
>   aks_msg=aks_opstate(op);
> #endif
> 
353a403,408
> #ifdef AKS_HACKS
>     if(aks_msg[0]!='\0') {
>        sprintf(aks_buf,"The %s %s",op_name,aks_msg);
>        draw_info(hitter,aks_buf);
>     }
> #endif
360a416,421
> #ifdef AKS_HACKS
>     if(aks_msg[0]!='\0') {
>         sprintf(aks_buf,"The %s %s",op_name,aks_msg);
>         draw_info(hitter->owner,aks_buf);
>      }
> #endif