mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Range radii - renamed few variales for clarity
This commit is contained in:
parent
8f5e8efce0
commit
ee76e41c78
2 changed files with 11 additions and 10 deletions
|
@ -423,14 +423,15 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
for property in allProps
|
||||
if m = property.match ".*Range$"
|
||||
if @thang[m[0]]? and @thang[m[0]] < 9001
|
||||
@ranges.push [m[0], @thang[m[0]]]
|
||||
@ranges.push
|
||||
name: m[0]
|
||||
radius: @thang[m[0]]
|
||||
|
||||
@ranges = @ranges.sort((a, b) ->
|
||||
return a[1] < b[1]
|
||||
@ranges = @ranges.sort((range1, range2) ->
|
||||
return range1.radius < range2.radius
|
||||
)
|
||||
|
||||
for range in @ranges
|
||||
@addMark range[0]
|
||||
@addMark range.name for range in @ranges
|
||||
|
||||
@addMark('bounds').toggle true if @thang?.drawsBounds
|
||||
@addMark('shadow').toggle true unless @thangType.get('shadow') is 0
|
||||
|
@ -441,9 +442,9 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
@marks.repair?.toggle @thang?.errorsOut
|
||||
|
||||
if @selected
|
||||
@marks[range[0]].toggle true for range in @ranges
|
||||
@marks[range['name']].toggle true for range in @ranges
|
||||
else
|
||||
@marks[range[0]].toggle false for range in @ranges
|
||||
@marks[range['name']].toggle false for range in @ranges
|
||||
|
||||
mark.update() for name, mark of @marks
|
||||
#@thang.effectNames = ['berserk', 'confuse', 'control', 'curse', 'fear', 'poison', 'paralyze', 'regen', 'sleep', 'slow', 'haste']
|
||||
|
|
|
@ -131,8 +131,8 @@ module.exports = class Mark extends CocoClass
|
|||
]
|
||||
|
||||
# Find the index of this range, to find the next-smallest radius
|
||||
rangeNames = @sprite.ranges.map((value, index) ->
|
||||
value[0]
|
||||
rangeNames = @sprite.ranges.map((range, index) ->
|
||||
range['name']
|
||||
)
|
||||
i = rangeNames.indexOf(range)
|
||||
|
||||
|
@ -148,7 +148,7 @@ module.exports = class Mark extends CocoClass
|
|||
|
||||
# Cut out the hollow part if necessary
|
||||
if i+1 < @sprite.ranges.length
|
||||
@mark.graphics.arc 0, 0, @sprite.ranges[i+1][1], Math.PI*2, 0, true
|
||||
@mark.graphics.arc 0, 0, @sprite.ranges[i+1]['radius'], Math.PI*2, 0, true
|
||||
|
||||
# Add perspective
|
||||
@mark.scaleY *= @camera.y2x
|
||||
|
|
Loading…
Reference in a new issue