From: davidt@ccwf.cc.utexas.edu (David Teo)
Newsgroups: rec.games.netrek
Subject: Re: Possible changed in the "E" message:
Date: 1 Oct 92 17:53:19 GMT
Reply-To: davidt@ccwf.cc.utexas.edu (David Teo)


I have incoporated something like this in my GFBorg but I didnt add the
color change nor the near planet thing.  I feel that those 2 suggestions
are excessive and really unnecessary.  However, I do feel that it is
necessary to show the fuel in the emergency message because when you run
out of fuel on a bronco server, you are in trouble!  The same goes with
wtemp on a starbase.  It is not necessary to show the fuel on a starbase
because starbases rarely run out of fuel but wtemp is their main enemy.

Furthermore, I think that the shield field is quite unnecessary as it is
the least important of all.

Here's my code for the emergency 'E' switch in smessage.c

    char addrbuf[ADDRLEN];
    char ebuf[80];

   	 if (myship->s_type==STARBASE) {
		sprintf(ebuf, 
		  	  "Distress Call From %c%c (Starbase!): %d%% damage, %d%% wtemp, %d
armies!",
	   	 teamlet[me->p_team], shipnos[me->p_no], (me->p_damage * 100 /
me->p_ship.s_maxdamage), (me->p_shield * 100 / me->p_ship.s_maxshield),
(me->p_wtemp * 100 / me->p_ship.s_maxwpntemp), me->p_armies);
  	  } else {
		sprintf(ebuf, 
	  	  "Distress Call From %c%c: %d%% damage, %d%% shields, %d%% fuel, %d
armies!",
	  	  teamlet[me->p_team], shipnos[me->p_no], (me->p_damage * 100 /
me->p_ship.s_maxdamage), (me->p_shield * 100 / me->p_ship.s_maxshield),
(me->p_fuel * 100 / me->p_ship.s_maxfuel), me->p_armies);
   	 }
   	 pmessage(ebuf, me->p_team, MTEAM);

I got rid of the shield field for starbases because it is not important
and because the message was too long to be shown in full in the message
window, maybe if you get rid of the "Distress Call From " line and
change it to "HELP! ", it will work better. 

Here's my server code for the 'Cause of death' field in the kill
messages, if anyone is interested.  Notice that I've used an array to
optimize my code. (taken from the grit server code)

char *killmsges[] = { "", "", "[photon torp]", "[phasers]", "", "[shock
waves]", "", "", "", "", "", "[plasma torp]" };

killmess(victim, killer)
struct player *victim, *killer;
{
    char buf[80];

    if (victim->p_armies) {
      (void) sprintf(buf, "%s (%c%c+%d armies) was kill %0.2f for %s
(%c%c) %s",  /* DT: Kill msges with */
		     victim->p_name,                                              /*
Cause of Death field */
		     teamlet[victim->p_team],
		     shipnos[victim->p_no],
		     victim->p_armies,
		     killer->p_kills,
		     killer->p_name,
		     teamlet[killer->p_team],
		     shipnos[killer->p_no],
		     killmsges[victim->p_whydead]); 
	pmessage(buf, 0, MALL | MKILL, "GOD->ALL");
    }
    else {
      (void) sprintf(buf, "%s (%c%c) was kill %0.2f for %s (%c%c) %s", 
/* DT: Kill msges with */
		     victim->p_name,                                    /* Cause of
Death field */
		     teamlet[victim->p_team],
		     shipnos[victim->p_no],
		     killer->p_kills,
		     killer->p_name,
		     teamlet[killer->p_team],
		     shipnos[killer->p_no],
		     killmsges[victim->p_whydead]);
	pmessage(buf, 0, MALL | MKILLA, "GOD->ALL");
    }
}

Again, I feel that it is excessive to add the ship types although it can
be done similarly.



Newsgroups: rec.games.netrek