fix bad item message, make the motion a little less silly

This commit is contained in:
yrsegal@gmail.com 2022-04-26 22:15:24 -04:00
parent 0a8f4e6282
commit 7492eb961b
2 changed files with 3 additions and 3 deletions

View file

@ -13,14 +13,14 @@ class MishapBadItem(val item: ItemEntity, val wanted: Component) : Mishap() {
dyeColor(DyeColor.BROWN)
override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList<SpellDatum<*>>) {
item.deltaMovement = item.deltaMovement.add((Math.random() - 0.5) * 0.05, 1.0, (Math.random() - 0.5) * 0.05)
item.deltaMovement = item.deltaMovement.add((Math.random() - 0.5) * 0.05, 0.75, (Math.random() - 0.5) * 0.05)
}
override fun errorMessage(ctx: CastingContext, errorCtx: Context): Component {
return if (item.item.isEmpty)
error("no_item", actionName(errorCtx.action), wanted)
else
error("bad_item", actionName(errorCtx.action), wanted, item.item)
error("bad_item", actionName(errorCtx.action), wanted, item.item.count, item.item.displayName)
}
companion object {

View file

@ -350,7 +350,7 @@
"hexcasting.mishap.eval_too_deep": "Recursively evaluated too deep",
"hexcasting.mishap.no_item": "%s needs %s but got nothing",
"hexcasting.mishap.no_item.offhand": "%s needs %s in the other hand but got nothing",
"hexcasting.mishap.bad_item": "%s needs %s but got %s",
"hexcasting.mishap.bad_item": "%s needs %s but got %dx %s",
"hexcasting.mishap.bad_item.offhand": "%s needs %s in the other hand but got %dx %s",
"hexcasting.mishap.bad_item.iota": "a place to store iotas",
"hexcasting.mishap.bad_item.iota.read": "a place to read iotas from",