v1.8.3
No files matched your search
@@ -7,6 +7,7 @@ import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.summon.BeeSummon;
|
||||
import com.lzxnone.terraria.item.ModItems;
|
||||
import com.lzxnone.terraria.item.armor.ModArmorMaterials;
|
||||
import com.lzxnone.terraria.particle.ModParticles;
|
||||
import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent;
|
||||
import org.slf4j.Logger;
|
||||
@@ -25,6 +26,7 @@ public class LzxnoneTerraria {
|
||||
//注册
|
||||
ModBlocks.BLOCKS.register(modEventBus);
|
||||
ModItems.ITEMS.register(modEventBus);
|
||||
ModArmorMaterials.ARMOR_MATERIALS.register(modEventBus);
|
||||
ModEffects.MOB_EFFECTS.register(modEventBus);
|
||||
ModEntities.ENTITY_TYPES.register(modEventBus);
|
||||
ModParticles.PARTICLE_TYPES.register(modEventBus);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria;
|
||||
|
||||
import com.lzxnone.terraria.client.ClientArmorRegistration;
|
||||
import com.lzxnone.terraria.ui.config.ConfigScreen;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.client.entity.beam.SwordBeamRenderer;
|
||||
@@ -51,6 +52,9 @@ public class LzxnoneTerrariaClient {
|
||||
event.registerEntityRenderer(ModEntities.BEE_SUMMON.get(), BeeRenderer::new);
|
||||
});
|
||||
|
||||
//护甲渲染与模型注册
|
||||
ClientArmorRegistration.register(modEventBus);
|
||||
|
||||
//粒子渲染
|
||||
modEventBus.addListener(RegisterParticleProvidersEvent.class, event -> {
|
||||
event.registerSpriteSet(ModParticles.DUST_PARTICLE.get(), DustParticle.Provider::new);
|
||||
|
||||
@@ -19,6 +19,10 @@ public class ModSounds {
|
||||
SOUND_EVENTS.register("beam2",
|
||||
() -> SoundEvent.createVariableRangeEvent(
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "beam2")));
|
||||
public static final Supplier<SoundEvent> BEAM3 =
|
||||
SOUND_EVENTS.register("beam3",
|
||||
() -> SoundEvent.createVariableRangeEvent(
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "beam3")));
|
||||
public static final Supplier<SoundEvent> BETSYS_FIREBALL_SHOOT =
|
||||
SOUND_EVENTS.register("betsys_fireball_shoot",
|
||||
() -> SoundEvent.createVariableRangeEvent(
|
||||
|
||||
@@ -50,4 +50,6 @@ public class ModAttachments {
|
||||
public static final Supplier<AttachmentType<List<Entity>>> ACTIVE_BEAMS =
|
||||
ATTACHMENT_TYPES.register("active_beams", () -> AttachmentType.<List<Entity>>builder((Supplier<List<Entity>>) ArrayList::new).build());
|
||||
|
||||
public static final Supplier<AttachmentType<Long>> LAST_ACCESSORY_FALLEN_STAR_TIME =
|
||||
ATTACHMENT_TYPES.register("last_accessory_fallen_star_time", () -> AttachmentType.builder(() -> 0L).serialize(Codec.LONG).copyOnDeath().build());
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class PlayerMana {
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
int maxMana = mana.getMaxMana();
|
||||
double regenSpeed = ((double) maxMana / 3.0D + 1.0D + manaRegenBonus) * standingBonus * regenCoeff * itemUseCoeff;
|
||||
double amount = regenSpeed * 3.0D / 40.0D;
|
||||
double amount = regenSpeed / 40.0D;
|
||||
return recoverMana(player, amount);
|
||||
}
|
||||
|
||||
@@ -122,6 +122,17 @@ public class PlayerMana {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean clearMana(ServerPlayer player) {
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
int oldMana = mana.getMana();
|
||||
mana.clearMana();
|
||||
player.setData(ModAttachments.PLAYER_MANA, mana);
|
||||
if(oldMana != 0) {
|
||||
PlayerManaSyncEventHandler.sync(player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean setBaseMaxMana(ServerPlayer player, int baseMaxMana) {
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
int oldMana = mana.getMana();
|
||||
@@ -167,6 +178,11 @@ public class PlayerMana {
|
||||
return mana >= (int) Math.floor(consumeProgress + amount);
|
||||
}
|
||||
|
||||
public void clearMana() {
|
||||
this.mana = 0;
|
||||
this.consumeProgress = 0.0D;
|
||||
}
|
||||
|
||||
//通过累加计数器消耗魔力
|
||||
private boolean consumeMana(double amount) {
|
||||
if(amount <= 0.0D) return true;
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.lzxnone.terraria.client;
|
||||
|
||||
import com.lzxnone.terraria.client.model.armor.RobeModel;
|
||||
import com.lzxnone.terraria.item.ModItems;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.HumanoidModel;
|
||||
import net.minecraft.client.model.Model;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
|
||||
import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions;
|
||||
import net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent;
|
||||
|
||||
public class ClientArmorRegistration {
|
||||
|
||||
public static void register(IEventBus modEventBus) {
|
||||
modEventBus.addListener(ClientArmorRegistration::onRegisterLayerDefinitions);
|
||||
modEventBus.addListener(ClientArmorRegistration::onRegisterClientExtensions);
|
||||
}
|
||||
|
||||
// 1. 注册 3D 护甲模型的骨骼网格定义
|
||||
public static void onRegisterLayerDefinitions(EntityRenderersEvent.RegisterLayerDefinitions event) {
|
||||
event.registerLayerDefinition(RobeModel.LAYER_LOCATION, RobeModel::createBodyLayer);
|
||||
}
|
||||
|
||||
// 2. 注册物品穿戴时的 3D 模型拦截与替换
|
||||
public static void onRegisterClientExtensions(RegisterClientExtensionsEvent event) {
|
||||
// 全部 7 种宝石长袍共享通用 3D 长袍模型(各自材质由 Material Layer 独立加载贴图)
|
||||
event.registerItem(new IClientItemExtensions() {
|
||||
private RobeModel model;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public Model getGenericArmorModel(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlot equipmentSlot, HumanoidModel<?> original) {
|
||||
if (this.model == null) {
|
||||
this.model = new RobeModel(Minecraft.getInstance().getEntityModels().bakeLayer(RobeModel.LAYER_LOCATION));
|
||||
}
|
||||
original.copyPropertiesTo((HumanoidModel) this.model);
|
||||
this.model.setAllVisible(false);
|
||||
this.model.body.visible = true;
|
||||
this.model.rightArm.visible = true;
|
||||
this.model.leftArm.visible = true;
|
||||
this.model.rightLeg.visible = true;
|
||||
this.model.leftLeg.visible = true;
|
||||
return this.model;
|
||||
}
|
||||
},
|
||||
ModItems.ROBE.get(),
|
||||
ModItems.AMETHYST_ROBE.get(),
|
||||
ModItems.TOPAZ_ROBE.get(),
|
||||
ModItems.SAPPHIRE_ROBE.get(),
|
||||
ModItems.EMERALD_ROBE.get(),
|
||||
ModItems.RUBY_ROBE.get(),
|
||||
ModItems.AMBER_ROBE.get(),
|
||||
ModItems.DIAMOND_ROBE.get()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.lzxnone.terraria.client.entity.projectile;
|
||||
|
||||
import com.lzxnone.terraria.client.item.accessory.ClientAccessoryFallenStar;
|
||||
import com.lzxnone.terraria.client.item.magic.ClientGemStaff;
|
||||
import com.lzxnone.terraria.client.item.magic.ClientStellarTune;
|
||||
import com.lzxnone.terraria.client.item.magic.ClientNebulaArcanum;
|
||||
import com.lzxnone.terraria.client.item.melee.ClientBladeOfGrass;
|
||||
@@ -42,6 +43,7 @@ public class ClientStaticProjectileRenderBehaviors {
|
||||
BEHAVIORS.put(StaticProjectileBehaviors.NEBULA_ARCANUM_ORBIT_PROJECTILE, ClientNebulaArcanum.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(StaticProjectileBehaviors.STELLAR_TUNE_PROJECTILE, ClientStellarTune.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(StaticProjectileBehaviors.STARDUST_CELL_PROJECTILE, ClientStardustCellStaff.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(StaticProjectileBehaviors.GEM_STAFF_PROJECTILE, ClientGemStaff.PROJECTILE_BEHAVIOR);
|
||||
}
|
||||
|
||||
public static IStaticProjectileRenderBehavior getBehavior(String id) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.lzxnone.terraria.client.item.accessory;
|
||||
import com.lzxnone.terraria.client.entity.projectile.IStaticProjectileRenderBehavior;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.item.effect.FallenStarSummoner;
|
||||
import com.lzxnone.terraria.utils.MathUtil;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
@@ -10,6 +11,7 @@ import com.mojang.math.Axis;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
@@ -18,13 +20,43 @@ import org.joml.Matrix4f;
|
||||
|
||||
public class ClientAccessoryFallenStar {
|
||||
private static final ResourceLocation STAR_WAVE_RES = ResourceLocation.parse("lzxnoneterraria:textures/vfx/star_wave.png");
|
||||
private static final float STAR_WAVE_HALF_WIDTH = 45 * 0.06F;
|
||||
private static final float STAR_WAVE_HALF_HEIGHT = 17 * 0.06F;
|
||||
private static final float STAR_WAVE_ALPHA = 0.5F;
|
||||
//紫色
|
||||
private static final float STAR_WAVE_COLOR_R = 0.7F;
|
||||
private static final float STAR_WAVE_COLOR_G = 0.3F;
|
||||
private static final float STAR_WAVE_COLOR_B = 1.0F;
|
||||
|
||||
// 大光波尺寸与偏移
|
||||
public static final float LARGE_STAR_WAVE_HALF_WIDTH = 45 * 0.06F;
|
||||
public static final float LARGE_STAR_WAVE_HALF_HEIGHT = 17 * 0.06F;
|
||||
public static final double LARGE_STAR_WAVE_OFFSET = 1.5D;
|
||||
|
||||
// 小光波尺寸与偏移(位于星星后方)
|
||||
public static final float SMALL_STAR_WAVE_HALF_WIDTH = 30 * 0.06F;
|
||||
public static final float SMALL_STAR_WAVE_HALF_HEIGHT = 11 * 0.06F;
|
||||
public static final double SMALL_STAR_WAVE_OFFSET = 2.5D;
|
||||
|
||||
// 颜色配置(静态变量)
|
||||
// 紫色(星星斗篷)
|
||||
public static final float PURPLE_R = 0.7F;
|
||||
public static final float PURPLE_G = 0.3F;
|
||||
public static final float PURPLE_B = 1.0F;
|
||||
|
||||
// 黄色(蜜蜂斗篷 / 星星面纱小光波)
|
||||
public static final float YELLOW_R = 1.0F;
|
||||
public static final float YELLOW_G = 0.9F;
|
||||
public static final float YELLOW_B = 0.2F;
|
||||
|
||||
// 粉色(星星面纱大光波)
|
||||
public static final float PINK_R = 1.0F;
|
||||
public static final float PINK_G = 0.4F;
|
||||
public static final float PINK_B = 0.7F;
|
||||
|
||||
// 深蓝色(魔力斗篷大光波)
|
||||
public static final float BLUE_R = 0.05F;
|
||||
public static final float BLUE_G = 0.2F;
|
||||
public static final float BLUE_B = 1.0F;
|
||||
|
||||
// 白色(魔力斗篷小光波)
|
||||
public static final float WHITE_R = 1.0F;
|
||||
public static final float WHITE_G = 1.0F;
|
||||
public static final float WHITE_B = 1.0F;
|
||||
|
||||
public static final IStaticProjectileRenderBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileRenderBehavior() {
|
||||
@Override
|
||||
@@ -38,25 +70,49 @@ public class ClientAccessoryFallenStar {
|
||||
};
|
||||
|
||||
private static void renderStarWave(StaticProjectile projectile, PoseStack poseStack, MultiBufferSource bufferSource) {
|
||||
CompoundTag customData = projectile.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
if(customData == null || !customData.contains("type")) return;
|
||||
|
||||
String type = customData.getString("type");
|
||||
if(type.isEmpty()) return;
|
||||
|
||||
Vec3 dir = projectile.getDeltaMovement().normalize();
|
||||
float[] xyRot = MathUtil.computeXYRot(dir.toVector3f());
|
||||
|
||||
switch(type) {
|
||||
case FallenStarSummoner.STAR_CLOAK -> {
|
||||
drawStarWave(poseStack, bufferSource, dir, xyRot, LARGE_STAR_WAVE_OFFSET, LARGE_STAR_WAVE_HALF_WIDTH, LARGE_STAR_WAVE_HALF_HEIGHT, PURPLE_R, PURPLE_G, PURPLE_B, STAR_WAVE_ALPHA);
|
||||
}
|
||||
case FallenStarSummoner.BEE_CLOAK -> {
|
||||
drawStarWave(poseStack, bufferSource, dir, xyRot, LARGE_STAR_WAVE_OFFSET, LARGE_STAR_WAVE_HALF_WIDTH, LARGE_STAR_WAVE_HALF_HEIGHT, YELLOW_R, YELLOW_G, YELLOW_B, STAR_WAVE_ALPHA);
|
||||
}
|
||||
case FallenStarSummoner.STAR_VEIL -> {
|
||||
drawStarWave(poseStack, bufferSource, dir, xyRot, LARGE_STAR_WAVE_OFFSET, LARGE_STAR_WAVE_HALF_WIDTH, LARGE_STAR_WAVE_HALF_HEIGHT, PINK_R, PINK_G, PINK_B, STAR_WAVE_ALPHA);
|
||||
drawStarWave(poseStack, bufferSource, dir, xyRot, SMALL_STAR_WAVE_OFFSET, SMALL_STAR_WAVE_HALF_WIDTH, SMALL_STAR_WAVE_HALF_HEIGHT, YELLOW_R, YELLOW_G, YELLOW_B, STAR_WAVE_ALPHA);
|
||||
}
|
||||
case FallenStarSummoner.MANA_CLOAK -> {
|
||||
drawStarWave(poseStack, bufferSource, dir, xyRot, LARGE_STAR_WAVE_OFFSET, LARGE_STAR_WAVE_HALF_WIDTH, LARGE_STAR_WAVE_HALF_HEIGHT, BLUE_R, BLUE_G, BLUE_B, STAR_WAVE_ALPHA);
|
||||
drawStarWave(poseStack, bufferSource, dir, xyRot, SMALL_STAR_WAVE_OFFSET, SMALL_STAR_WAVE_HALF_WIDTH, SMALL_STAR_WAVE_HALF_HEIGHT, WHITE_R, WHITE_G, WHITE_B, STAR_WAVE_ALPHA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void drawStarWave(PoseStack poseStack, MultiBufferSource bufferSource, Vec3 dir, float[] xyRot,
|
||||
double offsetDistance, float halfWidth, float halfHeight,
|
||||
float r, float g, float b, float alpha) {
|
||||
poseStack.pushPose();
|
||||
poseStack.translate(-dir.x * 1.5, -dir.y * 1.5, -dir.z * 1.5);
|
||||
poseStack.translate(-dir.x * offsetDistance, -dir.y * offsetDistance, -dir.z * offsetDistance);
|
||||
poseStack.mulPose(Axis.YP.rotationDegrees(-xyRot[1]));
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(xyRot[0]));
|
||||
poseStack.mulPose(Axis.ZP.rotationDegrees(90.0F));
|
||||
poseStack.mulPose(Axis.YP.rotationDegrees(270.0F));
|
||||
|
||||
VertexConsumer consumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(STAR_WAVE_RES));
|
||||
addQuad(consumer, poseStack.last().pose(), STAR_WAVE_HALF_WIDTH, STAR_WAVE_HALF_HEIGHT,
|
||||
STAR_WAVE_COLOR_R, STAR_WAVE_COLOR_G, STAR_WAVE_COLOR_B, STAR_WAVE_ALPHA);
|
||||
addQuad(consumer, poseStack.last().pose(), halfWidth, halfHeight, r, g, b, alpha);
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(60.0F));
|
||||
addQuad(consumer, poseStack.last().pose(), STAR_WAVE_HALF_WIDTH, STAR_WAVE_HALF_HEIGHT,
|
||||
STAR_WAVE_COLOR_R, STAR_WAVE_COLOR_G, STAR_WAVE_COLOR_B, STAR_WAVE_ALPHA);
|
||||
addQuad(consumer, poseStack.last().pose(), halfWidth, halfHeight, r, g, b, alpha);
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(60.0F));
|
||||
addQuad(consumer, poseStack.last().pose(), STAR_WAVE_HALF_WIDTH, STAR_WAVE_HALF_HEIGHT,
|
||||
STAR_WAVE_COLOR_R, STAR_WAVE_COLOR_G, STAR_WAVE_COLOR_B, STAR_WAVE_ALPHA);
|
||||
addQuad(consumer, poseStack.last().pose(), halfWidth, halfHeight, r, g, b, alpha);
|
||||
poseStack.popPose();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,355 @@
|
||||
package com.lzxnone.terraria.client.item.magic;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.client.entity.projectile.IStaticProjectileRenderBehavior;
|
||||
import com.lzxnone.terraria.client.event.ShaderRegistry;
|
||||
import com.lzxnone.terraria.entity.ModRenderTypes;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
import com.lzxnone.terraria.utils.MathUtil;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.shaders.Uniform;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.*;
|
||||
import com.mojang.math.Axis;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.ShaderInstance;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.neoforged.neoforge.client.GlStateBackup;
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Quaternionf;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ClientGemStaff {
|
||||
public static final ResourceLocation TRAIL_RES = ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/vfx/normal_trail2.png");
|
||||
public static final ResourceLocation SPARKLE_RES = ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/vfx/beam_sparkle.png");
|
||||
|
||||
// 超椭圆体基础尺寸:a = b = c
|
||||
private static final float BASE_RADIUS = 0.75f;
|
||||
private static final float DIAMOND_RADIUS = 1.5f;
|
||||
|
||||
// 消光系数, 核心比例, 外发光宽度, 核心亮度
|
||||
private static final float EXTINCTION = 6.0f;
|
||||
private static final float CORE_RATIO = 0.55f;
|
||||
private static final float AURA_WIDTH = 0.15f;
|
||||
private static final float CORE_BRIGHTNESS = 2.5f;
|
||||
|
||||
// 尾迹平面旋转角度(双交叉平面形成立体感)
|
||||
private static final float[] TRAIL_PLANE_ANGLES = new float[]{0.0f, 90.0f};
|
||||
|
||||
public static final IStaticProjectileRenderBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileRenderBehavior() {
|
||||
@Override
|
||||
public void render(Entity entity, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
|
||||
if (!(entity instanceof StaticProjectile proj)) return;
|
||||
|
||||
CompoundTag customData = proj.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
int skill = customData.getInt("skill");
|
||||
boolean diamond = (skill & GemStaff.SKILL_DIAMOND) != 0;
|
||||
|
||||
Vector3f color = new Vector3f(
|
||||
customData.contains("colorR") ? customData.getFloat("colorR") : proj.getEntityData().get(StaticProjectile.COLOR_R),
|
||||
customData.contains("colorG") ? customData.getFloat("colorG") : proj.getEntityData().get(StaticProjectile.COLOR_G),
|
||||
customData.contains("colorB") ? customData.getFloat("colorB") : proj.getEntityData().get(StaticProjectile.COLOR_B)
|
||||
);
|
||||
|
||||
// 1. 渲染 a=b=c 超椭圆体体积能量体(钻石尺寸更大)
|
||||
renderSuperellipsoid(proj, color, diamond, partialTick, poseStack, bufferSource);
|
||||
|
||||
// 2. 渲染优化后的双层尾迹
|
||||
renderTrail(proj, color, partialTick, poseStack, bufferSource);
|
||||
|
||||
// 3. 钻石专属:面向公告板的旋转 beam_sparkle
|
||||
if (diamond) {
|
||||
renderSparkle(proj, color, partialTick, poseStack, bufferSource);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static void renderSuperellipsoid(StaticProjectile proj, Vector3f color, boolean diamond, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource) {
|
||||
ShaderInstance shader = ShaderRegistry.getNightglowSuperellipsoid();
|
||||
if (shader == null) return;
|
||||
|
||||
poseStack.pushPose();
|
||||
|
||||
GlStateBackup backup = new GlStateBackup();
|
||||
RenderSystem.backupGlState(backup);
|
||||
ShaderInstance prevShader = RenderSystem.getShader();
|
||||
|
||||
try {
|
||||
if (bufferSource instanceof MultiBufferSource.BufferSource source) {
|
||||
source.endBatch();
|
||||
}
|
||||
|
||||
Vector3f motion = proj.getDeltaMovement().lengthSqr() > 1.0E-6D ?
|
||||
proj.getDeltaMovement().toVector3f() :
|
||||
proj.getEntityData().get(StaticProjectile.DIRECTION);
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(motion, proj.getYRot());
|
||||
|
||||
Matrix4f orientation = new Matrix4f(
|
||||
dirs[2].x, dirs[2].y, dirs[2].z, 0.0f, // col 0: right (X)
|
||||
dirs[1].x, dirs[1].y, dirs[1].z, 0.0f, // col 1: up (Y)
|
||||
dirs[0].x, dirs[0].y, dirs[0].z, 0.0f, // col 2: dir (Z)
|
||||
0.0f, 0.0f, 0.0f, 1.0f // col 3: translation
|
||||
);
|
||||
poseStack.mulPose(orientation);
|
||||
|
||||
Matrix4f modelMatrix = new Matrix4f(poseStack.last().pose());
|
||||
float renderTime = proj.tickCount + partialTick;
|
||||
|
||||
float radius = diamond ? DIAMOND_RADIUS : BASE_RADIUS;
|
||||
CompoundTag customData = proj.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
int skill = customData.getInt("skill");
|
||||
boolean emerald = (skill & GemStaff.SKILL_EMERALD) != 0;
|
||||
if(emerald) {
|
||||
float ratio = 1.0f - (float) proj.getEntityData().get(StaticProjectile.AGE) / proj.getEntityData().get(StaticProjectile.LIFETIME);
|
||||
radius = radius * ratio;
|
||||
}
|
||||
|
||||
Uniform modelMat = shader.getUniform("ModelMat");
|
||||
if (modelMat != null) modelMat.set(modelMatrix);
|
||||
|
||||
Uniform cameraLocalUniform = shader.getUniform("CameraLocal");
|
||||
if (cameraLocalUniform != null) {
|
||||
Vector3f cameraLocal = new Matrix4f(RenderSystem.getModelViewMatrix())
|
||||
.mul(modelMatrix)
|
||||
.invert()
|
||||
.transformPosition(new Vector3f());
|
||||
cameraLocalUniform.set(cameraLocal.x, cameraLocal.y, cameraLocal.z);
|
||||
}
|
||||
|
||||
Uniform dimensionsUniform = shader.getUniform("Dimensions");
|
||||
if (dimensionsUniform != null) {
|
||||
dimensionsUniform.set(radius, radius, radius);
|
||||
}
|
||||
|
||||
Uniform volumeParametersUniform = shader.getUniform("VolumeParameters");
|
||||
if (volumeParametersUniform != null) {
|
||||
volumeParametersUniform.set(EXTINCTION, CORE_RATIO, AURA_WIDTH, CORE_BRIGHTNESS);
|
||||
}
|
||||
|
||||
Uniform colorUniform = shader.getUniform("SuperellipsoidColor");
|
||||
if (colorUniform != null) {
|
||||
colorUniform.set(color.x, color.y, color.z);
|
||||
}
|
||||
|
||||
Uniform flowTimeUniform = shader.getUniform("FlowTime");
|
||||
if (flowTimeUniform != null) {
|
||||
flowTimeUniform.set(renderTime);
|
||||
}
|
||||
|
||||
// GL 状态:加法混合 + 深度测试 + 启用背面剔除
|
||||
RenderSystem.setShader(() -> shader);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFunc(
|
||||
GlStateManager.SourceFactor.SRC_ALPHA,
|
||||
GlStateManager.DestFactor.ONE
|
||||
);
|
||||
RenderSystem.enableDepthTest();
|
||||
RenderSystem.depthMask(true);
|
||||
RenderSystem.enableCull();
|
||||
|
||||
BufferBuilder bb = RenderSystem.renderThreadTesselator().begin(
|
||||
VertexFormat.Mode.TRIANGLES,
|
||||
DefaultVertexFormat.POSITION_COLOR
|
||||
);
|
||||
|
||||
// 立方体 AABB 包围盒
|
||||
float pad = 1.08f;
|
||||
float r = radius * pad;
|
||||
|
||||
// 6 个面,12 个三角形(正面向外)
|
||||
// +Z 面
|
||||
addCubeVertex(bb, -r, -r, r);
|
||||
addCubeVertex(bb, r, -r, r);
|
||||
addCubeVertex(bb, r, r, r);
|
||||
addCubeVertex(bb, -r, -r, r);
|
||||
addCubeVertex(bb, r, r, r);
|
||||
addCubeVertex(bb, -r, r, r);
|
||||
|
||||
// -Z 面
|
||||
addCubeVertex(bb, r, -r, -r);
|
||||
addCubeVertex(bb, -r, -r, -r);
|
||||
addCubeVertex(bb, -r, r, -r);
|
||||
addCubeVertex(bb, r, -r, -r);
|
||||
addCubeVertex(bb, -r, r, -r);
|
||||
addCubeVertex(bb, r, r, -r);
|
||||
|
||||
// +X 面
|
||||
addCubeVertex(bb, r, -r, r);
|
||||
addCubeVertex(bb, r, -r, -r);
|
||||
addCubeVertex(bb, r, r, -r);
|
||||
addCubeVertex(bb, r, -r, r);
|
||||
addCubeVertex(bb, r, r, -r);
|
||||
addCubeVertex(bb, r, r, r);
|
||||
|
||||
// -X 面
|
||||
addCubeVertex(bb, -r, -r, -r);
|
||||
addCubeVertex(bb, -r, -r, r);
|
||||
addCubeVertex(bb, -r, r, r);
|
||||
addCubeVertex(bb, -r, -r, -r);
|
||||
addCubeVertex(bb, -r, r, r);
|
||||
addCubeVertex(bb, -r, r, -r);
|
||||
|
||||
// +Y 面
|
||||
addCubeVertex(bb, -r, r, r);
|
||||
addCubeVertex(bb, r, r, r);
|
||||
addCubeVertex(bb, r, r, -r);
|
||||
addCubeVertex(bb, -r, r, r);
|
||||
addCubeVertex(bb, r, r, -r);
|
||||
addCubeVertex(bb, -r, r, -r);
|
||||
|
||||
// -Y 面
|
||||
addCubeVertex(bb, -r, -r, -r);
|
||||
addCubeVertex(bb, r, -r, -r);
|
||||
addCubeVertex(bb, r, -r, r);
|
||||
addCubeVertex(bb, -r, -r, -r);
|
||||
addCubeVertex(bb, r, -r, r);
|
||||
addCubeVertex(bb, -r, -r, r);
|
||||
|
||||
BufferUploader.drawWithShader(Objects.requireNonNull(bb.build()));
|
||||
} finally {
|
||||
poseStack.popPose();
|
||||
RenderSystem.depthMask(true);
|
||||
RenderSystem.enableDepthTest();
|
||||
RenderSystem.enableCull();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
if (prevShader != null) {
|
||||
RenderSystem.setShader(() -> prevShader);
|
||||
}
|
||||
RenderSystem.restoreGlState(backup);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addCubeVertex(BufferBuilder bb, float x, float y, float z) {
|
||||
bb.addVertex(x, y, z).setColor(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
private static void renderSparkle(StaticProjectile proj, Vector3f color, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource) {
|
||||
poseStack.pushPose();
|
||||
poseStack.mulPose(Minecraft.getInstance().getEntityRenderDispatcher().cameraOrientation());
|
||||
//float age = proj.tickCount + partialTick;
|
||||
poseStack.mulPose(Axis.ZP.rotationDegrees(45));
|
||||
|
||||
float size = 2.0f;
|
||||
CompoundTag customData = proj.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
int skill = customData.getInt("skill");
|
||||
boolean emerald = (skill & GemStaff.SKILL_EMERALD) != 0;
|
||||
if(emerald) {
|
||||
float ratio = 1.0f - (float) proj.getEntityData().get(StaticProjectile.AGE) / proj.getEntityData().get(StaticProjectile.LIFETIME);
|
||||
size = size * ratio;
|
||||
}
|
||||
VertexConsumer consumer = bufferSource.getBuffer(ModRenderTypes.entityAdditiveEmissive(SPARKLE_RES));
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
|
||||
consumer.addVertex(matrix, -size, -size, 0.0f)
|
||||
.setColor(color.x, color.y, color.z, 0.95f)
|
||||
.setUv(0.0f, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY)
|
||||
.setLight(LightTexture.FULL_BRIGHT)
|
||||
.setNormal(0.0f, 1.0f, 0.0f);
|
||||
consumer.addVertex(matrix, size, -size, 0.0f)
|
||||
.setColor(color.x, color.y, color.z, 0.95f)
|
||||
.setUv(1.0f, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY)
|
||||
.setLight(LightTexture.FULL_BRIGHT)
|
||||
.setNormal(0.0f, 1.0f, 0.0f);
|
||||
consumer.addVertex(matrix, size, size, 0.0f)
|
||||
.setColor(color.x, color.y, color.z, 0.95f)
|
||||
.setUv(1.0f, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY)
|
||||
.setLight(LightTexture.FULL_BRIGHT)
|
||||
.setNormal(0.0f, 1.0f, 0.0f);
|
||||
consumer.addVertex(matrix, -size, size, 0.0f)
|
||||
.setColor(color.x, color.y, color.z, 0.95f)
|
||||
.setUv(0.0f, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY)
|
||||
.setLight(LightTexture.FULL_BRIGHT)
|
||||
.setNormal(0.0f, 1.0f, 0.0f);
|
||||
|
||||
poseStack.popPose();
|
||||
}
|
||||
|
||||
private static void renderTrail(StaticProjectile proj, Vector3f color, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource) {
|
||||
LinkedList<Vec3> positions = proj.trailPositions;
|
||||
if (positions.size() < 6) return;
|
||||
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(ModRenderTypes.entityTranslucentEmissive(TRAIL_RES));
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
Vec3 renderOrigin = proj.getPosition(partialTick);
|
||||
|
||||
int sectionCount = positions.size() / 2;
|
||||
int quadCount = sectionCount - 1;
|
||||
|
||||
for (float planeAngle : TRAIL_PLANE_ANGLES) {
|
||||
// 第一段尾迹不渲染 (i 从 1 开始),防止尾迹超出飞弹位置
|
||||
for (int i = 1; i < quadCount; i++) {
|
||||
Vec3 pLeft0 = positions.get(i * 2);
|
||||
Vec3 pRight0 = positions.get(i * 2 + 1);
|
||||
Vec3 pLeft1 = positions.get((i + 1) * 2);
|
||||
Vec3 pRight1 = positions.get((i + 1) * 2 + 1);
|
||||
|
||||
Vec3 center0 = pLeft0.add(pRight0).scale(0.5D);
|
||||
Vec3 center1 = pLeft1.add(pRight1).scale(0.5D);
|
||||
Vec3 half0 = pRight0.subtract(pLeft0).scale(0.5D);
|
||||
Vec3 half1 = pRight1.subtract(pLeft1).scale(0.5D);
|
||||
Vec3 segmentDir = center1.subtract(center0);
|
||||
|
||||
if (planeAngle != 0.0f && segmentDir.lengthSqr() > 1.0E-6D) {
|
||||
Quaternionf rotation = new Quaternionf().fromAxisAngleRad(
|
||||
segmentDir.normalize().toVector3f(),
|
||||
(float) Math.toRadians(planeAngle)
|
||||
);
|
||||
half0 = MathUtil.toVec3(half0.toVector3f().rotate(rotation));
|
||||
half1 = MathUtil.toVec3(half1.toVector3f().rotate(rotation));
|
||||
}
|
||||
|
||||
float widthScale0 = 1.0f - (float) (i - 1) / (quadCount - 1);
|
||||
float widthScale1 = 1.0f - (float) i / (quadCount - 1);
|
||||
|
||||
float u0 = (float) (i - 1) / (quadCount - 1);
|
||||
float u1 = (float) i / (quadCount - 1);
|
||||
|
||||
// 双层条带:Layer 0 为外层彩色光翼,Layer 1 为内层纯白强光激光芯
|
||||
for (int layer = 0; layer < 2; layer++) {
|
||||
boolean isCore = (layer == 1);
|
||||
float layerWidthMult = isCore ? 0.40f : 1.10f;
|
||||
float r0 = isCore ? 1.0f : color.x;
|
||||
float g0 = isCore ? 1.0f : color.y;
|
||||
float b0 = isCore ? 1.0f : color.z;
|
||||
float a0 = isCore ? widthScale0 : widthScale0 * 0.85f;
|
||||
float a1 = isCore ? widthScale1 : widthScale1 * 0.85f;
|
||||
|
||||
Vec3 scaledHalf0 = half0.scale(widthScale0 * layerWidthMult);
|
||||
Vec3 scaledHalf1 = half1.scale(widthScale1 * layerWidthMult);
|
||||
|
||||
Vec3 left0 = center0.subtract(scaledHalf0).subtract(renderOrigin);
|
||||
Vec3 right0 = center0.add(scaledHalf0).subtract(renderOrigin);
|
||||
Vec3 left1 = center1.subtract(scaledHalf1).subtract(renderOrigin);
|
||||
Vec3 right1 = center1.add(scaledHalf1).subtract(renderOrigin);
|
||||
|
||||
vertexConsumer.addVertex(matrix, (float) left0.x, (float) left0.y, (float) left0.z)
|
||||
.setColor(r0, g0, b0, a0).setUv(u0, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(LightTexture.FULL_BRIGHT).setNormal(0.0f, 1.0f, 0.0f);
|
||||
vertexConsumer.addVertex(matrix, (float) right0.x, (float) right0.y, (float) right0.z)
|
||||
.setColor(r0, g0, b0, a0).setUv(u0, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(LightTexture.FULL_BRIGHT).setNormal(0.0f, 1.0f, 0.0f);
|
||||
vertexConsumer.addVertex(matrix, (float) right1.x, (float) right1.y, (float) right1.z)
|
||||
.setColor(r0, g0, b0, a1).setUv(u1, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(LightTexture.FULL_BRIGHT).setNormal(0.0f, 1.0f, 0.0f);
|
||||
vertexConsumer.addVertex(matrix, (float) left1.x, (float) left1.y, (float) left1.z)
|
||||
.setColor(r0, g0, b0, a1).setUv(u1, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(LightTexture.FULL_BRIGHT).setNormal(0.0f, 1.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.lzxnone.terraria.client.model.armor;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import net.minecraft.client.model.HumanoidArmorModel;
|
||||
import net.minecraft.client.model.geom.ModelLayerLocation;
|
||||
import net.minecraft.client.model.geom.ModelPart;
|
||||
import net.minecraft.client.model.geom.PartPose;
|
||||
import net.minecraft.client.model.geom.builders.*;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
||||
public class RobeModel extends HumanoidArmorModel<LivingEntity> {
|
||||
public static final ModelLayerLocation LAYER_LOCATION =
|
||||
new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "robe"), "main");
|
||||
|
||||
public RobeModel(ModelPart root) {
|
||||
super(root);
|
||||
}
|
||||
|
||||
public static LayerDefinition createBodyLayer() {
|
||||
MeshDefinition meshdefinition = HumanoidArmorModel.createMesh(new CubeDeformation(0.5F), 0.0F);
|
||||
PartDefinition partdefinition = meshdefinition.getRoot();
|
||||
|
||||
// 躯干 (长袍身体)
|
||||
partdefinition.addOrReplaceChild("body",
|
||||
CubeListBuilder.create()
|
||||
.texOffs(16, 32).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, new CubeDeformation(0.25F)),
|
||||
PartPose.ZERO
|
||||
);
|
||||
|
||||
// 右臂
|
||||
partdefinition.addOrReplaceChild("right_arm",
|
||||
CubeListBuilder.create()
|
||||
.texOffs(40, 32).addBox(-3.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.25F)),
|
||||
PartPose.ZERO
|
||||
);
|
||||
|
||||
// 左臂
|
||||
partdefinition.addOrReplaceChild("left_arm",
|
||||
CubeListBuilder.create()
|
||||
.texOffs(48, 48).addBox(-1.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.25F)),
|
||||
PartPose.ZERO
|
||||
);
|
||||
|
||||
// 右腿
|
||||
partdefinition.addOrReplaceChild("right_leg",
|
||||
CubeListBuilder.create()
|
||||
.texOffs(0, 32).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.25F)),
|
||||
PartPose.offset(-1.9F, 12.0F, 0.0F)
|
||||
);
|
||||
|
||||
// 左腿
|
||||
partdefinition.addOrReplaceChild("left_leg",
|
||||
CubeListBuilder.create()
|
||||
.texOffs(0, 48).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.25F)),
|
||||
PartPose.offset(1.9F, 12.0F, 0.0F)
|
||||
);
|
||||
|
||||
return LayerDefinition.create(meshdefinition, 64, 64);
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,21 @@ public class ModCreativeModeTabs {
|
||||
output.accept(ModItems.BUBBLE_GUN.get());
|
||||
output.accept(ModItems.NIGHTGLOW.get());
|
||||
output.accept(ModItems.ARC_SURGE.get());
|
||||
output.accept(ModItems.AMETHYST_STAFF.get());
|
||||
output.accept(ModItems.TOPAZ_STAFF.get());
|
||||
output.accept(ModItems.SAPPHIRE_STAFF.get());
|
||||
output.accept(ModItems.EMERALD_STAFF.get());
|
||||
output.accept(ModItems.RUBY_STAFF.get());
|
||||
output.accept(ModItems.AMBER_STAFF.get());
|
||||
output.accept(ModItems.DIAMOND_STAFF.get());
|
||||
output.accept(ModItems.ROBE.get());
|
||||
output.accept(ModItems.AMETHYST_ROBE.get());
|
||||
output.accept(ModItems.TOPAZ_ROBE.get());
|
||||
output.accept(ModItems.SAPPHIRE_ROBE.get());
|
||||
output.accept(ModItems.EMERALD_ROBE.get());
|
||||
output.accept(ModItems.RUBY_ROBE.get());
|
||||
output.accept(ModItems.AMBER_ROBE.get());
|
||||
output.accept(ModItems.DIAMOND_ROBE.get());
|
||||
output.accept(ModItems.MANA_CRYSTAL.get());
|
||||
output.accept(ModItems.LESSER_MANA_POTION.get());
|
||||
output.accept(ModItems.MANA_POTION.get());
|
||||
@@ -85,6 +100,7 @@ public class ModCreativeModeTabs {
|
||||
output.accept(ModItems.COBALT_SHIELD.get());
|
||||
output.accept(ModItems.OBSIDIAN_SHIELD.get());
|
||||
output.accept(ModItems.ANKH_SHIELD.get());
|
||||
output.accept(ModItems.RESTORATION_SHIELD.get());
|
||||
output.accept(ModItems.AVENGER_EMBLEM.get());
|
||||
output.accept(ModItems.CROSS_NECKLACE.get());
|
||||
output.accept(ModItems.STAR_CLOAK.get());
|
||||
@@ -113,6 +129,7 @@ public class ModCreativeModeTabs {
|
||||
output.accept(ModItems.STINGER_NECKLACE.get());
|
||||
output.accept(ModItems.BEE_CLOAK.get());
|
||||
output.accept(ModItems.BLACK_BELT.get());
|
||||
output.accept(ModItems.MYSTIC_ARTS_SASH.get());
|
||||
output.accept(ModItems.TITAN_GLOVE.get());
|
||||
output.accept(ModItems.FERAL_CLAWS.get());
|
||||
output.accept(ModItems.POWER_GLOVE.get());
|
||||
@@ -170,17 +187,6 @@ public class ModCreativeModeTabs {
|
||||
output.accept(ModItems.RECON_SCOPE.get());
|
||||
}).build());
|
||||
|
||||
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> BLOCK_TAB = CREATIVE_MODE_TABS.register("lzxnoneterraria_block_0", () -> CreativeModeTab.builder()
|
||||
.title(Component.translatable("itemGroup.lzxnoneterraria.block"))
|
||||
.icon(() -> ModItems.VISION.get().getDefaultInstance())
|
||||
.displayItems((parameters, output) -> {
|
||||
output.accept(ModItems.VISION.get());
|
||||
output.accept(ModItems.STARDUST_DRAGON_HEAD.get());
|
||||
output.accept(ModItems.STARDUST_DRAGON_BODY_A.get());
|
||||
output.accept(ModItems.STARDUST_DRAGON_BODY_B.get());
|
||||
output.accept(ModItems.STARDUST_DRAGON_TAIL.get());
|
||||
}).build());
|
||||
|
||||
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> RANGED_TAB = CREATIVE_MODE_TABS.register("lzxnoneterraria_ranged_0", () -> CreativeModeTab.builder()
|
||||
.title(Component.translatable("itemGroup.lzxnoneterraria.ranged"))
|
||||
.icon(() -> ModItems.SDMG.get().getDefaultInstance())
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.lzxnone.terraria.effect;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffectCategory;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
||||
public class ManaSurgeEffect extends MobEffect {
|
||||
public static final ConfigDouble DAMAGE_MULTIPLIER = new ConfigDouble(
|
||||
"effect.mana_surge.damage_multiplier",
|
||||
"mana_surge_damage_multiplier",
|
||||
1.2D,
|
||||
0.0D,
|
||||
100.0D
|
||||
);
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(DAMAGE_MULTIPLIER);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"mana_surge",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/mob_effect/mana_surge.png"),
|
||||
Component.translatable("effect.lzxnoneterraria.mana_surge"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public ManaSurgeEffect() {
|
||||
super(MobEffectCategory.BENEFICIAL, 0x00E5FF);
|
||||
}
|
||||
|
||||
public static float getMagicDamageMultiplier(LivingEntity entity) {
|
||||
if(entity == null) return 1.0F;
|
||||
MobEffectInstance instance = entity.getEffect(ModEffects.MANA_SURGE);
|
||||
if(instance == null) return 1.0F;
|
||||
int level = instance.getAmplifier() + 1;
|
||||
return (float) Math.pow(DAMAGE_MULTIPLIER.get(), level);
|
||||
}
|
||||
}
|
||||
@@ -46,4 +46,6 @@ public class ModEffects {
|
||||
MOB_EFFECTS.register("zapped_red", ZappedRedEffect::new);
|
||||
public static final DeferredHolder<MobEffect, ManaRegenerationEffect> MANA_REGENERATION =
|
||||
MOB_EFFECTS.register("mana_regeneration", ManaRegenerationEffect::new);
|
||||
public static final DeferredHolder<MobEffect, ManaSurgeEffect> MANA_SURGE =
|
||||
MOB_EFFECTS.register("mana_surge", ManaSurgeEffect::new);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.entity.projectile;
|
||||
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.EntityHitResult;
|
||||
|
||||
@@ -12,4 +13,7 @@ public interface IStaticProjectileBehavior {
|
||||
projectile.discard();
|
||||
}
|
||||
}
|
||||
default AABB getBoundingBoxForCulling(StaticProjectile projectile) {
|
||||
return projectile.getBoundingBox();
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.world.phys.*;
|
||||
import net.objecthunter.exp4j.Expression;
|
||||
import net.objecthunter.exp4j.ExpressionBuilder;
|
||||
import org.joml.Vector3f;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
@@ -166,6 +167,21 @@ public class StaticProjectile extends Projectile {
|
||||
}
|
||||
}
|
||||
|
||||
public void setExpressionX(String expr) {
|
||||
this.entityData.set(EXPRESSION_X, expr);
|
||||
this.exprX = new ExpressionBuilder(expr).variables("t").build();
|
||||
}
|
||||
|
||||
public void setExpressionY(String expr) {
|
||||
this.entityData.set(EXPRESSION_Y, expr);
|
||||
this.exprY = new ExpressionBuilder(expr).variables("t").build();
|
||||
}
|
||||
|
||||
public void setExpressionZ(String expr) {
|
||||
this.entityData.set(EXPRESSION_Z, expr);
|
||||
this.exprZ = new ExpressionBuilder(expr).variables("t").build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
@@ -339,4 +355,9 @@ public class StaticProjectile extends Projectile {
|
||||
super.onHitBlock(result);
|
||||
StaticProjectileBehaviors.getBehavior(this.entityData.get(BEHAVIOR)).onHitBlock(this, result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull AABB getBoundingBoxForCulling() {
|
||||
return StaticProjectileBehaviors.getBehavior(this.entityData.get(BEHAVIOR)).getBoundingBoxForCulling(this);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.item.ammo.CrystalBullet;
|
||||
import com.lzxnone.terraria.item.effect.FallenStarSummoner;
|
||||
import com.lzxnone.terraria.item.weapon.magic.NebulaArcanum;
|
||||
import com.lzxnone.terraria.item.weapon.magic.StellarTune;
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
import com.lzxnone.terraria.item.weapon.melee.*;
|
||||
import com.lzxnone.terraria.item.weapon.melee.flail.Flail;
|
||||
import com.lzxnone.terraria.item.weapon.ranged.Flamethrower;
|
||||
@@ -39,6 +40,7 @@ public class StaticProjectileBehaviors {
|
||||
public static final String NEBULA_ARCANUM_ORBIT_PROJECTILE = "nebula_arcanum_orbit_projectile";
|
||||
public static final String STELLAR_TUNE_PROJECTILE = "stellar_tune_projectile";
|
||||
public static final String STARDUST_CELL_PROJECTILE = "stardust_cell_projectile";
|
||||
public static final String GEM_STAFF_PROJECTILE = "gem_staff_projectile";
|
||||
|
||||
static {
|
||||
BEHAVIORS.put(DEFAULT, new IStaticProjectileBehavior() {
|
||||
@@ -74,6 +76,7 @@ public class StaticProjectileBehaviors {
|
||||
BEHAVIORS.put(NEBULA_ARCANUM_ORBIT_PROJECTILE, NebulaArcanum.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(STELLAR_TUNE_PROJECTILE, StellarTune.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(STARDUST_CELL_PROJECTILE, StardustCellStaff.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(GEM_STAFF_PROJECTILE, GemStaff.PROJECTILE_BEHAVIOR);
|
||||
}
|
||||
|
||||
public static IStaticProjectileBehavior getBehavior(String id) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.item.ammo.*;
|
||||
import com.lzxnone.terraria.item.normal.FallenStar;
|
||||
import com.lzxnone.terraria.item.normal.ManaStar;
|
||||
import com.lzxnone.terraria.item.weapon.magic.*;
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
import com.lzxnone.terraria.item.weapon.melee.flail.Flail;
|
||||
import com.lzxnone.terraria.item.weapon.ranged.ElfMelter;
|
||||
import com.lzxnone.terraria.item.weapon.melee.*;
|
||||
@@ -63,6 +64,7 @@ public class StaticSummonBehaviors {
|
||||
public static final String POSSESSION_VISION = "possession_vision";
|
||||
public static final String NIGHTGLOW_PROJECTILE = "nightglow_projectile";
|
||||
public static final String ARC_SURGE_LIGHTNING = "arc_surge_lightning";
|
||||
public static final String GEM_STAFF_PROJECTILE = "gem_staff_projectile";
|
||||
|
||||
//通用子弹实体
|
||||
public static final String MUSKET_BALL = "musket_ball";
|
||||
@@ -128,6 +130,7 @@ public class StaticSummonBehaviors {
|
||||
BEHAVIORS.put(POSSESSION_VISION, Possession.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(NIGHTGLOW_PROJECTILE, Nightglow.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(ARC_SURGE_LIGHTNING, ArcSurge.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(GEM_STAFF_PROJECTILE, GemStaff.SUMMON_BEHAVIOR);
|
||||
|
||||
BEHAVIORS.put(MUSKET_BALL, MusketBall.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(METEOR_SHOT, MeteorShot.SUMMON_BEHAVIOR);
|
||||
|
||||
@@ -106,6 +106,7 @@ public class EffectLogicHandler {
|
||||
return
|
||||
effect == ModEffects.CONFUSED
|
||||
|| effect == ModEffects.KILL_MODE
|
||||
|| effect == ModEffects.KILL_MODE_COOLDOWN;
|
||||
|| effect == ModEffects.KILL_MODE_COOLDOWN
|
||||
|| effect == ModEffects.MANA_SURGE;
|
||||
}
|
||||
}
|
||||
@@ -217,8 +217,11 @@ public class EntityEventHandler {
|
||||
Possession.markEvent(event);
|
||||
|
||||
if(event.getEntity() instanceof Player player) {
|
||||
//无敌时间
|
||||
AccessoryUtil.applyInvulnerableTimeModifier(player);
|
||||
AccessoryUtil.applyFallenStarSummoner(player);
|
||||
//生成坠星
|
||||
AccessoryUtil.applyFallenStarSummonerOnHurt(player);
|
||||
//生成蜜蜂
|
||||
AccessoryUtil.applyBeeSummoner(player);
|
||||
//受到伤害后触发恐慌加速
|
||||
if(AccessoryUtil.canApplyPanic(player) && PanicNecklace.DURATION.get() > 0) {
|
||||
@@ -271,6 +274,7 @@ public class EntityEventHandler {
|
||||
summon.getEntityData().set(StaticSummon.GLOW, true);
|
||||
CompoundTag customData = new CompoundTag();
|
||||
customData.putInt("mana", 100);
|
||||
customData.putDouble("min_attract_range", 4.0D);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
livingEntity.level().addFreshEntity(summon);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.lzxnone.terraria.attachment.ModAttachments;
|
||||
import com.lzxnone.terraria.attachment.PlayerMana;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.item.accessory.AccessoryUtil;
|
||||
import com.lzxnone.terraria.item.armor.ArmorUtil;
|
||||
import com.lzxnone.terraria.item.weapon.MagicWeapon;
|
||||
import com.lzxnone.terraria.network.payload.ManaSyncPayload;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -44,10 +45,10 @@ public class PlayerManaSyncEventHandler {
|
||||
public static void onPlayerTick(PlayerTickEvent.Post event) {
|
||||
if(!(event.getEntity() instanceof ServerPlayer player)) return;
|
||||
|
||||
//刷新饰品最大魔力加成
|
||||
//刷新饰品与防具最大魔力加成
|
||||
if(player.tickCount % 20 == 0) {
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
int bonus = AccessoryUtil.getMaxManaBonus(player);
|
||||
int bonus = AccessoryUtil.getMaxManaBonus(player) + ArmorUtil.getMaxManaBonus(player);
|
||||
if(mana.getBonusMaxMana() != bonus) {
|
||||
PlayerMana.setBonusMaxMana(player, bonus);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.lzxnone.terraria.item.normal.FallenStar;
|
||||
import com.lzxnone.terraria.item.potion.*;
|
||||
import com.lzxnone.terraria.item.weapon.ranged.ElfMelter;
|
||||
import com.lzxnone.terraria.item.weapon.magic.*;
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.*;
|
||||
import com.lzxnone.terraria.item.weapon.melee.*;
|
||||
import com.lzxnone.terraria.item.weapon.ranged.Flamethrower;
|
||||
import com.lzxnone.terraria.item.weapon.ranged.SnowballCannon;
|
||||
@@ -64,6 +65,13 @@ public class ModItems {
|
||||
public static final DeferredItem<Item> BUBBLE_GUN = ITEMS.register("bubble_gun", BubbleGun::new);
|
||||
public static final DeferredItem<Item> NIGHTGLOW = ITEMS.register("nightglow", Nightglow::new);
|
||||
public static final DeferredItem<Item> ARC_SURGE = ITEMS.register("arc_surge", ArcSurge::new);
|
||||
public static final DeferredItem<Item> AMETHYST_STAFF = ITEMS.register("amethyst_staff", AmethystStaff::new);
|
||||
public static final DeferredItem<Item> TOPAZ_STAFF = ITEMS.register("topaz_staff", TopazStaff::new);
|
||||
public static final DeferredItem<Item> SAPPHIRE_STAFF = ITEMS.register("sapphire_staff", SapphireStaff::new);
|
||||
public static final DeferredItem<Item> EMERALD_STAFF = ITEMS.register("emerald_staff", EmeraldStaff::new);
|
||||
public static final DeferredItem<Item> RUBY_STAFF = ITEMS.register("ruby_staff", RubyStaff::new);
|
||||
public static final DeferredItem<Item> AMBER_STAFF = ITEMS.register("amber_staff", AmberStaff::new);
|
||||
public static final DeferredItem<Item> DIAMOND_STAFF = ITEMS.register("diamond_staff", DiamondStaff::new);
|
||||
|
||||
//远程武器
|
||||
public static final DeferredItem<Item> MUSKET = ITEMS.register("musket", Musket::new);
|
||||
@@ -135,6 +143,7 @@ public class ModItems {
|
||||
public static final DeferredItem<Item> COBALT_SHIELD = ITEMS.register("cobalt_shield", CobaltShield::new);
|
||||
public static final DeferredItem<Item> OBSIDIAN_SHIELD = ITEMS.register("obsidian_shield", ObsidianShield::new);
|
||||
public static final DeferredItem<Item> ANKH_SHIELD = ITEMS.register("ankh_shield", AnkhShield::new);
|
||||
public static final DeferredItem<Item> RESTORATION_SHIELD = ITEMS.register("restoration_shield", RestorationShield::new);
|
||||
public static final DeferredItem<Item> AVENGER_EMBLEM = ITEMS.register("avenger_emblem", AvengerEmblem::new);
|
||||
public static final DeferredItem<Item> CROSS_NECKLACE = ITEMS.register("cross_necklace", CrossNecklace::new);
|
||||
public static final DeferredItem<Item> STAR_CLOAK = ITEMS.register("star_cloak", StarCloak::new);
|
||||
@@ -163,6 +172,7 @@ public class ModItems {
|
||||
public static final DeferredItem<Item> STINGER_NECKLACE = ITEMS.register("stinger_necklace", StingerNecklace::new);
|
||||
public static final DeferredItem<Item> BEE_CLOAK = ITEMS.register("bee_cloak", BeeCloak::new);
|
||||
public static final DeferredItem<Item> BLACK_BELT = ITEMS.register("black_belt", BlackBelt::new);
|
||||
public static final DeferredItem<Item> MYSTIC_ARTS_SASH = ITEMS.register("mystic_arts_sash", MysticArtsSash::new);
|
||||
public static final DeferredItem<Item> TITAN_GLOVE = ITEMS.register("titan_glove", TitanGlove::new);
|
||||
public static final DeferredItem<Item> FERAL_CLAWS = ITEMS.register("feral_claws", FeralClaws::new);
|
||||
public static final DeferredItem<Item> POWER_GLOVE = ITEMS.register("power_glove", PowerGlove::new);
|
||||
@@ -219,6 +229,16 @@ public class ModItems {
|
||||
public static final DeferredItem<Item> SNIPER_SCOPE = ITEMS.register("sniper_scope", SniperScope::new);
|
||||
public static final DeferredItem<Item> RECON_SCOPE = ITEMS.register("recon_scope", ReconScope::new);
|
||||
|
||||
//盔甲
|
||||
public static final DeferredItem<Item> ROBE = ITEMS.register("robe", com.lzxnone.terraria.item.armor.Robe::new);
|
||||
public static final DeferredItem<Item> AMETHYST_ROBE = ITEMS.register("amethyst_robe", com.lzxnone.terraria.item.armor.AmethystRobe::new);
|
||||
public static final DeferredItem<Item> TOPAZ_ROBE = ITEMS.register("topaz_robe", com.lzxnone.terraria.item.armor.TopazRobe::new);
|
||||
public static final DeferredItem<Item> SAPPHIRE_ROBE = ITEMS.register("sapphire_robe", com.lzxnone.terraria.item.armor.SapphireRobe::new);
|
||||
public static final DeferredItem<Item> EMERALD_ROBE = ITEMS.register("emerald_robe", com.lzxnone.terraria.item.armor.EmeraldRobe::new);
|
||||
public static final DeferredItem<Item> RUBY_ROBE = ITEMS.register("ruby_robe", com.lzxnone.terraria.item.armor.RubyRobe::new);
|
||||
public static final DeferredItem<Item> AMBER_ROBE = ITEMS.register("amber_robe", com.lzxnone.terraria.item.armor.AmberRobe::new);
|
||||
public static final DeferredItem<Item> DIAMOND_ROBE = ITEMS.register("diamond_robe", com.lzxnone.terraria.item.armor.DiamondRobe::new);
|
||||
|
||||
//食物
|
||||
public static final DeferredItem<Item> MANA_CRYSTAL = ITEMS.register("mana_crystal", ManaCrystal::new);
|
||||
|
||||
@@ -254,7 +274,9 @@ public class ModItems {
|
||||
public static final DeferredItem<Item> GOLDEN_BULLET_PROJECTILE = ITEMS.register("golden_bullet_projectile", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> LUMINITE_BULLET_PROJECTILE = ITEMS.register("luminite_bullet_projectile", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> WHITE_STAR = ITEMS.register("white_star", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> WHITE_STAR2 = ITEMS.register("white_star2", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> MANA_STAR = ITEMS.register("mana_star", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> MANA_STAR2 = ITEMS.register("mana_star2", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> BUBBLE_GUN_PROJECTILE = ITEMS.register("bubble_gun_projectile", () -> new Item(new Item.Properties()));
|
||||
public static final DeferredItem<Item> VORTEX_ROCKET = ITEMS.register("vortex_rocket", () -> new Item(new Item.Properties()));
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.lzxnone.terraria.item.accessory;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.attachment.ModAttachments;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
@@ -17,12 +18,12 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
@@ -490,55 +491,106 @@ public class AccessoryUtil {
|
||||
entity.invulnerableTime = (int) finalTime;
|
||||
}
|
||||
|
||||
public static void applyFallenStarSummoner(LivingEntity entity) {
|
||||
boolean[] result = {false};
|
||||
boolean[] summonManaStar = {false};
|
||||
public static String getFallenStar(LivingEntity entity) {
|
||||
String[] result = {"", FallenStarSummoner.STAR_CLOAK, FallenStarSummoner.STAR_VEIL, FallenStarSummoner.BEE_CLOAK, FallenStarSummoner.MANA_CLOAK};
|
||||
int[] idx = {0};
|
||||
AccessoryUtil.forEachAccessory(entity, (accessory, stack) -> {
|
||||
if(result[0]) return;
|
||||
if(accessory instanceof FallenStarSummoner summoner) {
|
||||
result[0] = summoner.summonThreeFallenStar(stack, entity);
|
||||
if(summoner.summonManaStarOnLanding(stack, entity)) summonManaStar[0] = true;
|
||||
if(accessory instanceof ManaCloak) {
|
||||
idx[0] = Math.max(idx[0], 4);
|
||||
}else if(accessory instanceof BeeCloak) {
|
||||
idx[0] = Math.max(idx[0], 3);
|
||||
}else if(accessory instanceof StarVeil) {
|
||||
idx[0] = Math.max(idx[0], 2);
|
||||
}else if(accessory instanceof StarCloak) {
|
||||
idx[0] = Math.max(idx[0], 1);
|
||||
}
|
||||
});
|
||||
if(result[0]) {
|
||||
SoundUtil.playServerSound(entity.level(), ModSounds.STAR_FALL.get(), entity.position());
|
||||
return result[idx[0]];
|
||||
}
|
||||
|
||||
public static StaticProjectile createFallenStar(LivingEntity summoner, Entity target, String type, Double damage) {
|
||||
Vec3 targetPos = target.position();
|
||||
Vec3 spawnPos = new Vec3(
|
||||
targetPos.x + 5.0 * (Math.random() * 2 - 1),
|
||||
targetPos.y + 12,
|
||||
targetPos.z + 5.0 * (Math.random() * 2 - 1)
|
||||
);
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(new Vec3(targetPos.x - spawnPos.x, targetPos.y - spawnPos.y, targetPos.z - spawnPos.z).toVector3f(), 0);
|
||||
|
||||
StaticProjectile projectile = new StaticProjectile(ModEntities.STATIC_PROJECTILE.get(), target.level());
|
||||
projectile.setOwner(summoner);
|
||||
projectile.setPos(spawnPos);
|
||||
projectile.getEntityData().set(StaticProjectile.BEHAVIOR, StaticProjectileBehaviors.ACCESSORY_FALLEN_STAR_PROJECTILE);
|
||||
projectile.getEntityData().set(StaticProjectile.RENDER_MODE, "custom");
|
||||
projectile.getEntityData().set(StaticProjectile.ORIGIN, MathUtil.toVector3f(spawnPos));
|
||||
projectile.getEntityData().set(StaticProjectile.ITEM, new ItemStack(ModItems.WHITE_STAR2.get()));
|
||||
projectile.getEntityData().set(StaticProjectile.LIFETIME, 300);
|
||||
projectile.getEntityData().set(StaticProjectile.DIRECTION, dirs[0]);
|
||||
projectile.getEntityData().set(StaticProjectile.UP, dirs[1]);
|
||||
projectile.getEntityData().set(StaticProjectile.RIGHT, dirs[2]);
|
||||
projectile.getEntityData().set(StaticProjectile.GLOW, true);
|
||||
projectile.getEntityData().set(StaticProjectile.RXP, 90);
|
||||
projectile.getEntityData().set(StaticProjectile.RYPS, 18);
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", 2.0));
|
||||
|
||||
CompoundTag customData = new CompoundTag();
|
||||
customData.putInt("targetLifetime", (int) Math.floor(targetPos.distanceTo(spawnPos) / 2.0));
|
||||
customData.putString("type", type);
|
||||
customData.putDouble("damage", damage);
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, customData);
|
||||
|
||||
projectile.setDeltaMovement(MathUtil.toVec3(dirs[0]));
|
||||
return projectile;
|
||||
}
|
||||
|
||||
public static void applyFallenStarSummonerOnHurt(LivingEntity entity) {
|
||||
String star = getFallenStar(entity);
|
||||
if(star.equals(FallenStarSummoner.STAR_CLOAK)) {
|
||||
for(int i = 0;i < 3;i++) {
|
||||
Vec3 targetPos = entity.position();
|
||||
|
||||
Vec3 spawnPos = new Vec3(
|
||||
targetPos.x + 5.0 * (Math.random() * 2 - 1),
|
||||
targetPos.y + 12,
|
||||
targetPos.z + 5.0 * (Math.random() * 2 - 1)
|
||||
);
|
||||
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(new Vec3(targetPos.x - spawnPos.x, targetPos.y - spawnPos.y, targetPos.z - spawnPos.z).toVector3f(), 0);
|
||||
|
||||
StaticProjectile projectile = new StaticProjectile(ModEntities.STATIC_PROJECTILE.get(), entity.level());
|
||||
projectile.setOwner(entity);
|
||||
projectile.setPos(spawnPos);
|
||||
projectile.getEntityData().set(StaticProjectile.BEHAVIOR, StaticProjectileBehaviors.ACCESSORY_FALLEN_STAR_PROJECTILE);
|
||||
projectile.getEntityData().set(StaticProjectile.RENDER_MODE, "custom");
|
||||
projectile.getEntityData().set(StaticProjectile.ORIGIN, MathUtil.toVector3f(spawnPos));
|
||||
projectile.getEntityData().set(StaticProjectile.ITEM, new ItemStack(ModItems.WHITE_STAR.get()));
|
||||
projectile.getEntityData().set(StaticProjectile.LIFETIME, 300);
|
||||
projectile.getEntityData().set(StaticProjectile.DIRECTION, dirs[0]);
|
||||
projectile.getEntityData().set(StaticProjectile.UP, dirs[1]);
|
||||
projectile.getEntityData().set(StaticProjectile.RIGHT, dirs[2]);
|
||||
projectile.getEntityData().set(StaticProjectile.GLOW, true);
|
||||
projectile.getEntityData().set(StaticProjectile.RXP, 90);
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", 2.0));
|
||||
|
||||
CompoundTag customData = new CompoundTag();
|
||||
customData.putInt("targetLifetime", (int) Math.floor(targetPos.distanceTo(spawnPos) / 2.0));
|
||||
if(summonManaStar[0] && i == 0) customData.putBoolean("summonManaStar", true);
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, customData);
|
||||
|
||||
projectile.setDeltaMovement(MathUtil.toVec3(dirs[0]));
|
||||
StaticProjectile projectile = createFallenStar(entity, entity, FallenStarSummoner.STAR_CLOAK, StarCloak.FALLEN_STAR_DAMAGE.get());
|
||||
entity.level().addFreshEntity(projectile);
|
||||
SoundUtil.playServerSound(entity.level(), ModSounds.STAR_FALL.get(), projectile.position());
|
||||
}
|
||||
}else if(star.equals(FallenStarSummoner.STAR_VEIL)) {
|
||||
for(int i = 0;i < 3;i++) {
|
||||
StaticProjectile projectile = createFallenStar(entity, entity, FallenStarSummoner.STAR_VEIL, StarVeil.FALLEN_STAR_DAMAGE.get());
|
||||
entity.level().addFreshEntity(projectile);
|
||||
SoundUtil.playServerSound(entity.level(), ModSounds.STAR_FALL.get(), projectile.position());
|
||||
}
|
||||
}else if(star.equals(FallenStarSummoner.BEE_CLOAK)) {
|
||||
for(int i = 0;i < 3;i++) {
|
||||
StaticProjectile projectile = createFallenStar(entity, entity, FallenStarSummoner.BEE_CLOAK, BeeCloak.FALLEN_STAR_DAMAGE.get());
|
||||
entity.level().addFreshEntity(projectile);
|
||||
SoundUtil.playServerSound(entity.level(), ModSounds.STAR_FALL.get(), projectile.position());
|
||||
}
|
||||
}else if(star.equals(FallenStarSummoner.MANA_CLOAK)) {
|
||||
for(int i = 0;i < 3;i++) {
|
||||
StaticProjectile projectile = createFallenStar(entity, entity, FallenStarSummoner.MANA_CLOAK, ManaCloak.FALLEN_STAR_DAMAGE.get());
|
||||
entity.level().addFreshEntity(projectile);
|
||||
SoundUtil.playServerSound(entity.level(), ModSounds.STAR_FALL.get(), projectile.position());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void applyFallenStarSummonerOnAttack(LivingEntity entity, Entity target) {
|
||||
if(entity.level().isClientSide()) return;
|
||||
LzxnoneTerraria.LOGGER.info("11");
|
||||
String star = getFallenStar(entity);
|
||||
if(star.equals(FallenStarSummoner.MANA_CLOAK)) {
|
||||
long gameTime = entity.level().getGameTime();
|
||||
long lastTime = entity.getData(ModAttachments.LAST_ACCESSORY_FALLEN_STAR_TIME);
|
||||
int cooldown = ManaCloak.ATTACK_COOLDOWN.get();
|
||||
if(gameTime - lastTime < cooldown) return;
|
||||
|
||||
StaticProjectile projectile = createFallenStar(entity, target, FallenStarSummoner.MANA_CLOAK, ManaCloak.FALLEN_STAR_DAMAGE.get());
|
||||
CompoundTag customData = projectile.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
customData.putBoolean("summonManaStar", true);
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, customData);
|
||||
entity.level().addFreshEntity(projectile);
|
||||
entity.setData(ModAttachments.LAST_ACCESSORY_FALLEN_STAR_TIME, gameTime);
|
||||
SoundUtil.playServerSound(entity.level(), ModSounds.STAR_FALL.get(), projectile.position());
|
||||
}
|
||||
}
|
||||
|
||||
public static void applyBeeSummoner(LivingEntity entity) {
|
||||
int[] maxCount = {0};
|
||||
|
||||
@@ -46,13 +46,8 @@ public class BeeCloak extends AccessoryItem implements FallenStarSummoner, BeeSu
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean summonThreeFallenStar(ItemStack stack, LivingEntity entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallenStarDamage(ItemStack stack, LivingEntity entity) {
|
||||
return FALLEN_STAR_DAMAGE.get();
|
||||
public String getStar(ItemStack stack, LivingEntity entity) {
|
||||
return FallenStarSummoner.BEE_CLOAK;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.lzxnone.terraria.item.effect.ManaCostModifier;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigInt;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -34,24 +35,21 @@ public class ManaCloak extends AccessoryItem implements FallenStarSummoner, Mana
|
||||
0.0D,
|
||||
1.0D
|
||||
);
|
||||
public static final ConfigInt ATTACK_COOLDOWN = new ConfigInt(
|
||||
"accessory.mana_cloak.attack_cooldown",
|
||||
"attack_cooldown",
|
||||
20,
|
||||
0,
|
||||
1200
|
||||
);
|
||||
|
||||
public ManaCloak() {
|
||||
super(new Item.Properties().stacksTo(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean summonThreeFallenStar(ItemStack stack, LivingEntity entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallenStarDamage(ItemStack stack, LivingEntity entity) {
|
||||
return FALLEN_STAR_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean summonManaStarOnLanding(ItemStack stack, LivingEntity entity) {
|
||||
return true;
|
||||
public String getStar(ItemStack stack, LivingEntity entity) {
|
||||
return FallenStarSummoner.MANA_CLOAK;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,7 +65,7 @@ public class ManaCloak extends AccessoryItem implements FallenStarSummoner, Mana
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(FALLEN_STAR_DAMAGE, MANA_COST_MULTIPLIER);
|
||||
ConfigStruct.loadAll(FALLEN_STAR_DAMAGE, MANA_COST_MULTIPLIER, ATTACK_COOLDOWN);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -82,7 +80,7 @@ public class ManaCloak extends AccessoryItem implements FallenStarSummoner, Mana
|
||||
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
||||
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.fallen_star_summon"
|
||||
"tooltip.lzxnoneterraria.mana_cloak_fallen_star_summon"
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
if(MANA_COST_MULTIPLIER.get() != 1.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.lzxnone.terraria.item.accessory;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.item.effect.EffectTooltipUtil;
|
||||
import com.lzxnone.terraria.item.effect.LifeRegenerationModifier;
|
||||
import com.lzxnone.terraria.item.effect.ManaRegenerationModifier;
|
||||
import com.lzxnone.terraria.item.effect.MaxManaModifier;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
@@ -19,12 +20,12 @@ import net.minecraft.world.item.TooltipFlag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ManaRegenerationBand extends AccessoryItem implements ManaRegenerationModifier, MaxManaModifier {
|
||||
public class ManaRegenerationBand extends AccessoryItem implements ManaRegenerationModifier, MaxManaModifier, LifeRegenerationModifier {
|
||||
//最大魔力加成
|
||||
public static final ConfigInt MAX_MANA_BONUS = new ConfigInt(
|
||||
"accessory.mana_regeneration_band.max_mana_bonus",
|
||||
"max_mana_bonus",
|
||||
20,
|
||||
40,
|
||||
0,
|
||||
400
|
||||
);
|
||||
@@ -36,6 +37,14 @@ public class ManaRegenerationBand extends AccessoryItem implements ManaRegenerat
|
||||
0.0D,
|
||||
1000.0D
|
||||
);
|
||||
//每秒生命回复量
|
||||
public static final ConfigDouble HEALTH_PER_SECOND = new ConfigDouble(
|
||||
"accessory.mana_regeneration_band.health_per_second",
|
||||
"health_per_second",
|
||||
0.2D,
|
||||
0.0D,
|
||||
1000.0D
|
||||
);
|
||||
|
||||
public ManaRegenerationBand() {
|
||||
super(new Item.Properties().stacksTo(1));
|
||||
@@ -51,10 +60,15 @@ public class ManaRegenerationBand extends AccessoryItem implements ManaRegenerat
|
||||
return MANA_REGEN_BONUS.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getHealthPerSecond(ItemStack stack, LivingEntity entity) {
|
||||
return HEALTH_PER_SECOND.get().floatValue();
|
||||
}
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(MAX_MANA_BONUS, MANA_REGEN_BONUS);
|
||||
ConfigStruct.loadAll(MAX_MANA_BONUS, MANA_REGEN_BONUS, HEALTH_PER_SECOND);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -68,6 +82,12 @@ public class ManaRegenerationBand extends AccessoryItem implements ManaRegenerat
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
||||
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
|
||||
if(HEALTH_PER_SECOND.get() > 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.life_regen",
|
||||
EffectTooltipUtil.formatNumber(HEALTH_PER_SECOND.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(MAX_MANA_BONUS.get() > 0) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.max_mana_bonus",
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.lzxnone.terraria.item.accessory;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.item.effect.DamageImmunityModifier;
|
||||
import com.lzxnone.terraria.item.effect.EffectTooltipUtil;
|
||||
import com.lzxnone.terraria.item.effect.LifeRegenerationModifier;
|
||||
import com.lzxnone.terraria.item.effect.ManaRegenerationModifier;
|
||||
import com.lzxnone.terraria.item.effect.MaxManaModifier;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigInt;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Rarity;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MysticArtsSash extends AccessoryItem implements MaxManaModifier, ManaRegenerationModifier, LifeRegenerationModifier, DamageImmunityModifier {
|
||||
public static final ConfigDouble DAMAGE_IMMUNITY_CHANCE = new ConfigDouble(
|
||||
"accessory.mystic_arts_sash.damage_immunity",
|
||||
"damage_immunity",
|
||||
0.1D,
|
||||
0.0D,
|
||||
1.0D
|
||||
);
|
||||
public static final ConfigInt MAX_MANA_BONUS = new ConfigInt(
|
||||
"accessory.mystic_arts_sash.max_mana_bonus",
|
||||
"max_mana_bonus",
|
||||
40,
|
||||
0,
|
||||
400
|
||||
);
|
||||
public static final ConfigDouble MANA_REGEN_BONUS = new ConfigDouble(
|
||||
"accessory.mystic_arts_sash.mana_regen_bonus",
|
||||
"mana_regen_bonus",
|
||||
60.0D,
|
||||
0.0D,
|
||||
1000.0D
|
||||
);
|
||||
public static final ConfigDouble HEALTH_PER_SECOND = new ConfigDouble(
|
||||
"accessory.mystic_arts_sash.health_per_second",
|
||||
"health_per_second",
|
||||
0.2D,
|
||||
0.0D,
|
||||
1000.0D
|
||||
);
|
||||
|
||||
public MysticArtsSash() {
|
||||
super(new Item.Properties().stacksTo(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDamageImmunityChance(ItemStack stack, LivingEntity entity) {
|
||||
return DAMAGE_IMMUNITY_CHANCE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxManaBonus(ItemStack stack, LivingEntity entity) {
|
||||
return MAX_MANA_BONUS.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getManaRegenBonus(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_REGEN_BONUS.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getHealthPerSecond(ItemStack stack, LivingEntity entity) {
|
||||
return HEALTH_PER_SECOND.get().floatValue();
|
||||
}
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(DAMAGE_IMMUNITY_CHANCE, MAX_MANA_BONUS, MANA_REGEN_BONUS, HEALTH_PER_SECOND);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"mystic_arts_sash",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/mystic_arts_sash.png"),
|
||||
Component.translatable("item.lzxnoneterraria.mystic_arts_sash"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
||||
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
|
||||
if(HEALTH_PER_SECOND.get() > 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.life_regen",
|
||||
EffectTooltipUtil.formatNumber(HEALTH_PER_SECOND.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(MAX_MANA_BONUS.get() > 0) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.max_mana_bonus",
|
||||
EffectTooltipUtil.formatNumber(MAX_MANA_BONUS.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(MANA_REGEN_BONUS.get() > 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.mana_regen_bonus",
|
||||
EffectTooltipUtil.formatNumber(MANA_REGEN_BONUS.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(DAMAGE_IMMUNITY_CHANCE.get() > 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.damage_immunity",
|
||||
EffectTooltipUtil.formatNumber(DAMAGE_IMMUNITY_CHANCE.get() * 100.0D)
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package com.lzxnone.terraria.item.accessory;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.MultimapBuilder;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.item.effect.EffectTooltipUtil;
|
||||
import com.lzxnone.terraria.item.effect.LifeRegenerationModifier;
|
||||
import com.lzxnone.terraria.item.effect.ManaRegenerationModifier;
|
||||
import com.lzxnone.terraria.item.effect.MaxManaModifier;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigInt;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Rarity;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import top.theillusivec4.curios.api.SlotContext;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RestorationShield extends AccessoryItem implements MaxManaModifier, ManaRegenerationModifier, LifeRegenerationModifier {
|
||||
public static final ConfigDouble KNOCKBACK_RESISTANCE = new ConfigDouble(
|
||||
"accessory.restoration_shield.knockback_resistance",
|
||||
"knockback_resistance",
|
||||
1.0D,
|
||||
0.0D,
|
||||
1.0D
|
||||
);
|
||||
public static final ConfigDouble DEFENSE = new ConfigDouble(
|
||||
"accessory.restoration_shield.defense",
|
||||
"defense",
|
||||
1.0D,
|
||||
0.0D,
|
||||
100.0D
|
||||
);
|
||||
public static final ConfigInt MAX_MANA_BONUS = new ConfigInt(
|
||||
"accessory.restoration_shield.max_mana_bonus",
|
||||
"max_mana_bonus",
|
||||
40,
|
||||
0,
|
||||
400
|
||||
);
|
||||
public static final ConfigDouble MANA_REGEN_BONUS = new ConfigDouble(
|
||||
"accessory.restoration_shield.mana_regen_bonus",
|
||||
"mana_regen_bonus",
|
||||
60.0D,
|
||||
0.0D,
|
||||
1000.0D
|
||||
);
|
||||
public static final ConfigDouble HEALTH_PER_SECOND = new ConfigDouble(
|
||||
"accessory.restoration_shield.health_per_second",
|
||||
"health_per_second",
|
||||
0.2D,
|
||||
0.0D,
|
||||
1000.0D
|
||||
);
|
||||
|
||||
public RestorationShield() {
|
||||
super(new Item.Properties().stacksTo(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap<Holder<Attribute>, AttributeModifier> getAttributeModifiers(SlotContext slotContext, ResourceLocation id, ItemStack stack) {
|
||||
Multimap<Holder<Attribute>, AttributeModifier> modifiers = MultimapBuilder.hashKeys().arrayListValues().build();
|
||||
double knockback = KNOCKBACK_RESISTANCE.get();
|
||||
if(knockback != 0.0D) {
|
||||
modifiers.put(
|
||||
Attributes.KNOCKBACK_RESISTANCE,
|
||||
new AttributeModifier(
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "restoration_shield_knockback_resistance"),
|
||||
knockback,
|
||||
AttributeModifier.Operation.ADD_VALUE
|
||||
)
|
||||
);
|
||||
}
|
||||
double defense = DEFENSE.get();
|
||||
if(defense != 0.0D) {
|
||||
modifiers.put(
|
||||
Attributes.ARMOR,
|
||||
new AttributeModifier(
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "restoration_shield_defense"),
|
||||
defense,
|
||||
AttributeModifier.Operation.ADD_VALUE
|
||||
)
|
||||
);
|
||||
}
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxManaBonus(ItemStack stack, LivingEntity entity) {
|
||||
return MAX_MANA_BONUS.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getManaRegenBonus(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_REGEN_BONUS.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getHealthPerSecond(ItemStack stack, LivingEntity entity) {
|
||||
return HEALTH_PER_SECOND.get().floatValue();
|
||||
}
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(KNOCKBACK_RESISTANCE, DEFENSE, MAX_MANA_BONUS, MANA_REGEN_BONUS, HEALTH_PER_SECOND);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"restoration_shield",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/restoration_shield.png"),
|
||||
Component.translatable("item.lzxnoneterraria.restoration_shield"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
||||
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
|
||||
if(KNOCKBACK_RESISTANCE.get() != 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.knockback_resistance_bonus",
|
||||
EffectTooltipUtil.formatNumber(KNOCKBACK_RESISTANCE.get() * 100.0D)
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(DEFENSE.get() != 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.defense_bonus",
|
||||
EffectTooltipUtil.formatNumber(DEFENSE.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(HEALTH_PER_SECOND.get() > 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.life_regen",
|
||||
EffectTooltipUtil.formatNumber(HEALTH_PER_SECOND.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(MAX_MANA_BONUS.get() > 0) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.max_mana_bonus",
|
||||
EffectTooltipUtil.formatNumber(MAX_MANA_BONUS.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
if(MANA_REGEN_BONUS.get() > 0.0D) {
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.mana_regen_bonus",
|
||||
EffectTooltipUtil.formatNumber(MANA_REGEN_BONUS.get())
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,13 +30,8 @@ public class StarCloak extends AccessoryItem implements FallenStarSummoner {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean summonThreeFallenStar(ItemStack stack, LivingEntity entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallenStarDamage(ItemStack stack, LivingEntity entity) {
|
||||
return FALLEN_STAR_DAMAGE.get();
|
||||
public String getStar(ItemStack stack, LivingEntity entity) {
|
||||
return FallenStarSummoner.STAR_CLOAK;
|
||||
}
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
|
||||
@@ -39,13 +39,8 @@ public class StarVeil extends AccessoryItem implements FallenStarSummoner, Invul
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean summonThreeFallenStar(ItemStack stack, LivingEntity entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getFallenStarDamage(ItemStack stack, LivingEntity entity) {
|
||||
return FALLEN_STAR_DAMAGE.get();
|
||||
public String getStar(ItemStack stack, LivingEntity entity) {
|
||||
return FallenStarSummoner.STAR_VEIL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
|
||||
public class AmberRobe extends GemRobe {
|
||||
public static final int MAX_MANA_BONUS = 60;
|
||||
public static final double MANA_COST_MULTIPLIER = 0.87D;
|
||||
public static final int SKILL_MASK = GemStaff.SKILL_AMBER;
|
||||
|
||||
public AmberRobe() {
|
||||
super(ModArmorMaterials.AMBER_ROBE, MAX_MANA_BONUS, MANA_COST_MULTIPLIER, SKILL_MASK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
|
||||
public class AmethystRobe extends GemRobe {
|
||||
public static final int MAX_MANA_BONUS = 20;
|
||||
public static final double MANA_COST_MULTIPLIER = 0.95D;
|
||||
public static final int SKILL_MASK = GemStaff.SKILL_AMETHYST;
|
||||
|
||||
public AmethystRobe() {
|
||||
super(ModArmorMaterials.AMETHYST_ROBE, MAX_MANA_BONUS, MANA_COST_MULTIPLIER, SKILL_MASK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.effect.ManaCostModifier;
|
||||
import com.lzxnone.terraria.item.effect.MaxManaModifier;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public class ArmorUtil {
|
||||
|
||||
public static void forEachArmor(LivingEntity entity, BiConsumer<Object, ItemStack> consumer) {
|
||||
if(entity == null) return;
|
||||
for(ItemStack stack : entity.getArmorSlots()) {
|
||||
if(!stack.isEmpty()) {
|
||||
consumer.accept(stack.getItem(), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 最大魔力加成:累加所有防具的加成
|
||||
public static int getMaxManaBonus(LivingEntity entity) {
|
||||
int[] bonus = {0};
|
||||
forEachArmor(entity, (armor, stack) -> {
|
||||
if(armor instanceof MaxManaModifier modifier) {
|
||||
bonus[0] += modifier.getMaxManaBonus(stack, entity);
|
||||
}
|
||||
});
|
||||
return bonus[0];
|
||||
}
|
||||
|
||||
// 魔力消耗倍率:累乘所有防具的倍率
|
||||
public static double getManaCostMultiplier(LivingEntity entity) {
|
||||
double[] multiplier = {1.0D};
|
||||
forEachArmor(entity, (armor, stack) -> {
|
||||
if(armor instanceof ManaCostModifier modifier) {
|
||||
multiplier[0] *= modifier.getManaCostMultiplier(stack, entity);
|
||||
}
|
||||
});
|
||||
return multiplier[0];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
|
||||
public class DiamondRobe extends GemRobe {
|
||||
public static final int MAX_MANA_BONUS = 80;
|
||||
public static final double MANA_COST_MULTIPLIER = 0.85D;
|
||||
public static final int SKILL_MASK = GemStaff.SKILL_DIAMOND;
|
||||
|
||||
public DiamondRobe() {
|
||||
super(ModArmorMaterials.DIAMOND_ROBE, MAX_MANA_BONUS, MANA_COST_MULTIPLIER, SKILL_MASK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
|
||||
public class EmeraldRobe extends GemRobe {
|
||||
public static final int MAX_MANA_BONUS = 60;
|
||||
public static final double MANA_COST_MULTIPLIER = 0.89D;
|
||||
public static final int SKILL_MASK = GemStaff.SKILL_EMERALD;
|
||||
|
||||
public EmeraldRobe() {
|
||||
super(ModArmorMaterials.EMERALD_ROBE, MAX_MANA_BONUS, MANA_COST_MULTIPLIER, SKILL_MASK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.effect.EffectTooltipUtil;
|
||||
import com.lzxnone.terraria.item.effect.ManaCostModifier;
|
||||
import com.lzxnone.terraria.item.effect.MaxManaModifier;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.ArmorMaterial;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GemRobe extends ArmorItem implements MaxManaModifier, ManaCostModifier {
|
||||
private final int maxManaBonus;
|
||||
private final double manaCostMultiplier;
|
||||
private final int skillMask;
|
||||
|
||||
public GemRobe(Holder<ArmorMaterial> material, int maxManaBonus, double manaCostMultiplier, int skillMask) {
|
||||
super(material, ArmorItem.Type.CHESTPLATE, new Item.Properties().stacksTo(1));
|
||||
this.maxManaBonus = maxManaBonus;
|
||||
this.manaCostMultiplier = manaCostMultiplier;
|
||||
this.skillMask = skillMask;
|
||||
}
|
||||
|
||||
public int getSkillMask(ItemStack stack) {
|
||||
return this.skillMask;
|
||||
}
|
||||
|
||||
public int getSkillMask() {
|
||||
return this.skillMask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxManaBonus(ItemStack stack, LivingEntity entity) {
|
||||
return this.maxManaBonus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getManaCostMultiplier(ItemStack stack, LivingEntity entity) {
|
||||
return this.manaCostMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
||||
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.max_mana_bonus",
|
||||
EffectTooltipUtil.formatNumber(this.maxManaBonus)
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
tooltipComponents.add(Component.translatable(
|
||||
"tooltip.lzxnoneterraria.mana_cost_decrease",
|
||||
EffectTooltipUtil.formatPercent(this.manaCostMultiplier)
|
||||
).withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.ArmorMaterial;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.neoforged.neoforge.registries.DeferredHolder;
|
||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ModArmorMaterials {
|
||||
public static final DeferredRegister<ArmorMaterial> ARMOR_MATERIALS =
|
||||
DeferredRegister.create(Registries.ARMOR_MATERIAL, LzxnoneTerraria.MODID);
|
||||
|
||||
private static DeferredHolder<ArmorMaterial, ArmorMaterial> registerRobe(String name, int defense, Supplier<Ingredient> repairIngredient) {
|
||||
return ARMOR_MATERIALS.register(name, () -> new ArmorMaterial(
|
||||
Util.make(new EnumMap<>(ArmorItem.Type.class), map -> {
|
||||
map.put(ArmorItem.Type.BOOTS, 0);
|
||||
map.put(ArmorItem.Type.LEGGINGS, 0);
|
||||
map.put(ArmorItem.Type.CHESTPLATE, defense);
|
||||
map.put(ArmorItem.Type.HELMET, 0);
|
||||
map.put(ArmorItem.Type.BODY, defense);
|
||||
}),
|
||||
15,
|
||||
SoundEvents.ARMOR_EQUIP_LEATHER,
|
||||
repairIngredient,
|
||||
List.of(new ArmorMaterial.Layer(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, name))),
|
||||
0.0F,
|
||||
0.0F
|
||||
));
|
||||
}
|
||||
|
||||
// 0 防御
|
||||
public static final DeferredHolder<ArmorMaterial, ArmorMaterial> ROBE = registerRobe("robe", 0, () -> Ingredient.of(Items.STRING));
|
||||
public static final DeferredHolder<ArmorMaterial, ArmorMaterial> AMETHYST_ROBE = registerRobe("amethyst_robe", 0, () -> Ingredient.of(Items.AMETHYST_SHARD));
|
||||
|
||||
// 1 防御
|
||||
public static final DeferredHolder<ArmorMaterial, ArmorMaterial> TOPAZ_ROBE = registerRobe("topaz_robe", 1, () -> Ingredient.of(Items.COPPER_INGOT));
|
||||
public static final DeferredHolder<ArmorMaterial, ArmorMaterial> SAPPHIRE_ROBE = registerRobe("sapphire_robe", 1, () -> Ingredient.of(Items.LAPIS_BLOCK));
|
||||
|
||||
// 2 防御
|
||||
public static final DeferredHolder<ArmorMaterial, ArmorMaterial> EMERALD_ROBE = registerRobe("emerald_robe", 2, () -> Ingredient.of(Items.EMERALD));
|
||||
public static final DeferredHolder<ArmorMaterial, ArmorMaterial> RUBY_ROBE = registerRobe("ruby_robe", 2, () -> Ingredient.of(Items.REDSTONE_BLOCK));
|
||||
|
||||
// 3 防御
|
||||
public static final DeferredHolder<ArmorMaterial, ArmorMaterial> AMBER_ROBE = registerRobe("amber_robe", 3, () -> Ingredient.of(Items.GOLD_INGOT));
|
||||
public static final DeferredHolder<ArmorMaterial, ArmorMaterial> DIAMOND_ROBE = registerRobe("diamond_robe", 3, () -> Ingredient.of(Items.DIAMOND));
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class Robe extends ArmorItem {
|
||||
|
||||
public Robe() {
|
||||
super(ModArmorMaterials.ROBE, ArmorItem.Type.CHESTPLATE, new Item.Properties().stacksTo(1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
|
||||
public class RubyRobe extends GemRobe {
|
||||
public static final int MAX_MANA_BONUS = 60;
|
||||
public static final double MANA_COST_MULTIPLIER = 0.87D;
|
||||
public static final int SKILL_MASK = GemStaff.SKILL_RUBY;
|
||||
|
||||
public RubyRobe() {
|
||||
super(ModArmorMaterials.RUBY_ROBE, MAX_MANA_BONUS, MANA_COST_MULTIPLIER, SKILL_MASK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
|
||||
public class SapphireRobe extends GemRobe {
|
||||
public static final int MAX_MANA_BONUS = 40;
|
||||
public static final double MANA_COST_MULTIPLIER = 0.91D;
|
||||
public static final int SKILL_MASK = GemStaff.SKILL_SAPPHIRE;
|
||||
|
||||
public SapphireRobe() {
|
||||
super(ModArmorMaterials.SAPPHIRE_ROBE, MAX_MANA_BONUS, MANA_COST_MULTIPLIER, SKILL_MASK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.lzxnone.terraria.item.armor;
|
||||
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.GemStaff;
|
||||
|
||||
public class TopazRobe extends GemRobe {
|
||||
public static final int MAX_MANA_BONUS = 40;
|
||||
public static final double MANA_COST_MULTIPLIER = 0.93D;
|
||||
public static final int SKILL_MASK = GemStaff.SKILL_TOPAZ;
|
||||
|
||||
public TopazRobe() {
|
||||
super(ModArmorMaterials.TOPAZ_ROBE, MAX_MANA_BONUS, MANA_COST_MULTIPLIER, SKILL_MASK);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
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.accessory.AccessoryUtil;
|
||||
import com.lzxnone.terraria.particle.ModParticles;
|
||||
import com.lzxnone.terraria.utils.*;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -21,13 +20,12 @@ import net.minecraft.world.phys.EntityHitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
public interface FallenStarSummoner {
|
||||
boolean summonThreeFallenStar(ItemStack stack, LivingEntity entity);
|
||||
double getFallenStarDamage(ItemStack stack, LivingEntity entity);
|
||||
String STAR_CLOAK = "star_cloak";
|
||||
String STAR_VEIL = "star_veil";
|
||||
String BEE_CLOAK = "bee_cloak";
|
||||
String MANA_CLOAK = "mana_cloak";
|
||||
|
||||
//星星落地时是否变为回复魔力的拾取物(魔力斗篷等)
|
||||
default boolean summonManaStarOnLanding(ItemStack stack, LivingEntity entity) {
|
||||
return false;
|
||||
}
|
||||
String getStar(ItemStack stack, LivingEntity entity);
|
||||
|
||||
IStaticProjectileBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileBehavior() {
|
||||
@Override
|
||||
@@ -46,14 +44,9 @@ public interface FallenStarSummoner {
|
||||
if(owner == null) return;
|
||||
if(!FilterUtil.createTargetFilter(owner).test(target) || !(owner instanceof Player player)) return;
|
||||
ItemStack stack = projectile.getEntityData().get(StaticProjectile.STACK_SOURCE);
|
||||
double[] fallenStarDamage = {0.0D};
|
||||
AccessoryUtil.forEachAccessory(player, (accessory, accessoryStack) -> {
|
||||
if(accessory instanceof FallenStarSummoner summoner) {
|
||||
fallenStarDamage[0] = Math.max(summoner.getFallenStarDamage(accessoryStack, player), fallenStarDamage[0]);
|
||||
}
|
||||
});
|
||||
if(DamageUtil.meleeAttack(projectile, target, stack, (float) fallenStarDamage[0], 1.0f, 10)) {
|
||||
}
|
||||
CompoundTag customData = projectile.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
double damage = customData.contains("damage") ? customData.getDouble("damage") : 0;
|
||||
DamageUtil.meleeAttack(projectile, target, stack, (float) damage, 1.0f, 10);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@@ -86,11 +79,12 @@ public interface FallenStarSummoner {
|
||||
summon.setPos(projectile.position());
|
||||
summon.getEntityData().set(StaticSummon.BEHAVIOR, StaticSummonBehaviors.MANA_STAR);
|
||||
summon.getEntityData().set(StaticSummon.RENDER_MODE, "item");
|
||||
summon.getEntityData().set(StaticSummon.ITEM, new ItemStack(ModItems.MANA_STAR.get()));
|
||||
summon.getEntityData().set(StaticSummon.ITEM, new ItemStack(ModItems.MANA_STAR2.get()));
|
||||
summon.getEntityData().set(StaticSummon.LIFETIME, 100);
|
||||
summon.getEntityData().set(StaticSummon.GLOW, true);
|
||||
CompoundTag summonCustomData = new CompoundTag();
|
||||
summonCustomData.putInt("mana", 50);
|
||||
summonCustomData.putDouble("min_attract_range", 12.0D);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, summonCustomData);
|
||||
projectile.level().addFreshEntity(summon);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class FallenStar extends Item {
|
||||
ServerPlayer player = players.getFirst();
|
||||
|
||||
double attractRange = Math.max(AccessoryUtil.getStarPickupRange(player), MIN_ATTRACT_RADIUS);
|
||||
Vec3 dir = player.position().subtract(summon.position());
|
||||
Vec3 dir = player.getBoundingBox().getCenter().subtract(summon.position());
|
||||
double dist = dir.length();
|
||||
if(dist <= attractRange) {
|
||||
summon.setDeltaMovement(dir.scale(ATTRACT_SPEED));
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
package com.lzxnone.terraria.item.normal;
|
||||
|
||||
import com.lzxnone.terraria.attachment.PlayerMana;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.item.accessory.AccessoryUtil;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ManaStar extends Item {
|
||||
public static final int MANA_SURGE_DURATION_TICKS = 40;
|
||||
|
||||
public ManaStar() {
|
||||
super(new Item.Properties());
|
||||
@@ -22,7 +25,6 @@ public class ManaStar extends Item {
|
||||
private static final double AIR_FRICTION = 0.98D;
|
||||
private static final double GROUND_FRICTION = 0.6D;
|
||||
private static final double MAX_FALL_SPEED = -1.5D;
|
||||
private static final double MIN_ATTRACT_RADIUS = 4.0D;
|
||||
private static final double PICKUP_RADIUS = 0.5D;
|
||||
private static final double MAX_PICKUP_RADIUS = 16.0D;
|
||||
private static final double ATTRACT_SPEED = 0.25D;
|
||||
@@ -62,16 +64,17 @@ public class ManaStar extends Item {
|
||||
|
||||
ServerPlayer player = players.getFirst();
|
||||
|
||||
double attractRange = Math.max(AccessoryUtil.getStarPickupRange(player), MIN_ATTRACT_RADIUS);
|
||||
Vec3 dir = player.position().subtract(summon.position());
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
double attractRange = Math.max(AccessoryUtil.getStarPickupRange(player), customData.contains("min_attract_range") ? customData.getDouble("min_attract_range") : 4.0D);
|
||||
Vec3 dir = player.getBoundingBox().getCenter().subtract(summon.position());
|
||||
double dist = dir.length();
|
||||
if(dist <= attractRange) {
|
||||
summon.setDeltaMovement(dir.scale(ATTRACT_SPEED));
|
||||
}
|
||||
if(dist <= PICKUP_RADIUS) {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
int amount = customData.contains("mana") ? customData.getInt("mana") : 0;
|
||||
PlayerMana.recoverMana(player, amount);
|
||||
player.addEffect(new MobEffectInstance(ModEffects.MANA_SURGE, MANA_SURGE_DURATION_TICKS, 0));
|
||||
onDied(summon);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,10 @@ import com.lzxnone.terraria.attachment.PlayerMana;
|
||||
import com.lzxnone.terraria.enchantment.ModEnchantments;
|
||||
import com.lzxnone.terraria.enchantment.ModEnchantmentConfigs;
|
||||
import com.lzxnone.terraria.effect.ManaSicknessEffect;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
import com.lzxnone.terraria.item.accessory.AccessoryUtil;
|
||||
import com.lzxnone.terraria.item.armor.ArmorUtil;
|
||||
import com.lzxnone.terraria.item.effect.AutoManaPotionUser;
|
||||
import com.lzxnone.terraria.item.effect.MagicDamageModifier;
|
||||
import com.lzxnone.terraria.item.effect.ManaCostModifier;
|
||||
@@ -125,7 +128,10 @@ public class MagicWeapon extends Weapon {
|
||||
//自动喝药
|
||||
PlayerMana mana = player.getData(ModAttachments.PLAYER_MANA);
|
||||
double targetMana = Math.max(1.0D, Math.floor(mana.getConsumeProgress() + amount));
|
||||
if(!tryAutoUseManaPotionToReachTarget(player, targetMana)) return false;
|
||||
if(!tryAutoUseManaPotionToReachTarget(player, targetMana)) {
|
||||
PlayerMana.clearMana(serverPlayer);
|
||||
return false;
|
||||
}
|
||||
return PlayerMana.consumeMana(serverPlayer, amount);
|
||||
}
|
||||
|
||||
@@ -137,7 +143,11 @@ public class MagicWeapon extends Weapon {
|
||||
protected double getManaConsumeRate(ItemStack stack, LivingEntity entity) { return 0.0D; }
|
||||
|
||||
protected double getManaTooltipValue(ItemStack stack) {
|
||||
return getManaConsumeRate(stack, null);
|
||||
Player player = null;
|
||||
if(net.neoforged.fml.loading.FMLEnvironment.dist.isClient()) {
|
||||
player = net.minecraft.client.Minecraft.getInstance().player;
|
||||
}
|
||||
return getFinalManaConsumeRate(stack, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,25 +164,33 @@ public class MagicWeapon extends Weapon {
|
||||
}
|
||||
|
||||
//获取最终魔力消耗
|
||||
protected double getFinalManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
double rate = getManaConsumeRate(stack, entity);
|
||||
//魔力泄漏
|
||||
int leakLevel = getEnchantmentLevel(entity, stack, ModEnchantments.MANA_LEAK);
|
||||
rate *= Math.pow(ModEnchantmentConfigs.getManaLeakConsumeMultiplier(), leakLevel);
|
||||
//魔力效率
|
||||
int efficiencyLevel = getEnchantmentLevel(entity, stack, ModEnchantments.MANA_EFFICIENCY);
|
||||
rate *= Math.pow(ModEnchantmentConfigs.getManaEfficiencyConsumeMultiplier(), efficiencyLevel);
|
||||
//饰品
|
||||
double[] multiplier = {1.0D};
|
||||
AccessoryUtil.forEachAccessory(entity, (accessory, itemStack) -> {
|
||||
if(accessory instanceof ManaCostModifier modifier) {
|
||||
multiplier[0] *= modifier.getManaCostMultiplier(itemStack, entity);
|
||||
}
|
||||
});
|
||||
rate *= multiplier[0];
|
||||
public double getFinalManaConsumeRate(ItemStack stack, LivingEntity entity, double baseRate) {
|
||||
double rate = baseRate;
|
||||
if(entity != null) {
|
||||
//魔力泄漏
|
||||
int leakLevel = getEnchantmentLevel(entity, stack, ModEnchantments.MANA_LEAK);
|
||||
rate *= Math.pow(ModEnchantmentConfigs.getManaLeakConsumeMultiplier(), leakLevel);
|
||||
//魔力效率
|
||||
int efficiencyLevel = getEnchantmentLevel(entity, stack, ModEnchantments.MANA_EFFICIENCY);
|
||||
rate *= Math.pow(ModEnchantmentConfigs.getManaEfficiencyConsumeMultiplier(), efficiencyLevel);
|
||||
//饰品
|
||||
double[] multiplier = {1.0D};
|
||||
AccessoryUtil.forEachAccessory(entity, (accessory, itemStack) -> {
|
||||
if(accessory instanceof ManaCostModifier modifier) {
|
||||
multiplier[0] *= modifier.getManaCostMultiplier(itemStack, entity);
|
||||
}
|
||||
});
|
||||
rate *= multiplier[0];
|
||||
//防具
|
||||
rate *= ArmorUtil.getManaCostMultiplier(entity);
|
||||
}
|
||||
return Math.max(0.0D, rate);
|
||||
}
|
||||
|
||||
public double getFinalManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
return getFinalManaConsumeRate(stack, entity, getManaConsumeRate(stack, entity));
|
||||
}
|
||||
|
||||
//获取最终造成的伤害
|
||||
public static float applyMagicDamageBonus(ItemStack stack, LivingEntity entity, float damage) {
|
||||
double finalDamage = damage;
|
||||
@@ -181,6 +199,10 @@ public class MagicWeapon extends Weapon {
|
||||
finalDamage *= Math.pow(ModEnchantmentConfigs.getArcaneAmplificationDamageMultiplier(), amplificationLevel);
|
||||
//耐魔性
|
||||
finalDamage *= ManaSicknessEffect.getMagicDamageMultiplier(entity);
|
||||
//魔力涌动
|
||||
if(entity != null && entity.hasEffect(ModEffects.MANA_SURGE)) {
|
||||
finalDamage *= ManaSurgeEffect.getMagicDamageMultiplier(entity);
|
||||
}
|
||||
//饰品
|
||||
double[] multiplier = {1.0D};
|
||||
AccessoryUtil.forEachAccessory(entity, (accessory, accessoryStack) -> {
|
||||
|
||||
@@ -73,6 +73,7 @@ public class Weapon extends Item {
|
||||
}
|
||||
|
||||
public static int getEnchantmentLevel(LivingEntity entity, ItemStack stack, ResourceKey<Enchantment> enchantment) {
|
||||
if(entity == null) return 0;
|
||||
return entity.registryAccess()
|
||||
.lookupOrThrow(Registries.ENCHANTMENT)
|
||||
.get(enchantment)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
@@ -70,7 +72,7 @@ public class ArcSurge extends MagicWeapon {
|
||||
public static final double COLLISION_INFLATE = 0.35D; // 碰撞检测膨胀大小
|
||||
|
||||
public static final DustParticleOptions DUST_PARTICLE = new DustParticleOptions(
|
||||
0.075f, 0.2f, 25, true, new Vector3f[]{
|
||||
0.04f, 0.2f, 25, true, new Vector3f[]{
|
||||
new Vector3f(1.0F, 0.15F, 0.15F),
|
||||
new Vector3f(0.9F, 0.05F, 0.1F)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.enchantment.ModEnchantmentConfigs;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.attachment.ModAttachments;
|
||||
@@ -133,7 +137,11 @@ public class LastPrism extends MagicWeapon {
|
||||
|
||||
@Override
|
||||
protected double getManaTooltipValue(ItemStack stack) {
|
||||
return MANA_CONSUME_RATE.get();
|
||||
Player player = null;
|
||||
if(net.neoforged.fml.loading.FMLEnvironment.dist.isClient()) {
|
||||
player = net.minecraft.client.Minecraft.getInstance().player;
|
||||
}
|
||||
return getFinalManaConsumeRate(stack, player, MANA_CONSUME_RATE.get());
|
||||
}
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic;
|
||||
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic.gem_staff;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigFloat;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigInt;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
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 org.joml.Vector3f;
|
||||
|
||||
public class AmberStaff extends GemStaff {
|
||||
public static final Vector3f COLOR = new Vector3f(1.0F, 0.55F, 0.05F);
|
||||
public static final ConfigFloat DAMAGE = new ConfigFloat("weapon.amber_staff.damage", "amber_staff_damage", 6.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigFloat EXTRA_DAMAGE = new ConfigFloat("weapon.amber_staff.extra_damage", "amber_staff_extra_damage", 4.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigDouble MANA_CONSUME = new ConfigDouble("weapon.amber_staff.mana_consume", "amber_staff_mana_consume", 9.0D, 0.0D, 10000.0D);
|
||||
public static final ConfigInt MAX_HIT_COUNT = new ConfigInt("weapon.amber_staff.max_hit_count", "amber_staff_max_hit_count", 3, 1, 64);
|
||||
public static final int SKILL_MASK = SKILL_AMBER;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(
|
||||
DAMAGE,
|
||||
EXTRA_DAMAGE,
|
||||
MANA_CONSUME,
|
||||
MAX_HIT_COUNT
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"amber_staff",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/amber_staff.png"),
|
||||
Component.translatable("item.lzxnoneterraria.amber_staff"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public AmberStaff() {
|
||||
super(Tiers.IRON, new Item.Properties().stacksTo(1), SKILL_MASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamage(ItemStack stack, LivingEntity entity) {
|
||||
return DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraDamage(ItemStack stack, LivingEntity entity) {
|
||||
return EXTRA_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_CONSUME.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return computeUseTime(28, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3f getColor() {
|
||||
return COLOR;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic.gem_staff;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigFloat;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
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 org.joml.Vector3f;
|
||||
|
||||
public class AmethystStaff extends GemStaff {
|
||||
public static final Vector3f COLOR = new Vector3f(0.70F, 0.25F, 0.85F);
|
||||
public static final ConfigFloat DAMAGE = new ConfigFloat("weapon.amethyst_staff.damage", "amethyst_staff_damage", 4.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigFloat EXTRA_DAMAGE = new ConfigFloat("weapon.amethyst_staff.extra_damage", "amethyst_staff_extra_damage", 4.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigDouble MANA_CONSUME = new ConfigDouble("weapon.amethyst_staff.mana_consume", "amethyst_staff_mana_consume", 7.0D, 0.0D, 10000.0D);
|
||||
public static final ConfigDouble TARGET_RANGE = new ConfigDouble("weapon.amethyst_staff.target_range", "amethyst_staff_target_range", 16.0D, 0.0D, 128.0D);
|
||||
public static final int SKILL_MASK = SKILL_AMETHYST;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(
|
||||
DAMAGE,
|
||||
EXTRA_DAMAGE,
|
||||
MANA_CONSUME,
|
||||
TARGET_RANGE
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"amethyst_staff",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/amethyst_staff.png"),
|
||||
Component.translatable("item.lzxnoneterraria.amethyst_staff"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public AmethystStaff() {
|
||||
super(Tiers.IRON, new Item.Properties().stacksTo(1), SKILL_MASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamage(ItemStack stack, LivingEntity entity) {
|
||||
return DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraDamage(ItemStack stack, LivingEntity entity) {
|
||||
return EXTRA_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_CONSUME.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return computeUseTime(37, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3f getColor() {
|
||||
return COLOR;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic.gem_staff;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigFloat;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigInt;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
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 org.joml.Vector3f;
|
||||
|
||||
public class DiamondStaff extends GemStaff {
|
||||
public static final Vector3f COLOR = new Vector3f(0.85F, 0.95F, 1.0F);
|
||||
public static final ConfigFloat DAMAGE = new ConfigFloat("weapon.diamond_staff.damage", "diamond_staff_damage", 7.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigFloat EXTRA_DAMAGE = new ConfigFloat("weapon.diamond_staff.extra_damage", "diamond_staff_extra_damage", 4.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigDouble MANA_CONSUME = new ConfigDouble("weapon.diamond_staff.mana_consume", "diamond_staff_mana_consume", 9.0D, 0.0D, 10000.0D);
|
||||
public static final ConfigInt MAX_ENTITY_HIT_COUNT = new ConfigInt("weapon.diamond_staff.max_entity_hit_count", "diamond_staff_max_entity_hit_count", 2, 1, 64);
|
||||
public static final ConfigDouble HITBOX_INFLATE = new ConfigDouble("weapon.diamond_staff.hitbox_inflate", "diamond_staff_hitbox_inflate", 0.8D, 0.0D, 10.0D);
|
||||
public static final int SKILL_MASK = SKILL_DIAMOND;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(
|
||||
DAMAGE,
|
||||
EXTRA_DAMAGE,
|
||||
MANA_CONSUME,
|
||||
MAX_ENTITY_HIT_COUNT,
|
||||
HITBOX_INFLATE
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"diamond_staff",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/diamond_staff.png"),
|
||||
Component.translatable("item.lzxnoneterraria.diamond_staff"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public DiamondStaff() {
|
||||
super(Tiers.IRON, new Item.Properties().stacksTo(1), SKILL_MASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamage(ItemStack stack, LivingEntity entity) {
|
||||
return DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraDamage(ItemStack stack, LivingEntity entity) {
|
||||
return EXTRA_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_CONSUME.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return computeUseTime(26, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3f getColor() {
|
||||
return COLOR;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic.gem_staff;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigFloat;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigInt;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
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 org.joml.Vector3f;
|
||||
|
||||
public class EmeraldStaff extends GemStaff {
|
||||
public static final Vector3f COLOR = new Vector3f(0.15F, 0.85F, 0.25F);
|
||||
public static final ConfigFloat DAMAGE = new ConfigFloat("weapon.emerald_staff.damage", "emerald_staff_damage", 5.5F, 0.0F, 8388600.0F);
|
||||
public static final ConfigFloat EXTRA_DAMAGE = new ConfigFloat("weapon.emerald_staff.extra_damage", "emerald_staff_extra_damage", 4.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigDouble MANA_CONSUME = new ConfigDouble("weapon.emerald_staff.mana_consume", "emerald_staff_mana_consume", 8.0D, 0.0D, 10000.0D);
|
||||
public static final ConfigInt MAX_ENTITY_HIT_COUNT = new ConfigInt("weapon.emerald_staff.max_entity_hit_count", "emerald_staff_max_entity_hit_count", 2, 1, 64);
|
||||
public static final ConfigDouble SPEED_MULTIPLIER = new ConfigDouble("weapon.emerald_staff.speed_multiplier", "emerald_staff_speed_multiplier", 2.0D, 0.1D, 10.0D);
|
||||
public static final ConfigInt LIFETIME = new ConfigInt("weapon.emerald_staff.lifetime", "emerald_staff_lifetime", 150, 1, 100000);
|
||||
public static final ConfigDouble DRAG = new ConfigDouble("weapon.emerald_staff.drag", "emerald_staff_drag", 0.92D, 0.0D, 1.0D);
|
||||
public static final int SKILL_MASK = SKILL_EMERALD;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(
|
||||
DAMAGE,
|
||||
EXTRA_DAMAGE,
|
||||
MANA_CONSUME,
|
||||
MAX_ENTITY_HIT_COUNT,
|
||||
SPEED_MULTIPLIER,
|
||||
LIFETIME,
|
||||
DRAG
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"emerald_staff",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/emerald_staff.png"),
|
||||
Component.translatable("item.lzxnoneterraria.emerald_staff"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public EmeraldStaff() {
|
||||
super(Tiers.IRON, new Item.Properties().stacksTo(1), SKILL_MASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamage(ItemStack stack, LivingEntity entity) {
|
||||
return DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraDamage(ItemStack stack, LivingEntity entity) {
|
||||
return EXTRA_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_CONSUME.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return computeUseTime(32, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3f getColor() {
|
||||
return COLOR;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,611 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic.gem_staff;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
import com.lzxnone.terraria.entity.projectile.IStaticProjectileBehavior;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectileBehaviors;
|
||||
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummon;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummonBehaviors;
|
||||
import com.lzxnone.terraria.item.ammo.Ammo;
|
||||
import com.lzxnone.terraria.item.armor.GemRobe;
|
||||
import com.lzxnone.terraria.item.weapon.MagicWeapon;
|
||||
import com.lzxnone.terraria.particle.CircleParticleOptions;
|
||||
import com.lzxnone.terraria.particle.DustParticleOptions;
|
||||
import com.lzxnone.terraria.utils.*;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.HumanoidArm;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.EntityHitResult;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class GemStaff extends MagicWeapon {
|
||||
public static final int SKILL_AMETHYST = 1 << 0; // 1 (紫晶 - 追踪)
|
||||
public static final int SKILL_TOPAZ = 1 << 1; // 2 (黄玉 - 爆炸)
|
||||
public static final int SKILL_SAPPHIRE = 1 << 2; // 4 (蓝玉 - 双螺旋)
|
||||
public static final int SKILL_EMERALD = 1 << 3; // 8 (翡翠 - 地形附着/双速)
|
||||
public static final int SKILL_RUBY = 1 << 4; // 16 (红玉 - 双发连射)
|
||||
public static final int SKILL_AMBER = 1 << 5; // 32 (琥珀 - 反弹穿透)
|
||||
public static final int SKILL_DIAMOND = 1 << 6; // 64 (钻石 - 巨型穿透)
|
||||
|
||||
public static final Vector3f OFFSET = new Vector3f(-0.3f, -0.15f, 1.2f);
|
||||
public static final double DEFAULT_SPEED = 1.0D;
|
||||
public static final double DOUBLE_HELIX_RADIUS = 0.6D;
|
||||
public static final double DOUBLE_HELIX_OMEGA = 0.35D;
|
||||
public static final double BURST_OFFSET = -1.2D;
|
||||
|
||||
public static final int LIFETIME = 50;
|
||||
public static final double TURN_RATE = 0.35D;
|
||||
public static final double CLOSE_TARGET_RANGE = 5.0D;
|
||||
public static final double CLOSE_TURN_RATE = 0.75D;
|
||||
public static final double DEFAULT_HITBOX_INFLATE = 0.35D;
|
||||
|
||||
/**
|
||||
* 核心锚点实体的行为(完全掌控运动逻辑、追踪与方块碰撞/反弹)
|
||||
*/
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
@Override
|
||||
public void tick(StaticSummon summon) {
|
||||
checkBeforeTick(summon);
|
||||
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA).copy();
|
||||
int skill = customData.getInt("skill");
|
||||
boolean amethyst = (skill & SKILL_AMETHYST) != 0;
|
||||
boolean emerald = (skill & SKILL_EMERALD) != 0;
|
||||
boolean amber = (skill & SKILL_AMBER) != 0;
|
||||
boolean sapphire = (skill & SKILL_SAPPHIRE) != 0;
|
||||
|
||||
Vec3 currentDir = summon.getLookAngle().normalize();
|
||||
Vec3 nextDir = currentDir;
|
||||
|
||||
// 紫晶追踪
|
||||
if(amethyst) {
|
||||
double targetRange = AmethystStaff.TARGET_RANGE.get();
|
||||
Entity target = findTarget(summon, targetRange);
|
||||
if(target != null) {
|
||||
Vec3 targetCenter = target.getBoundingBox().getCenter();
|
||||
Vec3 targetDir = targetCenter.subtract(summon.position()).normalize();
|
||||
double turnRate = targetCenter.distanceTo(summon.position()) <= CLOSE_TARGET_RANGE ? CLOSE_TURN_RATE : TURN_RATE;
|
||||
if (hasLineOfSight(summon.level(), summon, summon.position(), targetCenter)) {
|
||||
nextDir = steer(currentDir, targetDir, turnRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double speed = summon.getDeltaMovement().length();
|
||||
if(emerald) {
|
||||
speed *= EmeraldStaff.DRAG.get();
|
||||
if(customData.contains("stop")) speed = 0;
|
||||
}
|
||||
Vec3 motion = nextDir.normalize().scale(speed);
|
||||
summon.setDeltaMovement(motion);
|
||||
|
||||
//不存在翡翠:速度为0死亡
|
||||
if(!emerald && motion.lengthSqr() <= 1.0E-2D) {
|
||||
onDied(summon);
|
||||
return;
|
||||
}
|
||||
|
||||
Vec3 start = summon.position();
|
||||
Vec3 nextPos = start.add(motion);
|
||||
|
||||
//方块碰撞
|
||||
if(motion.lengthSqr() > 1.0E-6D) {
|
||||
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, nextPos);
|
||||
if(blockHitResult.getType() != HitResult.Type.MISS) {
|
||||
if(amber) {
|
||||
// 琥珀反弹(严格镜面反射,仅当朝向方块内部运动时反弹)
|
||||
Vec3 reflectedMotion = reflect(motion, blockHitResult.getDirection()).normalize().scale(speed);
|
||||
summon.setPos(blockHitResult.getLocation().add(Vec3.atLowerCornerOf(blockHitResult.getDirection().getNormal()).scale(0.05)));
|
||||
updateRotation(summon, reflectedMotion);
|
||||
summon.setDeltaMovement(reflectedMotion);
|
||||
|
||||
if(summon.level() instanceof ServerLevel serverLevel) {
|
||||
Ammo.playBlockHitEffects(serverLevel, blockHitResult);
|
||||
}
|
||||
|
||||
int hitCount = customData.getInt("hitCount") + 1;
|
||||
customData.putInt("hitCount", hitCount);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
if(hitCount >= AmberStaff.MAX_HIT_COUNT.get()) {
|
||||
onDied(summon);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}else if(emerald) {
|
||||
if(summon.level() instanceof ServerLevel serverLevel) {
|
||||
Ammo.playBlockHitEffects(serverLevel, blockHitResult);
|
||||
}
|
||||
int hitCount = customData.getInt("hitCount") + 1;
|
||||
customData.putInt("hitCount", hitCount);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
|
||||
//翡翠停止
|
||||
customData.putBoolean("stop", true);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
summon.setPos(blockHitResult.getLocation().add(Vec3.atLowerCornerOf(blockHitResult.getDirection().getNormal()).scale(0.05D)));
|
||||
updateRotation(summon, nextDir);
|
||||
summon.setDeltaMovement(Vec3.ZERO);
|
||||
|
||||
return;
|
||||
}else {
|
||||
if(summon.level() instanceof ServerLevel serverLevel) {
|
||||
Ammo.playBlockHitEffects(serverLevel, blockHitResult);
|
||||
}
|
||||
onDied(summon);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateRotation(summon, nextDir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDied(StaticSummon summon) {
|
||||
if(!summon.level().isClientSide() && !summon.isRemoved()) {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
if(summon.level() instanceof ServerLevel serverLevel && customData.hasUUID("projectileUUID")) {
|
||||
Entity p = serverLevel.getEntity(customData.getUUID("projectileUUID"));
|
||||
if(p instanceof StaticProjectile proj) {
|
||||
PROJECTILE_BEHAVIOR.onDied(proj);
|
||||
}
|
||||
}
|
||||
summon.discard();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 实际魔法弹实体的行为(跟随核心锚点并处理实体命中)
|
||||
*/
|
||||
public static final IStaticProjectileBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileBehavior() {
|
||||
@Override
|
||||
public void onMoving(StaticProjectile projectile) {
|
||||
// 移动时在客户端记录尾迹并生成相应颜色的 dust 粒子
|
||||
if(projectile.level().isClientSide()) {
|
||||
Vector3f motion = projectile.getDeltaMovement().lengthSqr() > 1.0E-6D ?
|
||||
projectile.getDeltaMovement().toVector3f() :
|
||||
projectile.getEntityData().get(StaticProjectile.DIRECTION);
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(motion, projectile.getYRot());
|
||||
Vec3 right = MathUtil.toVec3(dirs[2]);
|
||||
projectile.trailPositions.addFirst(projectile.position().add(right.scale(0.2D)));
|
||||
projectile.trailPositions.addFirst(projectile.position().add(right.scale(-0.2D)));
|
||||
while(projectile.trailPositions.size() > 24) projectile.trailPositions.removeLast();
|
||||
|
||||
float r = projectile.getEntityData().get(StaticProjectile.COLOR_R);
|
||||
float g = projectile.getEntityData().get(StaticProjectile.COLOR_G);
|
||||
float b = projectile.getEntityData().get(StaticProjectile.COLOR_B);
|
||||
Vector3f color = new Vector3f(r, g, b);
|
||||
DustParticleOptions dustParticle = new DustParticleOptions(0.1F, 0.4F, 40, true, new Vector3f[]{color});
|
||||
ParticleUtil.addParticle(projectile.level(), dustParticle, projectile.position(), 0.0D, Vec3.ZERO, 0.02D);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!(projectile.getOwner() instanceof StaticSummon core) || !core.isAlive()) {
|
||||
onDied(projectile);
|
||||
return;
|
||||
}
|
||||
|
||||
//同步原点
|
||||
projectile.getEntityData().set(StaticProjectile.ORIGIN, core.position().toVector3f());
|
||||
|
||||
CompoundTag customData = projectile.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
int skill = customData.getInt("skill");
|
||||
boolean sapphire = (skill & SKILL_SAPPHIRE) != 0;
|
||||
boolean emerald = (skill & SKILL_EMERALD) != 0;
|
||||
|
||||
// 蓝玉 + 翡翠:当核心速度接近0时,将相对核心距离直接写成表达式常量,保持相对位置不变
|
||||
CompoundTag coreData = core.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
boolean isStopped = coreData.getBoolean("stop") || core.getDeltaMovement().length() < 1.0E-2D;
|
||||
if(sapphire && emerald && isStopped) {
|
||||
String exprX = projectile.getEntityData().get(StaticProjectile.EXPRESSION_X);
|
||||
if(exprX.contains("t")) {
|
||||
int age = projectile.getEntityData().get(StaticProjectile.AGE);
|
||||
double curValX = projectile.exprX != null ? projectile.exprX.setVariable("t", age).evaluate() : 0.0D;
|
||||
double curValY = projectile.exprY != null ? projectile.exprY.setVariable("t", age).evaluate() : 0.0D;
|
||||
double curValZ = projectile.exprZ != null ? projectile.exprZ.setVariable("t", age).evaluate() : 0.0D;
|
||||
projectile.setExpressionX(String.format(Locale.ROOT, "%.4f", curValX));
|
||||
projectile.setExpressionY(String.format(Locale.ROOT, "%.4f", curValY));
|
||||
projectile.setExpressionZ(String.format(Locale.ROOT, "%.4f", curValZ));
|
||||
}
|
||||
}else if(sapphire) {
|
||||
//蓝玉:时刻计算坐标系(使用核心当前朝向)
|
||||
Vec3 motion = core.getLookAngle();
|
||||
if (motion.lengthSqr() < 1.0E-7D) {
|
||||
motion = MathUtil.toVec3(projectile.getEntityData().get(StaticProjectile.DIRECTION));
|
||||
}
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(motion.toVector3f(), core.getYRot());
|
||||
projectile.getEntityData().set(StaticProjectile.DIRECTION, dirs[0]);
|
||||
projectile.getEntityData().set(StaticProjectile.UP, dirs[1]);
|
||||
projectile.getEntityData().set(StaticProjectile.RIGHT, dirs[2]);
|
||||
}
|
||||
|
||||
// 实体碰撞检测(参考子弹逻辑,使用 AABB 包围盒范围检测)
|
||||
if(projectile.isAlive()) {
|
||||
boolean diamond = (skill & SKILL_DIAMOND) != 0;
|
||||
double inflate = diamond ? DiamondStaff.HITBOX_INFLATE.get() : DEFAULT_HITBOX_INFLATE;
|
||||
Vec3 start = projectile.prevPos == null ? projectile.position() : projectile.prevPos;
|
||||
|
||||
// 若刚发射不久,起点延伸至玩家视线位置,解决近距离/贴脸敌人无法命中的问题
|
||||
Entity owner = core.getOwner();
|
||||
if(projectile.tickCount <= 1 && owner instanceof Player player) {
|
||||
start = player.getEyePosition();
|
||||
}
|
||||
|
||||
AABB hitBox = new AABB(start, projectile.position()).inflate(inflate);
|
||||
List<Entity> targets = projectile.level().getEntitiesOfClass(
|
||||
Entity.class,
|
||||
hitBox,
|
||||
FilterUtil.createTargetFilter(projectile, owner)
|
||||
);
|
||||
|
||||
if(!targets.isEmpty()) {
|
||||
targets.sort(Comparator.comparingDouble(e -> e.distanceToSqr(projectile.position())));
|
||||
for(Entity target : targets) {
|
||||
if(!projectile.isAlive() || !core.isAlive()) break;
|
||||
EntityHitResult hitResult = new EntityHitResult(target, target.position().add(0, target.getBbHeight() * 0.5D, 0));
|
||||
onHitEntity(projectile, hitResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHitEntity(StaticProjectile projectile, EntityHitResult result) {
|
||||
if(projectile.level().isClientSide()) return;
|
||||
if(!(projectile.getOwner() instanceof StaticSummon core) || !core.isAlive()) return;
|
||||
if(!(core.getOwner() instanceof Player player)) return;
|
||||
|
||||
Entity hitEntity = result.getEntity();
|
||||
if(hitEntity == player) return;
|
||||
|
||||
CompoundTag customData = projectile.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
int skill = customData.getInt("skill");
|
||||
|
||||
//伤害逻辑
|
||||
float damage = customData.getFloat("damage");
|
||||
float knockback = customData.getFloat("knockback");
|
||||
float extraDamage = customData.contains("extraDamage") ? customData.getFloat("extraDamage") : 0.0F;
|
||||
float extraKnockback = customData.contains("extraKnockback") ? customData.getFloat("extraKnockback") : 0.0F;
|
||||
ItemStack stackSource = projectile.getEntityData().get(StaticProjectile.STACK_SOURCE);
|
||||
if(DamageUtil.magicAttack(projectile, hitEntity, stackSource, damage + extraDamage, knockback + extraKnockback, 10)) {
|
||||
// 击中实体时生成相应颜色的 circle 粒子
|
||||
if(projectile.level() instanceof ServerLevel serverLevel) {
|
||||
float r = customData.contains("colorR") ? customData.getFloat("colorR") : projectile.getEntityData().get(StaticProjectile.COLOR_R);
|
||||
float g = customData.contains("colorG") ? customData.getFloat("colorG") : projectile.getEntityData().get(StaticProjectile.COLOR_G);
|
||||
float b = customData.contains("colorB") ? customData.getFloat("colorB") : projectile.getEntityData().get(StaticProjectile.COLOR_B);
|
||||
Vector3f color = new Vector3f(r, g, b);
|
||||
CircleParticleOptions hitCircle = new CircleParticleOptions(0.08F, 14, color);
|
||||
ParticleUtil.addParticles(serverLevel, hitCircle, hitEntity.getBoundingBox().getCenter(), new Vec3(0.15D, 0.15D, 0.15D), 0.1D, 8);
|
||||
}
|
||||
|
||||
//统计碰撞次数
|
||||
boolean amber = (skill & SKILL_AMBER) != 0;
|
||||
boolean emerald = (skill & SKILL_EMERALD) != 0;
|
||||
boolean diamond = (skill & SKILL_DIAMOND) != 0;
|
||||
|
||||
if(amber) {
|
||||
int hitCount = customData.getInt("hitCount") + 1;
|
||||
if (hitCount >= AmberStaff.MAX_HIT_COUNT.get()) {
|
||||
SUMMON_BEHAVIOR.onDied(core);
|
||||
}
|
||||
customData.putInt("hitCount", hitCount);
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, customData);
|
||||
}else if(emerald || diamond) {
|
||||
int hitCount = customData.getInt("hitCount") + 1;
|
||||
if (hitCount >= Math.max(EmeraldStaff.MAX_ENTITY_HIT_COUNT.get(), DiamondStaff.MAX_ENTITY_HIT_COUNT.get())) {
|
||||
SUMMON_BEHAVIOR.onDied(core);
|
||||
}
|
||||
customData.putInt("hitCount", hitCount);
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, customData);
|
||||
}else {
|
||||
SUMMON_BEHAVIOR.onDied(core);
|
||||
}
|
||||
|
||||
if(!core.isAlive()) {
|
||||
onDied(projectile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHitBlock(StaticProjectile projectile, BlockHitResult result) {}
|
||||
|
||||
@Override
|
||||
public void onDied(StaticProjectile projectile) {
|
||||
if(!projectile.level().isClientSide() && !projectile.isRemoved()) {
|
||||
CompoundTag customData = projectile.getEntityData().get(StaticProjectile.CUSTOM_DATA);
|
||||
int skill = customData.getInt("skill");
|
||||
boolean topaz = (skill & SKILL_TOPAZ) != 0;
|
||||
|
||||
if(projectile.level() instanceof ServerLevel serverLevel) {
|
||||
Vec3 pos = projectile.position();
|
||||
float r = customData.contains("colorR") ? customData.getFloat("colorR") : projectile.getEntityData().get(StaticProjectile.COLOR_R);
|
||||
float g = customData.contains("colorG") ? customData.getFloat("colorG") : projectile.getEntityData().get(StaticProjectile.COLOR_G);
|
||||
float b = customData.contains("colorB") ? customData.getFloat("colorB") : projectile.getEntityData().get(StaticProjectile.COLOR_B);
|
||||
Vector3f color = new Vector3f(r, g, b);
|
||||
|
||||
// 生成相应颜色的 circle 粒子
|
||||
CircleParticleOptions deathCircle = new CircleParticleOptions(0.08F, 14, color);
|
||||
ParticleUtil.addParticles(serverLevel, deathCircle, pos, new Vec3(0.15D, 0.15D, 0.15D), 0.1D, 8);
|
||||
|
||||
// 如果存在黄玉,额外释放更大的 circle 粒子并进行爆炸结算
|
||||
if(topaz) {
|
||||
double explosionRange = TopazStaff.EXPLOSION_RANGE.get();
|
||||
float explosionDamage = TopazStaff.EXPLOSION_DAMAGE.get();
|
||||
ItemStack stackSource = projectile.getEntityData().get(StaticProjectile.STACK_SOURCE);
|
||||
|
||||
CircleParticleOptions topazCircle = new CircleParticleOptions(0.15F, 18, color);
|
||||
ParticleUtil.addParticles(serverLevel, topazCircle, pos, new Vec3(0.25D, 0.25D, 0.25D), 0.15D, 18);
|
||||
//SoundUtil.playServerSound(serverLevel, ModSounds.BOOM.get(), pos);
|
||||
|
||||
UUID playerUUID = customData.hasUUID("playerUUID") ? customData.getUUID("playerUUID") : null;
|
||||
Entity player = playerUUID != null ? serverLevel.getEntity(playerUUID) : null;
|
||||
|
||||
List<Entity> enemies = serverLevel.getEntitiesOfClass(
|
||||
Entity.class,
|
||||
AABB.ofSize(pos, explosionRange * 2.0D, explosionRange * 2.0D, explosionRange * 2.0D),
|
||||
FilterUtil.createTargetFilter(projectile, player)
|
||||
);
|
||||
|
||||
for(Entity target : enemies) {
|
||||
if(target.distanceToSqr(pos) <= explosionRange * explosionRange) {
|
||||
DamageUtil.magicAttack(projectile, target, stackSource, explosionDamage, 1.0F, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
projectile.discard();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AABB getBoundingBoxForCulling(StaticProjectile projectile) {
|
||||
if(projectile.trailPositions.isEmpty()) return projectile.getBoundingBox();
|
||||
AABB box = projectile.getBoundingBox();
|
||||
for(Vec3 pos : projectile.trailPositions) {
|
||||
box = box.minmax(new AABB(pos, pos));
|
||||
}
|
||||
return box.inflate(0.8D);
|
||||
}
|
||||
};
|
||||
|
||||
private final int skillMask;
|
||||
|
||||
public GemStaff(Tier tier, Properties properties, int skillMask) {
|
||||
super(tier, properties);
|
||||
this.skillMask = skillMask;
|
||||
}
|
||||
|
||||
public int getSkillMask(ItemStack stack) {
|
||||
return this.skillMask;
|
||||
}
|
||||
|
||||
public boolean hasSynergy(ItemStack staffStack, LivingEntity entity) {
|
||||
if (entity == null) return false;
|
||||
ItemStack chestStack = entity.getItemBySlot(EquipmentSlot.CHEST);
|
||||
if (chestStack.getItem() instanceof GemRobe robe) {
|
||||
return (robe.getSkillMask(chestStack) & this.getSkillMask(staffStack)) != 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract float getDamage(ItemStack stack, LivingEntity entity);
|
||||
public abstract float getExtraDamage(ItemStack stack, LivingEntity entity);
|
||||
public float getKnockback(ItemStack stack, LivingEntity entity) {
|
||||
return 0.5F;
|
||||
}
|
||||
|
||||
public float getExtraKnockback(ItemStack stack, LivingEntity entity) {
|
||||
return 0.25F;
|
||||
}
|
||||
|
||||
public abstract Vector3f getColor();
|
||||
|
||||
@Override
|
||||
public float getTooltipDamage(ItemStack weaponStack, LivingEntity entity) {
|
||||
float baseDmg = getDamage(weaponStack, entity) + (hasSynergy(weaponStack, entity) ? getExtraDamage(weaponStack, entity) : 0.0F);
|
||||
float damage = entity instanceof Player player ? DamageUtil.applyPlayerDamageEffects(player, baseDmg) : baseDmg;
|
||||
return applyMagicDamageBonus(weaponStack, entity, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shoot(Level level, Player player, InteractionHand hand, ItemStack weaponStack) {
|
||||
if (level.isClientSide()) return;
|
||||
|
||||
SoundUtil.playServerSound(player, ModSounds.BEAM3.get(), 1.0F, 1.0F);
|
||||
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
|
||||
Vec3 eyePos = player.getEyePosition();
|
||||
Vector3f offset = new Vector3f(
|
||||
hand == (player.getMainArm() == HumanoidArm.RIGHT ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND) ? -OFFSET.x : OFFSET.x,
|
||||
OFFSET.y,
|
||||
OFFSET.z
|
||||
);
|
||||
Vec3 startPos = 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
|
||||
);
|
||||
|
||||
Vec3 direction = MathUtil.toVec3(dirs[0]).normalize();
|
||||
|
||||
// 获取武器和胸甲长袍的 mask
|
||||
int staffMask = getSkillMask(weaponStack);
|
||||
int robeMask = 0;
|
||||
ItemStack chestStack = player.getItemBySlot(EquipmentSlot.CHEST);
|
||||
if(chestStack.getItem() instanceof GemRobe robe) {
|
||||
robeMask = robe.getSkillMask(chestStack);
|
||||
}
|
||||
|
||||
int skill = staffMask | robeMask;
|
||||
boolean sapphire = (skill & SKILL_SAPPHIRE) != 0;
|
||||
boolean ruby = (skill & SKILL_RUBY) != 0;
|
||||
boolean emerald = (skill & SKILL_EMERALD) != 0;
|
||||
|
||||
//红玉:后方生成的弹射+1
|
||||
int burstCount = ruby ? 2 : 1;
|
||||
|
||||
//蓝玉:双螺旋
|
||||
int helixCount = sapphire ? 2 : 1;
|
||||
|
||||
double speed = DEFAULT_SPEED;
|
||||
//翡翠:速度加快
|
||||
if(emerald) {
|
||||
speed *= EmeraldStaff.SPEED_MULTIPLIER.get();
|
||||
}
|
||||
|
||||
for(int b = 0; b < burstCount; b++) {
|
||||
Vec3 burstPos = startPos.add(direction.scale(BURST_OFFSET * b));
|
||||
|
||||
for(int h = 0; h < helixCount; h++) {
|
||||
// 1. 创建核心实体(一个核心独立管理一个实际飞弹)
|
||||
StaticSummon core = new StaticSummon(ModEntities.STATIC_SUMMON.get(), level);
|
||||
core.setOwner(player);
|
||||
core.setPos(burstPos);
|
||||
core.setDeltaMovement(direction.scale(speed));
|
||||
core.getEntityData().set(StaticSummon.STACK_SOURCE, weaponStack.copy());
|
||||
core.getEntityData().set(StaticSummon.BEHAVIOR, StaticSummonBehaviors.GEM_STAFF_PROJECTILE);
|
||||
core.getEntityData().set(StaticSummon.LIFETIME, emerald ? EmeraldStaff.LIFETIME.get() : LIFETIME);
|
||||
core.getEntityData().set(StaticSummon.RENDER_MODE, "custom");
|
||||
core.getEntityData().set(StaticSummon.GLOW, false);
|
||||
core.setNoGravity(true);
|
||||
core.noPhysics = true;
|
||||
|
||||
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
|
||||
core.setXRot(xyRot[0]);
|
||||
core.setYRot(xyRot[1]);
|
||||
core.xRotO = xyRot[0];
|
||||
core.yRotO = xyRot[1];
|
||||
|
||||
// 2. 生成实际的宝石法杖弹射(使用 StaticProjectile 实体)
|
||||
StaticProjectile projectile = new StaticProjectile(ModEntities.STATIC_PROJECTILE.get(), level);
|
||||
projectile.setOwner(core);
|
||||
|
||||
CompoundTag coreData = new CompoundTag();
|
||||
coreData.putInt("skill", skill);
|
||||
coreData.putUUID("projectileUUID", projectile.getUUID());
|
||||
core.getEntityData().set(StaticSummon.CUSTOM_DATA, coreData);
|
||||
level.addFreshEntity(core);
|
||||
projectile.setPos(burstPos);
|
||||
projectile.getEntityData().set(StaticProjectile.STACK_SOURCE, weaponStack.copy());
|
||||
projectile.getEntityData().set(StaticProjectile.BEHAVIOR, StaticProjectileBehaviors.GEM_STAFF_PROJECTILE);
|
||||
projectile.getEntityData().set(StaticProjectile.RENDER_MODE, "custom");
|
||||
projectile.getEntityData().set(StaticProjectile.GLOW, true);
|
||||
projectile.getEntityData().set(StaticProjectile.LIFETIME, emerald ? EmeraldStaff.LIFETIME.get() : LIFETIME);
|
||||
projectile.getEntityData().set(StaticProjectile.ORIGIN, burstPos.toVector3f());
|
||||
projectile.getEntityData().set(StaticProjectile.DIRECTION, dirs[0]);
|
||||
projectile.getEntityData().set(StaticProjectile.UP, dirs[1]);
|
||||
projectile.getEntityData().set(StaticProjectile.RIGHT, dirs[2]);
|
||||
|
||||
Vector3f color = getColor();
|
||||
projectile.getEntityData().set(StaticProjectile.COLOR_R, color.x);
|
||||
projectile.getEntityData().set(StaticProjectile.COLOR_G, color.y);
|
||||
projectile.getEntityData().set(StaticProjectile.COLOR_B, color.z);
|
||||
|
||||
// 蓝玉:双螺旋对称圆周方程
|
||||
if(sapphire) {
|
||||
String sign = (h == 0) ? "" : "-";
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_X, String.format(Locale.ROOT, "%s%.3f*cos(%.3f*t)", sign, DOUBLE_HELIX_RADIUS, DOUBLE_HELIX_OMEGA));
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Y, String.format(Locale.ROOT, "%s%.3f*sin(%.3f*t)", sign, DOUBLE_HELIX_RADIUS, DOUBLE_HELIX_OMEGA));
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, "0");
|
||||
}else {
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_X, "0");
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Y, "0");
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, "0");
|
||||
}
|
||||
|
||||
CompoundTag projData = new CompoundTag();
|
||||
projData.putInt("skill", skill);
|
||||
projData.putUUID("playerUUID", player.getUUID());
|
||||
projData.putFloat("damage", ruby ? getDamage(weaponStack, player) / 2 : getDamage(weaponStack, player));
|
||||
projData.putFloat("knockback", getKnockback(weaponStack, player));
|
||||
projData.putFloat("colorR", color.x);
|
||||
projData.putFloat("colorG", color.y);
|
||||
projData.putFloat("colorB", color.z);
|
||||
|
||||
if(staffMask == robeMask && staffMask != 0) {
|
||||
projData.putFloat("extraDamage", getExtraDamage(weaponStack, player));
|
||||
projData.putFloat("extraKnockback", getExtraKnockback(weaponStack, player));
|
||||
}
|
||||
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, projData);
|
||||
level.addFreshEntity(projectile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 辅助方法 ====================
|
||||
|
||||
private static Entity findTarget(StaticSummon summon, double targetRange) {
|
||||
List<Entity> targets = SearchUtil.searchEnemies(summon, summon.getOwner(), summon.getBoundingBox().inflate(targetRange));
|
||||
Entity bestTarget = null;
|
||||
double bestDistance = Double.MAX_VALUE;
|
||||
for (Entity target : targets) {
|
||||
Vec3 targetCenter = target.getBoundingBox().getCenter();
|
||||
if (!hasLineOfSight(summon.level(), summon, summon.position(), targetCenter)) continue;
|
||||
|
||||
double distance = targetCenter.distanceToSqr(summon.position());
|
||||
if (distance < bestDistance) {
|
||||
bestDistance = distance;
|
||||
bestTarget = target;
|
||||
}
|
||||
}
|
||||
return bestTarget;
|
||||
}
|
||||
|
||||
private static boolean hasLineOfSight(Level level, Entity clipEntity, Vec3 from, Vec3 to) {
|
||||
return level.clip(new ClipContext(
|
||||
from,
|
||||
to,
|
||||
ClipContext.Block.COLLIDER,
|
||||
ClipContext.Fluid.NONE,
|
||||
clipEntity
|
||||
)).getType() == HitResult.Type.MISS;
|
||||
}
|
||||
|
||||
private static Vec3 steer(Vec3 currentDir, Vec3 desiredDir, double turnRate) {
|
||||
Vec3 steered = currentDir.scale(1.0D - turnRate).add(desiredDir.normalize().scale(turnRate));
|
||||
if (steered.lengthSqr() < 1.0E-7D) return desiredDir.normalize();
|
||||
return steered.normalize();
|
||||
}
|
||||
|
||||
private static void updateRotation(StaticSummon summon, Vec3 motion) {
|
||||
float[] xyRot = MathUtil.computeXYRot(motion.toVector3f());
|
||||
summon.setXRot(xyRot[0]);
|
||||
summon.setYRot(xyRot[1]);
|
||||
summon.xRotO = xyRot[0];
|
||||
summon.yRotO = xyRot[1];
|
||||
}
|
||||
|
||||
private static Vec3 reflect(Vec3 motion, Direction hitDirection) {
|
||||
Vec3 normal = Vec3.atLowerCornerOf(hitDirection.getNormal());
|
||||
double dot = motion.dot(normal);
|
||||
if (dot >= 0.0D) {
|
||||
return motion;
|
||||
}
|
||||
return motion.subtract(normal.scale(2.0D * dot));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic.gem_staff;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigFloat;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
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 org.joml.Vector3f;
|
||||
|
||||
public class RubyStaff extends GemStaff {
|
||||
public static final Vector3f COLOR = new Vector3f(1.0F, 0.15F, 0.20F);
|
||||
public static final ConfigFloat DAMAGE = new ConfigFloat("weapon.ruby_staff.damage", "ruby_staff_damage", 5.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigFloat EXTRA_DAMAGE = new ConfigFloat("weapon.ruby_staff.extra_damage", "ruby_staff_extra_damage", 4.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigDouble MANA_CONSUME = new ConfigDouble("weapon.ruby_staff.mana_consume", "ruby_staff_mana_consume", 9.0D, 0.0D, 10000.0D);
|
||||
public static final int SKILL_MASK = SKILL_RUBY;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(
|
||||
DAMAGE,
|
||||
EXTRA_DAMAGE,
|
||||
MANA_CONSUME
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"ruby_staff",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/ruby_staff.png"),
|
||||
Component.translatable("item.lzxnoneterraria.ruby_staff"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public RubyStaff() {
|
||||
super(Tiers.IRON, new Item.Properties().stacksTo(1), SKILL_MASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamage(ItemStack stack, LivingEntity entity) {
|
||||
return DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraDamage(ItemStack stack, LivingEntity entity) {
|
||||
return EXTRA_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_CONSUME.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return computeUseTime(28, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3f getColor() {
|
||||
return COLOR;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic.gem_staff;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigFloat;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
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 org.joml.Vector3f;
|
||||
|
||||
public class SapphireStaff extends GemStaff {
|
||||
public static final Vector3f COLOR = new Vector3f(0.20F, 0.45F, 1.0F);
|
||||
public static final ConfigFloat DAMAGE = new ConfigFloat("weapon.sapphire_staff.damage", "sapphire_staff_damage", 5.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigFloat EXTRA_DAMAGE = new ConfigFloat("weapon.sapphire_staff.extra_damage", "sapphire_staff_extra_damage", 4.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigDouble MANA_CONSUME = new ConfigDouble("weapon.sapphire_staff.mana_consume", "sapphire_staff_mana_consume", 8.0D, 0.0D, 10000.0D);
|
||||
public static final int SKILL_MASK = SKILL_SAPPHIRE;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(
|
||||
DAMAGE,
|
||||
EXTRA_DAMAGE,
|
||||
MANA_CONSUME
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"sapphire_staff",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/sapphire_staff.png"),
|
||||
Component.translatable("item.lzxnoneterraria.sapphire_staff"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public SapphireStaff() {
|
||||
super(Tiers.IRON, new Item.Properties().stacksTo(1), SKILL_MASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamage(ItemStack stack, LivingEntity entity) {
|
||||
return DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraDamage(ItemStack stack, LivingEntity entity) {
|
||||
return EXTRA_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_CONSUME.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return computeUseTime(34, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3f getColor() {
|
||||
return COLOR;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.lzxnone.terraria.item.weapon.magic.gem_staff;
|
||||
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ui.config.ConfigListItem;
|
||||
import com.lzxnone.terraria.ui.config.IConfigData;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigDouble;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigFloat;
|
||||
import com.lzxnone.terraria.ui.config.struct.ConfigStruct;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
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 org.joml.Vector3f;
|
||||
|
||||
public class TopazStaff extends GemStaff {
|
||||
public static final Vector3f COLOR = new Vector3f(1.0F, 0.75F, 0.15F);
|
||||
public static final ConfigFloat DAMAGE = new ConfigFloat("weapon.topaz_staff.damage", "topaz_staff_damage", 4.5F, 0.0F, 8388600.0F);
|
||||
public static final ConfigFloat EXTRA_DAMAGE = new ConfigFloat("weapon.topaz_staff.extra_damage", "topaz_staff_extra_damage", 4.0F, 0.0F, 8388600.0F);
|
||||
public static final ConfigDouble MANA_CONSUME = new ConfigDouble("weapon.topaz_staff.mana_consume", "topaz_staff_mana_consume", 7.0D, 0.0D, 10000.0D);
|
||||
public static final ConfigDouble EXPLOSION_RANGE = new ConfigDouble("weapon.topaz_staff.explosion_range", "topaz_staff_explosion_range", 3.0D, 0.0D, 64.0D);
|
||||
public static final ConfigFloat EXPLOSION_DAMAGE = new ConfigFloat("weapon.topaz_staff.explosion_damage", "topaz_staff_explosion_damage", 3.0F, 0.0F, 8388600.0F);
|
||||
public static final int SKILL_MASK = SKILL_TOPAZ;
|
||||
|
||||
public static final IConfigData CONFIG_DATA = new IConfigData() {
|
||||
@Override
|
||||
public void onConfigLoad() {
|
||||
ConfigStruct.loadAll(
|
||||
DAMAGE,
|
||||
EXTRA_DAMAGE,
|
||||
MANA_CONSUME,
|
||||
EXPLOSION_RANGE,
|
||||
EXPLOSION_DAMAGE
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public static final ConfigListItem CONFIG_LIST_ITEM = new ConfigListItem(
|
||||
"topaz_staff",
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "textures/item/topaz_staff.png"),
|
||||
Component.translatable("item.lzxnoneterraria.topaz_staff"),
|
||||
CONFIG_DATA
|
||||
);
|
||||
|
||||
public TopazStaff() {
|
||||
super(Tiers.IRON, new Item.Properties().stacksTo(1), SKILL_MASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamage(ItemStack stack, LivingEntity entity) {
|
||||
return DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraDamage(ItemStack stack, LivingEntity entity) {
|
||||
return EXTRA_DAMAGE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getManaConsumeRate(ItemStack stack, LivingEntity entity) {
|
||||
return MANA_CONSUME.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseTime(ItemStack weaponStack, LivingEntity entity) {
|
||||
return computeUseTime(36, weaponStack, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3f getColor() {
|
||||
return COLOR;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import com.lzxnone.terraria.effect.PanicEffect;
|
||||
import com.lzxnone.terraria.effect.ZappedRedEffect;
|
||||
import com.lzxnone.terraria.effect.SummonEffect;
|
||||
import com.lzxnone.terraria.effect.ManaRegenerationEffect;
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
import com.lzxnone.terraria.enchantment.ModEnchantmentConfigs;
|
||||
import com.lzxnone.terraria.client.config.RenderConfigs;
|
||||
import com.lzxnone.terraria.item.ammo.*;
|
||||
@@ -27,6 +28,8 @@ import com.lzxnone.terraria.item.accessory.AvengerEmblem;
|
||||
import com.lzxnone.terraria.item.accessory.CobaltShield;
|
||||
import com.lzxnone.terraria.item.accessory.ObsidianShield;
|
||||
import com.lzxnone.terraria.item.accessory.AnkhShield;
|
||||
import com.lzxnone.terraria.item.accessory.RestorationShield;
|
||||
import com.lzxnone.terraria.item.accessory.MysticArtsSash;
|
||||
import com.lzxnone.terraria.item.accessory.StarCloak;
|
||||
import com.lzxnone.terraria.item.accessory.CrossNecklace;
|
||||
import com.lzxnone.terraria.item.accessory.StarVeil;
|
||||
@@ -96,15 +99,8 @@ import com.lzxnone.terraria.item.accessory.PutridScent;
|
||||
import com.lzxnone.terraria.item.accessory.Shackle;
|
||||
import com.lzxnone.terraria.item.accessory.SniperScope;
|
||||
import com.lzxnone.terraria.item.accessory.ReconScope;
|
||||
import com.lzxnone.terraria.item.weapon.magic.BetsyWrath;
|
||||
import com.lzxnone.terraria.item.weapon.magic.BubbleGun;
|
||||
import com.lzxnone.terraria.item.weapon.magic.LastPrism;
|
||||
import com.lzxnone.terraria.item.weapon.magic.LunarFlare;
|
||||
import com.lzxnone.terraria.item.weapon.magic.NebulaArcanum;
|
||||
import com.lzxnone.terraria.item.weapon.magic.NebulaBlaze;
|
||||
import com.lzxnone.terraria.item.weapon.magic.StellarTune;
|
||||
import com.lzxnone.terraria.item.weapon.magic.Nightglow;
|
||||
import com.lzxnone.terraria.item.weapon.magic.ArcSurge;
|
||||
import com.lzxnone.terraria.item.weapon.magic.*;
|
||||
import com.lzxnone.terraria.item.weapon.magic.gem_staff.*;
|
||||
import com.lzxnone.terraria.item.weapon.melee.BeeKeeper;
|
||||
import com.lzxnone.terraria.item.weapon.melee.BladeOfGrass;
|
||||
import com.lzxnone.terraria.item.weapon.melee.BloodButcherer;
|
||||
@@ -195,6 +191,13 @@ public class ConfigList {
|
||||
BubbleGun.CONFIG_LIST_ITEM,
|
||||
Nightglow.CONFIG_LIST_ITEM,
|
||||
ArcSurge.CONFIG_LIST_ITEM,
|
||||
AmethystStaff.CONFIG_LIST_ITEM,
|
||||
TopazStaff.CONFIG_LIST_ITEM,
|
||||
SapphireStaff.CONFIG_LIST_ITEM,
|
||||
EmeraldStaff.CONFIG_LIST_ITEM,
|
||||
RubyStaff.CONFIG_LIST_ITEM,
|
||||
AmberStaff.CONFIG_LIST_ITEM,
|
||||
DiamondStaff.CONFIG_LIST_ITEM,
|
||||
Minishark.CONFIG_LIST_ITEM,
|
||||
FlintlockPistol.CONFIG_LIST_ITEM,
|
||||
Boomstick.CONFIG_LIST_ITEM,
|
||||
@@ -237,7 +240,8 @@ public class ConfigList {
|
||||
IceBarrierEffect.CONFIG_LIST_ITEM,
|
||||
PanicEffect.CONFIG_LIST_ITEM,
|
||||
ZappedRedEffect.CONFIG_LIST_ITEM,
|
||||
ManaRegenerationEffect.CONFIG_LIST_ITEM
|
||||
ManaRegenerationEffect.CONFIG_LIST_ITEM,
|
||||
ManaSurgeEffect.CONFIG_LIST_ITEM
|
||||
});
|
||||
ITEMS.put(AMMO, new ConfigListItem[]{
|
||||
MusketBall.CONFIG_LIST_ITEM,
|
||||
@@ -265,6 +269,7 @@ public class ConfigList {
|
||||
CobaltShield.CONFIG_LIST_ITEM,
|
||||
ObsidianShield.CONFIG_LIST_ITEM,
|
||||
AnkhShield.CONFIG_LIST_ITEM,
|
||||
RestorationShield.CONFIG_LIST_ITEM,
|
||||
StarCloak.CONFIG_LIST_ITEM,
|
||||
CrossNecklace.CONFIG_LIST_ITEM,
|
||||
StarVeil.CONFIG_LIST_ITEM,
|
||||
@@ -283,6 +288,7 @@ public class ConfigList {
|
||||
StingerNecklace.CONFIG_LIST_ITEM,
|
||||
BeeCloak.CONFIG_LIST_ITEM,
|
||||
BlackBelt.CONFIG_LIST_ITEM,
|
||||
MysticArtsSash.CONFIG_LIST_ITEM,
|
||||
TitanGlove.CONFIG_LIST_ITEM,
|
||||
FeralClaws.CONFIG_LIST_ITEM,
|
||||
PowerGlove.CONFIG_LIST_ITEM,
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.lzxnone.terraria.utils;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.attachment.ModAttachments;
|
||||
import com.lzxnone.terraria.damage.ModDamageTypes;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.effect.ManaSurgeEffect;
|
||||
import com.lzxnone.terraria.entity.beam.SwordBeam;
|
||||
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
|
||||
import com.lzxnone.terraria.entity.summon.BeeSummon;
|
||||
@@ -184,6 +186,10 @@ public class DamageUtil {
|
||||
//近战着火
|
||||
if(AccessoryUtil.canApplyIgnite(player)) target.igniteForTicks(AccessoryUtil.getIgniteTicks(player));
|
||||
}
|
||||
if(category == DamageCategory.MAGIC) {
|
||||
//召唤落星
|
||||
AccessoryUtil.applyFallenStarSummonerOnAttack(player, target);
|
||||
}
|
||||
if(target instanceof LivingEntity livingTarget) {
|
||||
Vec3 hurtKnockback = livingTarget.getDeltaMovement().subtract(beforeHurtMovement);
|
||||
Vec3 extraKnockback = Vec3.ZERO;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
"itemGroup.lzxnoneterraria.ranged": "Terraria Ranged",
|
||||
"itemGroup.lzxnoneterraria.summon": "Terraria Summon",
|
||||
"itemGroup.lzxnoneterraria.accessory": "Terraria Accessories",
|
||||
"itemGroup.lzxnoneterraria.block": "Terraria Block",
|
||||
"itemGroup.lzxnoneterraria.calamity_melee": "Terraria Calamity Melee",
|
||||
"curios.identifier.terraria_accessory": "Terraria Accessory",
|
||||
"block.lzxnoneterraria.vision": "Vision",
|
||||
@@ -110,6 +109,7 @@
|
||||
"item.lzxnoneterraria.cobalt_shield": "Cobalt Shield",
|
||||
"item.lzxnoneterraria.obsidian_shield": "Obsidian Shield",
|
||||
"item.lzxnoneterraria.ankh_shield": "Ankh Shield",
|
||||
"item.lzxnoneterraria.restoration_shield": "Restoration Shield",
|
||||
"item.lzxnoneterraria.avenger_emblem": "Avenger Emblem",
|
||||
"item.lzxnoneterraria.cross_necklace": "Cross Necklace",
|
||||
"item.lzxnoneterraria.star_cloak": "Star Cloak",
|
||||
@@ -136,6 +136,7 @@
|
||||
"item.lzxnoneterraria.stinger_necklace": "Stinger Necklace",
|
||||
"item.lzxnoneterraria.bee_cloak": "Bee Cloak",
|
||||
"item.lzxnoneterraria.black_belt": "Black Belt",
|
||||
"item.lzxnoneterraria.mystic_arts_sash": "Mystic Arts Sash",
|
||||
"item.lzxnoneterraria.titan_glove": "Titan Glove",
|
||||
"item.lzxnoneterraria.feral_claws": "Feral Claws",
|
||||
"item.lzxnoneterraria.power_glove": "Power Glove",
|
||||
@@ -198,6 +199,14 @@
|
||||
"item.lzxnoneterraria.mana_potion": "Mana Potion",
|
||||
"item.lzxnoneterraria.greater_mana_potion": "Greater Mana Potion",
|
||||
"item.lzxnoneterraria.super_mana_potion": "Super Mana Potion",
|
||||
"item.lzxnoneterraria.robe": "Robe",
|
||||
"item.lzxnoneterraria.amethyst_robe": "Amethyst Robe",
|
||||
"item.lzxnoneterraria.topaz_robe": "Topaz Robe",
|
||||
"item.lzxnoneterraria.sapphire_robe": "Sapphire Robe",
|
||||
"item.lzxnoneterraria.emerald_robe": "Emerald Robe",
|
||||
"item.lzxnoneterraria.ruby_robe": "Ruby Robe",
|
||||
"item.lzxnoneterraria.amber_robe": "Amber Robe",
|
||||
"item.lzxnoneterraria.diamond_robe": "Diamond Robe",
|
||||
"enchantment.lzxnoneterraria.mana_leak": "Mana Leak",
|
||||
"enchantment.lzxnoneterraria.mana_efficiency": "Mana Efficiency",
|
||||
"enchantment.lzxnoneterraria.arcane_amplification": "Arcane Amplification",
|
||||
@@ -313,6 +322,7 @@
|
||||
"lzxnoneterraria.configuration.jump_height": "Jump Height",
|
||||
"lzxnoneterraria.configuration.jump_height.tooltip": "Vertical jump velocity multiplier while equipped",
|
||||
"tooltip.lzxnoneterraria.fallen_star_summon": "Summons falling stars when damaged",
|
||||
"tooltip.lzxnoneterraria.mana_cloak_fallen_star_summon": "Causes stars to fall when damaged or dealing magic damage",
|
||||
"tooltip.lzxnoneterraria.invulnerable_time_bonus": "Extends invulnerability time after being hit x%s",
|
||||
"tooltip.lzxnoneterraria.bee_summon": "Releases bees when damaged",
|
||||
"tooltip.lzxnoneterraria.aggro_increase": "Increases enemy aggro",
|
||||
@@ -461,6 +471,7 @@
|
||||
"effect.lzxnoneterraria.summon": "Summon",
|
||||
"effect.lzxnoneterraria.mana_sickness": "Mana Sickness",
|
||||
"effect.lzxnoneterraria.mana_regeneration": "Mana Regeneration",
|
||||
"effect.lzxnoneterraria.mana_surge": "Mana Surge",
|
||||
"effect.lzxnoneterraria.zapped_red": "Zapped",
|
||||
"key.categories.lzxnoneterraria": "lzxnoneterraria",
|
||||
"key.lzxnoneterraria.kill_mode": "Kill Mode",
|
||||
@@ -1175,5 +1186,74 @@
|
||||
"lzxnoneterraria.configuration.devils_devastation_stuck_projectile_effect_duration": "Stuck Projectile Effect Duration",
|
||||
"lzxnoneterraria.configuration.devils_devastation_stuck_projectile_effect_duration.tooltip": "Effect duration applied by popped-out projectile in ticks",
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_projectile_effect_duration": "Kill Mode Projectile Effect Duration",
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_projectile_effect_duration.tooltip": "Effect duration applied by kill mode projectile in ticks"
|
||||
}
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_projectile_effect_duration.tooltip": "Effect duration applied by kill mode projectile in ticks",
|
||||
"item.lzxnoneterraria.amethyst_staff": "Amethyst Staff",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_mana_consume": "Mana Consume",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_mana_consume.tooltip": "Mana consumed per use",
|
||||
"item.lzxnoneterraria.topaz_staff": "Topaz Staff",
|
||||
"lzxnoneterraria.configuration.topaz_staff_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.topaz_staff_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.topaz_staff_mana_consume": "Mana Consume",
|
||||
"lzxnoneterraria.configuration.topaz_staff_mana_consume.tooltip": "Mana consumed per use",
|
||||
"item.lzxnoneterraria.sapphire_staff": "Sapphire Staff",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_mana_consume": "Mana Consume",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_mana_consume.tooltip": "Mana consumed per use",
|
||||
"item.lzxnoneterraria.emerald_staff": "Emerald Staff",
|
||||
"lzxnoneterraria.configuration.emerald_staff_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.emerald_staff_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.emerald_staff_mana_consume": "Mana Consume",
|
||||
"lzxnoneterraria.configuration.emerald_staff_mana_consume.tooltip": "Mana consumed per use",
|
||||
"item.lzxnoneterraria.ruby_staff": "Ruby Staff",
|
||||
"lzxnoneterraria.configuration.ruby_staff_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.ruby_staff_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.ruby_staff_mana_consume": "Mana Consume",
|
||||
"lzxnoneterraria.configuration.ruby_staff_mana_consume.tooltip": "Mana consumed per use",
|
||||
"item.lzxnoneterraria.amber_staff": "Amber Staff",
|
||||
"lzxnoneterraria.configuration.amber_staff_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.amber_staff_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.amber_staff_mana_consume": "Mana Consume",
|
||||
"lzxnoneterraria.configuration.amber_staff_mana_consume.tooltip": "Mana consumed per use",
|
||||
"item.lzxnoneterraria.diamond_staff": "Diamond Staff",
|
||||
"lzxnoneterraria.configuration.diamond_staff_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.diamond_staff_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.diamond_staff_mana_consume": "Mana Consume",
|
||||
"lzxnoneterraria.configuration.diamond_staff_mana_consume.tooltip": "Mana consumed per use",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_extra_damage": "Synergy Extra Damage",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_extra_damage.tooltip": "Bonus damage when equipped with matching Gem Robe",
|
||||
"lzxnoneterraria.configuration.topaz_staff_extra_damage": "Synergy Extra Damage",
|
||||
"lzxnoneterraria.configuration.topaz_staff_extra_damage.tooltip": "Bonus damage when equipped with matching Gem Robe",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_extra_damage": "Synergy Extra Damage",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_extra_damage.tooltip": "Bonus damage when equipped with matching Gem Robe",
|
||||
"lzxnoneterraria.configuration.emerald_staff_extra_damage": "Synergy Extra Damage",
|
||||
"lzxnoneterraria.configuration.emerald_staff_extra_damage.tooltip": "Bonus damage when equipped with matching Gem Robe",
|
||||
"lzxnoneterraria.configuration.ruby_staff_extra_damage": "Synergy Extra Damage",
|
||||
"lzxnoneterraria.configuration.ruby_staff_extra_damage.tooltip": "Bonus damage when equipped with matching Gem Robe",
|
||||
"lzxnoneterraria.configuration.amber_staff_extra_damage": "Synergy Extra Damage",
|
||||
"lzxnoneterraria.configuration.amber_staff_extra_damage.tooltip": "Bonus damage when equipped with matching Gem Robe",
|
||||
"lzxnoneterraria.configuration.diamond_staff_extra_damage": "Synergy Extra Damage",
|
||||
"lzxnoneterraria.configuration.diamond_staff_extra_damage.tooltip": "Bonus damage when equipped with matching Gem Robe",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_target_range": "Homing Range",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_target_range.tooltip": "Maximum tracking and homing distance (blocks)",
|
||||
"lzxnoneterraria.configuration.topaz_staff_explosion_range": "Explosion Range",
|
||||
"lzxnoneterraria.configuration.topaz_staff_explosion_range.tooltip": "AoE damage radius upon hit (blocks)",
|
||||
"lzxnoneterraria.configuration.topaz_staff_explosion_damage": "Explosion Damage",
|
||||
"lzxnoneterraria.configuration.topaz_staff_explosion_damage.tooltip": "Damage dealt by the explosion upon impact",
|
||||
"lzxnoneterraria.configuration.emerald_staff_max_entity_hit_count": "Max Entity Hits",
|
||||
"lzxnoneterraria.configuration.emerald_staff_max_entity_hit_count.tooltip": "Maximum number of entities pierced",
|
||||
"lzxnoneterraria.configuration.amber_staff_max_hit_count": "Max Total Hits",
|
||||
"lzxnoneterraria.configuration.amber_staff_max_hit_count.tooltip": "Maximum total bounces and entity hits",
|
||||
"lzxnoneterraria.configuration.diamond_staff_max_entity_hit_count": "Max Entity Hits",
|
||||
"lzxnoneterraria.configuration.diamond_staff_max_entity_hit_count.tooltip": "Maximum number of entities pierced",
|
||||
"lzxnoneterraria.configuration.emerald_staff_speed_multiplier": "Speed Multiplier",
|
||||
"lzxnoneterraria.configuration.emerald_staff_speed_multiplier.tooltip": "Flight speed multiplier granted by Emerald skill (default 2x)",
|
||||
"lzxnoneterraria.configuration.emerald_staff_lifetime": "Lifetime",
|
||||
"lzxnoneterraria.configuration.emerald_staff_lifetime.tooltip": "Lifetime of the projectile with Emerald skill (ticks)",
|
||||
"lzxnoneterraria.configuration.emerald_staff_drag": "Drag Multiplier",
|
||||
"lzxnoneterraria.configuration.emerald_staff_drag.tooltip": "Flight drag multiplier of the projectile with Emerald skill per tick",
|
||||
"lzxnoneterraria.configuration.diamond_staff_hitbox_inflate": "Hitbox Inflate",
|
||||
"lzxnoneterraria.configuration.diamond_staff_hitbox_inflate.tooltip": "Extra hitbox inflation radius for the Diamond projectile (blocks)"
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"itemGroup.lzxnoneterraria.melee": "泰拉瑞亚 近战武器",
|
||||
"itemGroup.lzxnoneterraria.magic": "泰拉瑞亚 魔法武器",
|
||||
"itemGroup.lzxnoneterraria.ranged": "泰拉瑞亚 远程武器",
|
||||
"itemGroup.lzxnoneterraria.summon": "泰拉瑞亚 召唤武器",
|
||||
"itemGroup.lzxnoneterraria.melee": "泰拉瑞亚 近战",
|
||||
"itemGroup.lzxnoneterraria.magic": "泰拉瑞亚 魔法",
|
||||
"itemGroup.lzxnoneterraria.ranged": "泰拉瑞亚 远程",
|
||||
"itemGroup.lzxnoneterraria.summon": "泰拉瑞亚 召唤",
|
||||
"itemGroup.lzxnoneterraria.accessory": "泰拉瑞亚 饰品",
|
||||
"itemGroup.lzxnoneterraria.block": "泰拉瑞亚 方块",
|
||||
"itemGroup.lzxnoneterraria.calamity_melee": "泰拉瑞亚灾厄 近战武器",
|
||||
"itemGroup.lzxnoneterraria.calamity_melee": "泰拉瑞亚灾厄 近战",
|
||||
"curios.identifier.terraria_accessory": "泰拉瑞亚饰品",
|
||||
"block.lzxnoneterraria.vision": "幻象",
|
||||
"block.lzxnoneterraria.stardust_dragon_head": "星尘龙头部",
|
||||
@@ -110,6 +109,7 @@
|
||||
"item.lzxnoneterraria.cobalt_shield": "钴护盾",
|
||||
"item.lzxnoneterraria.obsidian_shield": "黑曜石护盾",
|
||||
"item.lzxnoneterraria.ankh_shield": "十字章护盾",
|
||||
"item.lzxnoneterraria.restoration_shield": "恢复之盾",
|
||||
"item.lzxnoneterraria.avenger_emblem": "复仇者徽章",
|
||||
"item.lzxnoneterraria.cross_necklace": "十字项链",
|
||||
"item.lzxnoneterraria.star_cloak": "星星斗篷",
|
||||
@@ -136,6 +136,7 @@
|
||||
"item.lzxnoneterraria.stinger_necklace": "毒刺项链",
|
||||
"item.lzxnoneterraria.bee_cloak": "蜜蜂斗篷",
|
||||
"item.lzxnoneterraria.black_belt": "黑腰带",
|
||||
"item.lzxnoneterraria.mystic_arts_sash": "秘术腰带",
|
||||
"item.lzxnoneterraria.titan_glove": "泰坦手套",
|
||||
"item.lzxnoneterraria.feral_claws": "猛爪手套",
|
||||
"item.lzxnoneterraria.power_glove": "强力手套",
|
||||
@@ -198,6 +199,14 @@
|
||||
"item.lzxnoneterraria.mana_potion": "魔力药水",
|
||||
"item.lzxnoneterraria.greater_mana_potion": "强效魔力药水",
|
||||
"item.lzxnoneterraria.super_mana_potion": "超级魔力药水",
|
||||
"item.lzxnoneterraria.robe": "长袍",
|
||||
"item.lzxnoneterraria.amethyst_robe": "紫晶长袍",
|
||||
"item.lzxnoneterraria.topaz_robe": "黄玉长袍",
|
||||
"item.lzxnoneterraria.sapphire_robe": "蓝玉长袍",
|
||||
"item.lzxnoneterraria.emerald_robe": "翡翠长袍",
|
||||
"item.lzxnoneterraria.ruby_robe": "红玉长袍",
|
||||
"item.lzxnoneterraria.amber_robe": "琥珀长袍",
|
||||
"item.lzxnoneterraria.diamond_robe": "钻石长袍",
|
||||
"enchantment.lzxnoneterraria.mana_leak": "魔力泄漏",
|
||||
"enchantment.lzxnoneterraria.mana_efficiency": "魔力效率",
|
||||
"enchantment.lzxnoneterraria.arcane_amplification": "奥术增幅",
|
||||
@@ -313,6 +322,7 @@
|
||||
"lzxnoneterraria.configuration.jump_height": "跳跃高度",
|
||||
"lzxnoneterraria.configuration.jump_height.tooltip": "佩戴后跳跃垂直初速度的倍率",
|
||||
"tooltip.lzxnoneterraria.fallen_star_summon": "受到伤害后会使星星坠落",
|
||||
"tooltip.lzxnoneterraria.mana_cloak_fallen_star_summon": "受到伤害或者造成魔法伤害会使星星坠落",
|
||||
"tooltip.lzxnoneterraria.invulnerable_time_bonus": "延长受伤后的无敌状态时间 x%s",
|
||||
"tooltip.lzxnoneterraria.bee_summon": "受到伤害后释放蜜蜂",
|
||||
"tooltip.lzxnoneterraria.aggro_increase": "增加怪物仇恨",
|
||||
@@ -461,6 +471,7 @@
|
||||
"effect.lzxnoneterraria.summon": "召唤",
|
||||
"effect.lzxnoneterraria.mana_sickness": "耐魔性",
|
||||
"effect.lzxnoneterraria.mana_regeneration": "魔力再生",
|
||||
"effect.lzxnoneterraria.mana_surge": "魔力涌动",
|
||||
"effect.lzxnoneterraria.zapped_red": "电击",
|
||||
"key.categories.lzxnoneterraria": "lzxnoneterraria",
|
||||
"key.lzxnoneterraria.kill_mode": "进入杀戮模式",
|
||||
@@ -1175,5 +1186,74 @@
|
||||
"lzxnoneterraria.configuration.devils_devastation_stuck_projectile_effect_duration": "弹出弹射效果持续时间",
|
||||
"lzxnoneterraria.configuration.devils_devastation_stuck_projectile_effect_duration.tooltip": "弹出弹射命中后造成的效果持续时间(刻)",
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_projectile_effect_duration": "杀戮模式弹射效果持续时间",
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_projectile_effect_duration.tooltip": "杀戮模式弹射命中后造成的效果持续时间(刻)"
|
||||
}
|
||||
"lzxnoneterraria.configuration.devils_devastation_kill_mode_projectile_effect_duration.tooltip": "杀戮模式弹射命中后造成的效果持续时间(刻)",
|
||||
"item.lzxnoneterraria.amethyst_staff": "紫晶法杖",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_mana_consume": "魔力消耗",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_mana_consume.tooltip": "每次使用消耗的魔力值",
|
||||
"item.lzxnoneterraria.topaz_staff": "黄玉法杖",
|
||||
"lzxnoneterraria.configuration.topaz_staff_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.topaz_staff_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.topaz_staff_mana_consume": "魔力消耗",
|
||||
"lzxnoneterraria.configuration.topaz_staff_mana_consume.tooltip": "每次使用消耗的魔力值",
|
||||
"item.lzxnoneterraria.sapphire_staff": "蓝玉法杖",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_mana_consume": "魔力消耗",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_mana_consume.tooltip": "每次使用消耗的魔力值",
|
||||
"item.lzxnoneterraria.emerald_staff": "翡翠法杖",
|
||||
"lzxnoneterraria.configuration.emerald_staff_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.emerald_staff_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.emerald_staff_mana_consume": "魔力消耗",
|
||||
"lzxnoneterraria.configuration.emerald_staff_mana_consume.tooltip": "每次使用消耗的魔力值",
|
||||
"item.lzxnoneterraria.ruby_staff": "红玉法杖",
|
||||
"lzxnoneterraria.configuration.ruby_staff_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.ruby_staff_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.ruby_staff_mana_consume": "魔力消耗",
|
||||
"lzxnoneterraria.configuration.ruby_staff_mana_consume.tooltip": "每次使用消耗的魔力值",
|
||||
"item.lzxnoneterraria.amber_staff": "琥珀法杖",
|
||||
"lzxnoneterraria.configuration.amber_staff_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.amber_staff_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.amber_staff_mana_consume": "魔力消耗",
|
||||
"lzxnoneterraria.configuration.amber_staff_mana_consume.tooltip": "每次使用消耗的魔力值",
|
||||
"item.lzxnoneterraria.diamond_staff": "钻石法杖",
|
||||
"lzxnoneterraria.configuration.diamond_staff_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.diamond_staff_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.diamond_staff_mana_consume": "魔力消耗",
|
||||
"lzxnoneterraria.configuration.diamond_staff_mana_consume.tooltip": "每次使用消耗的魔力值",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_extra_damage": "同系额外伤害",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_extra_damage.tooltip": "装备对应宝石长袍时获得的共鸣额外伤害",
|
||||
"lzxnoneterraria.configuration.topaz_staff_extra_damage": "同系额外伤害",
|
||||
"lzxnoneterraria.configuration.topaz_staff_extra_damage.tooltip": "装备对应宝石长袍时获得的共鸣额外伤害",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_extra_damage": "同系额外伤害",
|
||||
"lzxnoneterraria.configuration.sapphire_staff_extra_damage.tooltip": "装备对应宝石长袍时获得的共鸣额外伤害",
|
||||
"lzxnoneterraria.configuration.emerald_staff_extra_damage": "同系额外伤害",
|
||||
"lzxnoneterraria.configuration.emerald_staff_extra_damage.tooltip": "装备对应宝石长袍时获得的共鸣额外伤害",
|
||||
"lzxnoneterraria.configuration.ruby_staff_extra_damage": "同系额外伤害",
|
||||
"lzxnoneterraria.configuration.ruby_staff_extra_damage.tooltip": "装备对应宝石长袍时获得的共鸣额外伤害",
|
||||
"lzxnoneterraria.configuration.amber_staff_extra_damage": "同系额外伤害",
|
||||
"lzxnoneterraria.configuration.amber_staff_extra_damage.tooltip": "装备对应宝石长袍时获得的共鸣额外伤害",
|
||||
"lzxnoneterraria.configuration.diamond_staff_extra_damage": "同系额外伤害",
|
||||
"lzxnoneterraria.configuration.diamond_staff_extra_damage.tooltip": "装备对应宝石长袍时获得的共鸣额外伤害",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_target_range": "追踪范围",
|
||||
"lzxnoneterraria.configuration.amethyst_staff_target_range.tooltip": "自动索敌追踪的最大距离(格)",
|
||||
"lzxnoneterraria.configuration.topaz_staff_explosion_range": "爆炸范围",
|
||||
"lzxnoneterraria.configuration.topaz_staff_explosion_range.tooltip": "命中引发范围伤害的半径(格)",
|
||||
"lzxnoneterraria.configuration.topaz_staff_explosion_damage": "爆炸伤害",
|
||||
"lzxnoneterraria.configuration.topaz_staff_explosion_damage.tooltip": "命中引发范围爆炸造成的伤害",
|
||||
"lzxnoneterraria.configuration.emerald_staff_max_entity_hit_count": "最大穿透实体数",
|
||||
"lzxnoneterraria.configuration.emerald_staff_max_entity_hit_count.tooltip": "能够命中的最大实体数量",
|
||||
"lzxnoneterraria.configuration.amber_staff_max_hit_count": "最大碰撞总次数",
|
||||
"lzxnoneterraria.configuration.amber_staff_max_hit_count.tooltip": "碰撞方块反弹与命中实体的总次数上限",
|
||||
"lzxnoneterraria.configuration.diamond_staff_max_entity_hit_count": "最大穿透实体数",
|
||||
"lzxnoneterraria.configuration.diamond_staff_max_entity_hit_count.tooltip": "能够穿透命中的最大实体数量",
|
||||
"lzxnoneterraria.configuration.emerald_staff_speed_multiplier": "速度倍率",
|
||||
"lzxnoneterraria.configuration.emerald_staff_speed_multiplier.tooltip": "翡翠技能赋予弹射物的飞行速度倍率(默认双倍)",
|
||||
"lzxnoneterraria.configuration.emerald_staff_lifetime": "存活时间",
|
||||
"lzxnoneterraria.configuration.emerald_staff_lifetime.tooltip": "翡翠技能弹射物的存活时间(tick)",
|
||||
"lzxnoneterraria.configuration.emerald_staff_drag": "阻力系数",
|
||||
"lzxnoneterraria.configuration.emerald_staff_drag.tooltip": "翡翠技能弹射物的飞行阻力系数(每 tick 速度乘数)",
|
||||
"lzxnoneterraria.configuration.diamond_staff_hitbox_inflate": "碰撞箱扩展",
|
||||
"lzxnoneterraria.configuration.diamond_staff_hitbox_inflate.tooltip": "钻石技能弹射物的额外实体碰撞扩展半径(格)"
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// Made with Blockbench 5.1.6
|
||||
// Exported for Minecraft version 1.17 or later with Mojang mappings
|
||||
// Paste this class into your mod and generate all required imports
|
||||
|
||||
|
||||
public class CustomModel<T extends Entity> extends EntityModel<T> {
|
||||
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor
|
||||
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation("modid", "custommodel"), "main");
|
||||
private final ModelPart Waist;
|
||||
private final ModelPart Body;
|
||||
|
||||
public CustomModel(ModelPart root) {
|
||||
this.Waist = root.getChild("Waist");
|
||||
this.Body = this.Waist.getChild("Body");
|
||||
}
|
||||
|
||||
public static LayerDefinition createBodyLayer() {
|
||||
MeshDefinition meshdefinition = new MeshDefinition();
|
||||
PartDefinition partdefinition = meshdefinition.getRoot();
|
||||
|
||||
PartDefinition Waist = partdefinition.addOrReplaceChild("Waist", CubeListBuilder.create(), PartPose.offset(0.0F, 12.0F, 0.0F));
|
||||
|
||||
PartDefinition Body = Waist.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(16, 16).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, new CubeDeformation(0.0F))
|
||||
.texOffs(13, 14).addBox(-5.0F, 0.0F, -3.0F, 10.0F, 12.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -12.0F, 0.0F));
|
||||
|
||||
return LayerDefinition.create(meshdefinition, 64, 64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
|
||||
Waist.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/amber_robe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/sword2",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/amber_staff"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/amethyst_robe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/sword2",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/amethyst_staff"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/diamond_robe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/sword2",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/diamond_staff"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/emerald_robe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/sword2",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/emerald_staff"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/mana_star2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/mystic_arts_sash"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/restoration_shield"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/robe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/ruby_robe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/sword2",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/ruby_staff"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/sapphire_robe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/sword2",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/sapphire_staff"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/topaz_robe"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/sword2",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/topaz_staff"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/white_star2"
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,9 @@
|
||||
"beam2": {
|
||||
"sounds": ["lzxnoneterraria:beam2"]
|
||||
},
|
||||
"beam3": {
|
||||
"sounds": ["lzxnoneterraria:beam3"]
|
||||
},
|
||||
"betsys_fireball_shoot": {
|
||||
"sounds": [
|
||||
"lzxnoneterraria:betsys_fireball_shoot",
|
||||
|
||||
|
After Width: | Height: | Size: 235 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 213 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 216 B |
|
After Width: | Height: | Size: 221 B |
|
After Width: | Height: | Size: 249 B |
|
After Width: | Height: | Size: 239 B |
|
After Width: | Height: | Size: 261 B |