Skip to content

Commit

Permalink
projection
Browse files Browse the repository at this point in the history
  • Loading branch information
RadonCoding committed Nov 3, 2023
1 parent bb144c9 commit 2e73e89
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion art/naoya_zenin.bbmodel
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"meta":{"format_version":"4.5","model_format":"skin","box_uv":true},"name":"naoya_zenin","visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"skin_model":"steve.java","skin_pose":"none","unhandled_root_fields":{},"resolution":{"width":64,"height":64},"textures":[{"path":"/home/radon/dev/jujutsu-kaisen/src/main/resources/assets/jujutsu_kaisen/textures/entity/naoya_zenin.png","name":"naoya_zenin.png","folder":"","namespace":"","id":"0","particle":false,"render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"mode":"bitmap","saved":false,"uuid":"4670e166-4481-025e-d3d8-a376955dbc09","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABlZJREFUeF7tWs1vG0UUf0sTf8VJHKUxKKFWUGkQoYiWQhBUBS5QJDjADQ5IvSMOnLkh8RcgbhyQuCAucACJwgEBEogQQSVKKxIqmkQJkA/l207ilEW/MS+anczO7Hq8jks8l/XOvvl4v/m9j10/jyztu09e9zPZHlpamKN8d7eQ3tzYoOPFIdqurNPjJ583zuA9+JxnW8P0/KfLb/oPX3zb4ytkdX31rmHd3BcfXPKhOJSWAeC+Z8683BQAWHFcAYgMRL3KY5wVADCAlccVTQYkaQaEKSozoikAMOWxmGwSSQMABj776vvCBGRFwQJ+ligAh20CLcMApn2zTUB1fk33AWAA6K+LAuhL2gkyvXVRwIX6PNbqBNkEOPwxA/g+aQDY9jkUMgPkfhcghHNRT5fpjpNHQ7zXhUE4QzQer8owc3iDchjlPsiEhTU13qtgqPmB6i+ijPfkMMenKoc5OQT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gB1H02dA21ON5fLRXlBq3P1g8OaupiwZUvUaQPQZkCTTSCMknvVKm3v7FA+nzfaW7Mp2zDj/28iDwAgtPGbX9yrLdVs9IYbPV8bgDYD2ibQ2j6gf/gBp7dV6/eAtgkcdRNYWFjwEes3NzdFzI97TToPwP5cQl+U7wEu81tze6fJiShpgJ1fhtbX1g6cUHdPrXpMbRvrtQoRXVPHsGxPb6/zHk2H4Dy5LpVGGo2GVBotk06La0dnZ2xCtDwDImgUq75A/f/f9c9P2/6cGWBbAN8cFZlYBRBHHoCoFSARDkIr0vIMSBwA1YkhD4DTiuqwpqenA8iq9QMzMzOB52r9wZmnXqj38MQ425+ftsnFZ/G43wBkeRMAXByhbkKuP7jtAVD/J9DVFISdAmT/dwDoagrCAIDsveeetrHU+PzQTcBWQGHafRuASoVOjD7qxADXwc5O0FY/YKI/nqnj4yrk+lHWGYC4G1blDx0A5AFxvwHI8iMjI7HqCQCAXH8wOTnpiqHT+EZkgk71BWpFqU0b9W/xuKWx6vzOAIBBKJzgGgK1tgAL8jNNTaYoqjb914/xcnFEywHAlaamegJTfYFcVQ7luKlFD9zfaAD+BRruqFpPmxxFAAAAAElFTkSuQmCC","relative_path":"../../../../home/radon/dev/jujutsu-kaisen/src/main/resources/assets/jujutsu_kaisen/textures/entity/naoya_zenin.png"}]}
{"meta":{"format_version":"4.5","model_format":"skin","box_uv":true},"name":"naoya_zenin","visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"skin_model":"steve.java","skin_pose":"none","unhandled_root_fields":{},"resolution":{"width":64,"height":64},"textures":[{"path":"/home/radon/dev/jujutsu-kaisen/src/main/resources/assets/jujutsu_kaisen/textures/entity/naoya_zenin.png","name":"naoya_zenin.png","folder":"","namespace":"","id":"0","particle":false,"render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"4670e166-4481-025e-d3d8-a376955dbc09","relative_path":"../../src/main/resources/assets/jujutsu_kaisen/textures/entity/naoya_zenin.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAACESURBVHhe7dUBEQAwDAKx4t90hXzmoBwZu/hb/P4TgAbEE0AgXgCfIAIIxBNAIF4AK4AAAvEEEIgXwAoggEA8AQTiBbACCCAQTwCBeAGsAAIIxBNAIF4AK4AAAvEEEIgXwAoggEA8AQTiBbACCCAQTwCBeAGsAAIIxBNAIF4AK4BAncADaNgAQaz/YIEAAAAASUVORK5CYII="}]}
23 changes: 21 additions & 2 deletions src/main/java/radon/jujutsu_kaisen/ability/misc/Dash.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package radon.jujutsu_kaisen.ability.misc;

