Skip to content

Commit

Permalink
Cancer Ring
Browse files Browse the repository at this point in the history
  • Loading branch information
SammySemicolon committed Nov 23, 2023
1 parent 3f07803 commit a311957
Show file tree
Hide file tree
Showing 17 changed files with 160 additions and 57 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.daemon=false
# Dependency Version
minecraftVersion=1.18.2
forgeVersion=40.2.0
lodestoneVersion=1.4.2.509
lodestoneVersion=1.4.2.512
forgegradleVersion=5.1.53
mixingradleVersion=0.7-SNAPSHOT
librarianVersion=1.+
Expand Down
2 changes: 1 addition & 1 deletion src/generated/resources/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ cb6a17c4dca30d064eedc28529420373d25d1933 assets/malum/blockstates/wall_ether_tor
55635004672302336ef4a04dbe0d38dff66c4cd9 assets/malum/blockstates/weeping_well_core.json
55188decc0c9a982e5ba40f8df2adea65a032e32 assets/malum/blockstates/weeping_well_corner.json
62e007ecef751f8b9b42eaa138f06d18cc008d05 assets/malum/blockstates/weeping_well_side.json
f369ed947c43c3b9bc854f446e3d4d7711718682 assets/malum/lang/en_us.json
7b41bc2f9961161f15821f38176d8e57bff2d844 assets/malum/lang/en_us.json
c2637401df2afc394d62b5c6bde312c604cdb21f assets/malum/models/block/blazing_quartz_ore.json
782e64739e04f0b87aa0aeafb55893cc348df504 assets/malum/models/block/blighted_earth.json
c0b5a7b1d337a7090eaf86d07fd8b47d35fbc1e1 assets/malum/models/block/blighted_soil.json
Expand Down
17 changes: 10 additions & 7 deletions src/generated/resources/assets/malum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,25 +226,26 @@
"death.attack.scythe_sweep.player": "%s was sliced in twain by %s",
"death.attack.voodoo": "%s's soul shattered",
"death.attack.voodoo.player": "%s's soul was shattered by %s",
"effect.malum.aethers_charm": "Aether's Charm",
"effect.malum.aethers_charm": "Aether'''s Charm",
"effect.malum.aethers_charm.description": "The heavens call for you, increasing jump height and decreasing gravity.",
"effect.malum.anglers_lure": "Angler's Lure",
"effect.malum.anglers_lure": "Angler'''s Lure",
"effect.malum.anglers_lure.description": "Let any fish who meets my gaze learn the true meaning of fear; for I am the harbinger of death. The bane of creatures sub-aqueous, my rod is true and unwavering as I cast into the aquatic abyss. A man, scorned by this uncaring Earth, finds solace in the sea. My only friend, the worm upon my hook. Wriggling, writhing, struggling to surmount the mortal pointlessness that permeates this barren world. I am alone. I am empty. And yet, I fish.",
"effect.malum.cancerous_growth": "Cancerou'''s Growth",
"effect.malum.earthen_might": "Earthen Might",
"effect.malum.earthen_might.description": "Your fists and tools are reinforced with earth, increasing your overall damage.",
"effect.malum.gaian_bulwark": "Gaian Bulwark",
"effect.malum.gaian_bulwark.description": "You are protected by an earthen bulwark, increasing your armor.",
"effect.malum.gluttony": "Gluttony",
"effect.malum.gluttony.description": "You feed on the vulnerable, increasing scythe proficiency and gradually restoring lost hunger.",
"effect.malum.ifrits_embrace": "Ifrit's Embrace",
"effect.malum.ifrits_embrace": "Ifrit'''s Embrace",
"effect.malum.ifrits_embrace.description": "The warm embrace of fire coats your soul, mending your seared scars.",
"effect.malum.miners_rage": "Miner's Rage",
"effect.malum.miners_rage": "Miner'''s Rage",
"effect.malum.miners_rage.description": "Your tools are bolstered with radiance, increasing your mining and attack speed.",
"effect.malum.poseidons_grasp": "Poseidon's Grasp",
"effect.malum.poseidons_grasp": "Poseidon'''s Grasp",
"effect.malum.poseidons_grasp.description": "You reach out for further power, increasing your reach and item pickup distance.",
"effect.malum.rejected": "Rejected",
"effect.malum.wicked_intent": "Wicked Intent",
"effect.malum.zephyrs_courage": "Zephyr's Courage",
"effect.malum.zephyrs_courage": "Zephyr'''s Courage",
"effect.malum.zephyrs_courage.description": "The zephyr propels you forward, increasing your movement speed.",
"enchantment.malum.haunted": "Haunted",
"enchantment.malum.haunted.desc": "Deals extra magic damage.",
Expand Down Expand Up @@ -890,6 +891,7 @@
"malum.subtitle.deepslate_soulstone_step": "Footsteps",
"malum.subtitle.ether_break": "Block broken",
"malum.subtitle.ether_place": "Block placed",
"malum.subtitle.flesh_ring_absorbs": "Flesh ring absorbs",
"malum.subtitle.gilded_trinket_equipped": "Gilded trinket equipped",
"malum.subtitle.hallowed_gold_break": "Block broken",
"malum.subtitle.hallowed_gold_hit": "Block breaking",
Expand Down Expand Up @@ -921,8 +923,9 @@
"malum.subtitle.soul_stained_steel_hit": "Block breaking",
"malum.subtitle.soul_stained_steel_place": "Block placed",
"malum.subtitle.soul_stained_steel_step": "Footsteps",
"malum.subtitle.soul_ward_charges": "Soul ward charges",
"malum.subtitle.soul_ward_charged": "Soul ward charged",
"malum.subtitle.soul_ward_damaged": "Soul ward damaged",
"malum.subtitle.soul_ward_depleted": "Soul ward depleted",
"malum.subtitle.soul_ward_grows": "Soul ward grows",
"malum.subtitle.soulstone_break": "Block broken",
"malum.subtitle.soulstone_hit": "Block breaking",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,18 @@ protected AbstractMalumScreen(Component pTitle) {
public abstract Supplier<SoundEvent> getSweetenerSound();

public void playPageFlipSound(Supplier<SoundEvent> soundEvent, float pitch) {
playSound(soundEvent, Math.max(1, pitch * 0.8f));
playSound(getSweetenerSound(), pitch);
playSound(soundEvent, 1, Math.max(1, pitch * 0.8f));
playSound(getSweetenerSound(), 0.2f, pitch);
}

public void playSweetenedSound(Supplier<SoundEvent> soundEvent, float sweetenerPitch) {
playSound(soundEvent);
playSound(getSweetenerSound(), sweetenerPitch);
playSound(soundEvent, 1, 1);
playSound(getSweetenerSound(), 0.2f, sweetenerPitch);
}

public void playSound(Supplier<SoundEvent> soundEvent) {
playSound(soundEvent, 1);
}

public void playSound(Supplier<SoundEvent> soundEvent, float pitch) {
public void playSound(Supplier<SoundEvent> soundEvent, float volume, float pitch) {
Player playerEntity = Minecraft.getInstance().player;
playerEntity.playNotifySound(soundEvent.get(), SoundSource.PLAYERS, 1f, pitch);
playerEntity.playNotifySound(soundEvent.get(), SoundSource.PLAYERS, volume, pitch);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.sammy.malum.common.block;

import com.sammy.malum.common.item.spirit.*;
import com.sammy.malum.registry.common.*;
import net.minecraft.sounds.*;
import net.minecraft.world.entity.player.*;
import net.minecraft.world.item.*;
import net.minecraft.world.level.*;
import team.lodestar.lodestone.helpers.*;
import team.lodestar.lodestone.systems.blockentity.*;

import java.util.function.*;

public class MalumBlockEntityInventory extends LodestoneBlockEntityInventory {
public MalumBlockEntityInventory(int slotCount, int allowedItemSize, Predicate<ItemStack> inputPredicate, Predicate<ItemStack> outputPredicate) {
super(slotCount, allowedItemSize, inputPredicate, outputPredicate);
}

public MalumBlockEntityInventory(int slotCount, int allowedItemSize, Predicate<ItemStack> inputPredicate) {
super(slotCount, allowedItemSize, inputPredicate);
}

public MalumBlockEntityInventory(int slotCount, int allowedItemSize) {
super(slotCount, allowedItemSize);
}

@Override
public void extractItem(Player playerEntity, ItemStack stack, int slot) {
super.extractItem(playerEntity, stack, slot);
SoundEvent soundEvent = stack.getItem() instanceof SpiritShardItem ? SoundRegistry.PEDESTAL_SPIRIT_PICKUP.get() : SoundRegistry.PEDESTAL_ITEM_PICKUP.get();
playerEntity.level.playSound(null, playerEntity.blockPosition(), soundEvent, SoundSource.BLOCKS, 0.7f, RandomHelper.randomBetween(playerEntity.level.random, 0.8f, 1.2f));
}

@Override
public ItemStack insertItem(Player playerEntity, ItemStack stack) {
final ItemStack result = super.insertItem(playerEntity, stack);
if (!result.isEmpty()) {
SoundEvent soundEvent = result.getItem() instanceof SpiritShardItem ? SoundRegistry.PEDESTAL_SPIRIT_INSERT.get() : SoundRegistry.PEDESTAL_ITEM_INSERT.get();
playerEntity.level.playSound(null, playerEntity.blockPosition(), soundEvent, SoundSource.BLOCKS, 0.7f, RandomHelper.randomBetween(playerEntity.level.random, 0.8f, 1.2f));
}
return result;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sammy.malum.common.block.curiosities.spirit_altar;

import com.sammy.malum.common.block.*;
import com.sammy.malum.common.block.storage.*;
import com.sammy.malum.common.item.spirit.*;
import com.sammy.malum.common.recipe.*;
Expand Down Expand Up @@ -68,22 +69,22 @@ public SpiritAltarBlockEntity(BlockEntityType<? extends SpiritAltarBlockEntity>
public SpiritAltarBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityRegistry.SPIRIT_ALTAR.get(), pos, state);

inventory = new LodestoneBlockEntityInventory(1, 64, t -> !(t.getItem() instanceof SpiritShardItem)) {
inventory = new MalumBlockEntityInventory(1, 64, t -> !(t.getItem() instanceof SpiritShardItem)) {
@Override
public void onContentsChanged(int slot) {
super.onContentsChanged(slot);
needsSync = true;
BlockHelper.updateAndNotifyState(level, worldPosition);
}
};
extrasInventory = new LodestoneBlockEntityInventory(8, 1) {
extrasInventory = new MalumBlockEntityInventory(8, 1) {
@Override
public void onContentsChanged(int slot) {
super.onContentsChanged(slot);
BlockHelper.updateAndNotifyState(level, worldPosition);
}
};
spiritInventory = new LodestoneBlockEntityInventory(SpiritTypeRegistry.SPIRITS.size(), 64) {
spiritInventory = new MalumBlockEntityInventory(SpiritTypeRegistry.SPIRITS.size(), 64) {
@Override
public void onContentsChanged(int slot) {
super.onContentsChanged(slot);
Expand Down Expand Up @@ -265,7 +266,7 @@ public boolean consume() {
if (matches) {
level.playSound(null, provider.getAccessPointBlockPos(), SoundRegistry.ALTAR_CONSUME.get(), SoundSource.BLOCKS, 1, 0.9f + level.random.nextFloat() * 0.2f);
ParticleEffectTypeRegistry.SPIRIT_ALTAR_EATS_ITEM.createPositionedEffect(level, new PositionEffectData(worldPosition), ColorEffectData.fromRecipe(recipe.spirits), SpiritAltarEatItemParticleEffect.createData(provider.getAccessPointBlockPos(), providedStack));
extrasInventory.insertItem(level, providedStack.split(requestedItem.count));
extrasInventory.insertItem(providedStack.split(requestedItem.count));
inventoryForAltar.updateData();
BlockHelper.updateAndNotifyState(level, provider.getAccessPointBlockPos());
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sammy.malum.common.block.curiosities.spirit_crucible;

import com.sammy.malum.common.block.*;
import com.sammy.malum.core.systems.spirit.*;
import com.sammy.malum.visual_effects.*;
import com.sammy.malum.common.item.impetus.ImpetusItem;
Expand Down Expand Up @@ -75,15 +76,15 @@ public class SpiritCrucibleCoreBlockEntity extends MultiBlockCoreEntity implemen

public SpiritCrucibleCoreBlockEntity(BlockEntityType<? extends SpiritCrucibleCoreBlockEntity> type, MultiBlockStructure structure, BlockPos pos, BlockState state) {
super(type, structure, pos, state);
inventory = new LodestoneBlockEntityInventory(1, 1, t -> !(t.getItem() instanceof SpiritShardItem)) {
inventory = new MalumBlockEntityInventory(1, 1, t -> !(t.getItem() instanceof SpiritShardItem)) {
@Override
public void onContentsChanged(int slot) {
super.onContentsChanged(slot);
needsSync = true;
BlockHelper.updateAndNotifyState(level, worldPosition);
}
};
spiritInventory = new LodestoneBlockEntityInventory(4, 64) {
spiritInventory = new MalumBlockEntityInventory(4, 64) {
@Override
public void onContentsChanged(int slot) {
super.onContentsChanged(slot);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sammy.malum.common.block.curiosities.spirit_crucible.catalyzer;

import com.sammy.malum.common.block.*;
import com.sammy.malum.common.block.curiosities.spirit_crucible.*;
import com.sammy.malum.common.item.spirit.SpiritShardItem;
import com.sammy.malum.core.systems.spirit.*;
Expand Down Expand Up @@ -51,7 +52,7 @@ public class SpiritCatalyzerCoreBlockEntity extends MultiBlockCoreEntity impleme

public SpiritCatalyzerCoreBlockEntity(BlockEntityType<? extends SpiritCatalyzerCoreBlockEntity> type, MultiBlockStructure structure, BlockPos pos, BlockState state) {
super(type, structure, pos, state);
inventory = new LodestoneBlockEntityInventory(1, 64, t -> !(t.getItem() instanceof SpiritShardItem)) {
inventory = new MalumBlockEntityInventory(1, 64, t -> !(t.getItem() instanceof SpiritShardItem)) {
@Override
public void onContentsChanged(int slot) {
super.onContentsChanged(slot);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sammy.malum.common.block.storage;

import com.sammy.malum.common.block.*;
import com.sammy.malum.common.item.spirit.*;
import com.sammy.malum.core.systems.spirit.*;
import com.sammy.malum.visual_effects.*;
Expand All @@ -14,7 +15,7 @@ public abstract class MalumItemHolderBlockEntity extends ItemHolderBlockEntity i

public MalumItemHolderBlockEntity(BlockEntityType<? extends MalumItemHolderBlockEntity> type, BlockPos pos, BlockState state) {
super(type, pos, state);
inventory = new LodestoneBlockEntityInventory(1, 64) {
inventory = new MalumBlockEntityInventory(1, 64) {
@Override
public void onContentsChanged(int slot) {
super.onContentsChanged(slot);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.sammy.malum.common.effect;

import net.minecraft.world.effect.*;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.ai.attributes.*;
import team.lodestar.lodestone.helpers.*;

import java.awt.*;

public class GrowingFleshEffect extends MobEffect {
public GrowingFleshEffect() {
super(MobEffectCategory.BENEFICIAL, ColorHelper.getColor(new Color(126, 25, 95)));
addAttributeModifier(Attributes.MAX_HEALTH, "04448cbf-ee2c-4f36-b71f-e641a312834a", 0.05f, AttributeModifier.Operation.MULTIPLY_TOTAL);
}

@Override
public void applyEffectTick(LivingEntity entityLivingBaseIn, int amplifier) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,30 @@

import com.sammy.malum.common.item.curiosities.curios.*;
import com.sammy.malum.core.systems.item.*;
import com.sammy.malum.registry.common.*;
import net.minecraft.sounds.*;
import net.minecraft.world.effect.*;
import net.minecraft.world.entity.*;
import net.minecraft.world.item.*;
import net.minecraft.world.level.*;
import team.lodestar.lodestone.helpers.*;

public class CurioGrowingFleshRing extends MalumCurioItem implements IVoidItem {
public class CurioGrowingFleshRing extends MalumCurioItem implements IVoidItem, IMalumEventResponderItem {
public CurioGrowingFleshRing(Properties builder) {
super(builder, MalumTrinketType.VOID);
}

@Override
public void pickupSpirit(LivingEntity collector, ItemStack stack, double arcaneResonance) {
MobEffect cancerousGrowth = MobEffectRegistry.CANCEROUS_GROWTH.get();
MobEffectInstance effect = collector.getEffect(cancerousGrowth);
if (effect == null) {
collector.addEffect(new MobEffectInstance(cancerousGrowth, 1200, 0, true, true, true));
} else {
EntityHelper.extendEffect(effect, collector, (int) (1200+arcaneResonance*600), 144000);
EntityHelper.amplifyEffect(effect, collector, 1, 19);
}
Level level = collector.level;
level.playSound(null, collector.blockPosition(), SoundRegistry.FLESH_RING_ABSORBS.get(), SoundSource.PLAYERS, 0.3f, 1.5f + level.random.nextFloat() * 0.5f);
}
}
Loading

0 comments on commit a311957

Please sign in to comment.