From 2b9da4a0f048300e14bf359b705a4c04c05064ba Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sun, 24 Dec 2017 21:45:03 +1000 Subject: + Added the Tesla Tower for base defence. --- .../api/damage/BaseCustomDamageSource.java | 22 ++++++++++++++++++++++ .../gtPlusPlus/api/damage/DamageTeslaTower.java | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/Java/gtPlusPlus/api/damage/BaseCustomDamageSource.java create mode 100644 src/Java/gtPlusPlus/api/damage/DamageTeslaTower.java (limited to 'src/Java/gtPlusPlus/api/damage') diff --git a/src/Java/gtPlusPlus/api/damage/BaseCustomDamageSource.java b/src/Java/gtPlusPlus/api/damage/BaseCustomDamageSource.java new file mode 100644 index 0000000000..24348988d6 --- /dev/null +++ b/src/Java/gtPlusPlus/api/damage/BaseCustomDamageSource.java @@ -0,0 +1,22 @@ +package gtPlusPlus.api.damage; + +import net.minecraft.entity.Entity; +import net.minecraft.util.EntityDamageSourceIndirect; + +public class BaseCustomDamageSource extends EntityDamageSourceIndirect { + + public BaseCustomDamageSource(String name, Entity transmitter, Entity indirectSource) { + super(name, transmitter, indirectSource); + this.setDifficultyScaled(); + } + + /** + * Return whether this damage source will have its damage amount scaled based on the current difficulty. + */ + public boolean isDifficultyScaled() + { + return true; + } + + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/api/damage/DamageTeslaTower.java b/src/Java/gtPlusPlus/api/damage/DamageTeslaTower.java new file mode 100644 index 0000000000..ada2ba5c3d --- /dev/null +++ b/src/Java/gtPlusPlus/api/damage/DamageTeslaTower.java @@ -0,0 +1,22 @@ +package gtPlusPlus.api.damage; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class DamageTeslaTower extends BaseCustomDamageSource{ + + public DamageTeslaTower(Entity transmitter) { + super("plasmabolt", transmitter, null); + this.setDamageBypassesArmor(); + this.setDamageIsAbsolute(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase target) { + String s = "death.attack." + this.damageType; + return new ChatComponentTranslation(s, target.getCommandSenderName(), "Plasma"); + } + +} -- cgit