nadirs now increase in cost by the square of the potency, and zeniths by the cube
This commit is contained in:
parent
46f803ba9f
commit
92f652b800
3 changed files with 25 additions and 16 deletions
|
@ -180,35 +180,35 @@ public class RegisterPatterns {
|
|||
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqqqaqwawaw", HexDir.NORTH_WEST),
|
||||
prefix("potion/weakness"),
|
||||
new OpPotionEffect(MobEffects.WEAKNESS, 10_000 / 10, true));
|
||||
new OpPotionEffect(MobEffects.WEAKNESS, 10_000 / 10, true, false));
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqqqawwawawd", HexDir.WEST),
|
||||
prefix("potion/levitation"),
|
||||
new OpPotionEffect(MobEffects.LEVITATION, 10_000 / 5, false));
|
||||
new OpPotionEffect(MobEffects.LEVITATION, 10_000 / 5, false, false));
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqqqaewawawe", HexDir.SOUTH_WEST),
|
||||
prefix("potion/wither"),
|
||||
new OpPotionEffect(MobEffects.WITHER, 10_000, true));
|
||||
new OpPotionEffect(MobEffects.WITHER, 10_000, true, false));
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqqqadwawaww", HexDir.SOUTH_EAST),
|
||||
prefix("potion/poison"),
|
||||
new OpPotionEffect(MobEffects.POISON, 10_000 / 3, true));
|
||||
new OpPotionEffect(MobEffects.POISON, 10_000 / 3, true, false));
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqqqadwawaw", HexDir.SOUTH_EAST),
|
||||
prefix("potion/slowness"),
|
||||
new OpPotionEffect(MobEffects.MOVEMENT_SLOWDOWN, 10_000 / 3, true));
|
||||
new OpPotionEffect(MobEffects.MOVEMENT_SLOWDOWN, 10_000 / 3, true, false));
|
||||
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqqaawawaedd", HexDir.NORTH_WEST),
|
||||
prefix("potion/regeneration"),
|
||||
new OpPotionEffect(MobEffects.REGENERATION, 10_000, true), true);
|
||||
new OpPotionEffect(MobEffects.REGENERATION, 10_000, true, true), true);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqqaawawaeqdd", HexDir.WEST),
|
||||
prefix("potion/night_vision"),
|
||||
new OpPotionEffect(MobEffects.NIGHT_VISION, 10_000 / 5, false), true);
|
||||
new OpPotionEffect(MobEffects.NIGHT_VISION, 10_000 / 5, false, true), true);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qqaawawaeqqdd", HexDir.SOUTH_WEST),
|
||||
prefix("potion/absorption"),
|
||||
new OpPotionEffect(MobEffects.ABSORPTION, 10_000, true), true);
|
||||
new OpPotionEffect(MobEffects.ABSORPTION, 10_000, true, true), true);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qaawawaeqqqdd", HexDir.SOUTH_EAST),
|
||||
prefix("potion/haste"),
|
||||
new OpPotionEffect(MobEffects.DIG_SPEED, 10_000 / 3, true), true);
|
||||
new OpPotionEffect(MobEffects.DIG_SPEED, 10_000 / 3, true, true), true);
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("aawawaeqqqqdd", HexDir.EAST),
|
||||
prefix("potion/strength"),
|
||||
new OpPotionEffect(MobEffects.DAMAGE_BOOST, 10_000 / 3, true), true);
|
||||
new OpPotionEffect(MobEffects.DAMAGE_BOOST, 10_000 / 3, true, true), true);
|
||||
|
||||
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("waeawae", HexDir.EAST),
|
||||
prefix("sentinel/create"),
|
||||
|
|
|
@ -11,9 +11,14 @@ import net.minecraft.world.effect.MobEffectInstance
|
|||
import net.minecraft.world.entity.LivingEntity
|
||||
import kotlin.math.max
|
||||
|
||||
class OpPotionEffect(val effect: MobEffect, val baseCost: Int, val potency: Boolean) : SpellOperator {
|
||||
class OpPotionEffect(
|
||||
val effect: MobEffect,
|
||||
val baseCost: Int,
|
||||
val allowPotency: Boolean,
|
||||
val potencyCubic: Boolean
|
||||
) : SpellOperator {
|
||||
override val argc: Int
|
||||
get() = if (this.potency) 3 else 2
|
||||
get() = if (this.allowPotency) 3 else 2
|
||||
|
||||
override fun execute(
|
||||
args: List<SpellDatum<*>>,
|
||||
|
@ -22,11 +27,15 @@ class OpPotionEffect(val effect: MobEffect, val baseCost: Int, val potency: Bool
|
|||
val target = args.getChecked<LivingEntity>(0)
|
||||
val duration = max(args.getChecked(1), 0.0)
|
||||
ctx.assertEntityInRange(target)
|
||||
val potency = if (this.potency)
|
||||
val potency = if (this.allowPotency)
|
||||
max(args.getChecked(2), 1.0)
|
||||
else 1.0
|
||||
|
||||
val cost = this.baseCost * duration * potency
|
||||
val cost = this.baseCost * duration * if (potencyCubic) {
|
||||
potency * potency * potency
|
||||
} else {
|
||||
potency * potency
|
||||
}
|
||||
return Triple(
|
||||
Spell(effect, target, duration, potency),
|
||||
cost.toInt(),
|
||||
|
|
|
@ -650,7 +650,7 @@
|
|||
"hexcasting.page.blockworks.9": "Extinguish blocks in a large area. Costs about two $(item)Amethyst Crystal/$s.",
|
||||
|
||||
"hexcasting.entry.nadirs": "Nadirs",
|
||||
"hexcasting.page.nadirs.1": "This family of spells all impart a negative potion effect upon an entity. They all take an entity, the recipient, and one or two numbers, the first being the duration and the second, if present, being the potency (starting at 1).$(br2)Each one has a \"base cost;\" the actual cost is equal to that base cost, multiplied by the potency.",
|
||||
"hexcasting.page.nadirs.1": "This family of spells all impart a negative potion effect upon an entity. They all take an entity, the recipient, and one or two numbers, the first being the duration and the second, if present, being the potency (starting at 1).$(br2)Each one has a \"base cost;\" the actual cost is equal to that base cost, multiplied by the potency squared.",
|
||||
"hexcasting.page.nadirs.2": "According to certain legends, these spells and their sisters, the $(l:patterns/great_spells/zeniths)$(action)Zeniths/$, were \"[...] inspired by a world near to this one, where powerful wizards would gather magic from the land and hold duels to the death. Unfortunately, much was lost in translation...\"$(br2)Perhaps that is the reason for their peculiar names.",
|
||||
"hexcasting.page.nadirs.3": "Bestows weakness. Base cost is one $(item)Amethyst Dust/$ per 10 seconds.",
|
||||
"hexcasting.page.nadirs.4": "Bestows levitation. Base cost is one $(item)Amethyst Dust/$ per 5 seconds.",
|
||||
|
@ -693,7 +693,7 @@
|
|||
"hexcasting.page.teleport.2": "The entity will be teleported by the given vector, which is an offset from its given position. No matter the distance, it always seems to cost about ten $(item)Charged Crystal/$s.$(br2)The transference is not perfect, and it seems when teleporting something as complex as a player, their inventory doesn't $(italic)quite/$ stay attached, and tends to splatter everywhere at the destination.",
|
||||
|
||||
"hexcasting.entry.zeniths": "Zeniths",
|
||||
"hexcasting.page.zeniths.1": "This family of spells all impart a positive potion effect upon an entity.$(br2)See the $(l:patterns/spells/nadirs)$(action)Nadirs/$ for more information.",
|
||||
"hexcasting.page.zeniths.1": "This family of spells all impart a positive potion effect upon an entity, similar to the $(l:patterns/spells/nadirs)$(action)Nadirs/$. However, these have their _media costs increase with the $(italic)cube/$ of the potency.",
|
||||
"hexcasting.page.zeniths.2": "Bestows regeneration. Base cost is one $(item)Amethyst Dust/$ per second.",
|
||||
"hexcasting.page.zeniths.3": "Bestows night vision. Base cost is one $(item)Amethyst Dust/$ per 5 seconds.",
|
||||
"hexcasting.page.zeniths.4": "Bestows absorption. Base cost is one $(item)Amethyst Dust/$ per second.",
|
||||
|
|
Loading…
Reference in a new issue