def METHOD_NAME(evt: Event, var: GameState):
    chances = var.current_mode.TOTEM_CHANCES
    max_totems = sum(x["crazed shaman"] for x in chances.values())
    ps = get_players(var)
    shamans = get_all_players(var, ("crazed shaman",))
    for s in list(LASTGIVEN):
        if s not in shamans:
            del LASTGIVEN[s]
    shamans = list(shamans)
    random.shuffle(shamans)
    for shaman in shamans:
        if var.next_phase != "night":
            shaman.send(messages["shaman_notify"].format("crazed shaman"))
            continue
        pl = ps[:]
        random.shuffle(pl)
        for given in itertools.chain.from_iterable(LASTGIVEN[shaman].values()):
            if given in pl:
                pl.remove(given)
        event = Event("num_totems", {"num": var.current_mode.NUM_TOTEMS["crazed shaman"]})
        event.dispatch(var, shaman, "crazed shaman")
        num_totems = event.data["num"]
        totems = {}
        for i in range(num_totems):
            target = 0
            rand = random.random() * max_totems
            for t in chances:
                target += chances[t]["crazed shaman"]
                if rand <= target:
                    if t in totems:
                        totems[t] += 1
                    else:
                        totems[t] = 1
                    break
        event = Event("totem_assignment", {"totems": totems})
        event.dispatch(var, shaman, "crazed shaman")
        TOTEMS[shaman] = event.data["totems"]
        num_totems = sum(TOTEMS[shaman].values())
        if num_totems > 1:
            shaman.send(messages["shaman_notify_multiple_random"].format("crazed shaman"))
        else:
            shaman.send(messages["shaman_notify"].format("crazed shaman"))
        shaman.send(totem_message(TOTEMS[shaman], count_only=True))
        shaman.send(messages["players_list"].format(pl))