Method code for $robot.check_reactions()

[Turn on line numbering]
arg type, str, sender;
var rnum, t, id, chance, times, method, template, m, types;

rnum = random(100);
if (type == 'tell)
    types = ['tell, 'any];
else
    types = [type, 'notell, 'any];
for t in (types) {
    if (!dict_contains(active, t))
        continue;
    for id in (dict_keys(active[t])) {
        [chance, times] = active[t][id];
        if (rnum > chance)
            break;
        [method, template] = reactions[id];
        if (!template || (m = str.(method)(template))) {
            if (times == 1)
                .remove_active(t, id);
            else if (times > 1)
                .update_active(t, id, [chance, --times]);
            if (.do_reaction(str, m, id, sender) != 'continue)
                return;
        }
    }
}

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

Method Ancestry Override:

 ----  186 $robot.check_reactions(type, str, sender)
 ----  156 $has_reactions.check_reactions(type, str, sender)

the Cold Dark