Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
fbcc774383
@ -0,0 +1,139 @@
|
||||
package mineplex.minecraft.game.classcombat.Skill.Brute;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
|
||||
public class WhirlwindAxe extends SkillActive
|
||||
{
|
||||
public WhirlwindAxe(SkillFactory skills, String name, ClassType classType, SkillType skillType,
|
||||
int cost, int levels,
|
||||
int energy, int energyMod,
|
||||
long recharge, long rechargeMod, boolean rechargeInform,
|
||||
Material[] itemArray,
|
||||
Action[] actionArray)
|
||||
{
|
||||
super(skills, name, classType, skillType,
|
||||
cost, levels,
|
||||
energy, energyMod,
|
||||
recharge, rechargeMod, rechargeInform,
|
||||
itemArray,
|
||||
actionArray);
|
||||
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Whirl your axes around rapidly dealing",
|
||||
"#4#1 damage to nearby enemies, and",
|
||||
"pulling enemies within #5#1 blocks",
|
||||
"towards you.",
|
||||
});
|
||||
|
||||
this.setAchievementSkill(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean CustomCheck(Player player, int level)
|
||||
{
|
||||
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Skill(final Player player, int level)
|
||||
{
|
||||
//Pull + Damage
|
||||
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 5d + 1 * level);
|
||||
for (LivingEntity cur : targets.keySet())
|
||||
{
|
||||
if (cur.equals(player))
|
||||
continue;
|
||||
|
||||
//Damage Event
|
||||
if (UtilMath.offset(cur, player) < 4)
|
||||
{
|
||||
Factory.Damage().NewDamageEvent(cur, player, null,
|
||||
DamageCause.CUSTOM, 4 + level, false, true, false,
|
||||
player.getName(), GetName());
|
||||
}
|
||||
|
||||
//Velocity
|
||||
UtilAction.velocity(cur,
|
||||
UtilAlg.getTrajectory2d(cur.getLocation().toVector(), player.getLocation().toVector()),
|
||||
1.6 - 0.6*targets.get(cur), true, 0, 0.2, 1, true);
|
||||
|
||||
//Inform
|
||||
if (cur instanceof Player)
|
||||
UtilPlayer.message((Player)cur, F.main(GetClassType().name(), F.name(player.getName()) +" hit you with " + F.skill(GetName(level)) + "."));
|
||||
}
|
||||
|
||||
//Animation
|
||||
for (double i=0 ; i<Math.PI * 2 ; i += 0.1)
|
||||
{
|
||||
final double j = i;
|
||||
|
||||
final int ticksLived = player.getTicksLived();
|
||||
final Location loc = player.getLocation();
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskLater(Factory.GetPlugin(), new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
double x = Math.sin(j + (ticksLived/50d)) * (j%(Math.PI/2d)) * 3;
|
||||
double z = Math.cos(j + (ticksLived/50d)) * (j%(Math.PI/2d)) * 3;
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, loc.clone().add(x, 1, z), 0f, 0f, 0f, 0, 1);
|
||||
|
||||
x = Math.sin(j + (ticksLived/50d) + Math.PI/4) * (j%(Math.PI/2d)) * 3;
|
||||
z = Math.cos(j + (ticksLived/50d) + Math.PI/4) * (j%(Math.PI/2d)) * 3;
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, loc.clone().add(x, 1, z), 0f, 0f, 0f, 0, 1);
|
||||
|
||||
//Sound
|
||||
player.getWorld().playSound(player.getLocation(), Sound.STEP_WOOL, 2f, 1f + (float)((j%(Math.PI/2d))/(Math.PI/2)));
|
||||
}
|
||||
}, (long) ((Math.PI/2d - (j%(Math.PI/2d))) * 8));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Reset(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -38,9 +38,6 @@ public class NullBlade extends Skill
|
||||
Player damager = event.GetDamagerPlayer(false);
|
||||
if (damager == null) return;
|
||||
|
||||
if (!UtilGear.isSword(damager.getItemInHand()))
|
||||
return;
|
||||
|
||||
int level = getLevel(damager);
|
||||
if (level == 0) return;
|
||||
|
||||
|
@ -268,12 +268,12 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
// AddSkill(new Taunt(this, "Battle Taunt", ClassType.Brute, SkillType.Axe,
|
||||
// 1, 5,
|
||||
// 0, 0,
|
||||
// 30000, -2000, true,
|
||||
// new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
// new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
AddSkill(new WhirlwindAxe(this, "Whirlwind Axe", ClassType.Brute, SkillType.Axe,
|
||||
1, 5,
|
||||
0, 0,
|
||||
30000, -3000, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
//Passive A
|
||||
AddSkill(new Stampede(this, "Stampede", ClassType.Brute, SkillType.PassiveA, 1, 3));
|
||||
|
@ -95,6 +95,8 @@ public class Domination extends TeamGame
|
||||
{
|
||||
_emerald.add(new Emerald(this, loc));
|
||||
}
|
||||
|
||||
_victoryScore = 3000 * _points.size();
|
||||
|
||||
//Spawn Kits
|
||||
if (this instanceof ChampionsDominate)
|
||||
@ -223,13 +225,16 @@ public class Domination extends TeamGame
|
||||
Scoreboard.Reset();
|
||||
|
||||
//Scores
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write("First to " + _victoryScore);
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write(C.cRed + "Red Team");
|
||||
Scoreboard.Write(C.cRed + _redScore);
|
||||
Scoreboard.Write(_redScore + C.cRed);
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write(C.cAqua + "Blue Team");
|
||||
Scoreboard.Write(C.cAqua + _blueScore);
|
||||
Scoreboard.Write(_blueScore + C.cAqua);
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
|
||||
|
@ -25,12 +25,16 @@ public class KitPunch extends KitHuman
|
||||
{
|
||||
super(manager, "Punch", KitAvailability.Hide, new String[]
|
||||
{
|
||||
"Your bow is super stretchy", "Your arrows are huge", "What does this mean?",
|
||||
"Your bow is super stretchy",
|
||||
"Your arrows are huge",
|
||||
"What does this mean?",
|
||||
"Your arrows will knock em flying!"
|
||||
}, new Perk[]
|
||||
},
|
||||
new Perk[]
|
||||
{
|
||||
new PerkKnockbackArrow(2.5D)
|
||||
}, EntityType.SKELETON, new ItemStack(Material.FENCE));
|
||||
},
|
||||
EntityType.SKELETON, new ItemStack(Material.FENCE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,17 +13,22 @@ import nautilus.game.arcade.kit.Perk;
|
||||
public class KitRogue extends Kit
|
||||
{
|
||||
|
||||
public KitRogue(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Rogue", KitAvailability.Free, new String[]
|
||||
{}, new Perk[0], EntityType.ZOMBIE, new ItemStack(Material.WOOD_SWORD));
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
public KitRogue(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Rogue", KitAvailability.Free, new String[]
|
||||
{
|
||||
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
},
|
||||
new Perk[]
|
||||
{
|
||||
|
||||
}, EntityType.ZOMBIE, new ItemStack(Material.WOOD_SWORD));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ public class UHC extends TeamGame
|
||||
//private NautHashMap<String, Long> _combatTime = new NautHashMap<String, Long>();
|
||||
|
||||
private int _borderSize = 1000;
|
||||
private int _yMax = 0;
|
||||
|
||||
private int _gameMinutes = 0;
|
||||
private int _safeTime = 11;
|
||||
@ -175,7 +176,7 @@ public class UHC extends TeamGame
|
||||
|
||||
//Disable Anti-Stack
|
||||
setItemMerge(true);
|
||||
// Manager.GetAntiStack().SetEnabled(false);
|
||||
// Manager.GetAntiStack().SetEnabled(false);
|
||||
|
||||
//Damage Settings
|
||||
Manager.GetDamage().SetEnabled(false);
|
||||
@ -407,11 +408,9 @@ public class UHC extends TeamGame
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (event.getType() != UpdateType.SLOW)
|
||||
return;
|
||||
|
||||
if (_borderSize > 16)
|
||||
_borderSize--;
|
||||
if (event.getType() == UpdateType.SLOW)
|
||||
if (_borderSize > 16)
|
||||
_borderSize--;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -442,9 +441,34 @@ public class UHC extends TeamGame
|
||||
}
|
||||
*/
|
||||
|
||||
//Find Y Max
|
||||
for (int x=-16 ; x<16 ; x++)
|
||||
for (int z=-16 ; z<16 ; z++)
|
||||
{
|
||||
int y = UtilBlock.getHighest(WorldData.World, x, z).getY();
|
||||
|
||||
if (y > _yMax)
|
||||
_yMax = y;
|
||||
}
|
||||
System.out.println("Y Max: " + _yMax);
|
||||
|
||||
System.out.println("Time: " + UtilTime.MakeStr(System.currentTimeMillis() - time));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void WorldBoundaryYLimit(BlockPlaceEvent event)
|
||||
{
|
||||
if (event.getBlock().getX() >= -16 &&
|
||||
event.getBlock().getX() <= 16 &&
|
||||
event.getBlock().getZ() >= -16 &&
|
||||
event.getBlock().getZ() >= 16 &&
|
||||
event.getBlock().getY() >= _yMax)
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot build this high up."));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void GenerateSpawns(GameStateChangeEvent event)
|
||||
{
|
||||
@ -1259,7 +1283,7 @@ public class UHC extends TeamGame
|
||||
Manager.GetPortal().SendPlayerToServer(player, "Lobby");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean CanJoinTeam(GameTeam team)
|
||||
{
|
||||
@ -1400,7 +1424,7 @@ public class UHC extends TeamGame
|
||||
{
|
||||
return ChatColor.YELLOW + "In Progress";
|
||||
}
|
||||
|
||||
|
||||
//Ended
|
||||
if (GetState() == GameState.End || GetState() == GameState.Dead)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ public class PerkDigger extends Perk
|
||||
if (!Kit.HasKit(player))
|
||||
continue;
|
||||
|
||||
Manager.GetCondition().Factory().DigFast(GetName(), player, player, 1.9, 1, false, false, true);
|
||||
Manager.GetCondition().Factory().DigFast(GetName(), player, player, 2.9, 1, false, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user