Skip to content

Commit

Permalink
Stave Sounds and 1700 other changed files apparently
Browse files Browse the repository at this point in the history
  • Loading branch information
SammySemicolon committed Dec 6, 2023
1 parent f8fa6c8 commit 99402a3
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 17 deletions.
5 changes: 5 additions & 0 deletions src/generated/resources/assets/malum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"malum:soul_stained_steel_stave",
"malum:tyrving",
"malum:crude_scythe",
"malum:soul_stained_steel_scythe",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));
}
}
Expand All @@ -153,19 +159,16 @@ 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();
Vec3 motion = getDeltaMovement();
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;
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
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.*;
import net.minecraft.world.entity.*;
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.*;
Expand All @@ -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 {

Expand All @@ -46,11 +41,12 @@ public ImmutableMultimap.Builder<Attribute, AttributeModifier> 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())
Expand All @@ -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);
}
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public class SoundRegistry {

public static final RegistryObject<SoundEvent> SCYTHE_CUT = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("scythe_cuts")));

public static final RegistryObject<SoundEvent> STAVE_FIRES = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_fires")));
public static final RegistryObject<SoundEvent> STAVE_POWERS_UP = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_powers_up")));
public static final RegistryObject<SoundEvent> STAVE_SIZZLES = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_sizzles")));
public static final RegistryObject<SoundEvent> STAVE_CHARGED = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_charged")));
public static final RegistryObject<SoundEvent> STAVE_STRIKES = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("stave_strikes")));

public static final RegistryObject<SoundEvent> ALTAR_CRAFT = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("spirit_altar_completes_infusion")));
public static final RegistryObject<SoundEvent> ALTAR_LOOP = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("spirit_altar_infuses")));
public static final RegistryObject<SoundEvent> ALTAR_CONSUME = register(SoundEvent.createVariableRangeEvent(MalumMod.malumPath("spirit_altar_absorbs_item")));
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/assets/malum/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified src/main/resources/assets/malum/sounds/heavenly_organs.ogg
Binary file not shown.

0 comments on commit 99402a3

Please sign in to comment.