Skip to content

Commit

Permalink
1.1.
Browse files Browse the repository at this point in the history
Fix bug with effects.
  • Loading branch information
Weever1337 committed May 29, 2024
1 parent 6cbc242 commit 506cb7d
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

addon_version=1.0
addon_version=1.1
# https://github.com/StandoByte/RotP-maven/commits/main
main_mod_version=1.16.5-0.2.2-snapshot-240331-b

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void standPerform(World world, StandEntity standEntity, IStandPower userP
user.addEffect(new EffectInstance(Effects.MOVEMENT_SLOWDOWN, 30, 255));
user.addEffect(new EffectInstance(Effects.BLINDNESS, 30, 255));
user.hurt(DamageSource.MAGIC, 5.5F);
user.addEffect(new EffectInstance(InitEffects.CM_AWAKENING.get(), 5000, rand.nextInt(4), true, true, false));
user.addEffect(new EffectInstance(InitEffects.CM_AWAKENING.get(), 5000, rand.nextInt(4), false, false, true));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public StandEntityPunch punchEntity(StandEntity stand, Entity target, StandEntit
LivingEntity user = stand.getUser();
int duration = 100;
if (user.hasEffect(InitEffects.CM_AWAKENING.get())) { duration = 200; }
((LivingEntity) target).addEffect(new EffectInstance(Effects.LEVITATION, duration, 2, true, true, false));
((LivingEntity) target).addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), duration, 999, true, true, false));
if (!livingTarget.hasEffect(Effects.LEVITATION)) ((LivingEntity) target).addEffect(new EffectInstance(Effects.LEVITATION, 20, 12, false, false, true));
if (!livingTarget.hasEffect(InitEffects.CM_PARALYSIS.get())) ((LivingEntity) target).addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 2, false, false, true));
}
return super.punchEntity(stand, target, dmgSource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public void standPerform(World world, StandEntity standEntity, IStandPower userP
for (LivingEntity entity : MCUtil.entitiesAround(
LivingEntity.class, userPower.getUser(), 10, false,
entity -> (!(entity instanceof StandEntity) || !userPower.getUser().is(Objects.requireNonNull(((StandEntity) entity).getUser()))))) {
entity.addEffect(new EffectInstance(Effects.LEVITATION, 100, 2, true, true, false));
entity.addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 2, true, true, false));
entity.addEffect(new EffectInstance(Effects.LEVITATION, 100, 2, false, false, true));
entity.addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 2, false, false, true));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public CMoonGravityPunch(StandEntityHeavyAttack.Builder builder) {
public StandEntityPunch punchEntity(StandEntity stand, Entity target, StandEntityDamageSource dmgSource) {
if (target instanceof LivingEntity) {
LivingEntity livingTarget = (LivingEntity) target;
((LivingEntity) target).addEffect(new EffectInstance(Effects.LEVITATION, 20, 12, true, true, false));
((LivingEntity) target).addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 2, true, true, false));

if (!livingTarget.hasEffect(Effects.LEVITATION)) ((LivingEntity) target).addEffect(new EffectInstance(Effects.LEVITATION, 20, 12, false, false, true));
if (!livingTarget.hasEffect(InitEffects.CM_PARALYSIS.get())) ((LivingEntity) target).addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 2, false, false, true));
}
LivingEntity user = stand.getUser();
if (user.hasEffect(InitEffects.CM_AWAKENING.get())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public StandEntityPunch punchEntity(StandEntity stand, Entity target, StandEntit

if (target instanceof LivingEntity) {
LivingEntity livingTarget = (LivingEntity) target;
((LivingEntity) target).addEffect(new EffectInstance(InitEffects.CM_INVERSION.get(), 200, amplifier + 3, true, true, false));

if (!livingTarget.hasEffect(InitEffects.CM_INVERSION.get()))
((LivingEntity) target).addEffect(new EffectInstance(InitEffects.CM_INVERSION.get(), 200, amplifier + 3, false, false, true));
}
if (user.hasEffect(InitEffects.CM_AWAKENING.get())) {
target.hurt(dmgSource, amplifier + 1);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/weever/rotp_cm/action/stand/CMoonMoon.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ protected ActionConditionResult checkStandConditions(StandEntity stand, IStandPo
public void standPerform(World world, StandEntity standEntity, IStandPower userPower, StandEntityTask task) {
if (!world.isClientSide()) {
LivingEntity user = userPower.getUser();
user.addEffect(new EffectInstance(Effects.LEVITATION, 100, 2, true, true, false)); // AHH MOMENT 💀💀💀
user.addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 2, true, true, false));
if (!user.hasEffect(Effects.LEVITATION)) user.addEffect(new EffectInstance(Effects.LEVITATION, 100, 2, false, false, true)); // AHH MOMENT 💀💀💀
if (!user.hasEffect(InitEffects.CM_PARALYSIS.get())) user.addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 2, false, false, true));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public CMoonInversion(int color) {
@Override
public void applyEffectTick(LivingEntity entity, int amplifier) {
if (!entity.level.isClientSide()) {
if (entity.tickCount % 20 == 0 && entity.hasEffect(InitEffects.CM_INVERSION.get()))
if (entity.tickCount % 10 == 0 && entity.hasEffect(InitEffects.CM_INVERSION.get()))
entity.hurt(DamageSource.MAGIC, Math.min(10, entity.getHealth() * 0.5F));
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/weever/rotp_cm/entity/CMoonEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ else if (livingTarget.isDeadOrDying () && livingTarget.getMaxHealth () >= 20){
if (entity instanceof LivingEntity) {
LivingEntity livingEntity = (LivingEntity) entity;
if (!livingEntity.hasEffect(Effects.LEVITATION)) {
livingEntity.addEffect(new EffectInstance(Effects.LEVITATION, 100, 2, true, true, false));
livingEntity.addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 1, true, true, false));
livingEntity.addEffect(new EffectInstance(Effects.LEVITATION, 100, 2, false, false, true));
livingEntity.addEffect(new EffectInstance(InitEffects.CM_PARALYSIS.get(), 100, 1, false, false, true));
power.consumeStamina(200);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/weever/rotp_cm/init/InitEffects.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public class InitEffects {
() -> new CMoonAwakening(0xff0000)
);
public static final RegistryObject<Effect> CM_PARALYSIS = EFFECTS.register("cm_paralysis",
() -> new CMoonAwakening(0x240004)
() -> new CMoonAwakening(0x0f0f0f)
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 506cb7d

Please sign in to comment.