Unverified Commit b1771cff authored by layue13's avatar layue13
Browse files

限制狐月刀改技能实体负载

parent 7fe6c707
Loading
Loading
Loading
Loading
+1
Changes for .gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
build/
+4 −5
Changes for compile-decompiled.sh: 4 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -8,13 +8,12 @@ CP="${CP:-}"
if [ -z "$CP" ]; then
  CP_ENTRIES=()
  for jar in \
    "$TDLM_ROOT/modsource/IndustrialCraft2/build/rfg/srg_patched_minecraft-classes.jar" \
    "$TDLM_ROOT/Uranium/eclipse/cauldron/build/libs/cauldron.jar" \
    "$TDLM_ROOT/Uranium/build/tmp/deobfuscateJar/deobfed.jar" \
    "$TDLM_ROOT/modsource/CodeChickenCore/build/rfg/srg_merged_minecraft.jar"; do
    "$TDLM_ROOT/modsource/CodeChickenCore/build/rfg/srg_merged_minecraft.jar" \
    "$TDLM_ROOT/modsource/CodeChickenCore/build/rfg/recompiled_minecraft-1.7.10.jar" \
    "$TDLM_ROOT/modsource/IndustrialCraft2/build/rfg/srg_patched_minecraft-classes.jar"; do
    [ -f "$jar" ] && CP_ENTRIES+=("$jar")
  done
  for dir in "$TDLM_ROOT/Uranium/build/bundle/libraries" "$TDLM_ROOT/Uranium-server-run/mods" "$TDLM_ROOT/client/mods" "$TDLM_ROOT/_downloaded-deps" "$TDLM_ROOT/modsource/ImmersiveEngineering/externalLibs" "$TDLM_ROOT/modsource/CodeChickenCore/run/client/mods" "$TDLM_ROOT/modsource/CodeChickenCore/run/mods" "$TDLM_ROOT/modsource/Mekanism-Community-Edition/libs" "$TDLM_ROOT/modsource/ExtraBotany/libs"; do
  for dir in "$TDLM_ROOT/Uranium/build/bundle/libraries" "$TDLM_ROOT/Uranium-server-run/libraries" "$TDLM_ROOT/Uranium-server-run/mods" "$TDLM_ROOT/client/mods" "$TDLM_ROOT/_downloaded-deps" "$TDLM_ROOT/modsource/ImmersiveEngineering/externalLibs" "$TDLM_ROOT/modsource/CodeChickenCore/run/client/mods" "$TDLM_ROOT/modsource/CodeChickenCore/run/mods" "$TDLM_ROOT/modsource/Mekanism-Community-Edition/libs" "$TDLM_ROOT/modsource/ExtraBotany/libs"; do
    if [ -d "$dir" ]; then
      while IFS= read -r jar; do
        case "$jar" in
+25
Changes for src/main/java/net/lrsoft/foxbladeex/FoxExLimits.java: 25 added lines, 0 removed lines.
Original line number Diff line number Diff line
package net.lrsoft.foxbladeex;

import mods.flammpfeil.slashblade.ItemSlashBlade;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

public final class FoxExLimits {
    private FoxExLimits() {
    }

    public static boolean isOnCooldown(EntityPlayer player, ItemStack stack, String key, int cooldownTicks) {
        if (player == null || stack == null || cooldownTicks <= 0) {
            return false;
        }
        long now = player.field_70170_p.func_72820_D();
        NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack);
        long nextAllowed = tag.func_74763_f(key);
        if (now < nextAllowed) {
            return true;
        }
        tag.func_74772_a(key, now + (long)cooldownTicks);
        return false;
    }
}
+22 −3
Changes for src/main/java/net/lrsoft/foxbladeex/SAslashdimension_ex.java: 22 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ ISuperSpecialAttack {
    public void doSpacialAttack(ItemStack stack, EntityPlayer player) {
        Entity tmp;
        World world = player.field_70170_p;
        if (!world.field_72995_K && FoxExLimits.isOnCooldown(player, stack, "foxex.slashDimNextTick", 6)) {
            return;
        }
        NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack);
        Entity target = null;
        int entityId = ItemSlashBlade.TargetEntityId.get(tag);
@@ -131,7 +134,12 @@ ISuperSpecialAttack {
                list.add(target);
            }
            ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b();
            int attacked = 0;
            int maxTargets = target instanceof EntityPlayer ? 4 : 12;
            for (Entity curEntity : (java.util.List<Entity>)(java.util.List<?>)list) {
                if (attacked++ >= maxTargets) {
                    break;
                }
                StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.SlashDim);
                blade.attackTargetEntity(stack, curEntity, player, Boolean.valueOf(true));
            }
