HexCasting/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapShameOnYou.kt

23 lines
860 B
Kotlin
Raw Normal View History

package at.petrak.hexcasting.api.casting.mishaps
2022-11-13 20:05:31 +01:00
2023-01-22 03:29:09 +01:00
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.misc.HexDamageSources
import at.petrak.hexcasting.api.pigment.FrozenPigment
2022-11-13 20:05:31 +01:00
import net.minecraft.world.item.DyeColor
class MishapShameOnYou() : Mishap() {
override fun accentColor(ctx: CastingEnvironment, errorCtx: Context): FrozenPigment =
2022-11-13 20:05:31 +01:00
dyeColor(DyeColor.BLACK)
2023-01-22 03:29:09 +01:00
override fun execute(ctx: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
2023-02-08 03:57:52 +01:00
val caster = ctx.caster
if (caster != null) {
// FIXME: handle null caster case
Mishap.trulyHurt(caster, HexDamageSources.SHAME, 69420f)
}
2022-11-13 20:05:31 +01:00
}
2023-01-22 03:29:09 +01:00
override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context) = error("shame")
2022-11-13 20:05:31 +01:00
}