From f1af6941cf0e862211b6b4edb7d13a9dfb547a82 Mon Sep 17 00:00:00 2001 From: marston Date: Sat, 13 Jan 2024 01:52:13 -0500 Subject: [PATCH] fire and draining leveling --- MODIFIERS.md | 88 +++++++++---------- .../loot/modifiers/hurter/Draining.java | 17 ++-- .../loot/modifiers/hurter/Fire.java | 10 ++- 3 files changed, 63 insertions(+), 52 deletions(-) diff --git a/MODIFIERS.md b/MODIFIERS.md index ecf77e0..f03b6e4 100644 --- a/MODIFIERS.md +++ b/MODIFIERS.md @@ -2,66 +2,58 @@ This is a full list of modifiers in the game and a description of what they do. ## Breakers These effects are applied when breaking blocks. -### Magnetic -**id:** `attracting` | **crafting:** `minecraft:iron_block` ![iron_block](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/iron_block.png) +### Explosive +**id:** `explode` | **crafting:** `minecraft:tnt` ![tnt](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/tnt.png) -**Decription:** Upon breaking a block (allowed by tool type), all items at that block's position will teleport to you. -### Learning -**id:** `learning` | **crafting:** `minecraft:book` ![book](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/book.png) +**Decription:** Upon breaking a block (allowed by tool type), the current block position will explode causing damage to surrounding blocks. +### Veiny +**id:** `veiny` | **crafting:** `minecraft:diamond_pickaxe` ![diamond_pickaxe](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/diamond_pickaxe.png) -**Decription:** After breaking 10 blocks as allowed by this tool, gain 3 experience points. +**Decription:** Breaking any block while crouching will cause all blocks of the same type adjacent to it to break up to 5 in each direction. ### Melting **id:** `melting` | **crafting:** `minecraft:magma_cream` ![magma_cream](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/magma_cream.png) **Decription:** Items dropped by blocks broken with this tool will be smelted. -### Veiny -**id:** `veiny` | **crafting:** `minecraft:diamond_pickaxe` ![diamond_pickaxe](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/diamond_pickaxe.png) +### Learning +**id:** `learning` | **crafting:** `minecraft:book` ![book](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/book.png) -**Decription:** Breaking any block while crouching will cause all blocks of the same type adjacent to it to break up to 5 in each direction. -### Explosive -**id:** `explode` | **crafting:** `minecraft:tnt` ![tnt](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/tnt.png) +**Decription:** After breaking 10 blocks as allowed by this tool, gain 3 experience points. +### Magnetic +**id:** `attracting` | **crafting:** `minecraft:iron_block` ![iron_block](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/iron_block.png) -**Decription:** Upon breaking a block (allowed by tool type), the current block position will explode causing damage to surrounding blocks. +**Decription:** Upon breaking a block (allowed by tool type), all items at that block's position will teleport to you. ## Holders These effects are applied when holding the tool. -### Living -**id:** `living` | **crafting:** `minecraft:moss_block` ![moss_block](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/moss_block.png) +### Tomb Raider +**id:** `spawner` | **crafting:** `minecraft:mossy_cobblestone` ![mossy_cobblestone](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/mossy_cobblestone.png) -**Decription:** While holding the tool, it will randomly heal itself +**Decription:** While holding the spawners around you will glow. ### Hasty **id:** `hasty` | **crafting:** `minecraft:sugar` ![sugar](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/sugar.png) **Decription:** While holding the tool, get the Haste I effect. -### Detecting -**id:** `detecting` | **crafting:** `minecraft:spyglass` ![spyglass](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/spyglass.png) - -**Decription:** While holding the tool, ores around you will glow. -### Tomb Raider -**id:** `spawner` | **crafting:** `minecraft:mossy_cobblestone` ![mossy_cobblestone](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/mossy_cobblestone.png) +### Living +**id:** `living` | **crafting:** `minecraft:moss_block` ![moss_block](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/moss_block.png) -**Decription:** While holding the spawners around you will glow. +**Decription:** While holding the tool, it will randomly heal itself ### Appley **id:** `absorption` | **crafting:** `minecraft:golden_apple` ![golden_apple](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/golden_apple.png) **Decription:** While holding the tool, get the absorption effect. +### Rainy +**id:** `rainy` | **crafting:** `minecraft:cauldron` ![cauldron](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/cauldron.png) + +**Decription:** While holding the tool in the rain, mine faster! ### Filling **id:** `filling` | **crafting:** `minecraft:cake` ![cake](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/cake.png) **Decription:** While holding the tool, get the saturation effect. -### Rainy -**id:** `rainy` | **crafting:** `minecraft:cauldron` ![cauldron](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/cauldron.png) +### Detecting +**id:** `detecting` | **crafting:** `minecraft:spyglass` ![spyglass](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/spyglass.png) -**Decription:** While holding the tool in the rain, mine faster! +**Decription:** While holding the tool, ores around you will glow. ## Users These effects are applied when right clicking. -### Fire Starter -**id:** `fire_place` | **crafting:** `minecraft:flint_and_steel` ![flint_and_steel](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/flint_and_steel.png) - -**Decription:** Right clicking on the top of a block while crouching with the tool in hand will start a fire and use 2 durability points. -### Flame Thrower -**id:** `flame_thrower` | **crafting:** `minecraft:fire_charge` ![fire_charge](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/fire_charge.png) - -**Decription:** Right clicking throws a fire ball. ### Spelunking **id:** `torch_place` | **crafting:** `minecraft:glowstone` ![glowstone](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/glowstone.png) @@ -70,36 +62,44 @@ These effects are applied when right clicking. **id:** `dirt_place` | **crafting:** `minecraft:dirt` ![dirt](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/dirt.png) **Decription:** Right clicking on the top of a block with the tool in hand will place a dirt block and use 1 durability points. +### Flame Thrower +**id:** `flame_thrower` | **crafting:** `minecraft:fire_charge` ![fire_charge](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/fire_charge.png) + +**Decription:** Right clicking throws a fire ball. +### Fire Starter +**id:** `fire_place` | **crafting:** `minecraft:flint_and_steel` ![flint_and_steel](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/flint_and_steel.png) + +**Decription:** Right clicking on the top of a block while crouching with the tool in hand will start a fire and use 2 durability points. ## Hurters These effects are applied when hurting enemies. -### Charged -**id:** `charged` | **crafting:** `minecraft:lightning_rod` ![lightning_rod](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/lightning_rod.png) +### Poisonous +**id:** `poison` | **crafting:** `minecraft:poisonous_potato` ![poisonous_potato](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/poisonous_potato.png) -**Decription:** After 7 seconds, hitting and enemy will summon a lightning bolt and empty the charge meter. +**Decription:** When attacking with tool, apply the poison effect to the target. ### Withering **id:** `wither` | **crafting:** `minecraft:wither_rose` ![wither_rose](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/wither_rose.png) **Decription:** When attacking with tool, apply the wither effect to the target. +### Dexterous +**id:** `combo` | **crafting:** `minecraft:chorus_fruit` ![chorus_fruit](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/chorus_fruit.png) + +**Decription:** Hitting enemies within 2 seconds after hitting them deals an extra 25% damage. ### Critical **id:** `critical` | **crafting:** `minecraft:ghast_tear` ![ghast_tear](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/ghast_tear.png) **Decription:** Always critically strikes enemy. +### Charged +**id:** `charged` | **crafting:** `minecraft:lightning_rod` ![lightning_rod](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/lightning_rod.png) + +**Decription:** After 7 seconds, hitting and enemy will summon a lightning bolt and empty the charge meter. ### Blinding **id:** `blinding` | **crafting:** `minecraft:carrot` ![carrot](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/carrot.png) **Decription:** When attacking with tool, apply the blindness effect to the target. -### Dexterous -**id:** `combo` | **crafting:** `minecraft:chorus_fruit` ![chorus_fruit](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/chorus_fruit.png) - -**Decription:** Hitting enemies within 2 seconds after hitting them deals an extra 25% damage. ### Necrotic **id:** `necrotic` | **crafting:** `minecraft:wither_skeleton_skull` ![wither_skeleton_skull](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/wither_skeleton_skull.png) **Decription:** Heals 10% of damage dealt to target. -### Poisonous -**id:** `poison` | **crafting:** `minecraft:poisonous_potato` ![poisonous_potato](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/poisonous_potato.png) - -**Decription:** When attacking with tool, apply the poison effect to the target. ### Flaming **id:** `flaming` | **crafting:** `minecraft:blaze_rod` ![blaze_rod](https://raw.githubusercontent.com/anish-shanbhag/minecraft-api/master/public/images/items/blaze_rod.png) diff --git a/src/main/java/dev/marston/randomloot/loot/modifiers/hurter/Draining.java b/src/main/java/dev/marston/randomloot/loot/modifiers/hurter/Draining.java index eb6d91d..ca8523f 100644 --- a/src/main/java/dev/marston/randomloot/loot/modifiers/hurter/Draining.java +++ b/src/main/java/dev/marston/randomloot/loot/modifiers/hurter/Draining.java @@ -54,7 +54,10 @@ public Modifier fromNBT(CompoundTag tag) { @Override public String name() { - return name; + if (points == 2) { + return name; + } + return name + " " + LootUtils.roman(points - 1); } @Override @@ -69,7 +72,11 @@ public String color() { @Override public String description() { - return "Heals 10% of damage dealt to target."; + return "Heals " + String.format("%.0f", drain() * 100) + "% of damage dealt to target."; + } + + public float drain() { + return ((float) this.points) * 0.05f; } @Override @@ -100,15 +107,15 @@ public boolean forTool(ToolType type) { public boolean hurtEnemy(ItemStack itemstack, LivingEntity hurtee, LivingEntity hurter) { float damage = LootItem.getAttackDamage(itemstack, LootUtils.getToolType(itemstack)); - hurter.heal(damage * 0.25f); + hurter.heal(damage * drain()); return false; } public boolean canLevel() { - return false; + return this.points < 10; } public void levelUp() { - return; + this.points++; } } diff --git a/src/main/java/dev/marston/randomloot/loot/modifiers/hurter/Fire.java b/src/main/java/dev/marston/randomloot/loot/modifiers/hurter/Fire.java index 2777d69..ef337f4 100644 --- a/src/main/java/dev/marston/randomloot/loot/modifiers/hurter/Fire.java +++ b/src/main/java/dev/marston/randomloot/loot/modifiers/hurter/Fire.java @@ -5,6 +5,7 @@ import javax.annotation.Nullable; import dev.marston.randomloot.loot.LootItem.ToolType; +import dev.marston.randomloot.loot.LootUtils; import dev.marston.randomloot.loot.modifiers.EntityHurtModifier; import dev.marston.randomloot.loot.modifiers.Modifier; import net.minecraft.ChatFormatting; @@ -52,7 +53,10 @@ public Modifier fromNBT(CompoundTag tag) { @Override public String name() { - return name; + if (points == 2) { + return name; + } + return name + " " + LootUtils.roman(points - 1); } @Override @@ -101,10 +105,10 @@ public boolean hurtEnemy(ItemStack itemstack, LivingEntity hurtee, LivingEntity } public boolean canLevel() { - return false; + return this.points < 4; } public void levelUp() { - return; + this.points++; } }