1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
Pos Lua >> Moon
1 1:[ local world = require("world") ] >> 1:[ world = require "world" ]
25 2:[ local main = require("main") ] >> 2:[ main = require "main" ]
47 3:[ local color = require("color") ] >> 3:[ color = require "color" ]
71 4:[ local ui = require("ui") ] >> 4:[ ui = require "ui" ]
89 5:[ local bp = require("broadphase") ] >> 5:[ bp = require "broadphase" ]
115 6:[ local pass = require("a_pass") ] >> 6:[ pass = require "a_pass" ]
155 8:[ Pass = pass.Pass ] >> 7:[ import Pass from pass ]
161 9:[ local action = require("action") ] >> 8:[ action = require "action" ]
188 10:[ local mod = ... ] >> 10:[ mod = ... ]
199 11:[ local pip_width = 24 ] >> 12:[ pip_width = 24 ]
215 12:[ mod.time_pips = am.group() ] >> 14:[ mod.time_pips = am.group! ]
241 13:[ local pip_x_start = ((main.pips / 2) + 1) * -pip_width ] >> 15:[ pip_x_start = ((main.pips/2)+1) * -pip_width ]
286 14:[ local pip_sprites = { } ] >> 16:[ pip_sprites = {} ]
303 15:[ local ms_per_pip = 1000 ] >> 17:[ ms_per_pip = 1000 ]
322 16:[ mod.ability_selector = am.group() ] >> 19:[ mod.ability_selector = am.group! ]
355 17:[ mod.playerturn_up = 0 ] >> 20:[ mod.playerturn_up = 0 ]
378 18:[ mod.set_playerturn_up = function(self, time) ] >> 22:[ mod.set_playerturn_up = (time) => ]
413 19:[ mod.playerturn_up = time ] >> 23:[ mod.playerturn_up = time ]
378 20:[ end ] >> 22:[ mod.set_playerturn_up = (time) => ]
439 21:[ mod.victory_g = am.group() ] >> 25:[ mod.victory_g = am.group! ]
465 22:[ mod.victory_text = { } ] >> 26:[ mod.victory_text = {} ]
488 23:[ mod.action_phase = am.group() ] >> 28:[ mod.action_phase = am.group! --group used to animate characters during battle, also holds dammage values ]
593 24:[ mod.victory_show = false ] >> 29:[ mod.victory_show = false ]
618 25:[ mod.loaded_ability = nil ] >> 30:[ mod.loaded_ability = nil ]
644 26:[ mod.load = function() ] >> 32:[ mod.load = () -> ]
662 27:[ local pip_trans = am.translate(pip_x_start, 240 - (pip_width / 2)) ] >> 33:[ pip_trans = am.translate(pip_x_start,240 - (pip_width/2)) ]
728 28:[ for i = 1, main.pips do ] >> 34:[ for i = 1,main.pips ]
743 29:[ local pip_loc = am.translate(pip_width * i, 0) ] >> 35:[ pip_loc = am.translate(pip_width*i,0) ]
783 30:[ pip_trans:append(pip_loc ^ am.sprite("data/pip_frame.png", color.white)) ] >> 36:[ pip_trans\append(pip_loc^ am.sprite("data/pip_frame.png",color.white)) ]
856 31:[ local light_sprite = am.sprite("data/pip_dark.png", color.white) ] >> 37:[ light_sprite = am.sprite("data/pip_dark.png",color.white) ]
916 32:[ pip_loc:append(light_sprite) ] >> 38:[ pip_loc\append(light_sprite) ]
947 33:[ table.insert(pip_sprites, light_sprite) ] >> 39:[ table.insert(pip_sprites,light_sprite) ]
721 34:[ end ] >> 34:[ for i = 1,main.pips ]
987 35:[ mod.time_pips:append(pip_trans) ] >> 40:[ mod.time_pips\append(pip_trans) ]
1020 36:[ local ability_buttons = { } ] >> 41:[ ability_buttons = {} ]
1042 37:[ local ability_trans = am.group() ] >> 42:[ ability_trans = am.group! ]
1069 38:[ main.root("screen"):append(mod.victory_g) ] >> 43:[ main.root("screen")\append(mod.victory_g) ]
1122 39:[ for k, v in pairs({ ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1130 40:[ "V", ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1134 41:[ "I", ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1138 42:[ "C", ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1142 43:[ "T", ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1146 44:[ "O", ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1150 45:[ "R", ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1154 46:[ "Y" ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1122 47:[ }) do ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1162 48:[ local n = am.scale(2) ^ am.translate((k - 3.5) * 20, 0) ^ am.text(v, color.fg) ] >> 45:[ n = am.scale(2)^am.translate((k-3.5)*20,0)^am.text(v,color.fg) ]
1227 49:[ n:action(coroutine.create(function() ] >> 46:[ n\action(coroutine.create(() -> ]
1267 50:[ while true do ] >> 47:[ while true ]
1287 51:[ for k, v in pairs(mod.victory_text) do ] >> 48:[ for k,v in pairs(mod.victory_text) ]
1317 52:[ v.hidden = not mod.victory ] >> 49:[ v.hidden = not mod.victory ]
1277 53:[ end ] >> 48:[ for k,v in pairs(mod.victory_text) ]
1348 54:[ coroutine.yield() ] >> 50:[ coroutine.yield! ]
1262 55:[ end ] >> 47:[ while true ]
1227 56:[ end)) ] >> 46:[ n\action(coroutine.create(() -> ]
1372 57:[ n:action(am.series({ ] >> 52:[ n\action(am.series({ ]
1396 58:[ am.delay(k * 0.25), ] >> 53:[ am.delay(k*0.25), ]
1417 59:[ am.loop(function() ] >> 54:[ am.loop(() -> am.series({ ]
1430 60:[ return am.series({ ] >> 54:[ am.loop(() -> am.series({ ]
1447 61:[ am.tween(n("translate"), 1, { ] >> 55:[ am.tween(n("translate"),1,{y:30},am.ease.sine), ]
1476 62:[ y = 30 ] >> 55:[ am.tween(n("translate"),1,{y:30},am.ease.sine), ]
1447 63:[ }, am.ease.sine), ] >> 55:[ am.tween(n("translate"),1,{y:30},am.ease.sine), ]
1499 64:[ am.tween(n("translate"), 1, { ] >> 56:[ am.tween(n("translate"),1,{y:0},am.ease.sine) ]
1528 65:[ y = 0 ] >> 56:[ am.tween(n("translate"),1,{y:0},am.ease.sine) ]
1499 66:[ }, am.ease.sine) ] >> 56:[ am.tween(n("translate"),1,{y:0},am.ease.sine) ]
1430 67:[ }) ] >> 54:[ am.loop(() -> am.series({ ]
1417 68:[ end) ] >> 54:[ am.loop(() -> am.series({ ]
1372 69:[ })) ] >> 52:[ n\action(am.series({ ]
1560 70:[ table.insert(mod.victory_text, n) ] >> 59:[ table.insert(mod.victory_text,n) ]
1595 71:[ mod.victory_g:append(n) ] >> 60:[ mod.victory_g\append(n) ]
1112 72:[ end ] >> 44:[ for k,v in pairs({"V","I","C","T","O","R","Y"}) ]
1620 73:[ mod.ability_selector:append(ability_trans) ] >> 61:[ mod.ability_selector\append(ability_trans) ]
1671 74:[ for i = 1, 4 do ] >> 62:[ for i = 1,4 ]
1678 75:[ local trans_x = (-150 * (i - 2)) + 32 ] >> 63:[ trans_x = (-150 * (i-2))+32 ]
1708 76:[ local trans_y = 200 ] >> 64:[ trans_y = 200 ]
1803 77:[ local ability_slot_button = ui.create_any_button(ability_trans, 3, 3, trans_x, trans_y) ] >> 66:[ ability_slot_button = ui.create_any_button(ability_trans,3,3,trans_x,trans_y) ]
1883 78:[ local lpd = main.world.localplayer.data ] >> 67:[ lpd = main.world.localplayer.data ]
1919 79:[ print("lpd was:", lpd) ] >> 68:[ print("lpd was:",lpd) ]
1943 80:[ local ability = lpd.abilities[i] or Pass ] >> 69:[ ability = lpd.abilities[i] or Pass ]
1980 81:[ print("Ability was", ability.__name) ] >> 70:[ print("Ability was",ability.__name) ]
2018 82:[ print("Sprite was", ability and ability.sprite) ] >> 71:[ print("Sprite was",ability and ability.sprite) ]
2067 83:[ local ability_slot_icon = am.sprite(ability and ability.sprite or "data/no_action.png", color.white, "left", "top"):tag("icon") ] >> 72:[ ability_slot_icon = am.sprite(ability and ability.sprite or "data/no_action.png", color.white, "left","top")\tag("icon") ]
2190 84:[ ability_slot_button.name = ability.__name ] >> 73:[ ability_slot_button.name = ability.__name ]
2234 85:[ ability_slot_button.ability = ability ] >> 74:[ ability_slot_button.ability = ability ]
2274 86:[ ability_slot_button.node:append(am.translate(trans_x + 16, trans_y - 16) ^ ability_slot_icon) ] >> 75:[ ability_slot_button.node\append(am.translate(trans_x + 16,trans_y - 16)^ ability_slot_icon) ]
2368 87:[ table.insert(ability_buttons, ability_slot_button) ] >> 76:[ table.insert(ability_buttons, ability_slot_button) ]
1664 88:[ end ] >> 62:[ for i = 1,4 ]
2420 89:[ print("test") ] >> 77:[ print("test") ]
2435 90:[ main.root("screen"):append(mod.time_pips) ] >> 78:[ main.root("screen")\append(mod.time_pips) ]
2478 91:[ main.root("screen"):append(mod.ability_selector) ] >> 79:[ main.root("screen")\append(mod.ability_selector) ]
2528 92:[ main.root("screen"):append(mod.action_phase) ] >> 80:[ main.root("screen")\append(mod.action_phase) ]
2574 93:[ mod.time_pips:action(coroutine.create(function() ] >> 81:[ mod.time_pips\action(coroutine.create(() -> ]
2620 94:[ print("Pips in action:", pip_sprites) ] >> 82:[ print("Pips in action:",pip_sprites) ]
2664 95:[ while true do ] >> 83:[ while true ]
2675 96:[ if not mod.victory then ] >> 84:[ if not mod.victory ]
2696 97:[ local currtime = am.eval_js("new Date().getTime()") ] >> 85:[ currtime = am.eval_js("new Date().getTime()") ]
2746 98:[ local elapsed_time = currtime - main.world.time_ref ] >> 86:[ elapsed_time = currtime - main.world.time_ref ]
2796 99:[ local npips = math.min(math.floor(elapsed_time / ms_per_pip), main.pips) ] >> 87:[ npips = math.min(math.floor(elapsed_time/ms_per_pip),main.pips) ]
2871 100:[ for i = 1, npips do ] >> 88:[ for i = 1,npips ]
2885 101:[ pip_sprites[i].source = "data/pip_light.png" ] >> 89:[ pip_sprites[i].source = "data/pip_light.png" ]
2864 102:[ end ] >> 88:[ for i = 1,npips ]
2941 103:[ for i = npips + 2, main.pips do ] >> 90:[ for i = npips+2,main.pips ]
2967 104:[ if i > 0 and i <= main.pips then ] >> 91:[ if i > 0 and i <= main.pips ]
2999 105:[ pip_sprites[i].source = "data/pip_dark.png" ] >> 92:[ pip_sprites[i].source = "data/pip_dark.png" ]
2965 106:[ end ] >> 91:[ if i > 0 and i <= main.pips ]
2934 107:[ end ] >> 90:[ for i = npips+2,main.pips ]
2673 108:[ end ] >> 84:[ if not mod.victory ]
3046 109:[ coroutine.yield() ] >> 93:[ coroutine.yield! ]
2659 110:[ end ] >> 83:[ while true ]
2574 111:[ end)) ] >> 81:[ mod.time_pips\action(coroutine.create(() -> ]
3068 112:[ local touch_indicator = am.group() ] >> 95:[ touch_indicator = am.group! ]
3097 113:[ local touch_cursor = am.sprite("data/cursor.png", vec4(1, 1, 1, 1), "left", "top") ] >> 96:[ touch_cursor = am.sprite("data/cursor.png",vec4(1,1,1,1),"left","top") ]
3169 114:[ local touch_loc = am.translate(0, 0) ^ touch_cursor ] >> 97:[ touch_loc = am.translate(0,0)^ touch_cursor ]
3214 115:[ touch_indicator:append(touch_loc) ] >> 98:[ touch_indicator\append(touch_loc) ]
3249 116:[ mod.ability_selector:append(touch_indicator) ] >> 99:[ mod.ability_selector\append(touch_indicator) ]
3295 117:[ return mod.ability_selector:action(coroutine.create(function() ] >> 100:[ mod.ability_selector\action(coroutine.create(() -> ]
3353 118:[ while true do ] >> 101:[ while true ]
3364 119:[ if #main.win:active_touches() > 0 then ] >> 102:[ if #main.win\active_touches! > 0 ]
3399 120:[ local touch = main.win:touch_position(1) ] >> 103:[ touch = main.win\touch_position(1) ]
3438 121:[ touch_cursor.color = vec4(1, 1, 1, 1) ] >> 104:[ touch_cursor.color = vec4(1,1,1,1) ]
3477 122:[ touch_loc.x = touch.x ] >> 105:[ touch_loc.x = touch.x ]
3503 123:[ touch_loc.y = touch.y ] >> 106:[ touch_loc.y = touch.y ]
3529 124:[ local col_but = bp.check(touch.x, touch.y + 96) ] >> 107:[ col_but = bp.check(touch.x, touch.y + 96) ]
3577 125:[ if #col_but > 0 then ] >> 108:[ if #col_but > 0 ]
3596 126:[ touch_cursor.color = vec4(0.5, 0.5, 0.5, 0.5) ] >> 109:[ touch_cursor.color = vec4(0.5,0.5,0.5,0.5) ]
3575 127:[ end ] >> 108:[ if #col_but > 0 ]
3645 128:[ if main.win:touch_began(1) then ] >> 110:[ if main.win\touch_began(1) ]
3675 129:[ print("Checking ability buttons:", ability_buttons, "against col but:", col_but) ] >> 111:[ print("Checking ability buttons:",ability_buttons, "against col but:",col_but) ]
3774 130:[ for _, button in ipairs(ability_buttons) do ] >> 112:[ for _,button in ipairs(ability_buttons) ]
3807 131:[ if button == col_but[1] then ] >> 113:[ if button == col_but[1] ]
3836 132:[ print("Found button") ] >> 114:[ print("Found button") ]
3865 133:[ action.set_action(button.name) ] >> 115:[ action.set_action(button.name) ]
3905 134:[ if mod.loaded_ability then ] >> 116:[ if mod.loaded_ability ]
3933 135:[ mod.loaded_ability:unload() ] >> 117:[ mod.loaded_ability\unload! ]
3903 136:[ end ] >> 116:[ if mod.loaded_ability ]
3967 137:[ button.ability:load() ] >> 118:[ button.ability\load! ]
3995 138:[ mod.loaded_ability = ability ] >> 119:[ mod.loaded_ability = ability ]
3805 139:[ end ] >> 113:[ if button == col_but[1] ]
3759 140:[ end ] >> 112:[ for _,button in ipairs(ability_buttons) ]
3643 141:[ end ] >> 110:[ if main.win\touch_began(1) ]
3362 142:[ end ] >> 102:[ if #main.win\active_touches! > 0 ]
4027 143:[ coroutine.yield() ] >> 120:[ coroutine.yield! ]
3348 144:[ end ] >> 101:[ while true ]
3295 145:[ end)) ] >> 100:[ mod.ability_selector\action(coroutine.create(() -> ]
644 146:[ end ] >> 32:[ mod.load = () -> ]
4051 147:[ mod.unload = function() ] >> 124:[ mod.unload = () -> ]
4071 148:[ main.root("screen"):remove(mod.time_pips) ] >> 125:[ main.root("screen")\remove(mod.time_pips) ]
4114 149:[ main.root("screen"):remove(mod.ability_selector) ] >> 126:[ main.root("screen")\remove(mod.ability_selector) ]
4164 150:[ return main.root("screen"):remove(mod.action_phase) ] >> 127:[ main.root("screen")\remove(mod.action_phase) ]
4051 151:[ end ] >> 124:[ mod.unload = () -> ]
4210 152:[ return mod ] >> 129:[ mod ]
|