@@ -179,6 +187,9 @@ ISuperSpecialAttack {
    public void doJustSpacialAttack(ItemStack stack, EntityPlayer player) {
        Entity tmp;
        World world = player.field_70170_p;
        if (!world.field_72995_K && FoxExLimits.isOnCooldown(player, stack, "foxex.justSlashDimNextTick", 8)) {
            return;
        }
        NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack);
        Entity target = null;
        int entityId = ItemSlashBlade.TargetEntityId.get(tag);
@@ -224,7 +235,7 @@ ISuperSpecialAttack {
                    world.func_72838_d((Entity)dim);
                }
                magicDamage = 2.0f + ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * ((float)level / 5.0f);
                for (int i = 0; i < 5; ++i) {
                for (int i = 0; i < 3; ++i) {
                    EntityDrive entityDrive = new EntityDrive(world, (EntityLivingBase)player, Math.min(1.0f, magicDamage / 3.0f), false, 0.0f);
                    float rotationYaw = (float)(60 * i) + (entityDrive.getRand().nextFloat() - 0.5f) * 60.0f;
                    float rotationPitch = (entityDrive.getRand().nextFloat() - 0.5f) * 60.0f;
@@ -264,7 +275,12 @@ ISuperSpecialAttack {
                list.add(target);
            }
            ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b();
            int attacked = 0;
            int maxTargets = target instanceof EntityPlayer ? 4 : 12;
            for (Entity curEntity : (java.util.List<Entity>)(java.util.List<?>)list) {
                if (attacked++ >= maxTargets) {
                    break;
                }
                StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.SlashDim);
                blade.attackTargetEntity(stack, curEntity, player, Boolean.valueOf(true));
                player.func_71047_c(curEntity);
@@ -272,7 +288,8 @@ ISuperSpecialAttack {
            int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack);
            float magicDamage = 2.0f + ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * ((float)level / 5.0f);
            if (0 < level) {
                for (int i = 0; i < 5; ++i) {
                int driveCount = target instanceof EntityPlayer ? 3 : 5;
                for (int i = 0; i < driveCount; ++i) {
                    EntityDrive entityDrive = new EntityDrive(world, (EntityLivingBase)player, Math.min(1.0f, magicDamage / 3.0f), false, 0.0f);
                    float rotationYaw = target.field_70177_z + (float)(60 * i) + (entityDrive.getRand().nextFloat() - 0.5f) * 60.0f;
                    float rotationPitch = (entityDrive.getRand().nextFloat() - 0.5f) * 60.0f;
@@ -306,6 +323,9 @@ ISuperSpecialAttack {
    }

    public void doSuperSpecialAttack(ItemStack stack, EntityPlayer player) {
        if (!player.field_70170_p.field_72995_K && FoxExLimits.isOnCooldown(player, stack, "foxex.superNextTick", 20)) {
            return;
        }
        EntityJudgmentCutManager entityDA = new EntityJudgmentCutManager(player.field_70170_p, (EntityLivingBase)player);
        if (entityDA != null) {
            player.field_70170_p.func_72838_d((Entity)entityDA);
@@ -313,4 +333,3 @@ ISuperSpecialAttack {
        UntouchableTime.setUntouchableTime((Entity)player, (int)30, (boolean)true);
    }
}
+4 −1
Changes for src/main/java/net/lrsoft/foxbladeex/hypersystem/HS_advance.java: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import mods.flammpfeil.slashblade.specialeffect.ISpecialEffect;
import mods.flammpfeil.slashblade.specialeffect.SpecialEffects;
import mods.flammpfeil.slashblade.util.SlashBladeEvent;
import mods.flammpfeil.slashblade.util.SlashBladeHooks;
import net.lrsoft.foxbladeex.FoxExLimits;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -76,6 +77,9 @@ implements ISpecialEffect {
                player.func_70690_d(new PotionEffect(Potion.field_76432_h.func_76396_c(), 100, 3));
                player.func_70690_d(new PotionEffect(Potion.field_76424_c.func_76396_c(), 100, 3));
                if (world.field_72995_K) break;
                if (FoxExLimits.isOnCooldown(player, event.blade, "foxex.hsAdvanceNextTick", 20)) {
                    break;
                }
                ItemSlashBlade blade = (ItemSlashBlade)event.blade.func_77973_b();
                boolean isBurst = false;
                EntityWitherSword entityDrive = new EntityWitherSword(world, (EntityLivingBase)player, 1.0f, (float)(ItemSlashBlade.RepairCount.get(tag) * 2));
@@ -102,4 +106,3 @@ implements ISpecialEffect {
        return EffectKey;
    }
}