Some notes in line with the code
You don't have to do this - it's all already done for you when you use the already existing MON_INC_TIMED effect.
Code:
/* Determine if the monster resisted or not, if appropriate */
if (check_resist)
resisted = mon_resist_effect(mon, ef_idx, timer, flag);
[B] // This line should be in mon_resist_effect(), not here. If you put it here
// then the invisible timed effect will never happen, because...
[/B] if (ef_idx == MON_TMD_INVISIBLE) return (false);
if (resisted)
m_note = MON_MSG_UNAFFECTED;
else
[B] // this line is the one where the timer is set ("set the flag to the new timd value"
[/B] mon->m_timed[ef_idx] = timer;
if (player->upkeep->health_who == mon)
player->upkeep->redraw |= (PR_HEALTH);
if (ef_idx == MON_TMD_INVISIBLE) {
update_mon(mon, cave, false);
}


Comment