Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make flight spells cost zero if the target can already fly #687

Closed
wants to merge 6 commits into from
Closed
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 @@ -34,12 +34,17 @@ class OpFlight(val type: Type) : SpellAction {
val target = args.getPlayer(0, argc)
val theArg = args.getPositiveDouble(1, argc)
env.assertEntityInRange(target)

val cost = when (this.type) {
Type.LimitRange -> theArg * MediaConstants.DUST_UNIT
// A second of flight should cost 1 shard
Type.LimitTime -> theArg * MediaConstants.SHARD_UNIT
}.roundToLong()

val cost = if (target.abilities.mayfly) {
//zero in order to not just waste media if you can already fly (see https://github.com/FallingColors/HexMod/pull/687 for some discussion)
0L
beholderface marked this conversation as resolved.
Show resolved Hide resolved
} else {
when (this.type) {
Type.LimitRange -> theArg * MediaConstants.DUST_UNIT
// A second of flight should cost 1 shard
Type.LimitTime -> theArg * MediaConstants.SHARD_UNIT
}.roundToLong()
}

// Convert to ticks
return SpellAction.Result(
Expand Down
Loading