Skip to content

Commit

Permalink
v2.0.9
Browse files Browse the repository at this point in the history
릴리즈를 위해 실험적인 기능 (ResourcepackManager) 임시 삭제

컬스 등급 C -> D 변경
플로라 신속, 재생 일정량 너프
글래디에이터 투기장 디자인 일부 변경, 추가 체력 너프
이라 능력이 스피곳 1.12.2에서 오류가 발생하던 문제 해결
지금의 일은 나중의 나에게 능력 설명 추가
설인 이펙트 일부 너프
영혼수확자의 스킬을 맞았을 때 받는 이펙트로 구속 추가
  • Loading branch information
Daybreak365 committed Jan 11, 2020
1 parent deffd9e commit abd8ba1
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>DayBreak.AbilityWar</groupId>
<artifactId>AbilityWar</artifactId>
<version>2.0.8.8</version>
<version>2.0.9</version>
<packaging>jar</packaging>
<repositories>
<repository>
Expand Down
1 change: 0 additions & 1 deletion src/daybreak/abilitywar/AbilityWar.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public void run() {
AbilityWar.this.installer = installer;
try {
Class.forName("daybreak.abilitywar.utils.math.FastMath");
Class.forName("daybreak.abilitywar.utils.ResourcepackManager");
} catch (ClassNotFoundException ignored) {
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/daybreak/abilitywar/ability/list/Curse.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

@AbilityManifest(Name = "컬스", Rank = Rank.C, Species = Species.HUMAN)
@AbilityManifest(Name = "컬스", Rank = Rank.D, Species = Species.HUMAN)
public class Curse extends AbilityBase {

public static final SettingObject<Integer> CountConfig = new SettingObject<Integer>(Curse.class, "Count", 3,
Expand Down
4 changes: 2 additions & 2 deletions src/daybreak/abilitywar/ability/list/Flora.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public void onProcess(int count) {
for (Player p : LocationUtil.getNearbyPlayers(center, radius.radius, 200)) {
if (LocationUtil.isInCircle(center, p.getLocation(), radius.radius)) {
if (type.equals(EffectType.SPEED)) {
PotionEffects.SPEED.addPotionEffect(p, 20, 2, true);
PotionEffects.SPEED.addPotionEffect(p, 20, 1, true);
} else {
if (!p.isDead()) {
double maxHealth = VersionUtil.getMaxHealth(p);

if (p.getHealth() < maxHealth) {
p.setHealth(Math.min(p.getHealth() + 0.05, 20.0));
p.setHealth(Math.min(p.getHealth() + 0.04, 20.0));
}
}
}
Expand Down
25 changes: 20 additions & 5 deletions src/daybreak/abilitywar/ability/list/Gladiator.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.bukkit.event.block.BlockBreakEvent;

import java.util.HashMap;
import java.util.Random;

@AbilityManifest(Name = "글래디에이터", Rank = Rank.S, Species = Species.HUMAN)
public class Gladiator extends AbilityBase {
Expand All @@ -43,7 +44,7 @@ public Gladiator(Participant participant) {

private final CooldownTimer Cool = new CooldownTimer(CooldownConfig.getValue());

private final HashMap<Block, BlockState> Saves = new HashMap<Block, BlockState>();
private final HashMap<Block, BlockState> Saves = new HashMap<>();

private final Timer FieldClear = new Timer(20) {

Expand Down Expand Up @@ -80,6 +81,7 @@ public void onSilentEnd() {
};

private Player target = null;
private final Random random = new Random();

private final Timer Field = new Timer(26) {

Expand All @@ -99,9 +101,18 @@ public void onStart() {
@Override
public void onProcess(int count) {
if (TotalCount <= 10) {
for (Block b : LocationUtil.getBlocks2D(center, buildCount, false, false)) {
for (Block b : LocationUtil.getBlocks2D(center, buildCount, true, false)) {
Saves.putIfAbsent(b, b.getState());
b.setType(MaterialLib.STONE_BRICKS.getMaterial());
if (random.nextInt(5) <= 1) {
MaterialLib.STONE_BRICKS.setType(b);
} else {
MaterialLib.MOSSY_STONE_BRICKS.setType(b);
}
}
for (LivingEntity livingEntity : LocationUtil.getNearbyEntities(LivingEntity.class, center, buildCount, 6)) {
if (!getPlayer().equals(livingEntity) && !target.equals(livingEntity)) {
livingEntity.setVelocity(livingEntity.getLocation().toVector().clone().subtract(center.toVector()).normalize());
}
}

buildCount++;
Expand All @@ -121,7 +132,11 @@ public void onProcess(int count) {
for (Block b : LocationUtil.getBlocks2D(center, buildCount, true, false)) {
Location l = b.getLocation();
Saves.putIfAbsent(l.clone().add(0, 6, 0).getBlock(), l.clone().add(0, 6, 0).getBlock().getState());
l.add(0, 6, 0).getBlock().setType(MaterialLib.STONE_BRICKS.getMaterial());
if (random.nextInt(5) <= 1) {
MaterialLib.STONE_BRICKS.setType(l.add(0, 6, 0).getBlock());
} else {
MaterialLib.MOSSY_STONE_BRICKS.setType(l.add(0, 6, 0).getBlock());
}
}

buildCount--;
Expand All @@ -141,7 +156,7 @@ public void onEnd() {
Location teleport = center.clone().add(0, 1, 0);

getPlayer().teleport(teleport);
PotionEffects.ABSORPTION.addPotionEffect(getPlayer(), 400, 4, true);
PotionEffects.ABSORPTION.addPotionEffect(getPlayer(), 400, 2, true);
PotionEffects.DAMAGE_RESISTANCE.addPotionEffect(getPlayer(), 400, 0, true);
target.teleport(teleport);

Expand Down
7 changes: 5 additions & 2 deletions src/daybreak/abilitywar/ability/list/Ira.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import daybreak.abilitywar.config.AbilitySettings.SettingObject;
import daybreak.abilitywar.game.games.mode.AbstractGame.Participant;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
Expand Down Expand Up @@ -52,13 +53,15 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent e) {
if (damager instanceof Projectile) {
if (((Projectile) damager).getShooter() instanceof LivingEntity) {
LivingEntity entity = (LivingEntity) ((Projectile) damager).getShooter();
getPlayer().getWorld().createExplosion(entity.getLocation(), 1.3f, false, false);
Location location = entity.getLocation();
getPlayer().getWorld().createExplosion(location.getX(), location.getY(), location.getZ(), 1.3f, false, false);
if (entity.getVelocity().getY() > 0) {
entity.setVelocity(entity.getVelocity().setY(0));
}
}
} else {
getPlayer().getWorld().createExplosion(damager.getLocation(), 1.3f, false, false);
Location location = damager.getLocation();
getPlayer().getWorld().createExplosion(location.getX(), location.getY(), location.getZ(), 1.3f, false, false);
if (damager.getVelocity().getY() > 0) {
damager.setVelocity(damager.getVelocity().setY(0));
}
Expand Down
3 changes: 2 additions & 1 deletion src/daybreak/abilitywar/ability/list/Lazyness.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public class Lazyness extends AbilityBase {

public Lazyness(AbstractGame.Participant participant) {
super(participant,
ChatColor.translateAlternateColorCodes('&', "&f지금 받을 데미지를 3초 뒤의 나에게 미룹니다."));
ChatColor.translateAlternateColorCodes('&', "&f지금 받을 데미지를 3초 뒤의 나에게 미룹니다."),
ChatColor.translateAlternateColorCodes('&', "&f넉백을 무시합니다."));
}

@SubscribeEvent
Expand Down
9 changes: 8 additions & 1 deletion src/daybreak/abilitywar/ability/list/Reaper.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import daybreak.abilitywar.utils.Messager;
import daybreak.abilitywar.utils.library.ParticleLib;
import daybreak.abilitywar.utils.library.ParticleLib.RGB;
import daybreak.abilitywar.utils.library.PotionEffects;
import daybreak.abilitywar.utils.math.LocationUtil;
import daybreak.abilitywar.utils.math.LocationUtil.Locations;
import daybreak.abilitywar.utils.math.VectorUtil.Vectors;
Expand Down Expand Up @@ -66,7 +67,7 @@ public Reaper(AbstractGame.Participant participant) {

private static final RGB BLACK = RGB.of(1, 1, 1);
private static final RGB SOUL_COLOUR = RGB.of(1, 17, 48);
private static final Vector MULTIPLY = new Vector(0.01, 0.55, 0.01);
private static final Vector MULTIPLY = new Vector(0.1, 0.55, 0.1);

private final int distance = DistanceConfig.getValue();

Expand Down Expand Up @@ -110,6 +111,8 @@ protected void onProcess(int count) {
for (Damageable damageable : LocationUtil.getNearbyDamageableEntities(location, 1.5, 1.5)) {
if (!getPlayer().equals(damageable)) {
damageable.damage(3.5, getPlayer());
if (damageable instanceof LivingEntity)
PotionEffects.SLOW.addPotionEffect((LivingEntity) damageable, 60, 2, true);
}
}
}
Expand Down Expand Up @@ -140,6 +143,8 @@ protected void onProcess(int seconds) {
for (Damageable damageable : LocationUtil.getNearbyDamageableEntities(realLocation, 1.5, 1.5)) {
if (!getPlayer().equals(damageable)) {
damageable.damage(3.5, getPlayer());
if (damageable instanceof LivingEntity)
PotionEffects.SLOW.addPotionEffect((LivingEntity) damageable, 60, 2, true);
}
}
}
Expand Down Expand Up @@ -179,6 +184,8 @@ protected void onProcess(int seconds) {
for (Damageable damageable : LocationUtil.getNearbyDamageableEntities(location, 1.5, 1.5)) {
if (!getPlayer().equals(damageable)) {
damageable.damage(7, getPlayer());
if (damageable instanceof LivingEntity)
PotionEffects.SLOW.addPotionEffect((LivingEntity) damageable, 60, 2, true);
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/daybreak/abilitywar/ability/list/Yeti.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public boolean Condition(Integer value) {

public Yeti(Participant participant) {
super(participant,
ChatColor.translateAlternateColorCodes('&', "&f눈과 얼음 위에 서있으면 다양한 버프를 받습니다."),
ChatColor.translateAlternateColorCodes('&', "&f눈과 얼음 위에 서있으면 &6힘&f, &b신속 &f버프를 받습니다."),
ChatColor.translateAlternateColorCodes('&', "&f철괴를 우클릭하면 주변을 눈 지형으로 바꿉니다. " + Messager.formatCooldown(CooldownConfig.getValue())));
}

Expand All @@ -59,7 +59,6 @@ public void onProcess(int count) {
if (m.equals(Material.SNOW) || bm.equals(Material.SNOW) || bm.equals(Material.SNOW_BLOCK) || bm.equals(Material.ICE) || bm.equals(Material.PACKED_ICE)) {
PotionEffects.SPEED.addPotionEffect(getPlayer(), 5, 2, true);
PotionEffects.INCREASE_DAMAGE.addPotionEffect(getPlayer(), 5, 1, true);
PotionEffects.DAMAGE_RESISTANCE.addPotionEffect(getPlayer(), 5, 0, true);
}
}

Expand Down
73 changes: 72 additions & 1 deletion src/daybreak/abilitywar/game/games/mixability/MixAbility.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package daybreak.abilitywar.game.games.mixability;

import daybreak.abilitywar.AbilityWar;
import daybreak.abilitywar.ability.AbilityBase;
import daybreak.abilitywar.config.Configuration;
import daybreak.abilitywar.game.events.GameCreditEvent;
import daybreak.abilitywar.game.games.mode.AbstractGame;
Expand All @@ -25,6 +26,8 @@

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;

Expand Down Expand Up @@ -223,7 +226,75 @@ public void executeCommand(CommandType commandType, Player player, String[] args

@Override
protected AbilitySelect setupAbilitySelect() {
return null;
return new AbilitySelect(this, 1) {
@Override
protected Collection<Participant> initSelectors() {
return getParticipants();
}

private ArrayList<Class<? extends AbilityBase>> abilities;

@Override
protected void drawAbility(Collection<Participant> selectors) {
abilities = AbilitySelectStrategy.EVERY_ABILITY_EXCLUDING_BLACKLISTED.getAbilities();
if (getSelectors().size() <= abilities.size()) {
Random random = new Random();

for (Participant participant : selectors) {
Player p = participant.getPlayer();

Class<? extends AbilityBase> abilityClass = abilities.get(random.nextInt(abilities.size()));
Class<? extends AbilityBase> secondAbilityClass = abilities.get(random.nextInt(abilities.size()));
try {
((Mix) participant.getAbility()).setAbility(abilityClass, secondAbilityClass);

p.sendMessage(new String[]{
ChatColor.translateAlternateColorCodes('&', "&a당신에게 능력이 할당되었습니다. &e/ability check&f로 확인 할 수 있습니다."),
ChatColor.translateAlternateColorCodes('&', "&e/ability yes &f명령어를 사용하면 능력을 확정합니다."),
ChatColor.translateAlternateColorCodes('&', "&e/ability no &f명령어를 사용하면 능력을 변경할 수 있습니다.")});
} catch (IllegalAccessException | NoSuchMethodException | SecurityException |
InstantiationException | IllegalArgumentException | InvocationTargetException e) {
Messager.sendConsoleErrorMessage(
ChatColor.translateAlternateColorCodes('&', "&e" + p.getName() + "&f님에게 능력을 할당하는 도중 오류가 발생하였습니다."),
ChatColor.translateAlternateColorCodes('&', "&f문제가 발생한 능력: &b" + abilityClass.getName()));
}
}
} else {
Messager.broadcastErrorMessage("사용 가능한 능력의 수가 참가자의 수보다 적어 게임을 종료합니다.");
AbilityWarThread.StopGame();
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', "&7게임이 초기화되었습니다."));
}
}

@Override
protected boolean changeAbility(Participant participant) {
Player p = participant.getPlayer();

if (abilities.size() > 0) {
Random random = new Random();

if (participant.hasAbility()) {
Class<? extends AbilityBase> abilityClass = abilities.get(random.nextInt(abilities.size()));
Class<? extends AbilityBase> secondAbilityClass = abilities.get(random.nextInt(abilities.size()));
try {
((Mix) participant.getAbility()).setAbility(abilityClass, secondAbilityClass);
return true;
} catch (Exception e) {
Messager.sendConsoleErrorMessage(ChatColor.translateAlternateColorCodes('&', "&e" + p.getName() + "&f님의 능력을 변경하는 도중 오류가 발생하였습니다."));
Messager.sendConsoleErrorMessage(ChatColor.translateAlternateColorCodes('&', "&f문제가 발생한 능력: &b" + abilityClass.getName()));
}
}
} else {
Messager.sendErrorMessage(p, "능력을 변경할 수 없습니다.");
}

return false;
}

@Override
protected void onSelectEnd() {
}
};
}

@Override
Expand Down
17 changes: 3 additions & 14 deletions src/daybreak/abilitywar/utils/ResourcepackManager.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
package daybreak.abilitywar.utils;

import daybreak.abilitywar.AbilityWar;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerResourcePackStatusEvent;
import org.bukkit.scheduler.BukkitRunnable;

import java.util.HashSet;

public class ResourcepackManager implements Listener {

private static final String RESOURCEPACK_LINK = "https://drive.google.com/uc?export=download&confirm=no_antivirus&id=" + "1W223kUlcU4o11CEpeQXQPgpgh3LUqKCY";
/*
private static final String RESOURCEPACK_LINK = "https://drive.google.com/uc?export=download&confirm=no_antivirus&id=" + "1RQB5AQ1KwrxPC21DASf3BTgKB7eDL3tt";
private static final HashSet<Player> usingPlayers = new HashSet<>();
public static boolean isUsing(Player player) {
return usingPlayers.contains(player);
}

static {
new ResourcepackManager();
}
Expand All @@ -46,5 +35,5 @@ private void onPlayerResourcePackStatus(PlayerResourcePackStatusEvent e) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&bAbilityWar &f리소스팩을 성공적으로 불러왔습니다."));
}
}

*/
}

0 comments on commit abd8ba1

Please sign in to comment.