v1.8.3
This commit is contained in:
1 parent
e4a7b23546
commit
542b0d280d
35 files changed
+342
-126
No files matched your search
@@ -5,6 +5,7 @@ import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
public class PlayerMana {
|
||||
public static final int DEFAULT_BASE_MAX_MANA = 20;
|
||||
@@ -81,6 +82,14 @@ public class PlayerMana {
|
||||
return recoverDelay;
|
||||
}
|
||||
|
||||
public static boolean recoverMana(ServerPlayer player, double manaRegenBonus, double standingBonus, double regenCoeff, double itemUseCoeff) {
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
int maxMana = mana.getMaxMana();
|
||||
double regenSpeed = ((double) maxMana / 3.0D + 1.0D + manaRegenBonus) * standingBonus * regenCoeff * itemUseCoeff;
|
||||
double amount = regenSpeed * 3.0D / 40.0D;
|
||||
return recoverMana(player, amount);
|
||||
}
|
||||
|
||||
public static boolean recoverMana(ServerPlayer player, double amount) {
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
int oldMana = mana.getMana();
|
||||
@@ -94,12 +103,18 @@ public class PlayerMana {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean testMana(Player player, double amount) {
|
||||
if(amount <= 0.0D || player.hasInfiniteMaterials()) return true;
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
return mana.testMana(amount);
|
||||
}
|
||||
|
||||
public static boolean consumeMana(ServerPlayer player, double amount) {
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
int oldMana = mana.getMana();
|
||||
if(!mana.consumeMana(amount)) return false;
|
||||
|
||||
mana.applyRecoverDelay();
|
||||
//mana.applyRecoverDelay();
|
||||
player.setData(ModAttachments.PLAYER_MANA, mana);
|
||||
if(mana.getMana() != oldMana) {
|
||||
PlayerManaSyncEventHandler.sync(player);
|
||||
@@ -145,6 +160,13 @@ public class PlayerMana {
|
||||
return mana != oldMana;
|
||||
}
|
||||
|
||||
//测试魔力是否充足
|
||||
public boolean testMana(double amount) {
|
||||
if(amount <= 0.0D) return true;
|
||||
if(mana <= 0) return false;
|
||||
return mana >= (int) Math.floor(consumeProgress + amount);
|
||||
}
|
||||
|
||||
//通过累加计数器消耗魔力
|
||||
private boolean consumeMana(double amount) {
|
||||
if(amount <= 0.0D) return true;
|
||||
@@ -164,9 +186,8 @@ public class PlayerMana {
|
||||
public void applyRecoverDelay() {
|
||||
if(getMaxMana() <= 0) return;
|
||||
|
||||
//double emptyRatio = 1.0D - (double) mana / getMaxMana();
|
||||
//recoverDelay = Math.max(recoverDelay, (int) Math.ceil(0.7D * (emptyRatio * 240.0D + 45.0D) / 3.0D));
|
||||
recoverDelay = 0;
|
||||
double emptyRatio = 1.0D - (double) mana / getMaxMana();
|
||||
recoverDelay = Math.max(recoverDelay, (int) Math.ceil(0.7D * (emptyRatio * 240.0D + 45.0D) / 3.0D));
|
||||
recoverProgress = 0.0D;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,9 @@ public class TargetMarks {
|
||||
Codec.INT.optionalFieldOf("duration", 0).forGetter(Mark::getDuration),
|
||||
Codec.INT.optionalFieldOf("stacks", 0).forGetter(Mark::getStacks),
|
||||
UUID_CODEC.optionalFieldOf("owner", EMPTY_OWNER).forGetter(Mark::getOwner),
|
||||
ItemStack.OPTIONAL_CODEC.optionalFieldOf("stack", ItemStack.EMPTY).forGetter(Mark::getStack)
|
||||
ItemStack.OPTIONAL_CODEC.optionalFieldOf("stack", ItemStack.EMPTY).forGetter(Mark::getStack),
|
||||
Codec.FLOAT.optionalFieldOf("tag_damage", 0.0F).forGetter(Mark::getTagDamage),
|
||||
Codec.INT.optionalFieldOf("tag_crit", 0).forGetter(Mark::getTagCrit)
|
||||
).apply(instance, Mark::new));
|
||||
|
||||
private long startTime;
|
||||
@@ -87,21 +89,29 @@ public class TargetMarks {
|
||||
private int stacks;
|
||||
private UUID owner;
|
||||
private ItemStack stack;
|
||||
private float tagDamage;
|
||||
private int tagCrit;
|
||||
|
||||
public Mark() {
|
||||
this(0L, 0, 0, EMPTY_OWNER, ItemStack.EMPTY);
|
||||
this(0L, 0, 0, EMPTY_OWNER, ItemStack.EMPTY, 0.0F, 0);
|
||||
}
|
||||
|
||||
public Mark(long startTime, int duration, int stacks) {
|
||||
this(startTime, duration, stacks, EMPTY_OWNER, ItemStack.EMPTY);
|
||||
this(startTime, duration, stacks, EMPTY_OWNER, ItemStack.EMPTY, 0.0F, 0);
|
||||
}
|
||||
|
||||
public Mark(long startTime, int duration, int stacks, UUID owner, ItemStack stack) {
|
||||
this(startTime, duration, stacks, owner, stack, 0.0F, 0);
|
||||
}
|
||||
|
||||
public Mark(long startTime, int duration, int stacks, UUID owner, ItemStack stack, float tagDamage, int tagCrit) {
|
||||
this.startTime = startTime;
|
||||
this.duration = duration;
|
||||
this.stacks = stacks;
|
||||
this.owner = owner == null ? EMPTY_OWNER : owner;
|
||||
this.stack = stack == null ? ItemStack.EMPTY : stack.copy();
|
||||
this.tagDamage = tagDamage;
|
||||
this.tagCrit = tagCrit;
|
||||
}
|
||||
|
||||
public long getStartTime() {
|
||||
@@ -144,8 +154,24 @@ public class TargetMarks {
|
||||
this.stack = stack == null ? ItemStack.EMPTY : stack.copy();
|
||||
}
|
||||
|
||||
public float getTagDamage() {
|
||||
return tagDamage;
|
||||
}
|
||||
|
||||
public void setTagDamage(float tagDamage) {
|
||||
this.tagDamage = tagDamage;
|
||||
}
|
||||
|
||||
public int getTagCrit() {
|
||||
return tagCrit;
|
||||
}
|
||||
|
||||
public void setTagCrit(int tagCrit) {
|
||||
this.tagCrit = tagCrit;
|
||||
}
|
||||
|
||||
public Mark copy() {
|
||||
return new Mark(startTime, duration, stacks, owner, stack);
|
||||
return new Mark(startTime, duration, stacks, owner, stack, tagDamage, tagCrit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,12 +54,12 @@ public class ClientArcSurge {
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
|
||||
for(List<Vec3> branch : branches) {
|
||||
// 内白芯(Inner White Core - 纯白高亮高能核心,线性收缩至末端半径为 0)
|
||||
renderTube(buffer, matrix, entWorldPos, branch, radius * 0.5F, alpha, 1.0F, 1.0F, 1.0F, true);
|
||||
|
||||
// 外红层(Outer Red Layer - 主泛光与外圈微光,线性收缩至末端半径为 0)
|
||||
renderTube(buffer, matrix, entWorldPos, branch, radius * 1.0F, alpha * 0.7F, 1.0F, 0.15F, 0.15F, true);
|
||||
renderTube(buffer, matrix, entWorldPos, branch, radius * 1.3F, alpha * 0.3F, 0.85F, 0.05F, 0.1F, true);
|
||||
|
||||
// 内白芯(Inner White Core - 纯白高亮高能核心,线性收缩至末端半径为 0)
|
||||
renderTube(buffer, matrix, entWorldPos, branch, radius * 0.45F, alpha * 1.0F, 1.0F, 1.0F, 1.0F, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -86,12 +86,12 @@ public class ClientLastPrism {
|
||||
BeamData beamData = computeBeamData(tri, getBeamIndex(beam), partialTick);
|
||||
if (beamData == null) return;
|
||||
|
||||
VertexConsumer consumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(RES));
|
||||
VertexConsumer consumer = bufferSource.getBuffer(ModRenderTypes.entityAdditiveEmissive(RES));
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
List<Vec3> points = List.of(beamData.start(), beamData.end());
|
||||
|
||||
renderTube(consumer, matrix, beam.position(),
|
||||
points, beamData.radius() * 0.8f, 1.0f, 1.0f, 1.0f, 1.0f, false);
|
||||
points, beamData.radius() * 0.8f, 0.5f, 1.0f, 1.0f, 1.0f, false);
|
||||
renderTube(consumer, matrix, beam.position(),
|
||||
points, beamData.radius(), beam.getEntityData().get(StaticSummon.COLOR_A),
|
||||
beam.getEntityData().get(StaticSummon.COLOR_R),
|
||||
|
||||
@@ -66,6 +66,7 @@ public class ModCreativeModeTabs {
|
||||
output.accept(ModItems.MANA_POTION.get());
|
||||
output.accept(ModItems.GREATER_MANA_POTION.get());
|
||||
output.accept(ModItems.SUPER_MANA_POTION.get());
|
||||
output.accept(ModItems.MANA_REGENERATION_POTION.get());
|
||||
}).build());
|
||||
|
||||
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> ACCESSORY_TAB = CREATIVE_MODE_TABS.register("lzxnoneterraria_accessory_0", () -> CreativeModeTab.builder()
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.lzxnone.terraria.effect;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffectCategory;
|
||||
|
||||
public class ManaRegenerationEffect extends MobEffect {
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"mana_regeneration",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/mob_effect/mana_regeneration.png"),
|
||||
Component.translatable("effect.lzxnoneterraria.mana_regeneration"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public ManaRegenerationEffect() {
|
||||
super(MobEffectCategory.BENEFICIAL, 0x0099FF);
|
||||
}
|
||||
}
|
||||
@@ -44,4 +44,6 @@ public class ModEffects {
|
||||
MOB_EFFECTS.register("panic", PanicEffect::new);
|
||||
public static final DeferredHolder<MobEffect, ZappedRedEffect> ZAPPED_RED =
|
||||
MOB_EFFECTS.register("zapped_red", ZappedRedEffect::new);
|
||||
public static final DeferredHolder<MobEffect, ManaRegenerationEffect> MANA_REGENERATION =
|
||||
MOB_EFFECTS.register("mana_regeneration", ManaRegenerationEffect::new);
|
||||
}
|
||||
@@ -31,5 +31,10 @@ public class BrewingRecipeHandler {
|
||||
Ingredient.of(Items.BROWN_MUSHROOM, Items.RED_MUSHROOM),
|
||||
new ItemStack(ModItems.MANA_POTION.get())
|
||||
);
|
||||
event.getBuilder().addRecipe(
|
||||
Ingredient.of(ModItems.MANA_POTION.get()),
|
||||
Ingredient.of(Items.GLOWSTONE_DUST),
|
||||
new ItemStack(ModItems.MANA_REGENERATION_POTION.get())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -180,13 +180,8 @@ public class EntityEventHandler {
|
||||
AccessoryUtil.removeTargetArmorModifiers(event.getEntity());
|
||||
IchorEffect.removeArmorReduction(event.getEntity());
|
||||
BetsysCurseEffect.removeArmorReduction(event.getEntity());
|
||||
//暴击
|
||||
if(attacker instanceof LivingEntity livingEntity && attacker != target) {
|
||||
double critChance = AccessoryUtil.getCritChance(livingEntity);
|
||||
if(critChance > 0.0D && attacker.getRandom().nextDouble() < critChance) {
|
||||
event.setNewDamage(event.getNewDamage() * 1.5F);
|
||||
}
|
||||
//击中敌人概率掉落绿宝石(敌对生物、末影龙或凋灵)
|
||||
if(attacker instanceof LivingEntity livingEntity && attacker != target) {
|
||||
double emeraldDropChance = AccessoryUtil.getEmeraldDropChance(livingEntity);
|
||||
if(emeraldDropChance > 0.0D
|
||||
&& (target instanceof Enemy || target instanceof EnderDragon || target instanceof WitherBoss)
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.attachment.ModAttachments;
|
||||
import com.lzxnone.terraria.attachment.PlayerMana;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.item.accessory.AccessoryUtil;
|
||||
import com.lzxnone.terraria.item.weapon.MagicWeapon;
|
||||
import com.lzxnone.terraria.network.payload.ManaSyncPayload;
|
||||
@@ -52,17 +53,21 @@ public class PlayerManaSyncEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if(isUsingMagicWeapon(player)) return;
|
||||
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
double delayMultiplier = AccessoryUtil.getManaRecoverDelayMultiplier(player);
|
||||
|
||||
/*double delayMultiplier = AccessoryUtil.getManaRecoverDelayMultiplier(player);
|
||||
if(mana.tickRecoverDelay(delayMultiplier)) {
|
||||
player.setData(ModAttachments.PLAYER_MANA, mana);
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
double regenBonus = AccessoryUtil.getManaRegenBonus(player, mana.getMana(), mana.getMaxMana());
|
||||
PlayerMana.recoverMana(player, PlayerMana.DEFAULT_RECOVER_RATE + regenBonus);
|
||||
boolean hasManaRegenBuff = player.hasEffect(ModEffects.MANA_REGENERATION);
|
||||
double manaRegenBonus = AccessoryUtil.getManaRegenBonus(player);
|
||||
double standingBonus = (hasManaRegenBuff || !isPlayerMoving(player)) ? 2.0D : 1.0D;
|
||||
double regenCoeff = hasManaRegenBuff ? 1.0D : (mana.getMaxMana() > 0 ? ((double) mana.getMana() / mana.getMaxMana()) * 0.5D + 0.5D : 1.0D);
|
||||
double itemUseCoeff = isUsingMagicWeapon(player) ? 0.05D : 1.0D;
|
||||
|
||||
PlayerMana.recoverMana(player, manaRegenBonus, standingBonus, regenCoeff, itemUseCoeff);
|
||||
}
|
||||
|
||||
public static void sync(ServerPlayer player) {
|
||||
@@ -82,4 +87,11 @@ public class PlayerManaSyncEventHandler {
|
||||
ItemStack stack = player.getUseItem();
|
||||
return stack.getItem() instanceof MagicWeapon;
|
||||
}
|
||||
|
||||
private static boolean isPlayerMoving(ServerPlayer player) {
|
||||
return Math.abs(player.getX() - player.xo) > 0.001D
|
||||
|| Math.abs(player.getY() - player.yo) > 0.001D
|
||||
|| Math.abs(player.getZ() - player.zo) > 0.001D
|
||||
|| player.getDeltaMovement().horizontalDistanceSqr() > 1.0E-4D;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,12 @@ public class LzxnoneTerrariaJeiPlugin implements IModPlugin {
|
||||
List.of(new ItemStack(ModItems.LESSER_MANA_POTION.get())),
|
||||
new ItemStack(ModItems.MANA_POTION.get()),
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "brewing/mana_potion")
|
||||
),
|
||||
factory.createBrewingRecipe(
|
||||
List.of(new ItemStack(Items.GLOWSTONE_DUST)),
|
||||
List.of(new ItemStack(ModItems.MANA_POTION.get())),
|
||||
new ItemStack(ModItems.MANA_REGENERATION_POTION.get()),
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "brewing/mana_regeneration_potion")
|
||||
)
|
||||
);
|
||||
registration.addRecipes(RecipeTypes.BREWING, recipes);
|
||||
|
||||
@@ -224,6 +224,7 @@ public class ModItems {
|
||||
|
||||
//药水
|
||||
public static final DeferredItem<Item> SUMMONING_POTION = ITEMS.register("summoning_potion", SummoningPotion::new);
|
||||
public static final DeferredItem<Item> MANA_REGENERATION_POTION = ITEMS.register("mana_regeneration_potion", ManaRegenerationPotion::new);
|
||||
public static final DeferredItem<Item> LESSER_MANA_POTION = ITEMS.register("lesser_mana_potion", LesserManaPotion::new);
|
||||
public static final DeferredItem<Item> MANA_POTION = ITEMS.register("mana_potion", ManaPotion::new);
|
||||
public static final DeferredItem<Item> GREATER_MANA_POTION = ITEMS.register("greater_mana_potion", GreaterManaPotion::new);
|
||||
|
||||
@@ -159,23 +159,12 @@ public class AccessoryUtil {
|
||||
return multiplier[0];
|
||||
}
|
||||
|
||||
//魔力恢复延迟倍率:取所有饰品中的最小值(减半优先)
|
||||
public static double getManaRecoverDelayMultiplier(LivingEntity entity) {
|
||||
double[] multiplier = {1.0D};
|
||||
AccessoryUtil.forEachAccessory(entity, (accessory, stack) -> {
|
||||
if(accessory instanceof ManaRegenerationModifier modifier) {
|
||||
multiplier[0] = Math.min(multiplier[0], modifier.getManaRecoverDelayMultiplier(stack, entity));
|
||||
}
|
||||
});
|
||||
return multiplier[0];
|
||||
}
|
||||
|
||||
//额外魔力恢复速率:累加所有饰品
|
||||
public static double getManaRegenBonus(LivingEntity entity, int currentMana, int maxMana) {
|
||||
//魔力再生奖励:累加所有饰品
|
||||
public static double getManaRegenBonus(LivingEntity entity) {
|
||||
double[] bonus = {0.0D};
|
||||
AccessoryUtil.forEachAccessory(entity, (accessory, stack) -> {
|
||||
if(accessory instanceof ManaRegenerationModifier modifier) {
|
||||
bonus[0] += modifier.getManaRegenBonus(stack, entity, currentMana, maxMana);
|
||||
bonus[0] += modifier.getManaRegenBonus(stack, entity);
|
||||
}
|
||||
});
|
||||
return bonus[0];
|
||||
|
||||
@@ -28,26 +28,13 @@ public class ManaRegenerationBand extends AccessoryItem implements ManaRegenerat
|
||||
0,
|
||||
400
|
||||
);
|
||||
public static final ConfigDouble RECOVER_DELAY_MULTIPLIER = new ConfigDouble(
|
||||
"accessory.mana_regeneration_band.recover_delay_multiplier",
|
||||
"mana_regen_delay_multiplier",
|
||||
0.5D,
|
||||
0.1D,
|
||||
1.0D
|
||||
);
|
||||
public static final ConfigDouble REGEN_BONUS_SCALE = new ConfigDouble(
|
||||
"accessory.mana_regeneration_band.regen_bonus_scale",
|
||||
"mana_regen_bonus_scale",
|
||||
0.575D,
|
||||
//魔力再生奖励
|
||||
public static final ConfigDouble MANA_REGEN_BONUS = new ConfigDouble(
|
||||
"accessory.mana_regeneration_band.mana_regen_bonus",
|
||||
"mana_regen_bonus",
|
||||
60.0D,
|
||||
0.0D,
|
||||
400.0D
|
||||
);
|
||||
public static final ConfigDouble REGEN_BONUS_BASE = new ConfigDouble(
|
||||
"accessory.mana_regeneration_band.regen_bonus_base",
|
||||
"mana_regen_bonus_base",
|
||||
0.14375D,
|
||||
0.0D,
|
||||
400.0D
|
||||
1000.0D
|
||||
);
|
||||
|
||||
public ManaRegenerationBand() {
|
||||
@@ -60,20 +47,14 @@ public class ManaRegenerationBand extends AccessoryItem implements ManaRegenerat
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getManaRecoverDelayMultiplier(ItemStack stack, LivingEntity entity) {
|
||||
return RECOVER_DELAY_MULTIPLIER.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getManaRegenBonus(ItemStack stack, LivingEntity entity, int currentMana, int maxMana) {
|
||||
double ratio = maxMana > 0 ? (double) currentMana / maxMana : 0.0D;
|
||||
return REGEN_BONUS_SCALE.get() * ratio + REGEN_BONUS_BASE.get();
|
||||
public double getManaRegenBonus(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_REGEN_BONUS.get();
|
||||
}
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(MAX_MANA_BONUS, RECOVER_DELAY_MULTIPLIER, REGEN_BONUS_SCALE, REGEN_BONUS_BASE);
|
||||
ConfigStruct.loadAll(MAX_MANA_BONUS, MANA_REGEN_BONUS);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -93,15 +74,10 @@ public class ManaRegenerationBand extends AccessoryItem implements ManaRegenerat
|
||||
EffectTooltipUtil.formatNumber(MAX_MANA_BONUS.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(RECOVER_DELAY_MULTIPLIER.get() < 1.0D) {
|
||||
if(MANA_REGEN_BONUS.get() > 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.mana_regen_delay",
|
||||
EffectTooltipUtil.formatPercent(RECOVER_DELAY_MULTIPLIER.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(REGEN_BONUS_SCALE.get() > 0.0D || REGEN_BONUS_BASE.get() > 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.mana_regen_boost"
|
||||
"tooltip.lzxnoneterraria.mana_regen_bonus",
|
||||
EffectTooltipUtil.formatNumber(MANA_REGEN_BONUS.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
public interface ManaRegenerationModifier {
|
||||
//魔力恢复延迟倍率(0.5 = 减半)
|
||||
double getManaRecoverDelayMultiplier(ItemStack stack, LivingEntity entity);
|
||||
//额外魔力恢复速率(点/秒),按当前魔力水平计算
|
||||
double getManaRegenBonus(ItemStack stack, LivingEntity entity, int currentMana, int maxMana);
|
||||
//魔力再生奖励
|
||||
double getManaRegenBonus(ItemStack stack, LivingEntity entity);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.lzxnone.terraria.item.potion;
|
||||
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
public class ManaRegenerationPotion extends Potion {
|
||||
public static final int EFFECT_DURATION = 8 * 60 * 20;
|
||||
|
||||
@Override
|
||||
protected boolean onDrink(ServerPlayer player, ItemStack stack) {
|
||||
player.addEffect(new MobEffectInstance(ModEffects.MANA_REGENERATION, EFFECT_DURATION, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTooltipKey() {
|
||||
return "tooltip.lzxnoneterraria.mana_regeneration_potion";
|
||||
}
|
||||
}
|
||||
@@ -82,17 +82,38 @@ public class MagicWeapon extends Weapon {
|
||||
}
|
||||
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 1;
|
||||
return computeUseTime(1, weaponStack, entity);
|
||||
}
|
||||
|
||||
public int computeUseTime(int useTime, ItemStack weaponStack, LivingEntity entity) {
|
||||
if(entity instanceof Player player) {
|
||||
double manaConsume = getFinalManaConsumeRate(weaponStack, player);
|
||||
if(!testConsumeMana(player, manaConsume)) {
|
||||
return (int) Math.ceil(useTime / 0.4D);
|
||||
}
|
||||
}
|
||||
return useTime;
|
||||
}
|
||||
|
||||
public boolean tryShoot(Level level, Player player, InteractionHand hand, ItemStack weaponStack) {
|
||||
double manaConsume = getFinalManaConsumeRate(weaponStack, player);
|
||||
if(!tryConsumeMana(player, manaConsume)) return false;
|
||||
tryConsumeMana(player, manaConsume);
|
||||
//if(!tryConsumeMana(player, manaConsume)) return false;
|
||||
|
||||
shoot(level, player, hand, weaponStack);
|
||||
return true;
|
||||
}
|
||||
|
||||
//测试魔力是否充足(类比 tryConsumeMana)
|
||||
public boolean testConsumeMana(Player player, double amount) {
|
||||
if(amount <= 0.0D || player.hasInfiniteMaterials()) return true;
|
||||
if(PlayerMana.testMana(player, amount)) return true;
|
||||
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
double targetMana = Math.max(1.0D, Math.floor(mana.getConsumeProgress() + amount));
|
||||
return canAutoUseManaPotionToReachTarget(player, targetMana);
|
||||
}
|
||||
|
||||
//尝试消耗魔力
|
||||
protected boolean tryConsumeMana(Player player, double amount) {
|
||||
//创造模式
|
||||
@@ -108,6 +129,7 @@ public class MagicWeapon extends Weapon {
|
||||
return PlayerMana.consumeMana(serverPlayer, amount);
|
||||
}
|
||||
|
||||
|
||||
//使用魔法武器时
|
||||
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {}
|
||||
|
||||
@@ -170,7 +192,7 @@ public class MagicWeapon extends Weapon {
|
||||
return (float) Math.max(0.0D, finalDamage);
|
||||
}
|
||||
|
||||
protected static boolean tryAutoUseManaPotionToReachTarget(Player player, double targetMana) {
|
||||
protected static boolean canAutoUseManaPotionToReachTarget(Player player, double targetMana) {
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
if(targetMana <= 0.0D || mana.getMana() >= targetMana) return true;
|
||||
if(mana.getMaxMana() < targetMana) return false;
|
||||
@@ -183,7 +205,6 @@ public class MagicWeapon extends Weapon {
|
||||
});
|
||||
if(!result[0]) return false;
|
||||
|
||||
if(!(player instanceof ServerPlayer serverPlayer)) {
|
||||
int simulatedMana = mana.getMana();
|
||||
for(int i = 0; i < player.getInventory().getContainerSize() && simulatedMana < targetMana; i++) {
|
||||
ItemStack stack = player.getInventory().getItem(i);
|
||||
@@ -197,8 +218,12 @@ public class MagicWeapon extends Weapon {
|
||||
return simulatedMana >= targetMana;
|
||||
}
|
||||
|
||||
protected static boolean tryAutoUseManaPotionToReachTarget(Player player, double targetMana) {
|
||||
if(!canAutoUseManaPotionToReachTarget(player, targetMana)) return false;
|
||||
if(!(player instanceof ServerPlayer serverPlayer)) return true;
|
||||
|
||||
while(serverPlayer.getData(ModAttachments.PLAYER_MANA).getMana() < targetMana) {
|
||||
mana = serverPlayer.getData(ModAttachments.PLAYER_MANA);
|
||||
PlayerMana mana = serverPlayer.getData(ModAttachments.PLAYER_MANA);
|
||||
int bestSlot = -1;
|
||||
int bestRecoverAmount = 0;
|
||||
int smallestSufficientRecoverAmount = Integer.MAX_VALUE;
|
||||
|
||||
@@ -171,7 +171,7 @@ public class ArcSurge extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 10;
|
||||
return computeUseTime(10, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -235,7 +235,7 @@ public class BetsyWrath extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 20;
|
||||
return computeUseTime(20, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -132,7 +132,7 @@ public class BubbleGun extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 6;
|
||||
return computeUseTime(6, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,7 +55,7 @@ public class LastPrism extends MagicWeapon {
|
||||
public static final ConfigFloat DAMAGE = new ConfigFloat(
|
||||
"weapon.last_prism.damage",
|
||||
"last_prism_damage",
|
||||
3.0f,
|
||||
3f,
|
||||
0.0f,
|
||||
8388600.0f
|
||||
);
|
||||
@@ -214,6 +214,11 @@ public class LastPrism extends MagicWeapon {
|
||||
this.onDied(beam);
|
||||
return;
|
||||
}
|
||||
ItemStack weaponStack = tri.getEntityData().get(StaticSummon.STACK_SOURCE);
|
||||
if(weaponStack.isEmpty() || !(weaponStack.getItem() instanceof LastPrism lastPrism)) {
|
||||
this.onDied(beam);
|
||||
return;
|
||||
}
|
||||
|
||||
beam.setPos(tri.position());
|
||||
BeamData beamData = computeBeamData(tri, getBeamIndex(beam), 0.0f);
|
||||
@@ -241,8 +246,7 @@ public class LastPrism extends MagicWeapon {
|
||||
AABB entityBox = hitEntity.getBoundingBox().inflate(beamData.radius());
|
||||
Optional<Vec3> clipResult = entityBox.clip(beamData.start(), beamData.end());
|
||||
if(entityBox.contains(beamData.start()) || clipResult.isPresent()) {
|
||||
if(DamageUtil.magicAttack(beam, hitEntity, beam.getEntityData().get(StaticSummon.STACK_SOURCE), DAMAGE.get() * beamData.ratio(), 0.1f, 2)) {
|
||||
}
|
||||
DamageUtil.magicAttack(beam, hitEntity, beam.getEntityData().get(StaticSummon.STACK_SOURCE), DAMAGE.get() * beamData.ratio(), 0.1f, lastPrism.testConsumeMana(player, lastPrism.getFinalManaConsumeRate(weaponStack, player)) ? 2 : 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,7 +361,7 @@ public class LastPrism extends MagicWeapon {
|
||||
beam.getEntityData().set(StaticSummon.COLOR_R, color.x);
|
||||
beam.getEntityData().set(StaticSummon.COLOR_G, color.y);
|
||||
beam.getEntityData().set(StaticSummon.COLOR_B, color.z);
|
||||
beam.getEntityData().set(StaticSummon.COLOR_A, 1.0f);
|
||||
beam.getEntityData().set(StaticSummon.COLOR_A, 0.25f);
|
||||
|
||||
CompoundTag customData = new CompoundTag();
|
||||
customData.putInt("idx", i);
|
||||
@@ -379,14 +383,16 @@ public class LastPrism extends MagicWeapon {
|
||||
if(entity.tickCount % 10 == 0) {
|
||||
player.playNotifySound(ModSounds.BEAM2.get(), SoundSource.PLAYERS, 4.0F, 1.0F);
|
||||
}
|
||||
if(!tryConsumeMana(player, getFinalManaConsumeRate(stack, player))) {
|
||||
/*if(!tryConsumeMana(player, getFinalManaConsumeRate(stack, player))) {
|
||||
player.stopUsingItem();
|
||||
}
|
||||
}*/
|
||||
tryConsumeMana(player, getFinalManaConsumeRate(stack, player));
|
||||
}
|
||||
|
||||
private boolean canStartUsingPrism(Player player) {
|
||||
if(player.hasInfiniteMaterials()) return true;
|
||||
/*if(player.hasInfiniteMaterials()) return true;
|
||||
if(player.getData(ModAttachments.PLAYER_MANA).getMana() > 0) return true;
|
||||
return tryAutoUseManaPotionToReachTarget(player, 1.0D);
|
||||
return tryAutoUseManaPotionToReachTarget(player, 1.0D);*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -188,7 +188,7 @@ public class LunarFlare extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 10;
|
||||
return computeUseTime(10, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -434,7 +434,7 @@ public class NebulaArcanum extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 30;
|
||||
return computeUseTime(30, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -131,7 +131,7 @@ public class NebulaBlaze extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 12;
|
||||
return computeUseTime(12, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -106,7 +106,7 @@ public class Nightglow extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 34;
|
||||
return computeUseTime(34, weaponStack, entity);
|
||||
}
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
|
||||
@@ -134,7 +134,7 @@ public class StellarTune extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return 12;
|
||||
return computeUseTime(12, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,6 +49,9 @@ public class Possession extends Whip {
|
||||
private static final ConfigFloat BEAM_DAMAGE = new ConfigFloat("weapon.possession.beam_damage", "possession_beam_damage", 10.0F, 0.0F, 8388600.0F);
|
||||
private static final ConfigInt PROPHETIC_MARK_DURATION = new ConfigInt("weapon.possession.prophetic_mark_duration", "possession_prophetic_mark_duration", 80, 1, 72000);
|
||||
public static final ConfigInt MAX_PROPHETIC_MARK_STACKS = new ConfigInt("weapon.possession.max_prophetic_mark_stacks", "possession_max_prophetic_mark_stacks", 3, 0, 1024);
|
||||
private static final ConfigFloat TAG_DAMAGE = new ConfigFloat("weapon.possession.tag_damage", "possession_tag_damage", 25.0F, 0.0F, 8388600.0F);
|
||||
private static final ConfigInt TAG_CRIT = new ConfigInt("weapon.possession.tag_crit", "possession_tag_crit", 10, 0, 100);
|
||||
private static final ConfigFloat DAMAGE_FALLOFF = new ConfigFloat("weapon.possession.damage_falloff", "possession_damage_falloff", 0.95F, 0.0F, 1.0F);
|
||||
|
||||
public Possession() {
|
||||
super(Tiers.NETHERITE, new Item.Properties().stacksTo(1).fireResistant().rarity(Rarity.EPIC));
|
||||
@@ -94,6 +97,21 @@ public class Possession extends Whip {
|
||||
return DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getDamageFalloff() {
|
||||
return DAMAGE_FALLOFF.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getTagDamage() {
|
||||
return TAG_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getTagCrit() {
|
||||
return TAG_CRIT.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLifetime() {
|
||||
return 10;
|
||||
@@ -124,7 +142,10 @@ public class Possession extends Whip {
|
||||
BEAM_SPEED,
|
||||
BEAM_DAMAGE,
|
||||
PROPHETIC_MARK_DURATION,
|
||||
MAX_PROPHETIC_MARK_STACKS
|
||||
MAX_PROPHETIC_MARK_STACKS,
|
||||
TAG_DAMAGE,
|
||||
TAG_CRIT,
|
||||
DAMAGE_FALLOFF
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -195,7 +216,9 @@ public class Possession extends Whip {
|
||||
PROPHETIC_MARK_DURATION.get(),
|
||||
0,
|
||||
summon.getOwner() == null ? null : summon.getOwner().getUUID(),
|
||||
summon.getEntityData().get(StaticSummon.STACK_SOURCE)
|
||||
summon.getEntityData().get(StaticSummon.STACK_SOURCE),
|
||||
getTagDamage(),
|
||||
getTagCrit()
|
||||
)
|
||||
);
|
||||
target.setData(ModAttachments.TARGET_MARKS, marks);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.lzxnone.terraria.item.weapon.summon.whip;
|
||||
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.attachment.ModAttachments;
|
||||
import com.lzxnone.terraria.attachment.TargetMarks;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
@@ -34,7 +36,7 @@ import java.util.List;
|
||||
public abstract class Whip extends SummonWeapon {
|
||||
public static final Vector3f OFFSET = new Vector3f(-1.0F, 1.0F, 0.0F);
|
||||
private static final int SEGMENTS = 24;
|
||||
private static final double HITBOX_INFLATE = 1.0D;
|
||||
private static final double HITBOX_INFLATE = 0.5D;
|
||||
|
||||
protected Whip(Tier tier, Item.Properties properties) {
|
||||
super(tier, properties);
|
||||
@@ -56,6 +58,42 @@ public abstract class Whip extends SummonWeapon {
|
||||
|
||||
protected abstract float getDamage();
|
||||
|
||||
protected abstract float getDamageFalloff();
|
||||
|
||||
protected abstract float getTagDamage();
|
||||
|
||||
protected abstract int getTagCrit();
|
||||
|
||||
public static float applyMarkDamageBonus(Entity target, float damage) {
|
||||
if(target == null) return damage;
|
||||
TargetMarks marks = target.getData(ModAttachments.TARGET_MARKS);
|
||||
if(marks == null || marks.getMarks().isEmpty()) return damage;
|
||||
|
||||
long gameTime = target.level().getGameTime();
|
||||
float bonus = 0.0F;
|
||||
for(TargetMarks.Mark mark : marks.getMarks().values()) {
|
||||
if(mark != null && (mark.getDuration() <= 0 || gameTime - mark.getStartTime() < mark.getDuration())) {
|
||||
bonus += mark.getTagDamage();
|
||||
}
|
||||
}
|
||||
return damage + bonus;
|
||||
}
|
||||
|
||||
public static int applyMarkCritBonus(Entity target, int baseCrit) {
|
||||
if(target == null) return baseCrit;
|
||||
TargetMarks marks = target.getData(ModAttachments.TARGET_MARKS);
|
||||
if(marks == null || marks.getMarks().isEmpty()) return baseCrit;
|
||||
|
||||
long gameTime = target.level().getGameTime();
|
||||
int bonus = 0;
|
||||
for(TargetMarks.Mark mark : marks.getMarks().values()) {
|
||||
if(mark != null && (mark.getDuration() <= 0 || gameTime - mark.getStartTime() < mark.getDuration())) {
|
||||
bonus += mark.getTagCrit();
|
||||
}
|
||||
}
|
||||
return baseCrit + bonus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTooltipDamage(ItemStack weaponStack, LivingEntity entity) {
|
||||
float damage = entity instanceof Player player ? DamageUtil.applyPlayerDamageEffects(player, getDamage()) : getDamage();
|
||||
@@ -261,12 +299,23 @@ public abstract class Whip extends SummonWeapon {
|
||||
double radius = range + height + bend + HITBOX_INFLATE;
|
||||
AABB searchBox = AABB.ofSize(hand, radius * 2.0D, radius * 2.0D, radius * 2.0D);
|
||||
|
||||
int hitCount = customData.contains("hitCount") ? customData.getInt("hitCount") : 0;
|
||||
boolean hitOccurred = false;
|
||||
|
||||
for(Entity target : SearchUtil.searchEntities(summon, summon.getOwner(), searchBox)) {
|
||||
if(!intersectsWhip(points, target)) continue;
|
||||
if(DamageUtil.summonAttack(summon, target, sourceStack, whip.getDamage(), whip.getKnockbackScale(), whip.getInvulnerableTime())) {
|
||||
float currentDamage = (float) (whip.getDamage() * Math.pow(whip.getDamageFalloff(), hitCount));
|
||||
if(DamageUtil.summonAttack(summon, target, sourceStack, currentDamage, whip.getKnockbackScale(), whip.getInvulnerableTime())) {
|
||||
whip.onHitTarget(summon, target);
|
||||
hitCount++;
|
||||
hitOccurred = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(hitOccurred) {
|
||||
customData.putInt("hitCount", hitCount);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
}
|
||||
}
|
||||
|
||||
private static Whip getWhip(StaticSummon summon) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.lzxnone.terraria.effect.IceBarrierEffect;
|
||||
import com.lzxnone.terraria.effect.PanicEffect;
|
||||
import com.lzxnone.terraria.effect.ZappedRedEffect;
|
||||
import com.lzxnone.terraria.effect.SummonEffect;
|
||||
import com.lzxnone.terraria.effect.ManaRegenerationEffect;
|
||||
import com.lzxnone.terraria.enchantment.ModEnchantmentConfigs;
|
||||
import com.lzxnone.terraria.client.config.RenderConfigs;
|
||||
import com.lzxnone.terraria.item.ammo.*;
|
||||
@@ -235,7 +236,8 @@ public class ConfigList {
|
||||
PaladinsShieldEffect.CONFIG_LIST_ITEM,
|
||||
IceBarrierEffect.CONFIG_LIST_ITEM,
|
||||
PanicEffect.CONFIG_LIST_ITEM,
|
||||
ZappedRedEffect.CONFIG_LIST_ITEM
|
||||
ZappedRedEffect.CONFIG_LIST_ITEM,
|
||||
ManaRegenerationEffect.CONFIG_LIST_ITEM
|
||||
});
|
||||
ITEMS.put(AMMO, new ConfigListItem[]{
|
||||
MusketBall.CONFIG_LIST_ITEM,
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.item.accessory.AccessoryUtil;
|
||||
import com.lzxnone.terraria.item.weapon.*;
|
||||
import com.lzxnone.terraria.item.weapon.summon.minion.MinionWeapon;
|
||||
import com.lzxnone.terraria.item.weapon.summon.whip.Whip;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
@@ -120,12 +121,30 @@ public class DamageUtil {
|
||||
}else if(category == DamageCategory.SENTRY && !itemSource.isEmpty()) {
|
||||
finalDamage = SummonWeapon.applySummonDamageBonus(itemSource, player, finalDamage);
|
||||
}
|
||||
|
||||
//仆从/哨兵 标记伤害(来自鞭子标记的点伤加成)
|
||||
if(category == DamageCategory.MINION || category == DamageCategory.SENTRY) {
|
||||
finalDamage = Whip.applyMarkDamageBonus(target, finalDamage);
|
||||
}
|
||||
|
||||
finalDamage = Math.max(0.0F, finalDamage);
|
||||
|
||||
//近战暴击(月光护身符等饰品的近战暴击率,触发后伤害提升 1.5 倍)
|
||||
//近战暴击(近战专属暴击 + 全职业通用饰品暴击)
|
||||
if(category == DamageCategory.MELEE) {
|
||||
double meleeCritChance = AccessoryUtil.getMeleeCritChance(player);
|
||||
if(meleeCritChance > 0.0D && player.getRandom().nextDouble() < meleeCritChance) {
|
||||
double critChance = AccessoryUtil.getMeleeCritChance(player) + AccessoryUtil.getCritChance(player);
|
||||
if(critChance > 0.0D && player.getRandom().nextDouble() < critChance) {
|
||||
finalDamage *= 1.5F;
|
||||
}
|
||||
}else if(category == DamageCategory.RANGED || category == DamageCategory.MAGIC || category == DamageCategory.SUMMON || category == DamageCategory.NORMAL) {
|
||||
//远程、魔法、召唤鞭打、普通攻击:享受通用饰品暴击
|
||||
double critChance = AccessoryUtil.getCritChance(player);
|
||||
if(critChance > 0.0D && player.getRandom().nextDouble() < critChance) {
|
||||
finalDamage *= 1.5F;
|
||||
}
|
||||
}else if(category == DamageCategory.MINION || category == DamageCategory.SENTRY) {
|
||||
//仆从/哨兵 标记暴击(严格仅来自鞭子标记的暴击率加成,不享受玩家自身饰品暴击)
|
||||
int tagCrit = Whip.applyMarkCritBonus(target, 0);
|
||||
if(tagCrit > 0 && player.getRandom().nextInt(100) < tagCrit) {
|
||||
finalDamage *= 1.5F;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,6 +193,7 @@
|
||||
"item.lzxnoneterraria.recon_scope": "Recon Scope",
|
||||
"item.lzxnoneterraria.mana_crystal": "Mana Crystal",
|
||||
"item.lzxnoneterraria.summoning_potion": "Summoning Potion",
|
||||
"item.lzxnoneterraria.mana_regeneration_potion": "Mana Regeneration Potion",
|
||||
"item.lzxnoneterraria.lesser_mana_potion": "Lesser Mana Potion",
|
||||
"item.lzxnoneterraria.mana_potion": "Mana Potion",
|
||||
"item.lzxnoneterraria.greater_mana_potion": "Greater Mana Potion",
|
||||
@@ -230,6 +231,7 @@
|
||||
"tooltip.lzxnoneterraria.devils_devastation.2": "Perhaps this is why the Brimstone Elemental had strength unrivaled by her sisters.",
|
||||
"tooltip.lzxnoneterraria.mana_crystal": "Permanently increases maximum mana by 20, up to 200",
|
||||
"tooltip.lzxnoneterraria.summoning_potion": "Increases minion capacity by %s for 8 minutes",
|
||||
"tooltip.lzxnoneterraria.mana_regeneration_potion": "Greatly increases mana regeneration rate for 8 minutes",
|
||||
"tooltip.lzxnoneterraria.mana_potion": "Restores %s mana",
|
||||
"curios.modifiers.terraria_accessory": "Accessory Attribute Bonus",
|
||||
"tooltip.lzxnoneterraria.poison_immunity": "Poison Immunity",
|
||||
@@ -258,13 +260,8 @@
|
||||
"lzxnoneterraria.configuration.health_per_second": "Health Regeneration Per Second",
|
||||
"lzxnoneterraria.configuration.health_per_second.tooltip": "Health regenerated per second while equipped",
|
||||
"lzxnoneterraria.configuration.max_mana_bonus": "Max Mana Bonus",
|
||||
"lzxnoneterraria.configuration.max_mana_bonus.tooltip": "Max mana gained while equipped",
|
||||
"lzxnoneterraria.configuration.mana_regen_delay_multiplier": "Mana Regen Delay Multiplier",
|
||||
"lzxnoneterraria.configuration.mana_regen_delay_multiplier.tooltip": "Multiplier for the mana recovery delay while equipped (0.5 = halved)",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus_scale": "Mana Regen Bonus Scale",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus_scale.tooltip": "Bonus regen = scale × current mana ratio + base",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus_base": "Mana Regen Bonus Base",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus_base.tooltip": "Bonus regen when current mana is 0 (per tick)",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus": "Mana Regen Bonus",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus.tooltip": "Mana regen bonus provided while equipped",
|
||||
"lzxnoneterraria.configuration.mana_on_hurt_multiplier": "Mana Recovery on Hit Multiplier",
|
||||
"lzxnoneterraria.configuration.mana_on_hurt_multiplier.tooltip": "Mana recovered on hit based on pre-mitigation damage",
|
||||
"lzxnoneterraria.configuration.mana_sickness_duration_multiplier": "Mana Sickness Duration Multiplier",
|
||||
@@ -372,8 +369,7 @@
|
||||
"tooltip.lzxnoneterraria.mana_cost_increase": "+%s%% mana cost",
|
||||
"tooltip.lzxnoneterraria.mana_cost_decrease": "-%s%% mana cost",
|
||||
"tooltip.lzxnoneterraria.max_mana_bonus": "Mana +%s",
|
||||
"tooltip.lzxnoneterraria.mana_regen_delay": "Mana regen delay -%s%%",
|
||||
"tooltip.lzxnoneterraria.mana_regen_boost": "Increases mana regeneration rate",
|
||||
"tooltip.lzxnoneterraria.mana_regen_bonus": "+%s mana regen bonus",
|
||||
"tooltip.lzxnoneterraria.mana_on_hurt": "Restores mana when taking damage",
|
||||
"tooltip.lzxnoneterraria.mana_sickness_duration": "Mana sickness max duration -%s%%",
|
||||
"tooltip.lzxnoneterraria.luck_bonus": "Luck +%s",
|
||||
@@ -464,6 +460,7 @@
|
||||
"effect.lzxnoneterraria.panic": "Panic",
|
||||
"effect.lzxnoneterraria.summon": "Summon",
|
||||
"effect.lzxnoneterraria.mana_sickness": "Mana Sickness",
|
||||
"effect.lzxnoneterraria.mana_regeneration": "Mana Regeneration",
|
||||
"effect.lzxnoneterraria.zapped_red": "Zapped",
|
||||
"key.categories.lzxnoneterraria": "lzxnoneterraria",
|
||||
"key.lzxnoneterraria.kill_mode": "Kill Mode",
|
||||
@@ -835,6 +832,12 @@
|
||||
"lzxnoneterraria.configuration.possession_prophetic_mark_duration.tooltip": "Duration of the prophetic mark applied by Possession, in ticks",
|
||||
"lzxnoneterraria.configuration.possession_max_prophetic_mark_stacks": "Max Prophetic Stacks",
|
||||
"lzxnoneterraria.configuration.possession_max_prophetic_mark_stacks.tooltip": "Maximum number of vision triggers from one prophetic mark",
|
||||
"lzxnoneterraria.configuration.possession_tag_damage": "Tag Damage",
|
||||
"lzxnoneterraria.configuration.possession_tag_damage.tooltip": "Bonus flat damage granted to minions and sentries striking marked enemies",
|
||||
"lzxnoneterraria.configuration.possession_tag_crit": "Tag Critical Strike Chance",
|
||||
"lzxnoneterraria.configuration.possession_tag_crit.tooltip": "Bonus critical strike chance percentage granted to minions and sentries striking marked enemies",
|
||||
"lzxnoneterraria.configuration.possession_damage_falloff": "Damage Falloff",
|
||||
"lzxnoneterraria.configuration.possession_damage_falloff.tooltip": "Multiplicative damage reduction factor for each subsequent enemy struck in a single swing (e.g. 0.95)",
|
||||
"lzxnoneterraria.configuration.last_prism_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.last_prism_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.last_prism_charge_time": "Charge Time",
|
||||
|
||||
@@ -193,6 +193,7 @@
|
||||
"item.lzxnoneterraria.recon_scope": "侦察镜",
|
||||
"item.lzxnoneterraria.mana_crystal": "魔力水晶",
|
||||
"item.lzxnoneterraria.summoning_potion": "召唤药水",
|
||||
"item.lzxnoneterraria.mana_regeneration_potion": "魔力再生药水",
|
||||
"item.lzxnoneterraria.lesser_mana_potion": "弱效魔力药水",
|
||||
"item.lzxnoneterraria.mana_potion": "魔力药水",
|
||||
"item.lzxnoneterraria.greater_mana_potion": "强效魔力药水",
|
||||
@@ -230,6 +231,7 @@
|
||||
"tooltip.lzxnoneterraria.devils_devastation.2": "或许这就是硫磺火元素掌握着她的姐妹所不能匹敌之力量的原因。",
|
||||
"tooltip.lzxnoneterraria.mana_crystal": "永久提升 20 点最大魔力,最高提升到 200",
|
||||
"tooltip.lzxnoneterraria.summoning_potion": "增加 %s 个仆从栏位,持续 8 分钟",
|
||||
"tooltip.lzxnoneterraria.mana_regeneration_potion": "极大提升魔力再生速度,持续 8 分钟",
|
||||
"tooltip.lzxnoneterraria.mana_potion": "恢复 %s 点魔力",
|
||||
"curios.modifiers.terraria_accessory": "饰品属性加成",
|
||||
"tooltip.lzxnoneterraria.poison_immunity": "免疫中毒",
|
||||
@@ -258,13 +260,8 @@
|
||||
"lzxnoneterraria.configuration.health_per_second": "每秒生命回复",
|
||||
"lzxnoneterraria.configuration.health_per_second.tooltip": "佩戴后每秒回复的生命值",
|
||||
"lzxnoneterraria.configuration.max_mana_bonus": "最大魔力加成",
|
||||
"lzxnoneterraria.configuration.max_mana_bonus.tooltip": "佩戴后增加的最大魔力",
|
||||
"lzxnoneterraria.configuration.mana_regen_delay_multiplier": "魔力再生延迟倍率",
|
||||
"lzxnoneterraria.configuration.mana_regen_delay_multiplier.tooltip": "佩戴后魔力恢复延迟的倍率(0.5 = 减半)",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus_scale": "魔力再生加成系数",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus_scale.tooltip": "额外再生 = 系数 × 当前魔力比例 + 基础值",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus_base": "魔力再生加成基础值",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus_base.tooltip": "当前魔力为 0 时的额外再生量(每 tick)",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus": "魔力再生奖励",
|
||||
"lzxnoneterraria.configuration.mana_regen_bonus.tooltip": "佩戴后提供的魔力再生奖励数值",
|
||||
"lzxnoneterraria.configuration.mana_on_hurt_multiplier": "受击魔力恢复倍率",
|
||||
"lzxnoneterraria.configuration.mana_on_hurt_multiplier.tooltip": "受到伤害时按减免前的伤害值恢复魔力的倍率",
|
||||
"lzxnoneterraria.configuration.mana_sickness_duration_multiplier": "耐药性持续时间比例",
|
||||
@@ -372,8 +369,7 @@
|
||||
"tooltip.lzxnoneterraria.mana_cost_increase": "魔力花费 +%s%%",
|
||||
"tooltip.lzxnoneterraria.mana_cost_decrease": "魔力花费 -%s%%",
|
||||
"tooltip.lzxnoneterraria.max_mana_bonus": "魔力 +%s",
|
||||
"tooltip.lzxnoneterraria.mana_regen_delay": "魔力再生延迟 -%s%%",
|
||||
"tooltip.lzxnoneterraria.mana_regen_boost": "提升魔力再生速度",
|
||||
"tooltip.lzxnoneterraria.mana_regen_bonus": "魔力再生奖励 +%s",
|
||||
"tooltip.lzxnoneterraria.mana_on_hurt": "受到伤害时恢复魔力",
|
||||
"tooltip.lzxnoneterraria.mana_sickness_duration": "耐药性最大时间 -%s%%",
|
||||
"tooltip.lzxnoneterraria.luck_bonus": "幸运 +%s",
|
||||
@@ -464,6 +460,7 @@
|
||||
"effect.lzxnoneterraria.panic": "恐慌",
|
||||
"effect.lzxnoneterraria.summon": "召唤",
|
||||
"effect.lzxnoneterraria.mana_sickness": "耐魔性",
|
||||
"effect.lzxnoneterraria.mana_regeneration": "魔力再生",
|
||||
"effect.lzxnoneterraria.zapped_red": "电击",
|
||||
"key.categories.lzxnoneterraria": "lzxnoneterraria",
|
||||
"key.lzxnoneterraria.kill_mode": "进入杀戮模式",
|
||||
@@ -835,6 +832,12 @@
|
||||
"lzxnoneterraria.configuration.possession_prophetic_mark_duration.tooltip": "支配之鞭施加的预兆标记持续时间(刻)",
|
||||
"lzxnoneterraria.configuration.possession_max_prophetic_mark_stacks": "最大预兆层数",
|
||||
"lzxnoneterraria.configuration.possession_max_prophetic_mark_stacks.tooltip": "同一个预兆标记最多触发幻象的次数",
|
||||
"lzxnoneterraria.configuration.possession_tag_damage": "标记伤害",
|
||||
"lzxnoneterraria.configuration.possession_tag_damage.tooltip": "支配之鞭标记赋予仆从和哨兵的额外基础点伤",
|
||||
"lzxnoneterraria.configuration.possession_tag_crit": "标记暴击率",
|
||||
"lzxnoneterraria.configuration.possession_tag_crit.tooltip": "支配之鞭标记赋予仆从和哨兵的额外暴击率(百分比)",
|
||||
"lzxnoneterraria.configuration.possession_damage_falloff": "伤害衰减系数",
|
||||
"lzxnoneterraria.configuration.possession_damage_falloff.tooltip": "每次命中一个敌人后,后续击中敌人所承受伤害的衰减比例(如 0.95)",
|
||||
"lzxnoneterraria.configuration.last_prism_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.last_prism_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.last_prism_charge_time": "蓄力时间",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/item",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/mana_regeneration_potion"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 239 B |
Binary file not shown.
|
After Width: | Height: | Size: 248 B |
Reference in new issue
Block a user