From 5c4823fcbb5affa42f34dd65bbbaf28b60e3ec89 Mon Sep 17 00:00:00 2001
From: Edith Boles <edith@penguinowl.dev>
Date: Mon, 4 Oct 2021 22:18:55 -0700
Subject: [PATCH] New rituals and balance

---
 .../quidproquo/rituals/AirliftRitual.java     | 49 +++++++++++++++++++
 .../quidproquo/rituals/AntimatterRitual.java  | 40 +++++++++++++++
 .../quidproquo/rituals/AnvilRitual.java       |  2 +-
 .../quidproquo/rituals/ChunkBegoneRitual.java | 43 ++++++++++++++++
 .../quidproquo/rituals/DiggyRitual.java       | 43 ++++++++++++++++
 5 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 src/main/java/top/penowl/quidproquo/rituals/AirliftRitual.java
 create mode 100644 src/main/java/top/penowl/quidproquo/rituals/AntimatterRitual.java
 create mode 100644 src/main/java/top/penowl/quidproquo/rituals/ChunkBegoneRitual.java
 create mode 100644 src/main/java/top/penowl/quidproquo/rituals/DiggyRitual.java

diff --git a/src/main/java/top/penowl/quidproquo/rituals/AirliftRitual.java b/src/main/java/top/penowl/quidproquo/rituals/AirliftRitual.java
new file mode 100644
index 0000000..9d28986
--- /dev/null
+++ b/src/main/java/top/penowl/quidproquo/rituals/AirliftRitual.java
@@ -0,0 +1,49 @@
+package top.penowl.quidproquo.rituals;
+
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Player;
+
+import top.penowl.quidproquo.Ritual;
+
+@SuppressWarnings("deprecation")
+public class AirliftRitual extends Ritual {
+
+    @Override
+    public void setup() {
+        addIngredient(Material.PAPER, 1);
+        addIngredient(Material.IRON_SPADE, 1);
+        addIngredient(Material.FEATHER, 1);
+        addIngredient(Material.ARROW, 1);
+        addIngredient(Material.DIRT, 1);
+        addIngredient(Material.STONE, 1);
+        addIngredient(Material.SAPLING, 1);
+        addSacrifice(EntityType.CHICKEN, 1);
+        addIngredient(Material.WHEAT, 64*6);
+        name = "raising";
+        description = "Raises the chunk.";
+        health = 3;
+        notify = false;
+    }
+
+    @Override
+    public void execute(Player caster, Player target, Location location) {
+        Block block = location.getBlock().getRelative(-8, -12, -8);
+        for (int y = 200; y >= 0; y-- ) {
+            for (int x = 0; x < 16; x++ ) {
+                for (int z = 0; z < 16; z++ ) {
+                    Block targetBlock = block.getRelative(x, y, z);
+                    Block toBlock = targetBlock.getRelative(0, 20, 0);
+                    toBlock.setType(targetBlock.getType());
+                    toBlock.setData(targetBlock.getData());
+                    targetBlock.setType(Material.AIR);
+                }
+            }
+        }
+        caster.teleport(caster.getLocation().clone().add(0, 20, 0));
+        location.add(0, 20, 0);
+    }
+    
+}
diff --git a/src/main/java/top/penowl/quidproquo/rituals/AntimatterRitual.java b/src/main/java/top/penowl/quidproquo/rituals/AntimatterRitual.java
new file mode 100644
index 0000000..0e04783
--- /dev/null
+++ b/src/main/java/top/penowl/quidproquo/rituals/AntimatterRitual.java
@@ -0,0 +1,40 @@
+package top.penowl.quidproquo.rituals;
+
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.entity.Player;
+
+import top.penowl.quidproquo.Ritual;
+
+public class AntimatterRitual extends Ritual {
+
+    @Override
+    public void setup() {
+        addIngredient(Material.OBSIDIAN, 1);
+        addIngredient(Material.WHEAT, 64*2);
+        addIngredient(Material.ENDER_PEARL, 1);
+        addIngredient(Material.GOLDEN_CARROT, 1);
+        name = "antimatter";
+        notify = false;
+        description = "Erases a part of the world around the altar.";
+    }
+
+    @Override
+    public void execute(Player caster, Player target, Location location) {
+        fillBlocks(location.clone().add(-3, -3, -3), 7, 7, 7, Material.AIR);
+    }
+
+    public void fillBlocks(Location location, int offsetx, int offsety, int offsetz, Material material) {
+        Block block = location.getBlock();
+        for (int x = 0; x < offsetx; x++ ) {
+            for (int y = 0; y < offsety; y++ ) {
+                for (int z = 0; z < offsetz; z++ ) {
+                    Block targetBlock = block.getRelative(x, y, z);
+                    targetBlock.setType(material);
+                }
+            }
+        }
+    }
+
+}
diff --git a/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java b/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java
index 232e5c3..5e406d5 100644
--- a/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java
+++ b/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java
@@ -20,7 +20,7 @@ public class AnvilRitual extends Ritual {
         health = 5;
         backfire = 0.5;
         notify = false;
-        description = "Drop an anvil over your foe.";
+        description = "Drop an anvil on your enemy.";
     }
 
     @Override
