Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing info about demons (Blood Magic) #49

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.annotation.Nonnull;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

import com.kuba6000.mobsinfo.api.IChanceModifier;
import com.kuba6000.mobsinfo.api.MobDrop;
import com.kuba6000.mobsinfo.api.MobRecipe;

import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt;
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;

public class BloodMagic implements IExtraLoader {

Expand All @@ -28,5 +37,54 @@ public void process(String k, ArrayList<MobDrop> drops, MobRecipe recipe) {
drop.chanceModifiers.addAll(Arrays.asList(new NormalChance(50d), new DropsOnlyWithWeaknessII()));
drops.add(drop);
}
if (recipe.entity instanceof EntityDemon) {
for (MobDrop drop : drops) {
if (drop.stack.getItem() == ModItems.demonPlacer) {
drop.variableChance = true;
drop.chanceModifiers.addAll(Arrays.asList(new NormalChance(100d), new DemonDemonPlacer()));
}
}
}
// WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.EntityMinorDemonGrunt.dropFewItems
if (recipe.entity instanceof EntityMinorDemonGrunt) {
ItemStack lifeShardStack = new ItemStack(ModItems.baseItems, 1, 28);
ItemStack soulShardStack = new ItemStack(ModItems.baseItems, 1, 29);
MobDrop drop = new MobDrop(lifeShardStack, MobDrop.DropType.Normal, 0, 0, null, true, false);
drop.variableChance = true;
drop.chanceModifiers.addAll(Arrays.asList(new NormalChance(30d), new MinorDemonGruntShards()));
drops.add(drop);
MobDrop drop2 = new MobDrop(soulShardStack, MobDrop.DropType.Normal, 0, 0, null, true, false);
drop2.variableChance = true;
drop2.chanceModifiers.addAll(Arrays.asList(new NormalChance(30d), new MinorDemonGruntShards()));
drops.add(drop2);
}
}

private static class MinorDemonGruntShards implements IChanceModifier {

@Override
public String getDescription() {
return Translations.BLOODMAGIC_DEMON_SHARDS.get();
}

@Override
public double apply(double chance, @Nonnull World world, @Nonnull List<ItemStack> drops, Entity attacker,
EntityLiving victim) {
return chance;
}
}

private static class DemonDemonPlacer implements IChanceModifier {

@Override
public String getDescription() {
return Translations.BLOODMAGIC_DEMON_PLACER.get();
}

@Override
public double apply(double chance, @Nonnull World world, @Nonnull List<ItemStack> drops, Entity attacker,
EntityLiving victim) {
return 0d;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ enum Translations {
TINKERS_CONSTRUCT_BEHEADING_1,
WITCHERY_VAMPIRE_BOOK,
WITCHERY_WAREWOLF,
BLOODMAGIC_DEMON_SHARDS,
BLOODMAGIC_DEMON_PLACER,

;

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/mobsinfo/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ mobsinfo.extras.tinkers_construct_beheading=Each level of beheading on your weap
mobsinfo.extras.tinkers_construct_beheading_1=If you are using a Cleaver, it gives another %.2f%%
mobsinfo.extras.witchery_vampire_book=Drops only when player has Vampire book
mobsinfo.extras.witchery_warewolf=Only when killer is a Warewolf
mobsinfo.extras.bloodmagic_demon_shards=Drops only when spawned using Demon Portal or hit with dagger of sacrifice
mobsinfo.extras.bloodmagic_demon_placer=Drops only when NOT spawned using Demon Portal and NOT hit with dagger of sacrifice


#Commands
Expand Down
Loading