This commit is contained in:
LZX committed 2026-07-28 01:47:33 +08:00
1 parent dbb6783d18
commit ebf7da6dd0
32 files changed
+1474 -93

No files matched your search

@@ -5,6 +5,7 @@ import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.util.Mth;
@@ -38,7 +39,7 @@ public class ClientBulletAmmo {
Minecraft.getInstance().getItemRenderer().renderStatic(
itemStack,
ItemDisplayContext.NONE,
packedLight,
summon.getEntityData().get(StaticSummon.GLOW) ? LightTexture.FULL_BRIGHT : packedLight,
OverlayTexture.NO_OVERLAY,
poseStack,
bufferSource,
@@ -68,7 +69,7 @@ public class ClientBulletAmmo {
Minecraft.getInstance().getItemRenderer().renderStatic(
itemStack,
ItemDisplayContext.NONE,
packedLight,
summon.getEntityData().get(StaticSummon.GLOW) ? LightTexture.FULL_BRIGHT : packedLight,
OverlayTexture.NO_OVERLAY,
poseStack,
bufferSource,
@@ -0,0 +1,83 @@
package com.lzxnone.terraria.effect;
import com.lzxnone.terraria.LzxnoneTerraria;
import com.lzxnone.terraria.particle.DustParticleOptions;
import com.lzxnone.terraria.ui.config.ConfigFactory;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.ConfigUtil;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.ParticleUtil;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
public class AcidVenomEffect extends MobEffect {
private static final String CONFIG_TRANSLATION_PREFIX = "lzxnoneterraria.configuration.";
public static final String DAMAGE_PER_LEVEL_PATH = "effect.acid_venom.damage_per_level";
public static final float DAMAGE_PER_LEVEL_DEFAULT = 2.0f;
public static final float DAMAGE_PER_LEVEL_MIN = 0.0f;
public static final float DAMAGE_PER_LEVEL_MAX = 8388600.0f;
public AcidVenomEffect() {
super(MobEffectCategory.HARMFUL, 0x8A2BE2);
}
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
ConfigFactory.loadFloatConfig(DAMAGE_PER_LEVEL_PATH, configText("acid_venom_damage_per_level"), configTooltip("acid_venom_damage_per_level"), DAMAGE_PER_LEVEL_DEFAULT, DAMAGE_PER_LEVEL_MIN, DAMAGE_PER_LEVEL_MAX);
}
};
private static Component configText(String key) {
return Component.translatable(CONFIG_TRANSLATION_PREFIX + key);
}
private static Component configTooltip(String key) {
return Component.translatable(CONFIG_TRANSLATION_PREFIX + key + ".tooltip");
}
public static float getDamagePerLevel() {
return Math.clamp(ConfigUtil.readFloat(DAMAGE_PER_LEVEL_PATH, DAMAGE_PER_LEVEL_DEFAULT), DAMAGE_PER_LEVEL_MIN, DAMAGE_PER_LEVEL_MAX);
}
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
"acid_venom",
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/mob_effect/acid_venom.png"),
Component.translatable("effect.lzxnoneterraria.acid_venom"),
CONFIG_DATA
);
public static final DustParticleOptions PARTICLE = new DustParticleOptions(
0.075f, 0.5f, 40, false, new Vector3f[]{
new Vector3f(0.0F, 0.0F, 0.0F),
new Vector3f(0.06F, 0.06F, 0.06F)
}
);
@Override
public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) {
return true;
}
@Override
public boolean applyEffectTick(LivingEntity entity, int amplifier) {
if(entity.level() instanceof ServerLevel serverLevel) {
if(entity.tickCount % 20 == 0) {
if(entity.hurt(entity.damageSources().magic(), getDamagePerLevel() * (amplifier + 1))) entity.invulnerableTime = 10;
}
ParticleUtil.addParticles(
serverLevel, PARTICLE,
entity.getBoundingBox().getCenter(), new Vec3(0, 0, 0),
0.1, 1
);
}
return true;
}
}
@@ -89,6 +89,8 @@ public class EffectLogicHandler {
|| effect == ModEffects.KILL_MODE
|| effect == ModEffects.KILL_MODE_COOLDOWN
|| effect == ModEffects.MIDAS
|| effect == ModEffects.CURSED_INFERNO;
|| effect == ModEffects.CURSED_INFERNO
|| effect == ModEffects.ICHOR
|| effect == ModEffects.ACID_VENOM;
}
}
@@ -0,0 +1,50 @@
package com.lzxnone.terraria.effect;
import com.lzxnone.terraria.LzxnoneTerraria;
import com.lzxnone.terraria.ui.config.ConfigFactory;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.ConfigUtil;
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 IchorEffect extends MobEffect {
private static final String CONFIG_TRANSLATION_PREFIX = "lzxnoneterraria.configuration.";
public static final String DAMAGE_BONUS_PER_LEVEL_PATH = "effect.ichor.damage_bonus_per_level";
public static final float DAMAGE_BONUS_PER_LEVEL_DEFAULT = 0.15f;
public static final float DAMAGE_BONUS_PER_LEVEL_MIN = 0.0f;
public static final float DAMAGE_BONUS_PER_LEVEL_MAX = 10.0f;
public IchorEffect() {
super(MobEffectCategory.HARMFUL, 0xFFFF00);
}
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
ConfigFactory.loadFloatConfig(DAMAGE_BONUS_PER_LEVEL_PATH, configText("ichor_damage_bonus_per_level"), configTooltip("ichor_damage_bonus_per_level"), DAMAGE_BONUS_PER_LEVEL_DEFAULT, DAMAGE_BONUS_PER_LEVEL_MIN, DAMAGE_BONUS_PER_LEVEL_MAX);
}
};
private static Component configText(String key) {
return Component.translatable(CONFIG_TRANSLATION_PREFIX + key);
}
private static Component configTooltip(String key) {
return Component.translatable(CONFIG_TRANSLATION_PREFIX + key + ".tooltip");
}
public static float getDamageBonusPerLevel() {
return Math.clamp(ConfigUtil.readFloat(DAMAGE_BONUS_PER_LEVEL_PATH, DAMAGE_BONUS_PER_LEVEL_DEFAULT), DAMAGE_BONUS_PER_LEVEL_MIN, DAMAGE_BONUS_PER_LEVEL_MAX);
}
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
"ichor",
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/mob_effect/ichor.png"),
Component.translatable("effect.lzxnoneterraria.ichor"),
CONFIG_DATA
);
}
@@ -22,6 +22,10 @@ public class ModEffects {
MOB_EFFECTS.register("demonic_flames", DemonicFlamesEffect::new);
public static final DeferredHolder<MobEffect, CursedInfernoEffect> CURSED_INFERNO =
MOB_EFFECTS.register("cursed_inferno", CursedInfernoEffect::new);
public static final DeferredHolder<MobEffect, IchorEffect> ICHOR =
MOB_EFFECTS.register("ichor", IchorEffect::new);
public static final DeferredHolder<MobEffect, AcidVenomEffect> ACID_VENOM =
MOB_EFFECTS.register("acid_venom", AcidVenomEffect::new);
public static final DeferredHolder<MobEffect, SummonEffect> SUMMON =
MOB_EFFECTS.register("summon", SummonEffect::new);
public static final DeferredHolder<MobEffect, MidasEffect> MIDAS =
@@ -0,0 +1,86 @@
package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.LzxnoneTerraria;
import com.lzxnone.terraria.ui.config.ConfigFactory;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.ConfigUtil;
import com.lzxnone.terraria.ui.config.IConfigData;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
public class AmmoConfig {
private static final String CONFIG_TRANSLATION_PREFIX = "lzxnoneterraria.configuration.";
private AmmoConfig() {
}
public static String path(String id, String key) {
return "ammo." + id + "." + key;
}
public static String translationKey(String id, String key) {
return id + "_" + key;
}
public static void loadFloat(String id, String key, float defaultValue, float minValue, float maxValue) {
ConfigFactory.loadFloatConfig(
path(id, key),
configText(translationKey(id, key)),
configTooltip(translationKey(id, key)),
defaultValue,
minValue,
maxValue
);
}
public static void loadDouble(String id, String key, double defaultValue, double minValue, double maxValue) {
ConfigFactory.loadDoubleConfig(
path(id, key),
configText(translationKey(id, key)),
configTooltip(translationKey(id, key)),
defaultValue,
minValue,
maxValue
);
}
public static void loadInt(String id, String key, int defaultValue, int minValue, int maxValue) {
ConfigFactory.loadIntConfig(
path(id, key),
configText(translationKey(id, key)),
configTooltip(translationKey(id, key)),
defaultValue,
minValue,
maxValue
);
}
public static float readFloat(String id, String key, float defaultValue, float minValue, float maxValue) {
return Math.clamp(ConfigUtil.readFloat(path(id, key), defaultValue), minValue, maxValue);
}
public static double readDouble(String id, String key, double defaultValue, double minValue, double maxValue) {
return Math.clamp(ConfigUtil.readDouble(path(id, key), defaultValue), minValue, maxValue);
}
public static int readInt(String id, String key, int defaultValue, int minValue, int maxValue) {
return Math.clamp(ConfigUtil.readInt(path(id, key), defaultValue), minValue, maxValue);
}
public static ConfigListItem createListItem(String id, IConfigData configData) {
return new ConfigListItem(
id,
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/" + id + ".png"),
Component.translatable("item.lzxnoneterraria." + id),
configData
);
}
private static Component configText(String key) {
return Component.translatable(CONFIG_TRANSLATION_PREFIX + key);
}
private static Component configTooltip(String key) {
return Component.translatable(CONFIG_TRANSLATION_PREFIX + key + ".tooltip");
}
}
@@ -1,9 +1,222 @@
package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.FilterUtil;
import com.lzxnone.terraria.utils.MathUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
import java.util.List;
public class ChlorophyteBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 0.8f;
public static final double SPEED = 3.0D;
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
public static final String ID = "chlorophyte_bullet";
public static final float BASE_DAMAGE_DEFAULT = 1.5f;
public static final double SPEED_DEFAULT = 3.0D;
public static final double TARGET_RANGE_DEFAULT = 24.0D;
public static final double AVOID_CHECK_DISTANCE = 3.0D;
public static final double TURN_RATE = 0.35D;
public static final double CLOSE_TARGET_RANGE = 5.0D;
public static final double CLOSE_TURN_RATE = 0.75D;
public static final double TARGET_WEIGHT = 1.0D;
public static final double AVOID_WEIGHT = 0.8D;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadDouble(ID, "target_range", TARGET_RANGE_DEFAULT, 0.0D, 128.0D);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static double getTargetRange() {
return AmmoConfig.readDouble(ID, "target_range", TARGET_RANGE_DEFAULT, 0.0D, 128.0D);
}
private static final double[][] CANDIDATE_OFFSETS = new double[][]{
{0.0D, 0.0D},
{0.7D, 0.0D},
{-0.7D, 0.0D},
{0.0D, 0.7D},
{0.0D, -0.7D},
{0.7D, 0.4D},
{0.7D, -0.4D},
{-0.7D, 0.4D},
{-0.7D, -0.4D},
{1.1D, 0.0D},
{-1.1D, 0.0D},
{0.0D, 1.1D},
{0.0D, -1.1D}
};
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 currentDir = getCurrentDirection(summon);
Entity target = findTarget(summon);
Vec3 nextDir = currentDir;
if(target != null) {
Vec3 targetCenter = target.getBoundingBox().getCenter();
Vec3 targetDir = targetCenter.subtract(summon.position()).normalize();
double turnRate = targetCenter.distanceTo(summon.position()) <= CLOSE_TARGET_RANGE ? CLOSE_TURN_RATE : TURN_RATE;
if(hasLineOfSight(summon.level(), summon, summon.position(), targetCenter)) {
nextDir = steer(currentDir, targetDir, turnRate);
}else {
nextDir = steer(currentDir, findBestClearDirection(summon, currentDir, targetDir), turnRate);
}
}else if(getClearDistance(summon.level(), summon, summon.position(), currentDir, AVOID_CHECK_DISTANCE) < AVOID_CHECK_DISTANCE) {
nextDir = steer(currentDir, findBestClearDirection(summon, currentDir, currentDir));
}
Vec3 motion = nextDir.normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
updateRotation(summon, nextDir);
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
List<Entity> targets = summon.level().getEntitiesOfClass(
Entity.class,
hitBox,
FilterUtil.createTargetFilter(summon, summon.getOwner())
);
if(!targets.isEmpty()) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity hitTarget = targets.getFirst();
if(DamageUtil.rangedAttack(summon, hitTarget, sourceStack, getBaseDamage() + damage, knockbackScale)) {
hitTarget.invulnerableTime = invulnerableTime;
this.onDied(summon);
}
}
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
if(blockHitResult.getType() != HitResult.Type.MISS) {
this.onDied(summon);
}
}
};
private static Entity findTarget(StaticSummon summon) {
AABB searchBox = summon.getBoundingBox().inflate(getTargetRange());
List<Monster> targets = summon.level().getEntitiesOfClass(
Monster.class,
searchBox,
FilterUtil.createTargetFilter(summon, summon.getOwner())
);
Entity bestTarget = null;
double bestDistance = Double.MAX_VALUE;
for(Entity target : targets) {
double distance = target.getBoundingBox().getCenter().distanceToSqr(summon.position());
if(distance < bestDistance) {
bestDistance = distance;
bestTarget = target;
}
}
return bestTarget;
}
private static Vec3 findBestClearDirection(StaticSummon summon, Vec3 currentDir, Vec3 targetDir) {
Vector3f[] basis = MathUtil.computeCoordinateSystem(currentDir.toVector3f(), 0);
Vec3 forward = MathUtil.toVec3(basis[0]).normalize();
Vec3 up = MathUtil.toVec3(basis[1]).normalize();
Vec3 right = MathUtil.toVec3(basis[2]).normalize();
Vec3 bestDir = currentDir;
double bestScore = -Double.MAX_VALUE;
for(double[] offset : CANDIDATE_OFFSETS) {
Vec3 candidate = forward.add(right.scale(offset[0])).add(up.scale(offset[1])).normalize();
double clearDistance = getClearDistance(summon.level(), summon, summon.position(), candidate, AVOID_CHECK_DISTANCE);
double clearRatio = clearDistance / AVOID_CHECK_DISTANCE;
if(clearRatio < 0.25D) continue;
double targetScore = candidate.dot(targetDir);
double score = targetScore * TARGET_WEIGHT + clearRatio * AVOID_WEIGHT;
if(score > bestScore) {
bestScore = score;
bestDir = candidate;
}
}
return bestDir.normalize();
}
private static boolean hasLineOfSight(Level level, Entity clipEntity, Vec3 from, Vec3 to) {
return level.clip(new ClipContext(
from,
to,
ClipContext.Block.COLLIDER,
ClipContext.Fluid.NONE,
clipEntity
)).getType() == HitResult.Type.MISS;
}
private static double getClearDistance(Level level, Entity clipEntity, Vec3 pos, Vec3 direction, double maxDistance) {
BlockHitResult hitResult = level.clip(new ClipContext(
pos,
pos.add(direction.normalize().scale(maxDistance)),
ClipContext.Block.COLLIDER,
ClipContext.Fluid.NONE,
clipEntity
));
if(hitResult.getType() == HitResult.Type.MISS) return maxDistance;
return Math.max(0.0D, hitResult.getLocation().distanceTo(pos));
}
private static Vec3 getCurrentDirection(StaticSummon summon) {
Vec3 direction = summon.getDeltaMovement();
if(direction.lengthSqr() < 1.0E-7D) {
direction = summon.getLookAngle();
}
if(direction.lengthSqr() < 1.0E-7D) {
return new Vec3(0.0D, 0.0D, 1.0D);
}
return direction.normalize();
}
private static Vec3 steer(Vec3 currentDir, Vec3 desiredDir) {
return steer(currentDir, desiredDir, TURN_RATE);
}
private static Vec3 steer(Vec3 currentDir, Vec3 desiredDir, double turnRate) {
Vec3 steered = currentDir.scale(1.0D - turnRate).add(desiredDir.normalize().scale(turnRate));
if(steered.lengthSqr() < 1.0E-7D) return desiredDir.normalize();
return steered.normalize();
}
private static void updateRotation(StaticSummon summon, Vec3 direction) {
float[] xyRot = MathUtil.computeXYRot(direction.toVector3f());
summon.setXRot(xyRot[0]);
summon.setYRot(xyRot[1]);
summon.xRotO = xyRot[0];
summon.yRotO = xyRot[1];
}
}
@@ -8,6 +8,8 @@ import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.item.ModItems;
import com.lzxnone.terraria.particle.ModParticles;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.*;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
@@ -20,19 +22,64 @@ import org.joml.Vector3f;
import java.util.List;
public class CrystalBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 1.2f;
public static final double SPEED = 3.0D;
public static final String ID = "crystal_bullet";
public static final float BASE_DAMAGE_DEFAULT = 1.2f;
public static final double SPEED_DEFAULT = 3.0D;
public static final float FRAGMENT_DAMAGE_MUL = 0.5f;
public static final double FRAGMENT_SPEED = 1.0;
public static final int FRAGMENT_TIME = 60;
public static final int FRAGMENT_COUNT = 3;
public static final float FRAGMENT_DAMAGE_MUL_DEFAULT = 0.5f;
public static final double FRAGMENT_SPEED_DEFAULT = 1.0;
public static final int FRAGMENT_TIME_DEFAULT = 60;
public static final int FRAGMENT_COUNT_DEFAULT = 3;
public static final int PARTICLE_COUNT_DEFAULT = 5;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadFloat(ID, "fragment_damage_multiplier", FRAGMENT_DAMAGE_MUL_DEFAULT, 0.0f, 100.0f);
AmmoConfig.loadDouble(ID, "fragment_speed", FRAGMENT_SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadInt(ID, "fragment_time", FRAGMENT_TIME_DEFAULT, 0, 72000);
AmmoConfig.loadInt(ID, "fragment_count", FRAGMENT_COUNT_DEFAULT, 0, 100);
AmmoConfig.loadInt(ID, "particle_count", PARTICLE_COUNT_DEFAULT, 0, 1000);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static float getFragmentDamageMultiplier() {
return AmmoConfig.readFloat(ID, "fragment_damage_multiplier", FRAGMENT_DAMAGE_MUL_DEFAULT, 0.0f, 100.0f);
}
public static double getFragmentSpeed() {
return AmmoConfig.readDouble(ID, "fragment_speed", FRAGMENT_SPEED_DEFAULT, 0.0D, 24.0D);
}
public static int getFragmentTime() {
return AmmoConfig.readInt(ID, "fragment_time", FRAGMENT_TIME_DEFAULT, 0, 72000);
}
public static int getFragmentCount() {
return AmmoConfig.readInt(ID, "fragment_count", FRAGMENT_COUNT_DEFAULT, 0, 100);
}
public static int getParticleCount() {
return AmmoConfig.readInt(ID, "particle_count", PARTICLE_COUNT_DEFAULT, 0, 1000);
}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 motion = summon.getLookAngle().normalize().scale(SPEED);
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
if(summon.level().isClientSide()) return;
@@ -52,15 +99,15 @@ public class CrystalBullet extends BasicBulletAmmo {
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
if(DamageUtil.rangedAttack(summon, target, sourceStack, BASE_DAMAGE + damage, knockbackScale)) {
if(DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
target.invulnerableTime = invulnerableTime;
for(int i = 0;i < FRAGMENT_COUNT;i++) {
summonProjectile(summon, (BASE_DAMAGE + damage) * FRAGMENT_DAMAGE_MUL);
for(int i = 0;i < getFragmentCount();i++) {
summonProjectile(summon, (getBaseDamage() + damage) * getFragmentDamageMultiplier());
}
ParticleUtil.addParticles(
(ServerLevel) summon.level(), ModParticles.CRYSTAL_FRAGMENT_PARTICLE.get(),
summon.position(), new Vec3(0.2, 0.2, 0.2),
0.2, 5
0.2, getParticleCount()
);
this.onDied(summon);
}
@@ -71,13 +118,13 @@ public class CrystalBullet extends BasicBulletAmmo {
if(blockHitResult.getType() != HitResult.Type.MISS) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
for(int i = 0;i < FRAGMENT_COUNT;i++) {
summonProjectile(summon, (BASE_DAMAGE + damage) * FRAGMENT_DAMAGE_MUL);
for(int i = 0;i < getFragmentCount();i++) {
summonProjectile(summon, (getBaseDamage() + damage) * getFragmentDamageMultiplier());
}
ParticleUtil.addParticles(
(ServerLevel) summon.level(), ModParticles.CRYSTAL_FRAGMENT_PARTICLE.get(),
summon.position(), new Vec3(0.2, 0.2, 0.2),
0.2, 5
0.2, getParticleCount()
);
this.onDied(summon);
}
@@ -131,8 +178,8 @@ public class CrystalBullet extends BasicBulletAmmo {
projectile.getEntityData().set(StaticProjectile.SCALE_Y, 0.5f);
projectile.getEntityData().set(StaticProjectile.SCALE_Z, 0.5f);
projectile.getEntityData().set(StaticProjectile.RXPS, 10);
projectile.getEntityData().set(StaticProjectile.LIFETIME, FRAGMENT_TIME);
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", FRAGMENT_SPEED));
projectile.getEntityData().set(StaticProjectile.LIFETIME, getFragmentTime());
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", getFragmentSpeed()));
CompoundTag customData = new CompoundTag();
customData.putFloat("damage", damage);
@@ -3,6 +3,8 @@ package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.effect.ModEffects;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.FilterUtil;
@@ -19,16 +21,39 @@ import net.minecraft.world.phys.Vec3;
import java.util.List;
public class CursedBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 2.0f;
public static final double SPEED = 3.0D;
public static final int EFFECT_TIME = 140;
public static final String ID = "cursed_bullet";
public static final float BASE_DAMAGE_DEFAULT = 2.0f;
public static final double SPEED_DEFAULT = 3.0D;
public static final int EFFECT_TIME_DEFAULT = 140;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadInt(ID, "effect_time", EFFECT_TIME_DEFAULT, 0, 72000);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static int getEffectTime() {
return AmmoConfig.readInt(ID, "effect_time", EFFECT_TIME_DEFAULT, 0, 72000);
}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 motion = summon.getLookAngle().normalize().scale(SPEED);
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
if(summon.level().isClientSide()) return;
@@ -48,10 +73,10 @@ public class CursedBullet extends BasicBulletAmmo {
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
if(DamageUtil.rangedAttack(summon, target, sourceStack, BASE_DAMAGE + damage, knockbackScale)) {
if(DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
target.invulnerableTime = invulnerableTime;
if(target instanceof LivingEntity livingEntity) {
MobEffectInstance effectInstance = new MobEffectInstance(ModEffects.CURSED_INFERNO, EFFECT_TIME, 0);
MobEffectInstance effectInstance = new MobEffectInstance(ModEffects.CURSED_INFERNO, getEffectTime(), 0);
livingEntity.addEffect(effectInstance);
}
this.onDied(summon);
@@ -1,9 +1,125 @@
package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.ModSounds;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.particle.DustParticleOptions;
import com.lzxnone.terraria.particle.ModParticles;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.*;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
import java.util.List;
public class ExplodingBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 0.8f;
public static final double SPEED = 3.0D;
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
public static final String ID = "exploding_bullet";
public static final float BASE_DAMAGE_DEFAULT = 1.5f;
public static final double SPEED_DEFAULT = 3.0D;
public static final float KNOCKBACK_MULTIPLIER_DEFAULT = 2.0f;
public static final int DUST_COUNT_DEFAULT = 10;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadFloat(ID, "knockback_multiplier", KNOCKBACK_MULTIPLIER_DEFAULT, 0.0f, 100.0f);
AmmoConfig.loadInt(ID, "dust_count", DUST_COUNT_DEFAULT, 0, 1000);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static float getKnockbackMultiplier() {
return AmmoConfig.readFloat(ID, "knockback_multiplier", KNOCKBACK_MULTIPLIER_DEFAULT, 0.0f, 100.0f);
}
public static int getDustCount() {
return AmmoConfig.readInt(ID, "dust_count", DUST_COUNT_DEFAULT, 0, 1000);
}
public static final DustParticleOptions PARTICLE = new DustParticleOptions(
0.075f, 0.5f, 40, true, new Vector3f[]{
new Vector3f(1.0F, 0.8F, 0.5F),
new Vector3f(1.0F, 0.5F, 0.0F),
new Vector3f(1.0F, 0.9F, 0.0F),
}
);
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
if(summon.level().isClientSide()) return;
//碰撞检测
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
List<Entity> targets = summon.level().getEntitiesOfClass(
Entity.class,
hitBox,
FilterUtil.createTargetFilter(summon, summon.getOwner())
);
if(!targets.isEmpty()) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
if(DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale * getKnockbackMultiplier())) {
target.invulnerableTime = invulnerableTime;
SoundUtil.playServerSound(summon.level(), ModSounds.BOOM.get(), summon.position());
ParticleUtil.addParticles(
(ServerLevel) summon.level(), ModParticles.EXPLODE_PARTICLE.get(),
summon.position(), new Vec3(0, 0, 0),
0.2, 1
);
ParticleUtil.addParticles(
(ServerLevel) summon.level(), PARTICLE,
summon.position(), new Vec3(0, 0, 0),
0.2, getDustCount()
);
this.onDied(summon);
}
}
//方块检测
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
if(blockHitResult.getType() != HitResult.Type.MISS) {
SoundUtil.playServerSound(summon.level(), ModSounds.BOOM.get(), summon.position());
ParticleUtil.addParticles(
(ServerLevel) summon.level(), ModParticles.EXPLODE_PARTICLE.get(),
summon.position(), new Vec3(0, 0, 0),
0.2, 1
);
ParticleUtil.addParticles(
(ServerLevel) summon.level(), PARTICLE,
summon.position(), new Vec3(0, 0, 0),
0.2, getDustCount()
);
this.onDied(summon);
}
}
};
}
@@ -2,6 +2,8 @@ package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.FilterUtil;
@@ -16,14 +18,45 @@ import net.minecraft.world.phys.Vec3;
import java.util.List;
public class HighVelocityBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 1.5f;
public static final double SPEED = 3.5D;
public static final String ID = "high_velocity_bullet";
public static final float BASE_DAMAGE_DEFAULT = 1.5f;
public static final double SPEED_DEFAULT = 4.0D;
public static final float DAMAGE_DECAY_DEFAULT = 0.85f;
public static final int MAX_HIT_DEFAULT = 3;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadFloat(ID, "damage_decay", DAMAGE_DECAY_DEFAULT, 0.0f, 1.0f);
AmmoConfig.loadInt(ID, "max_hit", MAX_HIT_DEFAULT, 1, 100);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static float getDamageDecay() {
return AmmoConfig.readFloat(ID, "damage_decay", DAMAGE_DECAY_DEFAULT, 0.0f, 1.0f);
}
public static int getMaxHit() {
return AmmoConfig.readInt(ID, "max_hit", MAX_HIT_DEFAULT, 1, 100);
}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 motion = summon.getLookAngle().normalize().scale(SPEED);
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
if(summon.level().isClientSide()) return;
@@ -42,10 +75,16 @@ public class HighVelocityBullet extends BasicBulletAmmo {
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
if(DamageUtil.rangedAttack(summon, target, sourceStack, BASE_DAMAGE + damage, knockbackScale)) {
for(Entity target : targets) {
int hit = customData.getInt("hit");
if(DamageUtil.rangedAttack(summon, target, sourceStack, (getBaseDamage() + damage) * (float) Math.pow(getDamageDecay(), hit), knockbackScale)) {
target.invulnerableTime = invulnerableTime;
if(incrementHit(summon) >= getMaxHit()) {
this.onDied(summon);
return;
}
}
}
}
@@ -56,4 +95,12 @@ public class HighVelocityBullet extends BasicBulletAmmo {
}
}
};
private static int incrementHit(StaticSummon summon) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
int hit = customData.getInt("hit") + 1;
customData.putInt("hit", hit);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
return hit;
}
}
@@ -1,9 +1,93 @@
package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.effect.ModEffects;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.FilterUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import java.util.List;
public class IchorBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 0.8f;
public static final double SPEED = 3.0D;
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
public static final String ID = "ichor_bullet";
public static final float BASE_DAMAGE_DEFAULT = 2.25f;
public static final double SPEED_DEFAULT = 3.0D;
public static final int EFFECT_TIME_DEFAULT = 200;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadInt(ID, "effect_time", EFFECT_TIME_DEFAULT, 0, 72000);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static int getEffectTime() {
return AmmoConfig.readInt(ID, "effect_time", EFFECT_TIME_DEFAULT, 0, 72000);
}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
if(summon.level().isClientSide()) return;
//碰撞检测
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
List<Entity> targets = summon.level().getEntitiesOfClass(
Entity.class,
hitBox,
FilterUtil.createTargetFilter(summon, summon.getOwner())
);
if(!targets.isEmpty()) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
if(DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
target.invulnerableTime = invulnerableTime;
if(target instanceof LivingEntity livingEntity) {
MobEffectInstance effectInstance = new MobEffectInstance(ModEffects.ICHOR, getEffectTime(), 0);
livingEntity.addEffect(effectInstance);
}
this.onDied(summon);
}
}
//方块检测
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
if(blockHitResult.getType() != HitResult.Type.MISS) {
this.onDied(summon);
}
}
};
}
@@ -1,9 +1,91 @@
package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.FilterUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import java.util.List;
public class LuminiteBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 0.8f;
public static final double SPEED = 3.0D;
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
public static final String ID = "luminite_bullet";
public static final float BASE_DAMAGE_DEFAULT = 3.0f;
public static final double SPEED_DEFAULT = 3.5D;
public static final float DAMAGE_DECAY_DEFAULT = 0.96f;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadFloat(ID, "damage_decay", DAMAGE_DECAY_DEFAULT, 0.0f, 1.0f);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static float getDamageDecay() {
return AmmoConfig.readFloat(ID, "damage_decay", DAMAGE_DECAY_DEFAULT, 0.0f, 1.0f);
}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
if(summon.level().isClientSide()) return;
//碰撞检测
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
List<Entity> targets = summon.level().getEntitiesOfClass(
Entity.class,
hitBox,
FilterUtil.createTargetFilter(summon, summon.getOwner())
);
if(!targets.isEmpty()) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
for(Entity target : targets) {
int hit = customData.getInt("hit");
if(DamageUtil.rangedAttack(summon, target, sourceStack, (getBaseDamage() + damage) * (float) Math.pow(getDamageDecay(), hit), knockbackScale)) {
target.invulnerableTime = invulnerableTime;
hit++;
customData.putInt("hit", hit);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
}
}
}
//方块检测
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
if(blockHitResult.getType() != HitResult.Type.MISS) {
this.onDied(summon);
}
}
};
}
@@ -108,16 +108,17 @@ public class MeteorShot extends BulletAmmo {
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
if (DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
for(Entity target : targets) {
if(DamageUtil.rangedAttack(summon, target, sourceStack, (getBaseDamage() + damage), knockbackScale)) {
target.invulnerableTime = invulnerableTime;
if (MeteorShot.incrementHit(summon) >= getMaxHit()) {
if(incrementHit(summon) >= getMaxHit()) {
this.onDied(summon);
return;
}
}
}
}
}
//方块检测
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
@@ -1,9 +1,145 @@
package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.effect.ModEffects;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.FilterUtil;
import com.lzxnone.terraria.utils.MathUtil;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import java.util.List;
public class NanoBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 0.8f;
public static final double SPEED = 3.0D;
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
public static final String ID = "nano_bullet";
public static final float BASE_DAMAGE_DEFAULT = 2.5f;
public static final double SPEED_DEFAULT = 3.0D;
public static final float DAMAGE_DECAY_DEFAULT = 0.67f;
public static final int MAX_HIT_DEFAULT = 2;
public static final int EFFECT_TIME_DEFAULT = 40;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadFloat(ID, "damage_decay", DAMAGE_DECAY_DEFAULT, 0.0f, 1.0f);
AmmoConfig.loadInt(ID, "max_hit", MAX_HIT_DEFAULT, 1, 100);
AmmoConfig.loadInt(ID, "effect_time", EFFECT_TIME_DEFAULT, 0, 72000);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static float getDamageDecay() {
return AmmoConfig.readFloat(ID, "damage_decay", DAMAGE_DECAY_DEFAULT, 0.0f, 1.0f);
}
public static int getMaxHit() {
return AmmoConfig.readInt(ID, "max_hit", MAX_HIT_DEFAULT, 1, 100);
}
public static int getEffectTime() {
return AmmoConfig.readInt(ID, "effect_time", EFFECT_TIME_DEFAULT, 0, 72000);
}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
if(summon.isRemoved()) return;
double speed = getSpeed();
Vec3 motion = summon.getDeltaMovement();
if(motion.lengthSqr() < 0.0001) {
motion = summon.getLookAngle().normalize().scale(speed);
}else {
motion = motion.normalize().scale(speed);
}
summon.setDeltaMovement(motion);
//碰撞检测
if(!summon.level().isClientSide()) {
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
List<Entity> targets = summon.level().getEntitiesOfClass(
Entity.class,
hitBox,
FilterUtil.createTargetFilter(summon, summon.getOwner())
);
if(!targets.isEmpty()) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
int hit = customData.getInt("hit");
if(DamageUtil.rangedAttack(summon, target, sourceStack, hit > 0 ? (getBaseDamage() + damage) * getDamageDecay() : getBaseDamage() + damage, knockbackScale)) {
target.invulnerableTime = invulnerableTime;
if(target instanceof LivingEntity livingEntity) {
MobEffectInstance effectInstance = new MobEffectInstance(ModEffects.CONFUSED, getEffectTime(), 0);
livingEntity.addEffect(effectInstance);
}
onDied(summon);
}
}
}
//方块检测
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
if(blockHitResult.getType() != HitResult.Type.MISS) {
if(incrementHit(summon) >= getMaxHit()) {
this.onDied(summon);
return;
}
Vec3 reflectedMotion = reflect(motion, blockHitResult.getDirection()).normalize().scale(speed);
summon.setPos(blockHitResult.getLocation().add(Vec3.atLowerCornerOf(blockHitResult.getDirection().getNormal()).scale(0.05)));
summon.setDeltaMovement(reflectedMotion);
updateRotation(summon, reflectedMotion);
}
}
};
private static int incrementHit(StaticSummon summon) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
int hit = customData.getInt("hit") + 1;
customData.putInt("hit", hit);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
return hit;
}
private static Vec3 reflect(Vec3 motion, Direction hitDirection) {
Vec3 normal = Vec3.atLowerCornerOf(hitDirection.getNormal());
return motion.subtract(normal.scale(2.0D * motion.dot(normal)));
}
private static void updateRotation(StaticSummon summon, Vec3 motion) {
float[] xyRot = MathUtil.computeXYRot(MathUtil.toVector3f(motion.normalize()));
summon.setXRot(xyRot[0]);
summon.xRotO = xyRot[0];
summon.setYRot(xyRot[1]);
summon.yRotO = xyRot[1];
}
}
@@ -1,10 +1,81 @@
package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.FilterUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import java.util.List;
public class PartyBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 0.8f;
public static final double SPEED = 3.0D;
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
public static final String ID = "party_bullet";
public static final float BASE_DAMAGE_DEFAULT = 1.5f;
public static final double SPEED_DEFAULT = 3.0D;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
if(summon.level().isClientSide()) return;
//碰撞检测
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
List<Entity> targets = summon.level().getEntitiesOfClass(
Entity.class,
hitBox,
FilterUtil.createTargetFilter(summon, summon.getOwner())
);
if(!targets.isEmpty()) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
if(DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
target.invulnerableTime = invulnerableTime;
this.onDied(summon);
}
}
//方块检测
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
if(blockHitResult.getType() != HitResult.Type.MISS) {
this.onDied(summon);
}
}
};
}
@@ -1,9 +1,93 @@
package com.lzxnone.terraria.item.ammo;
import com.lzxnone.terraria.effect.ModEffects;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.FilterUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import java.util.List;
public class VenomBullet extends BasicBulletAmmo {
public static final float BASE_DAMAGE = 0.8f;
public static final double SPEED = 3.0D;
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = createSummonBehavior(BASE_DAMAGE, SPEED);
public static final String ID = "venom_bullet";
public static final float BASE_DAMAGE_DEFAULT = 2.5f;
public static final double SPEED_DEFAULT = 3.0D;
public static final int EFFECT_TIME_DEFAULT = 200;
public static final IConfigData CONFIG_DATA = new IConfigData() {
@Override
public void onConfigLoad() {
AmmoConfig.loadFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
AmmoConfig.loadDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
AmmoConfig.loadInt(ID, "effect_time", EFFECT_TIME_DEFAULT, 0, 72000);
}
};
public static final ConfigListItem CONFIG_LIST_ITEM = AmmoConfig.createListItem(ID, CONFIG_DATA);
public static float getBaseDamage() {
return AmmoConfig.readFloat(ID, "base_damage", BASE_DAMAGE_DEFAULT, 0.0f, 8388600.0f);
}
public static double getSpeed() {
return AmmoConfig.readDouble(ID, "speed", SPEED_DEFAULT, 0.0D, 24.0D);
}
public static int getEffectTime() {
return AmmoConfig.readInt(ID, "effect_time", EFFECT_TIME_DEFAULT, 0, 72000);
}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
Vec3 motion = summon.getLookAngle().normalize().scale(getSpeed());
summon.setDeltaMovement(motion);
if(summon.level().isClientSide()) return;
//碰撞检测
AABB hitBox = new AABB(summon.position(), summon.position().add(motion)).inflate(0.25);
List<Entity> targets = summon.level().getEntitiesOfClass(
Entity.class,
hitBox,
FilterUtil.createTargetFilter(summon, summon.getOwner())
);
if(!targets.isEmpty()) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
float damage = customData.contains("damage") ? customData.getFloat("damage") : 0;
float knockbackScale = customData.contains("knockbackScale") ? customData.getFloat("knockbackScale") : 1.0f;
int invulnerableTime = customData.contains("invulnerableTime") ? customData.getInt("invulnerableTime") : 20;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
Entity target = targets.getFirst();
if(DamageUtil.rangedAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
target.invulnerableTime = invulnerableTime;
if(target instanceof LivingEntity livingEntity) {
MobEffectInstance effectInstance = new MobEffectInstance(ModEffects.ACID_VENOM, getEffectTime(), 0);
livingEntity.addEffect(effectInstance);
}
this.onDied(summon);
}
}
//方块检测
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
if(blockHitResult.getType() != HitResult.Type.MISS) {
this.onDied(summon);
}
}
};
}
@@ -5,9 +5,12 @@ import net.minecraft.client.Camera;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.util.Mth;
import org.joml.Quaternionf;
import org.joml.Vector3f;
public class DustParticle extends EmissiveBloomParticle {
public class DustParticle extends TextureSheetParticle {
private final SpriteSet sprites;
private final float rotSpeed;
@@ -82,19 +85,70 @@ public class DustParticle extends EmissiveBloomParticle {
this.rCol = coloredR;
this.gCol = coloredG;
this.bCol = coloredB;
super.render(buffer, camera, partialTick);
renderCurrentSprite(buffer, camera, partialTick);
this.setSprite(this.sprites.get(1, 1));
this.rCol = 1.0F;
this.gCol = 1.0F;
this.bCol = 1.0F;
super.render(buffer, camera, partialTick);
renderCurrentSprite(buffer, camera, partialTick);
this.rCol = coloredR;
this.gCol = coloredG;
this.bCol = coloredB;
}
private void renderCurrentSprite(VertexConsumer buffer, Camera camera, float partialTick) {
if(glow) {
renderEmissiveBloom(buffer, camera, partialTick);
}else {
super.render(buffer, camera, partialTick);
}
}
private void renderEmissiveBloom(VertexConsumer buffer, Camera camera, float partialTick) {
float x = (float)(Mth.lerp(partialTick, this.xo, this.x) - camera.getPosition().x);
float y = (float)(Mth.lerp(partialTick, this.yo, this.y) - camera.getPosition().y);
float z = (float)(Mth.lerp(partialTick, this.zo, this.z) - camera.getPosition().z);
Quaternionf quaternion = new Quaternionf(camera.rotation());
quaternion.rotateZ(Mth.lerp(partialTick, this.oRoll, this.roll));
float size = this.quadSize;
float u0 = this.getU0();
float u1 = this.getU1();
float v0 = this.getV0();
float v1 = this.getV1();
float[][] uvs = {
{u1, v1},
{u1, v0},
{u0, v0},
{u0, v1}
};
Vector3f[] corners = {
new Vector3f(1.0F, -1.0F, 0.0F),
new Vector3f(1.0F, 1.0F, 0.0F),
new Vector3f(-1.0F, 1.0F, 0.0F),
new Vector3f(-1.0F, -1.0F, 0.0F)
};
for(int i = 0; i < 4; i++) {
Vector3f vertex = corners[i];
vertex.rotate(quaternion);
vertex.mul(size);
vertex.add(x, y, z);
buffer.addVertex(vertex.x(), vertex.y(), vertex.z())
.setColor(this.rCol, this.gCol, this.bCol, this.alpha)
.setUv(uvs[i][0], uvs[i][1])
.setOverlay(OverlayTexture.NO_OVERLAY)
.setLight(LightTexture.FULL_BRIGHT)
.setNormal(0.0F, 0.0F, 1.0F);
}
}
@Override
public int getLightColor(float partialTick) {
return glow ? LightTexture.FULL_BRIGHT : super.getLightColor(partialTick);
@@ -102,7 +156,7 @@ public class DustParticle extends EmissiveBloomParticle {
@Override
public ParticleRenderType getRenderType() {
return ModParticleRenderTypes.EMISSIVE_BLOOM;
return glow ? ModParticleRenderTypes.EMISSIVE_BLOOM : ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
}
public static class Provider implements ParticleProvider<DustParticleOptions> {
@@ -1,16 +1,14 @@
package com.lzxnone.terraria.ui.config;
import com.lzxnone.terraria.effect.BloodButcheredEffect;
import com.lzxnone.terraria.effect.AcidVenomEffect;
import com.lzxnone.terraria.effect.CursedInfernoEffect;
import com.lzxnone.terraria.effect.DemonicFlamesEffect;
import com.lzxnone.terraria.effect.IchorEffect;
import com.lzxnone.terraria.effect.MidasEffect;
import com.lzxnone.terraria.effect.SummonEffect;
import com.lzxnone.terraria.enchantment.ModEnchantmentConfigs;
import com.lzxnone.terraria.item.ammo.MeteorShot;
import com.lzxnone.terraria.item.ammo.MusketBall;
import com.lzxnone.terraria.item.ammo.GoldenBullet;
import com.lzxnone.terraria.item.ammo.SilverBullet;
import com.lzxnone.terraria.item.ammo.TungstenBullet;
import com.lzxnone.terraria.item.ammo.*;
import com.lzxnone.terraria.item.weapon.magic.LastPrism;
import com.lzxnone.terraria.item.weapon.melee.BeeKeeper;
import com.lzxnone.terraria.item.weapon.melee.BladeOfGrass;
@@ -82,6 +80,8 @@ public class ConfigList {
BloodButcheredEffect.CONFIG_LIST_ITEM,
DemonicFlamesEffect.CONFIG_LIST_ITEM,
CursedInfernoEffect.CONFIG_LIST_ITEM,
IchorEffect.CONFIG_LIST_ITEM,
AcidVenomEffect.CONFIG_LIST_ITEM,
MidasEffect.CONFIG_LIST_ITEM,
SummonEffect.CONFIG_LIST_ITEM
});
@@ -89,7 +89,17 @@ public class ConfigList {
MusketBall.CONFIG_LIST_ITEM,
MeteorShot.CONFIG_LIST_ITEM,
SilverBullet.CONFIG_LIST_ITEM,
CrystalBullet.CONFIG_LIST_ITEM,
CursedBullet.CONFIG_LIST_ITEM,
ChlorophyteBullet.CONFIG_LIST_ITEM,
HighVelocityBullet.CONFIG_LIST_ITEM,
IchorBullet.CONFIG_LIST_ITEM,
VenomBullet.CONFIG_LIST_ITEM,
PartyBullet.CONFIG_LIST_ITEM,
NanoBullet.CONFIG_LIST_ITEM,
ExplodingBullet.CONFIG_LIST_ITEM,
GoldenBullet.CONFIG_LIST_ITEM,
LuminiteBullet.CONFIG_LIST_ITEM,
TungstenBullet.CONFIG_LIST_ITEM
});
ITEMS.put(ENCHANTMENT, new ConfigListItem[]{
@@ -115,6 +115,7 @@ public class AmmoUtil {
summon.getEntityData().set(StaticSummon.SCALE_X, 1.0f);
summon.getEntityData().set(StaticSummon.SCALE_Y, 0.05f);
summon.getEntityData().set(StaticSummon.SCALE_Z, 0.01f);
summon.getEntityData().set(StaticSummon.GLOW, true);
summon.setNoGravity(true);
}
@@ -125,6 +126,9 @@ public class AmmoUtil {
summon.getEntityData().set(StaticSummon.SCALE_X, 1.0f);
summon.getEntityData().set(StaticSummon.SCALE_Y, 0.05f);
summon.getEntityData().set(StaticSummon.SCALE_Z, 0.01f);
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putInt("hit", 0);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
summon.setNoGravity(true);
}
@@ -135,6 +139,7 @@ public class AmmoUtil {
summon.getEntityData().set(StaticSummon.SCALE_X, 1.0f);
summon.getEntityData().set(StaticSummon.SCALE_Y, 0.05f);
summon.getEntityData().set(StaticSummon.SCALE_Z, 0.01f);
summon.getEntityData().set(StaticSummon.GLOW, true);
summon.setNoGravity(true);
}
@@ -165,6 +170,10 @@ public class AmmoUtil {
summon.getEntityData().set(StaticSummon.SCALE_X, 1.0f);
summon.getEntityData().set(StaticSummon.SCALE_Y, 0.05f);
summon.getEntityData().set(StaticSummon.SCALE_Z, 0.01f);
summon.getEntityData().set(StaticSummon.GLOW, true);
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putInt("hit", 0);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
summon.setNoGravity(true);
}
@@ -195,6 +204,10 @@ public class AmmoUtil {
summon.getEntityData().set(StaticSummon.SCALE_X, 1.0f);
summon.getEntityData().set(StaticSummon.SCALE_Y, 0.05f);
summon.getEntityData().set(StaticSummon.SCALE_Z, 0.01f);
summon.getEntityData().set(StaticSummon.GLOW, true);
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putInt("hit", 0);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
summon.setNoGravity(true);
}
@@ -1,6 +1,8 @@
package com.lzxnone.terraria.utils;
import com.lzxnone.terraria.damage.ModDamageTypes;
import com.lzxnone.terraria.effect.IchorEffect;
import com.lzxnone.terraria.effect.ModEffects;
import com.lzxnone.terraria.enchantment.ModEnchantmentConfigs;
import com.lzxnone.terraria.enchantment.ModEnchantments;
import com.lzxnone.terraria.entity.beam.SwordBeam;
@@ -84,6 +86,9 @@ public class DamageUtil {
}else if(category == DamageCategory.RANGED && !itemSource.isEmpty()) {
finalDamage = applyRangedDamageBonus(itemSource, player, finalDamage);
}
if(category != DamageCategory.REAL) {
finalDamage = applyTargetDamageEffects(target, finalDamage);
}
finalDamage = Math.max(0.0F, finalDamage);
Vec3 beforeHurtMovement = target instanceof LivingEntity livingTarget ? livingTarget.getDeltaMovement() : Vec3.ZERO;
@@ -138,6 +143,17 @@ public class DamageUtil {
return (float)Math.max(0.0D, finalDamage);
}
private static float applyTargetDamageEffects(Entity target, float damage) {
if(!(target instanceof LivingEntity livingTarget)) return damage;
float finalDamage = damage;
if(livingTarget.hasEffect(ModEffects.ICHOR) && livingTarget.getEffect(ModEffects.ICHOR) != null) {
int amplifier = Objects.requireNonNull(livingTarget.getEffect(ModEffects.ICHOR)).getAmplifier();
finalDamage *= 1.0f + IchorEffect.getDamageBonusPerLevel() * (amplifier + 1);
}
return Math.max(0.0F, finalDamage);
}
private static int getEnchantmentLevel(LivingEntity entity, ItemStack stack, ResourceKey<Enchantment> enchantment) {
return entity.registryAccess()
.lookupOrThrow(Registries.ENCHANTMENT)
@@ -32,6 +32,7 @@
"item.lzxnoneterraria.mace": "Mace",
"item.lzxnoneterraria.devils_devastation": "Devil's Devastation",
"item.lzxnoneterraria.last_prism": "Last Prism",
"item.lzxnoneterraria.terraprisma": "Terraprisma",
"item.lzxnoneterraria.sdmg": "S.D.M.G.",
"item.lzxnoneterraria.musket_ball": "Musket Ball",
"item.lzxnoneterraria.meteor_shot": "Meteor Shot",
@@ -49,21 +50,6 @@
"item.lzxnoneterraria.endless_musket_pouch": "Endless Musket Pouch",
"item.lzxnoneterraria.luminite_bullet": "Luminite Bullet",
"item.lzxnoneterraria.tungsten_bullet": "Tungsten Bullet",
"item.lzxnoneterraria.silver_bullet_projectile": "Silver Bullet Projectile",
"item.lzxnoneterraria.crystal_bullet_projectile": "Crystal Bullet Projectile",
"item.lzxnoneterraria.cursed_bullet_projectile": "Cursed Bullet Projectile",
"item.lzxnoneterraria.chlorophyte_bullet_projectile": "Chlorophyte Bullet Projectile",
"item.lzxnoneterraria.high_velocity_bullet_projectile": "High Velocity Bullet Projectile",
"item.lzxnoneterraria.ichor_bullet_projectile": "Ichor Bullet Projectile",
"item.lzxnoneterraria.venom_bullet_projectile": "Venom Bullet Projectile",
"item.lzxnoneterraria.party_bullet_projectile": "Party Bullet Projectile",
"item.lzxnoneterraria.nano_bullet_projectile": "Nano Bullet Projectile",
"item.lzxnoneterraria.exploding_bullet_projectile": "Exploding Bullet Projectile",
"item.lzxnoneterraria.golden_bullet_projectile": "Golden Bullet Projectile",
"item.lzxnoneterraria.endless_musket_pouch_projectile": "Endless Musket Pouch Projectile",
"item.lzxnoneterraria.luminite_bullet_projectile": "Luminite Bullet Projectile",
"item.lzxnoneterraria.tungsten_bullet_projectile": "Tungsten Bullet Projectile",
"item.lzxnoneterraria.terraprisma": "Terraprisma",
"enchantment.lzxnoneterraria.mana_leak": "Mana Leak",
"enchantment.lzxnoneterraria.mana_efficiency": "Mana Efficiency",
@@ -99,6 +85,8 @@
"effect.lzxnoneterraria.kill_mode_cooldown": "Kill Mode Cooldown",
"effect.lzxnoneterraria.demonic_flames": "Demonic Flames",
"effect.lzxnoneterraria.cursed_inferno": "Cursed Inferno",
"effect.lzxnoneterraria.ichor": "Ichor",
"effect.lzxnoneterraria.acid_venom": "Acid Venom",
"effect.lzxnoneterraria.midas": "Midas",
"effect.lzxnoneterraria.summon": "Summon",
"item.minecraft.potion.effect.summon": "Potion of Summon",
@@ -151,6 +139,12 @@
"lzxnoneterraria.configuration.cursed_inferno_settings": "Cursed Inferno Settings",
"lzxnoneterraria.configuration.cursed_inferno_damage_per_level": "Damage Per Level",
"lzxnoneterraria.configuration.cursed_inferno_damage_per_level.tooltip": "Cursed Inferno checks damage once per second; damage dealt per effect level",
"lzxnoneterraria.configuration.ichor_settings": "Ichor Settings",
"lzxnoneterraria.configuration.ichor_damage_bonus_per_level": "Damage Bonus Per Level",
"lzxnoneterraria.configuration.ichor_damage_bonus_per_level.tooltip": "Extra damage taken per Ichor level on the target; default 0.15 means 15%",
"lzxnoneterraria.configuration.acid_venom_settings": "Acid Venom Settings",
"lzxnoneterraria.configuration.acid_venom_damage_per_level": "Damage Per Level",
"lzxnoneterraria.configuration.acid_venom_damage_per_level.tooltip": "Acid Venom checks damage once per second; damage dealt per effect level",
"lzxnoneterraria.configuration.midas_settings": "Midas Settings",
"lzxnoneterraria.configuration.midas_drop_chance": "Emerald Drop Chance",
"lzxnoneterraria.configuration.midas_drop_chance.tooltip": "Chance for an entity with Midas to drop one emerald on death, from 0 to 1",
@@ -448,6 +442,83 @@
"lzxnoneterraria.configuration.meteor_shot_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.meteor_shot_max_hit": "Max Hit Count",
"lzxnoneterraria.configuration.meteor_shot_max_hit.tooltip": "Block collisions and entity hits both count toward this limit",
"lzxnoneterraria.configuration.crystal_bullet_settings": "Crystal Bullet Settings",
"lzxnoneterraria.configuration.crystal_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.crystal_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.crystal_bullet_speed": "Speed",
"lzxnoneterraria.configuration.crystal_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.crystal_bullet_fragment_damage_multiplier": "Fragment Damage Multiplier",
"lzxnoneterraria.configuration.crystal_bullet_fragment_damage_multiplier.tooltip": "Damage multiplier inherited by crystal fragments from the main bullet",
"lzxnoneterraria.configuration.crystal_bullet_fragment_speed": "Fragment Speed",
"lzxnoneterraria.configuration.crystal_bullet_fragment_speed.tooltip": "Crystal fragment movement speed per tick",
"lzxnoneterraria.configuration.crystal_bullet_fragment_time": "Fragment Lifetime",
"lzxnoneterraria.configuration.crystal_bullet_fragment_time.tooltip": "Crystal fragment lifetime in ticks",
"lzxnoneterraria.configuration.crystal_bullet_fragment_count": "Fragment Count",
"lzxnoneterraria.configuration.crystal_bullet_fragment_count.tooltip": "Number of crystal fragments spawned after a hit or collision",
"lzxnoneterraria.configuration.crystal_bullet_particle_count": "Particle Count",
"lzxnoneterraria.configuration.crystal_bullet_particle_count.tooltip": "Number of crystal particles spawned after a hit or collision",
"lzxnoneterraria.configuration.cursed_bullet_settings": "Cursed Bullet Settings",
"lzxnoneterraria.configuration.cursed_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.cursed_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.cursed_bullet_speed": "Speed",
"lzxnoneterraria.configuration.cursed_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.cursed_bullet_effect_time": "Effect Duration",
"lzxnoneterraria.configuration.cursed_bullet_effect_time.tooltip": "Duration of the effect applied on hit, in ticks",
"lzxnoneterraria.configuration.chlorophyte_bullet_settings": "Chlorophyte Bullet Settings",
"lzxnoneterraria.configuration.chlorophyte_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.chlorophyte_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.chlorophyte_bullet_speed": "Speed",
"lzxnoneterraria.configuration.chlorophyte_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.chlorophyte_bullet_target_range": "Target Range",
"lzxnoneterraria.configuration.chlorophyte_bullet_target_range.tooltip": "Maximum range for automatic target seeking",
"lzxnoneterraria.configuration.high_velocity_bullet_settings": "High Velocity Bullet Settings",
"lzxnoneterraria.configuration.high_velocity_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.high_velocity_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.high_velocity_bullet_speed": "Speed",
"lzxnoneterraria.configuration.high_velocity_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.high_velocity_bullet_damage_decay": "Damage Decay Multiplier",
"lzxnoneterraria.configuration.high_velocity_bullet_damage_decay.tooltip": "Damage multiplier after each extra hit",
"lzxnoneterraria.configuration.high_velocity_bullet_max_hit": "Max Hit Count",
"lzxnoneterraria.configuration.high_velocity_bullet_max_hit.tooltip": "Maximum number of entity hits or collisions",
"lzxnoneterraria.configuration.ichor_bullet_settings": "Ichor Bullet Settings",
"lzxnoneterraria.configuration.ichor_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.ichor_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.ichor_bullet_speed": "Speed",
"lzxnoneterraria.configuration.ichor_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.ichor_bullet_effect_time": "Effect Duration",
"lzxnoneterraria.configuration.ichor_bullet_effect_time.tooltip": "Duration of the effect applied on hit, in ticks",
"lzxnoneterraria.configuration.venom_bullet_settings": "Venom Bullet Settings",
"lzxnoneterraria.configuration.venom_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.venom_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.venom_bullet_speed": "Speed",
"lzxnoneterraria.configuration.venom_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.venom_bullet_effect_time": "Effect Duration",
"lzxnoneterraria.configuration.venom_bullet_effect_time.tooltip": "Duration of the effect applied on hit, in ticks",
"lzxnoneterraria.configuration.party_bullet_settings": "Party Bullet Settings",
"lzxnoneterraria.configuration.party_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.party_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.party_bullet_speed": "Speed",
"lzxnoneterraria.configuration.party_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.nano_bullet_settings": "Nano Bullet Settings",
"lzxnoneterraria.configuration.nano_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.nano_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.nano_bullet_speed": "Speed",
"lzxnoneterraria.configuration.nano_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.nano_bullet_damage_decay": "Damage Decay Multiplier",
"lzxnoneterraria.configuration.nano_bullet_damage_decay.tooltip": "Damage multiplier after each extra hit",
"lzxnoneterraria.configuration.nano_bullet_max_hit": "Max Hit Count",
"lzxnoneterraria.configuration.nano_bullet_max_hit.tooltip": "Maximum number of entity hits or collisions",
"lzxnoneterraria.configuration.nano_bullet_effect_time": "Effect Duration",
"lzxnoneterraria.configuration.nano_bullet_effect_time.tooltip": "Duration of the effect applied on hit, in ticks",
"lzxnoneterraria.configuration.exploding_bullet_settings": "Exploding Bullet Settings",
"lzxnoneterraria.configuration.exploding_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.exploding_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.exploding_bullet_speed": "Speed",
"lzxnoneterraria.configuration.exploding_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.exploding_bullet_knockback_multiplier": "Knockback Multiplier",
"lzxnoneterraria.configuration.exploding_bullet_knockback_multiplier.tooltip": "Multiplier applied to knockback strength on hit",
"lzxnoneterraria.configuration.exploding_bullet_dust_count": "Explosion Dust Count",
"lzxnoneterraria.configuration.exploding_bullet_dust_count.tooltip": "Number of dust particles spawned by the explosion",
"lzxnoneterraria.configuration.silver_bullet_settings": "Silver Bullet Settings",
"lzxnoneterraria.configuration.silver_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.silver_bullet_base_damage.tooltip": "Base damage provided by the ammo",
@@ -467,6 +538,13 @@
"lzxnoneterraria.configuration.tungsten_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.tungsten_bullet_speed": "Speed",
"lzxnoneterraria.configuration.tungsten_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.luminite_bullet_settings": "Luminite Bullet Settings",
"lzxnoneterraria.configuration.luminite_bullet_base_damage": "Base Damage",
"lzxnoneterraria.configuration.luminite_bullet_base_damage.tooltip": "Base damage provided by the ammo",
"lzxnoneterraria.configuration.luminite_bullet_speed": "Speed",
"lzxnoneterraria.configuration.luminite_bullet_speed.tooltip": "Ammo movement speed per tick",
"lzxnoneterraria.configuration.luminite_bullet_damage_decay": "Damage Decay Multiplier",
"lzxnoneterraria.configuration.luminite_bullet_damage_decay.tooltip": "Damage multiplier after each extra hit",
"lzxnoneterraria.configuration.sdmg_settings": "S.D.M.G. Settings",
"lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance": "Ammo Not Consume Chance",
"lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance.tooltip": "Chance for each shot to avoid consuming ammo, from 0 to 1",
@@ -32,6 +32,7 @@
"item.lzxnoneterraria.mace": "链锤",
"item.lzxnoneterraria.devils_devastation": "破灭魔王剑",
"item.lzxnoneterraria.last_prism": "终极棱镜",
"item.lzxnoneterraria.terraprisma": "泰拉棱镜",
"item.lzxnoneterraria.sdmg": "S.D.M.G.",
"item.lzxnoneterraria.musket_ball": "火枪子弹",
"item.lzxnoneterraria.meteor_shot": "流星弹",
@@ -49,21 +50,6 @@
"item.lzxnoneterraria.endless_musket_pouch": "无尽火枪袋",
"item.lzxnoneterraria.luminite_bullet": "夜明弹",
"item.lzxnoneterraria.tungsten_bullet": "钨子弹",
"item.lzxnoneterraria.silver_bullet_projectile": "银子弹弹射物",
"item.lzxnoneterraria.crystal_bullet_projectile": "水晶子弹弹射物",
"item.lzxnoneterraria.cursed_bullet_projectile": "诅咒弹弹射物",
"item.lzxnoneterraria.chlorophyte_bullet_projectile": "叶绿弹弹射物",
"item.lzxnoneterraria.high_velocity_bullet_projectile": "高速子弹弹射物",
"item.lzxnoneterraria.ichor_bullet_projectile": "灵液弹弹射物",
"item.lzxnoneterraria.venom_bullet_projectile": "毒液弹弹射物",
"item.lzxnoneterraria.party_bullet_projectile": "派对弹弹射物",
"item.lzxnoneterraria.nano_bullet_projectile": "纳米弹弹射物",
"item.lzxnoneterraria.exploding_bullet_projectile": "爆破弹弹射物",
"item.lzxnoneterraria.golden_bullet_projectile": "金子弹弹射物",
"item.lzxnoneterraria.endless_musket_pouch_projectile": "无尽火枪袋弹射物",
"item.lzxnoneterraria.luminite_bullet_projectile": "夜明弹弹射物",
"item.lzxnoneterraria.tungsten_bullet_projectile": "钨子弹弹射物",
"item.lzxnoneterraria.terraprisma": "泰拉棱镜",
"enchantment.lzxnoneterraria.mana_leak": "魔力泄漏",
"enchantment.lzxnoneterraria.mana_efficiency": "魔力效率",
@@ -98,6 +84,8 @@
"effect.lzxnoneterraria.kill_mode_cooldown": "杀戮模式 冷却",
"effect.lzxnoneterraria.demonic_flames": "恶魔之焰",
"effect.lzxnoneterraria.cursed_inferno": "诅咒狱火",
"effect.lzxnoneterraria.ichor": "灵液",
"effect.lzxnoneterraria.acid_venom": "酸性毒液",
"effect.lzxnoneterraria.midas": "迈达斯",
"effect.lzxnoneterraria.summon": "召唤",
"item.minecraft.potion.effect.summon": "召唤药水",
@@ -150,6 +138,12 @@
"lzxnoneterraria.configuration.cursed_inferno_settings": "诅咒狱火 设置",
"lzxnoneterraria.configuration.cursed_inferno_damage_per_level": "每级伤害",
"lzxnoneterraria.configuration.cursed_inferno_damage_per_level.tooltip": "诅咒狱火每秒进行一次伤害判定,每级造成的伤害",
"lzxnoneterraria.configuration.ichor_settings": "灵液 设置",
"lzxnoneterraria.configuration.ichor_damage_bonus_per_level": "每级增伤",
"lzxnoneterraria.configuration.ichor_damage_bonus_per_level.tooltip": "目标拥有灵液效果时,每级额外受到的伤害比例,默认 0.15 表示 15%",
"lzxnoneterraria.configuration.acid_venom_settings": "酸性毒液 设置",
"lzxnoneterraria.configuration.acid_venom_damage_per_level": "每级伤害",
"lzxnoneterraria.configuration.acid_venom_damage_per_level.tooltip": "酸性毒液每秒进行一次伤害判定,每级造成的伤害",
"lzxnoneterraria.configuration.midas_settings": "迈达斯 设置",
"lzxnoneterraria.configuration.midas_drop_chance": "绿宝石掉落概率",
"lzxnoneterraria.configuration.midas_drop_chance.tooltip": "拥有迈达斯效果的生物死亡时掉落一颗绿宝石的概率,范围 0~1",
@@ -447,6 +441,83 @@
"lzxnoneterraria.configuration.meteor_shot_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.meteor_shot_max_hit": "最大命中数",
"lzxnoneterraria.configuration.meteor_shot_max_hit.tooltip": "碰撞方块和击中生物都会计入命中次数",
"lzxnoneterraria.configuration.crystal_bullet_settings": "水晶子弹 设置",
"lzxnoneterraria.configuration.crystal_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.crystal_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.crystal_bullet_speed": "速度",
"lzxnoneterraria.configuration.crystal_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.crystal_bullet_fragment_damage_multiplier": "碎片伤害倍率",
"lzxnoneterraria.configuration.crystal_bullet_fragment_damage_multiplier.tooltip": "水晶碎片继承主弹伤害的倍率",
"lzxnoneterraria.configuration.crystal_bullet_fragment_speed": "碎片速度",
"lzxnoneterraria.configuration.crystal_bullet_fragment_speed.tooltip": "水晶碎片每刻移动速度",
"lzxnoneterraria.configuration.crystal_bullet_fragment_time": "碎片持续时间",
"lzxnoneterraria.configuration.crystal_bullet_fragment_time.tooltip": "水晶碎片存在时间(刻)",
"lzxnoneterraria.configuration.crystal_bullet_fragment_count": "碎片数量",
"lzxnoneterraria.configuration.crystal_bullet_fragment_count.tooltip": "命中或碰撞后生成的水晶碎片数量",
"lzxnoneterraria.configuration.crystal_bullet_particle_count": "粒子数量",
"lzxnoneterraria.configuration.crystal_bullet_particle_count.tooltip": "命中或碰撞后生成的水晶碎片粒子数量",
"lzxnoneterraria.configuration.cursed_bullet_settings": "诅咒弹 设置",
"lzxnoneterraria.configuration.cursed_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.cursed_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.cursed_bullet_speed": "速度",
"lzxnoneterraria.configuration.cursed_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.cursed_bullet_effect_time": "效果持续时间",
"lzxnoneterraria.configuration.cursed_bullet_effect_time.tooltip": "命中后施加效果的持续时间(刻)",
"lzxnoneterraria.configuration.chlorophyte_bullet_settings": "叶绿弹 设置",
"lzxnoneterraria.configuration.chlorophyte_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.chlorophyte_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.chlorophyte_bullet_speed": "速度",
"lzxnoneterraria.configuration.chlorophyte_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.chlorophyte_bullet_target_range": "寻敌范围",
"lzxnoneterraria.configuration.chlorophyte_bullet_target_range.tooltip": "自动寻敌的最大范围",
"lzxnoneterraria.configuration.high_velocity_bullet_settings": "高速子弹 设置",
"lzxnoneterraria.configuration.high_velocity_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.high_velocity_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.high_velocity_bullet_speed": "速度",
"lzxnoneterraria.configuration.high_velocity_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.high_velocity_bullet_damage_decay": "伤害衰减倍率",
"lzxnoneterraria.configuration.high_velocity_bullet_damage_decay.tooltip": "每次额外命中后的伤害倍率",
"lzxnoneterraria.configuration.high_velocity_bullet_max_hit": "最大命中数",
"lzxnoneterraria.configuration.high_velocity_bullet_max_hit.tooltip": "最多命中的生物或碰撞次数",
"lzxnoneterraria.configuration.ichor_bullet_settings": "灵液弹 设置",
"lzxnoneterraria.configuration.ichor_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.ichor_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.ichor_bullet_speed": "速度",
"lzxnoneterraria.configuration.ichor_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.ichor_bullet_effect_time": "效果持续时间",
"lzxnoneterraria.configuration.ichor_bullet_effect_time.tooltip": "命中后施加效果的持续时间(刻)",
"lzxnoneterraria.configuration.venom_bullet_settings": "毒液弹 设置",
"lzxnoneterraria.configuration.venom_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.venom_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.venom_bullet_speed": "速度",
"lzxnoneterraria.configuration.venom_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.venom_bullet_effect_time": "效果持续时间",
"lzxnoneterraria.configuration.venom_bullet_effect_time.tooltip": "命中后施加效果的持续时间(刻)",
"lzxnoneterraria.configuration.party_bullet_settings": "派对弹 设置",
"lzxnoneterraria.configuration.party_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.party_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.party_bullet_speed": "速度",
"lzxnoneterraria.configuration.party_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.nano_bullet_settings": "纳米弹 设置",
"lzxnoneterraria.configuration.nano_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.nano_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.nano_bullet_speed": "速度",
"lzxnoneterraria.configuration.nano_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.nano_bullet_damage_decay": "伤害衰减倍率",
"lzxnoneterraria.configuration.nano_bullet_damage_decay.tooltip": "每次额外命中后的伤害倍率",
"lzxnoneterraria.configuration.nano_bullet_max_hit": "最大命中数",
"lzxnoneterraria.configuration.nano_bullet_max_hit.tooltip": "最多命中的生物或碰撞次数",
"lzxnoneterraria.configuration.nano_bullet_effect_time": "效果持续时间",
"lzxnoneterraria.configuration.nano_bullet_effect_time.tooltip": "命中后施加效果的持续时间(刻)",
"lzxnoneterraria.configuration.exploding_bullet_settings": "爆破弹 设置",
"lzxnoneterraria.configuration.exploding_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.exploding_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.exploding_bullet_speed": "速度",
"lzxnoneterraria.configuration.exploding_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.exploding_bullet_knockback_multiplier": "击退倍率",
"lzxnoneterraria.configuration.exploding_bullet_knockback_multiplier.tooltip": "爆破弹命中时对击退强度的倍率",
"lzxnoneterraria.configuration.exploding_bullet_dust_count": "爆炸尘埃数量",
"lzxnoneterraria.configuration.exploding_bullet_dust_count.tooltip": "爆炸时生成的尘埃粒子数量",
"lzxnoneterraria.configuration.silver_bullet_settings": "银子弹 设置",
"lzxnoneterraria.configuration.silver_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.silver_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
@@ -466,6 +537,13 @@
"lzxnoneterraria.configuration.tungsten_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.tungsten_bullet_speed": "速度",
"lzxnoneterraria.configuration.tungsten_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.luminite_bullet_settings": "夜明弹 设置",
"lzxnoneterraria.configuration.luminite_bullet_base_damage": "基础伤害",
"lzxnoneterraria.configuration.luminite_bullet_base_damage.tooltip": "子弹自身提供的基础伤害",
"lzxnoneterraria.configuration.luminite_bullet_speed": "速度",
"lzxnoneterraria.configuration.luminite_bullet_speed.tooltip": "子弹每刻移动速度",
"lzxnoneterraria.configuration.luminite_bullet_damage_decay": "伤害衰减倍率",
"lzxnoneterraria.configuration.luminite_bullet_damage_decay.tooltip": "每次额外命中后的伤害倍率",
"lzxnoneterraria.configuration.sdmg_settings": "S.D.M.G. 设置",
"lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance": "不消耗弹药概率",
"lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance.tooltip": "每次射击不消耗弹药的概率,范围 0~1",
Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B