Unverified Commit 18ef62fb authored by Yudi Wang's avatar Yudi Wang
Browse files

限制遗忘拔刀技能实体负载

parent 6d5fcb2b
Loading
Loading
Loading
Loading
+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/com/tanzanite/SA/LostbladeLimits.java: 25 added lines, 0 removed lines.
Original line number Diff line number Diff line
package com.tanzanite.SA;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;

public final class LostbladeLimits {
    public static final int MAX_DESTRUCTABLES_PER_TICK = 8;
    public static final int MAX_ATTACKABLES_PER_TICK = 8;
    public static final int MAX_PLAYER_HITS_PER_DRIVE = 2;

    private LostbladeLimits() {
    }

    public static boolean isOnCooldown(EntityPlayer player, NBTTagCompound tag, String key, int ticks) {
        World world = player.field_70170_p;
        long now = world.func_82737_E();
        String tagKey = "lostblade." + key + ".nextTick";
        if (tag.func_74763_f(tagKey) > now) {
            return true;
        }
        tag.func_74772_a(tagKey, now + ticks);
        return false;
    }
}
+5 −3
Changes for src/main/java/com/tanzanite/SA/SAcrescentMoon.java: 5 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@ extends SpecialAttackBase {
    public void doSpacialAttack(ItemStack stack, EntityPlayer player) {
        World world = player.field_70170_p;
        NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack);
        if (LostbladeLimits.isOnCooldown(player, tag, "crescentMoon", 10)) {
            return;
        }
        if (!world.field_72995_K) {
            int cost = -30;
            if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(cost), false)) {
@@ -49,7 +52,7 @@ extends SpecialAttackBase {
            float baseModif = blade.getBaseAttackModifiers(tag);
            int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack);
            float magicDamage = baseModif * (float)rank;
            for (int i = 0; i < 5; ++i) {
            for (int i = 0; i < 3; ++i) {
                if (4 <= rank) {
                    magicDamage += ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * (float)(rank + level) / 2.0f;
                }
@@ -59,7 +62,7 @@ extends SpecialAttackBase {
                entityDrive.setk(Float.valueOf(1.0f));
                entityDrive.setg(Float.valueOf(1.5f));
                entityDrive.setInitialSpeed(0.7f);
                entityDrive.setLifeTime(800);
                entityDrive.setLifeTime(80);
                if (entityDrive == null) continue;
                world.func_72838_d((Entity)entityDrive);
            }
@@ -67,4 +70,3 @@ extends SpecialAttackBase {
        ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Kiriorosi);
    }
}
+6 −1
Changes for src/main/java/com/tanzanite/SA/SAcureWave.java: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@ extends SpecialAttackBase {
    public void doSpacialAttack(ItemStack stack, EntityPlayer player) {
        World world = player.field_70170_p;
        NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack);
        if (LostbladeLimits.isOnCooldown(player, tag, "cureWave", 10)) {
            return;
        }
        if (!world.field_72995_K) {
            int cost = -30;
            if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(cost), false)) {
@@ -55,7 +58,9 @@ extends SpecialAttackBase {
            bb = bb.func_72314_b(5.0, 0.25, 5.0);
            List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector);
            int rank = StylishRankManager.getStylishRank((Entity)player);
            int affected = 0;
            for (Entity curEntity : (java.util.List<Entity>)(java.util.List<?>)list) {
                if (affected++ >= LostbladeLimits.MAX_ATTACKABLES_PER_TICK) break;
                ((EntityLivingBase)curEntity).func_70690_d(new PotionEffect(Potion.field_76432_h.func_76396_c(), 1, rank));
                ((EntityLivingBase)curEntity).func_70690_d(new PotionEffect(Potion.field_76428_l.func_76396_c(), 400, 2));
                ((EntityLivingBase)curEntity).func_70690_d(new PotionEffect(Potion.field_76429_m.func_76396_c(), 400, 0));
@@ -63,6 +68,7 @@ extends SpecialAttackBase {
            float magicDamage = 0.0f;
            int maxCount = 6;
            maxCount += rank;
            maxCount = Math.min(4, maxCount);
            for (int i = 0; i < maxCount; ++i) {
                EntityDriveCure entityDrive = new EntityDriveCure(world, (EntityLivingBase)player, magicDamage, false, 0.0f);
                entityDrive.func_70012_b(player.field_70165_t, player.field_70163_u, player.field_70161_v, player.field_70177_z + (float)(60 * i), 0.0f);
@@ -98,4 +104,3 @@ extends SpecialAttackBase {
        ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Calibur);
    }
}
+5 −2
Changes for src/main/java/com/tanzanite/SA/SAdelete.java: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@ extends SpecialAttackBase {
    public void doSpacialAttack(ItemStack stack, EntityPlayer player) {
        World world = player.field_70170_p;
        NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack);
        if (LostbladeLimits.isOnCooldown(player, tag, "delete", 8)) {
            return;
        }
        if (!world.field_72995_K) {
            Entity tmp;
            ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b();
@@ -72,11 +75,12 @@ extends SpecialAttackBase {
                }
                float magicDamage = 2.0f + ItemSlashBlade.RepairCount.get(tag).floatValue() / 2.0f;
                int count = 3 + 3 * StylishRankManager.getStylishRank((Entity)player);
                count = Math.min(target instanceof EntityPlayer ? 6 : 12, count);
                for (int i = 0; i < count; ++i) {
                    EntityWitherSword entityDrive;
                    if (world.field_72995_K || (entityDrive = new EntityWitherSword(world, (EntityLivingBase)player, magicDamage, 90.0f)) == null) continue;
                    entityDrive.setInterval(3 + i);
                    entityDrive.setLifeTime(100);
                    entityDrive.setLifeTime(target instanceof EntityPlayer ? 40 : 60);
                    entityDrive.setRoll(20.0f);
                    entityDrive.setColor(0xADEAEA);
                    entityDrive.setTargetEntityId(target.func_145782_y());
@@ -109,4 +113,3 @@ extends SpecialAttackBase {
        return target;
    }
}
Loading