예제 #1
0
void
soma_ten_second_affect (CHAR_DATA * ch, AFFECTED_TYPE * af)
{
  int save = 0, stat = 0;
  char *locat = NULL;
  char buf2[MAX_STRING_LENGTH];
  char buf[MAX_STRING_LENGTH];
  
  stat = GET_CON (ch);
  if ((number (1, 1000) > af->a.soma.atm_power)
      || (number (1, (stat > 20) ? stat : 20) <= stat))
    return;

  switch (af->type)
    {
      /*    case SOMA_MUSCULAR_CRAMP:       sprintf(buf2,"a muscle cramp"); break;
         case SOMA_MUSCULAR_TWITCHING:      sprintf(buf2,"twitching"); break;
         case SOMA_MUSCULAR_TREMOR: sprintf(buf2,"tremors"); break;
         case SOMA_MUSCULAR_PARALYSIS:      sprintf(buf2,"paralysis"); break;
         case SOMA_DIGESTIVE_ULCER: sprintf(buf2,"stomach ulcer"); break; 
         case SOMA_DIGESTIVE_VOMITING:      sprintf(buf2,"vomiting"); break;
         case SOMA_DIGESTIVE_BLEEDING:      sprintf(buf2,"vomiting blood"); break; 
         case SOMA_EYE_BLINDNESS:   sprintf(buf2,"blindness"); break;
         case SOMA_EYE_BLURRED:             sprintf(buf2,"blurred vision"); break;
         case SOMA_EYE_DOUBLE:              sprintf(buf2,"double vision"); break;
         case SOMA_EYE_DILATION:            sprintf(buf2,"dilated pupils"); break; 
         case SOMA_EYE_CONTRACTION: sprintf(buf2,"contracted pupils"); break; 
         case SOMA_EYE_LACRIMATION: sprintf(buf2,"lacrimation"); break;
         case SOMA_EYE_PTOSIS:              sprintf(buf2,"ptosis"); break;
         case SOMA_EAR_TINNITUS:            sprintf(buf2,"tinnitus"); break;
         case SOMA_EAR_DEAFNESS:            sprintf(buf2,"deafness"); break;
         case SOMA_EAR_EQUILLIBRIUM:        sprintf(buf2,"ear imbalance"); break;
         case SOMA_NOSE_ANOSMIA:            sprintf(buf2,"anosmia"); break;
         case SOMA_NOSE_RHINITIS:   sprintf(buf2,"rhinitis"); break;
         case SOMA_MOUTH_SALIVATION:        sprintf(buf2,"salivation"); break;
         case SOMA_MOUTH_TOOTHACHE: sprintf(buf2,"toothache"); break;
         case SOMA_MOUTH_DRYNESS:   sprintf(buf2,"dry mouth"); break;
         case SOMA_MOUTH_HALITOSIS: sprintf(buf2,"halitosis"); break;
         case SOMA_CHEST_DIFFICULTY:        sprintf(buf2,"difficulty breathing"); break;
         case SOMA_CHEST_RAPIDBREATH:       sprintf(buf2,"rapid breathing"); break;
         case SOMA_CHEST_SLOWBREATH:        sprintf(buf2,"shallow breathing"); break;
         case SOMA_CHEST_FLUID:             sprintf(buf2,"fluidous lungs"); break;
         case SOMA_CHEST_PALPITATIONS:      sprintf(buf2,"heart palpitations"); break; */

    case SOMA_CHEST_COUGHING:

      stat = GET_WIL (ch);
      save = number (1, (stat > 20) ? stat : 20);

      if (get_affect (ch, MAGIC_HIDDEN) && would_reveal (ch))
	{
	  if (save > stat)
	    {
	      remove_affect_type (ch, MAGIC_HIDDEN);
	      act ("$n reveals $mself with an audible cough.", true, ch, 0, 0,
		   TO_ROOM);
	    }
	  else if (save > (stat / 2))
	    {
	      act ("You hear a muffled sound from somewhere nearby.", true,
		   ch, 0, 0, TO_ROOM);
	    }
	}
      else if ((save <= stat) && (save > (stat / 2)))
	{
	  act ("$n tries to stifle a cough.", true, ch, 0, 0, TO_ROOM);
	}

      if (save > stat)
	{
	  act ("You cough audibly.", true, ch, 0, 0, TO_CHAR);
	}
      else
	{
	  act ("You try to stifle a cough silently.", true, ch, 0, 0,
	       TO_CHAR);
	}
      break;

	case SOMA_CHEST_WHEEZING:

      stat = GET_WIL (ch);
      save = number (1, (stat > 20) ? stat : 20);

      if (get_affect (ch, MAGIC_HIDDEN) && would_reveal (ch))
	{
	  if (save > stat)
	    {
	      remove_affect_type (ch, MAGIC_HIDDEN);
	      act ("$n reveals $mself with an audible wheeze.", true, ch, 0, 0,
		   TO_ROOM);
	    }
	  else if (save > (stat / 2))
	    {
	      act ("You hear a muffled sound from somewhere nearby.", true,
		   ch, 0, 0, TO_ROOM);
	    }
	}
      else if ((save <= stat) && (save > (stat / 2)))
	{
	  act ("$n tries to stifle their wheezing.", true, ch, 0, 0, TO_ROOM);
	}

      if (save > stat)
	{
	  act ("You wheeze audibly.", true, ch, 0, 0, TO_CHAR);
	}
      else
	{
	  act ("You try to stifle your wheezing.", true, ch, 0, 0,
	       TO_CHAR);
	}
      break;


	case SOMA_NERVES_HEADACHE:

      stat = GET_WIL (ch);
      save = number (1, (stat > 20) ? stat : 20);

      if (save > stat)
	{
	  act ("Your head pounds with a headache.", true, ch, 0, 0, TO_CHAR);
	}
      else
	{
	  act ("You manage to ignore the pounding in your head.", true, ch, 0, 0,
	       TO_CHAR);
	}
      break;

	case SOMA_MUSCULAR_CRAMP:
	
			stat = GET_WIL (ch);
      save = number (1, (stat > 20) ? stat : 20);
			locat = expand_wound_loc(figure_location(ch, number(0,2)));

      if (save > stat)
				{
				sprintf(buf, "You get an intense cramp in your %s which persist for several minutes beofre finally relaxing\n", locat);
	  		act (buf, true, ch, 0, 0, TO_CHAR);
	  		 act ("$n suddenly cringes in pain.", true, ch, 0, 0, TO_ROOM);
				}
      else
				{
				sprintf(buf, "You get an intense cramp in your %s, but you shake it off quickly\n", locat);
	  		act (buf, true, ch, 0, 0, TO_CHAR);
	  		act ("$n suddenly cringes in pain, but quickly recovers.", true, ch, 0, 0, TO_ROOM);
				}
      break;

     
    case SOMA_MUSCULAR_TWITCHING:
    	stat = GET_WIL (ch);
      save = number (1, (stat > 20) ? stat : 20);
			locat = expand_wound_loc(figure_location(ch, number(0,2)));
			
      if (save > stat)
				{
				sprintf(buf, "You feel a strong twitching in your %s which persist for several minutes before finally relaxing\n", locat);
	  		act (buf, true, ch, 0, 0, TO_CHAR);
	  		sprintf(buf2, "$n suddenly cringes in pain, as $s %s twitches.", locat);
	  		act (buf2, true, ch, 0, 0, TO_ROOM);
				}
      else
				{
				sprintf(buf, "You feel a strong twitching in your %s, but you control it quickly\n", locat);
	  		act (buf, true, ch, 0, 0, TO_CHAR);
	  		sprintf(buf2, "$n cringes in pain, as $s %s twitches momentarily.", locat);
	  		act (buf2, true, ch, 0, 0, TO_ROOM);
	  		
				}
      break;      
      

      /*  case SOMA_CHEST_PNEUMONIA:      sprintf(buf2,"pneumonia"); break;
         case SOMA_NERVES_PSYCHOSIS:      sprintf(buf2,"psychosis"); break;
         case SOMA_NERVES_DELIRIUM:       sprintf(buf2,"delerium "); break;
         case SOMA_NERVES_COMA:           sprintf(buf2,"a comatose state"); break;
         case SOMA_NERVES_CONVULSIONS:    sprintf(buf2,"convulsions"); break;
         case SOMA_NERVES_CONFUSION:      sprintf(buf2,"confusion"); break;
         case SOMA_NERVES_PARETHESIAS:    sprintf(buf2,"parethesias"); break;
         case SOMA_NERVES_ATAXIA: sprintf(buf2,"ataxia"); break;
         case SOMA_NERVES_EQUILLIBRIUM:   sprintf(buf2,"nervous imbalance"); break;
         case SOMA_SKIN_CYANOSIS: sprintf(buf2,"cyanosis of the skin"); break;
         case SOMA_SKIN_DRYNESS:          sprintf(buf2,"dryness of the skin"); break;
         case SOMA_SKIN_CORROSION:        sprintf(buf2,"corrosion of the skin"); break;
         case SOMA_SKIN_JAUNDICE: sprintf(buf2,"jaundice of the skin"); break;
         case SOMA_SKIN_REDNESS:          sprintf(buf2,"redness of the skin"); break;
         case SOMA_SKIN_RASH:             sprintf(buf2,"a rash on the skin"); break;
         case SOMA_SKIN_HAIRLOSS: sprintf(buf2,"hairloss"); break;
         case SOMA_SKIN_EDEMA:            sprintf(buf2,"edema of the skin"); break;
         case SOMA_SKIN_BURNS:            sprintf(buf2,"burns on the skin"); break;
         case SOMA_SKIN_PALLOR:           sprintf(buf2,"pallor of the skin"); break;
         case SOMA_SKIN_SWEATING: sprintf(buf2,"the sweats"); break;
         case SOMA_GENERAL_WEIGHTLOSS:    sprintf(buf2,"weight loss"); break;
         case SOMA_GENERAL_LETHARGY:      sprintf(buf2,"lethargy"); break;
         case SOMA_GENERAL_APPETITELOSS:  sprintf(buf2,"appetite loss"); break;
         case SOMA_GENERAL_PRESSUREDROP:  sprintf(buf2,"low blood pressure"); break;
         case SOMA_GENERAL_PRESSURERISE:  sprintf(buf2,"high blood pressure"); break;
         case SOMA_GENERAL_FASTPULSE:     sprintf(buf2,"a fast pulse"); break;
         case SOMA_GENERAL_SLOWPULSE:     sprintf(buf2,"a slow pulse"); break;
         case SOMA_GENERAL_HYPERTHERMIA:  sprintf(buf2,"hyperthermia"); break;
         case SOMA_GENERAL_HYPOTHERMIA:   sprintf(buf2,"hypothermia"); break;
       */
    default:
      break;
    }
}
예제 #2
0
void
mob_char_indirect (CHAR_DATA * mob, char *token, int *value, int *type)
{
	CHAR_DATA *ch;
	CHAR_DATA *person;
	int i;

	struct ind_data_t
	{
		int which_case;
		char ind[15];
		int type;
	} ind_data[] =
	{
		{
			0, "str", MP_TYPE_INTEGER},
			{
				1, "dex", MP_TYPE_INTEGER},
				{
					2, "int", MP_TYPE_INTEGER},
					{
						3, "con", MP_TYPE_INTEGER},
						{
							4, "wil", MP_TYPE_INTEGER},
							{
								5, "aur", MP_TYPE_INTEGER},
								{
									6, "hit", MP_TYPE_INTEGER},
									{
										7, "maxhit", MP_TYPE_INTEGER},
										{
											8, "moves", MP_TYPE_INTEGER},
											{
												9, "maxmoves", MP_TYPE_INTEGER},
												{
													10, "deity", MP_TYPE_INTEGER},
													{
														11, "circle", MP_TYPE_INTEGER},
														{
															12, "race", MP_TYPE_INTEGER},
															{
																13, "sex", MP_TYPE_INTEGER},
																{
																	14, "clan_1", MP_TYPE_INTEGER},
																	{
																		15, "piety", MP_TYPE_INTEGER},
																		{
																			16, "offense", MP_TYPE_INTEGER},
																			{
																				17, "clan_2", MP_TYPE_INTEGER},
																				{
																					18, "fightmode", MP_TYPE_INTEGER},
																					{
																						19, "next_in_room", MP_TYPE_CHAR_DATA},
																						{
																							20, "name", MP_TYPE_STRING},
																							{
																								21, "level", MP_TYPE_INTEGER},
																								{
																									22, "fighting", MP_TYPE_CHAR_DATA},
																									{
																										23, "realname", MP_TYPE_STRING},
																										{
																											24, "in_room", MP_TYPE_INTEGER},
																											{
																												25, "equip", MP_TYPE_OBJ_DATA},
																												{
																													26, "inv", MP_TYPE_OBJ_DATA},
																													{
																														27, "reset_room", MP_TYPE_INTEGER},
																														{
																															28, "prisoner", MP_TYPE_CHAR_DATA},
																															{
																																0, "\0", 0}
	};

	*type = -1;

	if (!*value)
		return;

	ch = (CHAR_DATA *) * value;

	for (i = 0; *ind_data[i].ind; i++)
	{
		if (!str_cmp (ind_data[i].ind, token))
			break;
	}

	if (!*ind_data[i].ind)
		return;

	*type = ind_data[i].type;

	switch (ind_data[i].which_case)
	{
	case 0:
		*value = GET_STR (ch);
		break;
	case 1:
		*value = GET_DEX (ch);
		break;
	case 2:
		*value = GET_INT (ch);
		break;
	case 3:
		*value = GET_CON (ch);
		break;
	case 4:
		*value = GET_WIL (ch);
		break;
	case 5:
		*value = GET_AUR (ch);
		break;
	case 6:
		*value = GET_HIT (ch);
		break;
	case 7:
		*value = GET_MAX_HIT (ch);
		break;
	case 8:
		*value = GET_MOVE (ch);
		break;
	case 9:
		*value = GET_MAX_MOVE (ch);
		break;
	case 10:
		*value = ch->deity;
		break;
	case 11:
		*value = ch->circle;
		break;
	case 12:
		*value = ch->race;
		break;
	case 13:
		*value = ch->sex;
		break;
	case 14:
		*value = 0;		/* ch->clan_1; */
		break;
	case 15:
		*value = ch->ppoints;
		break;
	case 16:
		*value = ch->offense;
		break;
	case 17:
		*value = 0;		/* ch->clan_2; */
		break;
	case 18:
		*value = ch->fight_mode;
		break;
	case 19:
		if (!is_he_here (mob, ch, 0))
			person = NULL;
		else
		{
			person = ch->next_in_room;

			while (person && !CAN_SEE (mob, person))
				person = person->next_in_room;
		}

		*value = (long int) person;

		break;

	case 20:
		*value = (long int) ch->short_descr;
		break;
	case 21:
		*value = GET_TRUST (ch);
		break;
	case 22:
		*value = (long int) ch->fighting;
		break;
	case 23:
		*value = (long int) GET_NAME (ch);
		break;
	case 24:
		*value = ch->in_room;
		break;
	case 25:
		*value = (long int) ch->equip;
		break;
	case 26:
		if (ch->right_hand)
			*value = (long int) ch->right_hand;
		else
			*value = (long int) ch->left_hand;
		break;
	case 27:
		if (ch->pc)
			*value = 0;

		else if (ch->mob->reset_zone != 0 || ch->mob->reset_cmd != 0)
			*value = zone_table[ch->mob->reset_zone].cmd[ch->mob->reset_cmd].arg1;
		else
			*value = 0;
		break;
	case 28:
		*value = (long int) (IS_SUBDUER (ch) ? ch->subdue : NULL);
		break;
	}
}