New rituals and balance

This commit is contained in:
Edith Boles 2021-10-04 22:18:55 -07:00
parent d88c3a062c
commit 5c4823fcbb
5 changed files with 176 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}
}
}
}

View File

@ -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

View File

@ -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);
}
}
}
}
}

View File

@ -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);
}
}
}
}
}