This commit is contained in:
LZX committed 2026-07-28 23:14:26 +08:00
1 parent 3dbe97dd60
commit 87428f10b7
50 files changed
+725 -15

No files matched your search

@@ -71,6 +71,14 @@ public class ModSounds {
SOUND_EVENTS.register("shot6", SOUND_EVENTS.register("shot6",
() -> SoundEvent.createVariableRangeEvent( () -> SoundEvent.createVariableRangeEvent(
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "shot6"))); ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "shot6")));
public static final Supplier<SoundEvent> SHOT7 =
SOUND_EVENTS.register("shot7",
() -> SoundEvent.createVariableRangeEvent(
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "shot7")));
public static final Supplier<SoundEvent> SHOT8 =
SOUND_EVENTS.register("shot8",
() -> SoundEvent.createVariableRangeEvent(
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "shot8")));
public static final Supplier<SoundEvent> BOOM = public static final Supplier<SoundEvent> BOOM =
SOUND_EVENTS.register("boom", SOUND_EVENTS.register("boom",
() -> SoundEvent.createVariableRangeEvent( () -> SoundEvent.createVariableRangeEvent(
@@ -70,6 +70,14 @@ public class ModCreativeModeTabs {
output.accept(ModItems.HANDGUN.get()); output.accept(ModItems.HANDGUN.get());
output.accept(ModItems.PHOENIX_BLASTER.get()); output.accept(ModItems.PHOENIX_BLASTER.get());
output.accept(ModItems.MEGASHARK.get()); output.accept(ModItems.MEGASHARK.get());
output.accept(ModItems.CLOCKWORK_ASSAULT_RIFLE.get());
output.accept(ModItems.GATLIGATOR.get());
output.accept(ModItems.SHOTGUN.get());
output.accept(ModItems.UZI.get());
output.accept(ModItems.VENUS_MAGNUM.get());
output.accept(ModItems.TACTICAL_SHOTGUN.get());
output.accept(ModItems.SNIPER_RIFLE.get());
output.accept(ModItems.CHAIN_GUN.get());
output.accept(ModItems.SDMG.get()); output.accept(ModItems.SDMG.get());
output.accept(ModItems.MUSKET_BALL.get()); output.accept(ModItems.MUSKET_BALL.get());
output.accept(ModItems.METEOR_SHOT.get()); output.accept(ModItems.METEOR_SHOT.get());
@@ -57,6 +57,11 @@ public class ModEnchantmentConfigs {
public static final double GUNPOWDER_DAMAGE_MULTIPLIER_MIN = 0.0D; public static final double GUNPOWDER_DAMAGE_MULTIPLIER_MIN = 0.0D;
public static final double GUNPOWDER_DAMAGE_MULTIPLIER_MAX = 10.0D; public static final double GUNPOWDER_DAMAGE_MULTIPLIER_MAX = 10.0D;
public static final String STEADY_BREATH_SPREAD_MULTIPLIER_PATH = "enchantment.steady_breath.spread_multiplier";
public static final double STEADY_BREATH_SPREAD_MULTIPLIER_DEFAULT = 0.5D;
public static final double STEADY_BREATH_SPREAD_MULTIPLIER_MIN = 0.0D;
public static final double STEADY_BREATH_SPREAD_MULTIPLIER_MAX = 10.0D;
public static final ConfigListItem MANA_LEAK_CONFIG_LIST_ITEM = createConfigListItem( public static final ConfigListItem MANA_LEAK_CONFIG_LIST_ITEM = createConfigListItem(
"mana_leak", "mana_leak",
"enchantment.lzxnoneterraria.mana_leak", "enchantment.lzxnoneterraria.mana_leak",
@@ -111,6 +116,12 @@ public class ModEnchantmentConfigs {
() -> ConfigFactory.loadDoubleConfig(GUNPOWDER_DAMAGE_MULTIPLIER_PATH, configText("gunpowder_damage_multiplier"), configTooltip("gunpowder_damage_multiplier"), GUNPOWDER_DAMAGE_MULTIPLIER_DEFAULT, GUNPOWDER_DAMAGE_MULTIPLIER_MIN, GUNPOWDER_DAMAGE_MULTIPLIER_MAX) () -> ConfigFactory.loadDoubleConfig(GUNPOWDER_DAMAGE_MULTIPLIER_PATH, configText("gunpowder_damage_multiplier"), configTooltip("gunpowder_damage_multiplier"), GUNPOWDER_DAMAGE_MULTIPLIER_DEFAULT, GUNPOWDER_DAMAGE_MULTIPLIER_MIN, GUNPOWDER_DAMAGE_MULTIPLIER_MAX)
); );
public static final ConfigListItem STEADY_BREATH_CONFIG_LIST_ITEM = createConfigListItem(
"steady_breath",
"enchantment.lzxnoneterraria.steady_breath",
() -> ConfigFactory.loadDoubleConfig(STEADY_BREATH_SPREAD_MULTIPLIER_PATH, configText("steady_breath_spread_multiplier"), configTooltip("steady_breath_spread_multiplier"), STEADY_BREATH_SPREAD_MULTIPLIER_DEFAULT, STEADY_BREATH_SPREAD_MULTIPLIER_MIN, STEADY_BREATH_SPREAD_MULTIPLIER_MAX)
);
public static double getManaLeakConsumeMultiplier() { public static double getManaLeakConsumeMultiplier() {
return readDouble(MANA_LEAK_CONSUME_MULTIPLIER_PATH, MANA_LEAK_CONSUME_MULTIPLIER_DEFAULT, MANA_LEAK_CONSUME_MULTIPLIER_MIN, MANA_LEAK_CONSUME_MULTIPLIER_MAX); return readDouble(MANA_LEAK_CONSUME_MULTIPLIER_PATH, MANA_LEAK_CONSUME_MULTIPLIER_DEFAULT, MANA_LEAK_CONSUME_MULTIPLIER_MIN, MANA_LEAK_CONSUME_MULTIPLIER_MAX);
} }
@@ -147,6 +158,10 @@ public class ModEnchantmentConfigs {
return readDouble(GUNPOWDER_DAMAGE_MULTIPLIER_PATH, GUNPOWDER_DAMAGE_MULTIPLIER_DEFAULT, GUNPOWDER_DAMAGE_MULTIPLIER_MIN, GUNPOWDER_DAMAGE_MULTIPLIER_MAX); return readDouble(GUNPOWDER_DAMAGE_MULTIPLIER_PATH, GUNPOWDER_DAMAGE_MULTIPLIER_DEFAULT, GUNPOWDER_DAMAGE_MULTIPLIER_MIN, GUNPOWDER_DAMAGE_MULTIPLIER_MAX);
} }
public static double getSteadyBreathSpreadMultiplier() {
return readDouble(STEADY_BREATH_SPREAD_MULTIPLIER_PATH, STEADY_BREATH_SPREAD_MULTIPLIER_DEFAULT, STEADY_BREATH_SPREAD_MULTIPLIER_MIN, STEADY_BREATH_SPREAD_MULTIPLIER_MAX);
}
private static ConfigListItem createConfigListItem(String id, String nameKey, Runnable loader) { private static ConfigListItem createConfigListItem(String id, String nameKey, Runnable loader) {
return new ConfigListItem(id, ICON, Component.translatable(nameKey), new IConfigData() { return new ConfigListItem(id, ICON, Component.translatable(nameKey), new IConfigData() {
@Override @Override
@@ -16,6 +16,7 @@ public class ModEnchantments {
public static final ResourceKey<Enchantment> AMMO_EXHAUSTION = create("ammo_exhaustion"); public static final ResourceKey<Enchantment> AMMO_EXHAUSTION = create("ammo_exhaustion");
public static final ResourceKey<Enchantment> BULLET_HELL = create("bullet_hell"); public static final ResourceKey<Enchantment> BULLET_HELL = create("bullet_hell");
public static final ResourceKey<Enchantment> GUNPOWDER = create("gunpowder"); public static final ResourceKey<Enchantment> GUNPOWDER = create("gunpowder");
public static final ResourceKey<Enchantment> STEADY_BREATH = create("steady_breath");
public static final ResourceKey<Enchantment> BARREN_LAND = create("barren_land"); public static final ResourceKey<Enchantment> BARREN_LAND = create("barren_land");
private static ResourceKey<Enchantment> create(String name) { private static ResourceKey<Enchantment> create(String name) {
@@ -56,6 +56,14 @@ public class ModItems {
public static final DeferredItem<Item> HANDGUN = ITEMS.register("handgun", Handgun::new); public static final DeferredItem<Item> HANDGUN = ITEMS.register("handgun", Handgun::new);
public static final DeferredItem<Item> PHOENIX_BLASTER = ITEMS.register("phoenix_blaster", PhoenixBlaster::new); public static final DeferredItem<Item> PHOENIX_BLASTER = ITEMS.register("phoenix_blaster", PhoenixBlaster::new);
public static final DeferredItem<Item> MEGASHARK = ITEMS.register("megashark", Megashark::new); public static final DeferredItem<Item> MEGASHARK = ITEMS.register("megashark", Megashark::new);
public static final DeferredItem<Item> CLOCKWORK_ASSAULT_RIFLE = ITEMS.register("clockwork_assault_rifle", ClockworkAssaultRifle::new);
public static final DeferredItem<Item> GATLIGATOR = ITEMS.register("gatligator", Gatligator::new);
public static final DeferredItem<Item> SHOTGUN = ITEMS.register("shotgun", Shotgun::new);
public static final DeferredItem<Item> UZI = ITEMS.register("uzi", Uzi::new);
public static final DeferredItem<Item> VENUS_MAGNUM = ITEMS.register("venus_magnum", VenusMagnum::new);
public static final DeferredItem<Item> TACTICAL_SHOTGUN = ITEMS.register("tactical_shotgun", TacticalShotgun::new);
public static final DeferredItem<Item> SNIPER_RIFLE = ITEMS.register("sniper_rifle", SniperRifle::new);
public static final DeferredItem<Item> CHAIN_GUN = ITEMS.register("chain_gun", ChainGun::new);
public static final DeferredItem<Item> SDMG = ITEMS.register("sdmg", SDMG::new); public static final DeferredItem<Item> SDMG = ITEMS.register("sdmg", SDMG::new);
//召唤武器 //召唤武器
@@ -86,6 +86,8 @@ public class ChlorophyteBullet extends BulletAmmo {
this.checkBeforeTick(summon); this.checkBeforeTick(summon);
Vec3 currentDir = getCurrentDirection(summon); Vec3 currentDir = getCurrentDirection(summon);
Vec3 oldMotion = currentDir.normalize().scale(getSpeed());
Entity target = findTarget(summon); Entity target = findTarget(summon);
Vec3 nextDir = currentDir; Vec3 nextDir = currentDir;
if(target != null) { if(target != null) {
@@ -104,6 +106,7 @@ public class ChlorophyteBullet extends BulletAmmo {
Vec3 motion = nextDir.normalize().scale(getSpeed()); Vec3 motion = nextDir.normalize().scale(getSpeed());
Vec3 start = summon.position(); Vec3 start = summon.position();
Vec3 end = start.add(motion); Vec3 end = start.add(motion);
updateRotation(summon, nextDir); updateRotation(summon, nextDir);
if(summon.level().isClientSide()) { if(summon.level().isClientSide()) {
@@ -149,8 +152,7 @@ public class ChlorophyteBullet extends BulletAmmo {
return; return;
} }
} }
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(oldMotion));
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, end);
if(blockHitResult.getType() != HitResult.Type.MISS) { if(blockHitResult.getType() != HitResult.Type.MISS) {
this.onDied(summon); this.onDied(summon);
return; return;
@@ -1,6 +1,8 @@
package com.lzxnone.terraria.item.weapon.ranged; package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.LzxnoneTerraria; import com.lzxnone.terraria.LzxnoneTerraria;
import com.lzxnone.terraria.enchantment.ModEnchantmentConfigs;
import com.lzxnone.terraria.enchantment.ModEnchantments;
import com.lzxnone.terraria.entity.summon.StaticSummon; import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.item.ModItemTags; import com.lzxnone.terraria.item.ModItemTags;
import com.lzxnone.terraria.item.weapon.RangedWeapon; import com.lzxnone.terraria.item.weapon.RangedWeapon;
@@ -32,6 +34,9 @@ public class BasicGun extends RangedWeapon {
private static final float DAMAGE_MAX = 8388600.0f; private static final float DAMAGE_MAX = 8388600.0f;
private static final float AMMO_NOT_CONSUME_CHANCE_MIN = 0.0f; private static final float AMMO_NOT_CONSUME_CHANCE_MIN = 0.0f;
private static final float AMMO_NOT_CONSUME_CHANCE_MAX = 1.0f; private static final float AMMO_NOT_CONSUME_CHANCE_MAX = 1.0f;
public static final double SPRINT_SPREAD_MULTIPLIER = 2.0D;
public static final double WALK_SPREAD_MULTIPLIER = 1.5D;
public static final double CROUCH_SPREAD_MULTIPLIER = 0.5D;
private final String id; private final String id;
private final Vector3f offset; private final Vector3f offset;
@@ -150,6 +155,24 @@ public class BasicGun extends RangedWeapon {
return entity.getRandom().nextFloat() < getAmmoNotConsumeChance() ? 0 : 1; return entity.getRandom().nextFloat() < getAmmoNotConsumeChance() ? 0 : 1;
} }
protected float getFinalSpreadDegrees(float baseSpread, ItemStack weaponStack, Player player) {
double spread = baseSpread;
if(player.isSprinting()) {
spread *= SPRINT_SPREAD_MULTIPLIER;
}else if(player.getDeltaMovement().horizontalDistanceSqr() > 1.0E-4D) {
spread *= WALK_SPREAD_MULTIPLIER;
}
if(player.isShiftKeyDown()) {
spread *= CROUCH_SPREAD_MULTIPLIER;
}
int steadyBreathLevel = getEnchantmentLevel(player, weaponStack, ModEnchantments.STEADY_BREATH);
if(steadyBreathLevel > 0) {
spread *= Math.pow(ModEnchantmentConfigs.getSteadyBreathSpreadMultiplier(), steadyBreathLevel);
}
return (float) spread;
}
@Override @Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) { protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, sound.get()); SoundUtil.playClientSound(player, sound.get());
@@ -36,27 +36,28 @@ public class Boomstick extends BasicGun {
SoundUtil.playClientSound(player, ModSounds.SHOT5.get()); SoundUtil.playClientSound(player, ModSounds.SHOT5.get());
if(level.isClientSide()) return; if(level.isClientSide()) return;
float spreadDegrees = getFinalSpreadDegrees(MAX_SPREAD_DEGREES, stack, player);
for(int i = 0; i < PROJECTILE_COUNT; i++) { for(int i = 0; i < PROJECTILE_COUNT; i++) {
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET); StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
applySpread(player, summon); applySpread(player, summon, spreadDegrees);
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA); CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage()); customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 0.8f); customData.putFloat("knockbackScale", 1.25f);
customData.putInt("invulnerableTime", 10); customData.putInt("invulnerableTime", 10);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData); summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon); level.addFreshEntity(summon);
} }
} }
private static void applySpread(Player player, StaticSummon summon) { private static void applySpread(Player player, StaticSummon summon, float spreadDegrees) {
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player); Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
Vec3 forward = MathUtil.toVec3(dirs[0]).normalize(); Vec3 forward = MathUtil.toVec3(dirs[0]).normalize();
Vec3 up = MathUtil.toVec3(dirs[1]).normalize(); Vec3 up = MathUtil.toVec3(dirs[1]).normalize();
Vec3 right = MathUtil.toVec3(dirs[2]).normalize(); Vec3 right = MathUtil.toVec3(dirs[2]).normalize();
double yaw = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * MAX_SPREAD_DEGREES); double yaw = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
double pitch = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * MAX_SPREAD_DEGREES); double pitch = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
Vec3 spreadDir = forward Vec3 spreadDir = forward
.add(right.scale(Math.tan(yaw))) .add(right.scale(Math.tan(yaw)))
.add(up.scale(Math.tan(pitch))) .add(up.scale(Math.tan(pitch)))
@@ -0,0 +1,67 @@
package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.ModSounds;
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.AmmoUtil;
import com.lzxnone.terraria.utils.MathUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.item.Item;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
public class ChainGun extends BasicGun {
public static final String ID = "chain_gun";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.1f, 1.5f);
public static final float DAMAGE_DEFAULT = 6.0f;
public static final float AMMO_NOT_CONSUME_CHANCE = 0.67f;
public static final float MAX_SPREAD_DEGREES = 15.0f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
public ChainGun() {
super(Tiers.NETHERITE, new Item.Properties().stacksTo(1).rarity(Rarity.EPIC), ID, OFFSET, DAMAGE_DEFAULT, 4, ModSounds.SHOT6, 0.1f, 4);
}
@Override
public int getAmmoConsumeAmount(ItemStack weaponStack, LivingEntity entity) {
return entity.getRandom().nextFloat() < AMMO_NOT_CONSUME_CHANCE ? 0 : 1;
}
@Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, ModSounds.SHOT6.get());
if(level.isClientSide()) return;
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
Vec3 forward = MathUtil.toVec3(dirs[0]).normalize();
Vec3 up = MathUtil.toVec3(dirs[1]).normalize();
Vec3 right = MathUtil.toVec3(dirs[2]).normalize();
float spreadDegrees = getFinalSpreadDegrees(MAX_SPREAD_DEGREES, stack, player);
double yaw = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
double pitch = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
Vec3 spreadDir = forward.add(right.scale(Math.tan(yaw))).add(up.scale(Math.tan(pitch))).normalize();
float[] xyRot = MathUtil.computeXYRot(spreadDir.toVector3f());
summon.setXRot(xyRot[0]);
summon.xRotO = xyRot[0];
summon.setYRot(xyRot[1]);
summon.yRotO = xyRot[1];
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 0.1f);
customData.putInt("invulnerableTime", 4);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon);
}
}
@@ -0,0 +1,55 @@
package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.ModSounds;
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.AmmoUtil;
import com.lzxnone.terraria.utils.MathUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
public class ClockworkAssaultRifle extends BasicGun {
public static final String ID = "clockwork_assault_rifle";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.15f, 1.5f);
public static final float DAMAGE_DEFAULT = 2.4f;
public static final int PROJECTILE_COUNT = 3;
public static final double PROJECTILE_OFFSET = -1.0;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
public ClockworkAssaultRifle() {
super(Tiers.DIAMOND, new Item.Properties().stacksTo(1).rarity(Rarity.RARE), ID, OFFSET, DAMAGE_DEFAULT, 24, ModSounds.SHOT7, 0.2f, 5);
}
@Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, ModSounds.SHOT7.get());
if(level.isClientSide()) return;
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
Vec3 dir = MathUtil.toVec3(dirs[0]);
for(int i = 0;i < PROJECTILE_COUNT;i++) {
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 0.2f);
customData.putInt("invulnerableTime", 5);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
Vec3 pos = summon.position();
summon.setPos(pos.add(dir.scale(PROJECTILE_OFFSET * i)));
level.addFreshEntity(summon);
}
}
}
@@ -0,0 +1,67 @@
package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.ModSounds;
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.AmmoUtil;
import com.lzxnone.terraria.utils.MathUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
public class Gatligator extends BasicGun {
public static final String ID = "gatligator";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.1f, 1.5f);
public static final float DAMAGE_DEFAULT = 2.4f;
public static final float AMMO_NOT_CONSUME_CHANCE = 0.5f;
public static final float MAX_SPREAD_DEGREES = 10.0f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
public Gatligator() {
super(Tiers.DIAMOND, new Item.Properties().stacksTo(1).rarity(Rarity.RARE), ID, OFFSET, DAMAGE_DEFAULT, 7, ModSounds.SHOT6, 0.1f, 5);
}
@Override
public int getAmmoConsumeAmount(ItemStack weaponStack, LivingEntity entity) {
return entity.getRandom().nextFloat() < AMMO_NOT_CONSUME_CHANCE ? 0 : 1;
}
@Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, ModSounds.SHOT6.get());
if(level.isClientSide()) return;
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
Vec3 forward = MathUtil.toVec3(dirs[0]).normalize();
Vec3 up = MathUtil.toVec3(dirs[1]).normalize();
Vec3 right = MathUtil.toVec3(dirs[2]).normalize();
float spreadDegrees = getFinalSpreadDegrees(MAX_SPREAD_DEGREES, stack, player);
double yaw = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
double pitch = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
Vec3 spreadDir = forward.add(right.scale(Math.tan(yaw))).add(up.scale(Math.tan(pitch))).normalize();
float[] xyRot = MathUtil.computeXYRot(spreadDir.toVector3f());
summon.setXRot(xyRot[0]);
summon.xRotO = xyRot[0];
summon.setYRot(xyRot[1]);
summon.yRotO = xyRot[1];
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 0.1f);
customData.putInt("invulnerableTime", 5);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon);
}
}
@@ -11,7 +11,7 @@ import org.joml.Vector3f;
public class Megashark extends BasicGun { public class Megashark extends BasicGun {
public static final String ID = "megashark"; public static final String ID = "megashark";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.15f, 1.5f); public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.15f, 1.5f);
public static final float DAMAGE_DEFAULT = 2.0f; public static final float DAMAGE_DEFAULT = 3.0f;
public static final float AMMO_NOT_CONSUME_CHANCE_DEFAULT = 0.5f; public static final float AMMO_NOT_CONSUME_CHANCE_DEFAULT = 0.5f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT, AMMO_NOT_CONSUME_CHANCE_DEFAULT); public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT, AMMO_NOT_CONSUME_CHANCE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA); public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
@@ -36,27 +36,28 @@ public class QuadBarrelShotgun extends BasicGun {
SoundUtil.playClientSound(player, ModSounds.SHOT5.get()); SoundUtil.playClientSound(player, ModSounds.SHOT5.get());
if(level.isClientSide()) return; if(level.isClientSide()) return;
float spreadDegrees = getFinalSpreadDegrees(MAX_SPREAD_DEGREES, stack, player);
for(int i = 0; i < PROJECTILE_COUNT; i++) { for(int i = 0; i < PROJECTILE_COUNT; i++) {
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET); StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
applySpread(player, summon); applySpread(player, summon, spreadDegrees);
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA); CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage()); customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 0.9f); customData.putFloat("knockbackScale", 1.4f);
customData.putInt("invulnerableTime", 10); customData.putInt("invulnerableTime", 10);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData); summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon); level.addFreshEntity(summon);
} }
} }
private static void applySpread(Player player, StaticSummon summon) { private static void applySpread(Player player, StaticSummon summon, float spreadDegrees) {
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player); Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
Vec3 forward = MathUtil.toVec3(dirs[0]).normalize(); Vec3 forward = MathUtil.toVec3(dirs[0]).normalize();
Vec3 up = MathUtil.toVec3(dirs[1]).normalize(); Vec3 up = MathUtil.toVec3(dirs[1]).normalize();
Vec3 right = MathUtil.toVec3(dirs[2]).normalize(); Vec3 right = MathUtil.toVec3(dirs[2]).normalize();
double yaw = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * MAX_SPREAD_DEGREES); double yaw = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
double pitch = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * MAX_SPREAD_DEGREES); double pitch = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
Vec3 spreadDir = forward Vec3 spreadDir = forward
.add(right.scale(Math.tan(yaw))) .add(right.scale(Math.tan(yaw)))
.add(up.scale(Math.tan(pitch))) .add(up.scale(Math.tan(pitch)))
@@ -11,7 +11,7 @@ import org.joml.Vector3f;
public class SDMG extends BasicGun { public class SDMG extends BasicGun {
public static final String ID = "sdmg"; public static final String ID = "sdmg";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.15f, 1.5f); public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.15f, 1.5f);
public static final float DAMAGE_DEFAULT = 6.0f; public static final float DAMAGE_DEFAULT = 10.0f;
public static final float AMMO_NOT_CONSUME_CHANCE_DEFAULT = 0.66f; public static final float AMMO_NOT_CONSUME_CHANCE_DEFAULT = 0.66f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT, AMMO_NOT_CONSUME_CHANCE_DEFAULT); public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT, AMMO_NOT_CONSUME_CHANCE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA); public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
@@ -0,0 +1,65 @@
package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.ModSounds;
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.AmmoUtil;
import com.lzxnone.terraria.utils.MathUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
public class Shotgun extends BasicGun {
public static final String ID = "shotgun";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.05f, 1.5f);
public static final float DAMAGE_DEFAULT = 4.0f;
public static final int MIN_PROJECTILE_COUNT = 4;
public static final int MAX_PROJECTILE_COUNT = 5;
public static final float MAX_SPREAD_DEGREES = 10.0f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
public Shotgun() {
super(Tiers.IRON, new Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON), ID, OFFSET, DAMAGE_DEFAULT, 45, ModSounds.SHOT5, 1.25f, 10);
}
@Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, ModSounds.SHOT5.get());
if(level.isClientSide()) return;
int projectileCount = MIN_PROJECTILE_COUNT + player.getRandom().nextInt(MAX_PROJECTILE_COUNT - MIN_PROJECTILE_COUNT + 1);
float spreadDegrees = getFinalSpreadDegrees(MAX_SPREAD_DEGREES, stack, player);
for(int i = 0;i < projectileCount;i++) {
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
Vec3 forward = MathUtil.toVec3(dirs[0]).normalize();
Vec3 up = MathUtil.toVec3(dirs[1]).normalize();
Vec3 right = MathUtil.toVec3(dirs[2]).normalize();
double yaw = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
double pitch = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
Vec3 spreadDir = forward.add(right.scale(Math.tan(yaw))).add(up.scale(Math.tan(pitch))).normalize();
float[] xyRot = MathUtil.computeXYRot(spreadDir.toVector3f());
summon.setXRot(xyRot[0]);
summon.xRotO = xyRot[0];
summon.setYRot(xyRot[1]);
summon.yRotO = xyRot[1];
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 1.25f);
customData.putInt("invulnerableTime", 10);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon);
}
}
}
@@ -0,0 +1,50 @@
package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.ModSounds;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.item.ModItems;
import com.lzxnone.terraria.item.weapon.RangedWeapon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.AmmoUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.Level;
import org.joml.Vector3f;
public class SniperRifle extends BasicGun {
public static final String ID = "sniper_rifle";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.1f, 1.5f);
public static final float DAMAGE_DEFAULT = 35.0f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
public SniperRifle() {
super(Tiers.DIAMOND, new Item.Properties().stacksTo(1).rarity(Rarity.EPIC), ID, OFFSET, DAMAGE_DEFAULT, 36, ModSounds.SHOT, 2.0f, 10);
}
@Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, ModSounds.SHOT.get());
if(level.isClientSide()) return;
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
ItemStack ammoStack = RangedWeapon.getAmmoStack(stack);
if(ammoStack.is(ModItems.MUSKET_BALL.get()) || ammoStack.is(ModItems.TUNGSTEN_BULLET.get())) {
AmmoUtil.setHighVelocityBullet(summon);
}
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 2.0f);
customData.putInt("invulnerableTime", 10);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon);
}
}
@@ -0,0 +1,63 @@
package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.ModSounds;
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.AmmoUtil;
import com.lzxnone.terraria.utils.MathUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
public class TacticalShotgun extends BasicGun {
public static final String ID = "tactical_shotgun";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.1f, 1.5f);
public static final float DAMAGE_DEFAULT = 6.0f;
public static final int PROJECTILE_COUNT = 6;
public static final float MAX_SPREAD_DEGREES = 8.0f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
public TacticalShotgun() {
super(Tiers.DIAMOND, new Item.Properties().stacksTo(1).rarity(Rarity.EPIC), ID, OFFSET, DAMAGE_DEFAULT, 34, ModSounds.SHOT8, 1.5f, 10);
}
@Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, ModSounds.SHOT8.get());
if(level.isClientSide()) return;
float spreadDegrees = getFinalSpreadDegrees(MAX_SPREAD_DEGREES, stack, player);
for(int i = 0;i < PROJECTILE_COUNT;i++) {
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
Vec3 forward = MathUtil.toVec3(dirs[0]).normalize();
Vec3 up = MathUtil.toVec3(dirs[1]).normalize();
Vec3 right = MathUtil.toVec3(dirs[2]).normalize();
double yaw = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
double pitch = Math.toRadians((player.getRandom().nextFloat() * 2.0f - 1.0f) * spreadDegrees);
Vec3 spreadDir = forward.add(right.scale(Math.tan(yaw))).add(up.scale(Math.tan(pitch))).normalize();
float[] xyRot = MathUtil.computeXYRot(spreadDir.toVector3f());
summon.setXRot(xyRot[0]);
summon.xRotO = xyRot[0];
summon.setYRot(xyRot[1]);
summon.yRotO = xyRot[1];
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 1.5f);
customData.putInt("invulnerableTime", 10);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon);
}
}
}
@@ -0,0 +1,50 @@
package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.ModSounds;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.item.ModItems;
import com.lzxnone.terraria.item.weapon.RangedWeapon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.AmmoUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.Level;
import org.joml.Vector3f;
public class Uzi extends BasicGun {
public static final String ID = "uzi";
public static final Vector3f OFFSET = new Vector3f(-0.3f, 0, 1.5f);
public static final float DAMAGE_DEFAULT = 3.5f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
public Uzi() {
super(Tiers.DIAMOND, new Item.Properties().stacksTo(1).rarity(Rarity.RARE), ID, OFFSET, DAMAGE_DEFAULT, 9, ModSounds.SHOT2, 0.1f, 5);
}
@Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, ModSounds.SHOT2.get());
if(level.isClientSide()) return;
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
ItemStack ammoStack = RangedWeapon.getAmmoStack(stack);
if(ammoStack.is(ModItems.MUSKET_BALL.get()) || ammoStack.is(ModItems.TUNGSTEN_BULLET.get())) {
AmmoUtil.setHighVelocityBullet(summon);
}
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 0.1f);
customData.putInt("invulnerableTime", 5);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon);
}
}
@@ -0,0 +1,50 @@
package com.lzxnone.terraria.item.weapon.ranged;
import com.lzxnone.terraria.ModSounds;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.item.ModItems;
import com.lzxnone.terraria.item.weapon.RangedWeapon;
import com.lzxnone.terraria.ui.config.ConfigListItem;
import com.lzxnone.terraria.ui.config.IConfigData;
import com.lzxnone.terraria.utils.AmmoUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.Level;
import org.joml.Vector3f;
public class VenusMagnum extends BasicGun {
public static final String ID = "venus_magnum";
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.05f, 1.5f);
public static final float DAMAGE_DEFAULT = 5.0f;
public static final IConfigData CONFIG_DATA = createConfigData(ID, DAMAGE_DEFAULT);
public static final ConfigListItem CONFIG_LIST_ITEM = createConfigListItem(ID, CONFIG_DATA);
public VenusMagnum() {
super(Tiers.DIAMOND, new Item.Properties().stacksTo(1).rarity(Rarity.EPIC), ID, OFFSET, DAMAGE_DEFAULT, 9, ModSounds.SHOT6, 0.1f, 5);
}
@Override
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
SoundUtil.playClientSound(player, ModSounds.SHOT6.get());
if(level.isClientSide()) return;
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack, OFFSET);
ItemStack ammoStack = RangedWeapon.getAmmoStack(stack);
if(ammoStack.is(ModItems.MUSKET_BALL.get()) || ammoStack.is(ModItems.TUNGSTEN_BULLET.get())) {
AmmoUtil.setHighVelocityBullet(summon);
}
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
customData.putFloat("damage", getDamage());
customData.putFloat("knockbackScale", 0.1f);
customData.putInt("invulnerableTime", 5);
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
level.addFreshEntity(summon);
}
}
@@ -85,6 +85,14 @@ public class ConfigList {
Handgun.CONFIG_LIST_ITEM, Handgun.CONFIG_LIST_ITEM,
PhoenixBlaster.CONFIG_LIST_ITEM, PhoenixBlaster.CONFIG_LIST_ITEM,
Megashark.CONFIG_LIST_ITEM, Megashark.CONFIG_LIST_ITEM,
ClockworkAssaultRifle.CONFIG_LIST_ITEM,
Gatligator.CONFIG_LIST_ITEM,
Shotgun.CONFIG_LIST_ITEM,
Uzi.CONFIG_LIST_ITEM,
VenusMagnum.CONFIG_LIST_ITEM,
TacticalShotgun.CONFIG_LIST_ITEM,
SniperRifle.CONFIG_LIST_ITEM,
ChainGun.CONFIG_LIST_ITEM,
SDMG.CONFIG_LIST_ITEM SDMG.CONFIG_LIST_ITEM
}); });
ITEMS.put(EFFECT, new ConfigListItem[]{ ITEMS.put(EFFECT, new ConfigListItem[]{
@@ -122,7 +130,8 @@ public class ConfigList {
ModEnchantmentConfigs.SUMMON_AMPLIFICATION_CONFIG_LIST_ITEM, ModEnchantmentConfigs.SUMMON_AMPLIFICATION_CONFIG_LIST_ITEM,
ModEnchantmentConfigs.AMMO_EXHAUSTION_CONFIG_LIST_ITEM, ModEnchantmentConfigs.AMMO_EXHAUSTION_CONFIG_LIST_ITEM,
ModEnchantmentConfigs.BULLET_HELL_CONFIG_LIST_ITEM, ModEnchantmentConfigs.BULLET_HELL_CONFIG_LIST_ITEM,
ModEnchantmentConfigs.GUNPOWDER_CONFIG_LIST_ITEM ModEnchantmentConfigs.GUNPOWDER_CONFIG_LIST_ITEM,
ModEnchantmentConfigs.STEADY_BREATH_CONFIG_LIST_ITEM
}); });
} }
@@ -44,6 +44,14 @@
"item.lzxnoneterraria.handgun": "Handgun", "item.lzxnoneterraria.handgun": "Handgun",
"item.lzxnoneterraria.phoenix_blaster": "Phoenix Blaster", "item.lzxnoneterraria.phoenix_blaster": "Phoenix Blaster",
"item.lzxnoneterraria.megashark": "Megashark", "item.lzxnoneterraria.megashark": "Megashark",
"item.lzxnoneterraria.clockwork_assault_rifle": "Clockwork Assault Rifle",
"item.lzxnoneterraria.gatligator": "Gatligator",
"item.lzxnoneterraria.shotgun": "Shotgun",
"item.lzxnoneterraria.uzi": "Uzi",
"item.lzxnoneterraria.venus_magnum": "Venus Magnum",
"item.lzxnoneterraria.tactical_shotgun": "Tactical Shotgun",
"item.lzxnoneterraria.sniper_rifle": "Sniper Rifle",
"item.lzxnoneterraria.chain_gun": "Chain Gun",
"item.lzxnoneterraria.sdmg": "S.D.M.G.", "item.lzxnoneterraria.sdmg": "S.D.M.G.",
"item.lzxnoneterraria.musket_ball": "Musket Ball", "item.lzxnoneterraria.musket_ball": "Musket Ball",
"item.lzxnoneterraria.meteor_shot": "Meteor Shot", "item.lzxnoneterraria.meteor_shot": "Meteor Shot",
@@ -71,6 +79,7 @@
"enchantment.lzxnoneterraria.ammo_exhaustion": "Ammo Exhaustion", "enchantment.lzxnoneterraria.ammo_exhaustion": "Ammo Exhaustion",
"enchantment.lzxnoneterraria.bullet_hell": "Bullet Hell", "enchantment.lzxnoneterraria.bullet_hell": "Bullet Hell",
"enchantment.lzxnoneterraria.gunpowder": "Gunpowder", "enchantment.lzxnoneterraria.gunpowder": "Gunpowder",
"enchantment.lzxnoneterraria.steady_breath": "Steady Breath",
"enchantment.lzxnoneterraria.barren_land": "Barren Land", "enchantment.lzxnoneterraria.barren_land": "Barren Land",
"death.attack.lzxnoneterraria.player_normal": "%1$s was slain by %2$s", "death.attack.lzxnoneterraria.player_normal": "%1$s was slain by %2$s",
@@ -142,6 +151,8 @@
"lzxnoneterraria.configuration.bullet_hell_not_consume_chance.tooltip": "Independent chance per Bullet Hell level to avoid ammo consumption", "lzxnoneterraria.configuration.bullet_hell_not_consume_chance.tooltip": "Independent chance per Bullet Hell level to avoid ammo consumption",
"lzxnoneterraria.configuration.gunpowder_damage_multiplier": "Ranged Damage Multiplier", "lzxnoneterraria.configuration.gunpowder_damage_multiplier": "Ranged Damage Multiplier",
"lzxnoneterraria.configuration.gunpowder_damage_multiplier.tooltip": "Ranged weapon damage multiplier per Gunpowder level", "lzxnoneterraria.configuration.gunpowder_damage_multiplier.tooltip": "Ranged weapon damage multiplier per Gunpowder level",
"lzxnoneterraria.configuration.steady_breath_spread_multiplier": "Spread Multiplier",
"lzxnoneterraria.configuration.steady_breath_spread_multiplier.tooltip": "Ranged weapon spread multiplier per Steady Breath level",
"lzxnoneterraria.configuration.effect_settings": "Effect Settings", "lzxnoneterraria.configuration.effect_settings": "Effect Settings",
"lzxnoneterraria.configuration.blood_butcherer_damage_per_level": "Blood Butcherer Effect Damage Per Level", "lzxnoneterraria.configuration.blood_butcherer_damage_per_level": "Blood Butcherer Effect Damage Per Level",
"lzxnoneterraria.configuration.blood_butcherer_damage_per_level.tooltip": "Damage dealt per effect level", "lzxnoneterraria.configuration.blood_butcherer_damage_per_level.tooltip": "Damage dealt per effect level",
@@ -593,6 +604,30 @@
"lzxnoneterraria.configuration.megashark_ammo_not_consume_chance.tooltip": "Chance for each shot to avoid consuming ammo, from 0 to 1", "lzxnoneterraria.configuration.megashark_ammo_not_consume_chance.tooltip": "Chance for each shot to avoid consuming ammo, from 0 to 1",
"lzxnoneterraria.configuration.megashark_damage": "Damage", "lzxnoneterraria.configuration.megashark_damage": "Damage",
"lzxnoneterraria.configuration.megashark_damage.tooltip": "Damage per hit", "lzxnoneterraria.configuration.megashark_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.clockwork_assault_rifle_settings": "Clockwork Assault Rifle Settings",
"lzxnoneterraria.configuration.clockwork_assault_rifle_damage": "Damage",
"lzxnoneterraria.configuration.clockwork_assault_rifle_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.gatligator_settings": "Gatligator Settings",
"lzxnoneterraria.configuration.gatligator_damage": "Damage",
"lzxnoneterraria.configuration.gatligator_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.shotgun_settings": "Shotgun Settings",
"lzxnoneterraria.configuration.shotgun_damage": "Damage",
"lzxnoneterraria.configuration.shotgun_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.uzi_settings": "Uzi Settings",
"lzxnoneterraria.configuration.uzi_damage": "Damage",
"lzxnoneterraria.configuration.uzi_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.venus_magnum_settings": "Venus Magnum Settings",
"lzxnoneterraria.configuration.venus_magnum_damage": "Damage",
"lzxnoneterraria.configuration.venus_magnum_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.tactical_shotgun_settings": "Tactical Shotgun Settings",
"lzxnoneterraria.configuration.tactical_shotgun_damage": "Damage",
"lzxnoneterraria.configuration.tactical_shotgun_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.sniper_rifle_settings": "Sniper Rifle Settings",
"lzxnoneterraria.configuration.sniper_rifle_damage": "Damage",
"lzxnoneterraria.configuration.sniper_rifle_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.chain_gun_settings": "Chain Gun Settings",
"lzxnoneterraria.configuration.chain_gun_damage": "Damage",
"lzxnoneterraria.configuration.chain_gun_damage.tooltip": "Damage per hit",
"lzxnoneterraria.configuration.sdmg_settings": "S.D.M.G. Settings", "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": "Ammo Not Consume Chance",
"lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance.tooltip": "Chance for each shot to avoid consuming ammo, from 0 to 1", "lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance.tooltip": "Chance for each shot to avoid consuming ammo, from 0 to 1",
@@ -44,6 +44,14 @@
"item.lzxnoneterraria.handgun": "手枪", "item.lzxnoneterraria.handgun": "手枪",
"item.lzxnoneterraria.phoenix_blaster": "凤凰爆破枪", "item.lzxnoneterraria.phoenix_blaster": "凤凰爆破枪",
"item.lzxnoneterraria.megashark": "巨兽鲨", "item.lzxnoneterraria.megashark": "巨兽鲨",
"item.lzxnoneterraria.clockwork_assault_rifle": "发条式突击步枪",
"item.lzxnoneterraria.gatligator": "鳄鱼机关枪",
"item.lzxnoneterraria.shotgun": "霰弹枪",
"item.lzxnoneterraria.uzi": "乌兹冲锋枪",
"item.lzxnoneterraria.venus_magnum": "维纳斯万能枪",
"item.lzxnoneterraria.tactical_shotgun": "战术霰弹枪",
"item.lzxnoneterraria.sniper_rifle": "狙击步枪",
"item.lzxnoneterraria.chain_gun": "链式机枪",
"item.lzxnoneterraria.sdmg": "太空海豚机枪", "item.lzxnoneterraria.sdmg": "太空海豚机枪",
"item.lzxnoneterraria.musket_ball": "火枪子弹", "item.lzxnoneterraria.musket_ball": "火枪子弹",
"item.lzxnoneterraria.meteor_shot": "流星弹", "item.lzxnoneterraria.meteor_shot": "流星弹",
@@ -71,6 +79,7 @@
"enchantment.lzxnoneterraria.ammo_exhaustion": "弹尽粮绝", "enchantment.lzxnoneterraria.ammo_exhaustion": "弹尽粮绝",
"enchantment.lzxnoneterraria.bullet_hell": "枪林弹雨", "enchantment.lzxnoneterraria.bullet_hell": "枪林弹雨",
"enchantment.lzxnoneterraria.gunpowder": "火药", "enchantment.lzxnoneterraria.gunpowder": "火药",
"enchantment.lzxnoneterraria.steady_breath": "屏息",
"enchantment.lzxnoneterraria.barren_land": "寸草不生", "enchantment.lzxnoneterraria.barren_land": "寸草不生",
"death.attack.lzxnoneterraria.player_normal": "%1$s 被 %2$s 击杀", "death.attack.lzxnoneterraria.player_normal": "%1$s 被 %2$s 击杀",
@@ -141,6 +150,8 @@
"lzxnoneterraria.configuration.bullet_hell_not_consume_chance.tooltip": "枪林弹雨每级独立避免弹药消耗的概率", "lzxnoneterraria.configuration.bullet_hell_not_consume_chance.tooltip": "枪林弹雨每级独立避免弹药消耗的概率",
"lzxnoneterraria.configuration.gunpowder_damage_multiplier": "远程伤害倍率", "lzxnoneterraria.configuration.gunpowder_damage_multiplier": "远程伤害倍率",
"lzxnoneterraria.configuration.gunpowder_damage_multiplier.tooltip": "每级火药对远程武器伤害的倍率", "lzxnoneterraria.configuration.gunpowder_damage_multiplier.tooltip": "每级火药对远程武器伤害的倍率",
"lzxnoneterraria.configuration.steady_breath_spread_multiplier": "散射倍率",
"lzxnoneterraria.configuration.steady_breath_spread_multiplier.tooltip": "每级屏息对远程武器散射幅度的倍率",
"lzxnoneterraria.configuration.effect_settings": "药水效果 设置", "lzxnoneterraria.configuration.effect_settings": "药水效果 设置",
"lzxnoneterraria.configuration.blood_butcherer_damage_per_level": "血腥屠宰效果每级伤害", "lzxnoneterraria.configuration.blood_butcherer_damage_per_level": "血腥屠宰效果每级伤害",
"lzxnoneterraria.configuration.blood_butcherer_damage_per_level.tooltip": "每级造成的伤害", "lzxnoneterraria.configuration.blood_butcherer_damage_per_level.tooltip": "每级造成的伤害",
@@ -592,6 +603,30 @@
"lzxnoneterraria.configuration.megashark_ammo_not_consume_chance.tooltip": "每次射击不消耗弹药的概率,范围 0~1", "lzxnoneterraria.configuration.megashark_ammo_not_consume_chance.tooltip": "每次射击不消耗弹药的概率,范围 0~1",
"lzxnoneterraria.configuration.megashark_damage": "伤害", "lzxnoneterraria.configuration.megashark_damage": "伤害",
"lzxnoneterraria.configuration.megashark_damage.tooltip": "每次命中伤害", "lzxnoneterraria.configuration.megashark_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.clockwork_assault_rifle_settings": "发条式突击步枪 设置",
"lzxnoneterraria.configuration.clockwork_assault_rifle_damage": "伤害",
"lzxnoneterraria.configuration.clockwork_assault_rifle_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.gatligator_settings": "鳄鱼机关枪 设置",
"lzxnoneterraria.configuration.gatligator_damage": "伤害",
"lzxnoneterraria.configuration.gatligator_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.shotgun_settings": "霰弹枪 设置",
"lzxnoneterraria.configuration.shotgun_damage": "伤害",
"lzxnoneterraria.configuration.shotgun_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.uzi_settings": "乌兹冲锋枪 设置",
"lzxnoneterraria.configuration.uzi_damage": "伤害",
"lzxnoneterraria.configuration.uzi_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.venus_magnum_settings": "维纳斯万能枪 设置",
"lzxnoneterraria.configuration.venus_magnum_damage": "伤害",
"lzxnoneterraria.configuration.venus_magnum_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.tactical_shotgun_settings": "战术霰弹枪 设置",
"lzxnoneterraria.configuration.tactical_shotgun_damage": "伤害",
"lzxnoneterraria.configuration.tactical_shotgun_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.sniper_rifle_settings": "狙击步枪 设置",
"lzxnoneterraria.configuration.sniper_rifle_damage": "伤害",
"lzxnoneterraria.configuration.sniper_rifle_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.chain_gun_settings": "链式机枪 设置",
"lzxnoneterraria.configuration.chain_gun_damage": "伤害",
"lzxnoneterraria.configuration.chain_gun_damage.tooltip": "每次命中伤害",
"lzxnoneterraria.configuration.sdmg_settings": "S.D.M.G. 设置", "lzxnoneterraria.configuration.sdmg_settings": "S.D.M.G. 设置",
"lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance": "不消耗弹药概率", "lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance": "不消耗弹药概率",
"lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance.tooltip": "每次射击不消耗弹药的概率,范围 0~1", "lzxnoneterraria.configuration.sdmg_ammo_not_consume_chance.tooltip": "每次射击不消耗弹药的概率,范围 0~1",
@@ -0,0 +1,6 @@
{
"parent": "lzxnoneterraria:item/gun4",
"textures": {
"layer0": "lzxnoneterraria:item/chain_gun"
}
}
@@ -0,0 +1,6 @@
{
"parent": "lzxnoneterraria:item/gun2",
"textures": {
"layer0": "lzxnoneterraria:item/clockwork_assault_rifle"
}
}
@@ -0,0 +1,6 @@
{
"parent": "lzxnoneterraria:item/gun2",
"textures": {
"layer0": "lzxnoneterraria:item/gatligator"
}
}
@@ -0,0 +1,6 @@
{
"parent": "lzxnoneterraria:item/gun3",
"textures": {
"layer0": "lzxnoneterraria:item/shotgun"
}
}
@@ -0,0 +1,6 @@
{
"parent": "lzxnoneterraria:item/gun2",
"textures": {
"layer0": "lzxnoneterraria:item/sniper_rifle"
}
}
@@ -0,0 +1,6 @@
{
"parent": "lzxnoneterraria:item/gun",
"textures": {
"layer0": "lzxnoneterraria:item/tactical_shotgun"
}
}
@@ -0,0 +1,6 @@
{
"parent": "lzxnoneterraria:item/gun4",
"textures": {
"layer0": "lzxnoneterraria:item/uzi"
}
}
@@ -0,0 +1,6 @@
{
"parent": "lzxnoneterraria:item/gun",
"textures": {
"layer0": "lzxnoneterraria:item/venus_magnum"
}
}
@@ -44,6 +44,12 @@
"shot6": { "shot6": {
"sounds": ["lzxnoneterraria:shot6"] "sounds": ["lzxnoneterraria:shot6"]
}, },
"shot7": {
"sounds": ["lzxnoneterraria:shot7"]
},
"shot8": {
"sounds": ["lzxnoneterraria:shot8"]
},
"boom": { "boom": {
"sounds": ["lzxnoneterraria:boom"] "sounds": ["lzxnoneterraria:boom"]
}, },
Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