import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionHand;
Expand All @@ -10,13 +11,16 @@
import net.minecraft.world.entity.PathfinderMob;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable;
import radon.jujutsu_kaisen.ability.MenuType;
import radon.jujutsu_kaisen.ability.base.Ability;
import radon.jujutsu_kaisen.capability.data.ISorcererData;
import radon.jujutsu_kaisen.capability.data.SorcererDataHandler;
import radon.jujutsu_kaisen.capability.data.sorcerer.Trait;
import radon.jujutsu_kaisen.client.particle.CursedEnergyParticle;
import radon.jujutsu_kaisen.client.particle.MirageParticle;
import radon.jujutsu_kaisen.client.particle.ParticleColors;
import radon.jujutsu_kaisen.sound.JJKSounds;
import radon.jujutsu_kaisen.util.HelperMethods;

Expand Down Expand Up @@ -47,6 +51,21 @@ public ActivationType getActivationType(LivingEntity owner) {
public void run(LivingEntity owner) {
if (!(owner.level() instanceof ServerLevel level)) return;

Vec3 look = owner.getLookAngle();
Vec3 pos = owner.position().add(0.0D, owner.getBbHeight() / 2.0F, 0.0D);

for (int i = 0; i < 32; i++) {
double theta = HelperMethods.RANDOM.nextDouble() * 2 * Math.PI;
double phi = HelperMethods.RANDOM.nextDouble() * Math.PI;
double r = HelperMethods.RANDOM.nextDouble() * 0.8D;
double x = r * Math.sin(phi) * Math.cos(theta);
double y = r * Math.sin(phi) * Math.sin(theta);
double z = r * Math.cos(phi);
Vec3 speed = look.add(x, y, z).reverse();
Vec3 offset = pos.add(look);
level.sendParticles(ParticleTypes.CLOUD, offset.x(), offset.y(), offset.z(), 0, speed.x(), speed.y(), speed.z(), 1.0D);
}

if (HelperMethods.getLookAtHit(owner, RANGE) instanceof EntityHitResult hit) {
Entity target = hit.getEntity();

Expand All @@ -62,14 +81,14 @@ public void run(LivingEntity owner) {
owner.setDeltaMovement(motionX, motionY, motionZ);
owner.hurtMarked = true;
} else if (owner.isInWater() || owner.onGround()) {
owner.setDeltaMovement(owner.getDeltaMovement().add(owner.getLookAngle().normalize().scale(SPEED)));
owner.setDeltaMovement(owner.getDeltaMovement().add(look.normalize().scale(SPEED)));
owner.hurtMarked = true;
} else {
return;
}

owner.level().playSound(null, owner.getX(), owner.getY(), owner.getZ(), JJKSounds.DASH.get(), SoundSource.MASTER, 1.0F, 1.0F);
owner.addEffect(new MobEffectInstance(MobEffects.INVISIBILITY, 10, 0, false, false, false));
owner.addEffect(new MobEffectInstance(MobEffects.INVISIBILITY, 5, 0, false, false, false));
level.sendParticles(new MirageParticle.MirageParticleOptions(owner.getId()), owner.getX(), owner.getY(), owner.getZ(),
0, 0.0D, 0.0D, 0.0D, 1.0D);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void run(LivingEntity owner) {
double y = r * Math.sin(phi) * Math.sin(theta);
double z = r * Math.cos(phi);
Vec3 speed = look.add(x, y, z);
Vec3 offset = pos.add(owner.getLookAngle());
Vec3 offset = pos.add(look);
((ServerLevel) target.level()).sendParticles(new CursedEnergyParticle.CursedEnergyParticleOptions(ParticleColors.getCursedEnergyColor(owner), owner.getBbWidth(),
0.2F, 8), offset.x(), offset.y(), offset.z(), 0, speed.x(), speed.y(), speed.z(), 1.0D);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import radon.jujutsu_kaisen.ability.base.Ability;
import radon.jujutsu_kaisen.capability.data.ISorcererData;
import radon.jujutsu_kaisen.capability.data.SorcererDataHandler;
import radon.jujutsu_kaisen.client.particle.MirageParticle;
import radon.jujutsu_kaisen.client.particle.ProjectionParticle;
import radon.jujutsu_kaisen.effect.JJKEffects;
import radon.jujutsu_kaisen.entity.effect.ProjectionFrameEntity;
Expand All @@ -47,7 +48,7 @@ public boolean isScalable() {

@Override
public boolean shouldTrigger(PathfinderMob owner, @Nullable LivingEntity target) {
return target != null && HelperMethods.RANDOM.nextInt(10) == 0;
return target != null && (JJKAbilities.isChanneling(owner, this) || HelperMethods.RANDOM.nextInt(10) == 0);
}

@Override
Expand Down Expand Up @@ -167,9 +168,12 @@ public void onRelease(LivingEntity owner) {
cap.resetFrames();
return;
}
if (owner.level() instanceof ServerLevel level) {
level.sendParticles(new MirageParticle.MirageParticleOptions(owner.getId()), owner.getX(), owner.getY(), owner.getZ(),
0, 0.0D, 0.0D, 0.0D, 1.0D);
}
owner.moveTo(frame.x(), frame.y(), frame.z(), yaw, 0.0F);
cap.removeFrame(entry);

previous.set(frame);
}, delay++);
}
Expand Down

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/main/resources/mixins.jujutsu_kaisen.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"mixins": [
"common.EntityMixin",
"common.ItemEntityMixin",
"common.LivingEntityMixin",
"common.MeleeAttackGoalMixin",
"common.MobMixin",
"common.PathNavigationMixin",
Expand Down

0 comments on commit 2e73e89

Please sign in to comment.