suffering from poison

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 11 months ago - 6 years 11 months ago #6203 by JTP
suffering from poison was created by JTP
I tried to add code to damage a char without globe of darkness.

It seems that part is ok, but now if someone is poisoned, they get 2 sets of messages:

A little white mouse looks really sick and shivers uncomfortably.
A little white mouse is incapacitated and will slowly die, if not aided.
A little white mouse lies helplessly on the ground and suffers...
A little white mouse is incapacitated and will slowly die, if not aided.


What am i missing ?



Original code
    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 (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);
    }
  }



My add on
    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 (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);
    }
    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 (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;
    }
  }
Last edit: 6 years 11 months ago by JTP.

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

More
6 years 11 months ago #6204 by thomas
Replied by thomas on topic suffering from poison
I think the easiest way to explain this is to use pseudocode:
The way it was:

If they are alive (stunned+):
  let them gain mana, move and hp
  if they are poisoned
    try damaging them ("looks really sick")
      if the damage didn't kill them, make sure they're in the right position and send them a message ("is incapacitated"). 
      Then go to the next char.
if they are unconscious 
  damage them ("and suffers") 
  if they die, move on

What you added:

  let them gain mana, move and hp
  if they are poisoned
    try damaging them ("looks really sick")
      if the damage didn't kill them, make sure they're in the right position and send them a message ("is incapacitated"). 
      Then go to the next char.
if they are unconscious 
  damage them ("and suffers") 
  if they die, move on

Now, regardless of whether they were damaged above, if they are unconscious, hurt them again.

What you really want is to have the new code happen where you check for poison, like this:
  let them gain mana, move and hp
  if they are poisoned
    try damaging them ("looks really sick")
      if the damage didn't kill them,
    try damaging them by sunlight
      if the damage didn't kill them,  make sure they're in the right position and send them a message ("is incapacitated"). 
      Then go to the next char.
if they are unconscious 
  damage them ("and suffers") 
  if they die, move on
Here's the fixed version for that example:
  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 (GET_POS(i) <= POS_STUNNED)
        update_pos(i);
+    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;
    } 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);
    }
  }

However, you might be wanting this damage to strike also if they're unconscious - after all, if they're lying in the sunlight, you might want the damage to occur even if the culprit is near death.
In this case you will want to change the logic a bit in this function. This might work, though I haven't tested it:
Somewhere near the top of the function:
int position_before_update;

...
    gain_condition(i, HUNGER, -1);
    gain_condition(i, DRUNK, -1);
    gain_condition(i, THIRST, -1);
    
    position_before_update = GET_POS(i);
    if (position_before_update >= 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 */
    } else if (position_before_update == POS_INCAP) {
      if (damage(i, i, 1, TYPE_SUFFERING) == -1)
	continue;
    } else if (position_before_update == POS_MORTALLYW) {
      if (damage(i, i, 2, TYPE_SUFFERING) == -1)
	continue;
    }
    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 (position_before_update != GET_POS(i)) 
      update_pos(i);

    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.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 11 months ago - 6 years 11 months ago #6205 by JTP
Replied by JTP on topic suffering from poison
Hi

There seems to be a missing } in your first option, that im trying now ?
      if (GET_POS(i) <= POS_STUNNED)
        update_pos(i);
