diff --git a/build.gradle b/build.gradle index 739238588..924955fb8 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.2.3" +version = "1.24" group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "CustomNPC-Plus" diff --git a/src/main/java/noppes/npcs/CustomNpcs.java b/src/main/java/noppes/npcs/CustomNpcs.java index d001670dd..bdd44417d 100644 --- a/src/main/java/noppes/npcs/CustomNpcs.java +++ b/src/main/java/noppes/npcs/CustomNpcs.java @@ -60,7 +60,7 @@ import noppes.npcs.entity.old.EntityNpcNagaFemale; import noppes.npcs.entity.old.EntityNpcNagaMale; import noppes.npcs.entity.old.EntityNpcSkeleton; -@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.2.3") +@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.24") public class CustomNpcs { @ConfigProp(info = "Disable Chat Bubbles") diff --git a/src/main/java/noppes/npcs/Resistances.java b/src/main/java/noppes/npcs/Resistances.java index ff0cde972..7598e0f4e 100644 --- a/src/main/java/noppes/npcs/Resistances.java +++ b/src/main/java/noppes/npcs/Resistances.java @@ -9,6 +9,8 @@ public class Resistances { public float arrow = 1f; public float playermelee = 1f; public float explosion = 1f; + + public boolean disableDamage = false; public NBTTagCompound writeToNBT() { NBTTagCompound compound = new NBTTagCompound(); @@ -16,6 +18,7 @@ public class Resistances { compound.setFloat("Arrow", arrow); compound.setFloat("Melee", playermelee); compound.setFloat("Explosion", explosion); + compound.setBoolean("disableDamage", disableDamage); return compound; } @@ -24,9 +27,14 @@ public class Resistances { arrow = compound.getFloat("Arrow"); playermelee = compound.getFloat("Melee"); explosion = compound.getFloat("Explosion"); + disableDamage = compound.getBoolean("disableDamage"); } public float applyResistance(DamageSource source, float damage) { + if(disableDamage){ + return 0; + } + if(source.damageType.equals("arrow") || source.damageType.equals("thrown")){ damage *= (2 - arrow); } diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiNpcResistanceProperties.java b/src/main/java/noppes/npcs/client/gui/SubGuiNpcResistanceProperties.java index 08cd8519e..63427aa77 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiNpcResistanceProperties.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiNpcResistanceProperties.java @@ -35,7 +35,11 @@ public class SubGuiNpcResistanceProperties extends SubGuiInterface implements IS addLabel(new GuiNpcLabel(3,"stats.explosion", guiLeft + 4, guiTop + 81)); addSlider(new GuiNpcSlider(this, 3, guiLeft + 94, guiTop + 76, (int)(resistances.explosion * 100 - 100) + "%", resistances.explosion / 2)); - addButton(new GuiNpcButton(66, guiLeft + 190, guiTop + 190, 60, 20, "gui.done")); + if(resistances.disableDamage){ + addLabel(new GuiNpcLabel(4,"stats.disabletrue", guiLeft + 4, guiTop + 103)); + } + + addButton(new GuiNpcButton(66, guiLeft + 190, guiTop + 190, 60, 20, "gui.done")); } protected void actionPerformed(GuiButton guibutton) diff --git a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcStats.java b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcStats.java index dd4cb0f3e..0da4b3c6d 100644 --- a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcStats.java +++ b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcStats.java @@ -45,7 +45,6 @@ public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener, addButton(new GuiNpcButton(0,guiLeft + 82, y+=22, 56, 20, "selectServer.edit")); addLabel(new GuiNpcLabel(2,"stats.respawn", guiLeft + 5, y + 5)); - this.addButton(new GuiNpcButton(2, guiLeft + 82, y+=22, 56, 20, "selectServer.edit")); addLabel(new GuiNpcLabel(5,"stats.meleeproperties", guiLeft + 5, y + 5)); @@ -53,12 +52,14 @@ public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener, addLabel(new GuiNpcLabel(6,"stats.rangedproperties", guiLeft + 5, y + 5)); this.addButton(new GuiNpcButton(9, guiLeft + 217, y, 56, 20, "selectServer.edit")); addLabel(new GuiNpcLabel(7,"stats.projectileproperties", guiLeft + 140, y + 5)); - - this.addButton(new GuiNpcButton(15, guiLeft + 82, y+=34, 56, 20, "selectServer.edit")); - addLabel(new GuiNpcLabel(15,"potion.resistance", guiLeft + 5, y + 5)); - - addButton(new GuiNpcButton(4,guiLeft + 82, y+=34, 56, 20, new String[]{"gui.no","gui.yes"} ,npc.isImmuneToFire()? 1:0)); + this.addButton(new GuiNpcButton(15, guiLeft + 82, y+=34, 56, 20, "selectServer.edit")); + addLabel(new GuiNpcLabel(15,"potion.resistance", guiLeft + 5, y + 5)); + + this.addButton(new GuiNpcButton(21, guiLeft + 217, y, 56, 20, new String[]{"gui.no","gui.yes"}, this.stats.resistances.disableDamage? 1:0)); + addLabel(new GuiNpcLabel(21,"stats.disabledamage", guiLeft + 140, y + 5)); + + addButton(new GuiNpcButton(4,guiLeft + 82, y+=34, 56, 20, new String[]{"gui.no","gui.yes"} ,npc.isImmuneToFire()? 1:0)); addLabel(new GuiNpcLabel(10,"stats.fireimmune", guiLeft + 5, y + 5)); addButton(new GuiNpcButton(5,guiLeft + 217, y, 56, 20, new String[]{"gui.no","gui.yes"} ,stats.canDrown? 1:0)); addLabel(new GuiNpcLabel(11,"stats.candrown", guiLeft + 140, y + 5)); @@ -134,6 +135,9 @@ public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener, else if (button.id == 18) { stats.potionImmune = ((GuiNpcButtonYesNo)guibutton).getBoolean(); } + else if(button.id == 21){ + stats.resistances.disableDamage = ((GuiNpcButton)guibutton).getValue() == 1; + } } @Override public void save() { diff --git a/src/main/resources/assets/customnpcs/lang/en_US.lang b/src/main/resources/assets/customnpcs/lang/en_US.lang index 85193e066..dc15adec6 100644 --- a/src/main/resources/assets/customnpcs/lang/en_US.lang +++ b/src/main/resources/assets/customnpcs/lang/en_US.lang @@ -100,7 +100,6 @@ gui.selectSound=Select Sound gui.selectnpc=Select NPC gui.select=Select gui.range=Range -gui.name=Name gui.partly=Partially gui.copy=Copy gui.clear=Clear @@ -114,7 +113,6 @@ gui.detailed=Detailed gui.server=Server gui.showmore=Show More gui.update=Update -gui.disabled=Disabled gui.editor=Editor gui.playernearby=Player nearby @@ -238,8 +236,6 @@ job.puppet=Puppet stats.health=Health stats.aggro=AggroRange -stats.meleeproperties=MeleeProperties -stats.rangedproperties=RangeProperties stats.projectileproperties=ProjectileType stats.meleestrength=MeleeStrength stats.meleerange=MeleeRange @@ -268,6 +264,8 @@ stats.rangedproperties=RangedOptions stats.burninsun=BurnsInSun stats.amplify=Amplified stats.melee=Melee +stats.disabledamage=DisableDamage +stats.disabletrue=Damage is currently disabled in Stats stats.regenhealth=Health Regen stats.combatregen=Combat Regen stats.naturallydespawns=Naturally Despawn @@ -885,7 +883,6 @@ movement.rotation=Rotation movement.body=Body movement.manual=Manual movement.stalking=Stalking -movement.stalking=Stalking movement.head=Head movement.pauses=Pauses movement.stopinteract=Stop on interact