Skip to content

Commit

Permalink
make some shapes single cast only
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Jan 24, 2025
1 parent 8643914 commit 27fffc3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@ public Component getName() {

return Component.translatable(getTranslationKey());
}

public boolean singleCastOnly() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,4 @@ public SpellType getType() {
}

public abstract void effect(@Nullable LivingEntity caster, @Nullable Entity sourceEntity, Level level, HitResult target, List<SpellEffect> effects, ItemStack stack, double potency);

public boolean singleCastOnly() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void tick() {
if(!level().isClientSide()) {
int baseLifeSpan = ArcanusConfig.SpellShapes.AOEShapeProperties.baseLifeSpan;
int timesToApplyEffects = ArcanusConfig.SpellShapes.AOEShapeProperties.timesToApplyEffects;
int timesToCastNextShape = ArcanusConfig.SpellShapes.AOEShapeProperties.timesToCastNextShape;
int timesToCastNextShape = spellGroups.get(groupIndex + 1).shape().singleCastOnly() ? 1 : ArcanusConfig.SpellShapes.AOEShapeProperties.timesToCastNextShape;
int actualLifeSpan = (int) (baseLifeSpan * 0.9);

if(trueAge > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ public void cast(@Nullable LivingEntity caster, Vec3 castFrom, @Nullable Entity
}
}
}

@Override
public boolean singleCastOnly() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ public void cast(@Nullable LivingEntity caster, Vec3 castFrom, @Nullable Entity
// TODO add vfx & sfx for burst
castNext(caster, castFrom, castSource, level, stack, spellGroups, groupIndex, potency);
}

@Override
public boolean singleCastOnly() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ public void cast(@Nullable LivingEntity caster, Vec3 castFrom, @Nullable Entity
}
}
}

@Override
public boolean singleCastOnly() {
return true;
}
}

0 comments on commit 27fffc3

Please sign in to comment.