#include "Insults.h"
#include "Utils/AudioUtils.h"
#include "Utils/FileUtils.h"
#include "Utils/ChatUtils.h"
#include "Client.h"

auto Insults::onKilledPlayer(Actor& actor) -> void {
    auto clientinstance = Client::clientinstance;
    if (!clientinstance) return;

    auto localplayer = clientinstance->getLocalPlayer();
    if (!localplayer) return;

    auto loopbackpacketsender = clientinstance->getLoopbackPacketSender();
    if (!loopbackpacketsender) return;

    switch (killsound) {
    case 1:
        Utils::Audio::playmc(_("random.orb"), 1.f, 1.f);
        Utils::Audio::playmc(_("firework.blast"), 1.f, 1.f);
        break;
    case 2:
        Utils::Audio::playmc(_("random.orb"), 1.f, 2.f);
        Utils::Audio::playmc(_("dig.stone"), 1.f, 1.f);
        break;
    }
}
