updated disguisemanager so it uses player arg

fixed invisibility bug on disguises for specific players
updated champs skills
made some hard achievements a bit easier
This commit is contained in:
Chiss 2014-11-21 09:42:05 +11:00
parent 77b47c9e13
commit 7a8759dfba
10 changed files with 81 additions and 50 deletions

View File

@ -323,7 +323,7 @@ public enum Achievement
SNAKE_CANNIBAL("Cannibal", 1600,
new String[]{"Snake.Cannibal"},
new String[]{"Kill 8 players in a single game"},
new String[]{"Kill 6 players in a single game"},
new int[]{1},
AchievementCategory.SNAKE),
@ -519,7 +519,7 @@ public enum Achievement
MICRO_BATTLE_ANNIHILATION("Annihilation", 1200,
new String[]{"Micro Battle.Annihilation"},
new String[]{"Kill 9 players in one game"},
new String[]{"Kill 8 players in one game"},
new int[]{1},
AchievementCategory.MICRO_BATTLE),

View File

@ -113,11 +113,12 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
return _spawnPacketMap.get(entity.getEntityId());
}
public void addViewerToDisguise(DisguiseBase disguise, Player player)
public void addViewerToDisguise(DisguiseBase disguise, Player player, boolean reapply)
{
_disguisePlayerMap.get(disguise).add(player);
reApplyDisguise(disguise, player);
if (reapply)
reApplyDisguise(disguise, player);
}
public void removeViewerToDisguise(DisguiseBase disguise, Player player)
@ -151,6 +152,9 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
_spawnPacketMap.put(disguise.GetEntityId(), disguise);
_disguisePlayerMap.put(disguise, new HashSet<Player>());
for (Player player : players)
addViewerToDisguise(disguise, player, false);
if (disguise.GetEntity() instanceof Player && disguise instanceof DisguisePlayer)
{
if (!((Player)disguise.GetEntity()).getName().equalsIgnoreCase(((DisguisePlayer)disguise).getName()))

View File

@ -1,6 +1,8 @@
package mineplex.minecraft.game.classcombat.Skill.Assassin;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import net.minecraft.util.com.mojang.authlib.GameProfile;
@ -26,6 +28,7 @@ import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
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.UtilServer;
@ -76,7 +79,7 @@ public class Illusion extends SkillActive
@Override
public String GetEnergyString()
{
return "Energy: #30#-5 and #10#-2 per Second";
return "Energy: #40#-3 and #12#-0.5 per Second";
}
@Override
@ -111,10 +114,20 @@ public class Illusion extends SkillActive
skel.getEquipment().setLeggings(player.getInventory().getLeggings());
skel.getEquipment().setBoots(player.getInventory().getBoots());
skel.getEquipment().setItemInHand(Math.random() > 0.5 ? player.getItemInHand() : new ItemStack(Material.IRON_AXE));
//Get in range
ArrayList<Player> inRange = new ArrayList<Player>();
for (Player other : UtilServer.getPlayers())
if (UtilMath.offset2d(skel, other) < 70)
inRange.add(other);
Player[] disguiseList = new Player[inRange.size()];
for (int i=0 ; i<inRange.size() ; i++)
disguiseList[i] = inRange.get(i);
//Disguise
DisguisePlayer disguise = new DisguisePlayer(skel, ((CraftPlayer)player).getHandle().getProfile());
Factory.Disguise().disguise(disguise);
Factory.Disguise().disguise(disguise, disguiseList);
//Invis
Factory.Condition().Factory().Cloak(GetName(), player, player, 2 + 2*level, false, true);
@ -140,7 +153,7 @@ public class Illusion extends SkillActive
if (Factory.Condition().GetActiveCondition(cur, ConditionType.CLOAK) == null ||
!cur.isBlocking() ||
!Factory.Energy().Use(cur, GetName(), 0.5 - (getLevel(cur) * 0.1), true, true) ||
!Factory.Energy().Use(cur, GetName(), 0.6 - (getLevel(cur) * 0.025), true, true) ||
skel == null ||
!skel.isValid())
{

View File

@ -13,6 +13,7 @@ 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.PlayerDeathEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.util.Vector;
@ -52,8 +53,8 @@ public class AxeThrow extends SkillActive implements IThrown
SetDesc(new String[]
{
"Throw your axe with #0.8#0.1 velocity, ",
"dealing #7.5#0.5 damage.",
"Throw your axe with #0.7#0.1 velocity, ",
"dealing #6.5#0.5 damage.",
"",
"You pull your axe back to you when it",
"collides with anything.",
@ -85,7 +86,7 @@ public class AxeThrow extends SkillActive implements IThrown
//Throw
Item item = player.getWorld().dropItem(player.getEyeLocation(), player.getItemInHand());
UtilAction.velocity(item, player.getLocation().getDirection(), 0.8 + 0.1 * level, false, 0, 0.2, 10, true);
UtilAction.velocity(item, player.getLocation().getDirection(), 0.7 + 0.1 * level, false, 0, 0.2, 10, true);
player.setItemInHand(null);
@ -111,7 +112,7 @@ public class AxeThrow extends SkillActive implements IThrown
if (level <= 0)
return;
double damage = 7.5 + 0.5 * level;
double damage = 6.5 + 0.5 * level;
//Damage Event
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
@ -196,6 +197,24 @@ public class AxeThrow extends SkillActive implements IThrown
}
}
}
@EventHandler
public void death(PlayerDeathEvent event)
{
Iterator<Item> i = _thrown.keySet().iterator();
while (i.hasNext())
{
Item item = i.next();
Player player = _thrown.get(item);
if (player.equals(event.getEntity()))
{
i.remove();
item.remove();
}
}
}
@Override
public void Reset(Player player)

View File

@ -99,20 +99,17 @@ public class StaticLazer extends SkillChargeSword
//Firework
UtilFirework.playFirework(player.getLocation().add(player.getLocation().getDirection().multiply(Math.max(0, curRange - 0.6))), Type.BURST, Color.WHITE, false, false);
HashMap<LivingEntity, Double> hit = UtilEnt.getInRadius(target, 6);
HashMap<LivingEntity, Double> hit = UtilEnt.getInRadius(target.subtract(0, 1, 0), 6);
for (LivingEntity other : hit.keySet())
{
if (other.equals(player))
continue;
//Do from center
if (UtilMath.offset(target, other.getLocation().add(0, 1, 0)) < 3)
{
//Damage Event
Factory.Damage().NewDamageEvent(other, player, null,
DamageCause.CUSTOM, 2 + (5 + level) * hit.get(other), true, true, false,
player.getName(), GetName());
}
//Damage Event
Factory.Damage().NewDamageEvent(other, player, null,
DamageCause.CUSTOM, 2 + (5 + level) * hit.get(other), true, true, false,
player.getName(), GetName());
}
//Inform

View File

@ -50,8 +50,6 @@ public class Longshot extends Skill
//Save
_arrows.put(event.getProjectile(), event.getProjectile().getLocation());
System.out.println("FIRING!");
}
@EventHandler(priority = EventPriority.HIGH)

