package com.zivilon.cinder_loe.mixins;

import com.zivilon.cinder_loe.entity.npc.orc.trader.*;
import lotr.common.entity.npc.LOTREntityAngmarOrcTrader;
import lotr.common.entity.npc.LOTREntityNPC;
import lotr.common.entity.npc.LOTREntityUrukHaiMercenaryCaptain;
import lotr.common.entity.npc.LOTREntityUrukHaiTrader;
import lotr.common.world.structure2.LOTRWorldGenAngmarCamp;
import lotr.common.world.structure2.LOTRWorldGenUrukCamp;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

import java.util.Random;

@Mixin(LOTRWorldGenUrukCamp.class)
public class MixinLOTRWorldGenIsengardCamp {

    /**
     * @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 IsengardOrcBrewer(world);
            case 2:
                return new IsengardOrcButcher(world);
            case 3:
                return new IsengardOrcSmith(world);
            case 4:
                return new LOTREntityUrukHaiTrader(world);
            default:
                return new LOTREntityUrukHaiMercenaryCaptain(world);
        }
    }
}
