Skip to content

Commit

Permalink
Taint Poison Focus Effect
Browse files Browse the repository at this point in the history
-Fix poison focus effect damage
  • Loading branch information
IcarussOne committed May 26, 2024
1 parent 518ec67 commit 83eed21
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mobiusflip.crimsonrevelations.CrimsonRevelations;
import com.mobiusflip.crimsonrevelations.entity.boss.EntityOvergrownTaintacle;
import com.mobiusflip.crimsonrevelations.item.foci.FocusEffectPoison;
import com.mobiusflip.crimsonrevelations.item.foci.FocusEffectTaintPoison;

import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Loader;
Expand All @@ -18,6 +19,8 @@ public class ResearchHandler {
public static void init() {
// Focus Effects
FocusEngine.registerElement(FocusEffectPoison.class, new ResourceLocation(CrimsonRevelations.MODID, "textures/foci/poison.png"), 9039872);
if (Loader.isModLoaded("thaumicaugmentation"))
FocusEngine.registerElement(FocusEffectTaintPoison.class, new ResourceLocation(CrimsonRevelations.MODID, "textures/foci/taint_poison.png"), 10354925);

// 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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public boolean execute(final RayTraceResult target, final Trajectory trajectory,
if (target.typeOfHit == RayTraceResult.Type.ENTITY && target.entityHit != null) {
final float damage = this.getDamageForDisplay(finalPower);
final int duration = 40 * this.getSettingValue("duration");
final int potency = (int) (1.0F + this.getSettingValue("power") * finalPower / 3.0F);
final int potency = (int) (1.0F + this.getSettingValue("power") * finalPower / 2.0F);
target.entityHit.attackEntityFrom(DamageSource.causeThrownDamage((Entity) ((target.entityHit != null) ? target.entityHit : this.getPackage().getCaster()), (Entity) this.getPackage().getCaster()), damage);

if (target.entityHit instanceof EntityLivingBase) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
package com.mobiusflip.crimsonrevelations.item.foci;

import com.mobiusflip.crimsonrevelations.CrimsonRevelations;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.casters.FocusEffect;
import thaumcraft.api.casters.NodeSetting;
import thaumcraft.api.casters.Trajectory;
import thaumcraft.api.potions.PotionFluxTaint;
import thaumcraft.client.fx.ParticleEngine;
import thaumcraft.client.fx.particles.FXGeneric;
import thaumcraft.common.lib.SoundsTC;
import thaumcraft.common.lib.network.PacketHandler;
import thaumcraft.common.lib.network.fx.PacketFXFocusPartImpact;

public class FocusEffectTaintPoison extends FocusEffect {
@Override
public Aspect getAspect() {
return Aspect.FLUX;
}

@Override
public String getKey() {
return "focus." + CrimsonRevelations.MODID + ".taint_poison";
}

@Override
public NodeSetting[] createSettings() {
return new NodeSetting[]{new NodeSetting("power", "focus.common.power", (NodeSetting.INodeSettingType) new NodeSetting.NodeSettingIntRange(1, 5)), new NodeSetting("duration", "focus.common.double_duration", (NodeSetting.INodeSettingType) new NodeSetting.NodeSettingIntRange(2, 10))};
}

@Override
public int getComplexity() {
return this.getSettingValue("duration") + this.getSettingValue("power") * 3;
}

@Override
public float getDamageForDisplay(final float finalPower) {
return (4 + this.getSettingValue("power")) * finalPower;
}

@Override
public String getResearch() {
return "FOCUS_TAINT_POISON";
}

@Override
public boolean execute(final RayTraceResult target, final Trajectory trajectory, final float finalPower, final int num) {
PacketHandler.INSTANCE.sendToAllAround((IMessage) new PacketFXFocusPartImpact(target.hitVec.x, target.hitVec.y, target.hitVec.z, new String[]{this.getKey()}), new NetworkRegistry.TargetPoint(this.getPackage().world.provider.getDimension(), target.hitVec.x, target.hitVec.y, target.hitVec.z, 64.0D));
this.getPackage().world.playSound((EntityPlayer) null, target.hitVec.x, target.hitVec.y, target.hitVec.z, SoundsTC.bubble, SoundCategory.PLAYERS, 0.33F, 0.65F + (float) (this.getPackage().world.rand.nextGaussian() * 0.05F));
this.getPackage().world.playSound((EntityPlayer) null, target.hitVec.x, target.hitVec.y, target.hitVec.z, SoundsTC.egscreech, SoundCategory.PLAYERS, 0.2F, 1.5F + (float) (this.getPackage().world.rand.nextGaussian() * 0.1F));

if (target.typeOfHit == RayTraceResult.Type.ENTITY && target.entityHit != null) {
final float damage = this.getDamageForDisplay(finalPower);
final int duration = 40 * this.getSettingValue("duration");
final int potency = (int) (1.0F + this.getSettingValue("power") * finalPower / 4.0F);
target.entityHit.attackEntityFrom(DamageSource.causeThrownDamage((Entity) ((target.entityHit != null) ? target.entityHit : this.getPackage().getCaster()), (Entity) this.getPackage().getCaster()).setDamageBypassesArmor(), damage);

if (target.entityHit instanceof EntityLivingBase) {
((EntityLivingBase) target.entityHit).addPotionEffect(new PotionEffect(PotionFluxTaint.instance, duration, potency));
}
}

return false;
}

@Override
public void onCast(Entity caster) {
caster.world.playSound(null, caster.getPosition().up(), SoundsTC.bubble, SoundCategory.PLAYERS, 0.33F, 0.9F + caster.world.rand.nextFloat() * 0.1F);
}

@Override
@SideOnly(Side.CLIENT)
public void renderParticleFX(World world, double posX, double posY, double posZ, double velX, double velY, double velZ) {
final FXGeneric pp = new FXGeneric(world, posX, posY, posZ, velX, velY, velZ);
int color = 10354925;
pp.setGravity(-0.2F);
pp.setMaxAge(10 + world.rand.nextInt(5));
pp.setSlowDown(0.65);
pp.setScale(new float[]{(float) (0.1F + world.rand.nextGaussian() * 0.2F), 3.0F});
pp.setParticles(575, 8, 8);
pp.setRBGColorF(((color >> 16) & 0xFF) / 255.0F, ((color >> 8) & 0xFF) / 255.0F, (color & 0xFF) / 255.0F);
ParticleEngine.addEffect(world, pp);
}
}
6 changes: 6 additions & 0 deletions src/main/resources/assets/crimsonrevelations/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,16 @@ crimsonrevelations.research.QUARTZ_PURIFICATION.text.stage.2=The key insight pro
crimsonrevelations.research.FOCUS_POISON.title=Focus Effect: Poison
crimsonrevelations.research.FOCUS_POISON.stage.0=The poison inflicted from this blast of noxious goo lasts twice as long when compared to other effects.<BR>I must be wary however that a fair amount of monsters are resistant to being poisoned, such as the undead, spiders, and other rather fearsome opponents.

crimsonrevelations.research.FOCUS_TAINT_POISON.title=Focus Effect: Taint Poison
crimsonrevelations.research.FOCUS_TAINT_POISON.stage.0=Taint Poison is much more deadly than regular poison. It lasts just as long and is acidic enough to even go through armor.<BR>I must be careful when handling this effect, it's all fun and games until the target becomes infected, in which case more extreme measures must be taken.<BR>Undead seem to be completely unaffected by this type of poison.

crimsonrevelations.research.OVERGROWN_TAINTACLE.title=Overgrown Taintacle
crimsonrevelations.research.OVERGROWN_TAINTACLE.stage.0=During one of my treks in the Emptiness, I have discovered a significantly stronger and more aggressive Taintacle variant. It seems to have a symbiotic relationship with the environment, which would explain the main source of its power.<BR>Hunting these larger Taintacles would be ideal, I should be able to harvest whatever congealed energy it leaves off for my own purposes.

focus.crimsonrevelations.poison.name=Poison
focus.crimsonrevelations.poison.text=Summons a blob of goo at your target and poisons it for double the usual duration.

focus.crimsonrevelations.taint_poison.name=Taint Poison
focus.crimsonrevelations.taint_poison.text=Unleashes a glob of infectious taint at your target and poisons it for double the usual duration. Vulnerable targets can become corrupted with taint.

focus.common.double_duration=Duration (two seconds)
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,44 @@
"text": "crimsonrevelations.research.OVERGROWN_TAINTACLE.stage.0"
}
]
},
{
"key": "FOCUS_TAINT_POISON",
"name": "crimsonrevelations.research.FOCUS_TAINT_POISON.title",
"icons": [
"focus:focus.crimsonrevelations.taint_poison"
],
"category": "REVELATIONS",
"parents": [
"FOCUSCURSE",
"FOCUS_POISON",
"!OVERGROWN_TAINTACLE"
],
"siblings": [],
"meta": [],
"location": [
-1,
-4
],
"reward_item": [],
"reward_knowledge": [],
"stages": [
{
"text": "crimsonrevelations.research.FOCUS_TAINT_POISON.stage.0",
"required_knowledge": [
"THEORY;ELDRITCH;2",
"THEORY;AUROMANCY;2"
],
"required_item": [
"thaumcraft:void_seed;8"
],
"required_research": [
"!OVERGROWN_TAINTACLE",
"!vitium",
"!alienis"
]
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@
"OBSERVATION;AUROMANCY;1"
],
"required_research": [
"!alkimia"
"!alkimia",
"!mortuus"
]
}
]
Expand Down

0 comments on commit 83eed21

Please sign in to comment.