suffering from poison

More
6 years 5 months ago #6696 by WhiskyTest
Replied by WhiskyTest on topic suffering from poison/Sun light
what about:
weather_info.sunlight == SUN_LIGHT;

To simplify tracking down the crash a bit more you could take out the damage() part and replace it with a message like "testing Glob crash: damage() removed from here"

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 5 months ago #6699 by JTP
Replied by JTP on topic suffering from poison/Sun light
Seems none of this is working:
static int isLitLocation(char_data *i) {
  return !ROOM_FLAGGED(IN_ROOM(i), ROOM_DARK) &&
        !ROOM_FLAGGED(IN_ROOM(i), ROOM_INDOORS) &&
        !ROOM_FLAGGED(IN_ROOM(i), ROOM_TUNNEL);
/*      weather_info.sunlight == SUN_LIGHT; */
/*      ((time_info.hours >= 5) && (time_info.hours <= 21));  */
  }
static int isLightSensitive(char_data *i) {
  return GET_RACE(i) == RACE_DROW
        && !IS_AFFECTED(i, SPELL_GLOBE_OF_DARKNESS);
  }

A drow never gets damage at all :(

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #6700 by WhiskyTest
Replied by WhiskyTest on topic suffering from poison/Sun light
Do you mind posting your entire functuon as it currently is?

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 5 months ago #6701 by JTP
Replied by JTP on topic suffering from poison/Sun light
Sure here it is, hope you can see whats up
static int isLitLocation(char_data *i) {
  return !ROOM_FLAGGED(IN_ROOM(i), ROOM_DARK) &&
	!ROOM_FLAGGED(IN_ROOM(i), ROOM_INDOORS) &&
	!ROOM_FLAGGED(IN_ROOM(i), ROOM_TUNNEL) &&
	weather_info.sunlight == SUN_LIGHT;
/*	((time_info.hours >= 5) && (time_info.hours <= 21));  */
  }
static int isLightSensitive(char_data *i) {
  return GET_RACE(i) == RACE_DROW
	&& !IS_AFFECTED(i, SPELL_GLOBE_OF_DARKNESS);
  }

/* Update PCs, NPCs, and objects */
void point_update(void)
{
  struct char_data *i, *next_char;
  struct obj_data *j, *next_thing, *jj, *next_thing2;
/*  struct char_data *ch; */

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;

    gain_condition(i, HUNGER, -1);
    gain_condition(i, DRUNK, -1);
    gain_condition(i, THIRST, -1);

    if (GET_POS(i) >= POS_STUNNED) {
      GET_HIT(i) = MIN(GET_HIT(i) + hit_gain(i), GET_MAX_HIT(i));
      GET_MANA(i) = MIN(GET_MANA(i) + mana_gain(i), GET_MAX_MANA(i));
      GET_MOVE(i) = MIN(GET_MOVE(i) + move_gain(i), GET_MAX_MOVE(i));
      if (AFF_FLAGGED(i, AFF_POISON))
	if (damage(i, i, 2, SPELL_POISON) == -1)
	  continue;	/* Oops, they died. -gg 6/24/98 */

/* 	if ((!ROOM_FLAGGED(IN_ROOM(i), ROOM_DARK) && (!ROOM_FLAGGED(IN_ROOM(i), ROOM_INDOORS)) && (!ROOM_FLAGGED(IN_ROOM(i), ROOM_TUNNEL))) && (GET_RACE(i) == RACE_DROW) && (!AFF_FLAGGED(i, AFF_GLOBE_OF_DARKNESS)))
	if (damage(i, i, GET_LEVEL(i), SPELL_SUN_LIGHT) == -1)
	continue; */

if (isLightSensitive(i) && isLitLocation(i))
	if (damage(i, i, GET_LEVEL(i), SPELL_SUN_LIGHT) == -1)
	continue;

        if (GET_POS(i) <= POS_STUNNED)
	update_pos(i);

    } else if (GET_POS(i) == POS_INCAP) {
      if (damage(i, i, 1, TYPE_SUFFERING) == -1)
	continue;
    } else if (GET_POS(i) == POS_MORTALLYW) {
      if (damage(i, i, 2, TYPE_SUFFERING) == -1)
	continue;
    }
    if (!IS_NPC(i)) {
      update_char_objects(i);
      (i->char_specials.timer)++;
      if (GET_LEVEL(i) < CONFIG_IDLE_MAX_LEVEL)
	check_idling(i);
    }
  }

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #6702 by WhiskyTest
Replied by WhiskyTest on topic suffering from poison/Sun light
Apart from missing the closing bracket (I'm assuming you have the object timers and happy hour stuff below)
I don't have Drows or Globes of Darkness so I tested it on characters without sanctuary being damaged by Magic Missile.
I change point_update() to trigger every 15 seconds to help speed things up.

This is what I changed:
static int isLightSensitive(char_data *i) {
  return !IS_AFFECTED(i, AFF_SANCTUARY);
  }
if (isLightSensitive(i) && isLitLocation(i))
	if (damage(i, i, 10, SPELL_MAGIC_MISSILE) == -1)
	continue;

It was pretty funny to watch. No crashes, plenty of dead things everywhere during daylight hours...

Next step for your troubleshooting would be to add in some debug logging of some kind. You want to track down where the code is getting to, and figure out if there is a logic error or something being called from within the function that is causing unexpected behavior.

Example 1:
Take your new race and spell out of the mix using the changes above.

Example 2:
Take damage out of the mix:
if (isLightSensitive(i) && isLitLocation(i))
	send_to_char(i, "You're burning up! Grab the sunblock!\r\n");
	continue;

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
5 years 9 months ago #7255 by JTP
Replied by JTP on topic suffering from poison/Sun light
Hmm i thought this was fixed, but just now when i attacked a mob i got 3 messages:

You stab a local female citizen.
A local female citizen is mortally wounded, and will die soon, if not aided.
A local female citizen lies here immobile on the ground, suffering.
A local female citizen is mortally wounded, and will die soon, if not aided.


/* Update PCs, NPCs, and objects */
void point_update(void)
{
  struct char_data *i, *next_char;
  struct obj_data *j, *next_thing, *jj, *next_thing2;
/*  struct char_data *ch; */

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;

    gain_condition(i, HUNGER, -1);
    gain_condition(i, DRUNK, -1);
    gain_condition(i, THIRST, -1);

    if (GET_POS(i) >= POS_STUNNED) {
      GET_HIT(i) = MIN(GET_HIT(i) + hit_gain(i), GET_MAX_HIT(i));
      GET_MANA(i) = MIN(GET_MANA(i) + mana_gain(i), GET_MAX_MANA(i));
      GET_MOVE(i) = MIN(GET_MOVE(i) + move_gain(i), GET_MAX_MOVE(i));
      if (AFF_FLAGGED(i, AFF_POISON))
        if (damage(i, i, 2, SPELL_POISON) == -1)
          continue;     /* Oops, they died. -gg 6/24/98 */
/*
        if ((!ROOM_FLAGGED(IN_ROOM(i), ROOM_DARK) && (!ROOM_FLAGGED(IN_ROOM(i), ROOM_INDOORS)) && (!ROOM_FLAGGED(IN_ROOM(i), ROOM_TUNNEL))) && (GET_RACE(i) == RACE_DROW) && (!AFF_F$
        if (damage(i, i, GET_LEVEL(i), SPELL_SUN_LIGHT) == -1)
        continue; */

if (isLightSensitive(i) && isLitLocation(i))
        if (damage(i, i, GET_LEVEL(i), SPELL_SUN_LIGHT) == -1)
        continue;

        if (GET_POS(i) <= POS_STUNNED)
        update_pos(i);

    } else if (GET_POS(i) == POS_INCAP) {
      if (damage(i, i, 1, TYPE_SUFFERING) == -1)
        continue;
    } else if (GET_POS(i) == POS_MORTALLYW) {
      if (damage(i, i, 2, TYPE_SUFFERING) == -1)
        continue;
    }
    if (!IS_NPC(i)) {
      update_char_objects(i);
      (i->char_specials.timer)++;
      if (GET_LEVEL(i) < CONFIG_IDLE_MAX_LEVEL)
        check_idling(i);
    }
  }


Any ideas ?

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • LuminariMUD Developer
More
5 years 9 months ago #7256 by zusuk
Replied by zusuk on topic suffering from poison/Sun light
off the top of my head, there should be a place in damage() that will check their position and send you a message if you are stunned, incapacitated, mortally wounded, etc... you can check the skill/spellnum there to not send a message if it's poison spell

but you may want to keep that message there...

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
5 years 9 months ago #7257 by JTP
Replied by JTP on topic suffering from poison/Sun light
It all started after adding the if (damage(i, i, GET_LEVEL(i), SPELL_SUN_LIGHT) == -1) if

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #7264 by WhiskyTest
Replied by WhiskyTest on topic suffering from poison/Sun light
It is as Zusuk pointed out.
Any time damage() is called on a victim it will send the appropriate messages for mortally wounded, incap, stunned etc.

If you want to remove them, in fight.c, damage() line 693ish is where you'd start making your changes.

But you might want to keep that message there...

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
5 years 9 months ago - 5 years 9 months ago #7265 by JTP
Replied by JTP on topic suffering from poison/Sun light
Cant be right that i hit once, and Then the mob gives me 2 Will die soon If not aided and 1 suffering ?

That truly seems odd, and it only happends some times.
Last edit: 5 years 9 months ago by JTP.

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #7266 by WhiskyTest
Replied by WhiskyTest on topic suffering from poison/Sun light
It's like this:

You attack the mob, land a hit and damage() function runs. Because the mob is mortally wounded you get the mortally wounded message.

You stab a local female citizen.
A local female citizen is mortally wounded, and will die soon, if not aided.

Tick happens. Mortally wounded characters each take TYPE_SUFFERING damage, damage() function deals their suffering damage and you get another mortally wounded message.

A local female citizen lies here immobile on the ground, suffering.
A local female citizen is mortally wounded, and will die soon, if not aided.

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
5 years 9 months ago #7267 by JTP
Replied by JTP on topic suffering from poison/Sun light
Ah Yea ok, a tick didnt think about that because they all came so fast.

But that Could make good sense when it only happends some times.. Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.153 seconds