diff --git a/src/main/java/top/penowl/quidproquo/rituals/ChunkBegoneRitual.java b/src/main/java/top/penowl/quidproquo/rituals/ChunkBegoneRitual.java
new file mode 100644
index 0000000..2a4f4ef
--- /dev/null
+++ b/src/main/java/top/penowl/quidproquo/rituals/ChunkBegoneRitual.java
@@ -0,0 +1,43 @@
+package top.penowl.quidproquo.rituals;
+
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.entity.Player;
+
+import top.penowl.quidproquo.Ritual;
+
+public class ChunkBegoneRitual extends Ritual {
+
+    @Override
+    public void setup() {
+        addIngredient(Material.OBSIDIAN, 64);
+        addIngredient(Material.WHEAT, 64*18);
+        addIngredient(Material.ENDER_PEARL, 16);
+        addIngredient(Material.GOLDEN_APPLE, 1);
+        name = "chunk begone";
+        notify = false;
+        description = "Deletes a chunk. You want to stand on the gold block for this one.";
+    }
+
+    @Override
+    public void execute(Player caster, Player target, Location location) {
+        Location bedrock = location.clone();
+        int dist = bedrock.getBlockY();
+        bedrock.setY(0);
+        fillBlocks(bedrock.add(-8, 0, -8), 16, dist, 16, Material.AIR);
+    }
+
+    public void fillBlocks(Location location, int offsetx, int offsety, int offsetz, Material material) {
+        Block block = location.getBlock();
+        for (int x = 0; x < offsetx; x++ ) {
+            for (int y = 0; y < offsety; y++ ) {
+                for (int z = 0; z < offsetz; z++ ) {
+                    Block targetBlock = block.getRelative(x, y, z);
+                    targetBlock.setType(material);
+                }
+            }
+        }
+    }
+
+}
diff --git a/src/main/java/top/penowl/quidproquo/rituals/DiggyRitual.java b/src/main/java/top/penowl/quidproquo/rituals/DiggyRitual.java
new file mode 100644
index 0000000..d5783f9
--- /dev/null
+++ b/src/main/java/top/penowl/quidproquo/rituals/DiggyRitual.java
@@ -0,0 +1,43 @@
+package top.penowl.quidproquo.rituals;
+
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.entity.Player;
+
+import top.penowl.quidproquo.Ritual;
+
+public class DiggyRitual extends Ritual {
+
+    @Override
+    public void setup() {
+        addIngredient(Material.OBSIDIAN, 1);
+        addIngredient(Material.WHEAT, 64*1 + 32);
+        addIngredient(Material.IRON_PICKAXE, 1);
+        addIngredient(Material.GRAVEL, 1);
+        description = "Digs a hole to bedrock and then some.";
+        name = "diggy";
+        health = 2;
+    }
+
+    @Override
+    public void execute(Player caster, Player target, Location location) {
+        Location bedrock = location.clone();
+        int dist = bedrock.getBlockY();
+        bedrock.setY(0);
+        fillBlocks(bedrock, 1, dist + 1, 1, Material.AIR);
+    }
+
+    public void fillBlocks(Location location, int offsetx, int offsety, int offsetz, Material material) {
+        Block block = location.getBlock();
+        for (int x = 0; x < offsetx; x++ ) {
+            for (int y = 0; y < offsety; y++ ) {
+                for (int z = 0; z < offsetz; z++ ) {
+                    Block targetBlock = block.getRelative(x, y, z);
+                    targetBlock.setType(material);
+                }
+            }
+        }
+    }
+
+}