Skip to content

Commit

Permalink
Make the flight spells cost zero if the target can already fly
Browse files Browse the repository at this point in the history
  • Loading branch information
beholderface committed Jun 18, 2024
1 parent 3bcd0c7 commit a4f122b
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,20 @@ class OpFlight(val type: Type) : SpellAction {
val theArg = args.getPositiveDouble(1, argc)
env.assertEntityInRange(target)

val cost = when (this.type) {
/*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()
}.roundToLong()*/
val cost = if(target.abilities.mayfly){
0L
} 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

0 comments on commit a4f122b

Please sign in to comment.