So I'm working on adding a little more variety to poisons, creating two more that are a bit more deadly than just stock poison. I've gotten it to work very well, except for one thing: the message it delivers to the room when a tick goes by. You know, for poison, you'd see...
PapaBob shivers uncomfortably.
Or something like that, whatever text was put in the messages file. Here's a bit of code that, I think, has an effect on that; it's found in limits.c, in the point_update function.
Code:
/* Update PCs, NPCs, and objects */
void point_update(void)
{
struct char_data *i, *next_char;
struct obj_data *j, *next_thing, *jj, *next_thing2;
/* 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) || AFF_FLAGGED(i, AFF_MAJPOISON) || AFF_FLAGGED(i, AFF_LETPOISON))
if (damage(i, i, 2, SPELL_POISON) == -1) // <---- What does this doing?
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;
} else if (GET_POS(i) == POS_DEAD) {
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);
}
}
I've marked the line I'm curious about. What is that line doing? I'm curious as to what that line and others around it are actually doing; I'm afraid to admit it, but I don't really understand it. I assume it deals 2 damage to someone who is afflicted by poison. Would that be giving the player the poisoned message every tick? I've tried doing the same thing with SPELL_MAJ_POISON and SPELL_LET_POISON, and it doesn't work out so well... and this line seems to go off for AFF_POISON, AFF_MAJPOISON, and AFF_LETPOISON, not just AFF_POISON.
Anyways, any help is much appreciated. Thanks!