forked from MobiusFlip/CrimsonRevelations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
392 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...main/java/com/mobiusflip/crimsonrevelations/client/renderer/RenderOvergrownTaintacle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.mobiusflip.crimsonrevelations.client.renderer; | ||
|
||
import com.mobiusflip.crimsonrevelations.CrimsonRevelations; | ||
import com.mobiusflip.crimsonrevelations.entity.boss.EntityOvergrownTaintacle; | ||
|
||
import net.minecraft.client.renderer.entity.RenderLiving; | ||
import net.minecraft.client.renderer.entity.RenderManager; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
import thaumcraft.client.renderers.models.entity.ModelTaintacle; | ||
|
||
@SideOnly(Side.CLIENT) | ||
public class RenderOvergrownTaintacle extends RenderLiving<EntityOvergrownTaintacle> { | ||
public static final ResourceLocation TEXTURES = new ResourceLocation(CrimsonRevelations.MODID, "textures/entity/overgrown_taintacle.png"); | ||
|
||
public RenderOvergrownTaintacle(RenderManager renderManager) { | ||
super(renderManager, new ModelTaintacle(12, false), 0.8F); | ||
} | ||
|
||
@Override | ||
protected ResourceLocation getEntityTexture(EntityOvergrownTaintacle entity) { | ||
return TEXTURES; | ||
} | ||
} |
170 changes: 170 additions & 0 deletions
170
src/main/java/com/mobiusflip/crimsonrevelations/entity/boss/EntityOvergrownTaintacle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
package com.mobiusflip.crimsonrevelations.entity.boss; | ||
|
||
import net.minecraftforge.event.ForgeEventFactory; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import com.mobiusflip.crimsonrevelations.init.LootTableHandler; | ||
|
||
import net.minecraft.entity.IEntityLivingData; | ||
import net.minecraft.entity.SharedMonsterAttributes; | ||
import net.minecraft.entity.ai.attributes.IAttributeInstance; | ||
import net.minecraft.entity.item.EntityXPOrb; | ||
import net.minecraft.entity.player.EntityPlayerMP; | ||
import net.minecraft.world.BossInfo; | ||
import net.minecraft.world.BossInfoServer; | ||
import net.minecraft.world.DifficultyInstance; | ||
import net.minecraft.world.World; | ||
import net.minecraft.util.ResourceLocation; | ||
import thaumcraft.api.ThaumcraftApiHelper; | ||
import thaumcraft.api.entities.ITaintedMob; | ||
import thaumcraft.client.fx.FXDispatcher; | ||
import thaumcraft.common.entities.monster.mods.ChampionModifier; | ||
import thaumcraft.common.entities.monster.tainted.EntityTaintacle; | ||
import thaumcraft.common.lib.SoundsTC; | ||
import thaumcraft.common.lib.utils.EntityUtils; | ||
|
||
public class EntityOvergrownTaintacle extends EntityTaintacle implements ITaintedMob { | ||
protected final BossInfoServer bossInfo; | ||
|
||
public EntityOvergrownTaintacle(World world) { | ||
super(world); | ||
this.bossInfo = new BossInfoServer(this.getDisplayName(), BossInfo.Color.PINK, BossInfo.Overlay.PROGRESS); | ||
this.setSize(1.0F, 5.5F); | ||
this.experienceValue = 50; | ||
} | ||
|
||
@Override | ||
protected void applyEntityAttributes() { | ||
super.applyEntityAttributes(); | ||
this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(8.0D); | ||
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(9.0D); | ||
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(175.0D); | ||
this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(1.0D); | ||
} | ||
|
||
@Override | ||
protected void updateAITasks() { | ||
super.updateAITasks(); | ||
this.bossInfo.setPercent(this.getHealth() / this.getMaxHealth()); | ||
} | ||
|
||
@Override | ||
public void removeTrackingPlayer(final EntityPlayerMP player) { | ||
super.removeTrackingPlayer(player); | ||
this.bossInfo.removePlayer(player); | ||
} | ||
|
||
@Override | ||
public void addTrackingPlayer(final EntityPlayerMP player) { | ||
super.addTrackingPlayer(player); | ||
this.bossInfo.addPlayer(player); | ||
} | ||
|
||
// Fixes it spawning with lower health | ||
protected void makeChampion() { | ||
if (getEntityAttribute(ThaumcraftApiHelper.CHAMPION_MOD).getAttributeValue() > -2.0) return; | ||
|
||
int type = rand.nextInt(ChampionModifier.mods.length); | ||
IAttributeInstance mod = getEntityAttribute(ThaumcraftApiHelper.CHAMPION_MOD); | ||
mod.removeModifier(ChampionModifier.mods[type].attributeMod); | ||
mod.applyModifier(ChampionModifier.mods[type].attributeMod); | ||
|
||
IAttributeInstance health = getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH); | ||
health.removeModifier(EntityUtils.CHAMPION_HEALTH); | ||
health.applyModifier(EntityUtils.CHAMPION_HEALTH); | ||
|
||
IAttributeInstance attackDamage = getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE); | ||
attackDamage.removeModifier(EntityUtils.CHAMPION_DAMAGE); | ||
attackDamage.applyModifier(EntityUtils.CHAMPION_DAMAGE); | ||
|
||
setHealth(getMaxHealth()); | ||
setCustomNameTag(ChampionModifier.mods[type].getModNameLocalized() + " " + getName()); | ||
enablePersistence(); | ||
switch (type) { | ||
// Bold | ||
case 0: { | ||
IAttributeInstance movementSpeed = getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED); | ||
movementSpeed.removeModifier(EntityUtils.BOLDBUFF); | ||
movementSpeed.applyModifier(EntityUtils.BOLDBUFF); | ||
break; | ||
} | ||
|
||
// Mighty | ||
case 3: { | ||
attackDamage.removeModifier(EntityUtils.MIGHTYBUFF); | ||
attackDamage.applyModifier(EntityUtils.MIGHTYBUFF); | ||
break; | ||
} | ||
|
||
// Warded | ||
case 5: { | ||
int warding = (int) (getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).getBaseValue() / 2.0); | ||
setAbsorptionAmount(getAbsorptionAmount() + warding); | ||
break; | ||
} | ||
|
||
default: | ||
break; | ||
} | ||
} | ||
|
||
@Override | ||
public boolean canBreatheUnderwater() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean canBePushed() { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected int decreaseAirSupply(int air) { | ||
return air; | ||
} | ||
|
||
@Override | ||
public void setInWeb() { | ||
} | ||
|
||
@Override | ||
public IEntityLivingData onInitialSpawn(DifficultyInstance diff, @Nullable IEntityLivingData data) { | ||
this.makeChampion(); | ||
this.bossInfo.setName(this.getDisplayName()); | ||
return super.onInitialSpawn(diff, data); | ||
} | ||
|
||
public boolean isNonBoss() { | ||
return false; | ||
} | ||
|
||
// Special taint death animation | ||
@Override | ||
protected void onDeathUpdate() { | ||
if (!this.world.isRemote && (this.isPlayer() || this.recentlyHit > 0 && this.canDropLoot() && this.world.getGameRules().getBoolean("doMobLoot"))) { | ||
int i = this.getExperiencePoints(this.attackingPlayer); | ||
i = ForgeEventFactory.getExperienceDrop(this, this.attackingPlayer, i); | ||
|
||
while (i > 0) { | ||
int j = EntityXPOrb.getXPSplit(i); | ||
i -= j; | ||
this.world.spawnEntity(new EntityXPOrb(this.world, this.posX, this.posY, this.posZ, j)); | ||
} | ||
} | ||
|
||
this.setDead(); | ||
this.playSound(SoundsTC.gore, 1.0F, 0.65F / (rand.nextFloat() * 0.4F + 0.8F)); | ||
|
||
for (int k = 0; k < 40; ++k) { | ||
FXDispatcher.INSTANCE.splooshFX(this); | ||
FXDispatcher.INSTANCE.taintsplosionFX(this); | ||
} | ||
} | ||
|
||
@Override | ||
@Nullable | ||
protected ResourceLocation getLootTable() { | ||
return LootTableHandler.OVERGROWN_TAINTACLE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/com/mobiusflip/crimsonrevelations/init/RenderingHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.mobiusflip.crimsonrevelations.init; | ||
|
||
import com.mobiusflip.crimsonrevelations.client.renderer.RenderOvergrownTaintacle; | ||
import com.mobiusflip.crimsonrevelations.entity.boss.EntityOvergrownTaintacle; | ||
|
||
import net.minecraftforge.fml.client.registry.RenderingRegistry; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
@SideOnly(Side.CLIENT) | ||
public class RenderingHandler { | ||
public static void preInit() { | ||
RenderingRegistry.registerEntityRenderingHandler(EntityOvergrownTaintacle.class, RenderOvergrownTaintacle::new); | ||
} | ||
} |
19 changes: 16 additions & 3 deletions
19
src/main/java/com/mobiusflip/crimsonrevelations/init/ResearchHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,34 @@ | ||
package com.mobiusflip.crimsonrevelations.init; | ||
|
||
import com.mobiusflip.crimsonrevelations.CrimsonRevelations; | ||
import com.mobiusflip.crimsonrevelations.entity.boss.EntityOvergrownTaintacle; | ||
import com.mobiusflip.crimsonrevelations.item.foci.FocusEffectPoison; | ||
|
||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fml.common.Loader; | ||
import thaumcraft.Thaumcraft; | ||
import thaumcraft.api.ThaumcraftApi; | ||
import thaumcraft.api.aspects.AspectList; | ||
import thaumcraft.api.casters.FocusEngine; | ||
import thaumcraft.api.research.ResearchCategories; | ||
import thaumcraft.api.research.ScanEntity; | ||
import thaumcraft.api.research.ScanningManager; | ||
|
||
public class ResearchHandler { | ||
public static void init() { | ||
// Focus Effects | ||
FocusEngine.registerElement(FocusEffectPoison.class, new ResourceLocation(CrimsonRevelations.MODID, "textures/foci/poison.png"), 9039872); | ||
|
||
// Research Categories | ||
ResearchCategories.registerCategory("REVELATIONS", "CrimsonRites", new AspectList(), new ResourceLocation(Thaumcraft.MODID, "textures/items/crimson_rites.png"), new ResourceLocation(CrimsonRevelations.MODID, "textures/gui/research_background.jpg"), new ResourceLocation(Thaumcraft.MODID, "textures/gui/gui_research_back_over.png")); | ||
|
||
// Researches | ||
ThaumcraftApi.registerResearchLocation(new ResourceLocation(CrimsonRevelations.MODID, "research/revelations")); | ||
|
||
// Focus Effects | ||
FocusEngine.registerElement(FocusEffectPoison.class, new ResourceLocation(CrimsonRevelations.MODID, "textures/foci/poison.png"), 9039872); | ||
if (Loader.isModLoaded("thaumicaugmentation")) | ||
ThaumcraftApi.registerResearchLocation(new ResourceLocation(CrimsonRevelations.MODID, "research/compat/thaumic_augmentation")); | ||
|
||
// Scanning | ||
if (Loader.isModLoaded("thaumicaugmentation")) | ||
ScanningManager.addScannableThing(new ScanEntity("!OVERGROWN_TAINTACLE", EntityOvergrownTaintacle.class, true)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.