Rupture has been reworked

This commit is contained in:
nossr50
2021-04-02 11:00:11 -07:00
parent 0cb3d91f0e
commit 48bf79055a
14 changed files with 507 additions and 277 deletions

View File

@ -33,6 +33,11 @@ public class TransientMetadataTools {
livingEntity.removeMetadata(mcMMO.travelingBlock, pluginRef);
}
if(livingEntity.hasMetadata(mcMMO.REPLANT_META_KEY)) {
livingEntity.removeMetadata(mcMMO.REPLANT_META_KEY, pluginRef);
}
//Cleanup mob metadata
mcMMO.getCompatibilityManager().getPersistentDataLayer().removeMobFlags(livingEntity);
}

View File

@ -12,7 +12,6 @@ import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.runnables.skills.AwardCombatXpTask;
import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager;
import com.gmail.nossr50.skills.archery.ArcheryManager;
import com.gmail.nossr50.skills.axes.AxesManager;
@ -41,6 +40,7 @@ import org.bukkit.potion.PotionEffectType;
import org.bukkit.projectiles.ProjectileSource;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import com.gmail.nossr50.runnables.skills.AwardCombatXpTask;
import java.util.EnumMap;
import java.util.HashMap;
@ -96,7 +96,7 @@ public final class CombatUtils {
if(target.getHealth() - event.getFinalDamage() >= 1)
{
if (swordsManager.canUseRupture()) {
swordsManager.ruptureCheck(target);
swordsManager.processRupture(target);
}
}
@ -714,7 +714,7 @@ public final class CombatUtils {
NotificationManager.sendPlayerInformation((Player)entity, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.SS.Struck");
}
UserManager.getPlayer(attacker).getSwordsManager().ruptureCheck(target);
UserManager.getPlayer(attacker).getSwordsManager().processRupture(target);
break;
case AXES:

View File

@ -1,17 +1,19 @@
package com.gmail.nossr50.util.skills;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.sounds.SoundManager;
import com.gmail.nossr50.util.sounds.SoundType;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.apache.commons.lang.math.RandomUtils;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.Arrays;
public final class ParticleEffectUtils {
private ParticleEffectUtils() {}
@ -27,9 +29,40 @@ public final class ParticleEffectUtils {
return;
}
livingEntity.getWorld().playEffect(livingEntity.getEyeLocation(), Effect.STEP_SOUND, Material.REDSTONE_WIRE);
Location origin = livingEntity.getEyeLocation().clone();
World world = origin.getWorld();
double x = origin.getX();
double y = origin.getY();
double z = origin.getZ();
double offSetVal = 0.3D;
Location locA = new Location(world, x - offSetVal, y, z);
Location locB = new Location(world, x + offSetVal, y, z);
Location locC = new Location(world, x, y + offSetVal, z);
Location locD = new Location(world, x, y - offSetVal, z);
Location locE = new Location(world, x, y, z + offSetVal);
Location locF = new Location(world, x, y, z - offSetVal);
Location locG = new Location(world, x + offSetVal, y, z + offSetVal);
Location locH = new Location(world, x - offSetVal, y, z - offSetVal);
Location locI = new Location(world, x - offSetVal, y - offSetVal, z - offSetVal);
Location locJ = new Location(world, x + offSetVal, y - offSetVal, z + offSetVal);
Location locK = new Location(world, x - offSetVal, y + offSetVal, z - offSetVal);
Location locL = new Location(world, x - offSetVal, y + offSetVal, z - offSetVal);
Location[] particleLocations = new Location[]{ locA, locB, locC, locD, locE, locF, locG, locH, locI, locJ, locK, locL};
for(Location location : particleLocations) {
if(RandomUtils.nextInt(100) > 30) {
//TODO: Change
livingEntity.getWorld().playEffect(location, Effect.STEP_SOUND, Material.REDSTONE_WIRE);
}
}
}
public static void playDodgeEffect(Player player) {
if (!Config.getInstance().getDodgeEffectEnabled()) {
return;