Skip to content

Commit

Permalink
get things functional for a release
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Jan 30, 2025
1 parent ffa06f9 commit 4cceed0
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public static final class BurstShapeProperties {
// @Category(id = "guidedShotShapeProperties", translation = "config.arcanuscontinuum.guidedShotShapeProperties")
public static final class GuidedShotShapeProperties {
@ConfigEntry(id = "enabled", type = EntryType.BOOLEAN, translation = "config.arcanuscontinuum.enabled")
public static boolean enabled = true;
public static boolean enabled = false;

@ConfigEntry(id = "weight", type = EntryType.ENUM, translation = "config.arcanuscontinuum.weight")
public static Weight weight = Weight.MEDIUM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ public int getTrueAge() {

public void setProperties(UUID casterId, Vec3 pos, ItemStack stack, List<SpellEffect> effects, double potency, List<SpellGroup> groups, int groupIndex) {
HitResult hitResult = level().clip(new ClipContext(pos, pos.add(0, -64, 0), ClipContext.Block.COLLIDER, ClipContext.Fluid.ANY, this));
setPos(hitResult.getType() != HitResult.Type.MISS ? hitResult.getLocation() : pos);
setPos(pos);

// TODO clips into ground by one pixel for some reason?
// if(hitResult.getType() != HitResult.Type.MISS)
// setPos(hitResult.getLocation());

setYRot(random.nextFloat() * 360f);
this.casterId = casterId;
this.stack = stack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ private LivingEntity getCaster() {

public void setProperties(UUID casterId, Entity sourceEntity, Vec3 pos, ItemStack stack, List<SpellEffect> effects, double potency, List<SpellGroup> groups, int groupIndex) {
HitResult hitResult = level().clip(new ClipContext(pos, pos.add(0, -64, 0), ClipContext.Block.COLLIDER, ClipContext.Fluid.ANY, this));
setPos(hitResult.getType() != HitResult.Type.MISS ? hitResult.getLocation() : pos);
setPos(pos);

// TODO clips into ground by one pixel for some reason?
// if(hitResult.getType() != HitResult.Type.MISS)
// setPos(hitResult.getLocation());
setYRot(sourceEntity.getYRot());
setXRot(sourceEntity.getXRot());
this.casterId = casterId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ private LivingEntity getCaster() {

public void setProperties(UUID casterId, Entity sourceEntity, Vec3 pos, ItemStack stack, List<SpellEffect> effects, double potency) {
HitResult hitResult = level().clip(new ClipContext(pos, pos.add(0, -64, 0), ClipContext.Block.COLLIDER, ClipContext.Fluid.ANY, this));
setPos(hitResult.getType() != HitResult.Type.MISS ? hitResult.getLocation() : pos);
setPos(pos);

// TODO clips into ground by one pixel for some reason?
// if(hitResult.getType() != HitResult.Type.MISS)
// setPos(hitResult.getLocation());
setNoGravity(true);
setYRot(sourceEntity.getYRot());
this.casterId = casterId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ public void cast(@Nullable LivingEntity caster, Vec3 castFrom, @Nullable Entity

if(caster != null) {
List<? extends AreaOfEffect> list = level.getEntities(EntityTypeTest.forClass(AreaOfEffect.class), entity -> caster.getUUID().equals(entity.getCasterId()));
AreaOfEffect areaOfEffect = ArcanusEntities.AOE.get().create(level);

for(int i = 0; i < list.size() - 20; i++)
list.get(i).kill();

AreaOfEffect areaOfEffect = ArcanusEntities.AOE.get().create(level);
Entity sourceEntity = castSource != null ? castSource : caster;

if(areaOfEffect != null) {
areaOfEffect.setProperties(caster.getUUID(), castFrom, stack, effects, potency, spellGroups, groupIndex);
ArcanusHelper.copyMagicColor(areaOfEffect, caster);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
import dev.cammiescorner.arcanuscontinuum.api.spells.SpellEffect;
import dev.cammiescorner.arcanuscontinuum.api.spells.SpellGroup;
import dev.cammiescorner.arcanuscontinuum.api.spells.SpellShape;
import dev.cammiescorner.arcanuscontinuum.common.packets.s2c.SyncExplosionParticlesPacket;
import dev.cammiescorner.arcanuscontinuum.common.registry.ArcanusSpellComponents;
import net.fabricmc.fabric.api.networking.v1.PlayerLookup;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
Expand Down Expand Up @@ -61,6 +68,12 @@ public void cast(@Nullable LivingEntity caster, Vec3 castFrom, @Nullable Entity
}

// TODO add vfx & sfx for burst
level.gameEvent(caster, GameEvent.EXPLODE, new Vec3(castFrom.x(), castFrom.y(), castFrom.z()));
level.playSeededSound(null, castFrom.x(), castFrom.y(), castFrom.z(), SoundEvents.GENERIC_EXPLODE, SoundSource.BLOCKS, 4f, (1f + (level.random.nextFloat() - level.random.nextFloat()) * 0.2f) * 0.7f, 1);

for(ServerPlayer player : PlayerLookup.tracking(level, BlockPos.containing(castFrom.x(), castFrom.y(), castFrom.z())))
SyncExplosionParticlesPacket.send(player, castFrom.x(), castFrom.y(), castFrom.z(), 4f, effects.contains(ArcanusSpellComponents.MINE.get()));

castNext(caster, castFrom, castSource, level, stack, spellGroups, groupIndex, potency);
}
}

0 comments on commit 4cceed0

Please sign in to comment.