@@ -0,0 +1,21 @@
{
"anvil_cost": 6,
"description": {
"translate": "enchantment.lzxnoneterraria.steady_breath"
},
"max_cost": {
"base": 45,
"per_level_above_first": 0
},
"max_level": 1,
"min_cost": {
"base": 10,
"per_level_above_first": 0
},
"primary_items": "#lzxnoneterraria:spread_ranged_weapons",
"slots": [
"mainhand"
],
"supported_items": "#lzxnoneterraria:spread_ranged_weapons",
"weight": 5
}
@@ -12,6 +12,14 @@
"lzxnoneterraria:handgun", "lzxnoneterraria:handgun",
"lzxnoneterraria:phoenix_blaster", "lzxnoneterraria:phoenix_blaster",
"lzxnoneterraria:megashark", "lzxnoneterraria:megashark",
"lzxnoneterraria:clockwork_assault_rifle",
"lzxnoneterraria:gatligator",
"lzxnoneterraria:shotgun",
"lzxnoneterraria:uzi",
"lzxnoneterraria:venus_magnum",
"lzxnoneterraria:tactical_shotgun",
"lzxnoneterraria:sniper_rifle",
"lzxnoneterraria:chain_gun",
"lzxnoneterraria:sdmg" "lzxnoneterraria:sdmg"
] ]
} }
@@ -0,0 +1,11 @@
{
"replace": false,
"values": [
"lzxnoneterraria:boomstick",
"lzxnoneterraria:quad_barrel_shotgun",
"lzxnoneterraria:gatligator",
"lzxnoneterraria:shotgun",
"lzxnoneterraria:tactical_shotgun",
"lzxnoneterraria:chain_gun"
]
}
@@ -10,6 +10,7 @@
"lzxnoneterraria:ammo_exhaustion", "lzxnoneterraria:ammo_exhaustion",
"lzxnoneterraria:bullet_hell", "lzxnoneterraria:bullet_hell",
"lzxnoneterraria:gunpowder", "lzxnoneterraria:gunpowder",
"lzxnoneterraria:steady_breath",
"lzxnoneterraria:barren_land" "lzxnoneterraria:barren_land"
] ]
} }
@@ -9,6 +9,7 @@
"lzxnoneterraria:ammo_exhaustion", "lzxnoneterraria:ammo_exhaustion",
"lzxnoneterraria:bullet_hell", "lzxnoneterraria:bullet_hell",
"lzxnoneterraria:gunpowder", "lzxnoneterraria:gunpowder",
"lzxnoneterraria:steady_breath",
"lzxnoneterraria:barren_land" "lzxnoneterraria:barren_land"
] ]
} }
@@ -10,6 +10,7 @@
"lzxnoneterraria:ammo_exhaustion", "lzxnoneterraria:ammo_exhaustion",
"lzxnoneterraria:bullet_hell", "lzxnoneterraria:bullet_hell",
"lzxnoneterraria:gunpowder", "lzxnoneterraria:gunpowder",
"lzxnoneterraria:steady_breath",
"lzxnoneterraria:barren_land" "lzxnoneterraria:barren_land"
] ]
} }