diff options
author | Blood Asp <Blood@Asp> | 2015-04-23 18:14:22 +0200 |
---|---|---|
committer | Blood Asp <Blood@Asp> | 2015-04-23 18:14:22 +0200 |
commit | 7224ac4299098c70efae9dbd04c50a97e3f5f583 (patch) | |
tree | c739bb7d176a9735bc8e598063918023de32330c /main/java/gregtech/api/damagesources/GT_DamageSources.java | |
download | GT5-Unofficial-7224ac4299098c70efae9dbd04c50a97e3f5f583.tar.gz GT5-Unofficial-7224ac4299098c70efae9dbd04c50a97e3f5f583.tar.bz2 GT5-Unofficial-7224ac4299098c70efae9dbd04c50a97e3f5f583.zip |
Initial Commit
Diffstat (limited to 'main/java/gregtech/api/damagesources/GT_DamageSources.java')
-rw-r--r-- | main/java/gregtech/api/damagesources/GT_DamageSources.java | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/main/java/gregtech/api/damagesources/GT_DamageSources.java b/main/java/gregtech/api/damagesources/GT_DamageSources.java new file mode 100644 index 0000000000..d83bf661fe --- /dev/null +++ b/main/java/gregtech/api/damagesources/GT_DamageSources.java @@ -0,0 +1,86 @@ +package gregtech.api.damagesources; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.*; + +public class GT_DamageSources { + public static DamageSource getElectricDamage() { + return ic2.api.info.Info.DMG_ELECTRIC; + } + + public static DamageSource getRadioactiveDamage() { + return ic2.api.info.Info.DMG_RADIATION; + } + + public static DamageSource getNukeExplosionDamage() { + return ic2.api.info.Info.DMG_NUKE_EXPLOSION; + } + + public static DamageSource getExplodingDamage() { + return new DamageSourceExploding(); + } + + public static DamageSource getCombatDamage(String aType, EntityLivingBase aPlayer, IChatComponent aDeathMessage) { + return new DamageSourceCombat(aType, aPlayer, aDeathMessage); + } + + public static DamageSource getHeatDamage() { + return new DamageSourceHeat(); + } + + public static DamageSource getFrostDamage() { + return new DamageSourceFrost(); + } + + private static class DamageSourceCombat extends EntityDamageSource { + private IChatComponent mDeathMessage; + + public DamageSourceCombat(String aType, EntityLivingBase aPlayer, IChatComponent aDeathMessage) { + super(aType, aPlayer); + mDeathMessage = aDeathMessage; + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return mDeathMessage == null ? super.func_151519_b(aTarget) : mDeathMessage; + } + } + + private static class DamageSourceFrost extends DamageSource { + public DamageSourceFrost() { + super("frost"); + setDifficultyScaled(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " got frozen"); + } + } + + private static class DamageSourceHeat extends DamageSource { + public DamageSourceHeat() { + super("steam"); + setDifficultyScaled(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " was boiled alive"); + } + } + + public static class DamageSourceExploding extends DamageSource { + public DamageSourceExploding() { + super("exploded"); + setDamageAllowedInCreativeMode(); + setDamageBypassesArmor(); + setDamageIsAbsolute(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " exploded"); + } + } +}
\ No newline at end of file |