Welcome to the Builder Academy

Question suffering from poison

More
03 May 2017 22:12 #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.

More
03 May 2017 22:43 - 03 May 2017 23:23 #6692 by JTP
Replied by JTP on topic suffering from poison/Sun light
I Tried this for time:
Code:
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: 03 May 2017 23:23 by JTP.

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

More
04 May 2017 02:16 #6696 by WhiskyTest
what about:
Code:
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.

More
04 May 2017 14:30 #6699 by JTP
Replied by JTP on topic suffering from poison/Sun light
Seems none of this is working:
Code:
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
04 May 2017 20:00 #6700 by WhiskyTest
Do you mind posting your entire functuon as it currently is?

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

More
04 May 2017 20:15 #6701 by JTP
Replied by JTP on topic suffering from poison/Sun light
Sure here it is, hope you can see whats up
Code:
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.

Time to create page: 0.210 seconds