+     } /* i put one here and it compiled */
+    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;
    } else if (GET_POS(i) == POS_INCAP) {
      if (damage(i, i, 1, TYPE_SUFFERING) == -1)
	continue;


But as you can see below, the first 4 times just 1 message, then two times just one message where mob is stunned, but suddently one time i see double message from poison when mob is incapacitated, but the next two ticks just 1 when mob is mortally wounded.

Uno suffer's from being exposed to light.
A little white mouse looks really sick and shivers uncomfortably.


Uno suffer's from being exposed to light.
A little white mouse looks really sick and shivers uncomfortably.


Uno suffer's from being exposed to light.
A little white mouse looks really sick and shivers uncomfortably.


Uno suffer's from being exposed to light.
A little white mouse looks really sick and shivers uncomfortably.


Uno suffer's from being exposed to light.
A little white mouse looks really sick and shivers uncomfortably.
A little white mouse is stunned, but will probably regain consciousness again.


Uno suffer's from being exposed to light.
A little white mouse looks really sick and shivers uncomfortably.
A little white mouse is stunned, but will probably regain consciousness again.


Uno suffer's from being exposed to light.
A little white mouse looks really sick and shivers uncomfortably.
A little white mouse is incapacitated and will slowly die, if not aided.
A little white mouse lies immobile on the ground, suffering...
A little white mouse is incapacitated and will slowly die, if not aided.


Uno suffer's from being exposed to light.
A little white mouse lies immobile on the ground, suffering...
A little white mouse is mortally wounded, and will die soon, if not aided.


Uno suffer's from being exposed to light.
A little white mouse lies helplessly on the ground and suffers...
A little white mouse is mortally wounded, and will die soon, if not aided.


Then the mouse dies:
Uno suffer's from being exposed to light.
A little white mouse suffers from bloodlack, and the lack of a beating heart...
A little white mouse is dead! R.I.P.
Your blood freezes as you hear a little white mouse's death cry.


And then only Uno's message:
Uno suffer's from being exposed to light.
Uno is mortally wounded, and will die soon, if not aided.


Finally Uno dies:
Uno screams in pain, keels over and dies.
Uno is dead! R.I.P.
Your blood freezes as you hear Uno's death cry.




So your first option, seems to Work 99% except for that one time with double message, where the mob gets incapacitated. Any ideas why it came ?
Last edit: 6 years 11 months ago by JTP.

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

More
6 years 11 months ago #6206 by thomas
Replied by thomas on topic suffering from poison
You're almost there:

This your current code:
      if (GET_POS(i) <= POS_STUNNED)
        update_pos(i);
     } /* this one is the reason for your problem. It makes the next statement the "if" for the "else if"s below it*/
    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;
    } else if (GET_POS(i) == POS_INCAP) {
      if (damage(i, i, 1, TYPE_SUFFERING) == -1)
	continue;

This is what you need:
+    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;
+     } /* here it matches the { three lines up */
      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;

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

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 11 months ago - 6 years 11 months ago #6207 by JTP
Replied by JTP on topic suffering from poison
Looks like poison now works, though now its 2 ticks of incapasitated, before just 1 tick.
And takes 3 ticks of mortally wounded, before it was 2 ticks.


So it takes 2 ticks longer to die. Any idea why there suddently are more rounds ?



Dying from sunlight, lots of suffering cus my test char has lots of hp, then 3 mortally wounded and then next tick dead.

So there was no incapasitated.
Last edit: 6 years 11 months ago by JTP.

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

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 9 months ago - 6 years 9 months ago #6400 by JTP
Replied by JTP on topic suffering from poison
It seems that there might still be something wrong with below code. Have had reports that the mud halted when being incapasitated. Then having to kill it and restart. Any ideas ? Also that it take more rounds now to die, then before. Like i wrote above.
    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($
        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);
    }
  }

Last edit: 6 years 9 months ago by JTP.

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 - 6 years 5 months ago #6651 by JTP
Replied by JTP on topic suffering from poison
Hi

I still have people freeze the mud so i need to kill the process and restart, anyone who can see whats wrong below ?
    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($
        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);
    }
  }
Last edit: 6 years 5 months ago by JTP.

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

More
6 years 5 months ago #6658 by krell
Replied by krell on topic suffering from poison
This only happens when the player is incapacitated or dying from poison?

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 #6659 by JTP
Replied by JTP on topic suffering from poison
Aparently when mob reaches incapacitated

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

