Skip to content

Commit

Permalink
Change aphrodite heart KP
Browse files Browse the repository at this point in the history
  • Loading branch information
zelytra committed Sep 17, 2021
1 parent 25eb91c commit 4aa5785
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
return false;
}

GodsEnum god = null;
GodsEnum god;

try {
god = GodsEnum.valueOf(args[0].toUpperCase());
Expand All @@ -67,7 +67,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
return false;
}

GodSpawnEvent event = new GodSpawnEvent(god, playerFaction, player);
GodSpawnEvent event = new GodSpawnEvent(god, playerFaction, target);
Bukkit.getPluginManager().callEvent(event);

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
Expand Down Expand Up @@ -70,4 +71,10 @@ public void inventory(InventoryClickEvent e) {
if (Daedalus.getInstance().getGameManager().getTimeManager().isPause())
e.setCancelled(true);
}

@EventHandler
public void inventory(ProjectileLaunchEvent e) {
if (Daedalus.getInstance().getGameManager().getTimeManager().isPause())
e.setCancelled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void godSpawn(GodSpawnEvent e) {
}

@EventHandler
public void playerDeath(PartielDeathEvent e) {
public void playerPartielDeath(PartielDeathEvent e) {
aphroditeKill(e.getKiller());
}

Expand All @@ -45,30 +45,25 @@ private void aphroditeKill(Player killer) {
if (killer == null) return;

if (Daedalus.getInstance().getGameManager().isRunning()) {
if (killer != null) {
try {
Faction playerFaction = Daedalus.getInstance().getGameManager().getFactionManager().getFactionOf(killer);
if (playerFaction.getGod() == null)
return;

if (playerFaction.getGodsEnum() == GodsEnum.APHRODITE) {
if (playerFaction.getGod() != null && playerFaction.getGod().getName() == killer.getName()) {
if (playerFaction.getGod().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() + 2 <= 25)
playerFaction.getGod().getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(playerFaction.getGod().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() + 2);
} else
killer.setHealth(killer.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());
}
} catch (Exception exception) {
System.out.println("ERROR team not found");
}

try {
Faction killerFaction = Daedalus.getInstance().getGameManager().getFactionManager().getFactionOf(killer);
if (killerFaction.getGod() == null) return;

if (killerFaction.getGodsEnum() == GodsEnum.APHRODITE) {
if (killerFaction.getGod().getName().equalsIgnoreCase(killer.getName())) {
if (killerFaction.getGod().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() + 2 <= 50)
killerFaction.getGod().getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(killerFaction.getGod().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() + 2);
} else
killer.setHealth(killer.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());
}
} catch (Exception exception) {
System.out.println("ERROR team not found");
}
}
}



private void vfx(Player player) {
Bukkit.broadcastMessage(GameSettings.LANG.textOf("godSpawn.aphrodite"));
Utils.runTotemDisplay(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void onCustomDeath(EntityDamageEvent e) {

DefinitiveDeathEvent event = new DefinitiveDeathEvent(player, e);
Bukkit.getPluginManager().callEvent(event);
winListener();
//winListener();

} else {

Expand Down

0 comments on commit 4aa5785

Please sign in to comment.