package izzyaxel.arcaneartificing.main.damageSources;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;

import java.util.Random;

public class QuakeDamageSource extends DamageSource
{
	public QuakeDamageSource()
	{
		super("quake");
	}

	@Override
	public IChatComponent func_151519_b (EntityLivingBase entityLivingBase)
	{
		String type = "";
		Random rand = new Random();
		switch(rand.nextInt(3))
		{
		case 0: type = "one."; break;
		case 1: type = "two."; break;
		case 2: type = "three."; break;
		}
		EntityLivingBase entityLivingBase2 = entityLivingBase.func_94060_bK();
		String deathComp = "death." + type + this.damageType + ".player";
		return entityLivingBase2 != null && StatCollector.canTranslate(deathComp) ? new ChatComponentTranslation(deathComp, new Object[] { entityLivingBase.func_145748_c_(), entityLivingBase2.func_145748_c_() }) : new ChatComponentTranslation(deathComp, new Object[] { entityLivingBase.func_145748_c_() });
	}
}
