Skip to content

Commit

Permalink
Merge pull request #144 from peacefulcraft-network/feat/march_fixes
Browse files Browse the repository at this point in the history
Feat/march fixes
  • Loading branch information
Parsonswy authored Mar 22, 2021
2 parents 1bdb56c + f24a565 commit 2e227a6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,27 @@ public void triggerAbility(Event ev) {
if(ev instanceof PlayerToggleFlightEvent) {
((PlayerToggleFlightEvent) ev).getPlayer().setFlying(false);
((PlayerToggleFlightEvent) ev).setCancelled(true);
System.out.println("Canceling double jump.");
}

//Double jump logic
if(canDoubleJump && ev instanceof PlayerToggleFlightEvent) {
System.out.println("Vector 1");
Player p = ((PlayerToggleFlightEvent)ev).getPlayer();
Block b = p.getWorld().getBlockAt(p.getLocation().subtract(0,2,0));

//Check that the user is actually jumping
if(!b.getType().equals(Material.AIR)){

//"Boost" their movement vector to simulate a double jump
Vector v = new Vector(p.getVelocity().getX(), p.getVelocity().getY(), p.getVelocity().getZ());
Vector forward = p.getLocation().getDirection().multiply(0.3);
Vector jump = p.getLocation().getDirection().multiply(0.05).setY(1);
v.add(forward).add(jump);
p.setVelocity(v);

//Disable flight / jump until they touch the ground.
canDoubleJump = false;
p.setAllowFlight(false);

}
System.out.println("Vector 2");
//"Boost" their movement vector to simulate a double jump
Vector v = new Vector(p.getVelocity().getX(), p.getVelocity().getY(), p.getVelocity().getZ());
Vector forward = p.getLocation().getDirection().multiply(0.3);
Vector jump = p.getLocation().getDirection().multiply(0.05).setY(1);
v.add(forward).add(jump);
p.setVelocity(v);

//Disable flight / jump until they touch the ground.
canDoubleJump = false;
p.setAllowFlight(false);
return;
}

}
}



}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

public class HiddenBlade extends TrenchAbility{

private final int EFFECT_TIME = 140;
private final int EFFECT_TIME = 160;
private final int BUFF_TIME = 100;

public HiddenBlade(TrenchKit k) {
super(k.getTrenchPlayer(), 16000, "Hidden Blade");
Expand Down Expand Up @@ -56,7 +57,7 @@ public void triggerAbility(Event ev) {

Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(TrenchPvP.getPluginInstance(), new Runnable() {
public void run() {
p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, EFFECT_TIME, 3));
p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, BUFF_TIME, 3));
}
}, EFFECT_TIME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ public void triggerAbility(Event ev)

Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(TrenchPvP.getPluginInstance(), new Runnable() {
public void run() {
// Remove launch pad
padLoc.getBlock().setType(Material.AIR);

// Check if we should give the launch pad back to the player.
TrenchPlayer t = TeamManager.findTrenchPlayer(p);
if(!(t.getKitType() == TrenchKits.ADRENALINE_JUNKIE)) {return;}

padLoc.getBlock().setType(Material.AIR);
p.getInventory().setItem(itemIndex, pad);
if(!(t.getKitType() == TrenchKits.ADRENALINE_JUNKIE)) {return;}
p.getInventory().setItem(itemIndex, pad);
}
}, 300);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void equipItems() {
* Melee Weapon
*/

ItemStack melee = new ItemStack(Material.IRON_AXE, 1);
ItemStack melee = new ItemStack(Material.STONE_AXE, 1);
ItemMeta meleeMeta = melee.getItemMeta();
meleeMeta.setDisplayName(MELEE_NAME);

Expand Down

0 comments on commit 2e227a6

Please sign in to comment.