More
6 years 5 months ago #6661 by WhiskyTest
Replied by WhiskyTest on topic suffering from poison
Couple of brackets were wrong. This works, but I took out your RACE_DROW and SPELL_SUN_LIGHT so I could test it on vanilla. Pop those back in and you should be good to go
      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;   

        if (!ROOM_FLAGGED(IN_ROOM(i), ROOM_DARK) && (!ROOM_FLAGGED(IN_ROOM(i), ROOM_INDOORS)) && (!ROOM_FLAGGED(IN_ROOM(i), ROOM_TUNNEL)))
            if (damage(i, i, GET_LEVEL(i), SPELL_MAGIC_MISSILE) == -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.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 5 months ago - 6 years 5 months ago #6682 by JTP
Replied by JTP on topic suffering from poison/Sun light
Hmm, hoped it was fixed. But again today a drow without Globe of darkness, Frooze the mud.

As soon as he studied Globe of darkness and used that spell, Then all is fine.

Hope there is a clever person here who Can tell me what is wrong.
Last edit: 6 years 5 months ago by JTP.

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

More
6 years 5 months ago #6683 by krell
Replied by krell on topic suffering from poison/Sun light
What kind of editor are you using to write your code? Is it something that tracks your syntax and makes appropriate suggestions or are you just coding with a simple text editor? The reason I ask is that there might be a syntax error, or possibly a logic error, in your conditional statements for drows and globe of darkness that's causing the mud to hang.

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 #6684 by JTP
Replied by JTP on topic suffering from poison/Sun light
I use pico on UNIX.

How would i know If that is the case ?

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

More
6 years 5 months ago #6685 by krell
Replied by krell on topic suffering from poison/Sun light
Reduce your conditional statements to the simplest case possible that still works, then add a condition, test, repeat ad nauseum.

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

More
6 years 5 months ago #6686 by thomas
Replied by thomas on topic suffering from poison/Sun light
First off - when you are submitting code to us, do not open the file in pico - pico truncates the lines if they are too long:
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($
We can't tell what this line ends with.
Instead, open the file with less or cat - both will wrap long lines.

Secondly - I suggest you simplify the code a bit. Instead of the long if statement, use something like:
above point_update():
static int isLitLocation(char_data *ch ) {
  return !ROOM_FLAGGED(IN_ROOM(ch), ROOM_DARK) &&
            !ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS) &&
            !ROOM_FLAGGED(IN_ROOM(ch), ROOM_TUNNEL);
// perhaps make sure this only triggers at day?
}

static int isLightSensitive(char_data *ch) {
  return GET_RACE(i) == RACE_DROW
      && !IS_AFFECTED(ch, SPELL_GLOBE_OF_DARKNESS);
}
 
Then rewrite the check to something like this:

     if (isLightSensitive(i) && isLitLocation(i))
            if (damage(i, i, GET_LEVEL(i), SPELL_MAGIC_MISSILE) == -1)
                continue;
This kind of simple refactoring makes the code easier to read. It also removes some of the parenthesis so it is easier to understand what is going on.

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 #6687 by JTP
Replied by JTP on topic suffering from poison/Sun light
Thanks wil try that.

I have tried to grep something with time to add so They only suffer at Day time.

Havent had luck finding something usefull. You Got Any idea on that ?

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 #6688 by JTP
Replied by JTP on topic suffering from poison/Sun light
limits.c:411: error: invalid storage class for function ‘isLitLocation’
limits.c:416: error: invalid storage class for function ‘isLightSensitive’

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

More
6 years 5 months ago #6689 by krell
Replied by krell on topic suffering from poison/Sun light
Are you copying thomas's code suggestions verbatim ore are you checking to see if they make sense and modifying them to work in the cosebase?

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 #6690 by JTP
Replied by JTP on topic suffering from poison/Sun light
Yea just changed the *ch to *i etc, it compiled now

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 - 6 years 5 months ago #6692 by JTP
Replied by JTP on topic suffering from poison/Sun light
I Tried this for time:
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) &&
        ((time_info.hours >= 5) && (time_info.hours <= 21));
  }
Compiles fine, but no damage without globe. So what to do for time check, so People takes damage during Day time ?
Last edit: 6 years 5 months ago by JTP.

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

Time to create page: 0.205 seconds