Merge branch 'main' of github.com:PenguinOwl/QuidProQuo

big brain moment
This commit is contained in:
B1G-FUNGUS 2021-10-02 20:53:27 -07:00
commit 39aed7ce54
13 changed files with 199 additions and 11 deletions

View File

@ -1,6 +1,7 @@
package top.penowl.quidproquo;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -30,6 +31,7 @@ public class Commands implements CommandExecutor {
return false;
} else if (args[0].toLowerCase().equals("list")) {
List<String> ritualNames = new ArrayList<String>(recipes.keySet());
Collections.sort(ritualNames);
int max = ritualNames.size() - 1;
int maxPages = max / 9;
int page = 0;

View File

@ -93,7 +93,7 @@ public final class Events implements Listener {
}
}
for (LivingEntity sacrifice : sacrifices) {
if (sacrifice.getLocation().distance(location) < 2) {
if (sacrifice.getLocation().distance(location) < 6) {
near_sacrifices.add(sacrifice);
}
}
@ -101,7 +101,7 @@ public final class Events implements Listener {
// we check each ritual in order
for (Ritual ritual : QuidProQuo.instance.rituals) {
// this is where all the ingredients get collected in
// this is what all the ingredients get collected in
ArrayList<List<Item>> possibleItems = new ArrayList<List<Item>>();
ArrayList<List<LivingEntity>> possibleSacrifices = new ArrayList<List<LivingEntity>>();
Boolean failed = false;

View File

@ -40,13 +40,14 @@ public class QuidProQuo extends JavaPlugin {
rituals.add(new GetLuckyRitual());
rituals.add(new HardPenorRitual());
rituals.add(new HealRitual());
rituals.add(new HerobrineRitual());
rituals.add(new HitRitual());
rituals.add(new LavaRitual());
rituals.add(new RotateRitual());
rituals.add(new SnowmanRitual());
rituals.add(new HardPenorRitual());
rituals.add(new SoftPenorRitual());
rituals.add(new WoolingRitual());
rituals.add(new QuicktimeRitual());
rituals.add(new LightQuicktimeRitual());
rituals.add(new WitherRitual());
rituals.add(new DragonRitual());
rituals.add(new CrystalizationRtiual());
rituals.add(new BatSpewRitual());
// run ritual setup scripts
for (Ritual ritual : rituals) {

View File

@ -0,0 +1,29 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import top.penowl.quidproquo.Ritual;
public class BatSpewRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.WHEAT, 64);
addIngredient(Material.IRON_PICKAXE, 1);
addSacrifice(EntityType.CHICKEN, 1);
health = 4;
name = "bat spew";
backfire = 0.1;
}
@Override
public void execute(Player caster, Player target, Location location) {
for (int i = 0; i < 20; i++) {
target.getLocation().getWorld().spawnEntity(target.getLocation(), EntityType.CHICKEN);
}
}
}

View File

@ -14,6 +14,7 @@ public class CreeperHissRitual extends Ritual {
addIngredient(Material.SULPHUR, 1);
addIngredient(Material.REDSTONE, 1);
addIngredient(Material.WHEAT, 16);
name = "creeper hissing";
health = 1;
}

View File

@ -0,0 +1,29 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EnderCrystal;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import top.penowl.quidproquo.Ritual;
public class CrystalizationRtiual extends Ritual {
@Override
public void setup() {
addIngredient(Material.ENDER_PEARL, 1);
addIngredient(Material.GLASS, 1);
addIngredient(Material.TNT, 1);
addIngredient(Material.WHEAT, 32);
name = "crystalization";
health = 2;
}
@Override
public void execute(Player caster, Player target, Location location) {
location.getWorld().spawnEntity(location.clone().add(0, 1, 0), EntityType.ENDER_CRYSTAL);
}
}

View File

@ -0,0 +1,33 @@
package top.penowl.quidproquo.rituals;
import java.util.WeakHashMap;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import top.penowl.quidproquo.Ritual;
public class DragonRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.ENDER_PEARL, 16);
addIngredient(Material.WHEAT, 64*9*2);
addSacrifice(EntityType.CHICKEN, 2);
addSacrifice(EntityType.ENDERMAN, 1);
addIngredient(Material.EGG, 64);
addIngredient(Material.STONE, 64);
addIngredient(Material.BOOK, 4);
addIngredient(Material.DIAMOND_BLOCK, 1);
name = "dragon summoning";
health = 3;
}
@Override
public void execute(Player caster, Player target, Location location) {
location.getWorld().spawnEntity(location.clone().add(0, 1, 0), EntityType.ENDER_DRAGON);
}
}

View File

@ -19,7 +19,7 @@ public class HardPenorRitual extends Ritual {
@Override
public void execute(Player caster, Player target, Location location) {
Block shaft = caster.getLocation().getBlock();
Block shaft = target.getLocation().getBlock();
Block ball1 = shaft.getRelative(2, -1, 0);
Block ball2 = shaft.getRelative(-2,-1,0);
//TODO USE ELEGANT MATHEMATICS INSTEAD OF SCUFFED IF STATEMENTS

View File

@ -20,7 +20,7 @@ public class HerobrineRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.WHEAT, 64*9);
addIngredient(Material.WHEAT, 64*3);
addIngredient(Material.DIAMOND, 9);
addIngredient(Material.ROTTEN_FLESH, 64);
addIngredient(Material.REDSTONE_BLOCK, 9);

View File

@ -0,0 +1,32 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import top.penowl.quidproquo.Ritual;
public class LightQuicktimeRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.WHEAT, 64+32);
addIngredient(Material.GLASS_BOTTLE, 1);
addIngredient(Material.SPIDER_EYE, 1);
name = "quicktime lite";
health = 4;
backfire = 0.3;
}
@Override
public void execute(Player caster, Player target, Location location) {
target.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 60, 1));
target.getWorld().dropItemNaturally(target.getLocation(), new ItemStack(Material.MILK_BUCKET, 1));
target.sendMessage("DRINK THE MILK IDIOT");
}
}

View File

@ -0,0 +1,33 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import top.penowl.quidproquo.Ritual;
public class QuicktimeRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.WHEAT, 64*2);
addIngredient(Material.POTION, 1);
addIngredient(Material.SPIDER_EYE, 1);
addSacrifice(EntityType.SPIDER, 1);
name = "quicktime";
health = 4;
backfire = 0.15;
}
@Override
public void execute(Player caster, Player target, Location location) {
target.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 60, 2));
target.getWorld().dropItemNaturally(target.getLocation(), new ItemStack(Material.MILK_BUCKET, 1));
target.sendMessage("DRINK THE MILK IDIOT");
}
}

View File

@ -0,0 +1,28 @@
package top.penowl.quidproquo.rituals;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import top.penowl.quidproquo.Ritual;
public class WitherRitual extends Ritual {
@Override
public void setup() {
addIngredient(Material.BONE, 64);
addIngredient(Material.WHEAT, 64*9);
addSacrifice(EntityType.SKELETON, 1);
addIngredient(Material.FLOWER_POT, 1);
addIngredient(Material.SAND, 1);
name = "wither summoning";
health = 2;
}
@Override
public void execute(Player caster, Player target, Location location) {
location.getWorld().spawnEntity(location.clone().add(0, 1, 0), EntityType.WITHER);
}
}

View File

@ -8,5 +8,5 @@ commands:
permission: quidproquo.command
permission-message: You do not have /&lt;permission&gt;
usage: |
§3/ritual list - List all available rituals.
§3/ritual list [page] - List all available rituals.
§3/ritual <ritual> - See the information on a ritual