View File

@ -170,7 +170,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword,
1, 4,
30, -5,
40, -3,
12000, -1000, true,
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));

View File

@ -60,7 +60,7 @@ public class Micro extends TeamGame
this.BlockBreak = true;
this.BlockPlace = true;
registerStatTrackers(new KillsWithinGameStatTracker(this, 9, "Annihilation"));
registerStatTrackers(new KillsWithinGameStatTracker(this, 8, "Annihilation"));
}
@Override

View File

@ -381,30 +381,30 @@ public class MineStrike extends TeamGame
((CraftPlayer) event.getEntity()).getHandle().spectating = true;
}
public void disguiseSneak(Player player, GameTeam team)
{
//Create Disguise
if (!_disguise.containsKey(player))
{
_disguise.put(player, new DisguisePlayer(player, ((CraftPlayer)player).getProfile()));
}
DisguisePlayer disguise = _disguise.get(player);
disguise.setSneaking(true);
Manager.GetDisguise().disguise(_disguise.get(player));
for (Player other : UtilServer.getPlayers())
{
if (team.HasPlayer(other))
{
Manager.GetDisguise().removeViewerToDisguise(disguise, other);
}
else
{
Manager.GetDisguise().addViewerToDisguise(disguise, other);
}
}
}
// public void disguiseSneak(Player player, GameTeam team)
// {
// //Create Disguise
// if (!_disguise.containsKey(player))
// {
// _disguise.put(player, new DisguisePlayer(player, ((CraftPlayer)player).getProfile()));
// }
//
// DisguisePlayer disguise = _disguise.get(player);
// disguise.setSneaking(true);
// Manager.GetDisguise().disguise(_disguise.get(player));
//
// for (Player other : UtilServer.getPlayers())
// {
// if (team.HasPlayer(other))
// {
// Manager.GetDisguise().removeViewerToDisguise(disguise, other);
// }
// else
// {
// Manager.GetDisguise().addViewerToDisguise(disguise, other, true);
// }
// }
// }
public void giveTeamArmor(Player player, Color color)
{

View File

@ -151,7 +151,7 @@ public class Snake extends SoloGame
this.GemMultiplier = 0.5;
registerStatTrackers(
new KillsWithinGameStatTracker(this, 8, "Cannibal"),
new KillsWithinGameStatTracker(this, 6, "Cannibal"),
new ChooChooStatTracker(this),
new SlimySheepStatTracker(this)
);