package com.zivilon.cinder_loe.mixins;

import com.zivilon.cinder_loe.entity.npc.orc.trader.AngmarOrcBrewer;
import com.zivilon.cinder_loe.entity.npc.orc.trader.AngmarOrcButcher;
import com.zivilon.cinder_loe.entity.npc.orc.trader.AngmarOrcSmith;
import lotr.common.entity.npc.LOTREntityAngmarOrcTrader;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.world.structure2.LOTRWorldGenAngmarCamp;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

import java.util.Random;

@Mixin(LOTRWorldGenAngmarCamp.class)
public class MixinLOTRWorldGenAngmarCamp {

    /**
     * @author KeyLime17
     * @reason Made orc camps select trader from multiple options
     */
    @Overwrite(remap = false)
    protected LOTREntityNPC getCampCaptain(World world, Random random) {
        int pick = random.nextInt(5);
        switch (pick) {
            case 1:
                return new AngmarOrcBrewer(world);
            case 2:
                return new AngmarOrcButcher(world);
            case 3:
                return new AngmarOrcSmith(world);
            case 4:
                return new LOTREntityAngmarOrcTrader(world);
            default:
                return null;
        }
    }
}
