Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ object OpConsumeWisp : SpellAction {

HexalAPI.LOGGER.debug("consumer: {}, {}", consumer, consumed.fightConsume(consumer))

val selfConsume = consumer.map({wisp -> wisp == consumed},{false})
val cost = when (consumed.fightConsume(consumer)) {
false -> HexalConfig.server.consumeWispOwnCost
false -> if (selfConsume) 0 else HexalConfig.server.consumeWispOwnCost
true -> (HexalConfig.server.consumeWispOthersCostPerMedia * consumed.media).toLong()
}

Expand All @@ -47,7 +48,7 @@ object OpConsumeWisp : SpellAction {
private data class Spell(val consumed: IMediaEntity<*>) : RenderedSpell {
override fun cast(env: CastingEnvironment) {
if (env is WispCastEnv) {
env.wisp.addMedia(19 * consumed.media / 20)
if (env.wisp != consumed) env.wisp.addMedia(19 * consumed.media / 20)
} else {
val ext = env.getExtension(ExtractMediaHook.KEY)
if (ext == null) {
Expand Down Expand Up @@ -76,4 +77,4 @@ object OpConsumeWisp : SpellAction {
}
}
}
}
}
2 changes: 1 addition & 1 deletion Common/src/main/resources/assets/hexal/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@

"hexal.entry.great_wisps": "Great Wisp Spells",
"hexal.page.great_wisps.wisp/consume.0": "Remove a wisp from the stack, and disassemble the wisp. The patterns contained are lost, but the media that it contained can be repurposed if this spell is cast by another wisp.",
"hexal.page.great_wisps.wisp/consume.1": "Costs either an $(l:items/amethyst)$(item)Amethyst Shard/$ if the wisp is owned by you or has $(l:patterns/spells/wisps#hexal:wisp/transfer/allow)$(action)allowed/$ transfer with the caster or caster's owner, or half again as much media as the consumed wisp contains if the wisp is owned by another and has now allowed it. Repurposing the media is not completely efficient, losing one twentieth of the consumed wisp's reserve in transfer.",
"hexal.page.great_wisps.wisp/consume.1": "Costs either an $(l:items/amethyst)$(item)Amethyst Shard/$ if the wisp is owned by you or has $(l:patterns/spells/wisps#hexal:wisp/transfer/allow)$(action)allowed/$ transfer with the caster or caster's owner, or half again as much media as the consumed wisp contains if the wisp is owned by another and has not allowed it. Repurposing the media is not completely efficient, losing one twentieth of the consumed wisp's reserve in transfer.$(br2)Alternatively, a wisp can consume itself to self-destruct for no media cost at all.",
"hexal.page.great_wisps.wisp/seon/set": "Bind one of my wisps closer to me; I may only have one bound wisp at a time, but whichever wisp is bound costs significantly less upkeep and increased range.",
"hexal.page.great_wisps.wisp/seon/get": "Returns my currently bound wisp. A new wisp can only be bound when this returns null. (This is not a great spell, I have simply placed it here for convenience.)",

Expand Down
Loading