v1.6.0
This commit is contained in:
1 parent
7015a527fd
commit
0b3690217a
26 files changed
+574
-46
No files matched your search
@@ -42,6 +42,21 @@ public class ModEnchantmentConfigs {
|
||||
public static final double SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_MIN = 0.0D;
|
||||
public static final double SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_MAX = 10.0D;
|
||||
|
||||
public static final String AMMO_EXHAUSTION_CONSUME_BONUS_PATH = "enchantment.ammo_exhaustion.consume_bonus";
|
||||
public static final int AMMO_EXHAUSTION_CONSUME_BONUS_DEFAULT = 1;
|
||||
public static final int AMMO_EXHAUSTION_CONSUME_BONUS_MIN = 0;
|
||||
public static final int AMMO_EXHAUSTION_CONSUME_BONUS_MAX = 1024;
|
||||
|
||||
public static final String BULLET_HELL_NOT_CONSUME_CHANCE_PATH = "enchantment.bullet_hell.not_consume_chance";
|
||||
public static final double BULLET_HELL_NOT_CONSUME_CHANCE_DEFAULT = 0.5D;
|
||||
public static final double BULLET_HELL_NOT_CONSUME_CHANCE_MIN = 0.0D;
|
||||
public static final double BULLET_HELL_NOT_CONSUME_CHANCE_MAX = 1.0D;
|
||||
|
||||
public static final String GUNPOWDER_DAMAGE_MULTIPLIER_PATH = "enchantment.gunpowder.damage_multiplier";
|
||||
public static final double GUNPOWDER_DAMAGE_MULTIPLIER_DEFAULT = 1.15D;
|
||||
public static final double GUNPOWDER_DAMAGE_MULTIPLIER_MIN = 0.0D;
|
||||
public static final double GUNPOWDER_DAMAGE_MULTIPLIER_MAX = 10.0D;
|
||||
|
||||
public static final ConfigListItem MANA_LEAK_CONFIG_LIST_ITEM = createConfigListItem(
|
||||
"mana_leak",
|
||||
"enchantment.lzxnoneterraria.mana_leak",
|
||||
@@ -78,6 +93,24 @@ public class ModEnchantmentConfigs {
|
||||
() -> ConfigFactory.loadDoubleConfig(SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_PATH, configText("summon_amplification_damage_multiplier"), configTooltip("summon_amplification_damage_multiplier"), SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_DEFAULT, SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_MIN, SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_MAX)
|
||||
);
|
||||
|
||||
public static final ConfigListItem AMMO_EXHAUSTION_CONFIG_LIST_ITEM = createConfigListItem(
|
||||
"ammo_exhaustion",
|
||||
"enchantment.lzxnoneterraria.ammo_exhaustion",
|
||||
() -> ConfigFactory.loadIntConfig(AMMO_EXHAUSTION_CONSUME_BONUS_PATH, configText("ammo_exhaustion_consume_bonus"), configTooltip("ammo_exhaustion_consume_bonus"), AMMO_EXHAUSTION_CONSUME_BONUS_DEFAULT, AMMO_EXHAUSTION_CONSUME_BONUS_MIN, AMMO_EXHAUSTION_CONSUME_BONUS_MAX)
|
||||
);
|
||||
|
||||
public static final ConfigListItem BULLET_HELL_CONFIG_LIST_ITEM = createConfigListItem(
|
||||
"bullet_hell",
|
||||
"enchantment.lzxnoneterraria.bullet_hell",
|
||||
() -> ConfigFactory.loadDoubleConfig(BULLET_HELL_NOT_CONSUME_CHANCE_PATH, configText("bullet_hell_not_consume_chance"), configTooltip("bullet_hell_not_consume_chance"), BULLET_HELL_NOT_CONSUME_CHANCE_DEFAULT, BULLET_HELL_NOT_CONSUME_CHANCE_MIN, BULLET_HELL_NOT_CONSUME_CHANCE_MAX)
|
||||
);
|
||||
|
||||
public static final ConfigListItem GUNPOWDER_CONFIG_LIST_ITEM = createConfigListItem(
|
||||
"gunpowder",
|
||||
"enchantment.lzxnoneterraria.gunpowder",
|
||||
() -> 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 double getManaLeakConsumeMultiplier() {
|
||||
return readDouble(MANA_LEAK_CONSUME_MULTIPLIER_PATH, MANA_LEAK_CONSUME_MULTIPLIER_DEFAULT, MANA_LEAK_CONSUME_MULTIPLIER_MIN, MANA_LEAK_CONSUME_MULTIPLIER_MAX);
|
||||
}
|
||||
@@ -102,6 +135,18 @@ public class ModEnchantmentConfigs {
|
||||
return readDouble(SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_PATH, SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_DEFAULT, SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_MIN, SUMMON_AMPLIFICATION_DAMAGE_MULTIPLIER_MAX);
|
||||
}
|
||||
|
||||
public static int getAmmoExhaustionConsumeBonus() {
|
||||
return Math.clamp(ConfigUtil.readInt(AMMO_EXHAUSTION_CONSUME_BONUS_PATH, AMMO_EXHAUSTION_CONSUME_BONUS_DEFAULT), AMMO_EXHAUSTION_CONSUME_BONUS_MIN, AMMO_EXHAUSTION_CONSUME_BONUS_MAX);
|
||||
}
|
||||
|
||||
public static double getBulletHellNotConsumeChance() {
|
||||
return readDouble(BULLET_HELL_NOT_CONSUME_CHANCE_PATH, BULLET_HELL_NOT_CONSUME_CHANCE_DEFAULT, BULLET_HELL_NOT_CONSUME_CHANCE_MIN, BULLET_HELL_NOT_CONSUME_CHANCE_MAX);
|
||||
}
|
||||
|
||||
public static double getGunpowderDamageMultiplier() {
|
||||
return readDouble(GUNPOWDER_DAMAGE_MULTIPLIER_PATH, GUNPOWDER_DAMAGE_MULTIPLIER_DEFAULT, GUNPOWDER_DAMAGE_MULTIPLIER_MIN, GUNPOWDER_DAMAGE_MULTIPLIER_MAX);
|
||||
}
|
||||
|
||||
private static ConfigListItem createConfigListItem(String id, String nameKey, Runnable loader) {
|
||||
return new ConfigListItem(id, ICON, Component.translatable(nameKey), new IConfigData() {
|
||||
@Override
|
||||
|
||||
@@ -13,6 +13,9 @@ public class ModEnchantments {
|
||||
public static final ResourceKey<Enchantment> MANA_GATHERING_CURSE = create("mana_gathering_curse");
|
||||
public static final ResourceKey<Enchantment> ARCANE_AMPLIFICATION = create("arcane_amplification");
|
||||
public static final ResourceKey<Enchantment> SUMMON_AMPLIFICATION = create("summon_amplification");
|
||||
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> GUNPOWDER = create("gunpowder");
|
||||
public static final ResourceKey<Enchantment> BARREN_LAND = create("barren_land");
|
||||
|
||||
private static ResourceKey<Enchantment> create(String name) {
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.lzxnone.terraria.item.ammo;
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class BulletAmmo extends Item {
|
||||
public static final int MAX_STACK_SIZE = 99;
|
||||
|
||||
public BulletAmmo() {
|
||||
super(new Item.Properties());
|
||||
super(new Item.Properties().stacksTo(MAX_STACK_SIZE));
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,156 @@
|
||||
package com.lzxnone.terraria.item.ammo;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
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.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.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
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 MeteorShot extends BulletAmmo {
|
||||
private static final String CONFIG_TRANSLATION_PREFIX = "lzxnoneterraria.configuration.";
|
||||
|
||||
public static final String BASE_DAMAGE_PATH = "ammo.meteor_shot.base_damage";
|
||||
public static final float BASE_DAMAGE_DEFAULT = 1.0f;
|
||||
public static final float BASE_DAMAGE_MIN = 0.0f;
|
||||
public static final float BASE_DAMAGE_MAX = 8388600.0f;
|
||||
|
||||
public static final String SPEED_PATH = "ammo.meteor_shot.speed";
|
||||
public static final double SPEED_DEFAULT = 3.0D;
|
||||
public static final double SPEED_MIN = 0.0D;
|
||||
public static final double SPEED_MAX = 24.0D;
|
||||
|
||||
public static final String MAX_HIT_PATH = "ammo.meteor_shot.max_hit";
|
||||
public static final int MAX_HIT_DEFAULT = 2;
|
||||
public static final int MAX_HIT_MIN = 1;
|
||||
public static final int MAX_HIT_MAX = 256;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigFactory.loadFloatConfig(BASE_DAMAGE_PATH, configText("meteor_shot_base_damage"), configTooltip("meteor_shot_base_damage"), BASE_DAMAGE_DEFAULT, BASE_DAMAGE_MIN, BASE_DAMAGE_MAX);
|
||||
ConfigFactory.loadDoubleConfig(SPEED_PATH, configText("meteor_shot_speed"), configTooltip("meteor_shot_speed"), SPEED_DEFAULT, SPEED_MIN, SPEED_MAX);
|
||||
ConfigFactory.loadIntConfig(MAX_HIT_PATH, configText("meteor_shot_max_hit"), configTooltip("meteor_shot_max_hit"), MAX_HIT_DEFAULT, MAX_HIT_MIN, MAX_HIT_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 getBaseDamage() {
|
||||
return Math.clamp(ConfigUtil.readFloat(BASE_DAMAGE_PATH, BASE_DAMAGE_DEFAULT), BASE_DAMAGE_MIN, BASE_DAMAGE_MAX);
|
||||
}
|
||||
|
||||
public static double getSpeed() {
|
||||
return Math.clamp(ConfigUtil.readDouble(SPEED_PATH, SPEED_DEFAULT), SPEED_MIN, SPEED_MAX);
|
||||
}
|
||||
|
||||
public static int getMaxHit() {
|
||||
return Math.clamp(ConfigUtil.readInt(MAX_HIT_PATH, MAX_HIT_DEFAULT), MAX_HIT_MIN, MAX_HIT_MAX);
|
||||
}
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"meteor_shot",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/meteor_shot.png"),
|
||||
Component.translatable("item.lzxnoneterraria.meteor_shot"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
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);
|
||||
|
||||
//碰撞检测
|
||||
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.summonAttack(summon, target, sourceStack, getBaseDamage() + damage, knockbackScale)) {
|
||||
target.invulnerableTime = invulnerableTime;
|
||||
if(MeteorShot.incrementHit(summon) >= getMaxHit()) {
|
||||
this.onDied(summon);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//方块检测
|
||||
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(motion));
|
||||
if(blockHitResult.getType() != HitResult.Type.MISS) {
|
||||
if(MeteorShot.incrementHit(summon) >= getMaxHit()) {
|
||||
this.onDied(summon);
|
||||
return;
|
||||
}
|
||||
|
||||
Vec3 reflectedMotion = MeteorShot.reflect(motion, blockHitResult.getDirection()).normalize().scale(speed);
|
||||
summon.setPos(blockHitResult.getLocation().add(Vec3.atLowerCornerOf(blockHitResult.getDirection().getNormal()).scale(0.05)));
|
||||
summon.setDeltaMovement(reflectedMotion);
|
||||
MeteorShot.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,13 +1,104 @@
|
||||
package com.lzxnone.terraria.item.ammo;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
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.CollisionUtil;
|
||||
import com.lzxnone.terraria.utils.DamageUtil;
|
||||
import com.lzxnone.terraria.utils.FilterUtil;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
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 MusketBall extends BulletAmmo {
|
||||
private static final String CONFIG_TRANSLATION_PREFIX = "lzxnoneterraria.configuration.";
|
||||
|
||||
public static final String BASE_DAMAGE_PATH = "ammo.musket_ball.base_damage";
|
||||
public static final float BASE_DAMAGE_DEFAULT = 0.8f;
|
||||
public static final float BASE_DAMAGE_MIN = 0.0f;
|
||||
public static final float BASE_DAMAGE_MAX = 8388600.0f;
|
||||
|
||||
public static final String SPEED_PATH = "ammo.musket_ball.speed";
|
||||
public static final double SPEED_DEFAULT = 3.0D;
|
||||
public static final double SPEED_MIN = 0.0D;
|
||||
public static final double SPEED_MAX = 24.0D;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigFactory.loadFloatConfig(BASE_DAMAGE_PATH, configText("musket_ball_base_damage"), configTooltip("musket_ball_base_damage"), BASE_DAMAGE_DEFAULT, BASE_DAMAGE_MIN, BASE_DAMAGE_MAX);
|
||||
ConfigFactory.loadDoubleConfig(SPEED_PATH, configText("musket_ball_speed"), configTooltip("musket_ball_speed"), SPEED_DEFAULT, SPEED_MIN, SPEED_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 getBaseDamage() {
|
||||
return Math.clamp(ConfigUtil.readFloat(BASE_DAMAGE_PATH, BASE_DAMAGE_DEFAULT), BASE_DAMAGE_MIN, BASE_DAMAGE_MAX);
|
||||
}
|
||||
|
||||
public static double getSpeed() {
|
||||
return Math.clamp(ConfigUtil.readDouble(SPEED_PATH, SPEED_DEFAULT), SPEED_MIN, SPEED_MAX);
|
||||
}
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"musket_ball",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/musket_ball.png"),
|
||||
Component.translatable("item.lzxnoneterraria.musket_ball"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
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);
|
||||
|
||||
//碰撞检测
|
||||
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.summonAttack(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);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -24,22 +24,12 @@ public class MagicWeapon extends Weapon {
|
||||
private final IntSupplier manaConsumeRate;
|
||||
private final IntSupplier manaRecoverRate;
|
||||
|
||||
public MagicWeapon(Tier tier, Properties properties, int manaConsumeRate, int manaRecoverRate) {
|
||||
this(tier, properties, () -> manaConsumeRate, () -> manaRecoverRate);
|
||||
}
|
||||
|
||||
public MagicWeapon(Tier tier, Properties properties, IntSupplier manaConsumeRate, IntSupplier manaRecoverRate) {
|
||||
super(tier, properties);
|
||||
this.manaConsumeRate = manaConsumeRate;
|
||||
this.manaRecoverRate = manaRecoverRate;
|
||||
}
|
||||
|
||||
public MagicWeapon(Properties properties) {
|
||||
super(properties);
|
||||
this.manaConsumeRate = () -> 1;
|
||||
this.manaRecoverRate = () -> 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUseTick(Level level, LivingEntity entity, ItemStack stack, int count) {
|
||||
if(!canUseMagic(stack, entity)) {
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.lzxnone.terraria.item.weapon;
|
||||
|
||||
import com.lzxnone.terraria.enchantment.ModEnchantmentConfigs;
|
||||
import com.lzxnone.terraria.enchantment.ModEnchantments;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.SlotAccess;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
@@ -15,6 +20,7 @@ import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import java.util.List;
|
||||
@@ -26,10 +32,6 @@ public class RangedWeapon extends Weapon {
|
||||
super(tier, properties);
|
||||
}
|
||||
|
||||
public RangedWeapon(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
public boolean canUseAmmo(ItemStack weaponStack, ItemStack ammoStack) {
|
||||
return false;
|
||||
}
|
||||
@@ -42,6 +44,21 @@ public class RangedWeapon extends Weapon {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public int getFinalAmmoConsumeAmount(ItemStack weaponStack, LivingEntity entity, int amount) {
|
||||
if(amount <= 0) return 0;
|
||||
int exhaustionLevel = getEnchantmentLevel(entity, weaponStack, ModEnchantments.AMMO_EXHAUSTION);
|
||||
return Math.max(0, amount + exhaustionLevel * ModEnchantmentConfigs.getAmmoExhaustionConsumeBonus());
|
||||
}
|
||||
|
||||
public boolean shouldSkipAmmoConsume(ItemStack weaponStack, LivingEntity entity) {
|
||||
int bulletHellLevel = getEnchantmentLevel(entity, weaponStack, ModEnchantments.BULLET_HELL);
|
||||
if(bulletHellLevel <= 0) return false;
|
||||
|
||||
double triggerChance = Math.pow(1.0D - ModEnchantmentConfigs.getBulletHellNotConsumeChance(), bulletHellLevel);
|
||||
double skipChance = 1.0D - triggerChance;
|
||||
return entity.getRandom().nextDouble() < skipChance;
|
||||
}
|
||||
|
||||
public boolean shouldShootThisTick(ItemStack weaponStack, LivingEntity entity, int remainingUseTicks) {
|
||||
int useTime = Math.max(1, getUseTime(weaponStack, entity));
|
||||
int elapsedMinecraftTicks = getUseDuration(weaponStack, entity) - remainingUseTicks;
|
||||
@@ -55,6 +72,7 @@ public class RangedWeapon extends Weapon {
|
||||
public boolean canShoot(ItemStack weaponStack, Player player) {
|
||||
ItemStack ammoStack = getAmmoStack(weaponStack);
|
||||
if(ammoStack.isEmpty() || !canUseAmmo(weaponStack, ammoStack)) return false;
|
||||
if(player.hasInfiniteMaterials()) return true;
|
||||
|
||||
Item ammoItem = ammoStack.getItem();
|
||||
for(ItemStack inventoryStack : player.getInventory().items) {
|
||||
@@ -65,6 +83,10 @@ public class RangedWeapon extends Weapon {
|
||||
|
||||
public boolean consumeAmmo(ItemStack weaponStack, Player player, int amount) {
|
||||
if(amount <= 0 || player.hasInfiniteMaterials()) return true;
|
||||
if(shouldSkipAmmoConsume(weaponStack, player)) return true;
|
||||
|
||||
amount = getFinalAmmoConsumeAmount(weaponStack, player, amount);
|
||||
if(amount <= 0) return true;
|
||||
|
||||
ItemStack ammoStack = getAmmoStack(weaponStack);
|
||||
if(ammoStack.isEmpty() || !canUseAmmo(weaponStack, ammoStack)) return false;
|
||||
@@ -92,23 +114,22 @@ public class RangedWeapon extends Weapon {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean tryShoot(Level level, Player player, ItemStack weaponStack) {
|
||||
public boolean tryShoot(Level level, Player player, InteractionHand hand, ItemStack weaponStack) {
|
||||
if(!canShoot(weaponStack, player)) return false;
|
||||
if(!level.isClientSide() && !consumeAmmo(weaponStack, player, getAmmoConsumeAmount(weaponStack, player))) return false;
|
||||
|
||||
shoot(level, player, weaponStack);
|
||||
shoot(level, player, hand, weaponStack);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void shoot(Level level, Player player, ItemStack weaponStack) {
|
||||
}
|
||||
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack weaponStack) {}
|
||||
|
||||
@Override
|
||||
public void onUseTick(Level level, LivingEntity entity, ItemStack stack, int remainingUseTicks) {
|
||||
if(!(entity instanceof Player player)) return;
|
||||
if(!shouldShootThisTick(stack, entity, remainingUseTicks)) return;
|
||||
|
||||
if(!tryShoot(level, player, stack)) {
|
||||
if(!tryShoot(level, player, player.getUsedItemHand(), stack)) {
|
||||
player.stopUsingItem();
|
||||
}
|
||||
}
|
||||
@@ -156,4 +177,12 @@ public class RangedWeapon extends Weapon {
|
||||
ammoStack.getHoverName()
|
||||
).withStyle(style -> style.withColor(0x55FF55)));
|
||||
}
|
||||
|
||||
protected static int getEnchantmentLevel(LivingEntity entity, ItemStack stack, ResourceKey<Enchantment> enchantment) {
|
||||
return entity.registryAccess()
|
||||
.lookupOrThrow(Registries.ENCHANTMENT)
|
||||
.get(enchantment)
|
||||
.map(stack::getEnchantmentLevel)
|
||||
.orElse(0);
|
||||
}
|
||||
}
|
||||
@@ -30,10 +30,6 @@ public class SummonWeapon extends Weapon {
|
||||
super(tier, properties);
|
||||
}
|
||||
|
||||
public SummonWeapon(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
public static int getMaxSummonCount(Player player) {
|
||||
MobEffectInstance instance = player.getEffect(ModEffects.SUMMON);
|
||||
return 1 + (instance == null ? 0 : (instance.getAmplifier() + 1) * SummonEffect.getSummonCountPerLevel());
|
||||
@@ -88,13 +84,6 @@ public class SummonWeapon extends Weapon {
|
||||
player.level().addFreshEntity(summon);
|
||||
}
|
||||
|
||||
public static void removeSummon(Player player, Entity summon) {
|
||||
List<UUID> summons = getSummons(player);
|
||||
if(summons.remove(summon.getUUID())) {
|
||||
player.setData(ModAttachments.SUMMON_WEAPON_SUMMONS, summons);
|
||||
}
|
||||
}
|
||||
|
||||
public String getSummonId() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
package com.lzxnone.terraria.item.weapon.ranged;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.item.ModItemTags;
|
||||
import com.lzxnone.terraria.item.weapon.RangedWeapon;
|
||||
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.AmmoUtil;
|
||||
import com.lzxnone.terraria.utils.SoundUtil;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResultHolder;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
@@ -17,14 +25,57 @@ import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
public class SDMG extends RangedWeapon {
|
||||
private static final String CONFIG_TRANSLATION_PREFIX = "lzxnoneterraria.configuration.";
|
||||
|
||||
public static final String AMMO_NOT_CONSUME_CHANCE_PATH = "weapon.sdmg.ammo_not_consume_chance";
|
||||
public static final float AMMO_NOT_CONSUME_CHANCE_DEFAULT = 0.66f;
|
||||
public static final float AMMO_NOT_CONSUME_CHANCE_MIN = 0.0f;
|
||||
public static final float AMMO_NOT_CONSUME_CHANCE_MAX = 1.0f;
|
||||
|
||||
public static final String DAMAGE_PATH = "weapon.sdmg.damage";
|
||||
public static final float DAMAGE_DEFAULT = 1.0f;
|
||||
public static final float DAMAGE_MIN = 0.0f;
|
||||
public static final float DAMAGE_MAX = 8388600.0f;
|
||||
|
||||
public SDMG() {
|
||||
super(Tiers.NETHERITE, new Item.Properties().stacksTo(1).fireResistant().rarity(Rarity.EPIC));
|
||||
}
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigFactory.loadFloatConfig(AMMO_NOT_CONSUME_CHANCE_PATH, configText("sdmg_ammo_not_consume_chance"), configTooltip("sdmg_ammo_not_consume_chance"), AMMO_NOT_CONSUME_CHANCE_DEFAULT, AMMO_NOT_CONSUME_CHANCE_MIN, AMMO_NOT_CONSUME_CHANCE_MAX);
|
||||
ConfigFactory.loadFloatConfig(DAMAGE_PATH, configText("sdmg_damage"), configTooltip("sdmg_damage"), DAMAGE_DEFAULT, DAMAGE_MIN, DAMAGE_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 getAmmoNotConsumeChance() {
|
||||
return Math.clamp(ConfigUtil.readFloat(AMMO_NOT_CONSUME_CHANCE_PATH, AMMO_NOT_CONSUME_CHANCE_DEFAULT), AMMO_NOT_CONSUME_CHANCE_MIN, AMMO_NOT_CONSUME_CHANCE_MAX);
|
||||
}
|
||||
|
||||
public static float getDamage() {
|
||||
return Math.clamp(ConfigUtil.readFloat(DAMAGE_PATH, DAMAGE_DEFAULT), DAMAGE_MIN, DAMAGE_MAX);
|
||||
}
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"sdmg",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/sdmg.png"),
|
||||
Component.translatable("item.lzxnoneterraria.sdmg"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
|
||||
ItemStack stack = player.getItemInHand(hand);
|
||||
if(!tryShoot(level, player, stack)) return InteractionResultHolder.fail(stack);
|
||||
if(!tryShoot(level, player, hand, stack)) return InteractionResultHolder.fail(stack);
|
||||
player.startUsingItem(hand);
|
||||
return InteractionResultHolder.consume(stack);
|
||||
}
|
||||
@@ -40,10 +91,20 @@ public class SDMG extends RangedWeapon {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shoot(Level level, Player player, ItemStack stack) {
|
||||
public int getAmmoConsumeAmount(ItemStack weaponStack, LivingEntity entity) {
|
||||
return entity.getRandom().nextFloat() < getAmmoNotConsumeChance() ? 0 : 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shoot(Level level, Player player, InteractionHand hand, ItemStack stack) {
|
||||
SoundUtil.playClientSound(player, ModSounds.SHOT.get());
|
||||
if(!level.isClientSide()) {
|
||||
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, stack);
|
||||
StaticSummon summon = AmmoUtil.createAmmoSummon(level, player, hand, stack);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.lzxnone.terraria.effect.BloodButcheredEffect;
|
||||
import com.lzxnone.terraria.effect.DemonicFlamesEffect;
|
||||
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.weapon.magic.LastPrism;
|
||||
import com.lzxnone.terraria.item.weapon.melee.BeeKeeper;
|
||||
import com.lzxnone.terraria.item.weapon.melee.BladeOfGrass;
|
||||
@@ -28,6 +30,7 @@ import com.lzxnone.terraria.item.weapon.melee.TrueExcalibur;
|
||||
import com.lzxnone.terraria.item.weapon.melee.TrueNightsEdge;
|
||||
import com.lzxnone.terraria.item.weapon.melee.Volcano;
|
||||
import com.lzxnone.terraria.item.weapon.melee.Zenith;
|
||||
import com.lzxnone.terraria.item.weapon.ranged.SDMG;
|
||||
import com.lzxnone.terraria.item.weapon.summon.Terraprisma;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -35,6 +38,7 @@ import java.util.Map;
|
||||
|
||||
public class ConfigList {
|
||||
public static final String WEAPON = "weapon";
|
||||
public static final String AMMO = "ammo";
|
||||
public static final String EFFECT = "effect";
|
||||
public static final String ENCHANTMENT = "enchantment";
|
||||
|
||||
@@ -66,20 +70,28 @@ public class ConfigList {
|
||||
Mace.CONFIG_LIST_ITEM,
|
||||
DevilsDevastation.CONFIG_LIST_ITEM,
|
||||
Terraprisma.CONFIG_LIST_ITEM,
|
||||
LastPrism.CONFIG_LIST_ITEM
|
||||
LastPrism.CONFIG_LIST_ITEM,
|
||||
SDMG.CONFIG_LIST_ITEM
|
||||
});
|
||||
ITEMS.put(EFFECT, new ConfigListItem[]{
|
||||
BloodButcheredEffect.CONFIG_LIST_ITEM,
|
||||
DemonicFlamesEffect.CONFIG_LIST_ITEM,
|
||||
SummonEffect.CONFIG_LIST_ITEM
|
||||
});
|
||||
ITEMS.put(AMMO, new ConfigListItem[]{
|
||||
MusketBall.CONFIG_LIST_ITEM,
|
||||
MeteorShot.CONFIG_LIST_ITEM
|
||||
});
|
||||
ITEMS.put(ENCHANTMENT, new ConfigListItem[]{
|
||||
ModEnchantmentConfigs.MANA_LEAK_CONFIG_LIST_ITEM,
|
||||
ModEnchantmentConfigs.MANA_EFFICIENCY_CONFIG_LIST_ITEM,
|
||||
ModEnchantmentConfigs.MANA_GATHERING_CONFIG_LIST_ITEM,
|
||||
ModEnchantmentConfigs.MANA_GATHERING_CURSE_CONFIG_LIST_ITEM,
|
||||
ModEnchantmentConfigs.ARCANE_AMPLIFICATION_CONFIG_LIST_ITEM,
|
||||
ModEnchantmentConfigs.SUMMON_AMPLIFICATION_CONFIG_LIST_ITEM
|
||||
ModEnchantmentConfigs.SUMMON_AMPLIFICATION_CONFIG_LIST_ITEM,
|
||||
ModEnchantmentConfigs.AMMO_EXHAUSTION_CONFIG_LIST_ITEM,
|
||||
ModEnchantmentConfigs.BULLET_HELL_CONFIG_LIST_ITEM,
|
||||
ModEnchantmentConfigs.GUNPOWDER_CONFIG_LIST_ITEM
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Map;
|
||||
|
||||
public class ConfigScreen {
|
||||
private static final ResourceLocation UI_PATH = ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "ui/config.xml");
|
||||
private static final String[] NAV_KEYS = {ConfigList.WEAPON, ConfigList.EFFECT, ConfigList.ENCHANTMENT};
|
||||
private static final String[] NAV_KEYS = {ConfigList.WEAPON, ConfigList.AMMO, ConfigList.EFFECT, ConfigList.ENCHANTMENT};
|
||||
private static String selectedNavKey = ConfigList.WEAPON;
|
||||
private static final Map<String, Integer> NAV_SELECTED_INDEXES = new HashMap<>();
|
||||
|
||||
@@ -32,6 +32,7 @@ public class ConfigScreen {
|
||||
|
||||
//为头部导航按钮设置回调
|
||||
findElement(ui, "nav-button-weapon", Button.class).setOnClick(event -> onNavSelected(ui, ConfigList.WEAPON));
|
||||
findElement(ui, "nav-button-ammo", Button.class).setOnClick(event -> onNavSelected(ui, ConfigList.AMMO));
|
||||
findElement(ui, "nav-button-effect", Button.class).setOnClick(event -> onNavSelected(ui, ConfigList.EFFECT));
|
||||
findElement(ui, "nav-button-enchantment", Button.class).setOnClick(event -> onNavSelected(ui, ConfigList.ENCHANTMENT));
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.lzxnone.terraria.utils;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummonBehaviors;
|
||||
import com.lzxnone.terraria.item.ModItems;
|
||||
import com.lzxnone.terraria.item.weapon.RangedWeapon;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
@@ -15,15 +16,20 @@ import net.minecraft.world.phys.Vec3;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
public class AmmoUtil {
|
||||
public static final Vector3f OFFSET = new Vector3f(-0.3f, 0, 1.5f);
|
||||
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.15f, 1.5f);
|
||||
|
||||
public static StaticSummon createAmmoSummon(Level level, Player player, ItemStack stack) {
|
||||
return createAmmoSummon(level, player, InteractionHand.MAIN_HAND, stack);
|
||||
}
|
||||
|
||||
public static StaticSummon createAmmoSummon(Level level, Player player, InteractionHand hand, ItemStack stack) {
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
|
||||
Vec3 eyePos = player.getEyePosition();
|
||||
Vector3f offset = getOffset(hand);
|
||||
Vec3 pos = new Vec3(
|
||||
eyePos.x + dirs[0].x * OFFSET.z + dirs[1].x * OFFSET.y + dirs[2].x * OFFSET.x,
|
||||
eyePos.y + dirs[0].y * OFFSET.z + dirs[1].y * OFFSET.y + dirs[2].y * OFFSET.x,
|
||||
eyePos.z + dirs[0].z * OFFSET.z + dirs[1].z * OFFSET.y + dirs[2].z * OFFSET.x
|
||||
eyePos.x + dirs[0].x * offset.z + dirs[1].x * offset.y + dirs[2].x * offset.x,
|
||||
eyePos.y + dirs[0].y * offset.z + dirs[1].y * offset.y + dirs[2].y * offset.x,
|
||||
eyePos.z + dirs[0].z * offset.z + dirs[1].z * offset.y + dirs[2].z * offset.x
|
||||
);
|
||||
|
||||
StaticSummon summon = new StaticSummon(ModEntities.STATIC_SUMMON.get(), level);
|
||||
@@ -44,6 +50,14 @@ public class AmmoUtil {
|
||||
return summon;
|
||||
}
|
||||
|
||||
public static Vector3f getOffset(InteractionHand hand) {
|
||||
return new Vector3f(
|
||||
hand == InteractionHand.OFF_HAND ? -OFFSET.x : OFFSET.x,
|
||||
OFFSET.y,
|
||||
OFFSET.z
|
||||
);
|
||||
}
|
||||
|
||||
public static void setMusketBall(StaticSummon summon) {
|
||||
summon.getEntityData().set(StaticSummon.BEHAVIOR, StaticSummonBehaviors.MUSKET_BALL);
|
||||
summon.getEntityData().set(StaticSummon.ITEM, new ItemStack(ModItems.BULLET_PROJECTILE.get()));
|
||||
@@ -61,6 +75,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);
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,9 @@
|
||||
"enchantment.lzxnoneterraria.mana_gathering_curse": "Mana Gathering Curse",
|
||||
"enchantment.lzxnoneterraria.arcane_amplification": "Arcane Amplification",
|
||||
"enchantment.lzxnoneterraria.summon_amplification": "Summon Amplification",
|
||||
"enchantment.lzxnoneterraria.ammo_exhaustion": "Ammo Exhaustion",
|
||||
"enchantment.lzxnoneterraria.bullet_hell": "Bullet Hell",
|
||||
"enchantment.lzxnoneterraria.gunpowder": "Gunpowder",
|
||||
"enchantment.lzxnoneterraria.barren_land": "Barren Land",
|
||||
|
||||
"death.attack.lzxnoneterraria.player_normal": "%1$s was slain by %2$s",
|
||||
@@ -86,6 +89,7 @@
|
||||
|
||||
"lzxnoneterraria.configuration.title": "LzxnoneTerraria Config",
|
||||
"lzxnoneterraria.configuration.nav_weapon": "Weapon",
|
||||
"lzxnoneterraria.configuration.nav_ammo": "Ammo",
|
||||
"lzxnoneterraria.configuration.nav_effect": "Effect",
|
||||
"lzxnoneterraria.configuration.nav_enchantment": "Enchantment",
|
||||
"lzxnoneterraria.configuration.reset_button": "Reset",
|
||||
@@ -103,6 +107,12 @@
|
||||
"lzxnoneterraria.configuration.arcane_amplification_damage_multiplier.tooltip": "Magic damage multiplier per Arcane Amplification level",
|
||||
"lzxnoneterraria.configuration.summon_amplification_damage_multiplier": "Summon Damage Multiplier",
|
||||
"lzxnoneterraria.configuration.summon_amplification_damage_multiplier.tooltip": "Summon damage multiplier per Summon Amplification level",
|
||||
"lzxnoneterraria.configuration.ammo_exhaustion_consume_bonus": "Extra Ammo Consume",
|
||||
"lzxnoneterraria.configuration.ammo_exhaustion_consume_bonus.tooltip": "Extra ammo consumed per Ammo Exhaustion level when ammo consumption triggers",
|
||||
"lzxnoneterraria.configuration.bullet_hell_not_consume_chance": "Ammo Consumption Skip Chance",
|
||||
"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.tooltip": "Ranged weapon damage multiplier per Gunpowder level",
|
||||
"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.tooltip": "Damage dealt per effect level",
|
||||
@@ -390,6 +400,23 @@
|
||||
"lzxnoneterraria.configuration.last_prism_mana_consume_rate.tooltip": "Mana consumed per tick while using",
|
||||
"lzxnoneterraria.configuration.last_prism_mana_recover_rate": "Mana Recover Rate",
|
||||
"lzxnoneterraria.configuration.last_prism_mana_recover_rate.tooltip": "Mana recovered per tick while not using",
|
||||
"lzxnoneterraria.configuration.musket_ball_settings": "Musket Ball Settings",
|
||||
"lzxnoneterraria.configuration.musket_ball_base_damage": "Base Damage",
|
||||
"lzxnoneterraria.configuration.musket_ball_base_damage.tooltip": "Base damage provided by the ammo",
|
||||
"lzxnoneterraria.configuration.musket_ball_speed": "Speed",
|
||||
"lzxnoneterraria.configuration.musket_ball_speed.tooltip": "Ammo movement speed per tick",
|
||||
"lzxnoneterraria.configuration.meteor_shot_settings": "Meteor Shot Settings",
|
||||
"lzxnoneterraria.configuration.meteor_shot_base_damage": "Base Damage",
|
||||
"lzxnoneterraria.configuration.meteor_shot_base_damage.tooltip": "Base damage provided by the ammo",
|
||||
"lzxnoneterraria.configuration.meteor_shot_speed": "Speed",
|
||||
"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.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",
|
||||
"lzxnoneterraria.configuration.sdmg_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.sdmg_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.devils_devastation_settings": "Devil's Devastation Settings",
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_time": "Kill Mode Duration",
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_time.tooltip": "Kill Mode duration in ticks",
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
"enchantment.lzxnoneterraria.mana_gathering_curse": "聚魔诅咒",
|
||||
"enchantment.lzxnoneterraria.arcane_amplification": "奥术增幅",
|
||||
"enchantment.lzxnoneterraria.summon_amplification": "召唤增幅",
|
||||
"enchantment.lzxnoneterraria.ammo_exhaustion": "弹尽粮绝",
|
||||
"enchantment.lzxnoneterraria.bullet_hell": "枪林弹雨",
|
||||
"enchantment.lzxnoneterraria.gunpowder": "火药",
|
||||
"enchantment.lzxnoneterraria.barren_land": "寸草不生",
|
||||
|
||||
"death.attack.lzxnoneterraria.player_normal": "%1$s 被 %2$s 击杀",
|
||||
@@ -85,6 +88,7 @@
|
||||
|
||||
"lzxnoneterraria.configuration.title": "LzxnoneTerraria 配置",
|
||||
"lzxnoneterraria.configuration.nav_weapon": "武器",
|
||||
"lzxnoneterraria.configuration.nav_ammo": "弹药",
|
||||
"lzxnoneterraria.configuration.nav_effect": "药水效果",
|
||||
"lzxnoneterraria.configuration.nav_enchantment": "附魔",
|
||||
"lzxnoneterraria.configuration.reset_button": "重置",
|
||||
@@ -102,6 +106,12 @@
|
||||
"lzxnoneterraria.configuration.arcane_amplification_damage_multiplier.tooltip": "每级奥术增幅对魔法伤害的倍率",
|
||||
"lzxnoneterraria.configuration.summon_amplification_damage_multiplier": "召唤伤害倍率",
|
||||
"lzxnoneterraria.configuration.summon_amplification_damage_multiplier.tooltip": "每级召唤增幅对召唤伤害的倍率",
|
||||
"lzxnoneterraria.configuration.ammo_exhaustion_consume_bonus": "弹药额外消耗",
|
||||
"lzxnoneterraria.configuration.ammo_exhaustion_consume_bonus.tooltip": "每级弹尽粮绝触发弹药消耗时额外消耗的弹药数量",
|
||||
"lzxnoneterraria.configuration.bullet_hell_not_consume_chance": "不触发弹药消耗概率",
|
||||
"lzxnoneterraria.configuration.bullet_hell_not_consume_chance.tooltip": "枪林弹雨每级独立避免弹药消耗的概率",
|
||||
"lzxnoneterraria.configuration.gunpowder_damage_multiplier": "远程伤害倍率",
|
||||
"lzxnoneterraria.configuration.gunpowder_damage_multiplier.tooltip": "每级火药对远程武器伤害的倍率",
|
||||
"lzxnoneterraria.configuration.effect_settings": "药水效果 设置",
|
||||
"lzxnoneterraria.configuration.blood_butcherer_damage_per_level": "血腥屠宰效果每级伤害",
|
||||
"lzxnoneterraria.configuration.blood_butcherer_damage_per_level.tooltip": "每级造成的伤害",
|
||||
@@ -389,6 +399,23 @@
|
||||
"lzxnoneterraria.configuration.last_prism_mana_consume_rate.tooltip": "使用时每刻消耗的魔力值",
|
||||
"lzxnoneterraria.configuration.last_prism_mana_recover_rate": "魔力恢复速率",
|
||||
"lzxnoneterraria.configuration.last_prism_mana_recover_rate.tooltip": "未使用时每刻恢复的魔力值",
|
||||
"lzxnoneterraria.configuration.musket_ball_settings": "火枪子弹 设置",
|
||||
"lzxnoneterraria.configuration.musket_ball_base_damage": "基础伤害",
|
||||
"lzxnoneterraria.configuration.musket_ball_base_damage.tooltip": "子弹自身提供的基础伤害",
|
||||
"lzxnoneterraria.configuration.musket_ball_speed": "速度",
|
||||
"lzxnoneterraria.configuration.musket_ball_speed.tooltip": "子弹每刻移动速度",
|
||||
"lzxnoneterraria.configuration.meteor_shot_settings": "流星弹 设置",
|
||||
"lzxnoneterraria.configuration.meteor_shot_base_damage": "基础伤害",
|
||||
"lzxnoneterraria.configuration.meteor_shot_base_damage.tooltip": "子弹自身提供的基础伤害",
|
||||
"lzxnoneterraria.configuration.meteor_shot_speed": "速度",
|
||||
"lzxnoneterraria.configuration.meteor_shot_speed.tooltip": "子弹每刻移动速度",
|
||||
"lzxnoneterraria.configuration.meteor_shot_max_hit": "最大命中数",
|
||||
"lzxnoneterraria.configuration.meteor_shot_max_hit.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",
|
||||
"lzxnoneterraria.configuration.sdmg_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.sdmg_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.devils_devastation_settings": "破灭魔王剑 设置",
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_time": "杀戮模式持续时间",
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_time.tooltip": "杀戮模式持续时间(刻)",
|
||||
|
||||
@@ -86,6 +86,10 @@
|
||||
background: sprite(lzxnoneterraria:textures/ui/nav_weapon_icon.png);
|
||||
}
|
||||
|
||||
.nav-img-ammo {
|
||||
background: sprite(lzxnoneterraria:textures/item/musket_ball.png);
|
||||
}
|
||||
|
||||
.nav-img-effect {
|
||||
background: sprite(lzxnoneterraria:textures/ui/nav_effect_icon.png);
|
||||
}
|
||||
|
||||
@@ -32,12 +32,12 @@
|
||||
"scale": [1.7, 0.85, 0.85]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [0, 90, 25],
|
||||
"rotation": [0, 90, 0],
|
||||
"translation": [1.13, 4.2, 0.0],
|
||||
"scale": [1.36, 0.68, 0.68]
|
||||
},
|
||||
"firstperson_lefthand": {
|
||||
"rotation": [0, -90, -25],
|
||||
"rotation": [0, -90, 0],
|
||||
"translation": [1.13, 4.2, 0.0],
|
||||
"scale": [1.36, 0.68, 0.68]
|
||||
}
|
||||
|
||||
@@ -17,6 +17,13 @@
|
||||
</button>
|
||||
<element class="nav-indicator"/>
|
||||
</element>
|
||||
<element id="nav-item-ammo" class="nav-item">
|
||||
<button id="nav-button-ammo" class="nav-button" text="">
|
||||
<element class="nav-img nav-img-ammo"/>
|
||||
<label class="nav-label"><lang key="lzxnoneterraria.configuration.nav_ammo"/></label>
|
||||
</button>
|
||||
<element class="nav-indicator"/>
|
||||
</element>
|
||||
<element id="nav-item-effect" class="nav-item">
|
||||
<button id="nav-button-effect" class="nav-button" text="">
|
||||
<element class="nav-img nav-img-effect"/>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"anvil_cost": 4,
|
||||
"description": {
|
||||
"translate": "enchantment.lzxnoneterraria.ammo_exhaustion"
|
||||
},
|
||||
"max_cost": {
|
||||
"base": 35,
|
||||
"per_level_above_first": 0
|
||||
},
|
||||
"max_level": 1,
|
||||
"min_cost": {
|
||||
"base": 10,
|
||||
"per_level_above_first": 0
|
||||
},
|
||||
"primary_items": "#lzxnoneterraria:ranged_weapons",
|
||||
"slots": [
|
||||
"mainhand"
|
||||
],
|
||||
"supported_items": "#lzxnoneterraria:ranged_weapons",
|
||||
"weight": 5
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"anvil_cost": 6,
|
||||
"description": {
|
||||
"translate": "enchantment.lzxnoneterraria.bullet_hell"
|
||||
},
|
||||
"max_cost": {
|
||||
"base": 55,
|
||||
"per_level_above_first": 12
|
||||
},
|
||||
"max_level": 3,
|
||||
"min_cost": {
|
||||
"base": 10,
|
||||
"per_level_above_first": 12
|
||||
},
|
||||
"primary_items": "#lzxnoneterraria:ranged_weapons",
|
||||
"slots": [
|
||||
"mainhand"
|
||||
],
|
||||
"supported_items": "#lzxnoneterraria:ranged_weapons",
|
||||
"weight": 5
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"anvil_cost": 6,
|
||||
"description": {
|
||||
"translate": "enchantment.lzxnoneterraria.gunpowder"
|
||||
},
|
||||
"max_cost": {
|
||||
"base": 60,
|
||||
"per_level_above_first": 15
|
||||
},
|
||||
"max_level": 3,
|
||||
"min_cost": {
|
||||
"base": 15,
|
||||
"per_level_above_first": 15
|
||||
},
|
||||
"primary_items": "#lzxnoneterraria:ranged_weapons",
|
||||
"slots": [
|
||||
"mainhand"
|
||||
],
|
||||
"supported_items": "#lzxnoneterraria:ranged_weapons",
|
||||
"weight": 3
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"lzxnoneterraria:sdmg"
|
||||
]
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
"replace": false,
|
||||
"values": [
|
||||
"lzxnoneterraria:mana_leak",
|
||||
"lzxnoneterraria:mana_gathering_curse"
|
||||
"lzxnoneterraria:mana_gathering_curse",
|
||||
"lzxnoneterraria:ammo_exhaustion"
|
||||
]
|
||||
}
|
||||
@@ -7,6 +7,9 @@
|
||||
"lzxnoneterraria:mana_gathering_curse",
|
||||
"lzxnoneterraria:arcane_amplification",
|
||||
"lzxnoneterraria:summon_amplification",
|
||||
"lzxnoneterraria:ammo_exhaustion",
|
||||
"lzxnoneterraria:bullet_hell",
|
||||
"lzxnoneterraria:gunpowder",
|
||||
"lzxnoneterraria:barren_land"
|
||||
]
|
||||
}
|
||||
@@ -6,6 +6,9 @@
|
||||
"lzxnoneterraria:mana_gathering",
|
||||
"lzxnoneterraria:arcane_amplification",
|
||||
"lzxnoneterraria:summon_amplification",
|
||||
"lzxnoneterraria:ammo_exhaustion",
|
||||
"lzxnoneterraria:bullet_hell",
|
||||
"lzxnoneterraria:gunpowder",
|
||||
"lzxnoneterraria:barren_land"
|
||||
]
|
||||
}
|
||||
@@ -7,6 +7,9 @@
|
||||
"lzxnoneterraria:mana_gathering_curse",
|
||||
"lzxnoneterraria:arcane_amplification",
|
||||
"lzxnoneterraria:summon_amplification",
|
||||
"lzxnoneterraria:ammo_exhaustion",
|
||||
"lzxnoneterraria:bullet_hell",
|
||||
"lzxnoneterraria:gunpowder",
|
||||
"lzxnoneterraria:barren_land"
|
||||
]
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
"values": [
|
||||
"#lzxnoneterraria:melee_weapons",
|
||||
"#lzxnoneterraria:magic_weapons",
|
||||
"#lzxnoneterraria:summon_weapons"
|
||||
"#lzxnoneterraria:summon_weapons",
|
||||
"#lzxnoneterraria:ranged_weapons"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user