2023-01-20 20:27:35 +01:00
|
|
|
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
|
2023-01-20 20:27:35 +01:00
|
|
|
import at.petrak.hexcasting.api.casting.iota.Iota
|
2023-04-27 21:26:15 +02:00
|
|
|
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() {
|
2023-04-27 21:26:15 +02:00
|
|
|
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
|
|
|
}
|