diff --git a/src/generated/resources/assets/malum/lang/en_us.json b/src/generated/resources/assets/malum/lang/en_us.json index 98b035af0..c8a5d4482 100644 --- a/src/generated/resources/assets/malum/lang/en_us.json +++ b/src/generated/resources/assets/malum/lang/en_us.json @@ -946,6 +946,11 @@ "malum.subtitle.spirit_picked_up": "Spirit picked up", "malum.subtitle.spirit_rite_activated": "Spirit rite activated", "malum.subtitle.spirit_rite_cancelled": "Spirit rite cancelled", + "malum.subtitle.stave_charged": "Stave charged", + "malum.subtitle.stave_fires": "Stave fires", + "malum.subtitle.stave_powers_up": "Stave powers up", + "malum.subtitle.stave_sizzles": "Stave sizzles", + "malum.subtitle.stave_strikes": "Stave strikes", "malum.subtitle.the_deep_beckons": "The deep beckons", "malum.subtitle.the_heavens_sing": "The heavens sing", "malum.subtitle.the_unknown_weeps": "The unknown weeps", diff --git a/src/generated/resources/data/malum/tags/items/soul_hunter_weapon.json b/src/generated/resources/data/malum/tags/items/soul_hunter_weapon.json index 35ed60415..ba487e2fa 100644 --- a/src/generated/resources/data/malum/tags/items/soul_hunter_weapon.json +++ b/src/generated/resources/data/malum/tags/items/soul_hunter_weapon.json @@ -1,5 +1,6 @@ { "values": [ + "malum:soul_stained_steel_stave", "malum:tyrving", "malum:crude_scythe", "malum:soul_stained_steel_scythe", diff --git a/src/main/java/com/sammy/malum/common/entity/HexProjectileEntity.java b/src/main/java/com/sammy/malum/common/entity/HexProjectileEntity.java index 385267748..64fc1fb4f 100644 --- a/src/main/java/com/sammy/malum/common/entity/HexProjectileEntity.java +++ b/src/main/java/com/sammy/malum/common/entity/HexProjectileEntity.java @@ -42,7 +42,6 @@ public class HexProjectileEntity extends ThrowableItemProjectile { protected float magicDamage; public int age; public int spawnDelay; - public int soundCooldown = 20 + random.nextInt(100); public boolean fadingAway; @@ -110,6 +109,13 @@ public void readAdditionalSaveData(CompoundTag compound) { @Override protected void onHitBlock(BlockHitResult pResult) { + if (fadingAway || spawnDelay != 0) { + return; + } + if (!level().isClientSide) { + ParticleEffectTypeRegistry.HEX_BOLT_IMPACT.createPositionedEffect(level(), new PositionEffectData(position().add(getDeltaMovement().scale(0.25f))), new ColorEffectData(SpiritTypeRegistry.WICKED_SPIRIT), HexBoltHitEnemyParticleEffect.createData(getDeltaMovement().reverse().normalize())); + level().playSound(null, blockPosition(), SoundRegistry.STAVE_STRIKES.get(), getSoundSource(), 0.5f, Mth.nextFloat(random, 0.9F, 1.5F)); + } getEntityData().set(DATA_FADING_AWAY, true); setDeltaMovement(getDeltaMovement().scale(0.05f)); super.onHitBlock(pResult); @@ -142,7 +148,7 @@ protected void onHitEntity(EntityHitResult result) { } getEntityData().set(DATA_FADING_AWAY, true); ParticleEffectTypeRegistry.HEX_BOLT_IMPACT.createPositionedEffect(level(), new PositionEffectData(position().add(getDeltaMovement().scale(0.5f))), new ColorEffectData(SpiritTypeRegistry.WICKED_SPIRIT), HexBoltHitEnemyParticleEffect.createData(getDeltaMovement().reverse().normalize())); - target.level().playSound(null, target.getX(), target.getY(), target.getZ(), SoundRegistry.SCYTHE_CUT.get(), target.getSoundSource(), 1.0F, 0.9f + target.level().random.nextFloat() * 0.2f); + level().playSound(null, blockPosition(), SoundRegistry.STAVE_STRIKES.get(), getSoundSource(), 0.75f, Mth.nextFloat(random, 1F, 1.4F)); setDeltaMovement(getDeltaMovement().scale(0.05f)); } } @@ -153,6 +159,9 @@ protected void onHitEntity(EntityHitResult result) { public void tick() { if (spawnDelay > 0) { spawnDelay--; + if (spawnDelay == 0 && !level().isClientSide) { + level().playSound(null, blockPosition(), SoundRegistry.STAVE_FIRES.get(), SoundSource.PLAYERS, 0.5f, Mth.nextFloat(random, 0.9F, 1.5F)); + } return; } super.tick(); @@ -160,12 +169,6 @@ public void tick() { if (!fadingAway) { setDeltaMovement(motion.x * 0.96, (motion.y > 0 ? motion.y * 0.98 : motion.y) - 0.015f, motion.z * 0.96); } - if (soundCooldown-- == 0) { - if (random.nextFloat() < 0.6f) { - level().playSound(null, blockPosition(), SoundRegistry.ARCANE_WHISPERS.get(), SoundSource.NEUTRAL, 0.3f, Mth.nextFloat(random, 1.1f, 2f)); - } - soundCooldown = random.nextInt(40) + 40; - } float offsetScale = fadingAway ? 0f : 0.3f; for (int i = 0; i < 2; i++) { float progress = i * 0.5f; @@ -200,7 +203,7 @@ public void tick() { .setSpinData(spinData) .setScaleData(GenericParticleData.create(0.4f * scalar, 0).setEasing(Easing.SINE_IN_OUT).build()) .setColorData(SpiritTypeRegistry.WICKED_SPIRIT.createMainColorData().build()) - .setLifetime(Math.min(age * 3, 30)) + .setLifetime(Math.min(6+age * 3, 30)) .setDirection(getDeltaMovement().normalize()) .enableNoClip() .enableForcedSpawn() diff --git a/src/main/java/com/sammy/malum/common/item/curiosities/weapons/MagicStaveItem.java b/src/main/java/com/sammy/malum/common/item/curiosities/weapons/MagicStaveItem.java index 1394e9fe7..d3aed6660 100644 --- a/src/main/java/com/sammy/malum/common/item/curiosities/weapons/MagicStaveItem.java +++ b/src/main/java/com/sammy/malum/common/item/curiosities/weapons/MagicStaveItem.java @@ -4,7 +4,7 @@ import com.sammy.malum.common.entity.*; import com.sammy.malum.registry.client.*; import com.sammy.malum.registry.common.*; -import com.sammy.malum.registry.common.item.*; +import net.minecraft.sounds.*; import net.minecraft.stats.*; import net.minecraft.util.*; import net.minecraft.world.*; @@ -12,7 +12,6 @@ import net.minecraft.world.entity.ai.attributes.*; import net.minecraft.world.entity.player.*; import net.minecraft.world.item.*; -import net.minecraft.world.item.enchantment.*; import net.minecraft.world.level.*; import net.minecraft.world.phys.*; import team.lodestar.lodestone.helpers.*; @@ -23,10 +22,6 @@ import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.data.spin.*; import team.lodestar.lodestone.systems.particle.render_types.*; -import team.lodestar.lodestone.systems.particle.world.*; - -import java.util.*; -import java.util.function.*; public class MagicStaveItem extends MalumStaveItem { @@ -46,11 +41,12 @@ public ImmutableMultimap.Builder createExtraAttrib @Override public void onUseTick(Level pLevel, LivingEntity pLivingEntity, ItemStack pStack, int pRemainingUseDuration) { + final int useDuration = getUseDuration(pStack); if (pLevel.isClientSide) { RandomSource random = pLevel.random; InteractionHand hand = pLivingEntity.getUsedItemHand(); Vec3 pos = getProjectileSpawnPos(pLivingEntity, hand, 1.5f, 0.6f); - float pct = Math.min(20, getUseDuration(pStack) - pRemainingUseDuration) / 20f; + float pct = Math.min(20, useDuration - pRemainingUseDuration) / 20f; final SpinParticleData spinData = SpinParticleData.createRandomDirection(random, 0.25f, 0.5f).setSpinOffset(RandomHelper.randomBetween(random, 0f, 6.28f)).build(); DirectionalParticleBuilder.create(ParticleRegistry.HEXAGON) .setTransparencyData(GenericParticleData.create(0.6f * pct, 0f).setEasing(Easing.SINE_IN_OUT, Easing.SINE_IN).build()) @@ -69,6 +65,17 @@ public void onUseTick(Level pLevel, LivingEntity pLivingEntity, ItemStack pStack .setRenderType(LodestoneWorldParticleRenderType.LUMITRANSPARENT) .spawn(pLevel, pos.x, pos.y, pos.z); } + if (pRemainingUseDuration == useDuration - 20) { + pLevel.playSound(null, pLivingEntity.blockPosition(), SoundRegistry.STAVE_CHARGED.get(), SoundSource.PLAYERS, 1f, Mth.nextFloat(pLevel.random, 1f, 1.4f)); + } + else if (pRemainingUseDuration > useDuration - 20 && pRemainingUseDuration % 5 == 0) { + float pct = 0.25f+Math.min(20, useDuration - pRemainingUseDuration) / 20f; + pLevel.playSound(null, pLivingEntity.blockPosition(), SoundRegistry.STAVE_POWERS_UP.get(), SoundSource.PLAYERS, 0.5f, pct+Mth.nextFloat(pLevel.random, 0.2f, 0.4f)); + } + else if (pRemainingUseDuration % 5 == 0) { + pLevel.playSound(null, pLivingEntity.blockPosition(), SoundRegistry.STAVE_POWERS_UP.get(), SoundSource.PLAYERS, 0.25f, Mth.nextFloat(pLevel.random, 0.2f, 0.6f)); + + } super.onUseTick(pLevel, pLivingEntity, pStack, pRemainingUseDuration); } @@ -88,9 +95,13 @@ public void releaseUsing(ItemStack pStack, Level pLevel, LivingEntity pLivingEnt }); player.getCooldowns().addCooldown(this, 80); } + pLevel.playSound(null, pLivingEntity.blockPosition(), SoundRegistry.STAVE_FIRES.get(), SoundSource.PLAYERS, 0.5f, Mth.nextFloat(pLevel.random, 0.8f, 1.2f)); player.swing(hand, true); } } + else { + pLevel.playSound(null, pLivingEntity.blockPosition(), SoundRegistry.STAVE_SIZZLES.get(), SoundSource.PLAYERS, 0.5f, Mth.nextFloat(pLevel.random, 0.5f, 0.8f)); + } super.releaseUsing(pStack, pLevel, pLivingEntity, pTimeCharged); } diff --git a/src/main/java/com/sammy/malum/common/item/curiosities/weapons/MalumStaveItem.java b/src/main/java/com/sammy/malum/common/item/curiosities/weapons/MalumStaveItem.java index 300df6719..109651c76 100644 --- a/src/main/java/com/sammy/malum/common/item/curiosities/weapons/MalumStaveItem.java +++ b/src/main/java/com/sammy/malum/common/item/curiosities/weapons/MalumStaveItem.java @@ -30,7 +30,7 @@ public MalumStaveItem(Tier tier, float attackDamageIn, float attackSpeedIn, Prop public void hurtEvent(LivingHurtEvent event, LivingEntity attacker, LivingEntity target, ItemStack stack) { if (attacker instanceof Player player && !(event.getSource().getDirectEntity() instanceof HexProjectileEntity)) { spawnSweepParticles(player, ParticleRegistry.SCYTHE_CUT_ATTACK_PARTICLE.get()); - attacker.level().playSound(null, target.getX(), target.getY(), target.getZ(), SoundRegistry.SCYTHE_CUT.get(), attacker.getSoundSource(), 1, 1); + attacker.level().playSound(null, target.blockPosition(), SoundRegistry.STAVE_STRIKES.get(), attacker.getSoundSource(), 0.75f, Mth.nextFloat(attacker.level().random, 0.5F, 1F)); } } diff --git a/src/main/java/com/sammy/malum/registry/common/SoundRegistry.java b/src/main/java/com/sammy/malum/registry/common/SoundRegistry.java index e72e77b16..59a505e49 100644 --- a/src/main/java/com/sammy/malum/registry/common/SoundRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/SoundRegistry.java @@ -47,6 +47,12 @@ public class SoundRegistry { public static final RegistryObject SCYTHE_CUT = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("scythe_cuts"))); + public static final RegistryObject STAVE_FIRES = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_fires"))); + public static final RegistryObject STAVE_POWERS_UP = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_powers_up"))); + public static final RegistryObject STAVE_SIZZLES = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_sizzles"))); + public static final RegistryObject STAVE_CHARGED = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_charged"))); + public static final RegistryObject STAVE_STRIKES = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_strikes"))); + public static final RegistryObject ALTAR_CRAFT = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("spirit_altar_completes_infusion"))); public static final RegistryObject ALTAR_LOOP = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("spirit_altar_infuses"))); public static final RegistryObject ALTAR_CONSUME = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("spirit_altar_absorbs_item"))); diff --git a/src/main/resources/assets/malum/sounds.json b/src/main/resources/assets/malum/sounds.json index 14f70a78d..3bda28783 100644 --- a/src/main/resources/assets/malum/sounds.json +++ b/src/main/resources/assets/malum/sounds.json @@ -20,6 +20,12 @@ "scythe_cuts": { "sounds":["malum:curiosities/scythe/cut1","malum:curiosities/scythe/cut2","malum:curiosities/scythe/cut3"], "subtitle": "malum.subtitle.scythe_cuts" }, + "stave_fires": { "sounds":["malum:curiosities/stave/fire1","malum:curiosities/stave/fire2"], "subtitle": "malum.subtitle.stave_fires" }, + "stave_powers_up": { "sounds":["malum:curiosities/stave/charge1","malum:curiosities/stave/charge2"], "subtitle": "malum.subtitle.stave_powers_up" }, + "stave_sizzles": { "sounds":["malum:curiosities/stave/sizzle1","malum:curiosities/stave/sizzle2"], "subtitle": "malum.subtitle.stave_sizzles" }, + "stave_charged": { "sounds":["malum:curiosities/stave/sizzle1","malum:curiosities/stave/sizzle2"], "subtitle": "malum.subtitle.stave_charged" }, + "stave_strikes": { "sounds":["malum:curiosities/stave/hit3","malum:curiosities/stave/hit2","malum:curiosities/stave/hit3","malum:curiosities/stave/hit4"], "subtitle": "malum.subtitle.stave_strikes" }, + "cloth_trinket_equipped": { "sounds":["malum:equip_sounds/cloth/equip_cloth1", "malum:equip_sounds/cloth/equip_cloth2", "malum:equip_sounds/cloth/equip_cloth3"], "subtitle": "malum.subtitle.ornate_trinket_equipped" }, "ornate_trinket_equipped": { "sounds":["malum:equip_sounds/ornate/equip_ornate1", "malum:equip_sounds/ornate/equip_ornate2", "malum:equip_sounds/ornate/equip_ornate3"], "subtitle": "malum.subtitle.ornate_trinket_equipped" }, "gilded_trinket_equipped": { "sounds":["malum:equip_sounds/gilded/equip_gilded1", "malum:equip_sounds/gilded/equip_gilded2", "malum:equip_sounds/gilded/equip_gilded3"], "subtitle": "malum.subtitle.gilded_trinket_equipped" }, diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/charge1.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/charge1.ogg new file mode 100644 index 000000000..31975b580 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/charge1.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/charge2.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/charge2.ogg new file mode 100644 index 000000000..778d8d3e9 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/charge2.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/fire1.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/fire1.ogg new file mode 100644 index 000000000..925191039 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/fire1.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/fire2.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/fire2.ogg new file mode 100644 index 000000000..32c0b8bb9 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/fire2.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/hit1.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/hit1.ogg new file mode 100644 index 000000000..b97191bff Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/hit1.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/hit2.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/hit2.ogg new file mode 100644 index 000000000..a50891b07 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/hit2.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/hit3.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/hit3.ogg new file mode 100644 index 000000000..11619fc22 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/hit3.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/hit4.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/hit4.ogg new file mode 100644 index 000000000..660f409ad Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/hit4.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/sizzle1.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/sizzle1.ogg new file mode 100644 index 000000000..0e2a48d43 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/sizzle1.ogg differ diff --git a/src/main/resources/assets/malum/sounds/curiosities/stave/sizzle2.ogg b/src/main/resources/assets/malum/sounds/curiosities/stave/sizzle2.ogg new file mode 100644 index 000000000..58abdbfe7 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/curiosities/stave/sizzle2.ogg differ diff --git a/src/main/resources/assets/malum/sounds/heavenly_organs.ogg b/src/main/resources/assets/malum/sounds/heavenly_organs.ogg index 0852c9928..679375a6b 100644 Binary files a/src/main/resources/assets/malum/sounds/heavenly_organs.ogg and b/src/main/resources/assets/malum/sounds/heavenly_organs.ogg differ