diff options
| author | Alexander M Pickering <alex@cogarr.net> | 2024-01-29 16:20:10 -0600 |
|---|---|---|
| committer | Alexander M Pickering <alex@cogarr.net> | 2024-01-29 16:20:10 -0600 |
| commit | c2926c5ec74d7e37da395c8c32a7ff2b4cae7d06 (patch) | |
| tree | ac2bb208dab1274cdc5e9059ffe014ae19181a4c /debug | |
| download | fools_rush_in-c2926c5ec74d7e37da395c8c32a7ff2b4cae7d06.tar.gz fools_rush_in-c2926c5ec74d7e37da395c8c32a7ff2b4cae7d06.tar.bz2 fools_rush_in-c2926c5ec74d7e37da395c8c32a7ff2b4cae7d06.zip | |
All the files
Diffstat (limited to 'debug')
49 files changed, 3111 insertions, 0 deletions
diff --git a/debug/.gitignore b/debug/.gitignore new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/debug/.gitignore diff --git a/debug/a_brood.lua.X b/debug/a_brood.lua.X new file mode 100644 index 0000000..ea6e658 --- /dev/null +++ b/debug/a_brood.lua.X @@ -0,0 +1,58 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +73 7:[ local _parent_0 = Ability ] >> 4:[ class Brood extends Ability ] +348 10:[ local room = world.player_party.room ] >> 18:[ room = world.player_party.room ] +381 11:[ local enemy_party = room.parties[1] ] >> 19:[ enemy_party = room.parties[1] ] +415 12:[ if enemy_party == party then ] >> 20:[ if enemy_party == party ] +440 13:[ enemy_party = room.parties[2] ] >> 21:[ enemy_party = room.parties[2] ] +413 14:[ end ] >> 20:[ if enemy_party == party ] +508 17:[ for i = 1, 4 do ] >> 23:[ for i = 1,4 ] +516 18:[ local chars_at_loc = world.room.data.locations[i] ] >> 24:[ chars_at_loc = world.room.data.locations[i] ] +565 19:[ if world.server then ] >> 25:[ if world.server ] +583 20:[ local a_chars_at_loc = { } ] >> 26:[ a_chars_at_loc = {} ] +617 21:[ for _, v in ipairs(chars_at_loc) do ] >> 27:[ for _,v in ipairs(chars_at_loc) ] +644 22:[ table.insert(a_chars_at_loc, world.player_party:member(v.uname)) ] >> 28:[ table.insert(a_chars_at_loc,world.player_party\member(v.uname)) ] +607 23:[ end ] >> 27:[ for _,v in ipairs(chars_at_loc) ] +712 24:[ chars_at_loc = a_chars_at_loc ] >> 29:[ chars_at_loc = a_chars_at_loc ] +563 25:[ end ] >> 25:[ if world.server ] +745 26:[ local hp_minus ] >> 30:[ hp_minus = () -> ] +745 27:[ hp_minus = function() ] >> 30:[ hp_minus = () -> ] +780 28:[ for _, char in pairs(chars_at_loc) do ] >> 31:[ for _, char in pairs(chars_at_loc) ] +806 29:[ char:set_field("hp", char.data.hp - 1) ] >> 32:[ char\set_field("hp",char.data.hp - 1) ] +766 30:[ end ] >> 31:[ for _, char in pairs(chars_at_loc) ] +745 31:[ end ] >> 30:[ hp_minus = () -> ] +849 32:[ if world.server then ] >> 33:[ if world.server ] +867 33:[ hp_minus() ] >> 34:[ hp_minus! ] +847 34:[ end ] >> 33:[ if world.server ] +882 35:[ if world.client then ] >> 35:[ if world.client ] +900 36:[ local ui = ui or require("ui") ] >> 36:[ ui = ui or require "ui" ] +928 37:[ ui.tween_hit(char, i, hp_minus) ] >> 37:[ ui.tween_hit(char,i, hp_minus) ] +880 38:[ end ] >> 35:[ if world.client ] +501 39:[ end ] >> 23:[ for i = 1,4 ] +973 42:[ return print("TODO!") ] >> 39:[ print("TODO!") ] +1005 45:[ return print("TODO!") ] >> 42:[ print("TODO!") ] +198 52:[ _class_0.__parent.__init(self, ...) ] >> 11:[ super(...) ] +211 53:[ self.requirements = { ] >> 12:[ @requirements = { ] +233 55:[ "consume_stat", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +248 56:[ "stamina", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +259 57:[ 1 ] >> 13:[ {"consume_stat", "stamina", 1}, ] +268 60:[ "status", ] >> 14:[ {"status", "active"}, ] +277 61:[ "active" ] >> 14:[ {"status", "active"}, ] +293 64:[ "distance", ] >> 15:[ {"distance", 1}, ] +304 65:[ 1 ] >> 15:[ {"distance", 1}, ] +211 67:[ } ] >> 12:[ @requirements = { ] +83 92:[ self.text = "Brood" ] >> 5:[ @text = "Brood" ] +100 93:[ self.description = "brood" ] >> 6:[ @description = "brood" ] +124 94:[ self.hits_icon = { ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +138 95:[ 1, ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +140 96:[ 1, ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +142 97:[ 1, ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +144 98:[ 1, ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +146 99:[ 0, ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +148 100:[ 0, ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +150 101:[ 0, ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +152 102:[ 0 ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +124 103:[ } ] >> 7:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +156 104:[ self.speed = 5 ] >> 8:[ @speed = 5 ] +168 105:[ self.distance = 1 ] >> 9:[ @distance = 1 ] diff --git a/debug/a_dance.lua.X b/debug/a_dance.lua.X new file mode 100644 index 0000000..d8512f2 --- /dev/null +++ b/debug/a_dance.lua.X @@ -0,0 +1,63 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +29 2:[ local ui = require("ui") ] >> 2:[ ui = require "ui" ] +66 4:[ Ability = reg.Ability ] >> 3:[ import Ability from reg ] +72 5:[ local mod = ... ] >> 5:[ mod = ... ] +102 9:[ local _parent_0 = Ability ] >> 7:[ class Dance extends Ability ] +376 12:[ local room = world.player_party.room ] >> 20:[ room = world.player_party.room ] +409 13:[ local my_pos = char.location ] >> 21:[ my_pos = char.location ] +466 14:[ local char_tbl1, char_tbl2 = nil, nil ] >> 23:[ char_tbl1, char_tbl2 = nil, nil ] +514 15:[ for distance = 1, 8 do ] >> 24:[ for distance = 1, 8 ] +523 16:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 25:[ char_tbl1 = room\at_location(my_pos + distance) ] +574 17:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 26:[ char_tbl2 = room\at_location(my_pos - distance) ] +627 18:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +625 20:[ end ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +500 21:[ end ] >> 24:[ for distance = 1, 8 ] +745 24:[ for _, i in pairs({ ] >> 31:[ for _,i in pairs({6,7}) ] +753 25:[ 6, ] >> 31:[ for _,i in pairs({6,7}) ] +755 26:[ 7 ] >> 31:[ for _,i in pairs({6,7}) ] +745 27:[ }) do ] >> 31:[ for _,i in pairs({6,7}) ] +762 28:[ local chars_at_loc = world.room.data.locations[i] ] >> 32:[ chars_at_loc = world.room.data.locations[i] ] +811 29:[ if world.server then ] >> 33:[ if world.server ] +829 30:[ local a_chars_at_loc = { } ] >> 34:[ a_chars_at_loc = {} ] +863 31:[ for _, v in ipairs(chars_at_loc) do ] >> 35:[ for _,v in ipairs(chars_at_loc) ] +890 32:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 36:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +853 33:[ end ] >> 35:[ for _,v in ipairs(chars_at_loc) ] +957 34:[ chars_at_loc = a_chars_at_loc ] >> 37:[ chars_at_loc = a_chars_at_loc ] +809 35:[ end ] >> 33:[ if world.server ] +990 36:[ local hp_minus ] >> 38:[ hp_minus = () -> ] +990 37:[ hp_minus = function() ] >> 38:[ hp_minus = () -> ] +1025 38:[ for _, char in pairs(chars_at_loc) do ] >> 39:[ for _, char in pairs(chars_at_loc) ] +1051 39:[ char:set_field("hp", char.data.hp - 1) ] >> 40:[ char\set_field("hp",char.data.hp - 1) ] +1011 40:[ end ] >> 39:[ for _, char in pairs(chars_at_loc) ] +990 41:[ end ] >> 38:[ hp_minus = () -> ] +1094 42:[ if world.server then ] >> 41:[ if world.server ] +1112 43:[ hp_minus() ] >> 42:[ hp_minus! ] +1092 44:[ end ] >> 41:[ if world.server ] +1127 45:[ if world.client then ] >> 43:[ if world.client ] +1145 46:[ ui = ui or require("ui") ] >> 44:[ ui = ui or require "ui" ] +1173 47:[ ui.tween_hit(char, 1, hp_minus) ] >> 45:[ ui.tween_hit(char,1, hp_minus) ] +1125 48:[ end ] >> 43:[ if world.client ] +735 49:[ end ] >> 31:[ for _,i in pairs({6,7}) ] +274 56:[ _class_0.__parent.__init(self, "Dance", { }) ] >> 15:[ super("Dance",{}) ] +294 57:[ self.requirements = { ] >> 16:[ @requirements = { ] +316 59:[ "status", ] >> 17:[ {"status", "active"}, ] +325 60:[ "active" ] >> 17:[ {"status", "active"}, ] +294 62:[ } ] >> 16:[ @requirements = { ] +112 87:[ self.text = "Dance" ] >> 8:[ @text = "Dance" ] +129 88:[ self.description = "Shake your body!" ] >> 9:[ @description = "Shake your body!" ] +164 89:[ self.hits_icon = { ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +178 90:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +180 91:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +182 92:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +184 93:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +186 94:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +188 95:[ 1, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +190 96:[ 1, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +192 97:[ 0 ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +164 98:[ } ] >> 10:[ @hits_icon = {0,0,0,0,0,1,1,0} ] +196 99:[ self.sprite = "data/body-balance.png" ] >> 11:[ @sprite = "data/body-balance.png" ] +231 100:[ self.speed = 7 ] >> 12:[ @speed = 7 ] +244 101:[ self.distance = 1 ] >> 13:[ @distance = 1 ] +1205 107:[ mod.Tumble = Tumble ] >> 47:[ mod.Tumble = Tumble ] +1226 108:[ return mod ] >> 49:[ mod ] diff --git a/debug/a_drum.lua.X b/debug/a_drum.lua.X new file mode 100644 index 0000000..9b55003 --- /dev/null +++ b/debug/a_drum.lua.X @@ -0,0 +1,58 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +29 2:[ local ui = require("ui") ] >> 2:[ ui = require "ui" ] +66 4:[ Ability = reg.Ability ] >> 3:[ import Ability from reg ] +72 5:[ local mod = ... ] >> 5:[ mod = ... ] +101 9:[ local _parent_0 = Ability ] >> 7:[ class Drum extends Ability ] +362 12:[ local room = world.player_party.room ] >> 20:[ room = world.player_party.room ] +395 13:[ local my_pos = char.location ] >> 21:[ my_pos = char.location ] +452 14:[ local char_tbl1, char_tbl2 = nil, nil ] >> 23:[ char_tbl1, char_tbl2 = nil, nil ] +500 15:[ for distance = 1, 8 do ] >> 24:[ for distance = 1, 8 ] +509 16:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 25:[ char_tbl1 = room\at_location(my_pos + distance) ] +560 17:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 26:[ char_tbl2 = room\at_location(my_pos - distance) ] +613 18:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +611 20:[ end ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +486 21:[ end ] >> 24:[ for distance = 1, 8 ] +721 24:[ local chars_at_loc = world.room.data.locations[5] ] >> 31:[ chars_at_loc = world.room.data.locations[5] ] +769 25:[ if world.server then ] >> 32:[ if world.server ] +786 26:[ local a_chars_at_loc = { } ] >> 33:[ a_chars_at_loc = {} ] +819 27:[ for _, v in ipairs(chars_at_loc) do ] >> 34:[ for _,v in ipairs(chars_at_loc) ] +845 28:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 35:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +809 29:[ end ] >> 34:[ for _,v in ipairs(chars_at_loc) ] +911 30:[ chars_at_loc = a_chars_at_loc ] >> 36:[ chars_at_loc = a_chars_at_loc ] +767 31:[ end ] >> 32:[ if world.server ] +943 32:[ local hp_minus ] >> 37:[ hp_minus = () -> ] +943 33:[ hp_minus = function() ] >> 37:[ hp_minus = () -> ] +977 34:[ for _, char in pairs(chars_at_loc) do ] >> 38:[ for _, char in pairs(chars_at_loc) ] +1002 35:[ char:set_field("hp", char.data.hp - 1) ] >> 39:[ char\set_field("hp",char.data.hp - 1) ] +963 36:[ end ] >> 38:[ for _, char in pairs(chars_at_loc) ] +943 37:[ end ] >> 37:[ hp_minus = () -> ] +1044 38:[ if world.server then ] >> 40:[ if world.server ] +1061 39:[ hp_minus() ] >> 41:[ hp_minus! ] +1042 40:[ end ] >> 40:[ if world.server ] +1075 41:[ if world.client then ] >> 42:[ if world.client ] +1092 42:[ ui = ui or require("ui") ] >> 43:[ ui = ui or require "ui" ] +1119 43:[ return ui.tween_hit(char, 1, hp_minus) ] >> 44:[ ui.tween_hit(char,1, hp_minus) ] +1073 44:[ end ] >> 42:[ if world.client ] +261 51:[ _class_0.__parent.__init(self, "Drum", { }) ] >> 15:[ super("Drum",{}) ] +280 52:[ self.requirements = { ] >> 16:[ @requirements = { ] +302 54:[ "status", ] >> 17:[ {"status", "active"}, ] +311 55:[ "active" ] >> 17:[ {"status", "active"}, ] +280 57:[ } ] >> 16:[ @requirements = { ] +111 82:[ self.text = "Drum" ] >> 8:[ @text = "Drum" ] +127 83:[ self.description = "Rat-a-tat-tat!" ] >> 9:[ @description = "Rat-a-tat-tat!" ] +160 84:[ self.hits_icon = { ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +174 85:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +176 86:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +178 87:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +180 88:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +182 89:[ 1, ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +184 90:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +186 91:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +188 92:[ 0 ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +160 93:[ } ] >> 10:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +192 94:[ self.sprite = "data/drum.png" ] >> 11:[ @sprite = "data/drum.png" ] +219 95:[ self.speed = 5 ] >> 12:[ @speed = 5 ] +231 96:[ self.distance = 1 ] >> 13:[ @distance = 1 ] +1151 102:[ mod.Tumble = Tumble ] >> 46:[ mod.Tumble = Tumble ] +1172 103:[ return mod ] >> 48:[ mod ] diff --git a/debug/a_firebreath.lua.X b/debug/a_firebreath.lua.X new file mode 100644 index 0000000..057c386 --- /dev/null +++ b/debug/a_firebreath.lua.X @@ -0,0 +1,62 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +54 4:[ local mod = ... ] >> 4:[ mod = ... ] +64 5:[ print("In tubmle, reg is", reg) ] >> 5:[ print("In tubmle, reg is",reg) ] +120 9:[ local _parent_0 = Ability ] >> 7:[ class FireBreath extends Ability ] +424 12:[ local room = world.player_party.room ] >> 20:[ room = world.player_party.room ] +457 13:[ local my_pos = char.location ] >> 21:[ my_pos = char.location ] +514 14:[ local char_tbl1, char_tbl2 = nil, nil ] >> 23:[ char_tbl1, char_tbl2 = nil, nil ] +562 15:[ for distance = 1, 8 do ] >> 24:[ for distance = 1, 8 ] +571 16:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 25:[ char_tbl1 = room\at_location(my_pos + distance) ] +622 17:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 26:[ char_tbl2 = room\at_location(my_pos - distance) ] +675 18:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +673 20:[ end ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +548 21:[ end ] >> 24:[ for distance = 1, 8 ] +783 24:[ print("Doing FireBreath") ] >> 31:[ print("Doing FireBreath") ] +818 25:[ for i = 5, 8 do ] >> 32:[ for i = 5,8 ] +826 26:[ local chars_at_loc = world.room.data.locations[i] ] >> 33:[ chars_at_loc = world.room.data.locations[i] ] +873 27:[ print("chars at loc:", chars_at_loc) ] >> 34:[ print("chars at loc:",chars_at_loc) ] +914 28:[ if world.server then ] >> 35:[ if world.server ] +932 29:[ local a_chars_at_loc = { } ] >> 36:[ a_chars_at_loc = {} ] +966 30:[ for _, v in ipairs(chars_at_loc) do ] >> 37:[ for _,v in ipairs(chars_at_loc) ] +993 31:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 38:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +956 32:[ end ] >> 37:[ for _,v in ipairs(chars_at_loc) ] +1060 33:[ chars_at_loc = a_chars_at_loc ] >> 39:[ chars_at_loc = a_chars_at_loc ] +912 34:[ end ] >> 35:[ if world.server ] +1093 35:[ local hp_minus ] >> 40:[ hp_minus = () -> ] +1093 36:[ hp_minus = function() ] >> 40:[ hp_minus = () -> ] +1128 37:[ for _, char in pairs(chars_at_loc) do ] >> 41:[ for _, char in pairs(chars_at_loc) ] +1154 38:[ char:set_field("hp", char.data.hp - 1) ] >> 42:[ char\set_field("hp",char.data.hp - 1) ] +1114 39:[ end ] >> 41:[ for _, char in pairs(chars_at_loc) ] +1093 40:[ end ] >> 40:[ hp_minus = () -> ] +1197 41:[ if world.server then ] >> 43:[ if world.server ] +1215 42:[ hp_minus() ] >> 44:[ hp_minus! ] +1195 43:[ end ] >> 43:[ if world.server ] +1230 44:[ if world.client then ] >> 45:[ if world.client ] +1248 45:[ local ui = ui or require("ui") ] >> 46:[ ui = ui or require "ui" ] +1276 46:[ ui.tween_hit(char, i - 4, hp_minus) ] >> 47:[ ui.tween_hit(char,i - 4, hp_minus) ] +1228 47:[ end ] >> 45:[ if world.client ] +811 48:[ end ] >> 32:[ for i = 5,8 ] +317 55:[ _class_0.__parent.__init(self, "FireBreath", { }) ] >> 15:[ super("FireBreath",{}) ] +342 56:[ self.requirements = { ] >> 16:[ @requirements = { ] +364 58:[ "status", ] >> 17:[ {"status", "active"}, ] +373 59:[ "active" ] >> 17:[ {"status", "active"}, ] +342 61:[ } ] >> 16:[ @requirements = { ] +130 86:[ self.text = "Breath Fire" ] >> 8:[ @text = "Breath Fire" ] +153 87:[ self.description = "Breath fire, visible for everyone!" ] >> 9:[ @description = "Breath fire, visible for everyone!" ] +206 88:[ self.sprite = "data/dragon-breath.png" ] >> 10:[ @sprite = "data/dragon-breath.png" ] +242 89:[ self.hits_icon = { ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +256 90:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +258 91:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +260 92:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +262 93:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +264 94:[ 1, ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +266 95:[ 1, ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +268 96:[ 1, ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +270 97:[ 1 ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +242 98:[ } ] >> 11:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +274 99:[ self.speed = 10 ] >> 12:[ @speed = 10 ] +287 100:[ self.distance = 1 ] >> 13:[ @distance = 1 ] +1312 106:[ mod.Tumble = Tumble ] >> 49:[ mod.Tumble = Tumble ] +1333 107:[ return mod ] >> 51:[ mod ] diff --git a/debug/a_hackysacks.lua.X b/debug/a_hackysacks.lua.X new file mode 100644 index 0000000..88adebb --- /dev/null +++ b/debug/a_hackysacks.lua.X @@ -0,0 +1,61 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +54 4:[ local mod = ... ] >> 4:[ mod = ... ] +64 5:[ print("In tubmle, reg is", reg) ] >> 5:[ print("In tubmle, reg is",reg) ] +116 9:[ local _parent_0 = Ability ] >> 7:[ class Juggle extends Ability ] +393 12:[ local room = world.player_party.room ] >> 20:[ room = world.player_party.room ] +426 13:[ local my_pos = char.location ] >> 21:[ my_pos = char.location ] +483 14:[ local char_tbl1, char_tbl2 = nil, nil ] >> 23:[ char_tbl1, char_tbl2 = nil, nil ] +531 15:[ for distance = 1, 8 do ] >> 24:[ for distance = 1, 8 ] +540 16:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 25:[ char_tbl1 = room\at_location(my_pos + distance) ] +591 17:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 26:[ char_tbl2 = room\at_location(my_pos - distance) ] +644 18:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +642 20:[ end ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +517 21:[ end ] >> 24:[ for distance = 1, 8 ] +759 24:[ for i = 5, 6 do ] >> 31:[ for i = 5,6 ] +767 25:[ local chars_at_loc = world.room.data.locations[i] ] >> 32:[ chars_at_loc = world.room.data.locations[i] ] +814 26:[ print("chars at loc:", chars_at_loc) ] >> 33:[ print("chars at loc:",chars_at_loc) ] +855 27:[ if world.server then ] >> 34:[ if world.server ] +873 28:[ local a_chars_at_loc = { } ] >> 35:[ a_chars_at_loc = {} ] +907 29:[ for _, v in ipairs(chars_at_loc) do ] >> 36:[ for _,v in ipairs(chars_at_loc) ] +934 30:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 37:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +897 31:[ end ] >> 36:[ for _,v in ipairs(chars_at_loc) ] +1001 32:[ chars_at_loc = a_chars_at_loc ] >> 38:[ chars_at_loc = a_chars_at_loc ] +853 33:[ end ] >> 34:[ if world.server ] +1034 34:[ local hp_minus ] >> 39:[ hp_minus = () -> ] +1034 35:[ hp_minus = function() ] >> 39:[ hp_minus = () -> ] +1069 36:[ for _, char in pairs(chars_at_loc) do ] >> 40:[ for _, char in pairs(chars_at_loc) ] +1095 37:[ char:set_field("hp", char.data.hp - 1) ] >> 41:[ char\set_field("hp",char.data.hp - 1) ] +1055 38:[ end ] >> 40:[ for _, char in pairs(chars_at_loc) ] +1034 39:[ end ] >> 39:[ hp_minus = () -> ] +1138 40:[ if world.server then ] >> 42:[ if world.server ] +1156 41:[ hp_minus() ] >> 43:[ hp_minus! ] +1136 42:[ end ] >> 42:[ if world.server ] +1171 43:[ if world.client then ] >> 44:[ if world.client ] +1189 44:[ local ui = ui or require("ui") ] >> 45:[ ui = ui or require "ui" ] +1217 45:[ ui.tween_hit(char, i - 4, hp_minus) ] >> 46:[ ui.tween_hit(char,i-4, hp_minus) ] +1169 46:[ end ] >> 44:[ if world.client ] +752 47:[ end ] >> 31:[ for i = 5,6 ] +290 54:[ _class_0.__parent.__init(self, "Juggle", { }) ] >> 15:[ super("Juggle",{}) ] +311 55:[ self.requirements = { ] >> 16:[ @requirements = { ] +333 57:[ "status", ] >> 17:[ {"status", "active"}, ] +342 58:[ "active" ] >> 17:[ {"status", "active"}, ] +311 60:[ } ] >> 16:[ @requirements = { ] +126 85:[ self.text = "Juggle Balls" ] >> 8:[ @text = "Juggle Balls" ] +150 86:[ self.description = "Juggle some balls" ] >> 9:[ @description = "Juggle some balls" ] +186 87:[ self.hits_icon = { ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +200 88:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +202 89:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +204 90:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +206 91:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +208 92:[ 1, ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +210 93:[ 1, ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +212 94:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +214 95:[ 0 ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +186 96:[ } ] >> 10:[ @hits_icon = {0,0,0,0,1,1,0,0} ] +218 97:[ self.sprite = "data/juggler.png" ] >> 11:[ @sprite = "data/juggler.png" ] +248 98:[ self.speed = 4 ] >> 12:[ @speed = 4 ] +260 99:[ self.distance = 1 ] >> 13:[ @distance = 1 ] +1251 105:[ mod.Tumble = Tumble ] >> 48:[ mod.Tumble = Tumble ] +1272 106:[ return mod ] >> 50:[ mod ] diff --git a/debug/a_highjump.lua.X b/debug/a_highjump.lua.X new file mode 100644 index 0000000..4ba4501 --- /dev/null +++ b/debug/a_highjump.lua.X @@ -0,0 +1,63 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +29 2:[ local ui = require("ui") ] >> 2:[ ui = require "ui" ] +66 4:[ Ability = reg.Ability ] >> 3:[ import Ability from reg ] +72 5:[ local mod = ... ] >> 5:[ mod = ... ] +105 9:[ local _parent_0 = Ability ] >> 7:[ class HighJump extends Ability ] +394 12:[ local room = world.player_party.room ] >> 20:[ room = world.player_party.room ] +427 13:[ local my_pos = char.location ] >> 21:[ my_pos = char.location ] +484 14:[ local char_tbl1, char_tbl2 = nil, nil ] >> 23:[ char_tbl1, char_tbl2 = nil, nil ] +532 15:[ for distance = 1, 8 do ] >> 24:[ for distance = 1, 8 ] +541 16:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 25:[ char_tbl1 = room\at_location(my_pos + distance) ] +592 17:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 26:[ char_tbl2 = room\at_location(my_pos - distance) ] +645 18:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +643 20:[ end ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +518 21:[ end ] >> 24:[ for distance = 1, 8 ] +763 24:[ for _, i in pairs({ ] >> 31:[ for _,i in pairs({7,8}) ] +771 25:[ 7, ] >> 31:[ for _,i in pairs({7,8}) ] +773 26:[ 8 ] >> 31:[ for _,i in pairs({7,8}) ] +763 27:[ }) do ] >> 31:[ for _,i in pairs({7,8}) ] +780 28:[ local chars_at_loc = world.room.data.locations[i] ] >> 32:[ chars_at_loc = world.room.data.locations[i] ] +829 29:[ if world.server then ] >> 33:[ if world.server ] +847 30:[ local a_chars_at_loc = { } ] >> 34:[ a_chars_at_loc = {} ] +881 31:[ for _, v in ipairs(chars_at_loc) do ] >> 35:[ for _,v in ipairs(chars_at_loc) ] +908 32:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 36:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +871 33:[ end ] >> 35:[ for _,v in ipairs(chars_at_loc) ] +975 34:[ chars_at_loc = a_chars_at_loc ] >> 37:[ chars_at_loc = a_chars_at_loc ] +827 35:[ end ] >> 33:[ if world.server ] +1008 36:[ local hp_minus ] >> 38:[ hp_minus = () -> ] +1008 37:[ hp_minus = function() ] >> 38:[ hp_minus = () -> ] +1043 38:[ for _, char in pairs(chars_at_loc) do ] >> 39:[ for _, char in pairs(chars_at_loc) ] +1069 39:[ char:set_field("hp", char.data.hp - 1) ] >> 40:[ char\set_field("hp",char.data.hp - 1) ] +1029 40:[ end ] >> 39:[ for _, char in pairs(chars_at_loc) ] +1008 41:[ end ] >> 38:[ hp_minus = () -> ] +1112 42:[ if world.server then ] >> 41:[ if world.server ] +1130 43:[ hp_minus() ] >> 42:[ hp_minus! ] +1110 44:[ end ] >> 41:[ if world.server ] +1145 45:[ if world.client then ] >> 43:[ if world.client ] +1163 46:[ ui = ui or require("ui") ] >> 44:[ ui = ui or require "ui" ] +1191 47:[ ui.tween_hit(char, 1, hp_minus) ] >> 45:[ ui.tween_hit(char,1, hp_minus) ] +1143 48:[ end ] >> 43:[ if world.client ] +753 49:[ end ] >> 31:[ for _,i in pairs({7,8}) ] +291 56:[ _class_0.__parent.__init(self, "Tumble", { }) ] >> 15:[ super("Tumble",{}) ] +312 57:[ self.requirements = { ] >> 16:[ @requirements = { ] +334 59:[ "status", ] >> 17:[ {"status", "active"}, ] +343 60:[ "active" ] >> 17:[ {"status", "active"}, ] +312 62:[ } ] >> 16:[ @requirements = { ] +115 87:[ self.text = "High Jump" ] >> 8:[ @text = "High Jump" ] +136 88:[ self.description = "Jump up high. Like REALLY high." ] >> 9:[ @description = "Jump up high. Like REALLY high." ] +186 89:[ self.hits_icon = { ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +200 90:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +202 91:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +204 92:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +206 93:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +208 94:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +210 95:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +212 96:[ 1, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +214 97:[ 1 ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +186 98:[ } ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +218 99:[ self.sprite = "data/kangaroo.png" ] >> 11:[ @sprite = "data/kangaroo.png" ] +249 100:[ self.speed = 3 ] >> 12:[ @speed = 3 ] +261 101:[ self.distance = 1 ] >> 13:[ @distance = 1 ] +1223 107:[ mod.Tumble = Tumble ] >> 47:[ mod.Tumble = Tumble ] +1244 108:[ return mod ] >> 49:[ mod ] diff --git a/debug/a_knifeslip.lua.X b/debug/a_knifeslip.lua.X new file mode 100644 index 0000000..6d99875 --- /dev/null +++ b/debug/a_knifeslip.lua.X @@ -0,0 +1,62 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +54 4:[ local mod = ... ] >> 4:[ mod = ... ] +64 5:[ print("In tubmle, reg is", reg) ] >> 5:[ print("In tubmle, reg is",reg) ] +119 9:[ local _parent_0 = Ability ] >> 7:[ class KnifeSlip extends Ability ] +434 12:[ local room = world.player_party.room ] >> 20:[ room = world.player_party.room ] +467 13:[ local my_pos = char.location ] >> 21:[ my_pos = char.location ] +524 14:[ local char_tbl1, char_tbl2 = nil, nil ] >> 23:[ char_tbl1, char_tbl2 = nil, nil ] +572 15:[ for distance = 1, 8 do ] >> 24:[ for distance = 1, 8 ] +581 16:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 25:[ char_tbl1 = room\at_location(my_pos + distance) ] +632 17:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 26:[ char_tbl2 = room\at_location(my_pos - distance) ] +685 18:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +683 20:[ end ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +558 21:[ end ] >> 24:[ for distance = 1, 8 ] +793 24:[ print("Doing knifeslip") ] >> 31:[ print("Doing knifeslip") ] +827 25:[ for i = 7, 8 do ] >> 32:[ for i = 7,8 ] +835 26:[ local chars_at_loc = world.room.data.locations[i] ] >> 33:[ chars_at_loc = world.room.data.locations[i] ] +882 27:[ print("chars at loc:", chars_at_loc) ] >> 34:[ print("chars at loc:",chars_at_loc) ] +923 28:[ if world.server then ] >> 35:[ if world.server ] +941 29:[ local a_chars_at_loc = { } ] >> 36:[ a_chars_at_loc = {} ] +975 30:[ for _, v in ipairs(chars_at_loc) do ] >> 37:[ for _,v in ipairs(chars_at_loc) ] +1002 31:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 38:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +965 32:[ end ] >> 37:[ for _,v in ipairs(chars_at_loc) ] +1069 33:[ chars_at_loc = a_chars_at_loc ] >> 39:[ chars_at_loc = a_chars_at_loc ] +921 34:[ end ] >> 35:[ if world.server ] +1102 35:[ local hp_minus ] >> 40:[ hp_minus = () -> ] +1102 36:[ hp_minus = function() ] >> 40:[ hp_minus = () -> ] +1137 37:[ for _, char in pairs(chars_at_loc) do ] >> 41:[ for _, char in pairs(chars_at_loc) ] +1163 38:[ char:set_field("hp", char.data.hp - 2) ] >> 42:[ char\set_field("hp",char.data.hp - 2) ] +1123 39:[ end ] >> 41:[ for _, char in pairs(chars_at_loc) ] +1102 40:[ end ] >> 40:[ hp_minus = () -> ] +1206 41:[ if world.server then ] >> 43:[ if world.server ] +1224 42:[ hp_minus() ] >> 44:[ hp_minus! ] +1204 43:[ end ] >> 43:[ if world.server ] +1239 44:[ if world.client then ] >> 45:[ if world.client ] +1257 45:[ local ui = ui or require("ui") ] >> 46:[ ui = ui or require "ui" ] +1285 46:[ ui.tween_hit(char, i - 4, hp_minus) ] >> 47:[ ui.tween_hit(char,i-4, hp_minus) ] +1237 47:[ end ] >> 45:[ if world.client ] +820 48:[ end ] >> 32:[ for i = 7,8 ] +328 55:[ _class_0.__parent.__init(self, "KnifeSlip", { }) ] >> 15:[ super("KnifeSlip",{}) ] +352 56:[ self.requirements = { ] >> 16:[ @requirements = { ] +374 58:[ "status", ] >> 17:[ {"status", "active"}, ] +383 59:[ "active" ] >> 17:[ {"status", "active"}, ] +352 61:[ } ] >> 16:[ @requirements = { ] +129 86:[ self.text = "Juggle Knives" ] >> 8:[ @text = "Juggle Knives" ] +154 87:[ self.description = "Juggle some knives for\nthe people in the back" ] >> 9:[ @description = "Juggle some knives for\nthe people in the back" ] +219 88:[ self.hits_icon = { ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +233 89:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +235 90:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +237 91:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +239 92:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +241 93:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +243 94:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +245 95:[ 1, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +247 96:[ 1 ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +219 97:[ } ] >> 10:[ @hits_icon = {0,0,0,0,0,0,1,1} ] +251 98:[ self.sprite = "data/thrown-knife.png" ] >> 11:[ @sprite = "data/thrown-knife.png" ] +286 99:[ self.speed = 4 ] >> 12:[ @speed = 4 ] +298 100:[ self.distance = 1 ] >> 13:[ @distance = 1 ] +1319 106:[ mod.Tumble = Tumble ] >> 49:[ mod.Tumble = Tumble ] +1340 107:[ return mod ] >> 51:[ mod ] diff --git a/debug/a_mope.lua.X b/debug/a_mope.lua.X new file mode 100644 index 0000000..b17248c --- /dev/null +++ b/debug/a_mope.lua.X @@ -0,0 +1,56 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +72 7:[ local _parent_0 = Ability ] >> 4:[ class Mope extends Ability ] +345 10:[ local room = world.player_party.room ] >> 18:[ room = world.player_party.room ] +378 11:[ local enemy_party = room.parties[1] ] >> 19:[ enemy_party = room.parties[1] ] +412 12:[ if enemy_party == party then ] >> 20:[ if enemy_party == party ] +437 13:[ enemy_party = room.parties[2] ] >> 21:[ enemy_party = room.parties[2] ] +410 14:[ end ] >> 20:[ if enemy_party == party ] +498 17:[ local chars_at_loc = world.room.data.locations[4] ] >> 23:[ chars_at_loc = world.room.data.locations[4] ] +546 18:[ if world.server then ] >> 24:[ if world.server ] +563 19:[ local a_chars_at_loc = { } ] >> 25:[ a_chars_at_loc = {} ] +596 20:[ for _, v in ipairs(chars_at_loc) do ] >> 26:[ for _,v in ipairs(chars_at_loc) ] +622 21:[ table.insert(a_chars_at_loc, world.player_party:member(v.uname)) ] >> 27:[ table.insert(a_chars_at_loc,world.player_party\member(v.uname)) ] +586 22:[ end ] >> 26:[ for _,v in ipairs(chars_at_loc) ] +689 23:[ chars_at_loc = a_chars_at_loc ] >> 28:[ chars_at_loc = a_chars_at_loc ] +544 24:[ end ] >> 24:[ if world.server ] +721 25:[ local hp_minus ] >> 29:[ hp_minus = () -> ] +721 26:[ hp_minus = function() ] >> 29:[ hp_minus = () -> ] +755 27:[ for _, char in pairs(chars_at_loc) do ] >> 30:[ for _, char in pairs(chars_at_loc) ] +780 28:[ char:set_field("hp", char.data.hp - 2) ] >> 31:[ char\set_field("hp",char.data.hp - 2) ] +741 29:[ end ] >> 30:[ for _, char in pairs(chars_at_loc) ] +721 30:[ end ] >> 29:[ hp_minus = () -> ] +822 31:[ if world.server then ] >> 32:[ if world.server ] +839 32:[ hp_minus() ] >> 33:[ hp_minus! ] +820 33:[ end ] >> 32:[ if world.server ] +853 34:[ if world.client then ] >> 34:[ if world.client ] +870 35:[ local ui = ui or require("ui") ] >> 35:[ ui = ui or require "ui" ] +897 36:[ return ui.tween_hit(char, 1, hp_minus) ] >> 36:[ ui.tween_hit(char,1, hp_minus) ] +851 37:[ end ] >> 34:[ if world.client ] +942 40:[ return print("TODO!") ] >> 38:[ print("TODO!") ] +974 43:[ return print("TODO!") ] >> 41:[ print("TODO!") ] +195 50:[ _class_0.__parent.__init(self, ...) ] >> 11:[ super(...) ] +208 51:[ self.requirements = { ] >> 12:[ @requirements = { ] +230 53:[ "consume_stat", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +245 54:[ "stamina", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +256 55:[ 1 ] >> 13:[ {"consume_stat", "stamina", 1}, ] +265 58:[ "status", ] >> 14:[ {"status", "active"}, ] +274 59:[ "active" ] >> 14:[ {"status", "active"}, ] +290 62:[ "distance", ] >> 15:[ {"distance", 1}, ] +301 63:[ 1 ] >> 15:[ {"distance", 1}, ] +208 65:[ } ] >> 12:[ @requirements = { ] +82 90:[ self.text = "Mope" ] >> 5:[ @text = "Mope" ] +98 91:[ self.description = "mope" ] >> 6:[ @description = "mope" ] +121 92:[ self.hits_icon = { ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +135 93:[ 0, ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +137 94:[ 0, ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +139 95:[ 0, ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +141 96:[ 1, ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +143 97:[ 0, ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +145 98:[ 0, ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +147 99:[ 0, ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +149 100:[ 0 ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +121 101:[ } ] >> 7:[ @hits_icon = {0,0,0,1,0,0,0,0} ] +153 102:[ self.speed = 5 ] >> 8:[ @speed = 5 ] +165 103:[ self.distance = 1 ] >> 9:[ @distance = 1 ] diff --git a/debug/a_pass.lua.X b/debug/a_pass.lua.X new file mode 100644 index 0000000..0db16e1 --- /dev/null +++ b/debug/a_pass.lua.X @@ -0,0 +1,31 @@ +Pos Lua >> Moon +2 1:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +49 3:[ Ability = reg.Ability ] >> 3:[ import Ability from reg ] +55 4:[ local mod = ... ] >> 5:[ mod = ... ] +84 8:[ local _parent_0 = Ability ] >> 7:[ class Pass extends Ability ] +306 11:[ return nil ] >> 17:[ nil ] +326 14:[ local main = require("main") ] >> 20:[ main = require "main" ] +350 15:[ local infocard = am.group():tag("infocard") ] >> 21:[ infocard = am.group!\tag("infocard") ] +389 16:[ return main.root("screen"):append(infocard) ] >> 22:[ main.root("screen")\append(infocard) ] +444 19:[ local main = require("main") ] >> 25:[ main = require "main" ] +468 20:[ local infocard = main.root("infocard") ] >> 26:[ infocard = main.root("infocard") ] +503 21:[ return main.root("screen"):remove(infocard) ] >> 27:[ main.root("screen")\remove(infocard) ] +572 24:[ return print("Pass used") ] >> 30:[ print("Pass used") ] +233 31:[ _class_0.__parent.__init(self, "Pass", { }) ] >> 14:[ super("Pass",{}) ] +252 32:[ self.requirements = { } ] >> 15:[ @requirements = {} ] +94 57:[ self.text = "Pass" ] >> 8:[ @text = "Pass" ] +110 58:[ self.description = "Do nothing..." ] >> 9:[ @description = "Do nothing..." ] +142 59:[ self.hits_icon = { ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +156 60:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +158 61:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +160 62:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +162 63:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +164 64:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +166 65:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +168 66:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +170 67:[ 0 ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +142 68:[ } ] >> 10:[ @hits_icon = {0,0,0,0,0,0,0,0} ] +174 69:[ self.speed = 0 ] >> 11:[ @speed = 0 ] +186 70:[ self.sprite = "data/no_action.png" ] >> 12:[ @sprite = "data/no_action.png" ] +592 76:[ mod.Pass = Pass ] >> 32:[ mod.Pass = Pass ] +609 77:[ return mod ] >> 34:[ mod ] diff --git a/debug/a_physique.lua.X b/debug/a_physique.lua.X new file mode 100644 index 0000000..72ceedd --- /dev/null +++ b/debug/a_physique.lua.X @@ -0,0 +1,58 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +29 2:[ local ui = require("ui") ] >> 2:[ ui = require "ui" ] +66 4:[ Ability = reg.Ability ] >> 3:[ import Ability from reg ] +72 5:[ local mod = ... ] >> 5:[ mod = ... ] +105 9:[ local _parent_0 = Ability ] >> 7:[ class Physique extends Ability ] +381 12:[ local room = world.player_party.room ] >> 20:[ room = world.player_party.room ] +414 13:[ local my_pos = char.location ] >> 21:[ my_pos = char.location ] +471 14:[ local char_tbl1, char_tbl2 = nil, nil ] >> 23:[ char_tbl1, char_tbl2 = nil, nil ] +519 15:[ for distance = 1, 8 do ] >> 24:[ for distance = 1, 8 ] +528 16:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 25:[ char_tbl1 = room\at_location(my_pos + distance) ] +579 17:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 26:[ char_tbl2 = room\at_location(my_pos - distance) ] +632 18:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +630 20:[ end ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +505 21:[ end ] >> 24:[ for distance = 1, 8 ] +740 24:[ local chars_at_loc = world.room.data.locations[6] ] >> 31:[ chars_at_loc = world.room.data.locations[6] ] +788 25:[ if world.server then ] >> 32:[ if world.server ] +805 26:[ local a_chars_at_loc = { } ] >> 33:[ a_chars_at_loc = {} ] +838 27:[ for _, v in ipairs(chars_at_loc) do ] >> 34:[ for _,v in ipairs(chars_at_loc) ] +864 28:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 35:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +828 29:[ end ] >> 34:[ for _,v in ipairs(chars_at_loc) ] +930 30:[ chars_at_loc = a_chars_at_loc ] >> 36:[ chars_at_loc = a_chars_at_loc ] +786 31:[ end ] >> 32:[ if world.server ] +962 32:[ local hp_minus ] >> 37:[ hp_minus = () -> ] +962 33:[ hp_minus = function() ] >> 37:[ hp_minus = () -> ] +996 34:[ for _, char in pairs(chars_at_loc) do ] >> 38:[ for _, char in pairs(chars_at_loc) ] +1021 35:[ char:set_field("hp", char.data.hp - 2) ] >> 39:[ char\set_field("hp",char.data.hp - 2) ] +982 36:[ end ] >> 38:[ for _, char in pairs(chars_at_loc) ] +962 37:[ end ] >> 37:[ hp_minus = () -> ] +1063 38:[ if world.server then ] >> 40:[ if world.server ] +1080 39:[ hp_minus() ] >> 41:[ hp_minus! ] +1061 40:[ end ] >> 40:[ if world.server ] +1094 41:[ if world.client then ] >> 42:[ if world.client ] +1111 42:[ ui = ui or require("ui") ] >> 43:[ ui = ui or require "ui" ] +1138 43:[ return ui.tween_hit(char, 2, hp_minus) ] >> 44:[ ui.tween_hit(char,2, hp_minus) ] +1092 44:[ end ] >> 42:[ if world.client ] +276 51:[ _class_0.__parent.__init(self, "Physique", { }) ] >> 15:[ super("Physique",{}) ] +299 52:[ self.requirements = { ] >> 16:[ @requirements = { ] +321 54:[ "status", ] >> 17:[ {"status", "active"}, ] +330 55:[ "active" ] >> 17:[ {"status", "active"}, ] +299 57:[ } ] >> 16:[ @requirements = { ] +115 82:[ self.text = "Physique" ] >> 8:[ @text = "Physique" ] +135 83:[ self.description = "Big ol' muscles" ] >> 9:[ @description = "Big ol' muscles" ] +169 84:[ self.hits_icon = { ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +183 85:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +185 86:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +187 87:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +189 88:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +191 89:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +193 90:[ 1, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +195 91:[ 0, ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +197 92:[ 0 ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +169 93:[ } ] >> 10:[ @hits_icon = {0,0,0,0,0,1,0,0} ] +201 94:[ self.sprite = "data/strong-man.png" ] >> 11:[ @sprite = "data/strong-man.png" ] +234 95:[ self.speed = 3 ] >> 12:[ @speed = 3 ] +246 96:[ self.distance = 1 ] >> 13:[ @distance = 1 ] +1170 102:[ mod.Tumble = Tumble ] >> 46:[ mod.Tumble = Tumble ] +1191 103:[ return mod ] >> 48:[ mod ] diff --git a/debug/a_rat_bite.lua.X b/debug/a_rat_bite.lua.X new file mode 100644 index 0000000..af0bb55 --- /dev/null +++ b/debug/a_rat_bite.lua.X @@ -0,0 +1,57 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +75 7:[ local _parent_0 = Ability ] >> 4:[ class RatBite extends Ability ] +360 10:[ local room = world.player_party.room ] >> 18:[ room = world.player_party.room ] +393 11:[ local enemy_party = room.parties[1] ] >> 19:[ enemy_party = room.parties[1] ] +427 12:[ if enemy_party == party then ] >> 20:[ if enemy_party == party ] +452 13:[ enemy_party = room.parties[2] ] >> 21:[ enemy_party = room.parties[2] ] +425 14:[ end ] >> 20:[ if enemy_party == party ] +513 17:[ local chars_at_loc = world.room.data.locations[4] ] >> 23:[ chars_at_loc = world.room.data.locations[4] ] +561 18:[ if world.server then ] >> 24:[ if world.server ] +578 19:[ local a_chars_at_loc = { } ] >> 25:[ a_chars_at_loc = {} ] +611 20:[ for _, v in ipairs(chars_at_loc) do ] >> 26:[ for _,v in ipairs(chars_at_loc) ] +637 21:[ table.insert(a_chars_at_loc, world.player_party:member(v.uname)) ] >> 27:[ table.insert(a_chars_at_loc,world.player_party\member(v.uname)) ] +601 22:[ end ] >> 26:[ for _,v in ipairs(chars_at_loc) ] +704 23:[ chars_at_loc = a_chars_at_loc ] >> 28:[ chars_at_loc = a_chars_at_loc ] +559 24:[ end ] >> 24:[ if world.server ] +736 25:[ local hp_minus ] >> 29:[ hp_minus = () -> ] +736 26:[ hp_minus = function() ] >> 29:[ hp_minus = () -> ] +770 27:[ for _, char in pairs(chars_at_loc) do ] >> 30:[ for _, char in pairs(chars_at_loc) ] +795 28:[ char:set_field("hp", char.data.hp - 1) ] >> 31:[ char\set_field("hp",char.data.hp - 1) ] +756 29:[ end ] >> 30:[ for _, char in pairs(chars_at_loc) ] +736 30:[ end ] >> 29:[ hp_minus = () -> ] +837 31:[ if world.server then ] >> 32:[ if world.server ] +854 32:[ hp_minus() ] >> 33:[ hp_minus! ] +835 33:[ end ] >> 32:[ if world.server ] +868 34:[ if world.client then ] >> 34:[ if world.client ] +885 35:[ local ui = ui or require("ui") ] >> 35:[ ui = ui or require "ui" ] +912 36:[ ui.tween_hit(char, 1, hp_minus) ] >> 36:[ ui.tween_hit(char,1, hp_minus) ] +866 37:[ end ] >> 34:[ if world.client ] +945 38:[ return print("rat bite done, chars_at_loc:", chars_at_loc) ] >> 37:[ print("rat bite done, chars_at_loc:",chars_at_loc) ] +1010 41:[ return print("TODO!") ] >> 39:[ print("TODO!") ] +1042 44:[ return print("TODO!") ] >> 42:[ print("TODO!") ] +210 51:[ _class_0.__parent.__init(self, ...) ] >> 11:[ super(...) ] +223 52:[ self.requirements = { ] >> 12:[ @requirements = { ] +245 54:[ "consume_stat", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +260 55:[ "stamina", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +271 56:[ 1 ] >> 13:[ {"consume_stat", "stamina", 1}, ] +280 59:[ "status", ] >> 14:[ {"status", "active"}, ] +289 60:[ "active" ] >> 14:[ {"status", "active"}, ] +305 63:[ "distance", ] >> 15:[ {"distance", 1}, ] +316 64:[ 1 ] >> 15:[ {"distance", 1}, ] +223 66:[ } ] >> 12:[ @requirements = { ] +85 91:[ self.text = "Rat Bite" ] >> 5:[ @text = "Rat Bite" ] +105 92:[ self.description = "A rat's bite" ] >> 6:[ @description = "A rat's bite" ] +136 93:[ self.hits_icon = { ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +150 94:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +152 95:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +154 96:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +156 97:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +158 98:[ 1, ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +160 99:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +162 100:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +164 101:[ 0 ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +136 102:[ } ] >> 7:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +168 103:[ self.speed = 3 ] >> 8:[ @speed = 3 ] +180 104:[ self.distance = 1 ] >> 9:[ @distance = 1 ] diff --git a/debug/a_rat_scurry.lua.X b/debug/a_rat_scurry.lua.X new file mode 100644 index 0000000..3e9b68a --- /dev/null +++ b/debug/a_rat_scurry.lua.X @@ -0,0 +1,20 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +77 7:[ local _parent_0 = Ability ] >> 4:[ class RatScurry extends Ability ] +242 10:[ local room = world.player_party.room ] >> 14:[ room = world.player_party.room ] +275 11:[ local enemy_party = room.parties[1] ] >> 15:[ enemy_party = room.parties[1] ] +309 12:[ if enemy_party == party then ] >> 16:[ if enemy_party == party ] +334 13:[ enemy_party = room.parties[2] ] >> 17:[ enemy_party = room.parties[2] ] +307 14:[ end ] >> 16:[ if enemy_party == party ] +395 17:[ return print("Rat scurry used") ] >> 19:[ print("Rat scurry used") ] +436 20:[ return print("TODO!") ] >> 22:[ print("TODO!") ] +468 23:[ return print("TODO!") ] >> 25:[ print("TODO!") ] +147 30:[ _class_0.__parent.__init(self, ...) ] >> 9:[ super(...) ] +160 31:[ self.requirements = { ] >> 10:[ @requirements = { ] +182 33:[ "status", ] >> 11:[ {"status", "active"}, ] +191 34:[ "active" ] >> 11:[ {"status", "active"}, ] +160 36:[ } ] >> 10:[ @requirements = { ] +87 61:[ self.text = "Scurry" ] >> 5:[ @text = "Scurry" ] +105 62:[ self.speed = 5 ] >> 6:[ @speed = 5 ] +117 63:[ self.distance = 1 ] >> 7:[ @distance = 1 ] diff --git a/debug/a_ruminate.lua.X b/debug/a_ruminate.lua.X new file mode 100644 index 0000000..7166706 --- /dev/null +++ b/debug/a_ruminate.lua.X @@ -0,0 +1,38 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +76 7:[ local _parent_0 = Ability ] >> 4:[ class Ruminate extends Ability ] +357 10:[ local room = world.player_party.room ] >> 18:[ room = world.player_party.room ] +390 11:[ local enemy_party = room.parties[1] ] >> 19:[ enemy_party = room.parties[1] ] +424 12:[ if enemy_party == party then ] >> 20:[ if enemy_party == party ] +449 13:[ enemy_party = room.parties[2] ] >> 21:[ enemy_party = room.parties[2] ] +422 14:[ end ] >> 20:[ if enemy_party == party ] +526 17:[ for _, member in pairs(party.members) do ] >> 23:[ for _, member in pairs(party.members) ] +551 18:[ char:set_field("hp", char.data.hp + 1) ] >> 24:[ char\set_field("hp",char.data.hp + 1) ] +510 19:[ end ] >> 23:[ for _, member in pairs(party.members) ] +603 22:[ return print("TODO!") ] >> 26:[ print("TODO!") ] +635 25:[ return print("TODO!") ] >> 29:[ print("TODO!") ] +207 32:[ _class_0.__parent.__init(self, ...) ] >> 11:[ super(...) ] +220 33:[ self.requirements = { ] >> 12:[ @requirements = { ] +242 35:[ "consume_stat", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +257 36:[ "stamina", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +268 37:[ 1 ] >> 13:[ {"consume_stat", "stamina", 1}, ] +277 40:[ "status", ] >> 14:[ {"status", "active"}, ] +286 41:[ "active" ] >> 14:[ {"status", "active"}, ] +302 44:[ "distance", ] >> 15:[ {"distance", 1}, ] +313 45:[ 1 ] >> 15:[ {"distance", 1}, ] +220 47:[ } ] >> 12:[ @requirements = { ] +86 72:[ self.text = "Ruminate" ] >> 5:[ @text = "Ruminate" ] +106 73:[ self.description = "Ruminate" ] >> 6:[ @description = "Ruminate" ] +133 74:[ self.hits_icon = { ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +147 75:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +149 76:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +151 77:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +153 78:[ 0, ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +155 79:[ 1, ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +157 80:[ 1, ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +159 81:[ 1, ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +161 82:[ 1 ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +133 83:[ } ] >> 7:[ @hits_icon = {0,0,0,0,1,1,1,1} ] +165 84:[ self.speed = 5 ] >> 8:[ @speed = 5 ] +177 85:[ self.distance = 1 ] >> 9:[ @distance = 1 ] diff --git a/debug/a_strum.lua.X b/debug/a_strum.lua.X new file mode 100644 index 0000000..9c764af --- /dev/null +++ b/debug/a_strum.lua.X @@ -0,0 +1,41 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +54 4:[ local mod = ... ] >> 4:[ mod = ... ] +64 5:[ print("In tubmle, reg is", reg) ] >> 5:[ print("In tubmle, reg is",reg) ] +115 9:[ local _parent_0 = Ability ] >> 7:[ class Strum extends Ability ] +398 12:[ local room = world.player_party.room ] >> 20:[ room = world.player_party.room ] +431 13:[ local my_pos = char.location ] >> 21:[ my_pos = char.location ] +488 14:[ local char_tbl1, char_tbl2 = nil, nil ] >> 23:[ char_tbl1, char_tbl2 = nil, nil ] +536 15:[ for distance = 1, 8 do ] >> 24:[ for distance = 1, 8 ] +545 16:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 25:[ char_tbl1 = room\at_location(my_pos + distance) ] +596 17:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 26:[ char_tbl2 = room\at_location(my_pos - distance) ] +649 18:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +647 20:[ end ] >> 27:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +522 21:[ end ] >> 24:[ for distance = 1, 8 ] +757 24:[ print("Doing Strum, party was", party) ] >> 31:[ print("Doing Strum, party was", party) ] +814 25:[ for _, member in pairs(party.members) do ] >> 32:[ for _, member in pairs(party.members) ] +839 26:[ member:set_field("hp", member.data.hp + 1) ] >> 33:[ member\set_field("hp",member.data.hp + 1) ] +798 27:[ end ] >> 32:[ for _, member in pairs(party.members) ] +296 34:[ _class_0.__parent.__init(self, "Strum", { }) ] >> 15:[ super("Strum",{}) ] +316 35:[ self.requirements = { ] >> 16:[ @requirements = { ] +338 37:[ "status", ] >> 17:[ {"status", "active"}, ] +347 38:[ "active" ] >> 17:[ {"status", "active"}, ] +316 40:[ } ] >> 16:[ @requirements = { ] +125 65:[ self.text = "Strum" ] >> 8:[ @text = "Strum" ] +142 66:[ self.description = "Strum a cord to heal the troupe!" ] >> 9:[ @description = "Strum a cord to heal the troupe!" ] +193 67:[ self.hits_icon = { ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +207 68:[ 1, ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +209 69:[ 1, ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +211 70:[ 1, ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +213 71:[ 1, ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +215 72:[ 0, ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +217 73:[ 0, ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +219 74:[ 0, ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +221 75:[ 0 ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +193 76:[ } ] >> 10:[ @hits_icon = {1,1,1,1,0,0,0,0} ] +225 77:[ self.sprite = "data/g-clef.png" ] >> 11:[ @sprite = "data/g-clef.png" ] +254 78:[ self.speed = 1 ] >> 12:[ @speed = 1 ] +266 79:[ self.distance = 1 ] >> 13:[ @distance = 1 ] +882 85:[ mod.Tumble = Tumble ] >> 35:[ mod.Tumble = Tumble ] +903 86:[ return mod ] >> 37:[ mod ] diff --git a/debug/a_sulk.lua.X b/debug/a_sulk.lua.X new file mode 100644 index 0000000..c75fcd4 --- /dev/null +++ b/debug/a_sulk.lua.X @@ -0,0 +1,59 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +48 3:[ Ability = reg.Ability ] >> 2:[ import Ability from reg ] +72 7:[ local _parent_0 = Ability ] >> 4:[ class Sulk extends Ability ] +345 10:[ local room = world.player_party.room ] >> 18:[ room = world.player_party.room ] +378 11:[ local enemy_party = room.parties[1] ] >> 19:[ enemy_party = room.parties[1] ] +412 12:[ if enemy_party == party then ] >> 20:[ if enemy_party == party ] +437 13:[ enemy_party = room.parties[2] ] >> 21:[ enemy_party = room.parties[2] ] +410 14:[ end ] >> 20:[ if enemy_party == party ] +505 17:[ for i = 3, 4 do ] >> 23:[ for i = 3,4 ] +513 18:[ local chars_at_loc = world.room.data.locations[i] ] >> 24:[ chars_at_loc = world.room.data.locations[i] ] +562 19:[ if world.server then ] >> 25:[ if world.server ] +580 20:[ local a_chars_at_loc = { } ] >> 26:[ a_chars_at_loc = {} ] +614 21:[ for _, v in ipairs(chars_at_loc) do ] >> 27:[ for _,v in ipairs(chars_at_loc) ] +641 22:[ table.insert(a_chars_at_loc, world.player_party:member(v.uname)) ] >> 28:[ table.insert(a_chars_at_loc,world.player_party\member(v.uname)) ] +604 23:[ end ] >> 27:[ for _,v in ipairs(chars_at_loc) ] +709 24:[ chars_at_loc = a_chars_at_loc ] >> 29:[ chars_at_loc = a_chars_at_loc ] +560 25:[ end ] >> 25:[ if world.server ] +742 26:[ local hp_minus ] >> 30:[ hp_minus = () -> ] +742 27:[ hp_minus = function() ] >> 30:[ hp_minus = () -> ] +777 28:[ for _, char in pairs(chars_at_loc) do ] >> 31:[ for _, char in pairs(chars_at_loc) ] +803 29:[ char:set_field("hp", char.data.hp - 1) ] >> 32:[ char\set_field("hp",char.data.hp - 1) ] +763 30:[ end ] >> 31:[ for _, char in pairs(chars_at_loc) ] +742 31:[ end ] >> 30:[ hp_minus = () -> ] +846 32:[ if world.server then ] >> 33:[ if world.server ] +864 33:[ hp_minus() ] >> 34:[ hp_minus! ] +844 34:[ end ] >> 33:[ if world.server ] +879 35:[ if world.client then ] >> 35:[ if world.client ] +897 36:[ local ui = ui or require("ui") ] >> 36:[ ui = ui or require "ui" ] +925 37:[ ui.tween_hit(char, 8 - i, hp_minus) ] >> 37:[ ui.tween_hit(char,8 - i, hp_minus) ] +877 38:[ end ] >> 35:[ if world.client ] +963 39:[ print("rat bite done, chars_at_loc:", chars_at_loc) ] >> 38:[ print("rat bite done, chars_at_loc:",chars_at_loc) ] +498 40:[ end ] >> 23:[ for i = 3,4 ] +1028 43:[ return print("TODO!") ] >> 40:[ print("TODO!") ] +1060 46:[ return print("TODO!") ] >> 43:[ print("TODO!") ] +195 53:[ _class_0.__parent.__init(self, ...) ] >> 11:[ super(...) ] +208 54:[ self.requirements = { ] >> 12:[ @requirements = { ] +230 56:[ "consume_stat", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +245 57:[ "stamina", ] >> 13:[ {"consume_stat", "stamina", 1}, ] +256 58:[ 1 ] >> 13:[ {"consume_stat", "stamina", 1}, ] +265 61:[ "status", ] >> 14:[ {"status", "active"}, ] +274 62:[ "active" ] >> 14:[ {"status", "active"}, ] +290 65:[ "distance", ] >> 15:[ {"distance", 1}, ] +301 66:[ 1 ] >> 15:[ {"distance", 1}, ] +208 68:[ } ] >> 12:[ @requirements = { ] +82 93:[ self.text = "Sulk" ] >> 5:[ @text = "Sulk" ] +98 94:[ self.description = "sulk" ] >> 6:[ @description = "sulk" ] +121 95:[ self.hits_icon = { ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +135 96:[ 0, ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +137 97:[ 0, ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +139 98:[ 1, ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +141 99:[ 1, ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +143 100:[ 0, ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +145 101:[ 0, ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +147 102:[ 0, ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +149 103:[ 0 ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +121 104:[ } ] >> 7:[ @hits_icon = {0,0,1,1,0,0,0,0} ] +153 105:[ self.speed = 3 ] >> 8:[ @speed = 3 ] +165 106:[ self.distance = 1 ] >> 9:[ @distance = 1 ] diff --git a/debug/a_test.lua.X b/debug/a_test.lua.X new file mode 100644 index 0000000..c6d5eb7 --- /dev/null +++ b/debug/a_test.lua.X @@ -0,0 +1,63 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +29 2:[ local ui = require("ui") ] >> 2:[ ui = require "ui" ] +66 4:[ Ability = reg.Ability ] >> 3:[ import Ability from reg ] +72 5:[ local mod = ... ] >> 5:[ mod = ... ] +82 6:[ print("In tubmle, reg is", reg) ] >> 6:[ print("In tubmle, reg is",reg) ] +138 10:[ local _parent_0 = Ability ] >> 8:[ class Everything extends Ability ] +417 13:[ local room = world.player_party.room ] >> 21:[ room = world.player_party.room ] +450 14:[ local my_pos = char.location ] >> 22:[ my_pos = char.location ] +507 15:[ local char_tbl1, char_tbl2 = nil, nil ] >> 24:[ char_tbl1, char_tbl2 = nil, nil ] +555 16:[ for distance = 1, 8 do ] >> 25:[ for distance = 1, 8 ] +564 17:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 26:[ char_tbl1 = room\at_location(my_pos + distance) ] +615 18:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 27:[ char_tbl2 = room\at_location(my_pos - distance) ] +668 19:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 28:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +666 21:[ end ] >> 28:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +541 22:[ end ] >> 25:[ for distance = 1, 8 ] +783 25:[ for i = 5, 8 do ] >> 32:[ for i = 5,8 ] +791 26:[ print("Doing tumble") ] >> 33:[ print("Doing tumble") ] +816 27:[ local chars_at_loc = world.room.data.locations[i] ] >> 34:[ chars_at_loc = world.room.data.locations[i] ] +863 28:[ print("chars at loc:", chars_at_loc) ] >> 35:[ print("chars at loc:",chars_at_loc) ] +904 29:[ if world.server then ] >> 36:[ if world.server ] +922 30:[ local a_chars_at_loc = { } ] >> 37:[ a_chars_at_loc = {} ] +956 31:[ for _, v in ipairs(chars_at_loc) do ] >> 38:[ for _,v in ipairs(chars_at_loc) ] +983 32:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 39:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +946 33:[ end ] >> 38:[ for _,v in ipairs(chars_at_loc) ] +1050 34:[ chars_at_loc = a_chars_at_loc ] >> 40:[ chars_at_loc = a_chars_at_loc ] +902 35:[ end ] >> 36:[ if world.server ] +1083 36:[ local hp_minus ] >> 41:[ hp_minus = () -> ] +1083 37:[ hp_minus = function() ] >> 41:[ hp_minus = () -> ] +1118 38:[ for _, char in pairs(chars_at_loc) do ] >> 42:[ for _, char in pairs(chars_at_loc) ] +1144 39:[ char:set_field("hp", char.data.hp - 10) ] >> 43:[ char\set_field("hp",char.data.hp - 10) ] +1104 40:[ end ] >> 42:[ for _, char in pairs(chars_at_loc) ] +1083 41:[ end ] >> 41:[ hp_minus = () -> ] +1188 42:[ if world.server then ] >> 44:[ if world.server ] +1206 43:[ hp_minus() ] >> 45:[ hp_minus! ] +1186 44:[ end ] >> 44:[ if world.server ] +1221 45:[ if world.client then ] >> 46:[ if world.client ] +1239 46:[ ui = ui or require("ui") ] >> 47:[ ui = ui or require "ui" ] +1267 47:[ ui.tween_hit(char, i - 4, hp_minus) ] >> 48:[ ui.tween_hit(char,i-4, hp_minus) ] +1219 48:[ end ] >> 46:[ if world.client ] +776 49:[ end ] >> 32:[ for i = 5,8 ] +310 56:[ _class_0.__parent.__init(self, "Everything", { }) ] >> 16:[ super("Everything",{}) ] +335 57:[ self.requirements = { ] >> 17:[ @requirements = { ] +357 59:[ "status", ] >> 18:[ {"status", "active"}, ] +366 60:[ "active" ] >> 18:[ {"status", "active"}, ] +335 62:[ } ] >> 17:[ @requirements = { ] +148 87:[ self.text = "Everything" ] >> 9:[ @text = "Everything" ] +170 88:[ self.description = "destroy everything" ] >> 10:[ @description = "destroy everything" ] +207 89:[ self.hits_icon = { ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +221 90:[ 1, ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +223 91:[ 1, ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +225 92:[ 1, ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +227 93:[ 1, ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +229 94:[ 1, ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +231 95:[ 1, ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +233 96:[ 1, ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +235 97:[ 1 ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +207 98:[ } ] >> 11:[ @hits_icon = {1,1,1,1,1,1,1,1} ] +239 99:[ self.sprite = "data/tumble.png" ] >> 12:[ @sprite = "data/tumble.png" ] +268 100:[ self.speed = 5 ] >> 13:[ @speed = 5 ] +280 101:[ self.distance = 1 ] >> 14:[ @distance = 1 ] +1301 107:[ mod.Test = Test ] >> 50:[ mod.Test = Test ] +1318 108:[ return mod ] >> 52:[ mod ] diff --git a/debug/a_tumble.lua.X b/debug/a_tumble.lua.X new file mode 100644 index 0000000..301fc76 --- /dev/null +++ b/debug/a_tumble.lua.X @@ -0,0 +1,61 @@ +Pos Lua >> Moon +1 1:[ local reg = require("ability_reg") ] >> 1:[ reg = require "ability_reg" ] +29 2:[ local ui = require("ui") ] >> 2:[ ui = require "ui" ] +66 4:[ Ability = reg.Ability ] >> 3:[ import Ability from reg ] +72 5:[ local mod = ... ] >> 5:[ mod = ... ] +82 6:[ print("In tubmle, reg is", reg) ] >> 6:[ print("In tubmle, reg is",reg) ] +134 10:[ local _parent_0 = Ability ] >> 8:[ class Tumble extends Ability ] +417 13:[ local room = world.player_party.room ] >> 21:[ room = world.player_party.room ] +450 14:[ local my_pos = char.location ] >> 22:[ my_pos = char.location ] +507 15:[ local char_tbl1, char_tbl2 = nil, nil ] >> 24:[ char_tbl1, char_tbl2 = nil, nil ] +555 16:[ for distance = 1, 8 do ] >> 25:[ for distance = 1, 8 ] +564 17:[ char_tbl1 = room:at_location(my_pos + distance) ] >> 26:[ char_tbl1 = room\at_location(my_pos + distance) ] +615 18:[ char_tbl2 = room:at_location(my_pos - distance) ] >> 27:[ char_tbl2 = room\at_location(my_pos - distance) ] +668 19:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) then ] >> 28:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +666 21:[ end ] >> 28:[ if (char_tbl1 and #char_tbl1 > 0) or (char_tbl2 and #char_tbl2 > 0) ] +541 22:[ end ] >> 25:[ for distance = 1, 8 ] +776 25:[ print("Doing tumble") ] >> 32:[ print("Doing tumble") ] +800 26:[ local chars_at_loc = world.room.data.locations[5] ] >> 33:[ chars_at_loc = world.room.data.locations[5] ] +846 27:[ print("chars at loc:", chars_at_loc) ] >> 34:[ print("chars at loc:",chars_at_loc) ] +886 28:[ if world.server then ] >> 35:[ if world.server ] +903 29:[ local a_chars_at_loc = { } ] >> 36:[ a_chars_at_loc = {} ] +936 30:[ for _, v in ipairs(chars_at_loc) do ] >> 37:[ for _,v in ipairs(chars_at_loc) ] +962 31:[ table.insert(a_chars_at_loc, world.enemy_party:member(v.uname)) ] >> 38:[ table.insert(a_chars_at_loc,world.enemy_party\member(v.uname)) ] +926 32:[ end ] >> 37:[ for _,v in ipairs(chars_at_loc) ] +1028 33:[ chars_at_loc = a_chars_at_loc ] >> 39:[ chars_at_loc = a_chars_at_loc ] +884 34:[ end ] >> 35:[ if world.server ] +1060 35:[ local hp_minus ] >> 40:[ hp_minus = () -> ] +1060 36:[ hp_minus = function() ] >> 40:[ hp_minus = () -> ] +1094 37:[ for _, char in pairs(chars_at_loc) do ] >> 41:[ for _, char in pairs(chars_at_loc) ] +1119 38:[ char:set_field("hp", char.data.hp - 3) ] >> 42:[ char\set_field("hp",char.data.hp - 3) ] +1080 39:[ end ] >> 41:[ for _, char in pairs(chars_at_loc) ] +1060 40:[ end ] >> 40:[ hp_minus = () -> ] +1161 41:[ if world.server then ] >> 43:[ if world.server ] +1178 42:[ hp_minus() ] >> 44:[ hp_minus! ] +1159 43:[ end ] >> 43:[ if world.server ] +1192 44:[ if world.client then ] >> 45:[ if world.client ] +1209 45:[ ui = ui or require("ui") ] >> 46:[ ui = ui or require "ui" ] +1236 46:[ return ui.tween_hit(char, 1, hp_minus) ] >> 47:[ ui.tween_hit(char,1, hp_minus) ] +1190 47:[ end ] >> 45:[ if world.client ] +314 54:[ _class_0.__parent.__init(self, "Tumble", { }) ] >> 16:[ super("Tumble",{}) ] +335 55:[ self.requirements = { ] >> 17:[ @requirements = { ] +357 57:[ "status", ] >> 18:[ {"status", "active"}, ] +366 58:[ "active" ] >> 18:[ {"status", "active"}, ] +335 60:[ } ] >> 17:[ @requirements = { ] +144 85:[ self.text = "Tumble" ] >> 9:[ @text = "Tumble" ] +162 86:[ self.description = "Tumble around for those nearby" ] >> 10:[ @description = "Tumble around for those nearby" ] +211 87:[ self.hits_icon = { ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +225 88:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +227 89:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +229 90:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +231 91:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +233 92:[ 1, ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +235 93:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +237 94:[ 0, ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +239 95:[ 0 ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +211 96:[ } ] >> 11:[ @hits_icon = {0,0,0,0,1,0,0,0} ] +243 97:[ self.sprite = "data/tumble.png" ] >> 12:[ @sprite = "data/tumble.png" ] +272 98:[ self.speed = 5 ] >> 13:[ @speed = 5 ] +284 99:[ self.distance = 1 ] >> 14:[ @distance = 1 ] +1268 105:[ mod.Tumble = Tumble ] >> 49:[ mod.Tumble = Tumble ] +1289 106:[ return mod ] >> 51:[ mod ] diff --git a/debug/ability_reg.lua.X b/debug/ability_reg.lua.X new file mode 100644 index 0000000..1302808 --- /dev/null +++ b/debug/ability_reg.lua.X @@ -0,0 +1,26 @@ +Pos Lua >> Moon +1 1:[ local ui = require("ui") ] >> 1:[ ui = require "ui" ] +19 2:[ local reg = ... ] >> 2:[ reg = ... ] +30 3:[ reg.list = { } ] >> 4:[ reg.list = {} ] +1101 9:[ local main = require("main") ] >> 30:[ main = require "main" ] +1125 10:[ local infocard = am.group():tag("infocard") ] >> 31:[ infocard = am.group!\tag("infocard") ] +1164 11:[ main.root("screen"):append(infocard) ] >> 32:[ main.root("screen")\append(infocard) ] +1203 12:[ return ui.build_infocard(infocard, self.__class) ] >> 33:[ ui.build_infocard(infocard,@@) ] +1252 15:[ local main = require("main") ] >> 36:[ main = require "main" ] +1276 16:[ return main.root:remove("infocard") ] >> 37:[ main.root\remove("infocard") ] +365 22:[ self.sprite = self.__class.sprite ] >> 13:[ @sprite = @@sprite ] +386 23:[ self.name = name or self.__class.__name ] >> 14:[ @name = name or @.__class.__name ] +421 24:[ self.data = data ] >> 15:[ @data = data ] +326 38:[ self.children = { } ] >> 11:[ @children = {} ] +464 40:[ assert(child.use, "abilities must have a .use") ] >> 18:[ assert(child.use, "abilities must have a .use") ] +514 41:[ assert(type(child.use) == "function", "abilities must have a .use() function") ] >> 19:[ assert(type(child.use) == "function", "abilities must have a .use() function") ] +595 42:[ assert(type(child.load) == "function", "abilities must have a .load() that shows their infocard") ] >> 20:[ assert(type(child.load) == "function", "abilities must have a .load() that shows their infocard") ] +695 43:[ assert(type(child.unload) == "function", "abilities must have an .unload() that removes their infocard") ] >> 21:[ assert(type(child.unload) == "function", "abilities must have an .unload() that removes their infocard") ] +802 44:[ assert(child.text, "ability must have text") ] >> 22:[ assert(child.text, "ability must have text") ] +849 45:[ assert(child.description, "ability must have a description") ] >> 23:[ assert(child.description, "ability must have a description") ] +912 46:[ assert(child.hits_icon, "ability must have a hits icon") ] >> 24:[ assert(child.hits_icon, "ability must have a hits icon") ] +971 47:[ assert(child.speed, "ability must have a speed") ] >> 25:[ assert(child.speed, "ability must have a speed") ] +1022 48:[ self.__class.children[child.__name] = child ] >> 26:[ @@.children[child.__name] = child ] +1058 49:[ reg[child.__name] = child ] >> 27:[ reg[child.__name] = child ] +1407 53:[ reg["Ability"] = Ability ] >> 41:[ reg["Ability"] = Ability ] +1433 54:[ return reg ] >> 43:[ return reg ] diff --git a/debug/action.lua.X b/debug/action.lua.X new file mode 100644 index 0000000..778ce1a --- /dev/null +++ b/debug/action.lua.X @@ -0,0 +1,66 @@ +Pos Lua >> Moon +50 1:[ local char = require("char") ] >> 2:[ char = require "char" ] +72 2:[ local mod = ... ] >> 3:[ mod = ... ] +83 3:[ mod.msg = { ] >> 5:[ mod.msg = { ] +96 4:[ "request_class_change", ] >> 6:[ "request_class_change" ,--client to server request ] +148 5:[ "confirm_class_change", ] >> 7:[ "confirm_class_change" ,-- server to client answer ] +200 6:[ "deny_class_change", ] >> 8:[ "deny_class_change" ,-- server to client answer ] +249 7:[ "info_class_change", ] >> 9:[ "info_class_change" ,-- server to client info ] +296 8:[ "player_joined", ] >> 10:[ "player_joined" ,--client to server hello ] +339 9:[ "info_player_joined", ] >> 11:[ "info_player_joined" ,-- server to client info ] +387 10:[ "info_player_dropped", ] >> 12:[ "info_player_dropped" ,-- server to client info ] +436 11:[ "request_campaign_start", ] >> 13:[ "request_campaign_start" , --client to server, start game ] +495 12:[ "info_campaign_start", ] >> 14:[ "info_campaign_start" , --server to client, game is starting ] +557 13:[ "request_player_list", ] >> 15:[ "request_player_list" ,-- client to server request ] +609 14:[ "respond_player_list", ] >> 16:[ "respond_player_list" ,--server to client respond with player list ] +677 15:[ "info_room", ] >> 17:[ "info_room" ,-- server to client notify about room info ] +734 16:[ "info_turnup", ] >> 18:[ "info_turnup", -- sever to client, when is the turn up? ] +791 17:[ "info_enemy_party", ] >> 19:[ "info_enemy_party", --server to client notify about enemy party ] +856 18:[ "set_action", ] >> 20:[ "set_action" ,-- client to server, notify action for next turn ] +920 19:[ "info_timeref", ] >> 21:[ "info_timeref" , --server to client, when the next turn is up ] +983 20:[ "info_actions", ] >> 22:[ "info_actions" ,-- server to client set animations to play ] +1043 21:[ "info_deaths", ] >> 23:[ "info_deaths", -- server to client, deaths that are about to happen ] +1112 22:[ "info_loot", ] >> 24:[ "info_loot" ,--server to client loot for clearing a room ] +1170 23:[ "request_camp_action", ] >> 25:[ "request_camp_action" ,--client to server what action to take at camp ] +1241 24:[ "info_camp", ] >> 26:[ "info_camp" ,--server to client actions taken at camp ] +1296 25:[ "info_defeat" ] >> 27:[ "info_defeat", --server to client, you're done! ] +83 26:[ } ] >> 5:[ mod.msg = { ] +1346 27:[ mod.msg_rev = { } ] >> 29:[ mod.msg_rev = {} ] +1373 28:[ for k, v in pairs(mod.msg) do ] >> 30:[ for k,v in pairs(mod.msg) do ] +1393 29:[ mod.msg_rev[v] = k ] >> 31:[ mod.msg_rev[v] = k ] +1363 30:[ end ] >> 30:[ for k,v in pairs(mod.msg) do ] +1413 31:[ mod.action_reg = { } ] >> 33:[ mod.action_reg = {} ] +1433 32:[ mod.class_counter = 1 ] >> 34:[ mod.class_counter = 1 ] +1456 33:[ mod.request_class_change = function(what) ] >> 36:[ mod.request_class_change = (what) -> ] +1494 34:[ assert(what, "class may not be nil") ] >> 37:[ assert(what, "class may not be nil") ] +1532 35:[ assert(char.class_order_rev[what], "class must be one of " .. tostring(char.class_order)) ] >> 38:[ assert(char.class_order_rev[what], "class must be one of " .. tostring(char.class_order)) ] +1623 36:[ local msg_json = am.to_json({ ] >> 39:[ msg_json = am.to_json({msg:"request_class_change", time:am.current_time(), class:what}) ] +1650 37:[ msg = "request_class_change", ] >> 39:[ msg_json = am.to_json({msg:"request_class_change", time:am.current_time(), class:what}) ] +1679 38:[ time = am.current_time(), ] >> 39:[ msg_json = am.to_json({msg:"request_class_change", time:am.current_time(), class:what}) ] +1704 39:[ class = what ] >> 39:[ msg_json = am.to_json({msg:"request_class_change", time:am.current_time(), class:what}) ] +1623 40:[ }) ] >> 39:[ msg_json = am.to_json({msg:"request_class_change", time:am.current_time(), class:what}) ] +1712 41:[ return am.eval_js(string.format("CLIENT.send(%q);", msg_json)) ] >> 40:[ am.eval_js(string.format("CLIENT.send(%q);",msg_json)) ] +1456 42:[ end ] >> 36:[ mod.request_class_change = (what) -> ] +1768 43:[ mod.start_game = function() ] >> 42:[ mod.start_game = () -> ] +1792 44:[ local msg_json = am.to_json({ ] >> 43:[ msg_json = am.to_json({msg:"request_campaign_start", time:am.current_time()}) ] +1819 45:[ msg = "request_campaign_start", ] >> 43:[ msg_json = am.to_json({msg:"request_campaign_start", time:am.current_time()}) ] +1850 46:[ time = am.current_time() ] >> 43:[ msg_json = am.to_json({msg:"request_campaign_start", time:am.current_time()}) ] +1792 47:[ }) ] >> 43:[ msg_json = am.to_json({msg:"request_campaign_start", time:am.current_time()}) ] +1871 48:[ return am.eval_js(string.format("CLIENT.send(%q);", msg_json)) ] >> 44:[ am.eval_js(string.format("CLIENT.send(%q);",msg_json)) ] +1768 49:[ end ] >> 42:[ mod.start_game = () -> ] +1927 50:[ mod.sync_players = function() ] >> 46:[ mod.sync_players = () -> ] +1953 51:[ local msg_json = am.to_json({ ] >> 47:[ msg_json = am.to_json({msg:"request_player_list", time:am.current_time()}) ] +1980 52:[ msg = "request_player_list", ] >> 47:[ msg_json = am.to_json({msg:"request_player_list", time:am.current_time()}) ] +2008 53:[ time = am.current_time() ] >> 47:[ msg_json = am.to_json({msg:"request_player_list", time:am.current_time()}) ] +1953 54:[ }) ] >> 47:[ msg_json = am.to_json({msg:"request_player_list", time:am.current_time()}) ] +2029 55:[ return am.eval_js(string.format("CLIENT.send(%q);", msg_json)) ] >> 48:[ am.eval_js(string.format("CLIENT.send(%q);",msg_json)) ] +1927 56:[ end ] >> 46:[ mod.sync_players = () -> ] +2085 57:[ mod.set_action = function(name) ] >> 50:[ mod.set_action = (name) -> ] +2113 58:[ local msg_json = am.to_json({ ] >> 51:[ msg_json = am.to_json({ ] +2143 59:[ msg = "set_action", ] >> 52:[ msg: "set_action" ] +2164 60:[ time = am.current_time(), ] >> 53:[ time: am.current_time! ] +2191 61:[ action = name ] >> 54:[ action: name ] +2113 62:[ }) ] >> 51:[ msg_json = am.to_json({ ] +2202 63:[ return am.eval_js(string.format("CLIENT.send(%q);", msg_json)) ] >> 56:[ am.eval_js(string.format("CLIENT.send(%q);",msg_json)) ] +2085 64:[ end ] >> 50:[ mod.set_action = (name) -> ] +2258 65:[ return mod ] >> 58:[ mod ] diff --git a/debug/battle_menu.lua.X b/debug/battle_menu.lua.X new file mode 100644 index 0000000..9df0636 --- /dev/null +++ b/debug/battle_menu.lua.X @@ -0,0 +1,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 ] diff --git a/debug/broadphase.lua.X b/debug/broadphase.lua.X new file mode 100644 index 0000000..0bb6623 --- /dev/null +++ b/debug/broadphase.lua.X @@ -0,0 +1,39 @@ +Pos Lua >> Moon +136 1:[ local mod = ... ] >> 5:[ mod = ... ] +146 2:[ local util = require("util") ] >> 6:[ util = require "util" ] +168 3:[ local bump = require("bump") ] >> 7:[ bump = require "bump" ] +190 4:[ local main = require("main") ] >> 8:[ main = require "main" --for debugging ] +244 6:[ Vec3 = util.Vec3 ] >> 9:[ import Vec3 from util ] +251 7:[ mod.world = bump.newWorld(8) ] >> 11:[ mod.world = bump.newWorld(8) ] +344 8:[ mod.add = function(ref, x, y, width, height) ] >> 13:[ mod.add = (ref,x,y,width,height) -> ] +381 9:[ print("Making phys for ref:", ref) ] >> 14:[ print("Making phys for ref:",ref) ] +578 10:[ local graphic_x = 0 ] >> 18:[ graphic_x = 0--x/4 ] +598 11:[ local graphic_y = 0 ] >> 19:[ graphic_y = 0--y --+ (height / 2) ] +666 12:[ local physx = x ] >> 21:[ physx = x ] +677 13:[ local physy = y ] >> 22:[ physy = y ] +775 14:[ local lx = x ] >> 25:[ lx = x --+ (width / 2) ] +799 15:[ local ly = y ] >> 26:[ ly = y --+ (height / 2) ] +1214 16:[ local positionnode = ref.node ] >> 36:[ positionnode = ref.node ] +1591 17:[ mod.world:add(ref, physx, physy, width, height) ] >> 41:[ mod.world\add(ref,physx,physy,width,height) ] +1687 18:[ print("physics node:", node) ] >> 43:[ print("physics node:",node) ] +1716 19:[ return node ] >> 44:[ node ] +344 20:[ end ] >> 13:[ mod.add = (ref,x,y,width,height) -> ] +1722 21:[ mod.update = function(ref, x, y, newwidth, newheight) ] >> 46:[ mod.update = (ref,x,y,newwidth,newheight) -> ] +1768 22:[ return mod.world:update(ref, x, y, newwidth, newheight) ] >> 47:[ mod.world\update(ref,x,y,newwidth,newheight) ] +1722 23:[ end ] >> 46:[ mod.update = (ref,x,y,newwidth,newheight) -> ] +1814 24:[ mod.move = function(ref, x, y, filter) ] >> 49:[ mod.move = (ref,x,y,filter) -> ] +1846 25:[ return mod.world:move(ref, x, y, filter) ] >> 50:[ mod.world\move(ref,x,y,filter) ] +1814 26:[ end ] >> 49:[ mod.move = (ref,x,y,filter) -> ] +1878 27:[ mod.remove = function(ref) ] >> 52:[ mod.remove = (ref) -> ] +1901 28:[ return mod.world:remove(ref) ] >> 53:[ mod.world\remove(ref) ] +1878 29:[ end ] >> 52:[ mod.remove = (ref) -> ] +1924 30:[ mod.check = function(x, y) ] >> 55:[ mod.check = (x,y) -> ] +1946 31:[ return mod.world:queryPoint(x, y) ] >> 56:[ mod.world\queryPoint(x,y) ] +1924 32:[ end ] >> 55:[ mod.check = (x,y) -> ] +2028 43:[ self.offset = offset ] >> 61:[ @offset = offset ] +2047 44:[ self.size = size ] >> 62:[ @size = size ] +2062 45:[ self.extra = extra ] >> 63:[ @extra = extra ] +2078 60:[ mod.gravity = 0.5 ] >> 65:[ mod.gravity = 0.5 ] +2096 61:[ mod.term_fall_vel = 10 ] >> 66:[ mod.term_fall_vel = 10 ] +2119 62:[ mod.PhysGroup = PhysGroup ] >> 67:[ mod.PhysGroup = PhysGroup ] +2145 63:[ return mod ] >> 68:[ mod ] diff --git a/debug/char.lua.X b/debug/char.lua.X new file mode 100644 index 0000000..bc01108 --- /dev/null +++ b/debug/char.lua.X @@ -0,0 +1,266 @@ +Pos Lua >> Moon +2 1:[ local util = require("util") ] >> 2:[ util = require "util" ] +24 2:[ local broadphase = require("broadphase") ] >> 3:[ broadphase = require "broadphase" ] +58 3:[ local main = require("main") ] >> 4:[ main = require "main" ] +80 4:[ local constrain = require("constrain") ] >> 5:[ constrain = require "constrain" ] +112 5:[ local color = require("color") ] >> 6:[ color = require "color" ] +136 6:[ local room = require("room") ] >> 7:[ room = require "room" ] +179 8:[ LobbyRoom = room.LobbyRoom ] >> 8:[ import LobbyRoom from room ] +185 9:[ local ability_reg = require("ability_reg") ] >> 9:[ ability_reg = require "ability_reg" ] +223 10:[ local mod = ... ] >> 12:[ mod = ... ] +233 11:[ mod.characters = { } ] >> 13:[ mod.characters = {} ] +253 12:[ mod.classes = { } ] >> 14:[ mod.classes = {} ] +270 13:[ require("char_tank") ] >> 15:[ require "char_tank" ] +290 14:[ require("char_mage") ] >> 16:[ require "char_mage" ] +310 15:[ require("char_theif") ] >> 17:[ require "char_theif" ] +331 16:[ require("char_fool") ] >> 18:[ require "char_fool" ] +351 17:[ require("char_jugg") ] >> 19:[ require "char_jugg" ] +371 18:[ mod.class_order = { ] >> 20:[ mod.class_order = { ] +392 19:[ "Tumbler", ] >> 21:[ "Tumbler", ] +404 20:[ "Fire Breather", ] >> 22:[ "Fire Breather", ] +422 21:[ "Juggler", ] >> 23:[ "Juggler", ] +434 22:[ "Troubador", ] >> 24:[ "Troubador", ] +448 23:[ "Juggernaut" ] >> 25:[ "Juggernaut" ] +371 24:[ } ] >> 20:[ mod.class_order = { ] +463 25:[ mod.class_order_rev = { } ] >> 27:[ mod.class_order_rev = {} ] +498 26:[ for k, v in ipairs(mod.class_order) do ] >> 28:[ for k,v in ipairs(mod.class_order) ] +524 27:[ mod.class_order_rev[v] = k ] >> 29:[ mod.class_order_rev[v] = k ] +488 28:[ end ] >> 28:[ for k,v in ipairs(mod.class_order) ] +551 29:[ print("After requireing characters, mod.classes was", mod.classes) ] >> 30:[ print("After requireing characters, mod.classes was",mod.classes) ] +617 30:[ mod.enemies = { } ] >> 31:[ mod.enemies = {} ] +652 31:[ require("e_bethany") ] >> 33:[ require "e_bethany" ] +672 32:[ require("e_ruminating_randy") ] >> 34:[ require "e_ruminating_randy" ] +701 33:[ require("e_mopey_marvin") ] >> 35:[ require "e_mopey_marvin" ] +726 34:[ require("e_sullen_salley") ] >> 36:[ require "e_sullen_salley" ] +752 35:[ require("e_child") ] >> 37:[ require "e_child" ] +770 36:[ print("After requireing rat, mod.enemies was", mod.enemies) ] >> 38:[ print("After requireing rat, mod.enemies was",mod.enemies) ] +928 45:[ key = "<input>" ] >> 42:[ new:(key = "<input>") => ] +945 47:[ self.time = 0 ] >> 43:[ @time = 0 ] +957 48:[ self.key = key ] >> 44:[ @key = key ] +970 49:[ self.value = false ] >> 45:[ @value = false ] +1049 71:[ self.anim = anim ] >> 51:[ @anim = anim ] +1064 72:[ self.interupt = interupt ] >> 52:[ @interupt = interupt ] +1087 73:[ self.mode = mode ] >> 53:[ @mode = mode ] +1133 96:[ action = "<input>" ] >> 56:[ new:(action = "<input>") => ] +1150 98:[ self.time = 0 ] >> 57:[ @time = 0 ] +1162 99:[ self.action = action ] >> 58:[ @action = action ] +1180 114:[ mod.sprite_direction_co = function(self) ] >> 60:[ mod.sprite_direction_co = () => ] +1213 115:[ return function() ] >> 61:[ return () -> ] +1233 116:[ while true do ] >> 62:[ while true ] +1242 117:[ self:stop_anim(self.sprites.right) ] >> 63:[ @stop_anim(@sprites.right) ] +1272 118:[ self:stop_anim(self.sprites.left) ] >> 64:[ @stop_anim(@sprites.left) ] +1301 119:[ self:stop_anim(self.sprites.stop_right) ] >> 65:[ @stop_anim(@sprites.stop_right) ] +1336 120:[ self:stop_anim(self.sprites.stop_left) ] >> 66:[ @stop_anim(@sprites.stop_left) ] +1370 121:[ self:stop_anim(self.sprites.falling_left) ] >> 67:[ @stop_anim(@sprites.falling_left) ] +1407 122:[ self:stop_anim(self.sprites.falling_right) ] >> 68:[ @stop_anim(@sprites.falling_right) ] +1459 123:[ local _list_0 = self.inputs ] >> 69:[ for input in *@inputs ] +1473 126:[ if self.velocity.x > 0.01 then ] >> 70:[ if @velocity.x > 0.01 ] +1498 127:[ self:set_anim(self.sprites.right, 1, "loop") ] >> 71:[ @set_anim(@sprites.right,1,"loop") ] +1554 129:[ elseif self.velocity.x < -0.01 then ] >> 73:[ elseif @velocity.x < -0.01 ] +1580 130:[ self:set_anim(self.sprites.left, 1, "loop") ] >> 74:[ @set_anim(@sprites.left,1,"loop") ] +1628 134:[ coroutine.yield() ] >> 76:[ coroutine.yield! ] +1228 135:[ end ] >> 62:[ while true ] +1213 136:[ end ] >> 61:[ return () -> ] +1180 137:[ end ] >> 60:[ mod.sprite_direction_co = () => ] +1646 138:[ mod.can_die_co = function(self) ] >> 78:[ mod.can_die_co = () => ] +1670 139:[ return function() ] >> 79:[ return () -> ] +1690 140:[ while not self.dead do ] >> 80:[ while not @dead ] +1704 141:[ coroutine.yield() ] >> 81:[ coroutine.yield! ] +1685 142:[ end ] >> 80:[ while not @dead ] +1734 143:[ for k, v in pairs(self.sprites) do ] >> 83:[ for k,v in pairs @sprites ] +1755 144:[ if k ~= "idle" then ] >> 84:[ if k ~= "idle" ] +1772 145:[ self:stop_anim(v) ] >> 85:[ @stop_anim(v) ] +1753 146:[ end ] >> 84:[ if k ~= "idle" ] +1724 147:[ end ] >> 83:[ for k,v in pairs @sprites ] +1790 148:[ if self.sprites.die then ] >> 86:[ if @sprites.die ] +1807 149:[ self:set_anim(self.sprites.die, 5) ] >> 87:[ @set_anim(@sprites.die,5) ] +1788 150:[ end ] >> 86:[ if @sprites.die ] +1835 151:[ return coroutine.yield(true) ] >> 88:[ coroutine.yield(true) ] +1670 152:[ end ] >> 79:[ return () -> ] +1646 153:[ end ] >> 78:[ mod.can_die_co = () => ] +1858 154:[ mod.make_animate = function(c) ] >> 90:[ mod.make_animate = (c) -> ] +1885 155:[ assertf(c.sprites ~= nil, "Tried to animate something that had no .sprites: %q", c.__class.__name) ] >> 91:[ assertf(c.sprites ~= nil, "Tried to animate something that had no .sprites: %q", c.__class.__name) ] +1985 156:[ assertf(c.sprites.idle ~= nil and #c.sprites.idle > 0, "Tried to animate something without a .idle animation: %q", c.__class.__name) ] >> 92:[ assertf(c.sprites.idle ~= nil and #c.sprites.idle > 0, "Tried to animate something without a .idle animation: %q", c.__class.__name) ] +2119 157:[ c.anim_stack = { ] >> 93:[ c.anim_stack = {AnimFrame(c.sprites.idle,0,"loop")} ] +2135 158:[ AnimFrame(c.sprites.idle, 0, "loop") ] >> 93:[ c.anim_stack = {AnimFrame(c.sprites.idle,0,"loop")} ] +2119 159:[ } ] >> 93:[ c.anim_stack = {AnimFrame(c.sprites.idle,0,"loop")} ] +2172 160:[ c.anim = c.sprites.idle ] >> 94:[ c.anim = c.sprites.idle ] +2197 161:[ c.keyframe = 0 ] >> 95:[ c.keyframe = 0 ] +2213 162:[ c.animrate = c.animrate or 1 ] >> 96:[ c.animrate = c.animrate or 1 ] +2243 163:[ c.anim_interupt = 0 ] >> 97:[ c.anim_interupt = 0 ] +2264 164:[ c.set_anim = function(self, tbl, interupt, mode) ] >> 98:[ c.set_anim = (self,tbl,interupt,mode) -> ] +2309 165:[ if type(tbl) ~= "table" then ] >> 99:[ if type(tbl) ~= "table" ] +2334 166:[ error("Tried to set anim to something that was not a table!", 2) ] >> 100:[ error("Tried to set anim to something that was not a table!",2) ] +2307 167:[ end ] >> 99:[ if type(tbl) ~= "table" ] +2402 168:[ if #tbl == 0 then ] >> 101:[ if #tbl == 0 ] +2416 169:[ error("Tried to set anim to an empty table", 2) ] >> 102:[ error("Tried to set anim to an empty table",2) ] +2400 170:[ end ] >> 101:[ if #tbl == 0 ] +2467 171:[ if interupt > self.anim_interupt then ] >> 103:[ if interupt > @anim_interupt ] +2497 172:[ table.insert(self.anim_stack, AnimFrame(tbl, interupt, mode)) ] >> 104:[ table.insert(@anim_stack,AnimFrame(tbl,interupt,mode)) ] +2555 173:[ self.anim = self.anim_stack[#self.anim_stack].anim ] >> 105:[ @anim = @anim_stack[#@anim_stack].anim ] +2597 174:[ self.anim_interupt = interupt ] >> 106:[ @anim_interupt = interupt ] +2465 175:[ end ] >> 103:[ if interupt > @anim_interupt ] +2264 176:[ end ] >> 98:[ c.set_anim = (self,tbl,interupt,mode) -> ] +2625 177:[ c.stop_anim = function(self, tbl, err_if_unable) ] >> 108:[ c.stop_anim = (self,tbl,err_if_unable=false) -> ] +2663 179:[ err_if_unable = false ] >> 108:[ c.stop_anim = (self,tbl,err_if_unable=false) -> ] +2675 181:[ local anim_found = false ] >> 109:[ anim_found = false ] +2706 182:[ for k, v in pairs(self.anim_stack) do ] >> 110:[ for k,v in pairs @anim_stack ] +2730 183:[ if v.anim == tbl then ] >> 111:[ if v.anim == tbl ] +2785 184:[ anim_found = true ] >> 113:[ anim_found = true ] +2807 185:[ table.remove(self.anim_stack, k) ] >> 114:[ table.remove(@anim_stack,k) ] +2728 187:[ end ] >> 111:[ if v.anim == tbl ] +2696 188:[ end ] >> 110:[ for k,v in pairs @anim_stack ] +2849 189:[ if err_if_unable then ] >> 116:[ if err_if_unable ] +2867 190:[ assertf(anim_found, "Could not find animation to remove") ] >> 117:[ assertf(anim_found, "Could not find animation to remove") ] +2847 191:[ end ] >> 116:[ if err_if_unable ] +2927 192:[ self.anim = self.anim_stack[#self.anim_stack].anim ] >> 118:[ @anim = @anim_stack[#@anim_stack].anim ] +2968 193:[ self.anim_interupt = self.anim_stack[#self.anim_stack].interupt ] >> 119:[ @anim_interupt = @anim_stack[#@anim_stack].interupt ] +2625 194:[ end ] >> 108:[ c.stop_anim = (self,tbl,err_if_unable=false) -> ] +3022 195:[ return c.node:action(coroutine.create(function() ] >> 121:[ c.node\action(coroutine.create(() -> ] +3066 196:[ while not c.dead do ] >> 122:[ while not c.dead ] +3081 197:[ c.keyframe = math.floor(am.current_time() * c.animrate) % #c.anim ] >> 123:[ c.keyframe = math.floor(am.current_time()*c.animrate) % #c.anim ] +3148 198:[ local spritename = c.anim[c.keyframe + 1] ] >> 124:[ spritename = c.anim[c.keyframe + 1] ] +3187 199:[ assert(spritename, "Failed to find an appropriate image to draw.") ] >> 125:[ assert(spritename, "Failed to find an appropriate image to draw.") ] +3291 200:[ c.node("sprite").source = spritename ] >> 127:[ c.node("sprite").source = spritename ] +3331 201:[ coroutine.yield() ] >> 128:[ coroutine.yield! ] +3061 202:[ end ] >> 122:[ while not c.dead ] +3366 203:[ local keyframe_0 = am.current_time() ] >> 130:[ keyframe_0 = am.current_time() ] +3404 204:[ while c.keyframe < #c.anim - 1 do ] >> 131:[ while c.keyframe < #c.anim - 1 ] +3433 205:[ c.keyframe = math.floor((am.current_time() - keyframe_0) * c.animrate) ] >> 132:[ c.keyframe = math.floor((am.current_time! - keyframe_0)*c.animrate) ] +3504 206:[ assert(c.anim[c.keyframe + 1], "Failed to find an appropriate image to draw.") ] >> 133:[ assert(c.anim[c.keyframe + 1], "Failed to find an appropriate image to draw.") ] +3586 207:[ c.node("sprite").source = c.anim[c.keyframe + 1] ] >> 134:[ c.node("sprite").source = c.anim[c.keyframe + 1] ] +3638 208:[ coroutine.yield() ] >> 135:[ coroutine.yield! ] +3399 209:[ end ] >> 131:[ while c.keyframe < #c.anim - 1 ] +3657 210:[ c:remove() ] >> 136:[ c\remove() ] +3670 211:[ return coroutine.yield(true) ] >> 137:[ coroutine.yield(true) ] +3022 212:[ end)) ] >> 121:[ c.node\action(coroutine.create(() -> ] +1858 213:[ end ] >> 90:[ mod.make_animate = (c) -> ] +3697 214:[ mod.inherited = { } ] >> 140:[ mod.inherited = {} ] +3716 215:[ local hp_bar_width = 20 ] >> 141:[ hp_bar_width = 20 ] +5899 221:[ return string.format("<%s, %s> at (%d)", self.__class.__name, (self.class and self.class.name or "no class"), (self.data and self.data.position or -1)) ] >> 187:[ return string.format( ] +6264 224:[ for k, v in pairs(self.class) do ] >> 201:[ for k,v in pairs(@class) ] +6284 225:[ if k:match("^default") then ] >> 202:[ if k\match("^default") ] +6309 226:[ local field = k:match("^default_(.*)") ] >> 203:[ field = k\match("^default_(.*)") ] +6348 227:[ if type(v) == "function" then ] >> 204:[ if type(v) == "function" ] +6376 228:[ self.data[field] = v() ] >> 205:[ @data[field] = v! ] +6408 230:[ self.data[field] = v ] >> 207:[ @data[field] = v ] +6282 232:[ end ] >> 202:[ if k\match("^default") ] +6254 233:[ end ] >> 201:[ for k,v in pairs(@class) ] +6457 236:[ assert(self.data[name], "Field must exist to be set") ] >> 210:[ assert(@data[name], "Field must exist to be set") ] +6509 237:[ self.data[name] = value ] >> 211:[ @data[name] = value ] +6531 238:[ print("my data table is:", self.data) ] >> 212:[ print("my data table is:",@data) ] +6568 239:[ if name == "hp" then ] >> 213:[ if name == "hp" ] +6585 240:[ local perc = (self.data.hp / self.data.maxhp) * 20 ] >> 214:[ perc = (@data.hp / @data.maxhp) * 20 ] +6625 241:[ self.node("hp_fill_scale").x = perc ] >> 215:[ @.node("hp_fill_scale").x = perc ] +6566 242:[ end ] >> 213:[ if name == "hp" ] +6679 245:[ print("Serializing char:", self) ] >> 218:[ print("Serializing char:",@) ] +6710 246:[ print("Name:", self.__class.__name) ] >> 219:[ print("Name:", @@__name) ] +6737 247:[ print("uname:", self.uname) ] >> 220:[ print("uname:",@uname) ] +6762 248:[ print("data:", self.data) ] >> 221:[ print("data:",@data) ] +6785 249:[ local data_abilities = { } ] >> 222:[ data_abilities = {} ] +6823 250:[ for i, ability in pairs(self.data.abilities) do ] >> 223:[ for i,ability in pairs(@data.abilities) ] +6850 251:[ data_abilities[i] = ability.__name ] >> 224:[ data_abilities[i] = ability.__name ] +6807 252:[ end ] >> 223:[ for i,ability in pairs(@data.abilities) ] +6887 253:[ local data_copy = table.shallow_copy(self.data) ] >> 225:[ data_copy = table.shallow_copy(@data) ] +6927 254:[ data_copy.abilities = data_abilities ] >> 226:[ data_copy.abilities = data_abilities ] +6966 255:[ print("class.name:", self.class.name) ] >> 227:[ print("class.name:",@class.name) ] +7001 256:[ local ret = am.to_json({ ] >> 228:[ ret = am.to_json({name:@@__name, uname:@uname, data:data_copy, class:@class.name}) ] +7024 257:[ name = self.__class.__name, ] >> 228:[ ret = am.to_json({name:@@__name, uname:@uname, data:data_copy, class:@class.name}) ] +7040 258:[ uname = self.uname, ] >> 228:[ ret = am.to_json({name:@@__name, uname:@uname, data:data_copy, class:@class.name}) ] +7053 259:[ data = data_copy, ] >> 228:[ ret = am.to_json({name:@@__name, uname:@uname, data:data_copy, class:@class.name}) ] +7070 260:[ class = self.class.name ] >> 228:[ ret = am.to_json({name:@@__name, uname:@uname, data:data_copy, class:@class.name}) ] +7001 261:[ }) ] >> 228:[ ret = am.to_json({name:@@__name, uname:@uname, data:data_copy, class:@class.name}) ] +7086 262:[ print("Ret is:", ret) ] >> 229:[ print("Ret is:",ret) ] +7109 263:[ return ret ] >> 230:[ ret ] +7141 266:[ print("Deserializing character") ] >> 233:[ print("Deserializing character") ] +7176 267:[ local tbl = am.parse_json(data) ] >> 234:[ tbl = am.parse_json(data) ] +7206 268:[ if mod.classes[tbl.class] then ] >> 235:[ if mod.classes[tbl.class] ] +7233 269:[ local data_abilities = { } ] >> 236:[ data_abilities = {} ] +7278 270:[ for i, ability_name in pairs(tbl.data.abilities) do ] >> 237:[ for i, ability_name in pairs(tbl.data.abilities) ] +7309 271:[ data_abilities[i] = ability_reg[ability_name] ] >> 238:[ data_abilities[i] = ability_reg[ability_name] ] +7256 272:[ end ] >> 237:[ for i, ability_name in pairs(tbl.data.abilities) ] +7358 273:[ tbl.data.abilities = data_abilities ] >> 239:[ tbl.data.abilities = data_abilities ] +7397 274:[ return mod.inherited[tbl.name](tbl.uname, tbl.data, mod.classes[tbl.class]) ] >> 240:[ return mod.inherited[tbl.name](tbl.uname, tbl.data, mod.classes[tbl.class]) ] +7481 275:[ elseif mod.enemies[tbl.class] then ] >> 241:[ elseif mod.enemies[tbl.class] ] +7508 276:[ local e = mod.Enemy(tbl.data, mod.enemies[tbl.class]) ] >> 242:[ e = mod.Enemy(tbl.data, mod.enemies[tbl.class]) ] +7559 277:[ e.uname = tbl.uname ] >> 243:[ e.uname = tbl.uname ] +7582 278:[ return e ] >> 244:[ return e ] +7616 282:[ return print("draw") ] >> 248:[ print("draw") ] +7647 285:[ return self.node:remove_all() ] >> 250:[ @node\remove_all! ] +7679 288:[ self.dead = true ] >> 252:[ @dead = true ] +7694 289:[ print(self, "is dieing, node is", self.node, "and color is", color) ] >> 253:[ print(@,"is dieing, node is",@.node,"and color is",color) ] +7754 290:[ self.node("char_sprite"):append(am.line(vec2(-10, -10), vec2(10, 10), 5, color.bright)) ] >> 254:[ @.node("char_sprite")\append(am.line(vec2(-10,-10),vec2(10,10),5,color.bright)) ] +7836 291:[ return self.node("char_sprite"):append(am.line(vec2(10, -10), vec2(-10, 10), 5, color.bright)) ] >> 255:[ @.node("char_sprite")\append(am.line(vec2(10,-10),vec2(-10,10),5,color.bright)) ] +7941 294:[ self.room = room ] >> 257:[ @room = room ] +7956 295:[ print("Character", self, "entered room", room) ] >> 258:[ print("Character",@,"entered room",room) ] +7999 296:[ self.node("char_translate").y = room.floor_y ] >> 259:[ @.node("char_translate").y = room.floor_y ] +8045 297:[ if room.__class == LobbyRoom then ] >> 260:[ if room.__class == LobbyRoom ] +8075 298:[ print("Class was lobbyRoom") ] >> 261:[ print("Class was lobbyRoom") ] +8107 299:[ local rng_x = math.random(-(main.width / 2), (main.width / 2)) ] >> 262:[ rng_x = math.random(-(main.width/2), (main.width/2)) ] +8163 300:[ print("RNG x:", rng_x) ] >> 263:[ print("RNG x:",rng_x) ] +8188 301:[ self.node("char_translate").x = rng_x ] >> 264:[ @.node("char_translate").x = rng_x ] +8233 303:[ print("Class was not LobbyRoom") ] >> 266:[ print("Class was not LobbyRoom") ] +8269 304:[ local x_pos = self.room:player_location_of(self.data.position) ] >> 267:[ x_pos = @room\player_location_of(@data.position) ] +8321 305:[ print("Got x pos for", self, x_pos) ] >> 268:[ print("Got x pos for",@,x_pos) ] +8355 306:[ self.node("char_translate").x = x_pos + math.random(-15, 15) ] >> 269:[ @.node("char_translate").x = x_pos + math.random(-15,15) --some random variance to stop stacking ] +8480 310:[ assert(newclass, "Cannot set a class to nil") ] >> 271:[ assert(newclass, "Cannot set a class to nil") ] +8528 311:[ self.class = newclass ] >> 272:[ @class = newclass ] +8548 312:[ self:calc_class_values() ] >> 273:[ @calc_class_values! ] +8570 313:[ self.node("char_sprite").source = newclass.sprite ] >> 274:[ @.node("char_sprite").source = newclass.sprite ] +8645 316:[ self.data.position = pos ] >> 277:[ @data.position = pos ] +8694 319:[ self.data.location = loc ] >> 280:[ @data.location = loc ] +3916 325:[ assert(charclass, "Charclass may not be nil") ] >> 147:[ assert(charclass, "Charclass may not be nil") ] +3964 326:[ self.uname = uname or false ] >> 148:[ @uname = uname or false ] +3990 327:[ self.data = data or { ] >> 149:[ @data = data or { ] +4018 328:[ status = "active", ] >> 150:[ status: "active", ] +4041 329:[ location = -1, ] >> 151:[ location: -1, ] +4058 330:[ position = charclass.default_position ] >> 152:[ position: charclass.default_position ] +3990 331:[ } ] >> 149:[ @data = data or { ] +4092 332:[ self.class = charclass ] >> 154:[ @class = charclass ] +4113 333:[ assert(self.class.name, "Character classes must have a name") ] >> 155:[ assert(@class.name, "Character classes must have a name") ] +4173 334:[ self:calc_class_values() ] >> 156:[ @calc_class_values! ] +4195 335:[ self.node = am.group() ] >> 157:[ @node = am.group! ] +4270 336:[ self.node:append(am.translate(0, 0):tag("char_translate") ^ am.sprite(self.class.sprite, color.white, "center", "bottom"):tag("char_sprite")) ] >> 160:[ @node\append(am.translate(0,0)\tag("char_translate")^ am.sprite(@class.sprite,color.white,"center","bottom")\tag("char_sprite")) ] +4401 337:[ print("A character has been created!") ] >> 161:[ print("A character has been created!") ] +4442 338:[ print(debug.traceback()) ] >> 162:[ print(debug.traceback!) ] +4487 339:[ local healthbar_trans = am.translate(0, 60) ] >> 164:[ healthbar_trans = am.translate(0,60) ] +4526 340:[ local healthbar_left = am.sprite("data/bar_left.png", color.white, "left", "center"):tag("hp_l") ] >> 165:[ healthbar_left = am.sprite("data/bar_left.png", color.white,"left","center")\tag("hp_l") ] +4617 341:[ local healthbar_right = am.sprite("data/bar_right.png", color.white, "right", "center"):tag("hp_r") ] >> 166:[ healthbar_right = am.sprite("data/bar_right.png", color.white, "right","center")\tag("hp_r") ] +4712 342:[ local healthbar_bar = am.sprite("data/bar_mid.png", color.white, "left", "center"):tag("hp_b") ] >> 167:[ healthbar_bar = am.sprite("data/bar_mid.png", color.white,"left","center")\tag("hp_b") ] +4801 343:[ local healthbar_fill = am.sprite("data/bar_fill.png", color.white, "left", "center"):tag("hp_f") ] >> 168:[ healthbar_fill = am.sprite("data/bar_fill.png", color.white,"left","center")\tag("hp_f") ] +4892 344:[ local healthbar_scale = am.scale(hp_bar_width, 1) ] >> 169:[ healthbar_scale = am.scale(hp_bar_width,1) ] +4937 345:[ local healthbar_fill_scale = am.scale(hp_bar_width + 1, 1):tag("hp_fill_scale") ] >> 170:[ healthbar_fill_scale = am.scale(hp_bar_width + 1,1)\tag("hp_fill_scale") ] +5012 346:[ healthbar_trans:append(am.translate(-hp_bar_width, 0) ^ healthbar_left) ] >> 171:[ healthbar_trans\append(am.translate(-hp_bar_width,0)^ healthbar_left) ] +5084 347:[ healthbar_trans:append(am.translate(hp_bar_width, 0) ^ healthbar_right) ] >> 172:[ healthbar_trans\append(am.translate(hp_bar_width,0)^ healthbar_right) ] +5156 348:[ healthbar_trans:append(am.translate(-hp_bar_width / 2, 0) ^ healthbar_scale ^ healthbar_bar) ] >> 173:[ healthbar_trans\append(am.translate(-hp_bar_width/2,0)^ healthbar_scale^ healthbar_bar) ] +5246 349:[ healthbar_trans:append(am.translate((-hp_bar_width / 2) - 1, 0) ^ healthbar_fill_scale ^ healthbar_fill) ] >> 174:[ healthbar_trans\append(am.translate((-hp_bar_width/2) - 1,0)^ healthbar_fill_scale^ healthbar_fill) ] +5348 350:[ self.node("char_sprite"):append(healthbar_trans) ] >> 175:[ @.node("char_sprite")\append(healthbar_trans) ] +5419 351:[ assert(self.__class.draw, "Characters must have a draw() method") ] >> 177:[ assert(@.__class.draw,"Characters must have a draw() method") ] +5483 352:[ table.insert(mod.characters, self) ] >> 178:[ table.insert(mod.characters,@) ] +5516 353:[ constrain(self, "set anim", function(self, value) ] >> 179:[ constrain(@,"set anim", (self,value) -> ] +5559 354:[ assertf(type(value) == "table", "Tried to set anim on %q to something other than a table (%q)", self, type(value)) ] >> 180:[ assertf(type(value) == "table", "Tried to set anim on %q to something other than a table (%q)",@, type(value)) ] +5673 355:[ return assert(#value > 0, "Tried to set animation for char to something with 0 frames!") ] >> 181:[ assert(#value > 0, "Tried to set animation for char to something with 0 frames!") ] +5516 356:[ end) ] >> 179:[ constrain(@,"set anim", (self,value) -> ] +5761 357:[ return assert(self.__class ~= Character, "Character class must be subclassed") ] >> 183:[ assert(@.__class != Character,"Character class must be subclassed") ] +3809 371:[ self.classes = { } ] >> 144:[ @classes = {} ] +3824 372:[ self.players = { } ] >> 145:[ @players = {} -- players singleton, [peerid] = Character ] +6074 374:[ assert(c, "Inheritance must exist") ] >> 195:[ assert(c, "Inheritance must exist") ] +6112 375:[ assert(c.__name, "Inherited class must have a .__name") ] >> 196:[ assert(c.__name, "Inherited class must have a .__name") ] +6170 376:[ self.__class.classes[c.__name] = c ] >> 197:[ @@.classes[c.__name] = c ] +6197 377:[ mod.inherited[c.__name] = c ] >> 198:[ mod.inherited[c.__name] = c ] +8716 381:[ mod.enemy_counter = 0 ] >> 282:[ mod.enemy_counter = 0 ] +8757 385:[ local _parent_0 = Character ] >> 283:[ class Enemy extends Character ] +8927 388:[ self(data, eclass) ] >> 288:[ @(data, eclass) ] +8946 389:[ mod.enemy_counter = mod.enemy_counter + 1 ] >> 290:[ mod.enemy_counter += 1 ] +8990 392:[ return string.format("<%s> at (%d)", self.uname, self.data.position or 0) ] >> 292:[ return string.format("<%s> at (%d)",@uname, @data.position or 0) ] +9127 395:[ print("Character", self, "entered room", room) ] >> 295:[ print("Character",@,"entered room",room) ] +9170 396:[ self.room = room ] >> 296:[ @room = room ] +9185 397:[ self.node("char_translate").y = self.room.floor_y ] >> 297:[ @.node("char_translate").y = @room.floor_y ] +9230 398:[ self.node("char_translate").x = self.room:enemy_location_of(self.data.position) ] >> 298:[ @.node("char_translate").x = @room\enemy_location_of(@data.position) ] +9325 401:[ return self.class.select_action(self) ] >> 301:[ return @class.select_action(@) ] +8794 408:[ _class_0.__parent.__init(self, eclass.name .. ":" .. tostring(mod.enemy_counter), data, eclass) ] >> 285:[ super(eclass.name .. ":" .. tostring(mod.enemy_counter), data, eclass) ] +8867 409:[ mod.enemy_counter = mod.enemy_counter + 1 ] >> 286:[ mod.enemy_counter += 1 ] +9357 438:[ mod["Character"] = Character ] >> 303:[ mod["Character"] = Character ] +9386 439:[ mod["KeyInput"] = KeyInput ] >> 304:[ mod["KeyInput"] = KeyInput ] +9413 440:[ mod["Enemy"] = Enemy ] >> 305:[ mod["Enemy"] = Enemy ] +9475 441:[ return mod ] >> 307:[ mod ] diff --git a/debug/char_fool.lua.X b/debug/char_fool.lua.X new file mode 100644 index 0000000..9cbf0ca --- /dev/null +++ b/debug/char_fool.lua.X @@ -0,0 +1,22 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_firebreath") ] >> 3:[ require "a_firebreath" ] +75 4:[ local mod = ... ] >> 5:[ mod = ... ] +86 5:[ mod.char = { ] >> 7:[ mod.char = { ] +105 6:[ name = "Fire Breather", ] >> 8:[ name: "Fire Breather", ] +141 7:[ default_position = 3, ] >> 9:[ default_position: 3, ] +166 9:[ reg.FireBreath ] >> 10:[ default_abilities: {reg.FireBreath}, ] +198 11:[ default_maxhp = 3, ] >> 11:[ default_maxhp: 3, ] +214 12:[ default_hp = 3, ] >> 12:[ default_hp: 3, ] +238 13:[ default_maxstamina = 3, ] >> 13:[ default_maxstamina: 3 ] +258 14:[ default_stamina = 3, ] >> 14:[ default_stamina: 3 ] +278 15:[ default_maxmana = 3, ] >> 15:[ default_maxmana: 3 ] +295 16:[ default_mana = 3, ] >> 16:[ default_mana: 3 ] +306 17:[ sprite = "data/character_4.png" ] >> 17:[ sprite:"data/character_4.png" ] +86 18:[ } ] >> 7:[ mod.char = { ] +341 19:[ for k, v in pairs(mod.char) do ] >> 19:[ for k,v in pairs(mod.char) ] +359 20:[ mod[k] = v ] >> 20:[ mod[k] = v ] +331 21:[ end ] >> 19:[ for k,v in pairs(mod.char) ] +371 22:[ char.classes[mod.char.name] = mod.char ] >> 22:[ char.classes[mod.char.name] = mod.char ] +411 23:[ return mod ] >> 24:[ mod ] diff --git a/debug/char_jugg.lua.X b/debug/char_jugg.lua.X new file mode 100644 index 0000000..edff74e --- /dev/null +++ b/debug/char_jugg.lua.X @@ -0,0 +1,25 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_test") ] >> 3:[ require "a_test" ] +69 4:[ local mod = ... ] >> 5:[ mod = ... ] +80 5:[ mod.char = { ] >> 7:[ mod.char = { ] +99 6:[ name = "Juggernaut", ] >> 8:[ name: "Juggernaut", ] +132 7:[ default_position = 1, ] >> 9:[ default_position:1, ] +159 9:[ reg.Everything ] >> 11:[ reg.Everything ] +193 11:[ default_maxhp = 100, ] >> 13:[ default_maxhp: 100, ] +211 12:[ default_hp = 100, ] >> 14:[ default_hp: 100, ] +237 13:[ default_maxstamina = 3, ] >> 15:[ default_maxstamina: 3, ] +258 14:[ default_stamina = 3, ] >> 16:[ default_stamina: 3, ] +279 15:[ default_maxmana = 1, ] >> 17:[ default_maxmana: 1, ] +297 16:[ default_mana = 1, ] >> 18:[ default_mana: 1, ] +309 17:[ sprite = "data/character_1.png" ] >> 19:[ sprite:"data/character_1.png" ] +80 18:[ } ] >> 7:[ mod.char = { ] +345 19:[ for k, v in pairs(mod.char) do ] >> 22:[ for k,v in pairs(mod.char) ] +363 20:[ mod[k] = v ] >> 23:[ mod[k] = v ] +335 21:[ end ] >> 22:[ for k,v in pairs(mod.char) ] +375 22:[ print("reg:", reg) ] >> 25:[ print("reg:",reg) ] +393 23:[ assert(mod.char.default_abilities[1], "Tumble not found in reg") ] >> 26:[ assert(mod.char.default_abilities[1], "Tumble not found in reg") ] +458 24:[ char.classes[mod.char.name] = mod.char ] >> 27:[ char.classes[mod.char.name] = mod.char ] +497 25:[ print("After adding Tumbler, char.classes is", char.classes) ] >> 28:[ print("After adding Tumbler, char.classes is", char.classes) ] +559 26:[ return mod ] >> 30:[ mod ] diff --git a/debug/char_mage.lua.X b/debug/char_mage.lua.X new file mode 100644 index 0000000..48bceec --- /dev/null +++ b/debug/char_mage.lua.X @@ -0,0 +1,26 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_strum") ] >> 3:[ require "a_strum" ] +69 4:[ require("a_dance") ] >> 4:[ require "a_dance" ] +87 5:[ require("a_drum") ] >> 5:[ require "a_drum" ] +105 6:[ local mod = ... ] >> 7:[ mod = ... ] +116 7:[ mod.char = { ] >> 9:[ mod.char = { ] +135 8:[ name = "Troubador", ] >> 10:[ name: "Troubador", ] +167 9:[ default_position = 3, ] >> 11:[ default_position:3, ] +191 11:[ reg.Strum, ] >> 12:[ default_abilities: {reg.Strum, reg.Dance, reg.Drum}, ] +201 12:[ reg.Dance, ] >> 12:[ default_abilities: {reg.Strum, reg.Dance, reg.Drum}, ] +212 13:[ reg.Drum ] >> 12:[ default_abilities: {reg.Strum, reg.Dance, reg.Drum}, ] +239 15:[ default_maxhp = 2, ] >> 13:[ default_maxhp: 2, ] +255 16:[ default_hp = 2, ] >> 14:[ default_hp: 2, ] +279 17:[ default_maxstamina = 1, ] >> 15:[ default_maxstamina: 1 ] +299 18:[ default_stamina = 1, ] >> 16:[ default_stamina: 1 ] +319 19:[ default_maxmana = 5, ] >> 17:[ default_maxmana: 5 ] +336 20:[ default_mana = 5, ] >> 18:[ default_mana: 5 ] +347 21:[ sprite = "data/character_3.png" ] >> 19:[ sprite:"data/character_3.png" ] +116 22:[ } ] >> 9:[ mod.char = { ] +382 23:[ for k, v in pairs(mod.char) do ] >> 21:[ for k,v in pairs(mod.char) ] +400 24:[ mod[k] = v ] >> 22:[ mod[k] = v ] +372 25:[ end ] >> 21:[ for k,v in pairs(mod.char) ] +412 26:[ char.classes[mod.char.name] = mod.char ] >> 24:[ char.classes[mod.char.name] = mod.char ] +452 27:[ return mod ] >> 26:[ mod ] diff --git a/debug/char_tank.lua.X b/debug/char_tank.lua.X new file mode 100644 index 0000000..4d016df --- /dev/null +++ b/debug/char_tank.lua.X @@ -0,0 +1,29 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_tumble") ] >> 3:[ require "a_tumble" ] +70 4:[ require("a_highjump") ] >> 4:[ require "a_highjump" ] +91 5:[ require("a_physique") ] >> 5:[ require "a_physique" ] +113 6:[ local mod = ... ] >> 7:[ mod = ... ] +124 7:[ mod.char = { ] >> 9:[ mod.char = { ] +143 8:[ name = "Tumbler", ] >> 10:[ name: "Tumbler", ] +173 9:[ default_position = 1, ] >> 11:[ default_position:1, ] +200 11:[ reg.Tumble, ] >> 13:[ reg.Tumble, ] +214 12:[ reg.HighJump, ] >> 14:[ reg.HighJump, ] +230 13:[ reg.Physique ] >> 15:[ reg.Physique ] +262 15:[ default_maxhp = 5, ] >> 17:[ default_maxhp: 5, ] +278 16:[ default_hp = 5, ] >> 18:[ default_hp: 5, ] +302 17:[ default_maxstamina = 3, ] >> 19:[ default_maxstamina: 3, ] +323 18:[ default_stamina = 3, ] >> 20:[ default_stamina: 3, ] +344 19:[ default_maxmana = 1, ] >> 21:[ default_maxmana: 1, ] +362 20:[ default_mana = 1, ] >> 22:[ default_mana: 1, ] +374 21:[ sprite = "data/character_1.png" ] >> 23:[ sprite:"data/character_1.png" ] +124 22:[ } ] >> 9:[ mod.char = { ] +410 23:[ for k, v in pairs(mod.char) do ] >> 26:[ for k,v in pairs(mod.char) ] +428 24:[ mod[k] = v ] >> 27:[ mod[k] = v ] +400 25:[ end ] >> 26:[ for k,v in pairs(mod.char) ] +440 26:[ print("reg:", reg) ] >> 29:[ print("reg:",reg) ] +458 27:[ assert(mod.char.default_abilities[1], "Tumble not found in reg") ] >> 30:[ assert(mod.char.default_abilities[1], "Tumble not found in reg") ] +523 28:[ char.classes[mod.char.name] = mod.char ] >> 31:[ char.classes[mod.char.name] = mod.char ] +562 29:[ print("After adding Tumbler, char.classes is", char.classes) ] >> 32:[ print("After adding Tumbler, char.classes is", char.classes) ] +624 30:[ return mod ] >> 34:[ mod ] diff --git a/debug/char_theif.lua.X b/debug/char_theif.lua.X new file mode 100644 index 0000000..8354a83 --- /dev/null +++ b/debug/char_theif.lua.X @@ -0,0 +1,24 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_knifeslip") ] >> 3:[ require "a_knifeslip" ] +73 4:[ require("a_hackysacks") ] >> 4:[ require "a_hackysacks" ] +97 5:[ local mod = ... ] >> 6:[ mod = ... ] +108 6:[ mod.char = { ] >> 8:[ mod.char = { ] +127 7:[ name = "Juggler", ] >> 9:[ name: "Juggler", ] +157 8:[ default_position = 2, ] >> 10:[ default_position: 2, ] +182 10:[ reg.KnifeSlip, ] >> 11:[ default_abilities: {reg.KnifeSlip, reg.Juggle}, ] +196 11:[ reg.Juggle ] >> 11:[ default_abilities: {reg.KnifeSlip, reg.Juggle}, ] +225 13:[ default_maxhp = 3, ] >> 12:[ default_maxhp: 3, ] +241 14:[ default_hp = 3, ] >> 13:[ default_hp: 3, ] +265 15:[ default_maxstamina = 5, ] >> 14:[ default_maxstamina: 5 ] +285 16:[ default_stamina = 5, ] >> 15:[ default_stamina: 5 ] +305 17:[ default_maxmana = 1, ] >> 16:[ default_maxmana: 1 ] +322 18:[ default_mana = 1, ] >> 17:[ default_mana: 1 ] +333 19:[ sprite = "data/character_2.png" ] >> 18:[ sprite:"data/character_2.png" ] +108 20:[ } ] >> 8:[ mod.char = { ] +368 21:[ for k, v in pairs(mod.char) do ] >> 20:[ for k,v in pairs(mod.char) ] +386 22:[ mod[k] = v ] >> 21:[ mod[k] = v ] +358 23:[ end ] >> 20:[ for k,v in pairs(mod.char) ] +398 24:[ char.classes[mod.char.name] = mod.char ] >> 23:[ char.classes[mod.char.name] = mod.char ] +438 25:[ return mod ] >> 25:[ mod ] diff --git a/debug/color.lua.X b/debug/color.lua.X new file mode 100644 index 0000000..f5b6be1 --- /dev/null +++ b/debug/color.lua.X @@ -0,0 +1,11 @@ +Pos Lua >> Moon +1 1:[ local mod = ... ] >> 1:[ mod = ... ] +12 2:[ mod.fg = vec4(0.983, 0.961, 0.937, 1) ] >> 3:[ mod.fg = vec4(0.983,0.961,0.937,1) ] +47 3:[ mod.bg = vec4(0.153, 0.153, 0.267, 1) ] >> 4:[ mod.bg = vec4(0.153,0.153,0.267,1) ] +82 4:[ mod.highlight = vec4(0.949, 0.827, 0.671, 1) ] >> 5:[ mod.highlight = vec4(0.949,0.827,0.671,1) ] +124 5:[ mod.shadow = vec4(0.286, 0.302, 0.494, 1) ] >> 6:[ mod.shadow = vec4(0.286,0.302,0.494,1) ] +163 6:[ mod.bright = vec4(0.776, 0.624, 0.647, 1) ] >> 7:[ mod.bright = vec4(0.776,0.624,0.647,1) ] +202 7:[ mod.dark = vec4(0.545, 0.427, 0.612, 1) ] >> 8:[ mod.dark = vec4(0.545,0.427,0.612,1) ] +240 8:[ mod.transparent = vec4(0, 0, 0, 0) ] >> 10:[ mod.transparent = vec4(0,0,0,0) ] +272 9:[ mod.white = vec4(1, 1, 1, 1) ] >> 11:[ mod.white = vec4(1,1,1,1) ] +299 10:[ return mod ] >> 13:[ mod ] diff --git a/debug/create_party_menu.lua.X b/debug/create_party_menu.lua.X new file mode 100644 index 0000000..a18039f --- /dev/null +++ b/debug/create_party_menu.lua.X @@ -0,0 +1,114 @@ +Pos Lua >> Moon +1 1:[ local main = require("main") ] >> 1:[ main = require "main" ] +23 2:[ local world = require("world") ] >> 2:[ world = require "world" ] +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 action = require("action") ] >> 6:[ action = require "action" ] +141 7:[ local char = require("char") ] >> 7:[ char = require "char" ] +163 8:[ local player = require("player") ] >> 8:[ player = require "player" ] +189 9:[ local room = require("room") ] >> 9:[ room = require "room" ] +228 11:[ World = world.World ] >> 10:[ import World from world ] +253 13:[ Server = world.Server ] >> 11:[ import Server from world ] +283 15:[ LocalPlayer = player.LocalPlayer ] >> 12:[ import LocalPlayer from player ] +313 17:[ LobbyRoom = room.LobbyRoom ] >> 13:[ import LobbyRoom from room ] +320 18:[ local mod = ... ] >> 15:[ mod = ... ] +331 19:[ mod.node = am.group() ] >> 17:[ mod.node = am.group! ] +352 20:[ mod.node:append(am.translate(0, main.height / 2) ^ am.text("Creating lobby...", color.fg, "center", "top"):tag("join_id")) ] >> 18:[ mod.node\append(am.translate(0,main.height/2)^ am.text("Creating lobby...", color.fg, "center","top")\tag("join_id")) ] +470 21:[ mod.loaded = false ] >> 19:[ mod.loaded = false ] +489 22:[ mod.load = function() ] >> 20:[ mod.load = () -> ] +507 23:[ mod.loaded = true ] >> 21:[ mod.loaded = true ] +526 24:[ print("Loading create party") ] >> 22:[ print("Loading create party") ] +557 25:[ main.root("screen"):append(mod.node) ] >> 23:[ main.root("screen")\append(mod.node) ] +595 26:[ print("About to create server") ] >> 24:[ print("About to create server") ] +628 27:[ main["server"] = Server() ] >> 25:[ main["server"] = Server! ] +654 28:[ print("Created server") ] >> 26:[ print("Created server") ] +679 29:[ mod.node("join_id").text = "Lobby id:" .. main.server.lobby_id ] >> 27:[ mod.node("join_id").text = "Lobby id:" .. main.server.lobby_id ] +743 30:[ print("Set join id text") ] >> 28:[ print("Set join id text") ] +770 31:[ main["world"] = World() ] >> 29:[ main["world"] = World! ] +794 32:[ main.world:set_room(LobbyRoom()) ] >> 30:[ main.world\set_room(LobbyRoom!) ] +827 33:[ print("Created world") ] >> 31:[ print("Created world") ] +851 34:[ main.world:join(main.server.lobby_id) ] >> 32:[ main.world\join(main.server.lobby_id) ] +890 35:[ print("Joined my own lobby") ] >> 33:[ print("Joined my own lobby") ] +920 36:[ local start_button = ui.create_any_button(mod.node, 5, 2, (-32 * 5) / 2, 0) ] >> 34:[ start_button = ui.create_any_button(mod.node,5,2,(-32*5)/2,0) ] +983 37:[ start_button.node("loc"):append(am.scale(1.5) ^ am.translate(12, -10) ^ am.text("GET SILLY", color.fg, "left", "top")) ] >> 35:[ start_button.node("loc")\append(am.scale(1.5)^ am.translate(12,-10)^ am.text("GET SILLY", color.fg, "left", "top")) ] +1100 38:[ local char_selector = ui.create_char_selector2(mod.node) ] >> 36:[ char_selector = ui.create_char_selector2(mod.node) ] +1152 39:[ local char_right, char_left, char_text = char_selector[1], char_selector[2], char_selector[3] ] >> 37:[ char_right, char_left, char_text = char_selector[1], char_selector[2], char_selector[3] ] +1241 40:[ mod.buttons = { ] >> 38:[ mod.buttons = {char_left, char_right, start_button} --save to remove from the physworld later ] +1256 41:[ char_left, ] >> 38:[ mod.buttons = {char_left, char_right, start_button} --save to remove from the physworld later ] +1266 42:[ char_right, ] >> 38:[ mod.buttons = {char_left, char_right, start_button} --save to remove from the physworld later ] +1278 43:[ start_button ] >> 38:[ mod.buttons = {char_left, char_right, start_button} --save to remove from the physworld later ] +1241 44:[ } ] >> 38:[ mod.buttons = {char_left, char_right, start_button} --save to remove from the physworld later ] +1336 45:[ local classes = char.class_order ] >> 39:[ classes = char.class_order ] +1364 46:[ local class_s = 1 ] >> 40:[ class_s = 1 ] +1377 47:[ print("got char selector:", char_selector) ] >> 41:[ print("got char selector:",char_selector) ] +1420 48:[ local touch_indicator = am.group() ] >> 42:[ touch_indicator = am.group! ] +1449 49:[ local touch_cursor = am.sprite("data/cursor.png", vec4(1, 1, 1, 1), "left", "top") ] >> 43:[ touch_cursor = am.sprite("data/cursor.png",vec4(1,1,1,1),"left","top") ] +1521 50:[ local touch_loc = am.translate(0, 0) ^ touch_cursor ] >> 44:[ touch_loc = am.translate(0,0)^ touch_cursor ] +1566 51:[ touch_indicator:append(touch_loc) ] >> 45:[ touch_indicator\append(touch_loc) ] +1667 52:[ start_button.color = color.transparent ] >> 47:[ start_button.color = color.transparent ] +1707 53:[ char_right.color = color.transparent ] >> 48:[ char_right.color = color.transparent ] +1745 54:[ char_left.color = color.transparent ] >> 49:[ char_left.color = color.transparent ] +1782 55:[ mod.node:action("click_interpreter", coroutine.create(function() ] >> 50:[ mod.node\action("click_interpreter",coroutine.create(()-> ] +1847 56:[ while not main.world.client_open() do ] >> 51:[ while not main.world.client_open! ] +1879 57:[ coroutine.yield() ] >> 52:[ coroutine.yield! ] +1842 58:[ end ] >> 51:[ while not main.world.client_open! ] +1898 59:[ char_left.color = color.white ] >> 53:[ char_left.color = color.white ] +1930 60:[ char_right.color = color.white ] >> 54:[ char_right.color = color.white ] +1963 61:[ char_text.text = "Tumbler" ] >> 55:[ char_text.text = "Tumbler" ] +1992 62:[ main.world:set_local(LocalPlayer(am.eval_js("CLIENT.peer._id"), { }, char.classes.Tumbler)) ] >> 56:[ main.world\set_local(LocalPlayer(am.eval_js("CLIENT.peer._id"),{},char.classes.Tumbler)) ] +2083 63:[ main.world:load() ] >> 57:[ main.world\load! ] +2107 64:[ while true do ] >> 58:[ while true ] +2118 65:[ if #main.win:active_touches() > 0 then ] >> 59:[ if #main.win\active_touches! > 0 ] +2154 66:[ local touch = main.win:touch_position(1) ] >> 60:[ touch = main.win\touch_position(1) ] +2193 67:[ touch_cursor.color = vec4(1, 1, 1, 1) ] >> 61:[ touch_cursor.color = vec4(1,1,1,1) ] +2232 68:[ touch_loc.x = touch.x ] >> 62:[ touch_loc.x = touch.x ] +2258 69:[ touch_loc.y = touch.y ] >> 63:[ touch_loc.y = touch.y ] +2284 70:[ local col_but = bp.check(touch.x, touch.y + 64) ] >> 64:[ col_but = bp.check(touch.x, touch.y + 64) ] +2332 71:[ if #col_but > 0 then ] >> 65:[ if #col_but > 0 ] +2351 72:[ touch_cursor.color = vec4(0.5, 0.5, 0.5, 0.5) ] >> 66:[ touch_cursor.color = vec4(0.5,0.5,0.5,0.5) ] +2330 73:[ end ] >> 65:[ if #col_but > 0 ] +2400 74:[ if #col_but > 0 and main.win:touch_began(1) then ] >> 67:[ if #col_but > 0 and main.win\touch_began(1) ] +2449 75:[ if col_but[1] == start_button then ] >> 68:[ if col_but[1] == start_button ] +2483 76:[ print("Starting!") ] >> 69:[ print("Starting!") ] +2508 77:[ action.start_game() ] >> 70:[ action.start_game! ] +2533 78:[ coroutine.yield() ] >> 71:[ coroutine.yield! ] +2447 79:[ end ] >> 68:[ if col_but[1] == start_button ] +2557 80:[ if col_but[1] == char_left then ] >> 72:[ if col_but[1] == char_left ] +2588 81:[ print("char left") ] >> 73:[ print("char left") ] +2613 82:[ class_s = class_s - 1 ] >> 74:[ class_s = class_s - 1 ] +2641 83:[ start_button.color = color.white ] >> 75:[ start_button.color = color.white ] +2682 84:[ if class_s == 0 then ] >> 76:[ if class_s == 0 ] +2703 85:[ class_s = #classes ] >> 77:[ class_s = #classes ] +2680 86:[ end ] >> 76:[ if class_s == 0 ] +2555 87:[ end ] >> 72:[ if col_but[1] == char_left ] +2729 88:[ if col_but[1] == char_right then ] >> 78:[ if col_but[1] == char_right ] +2761 89:[ print("char right") ] >> 79:[ print("char right") ] +2787 90:[ class_s = class_s + 1 ] >> 80:[ class_s = class_s + 1 ] +2815 91:[ start_button.color = color.white ] >> 81:[ start_button.color = color.white ] +2856 92:[ if class_s > #classes then ] >> 82:[ if class_s > #classes ] +2883 93:[ class_s = 1 ] >> 83:[ class_s = 1 ] +2854 94:[ end ] >> 82:[ if class_s > #classes ] +2727 95:[ end ] >> 78:[ if col_but[1] == char_right ] +2902 96:[ if col_but[1] == char_left or col_but[1] == char_right then ] >> 84:[ if col_but[1] == char_left or col_but[1] == char_right ] +2961 97:[ print("class_s", class_s) ] >> 85:[ print("class_s",class_s) ] +2992 98:[ print("classes:", classes) ] >> 86:[ print("classes:", classes) ] +3025 99:[ char_text.text = classes[class_s] ] >> 87:[ char_text.text = classes[class_s] ] +3065 100:[ action.request_class_change(classes[class_s]) ] >> 88:[ action.request_class_change(classes[class_s]) ] +2900 101:[ end ] >> 84:[ if col_but[1] == char_left or col_but[1] == char_right ] +2398 102:[ end ] >> 67:[ if #col_but > 0 and main.win\touch_began(1) ] +3124 104:[ touch_cursor.color = vec4(0, 0, 0, 0) ] >> 91:[ touch_cursor.color = vec4(0,0,0,0) ] +3162 106:[ coroutine.yield() ] >> 92:[ coroutine.yield! ] +2102 107:[ end ] >> 58:[ while true ] +1782 108:[ end)) ] >> 50:[ mod.node\action("click_interpreter",coroutine.create(()-> ] +3184 109:[ return mod.node:append(touch_indicator) ] >> 94:[ mod.node\append(touch_indicator) ] +489 110:[ end ] >> 20:[ mod.load = () -> ] +3218 111:[ mod.unload = function() ] >> 96:[ mod.unload = () -> ] +3238 112:[ print("Unloading create party") ] >> 97:[ print("Unloading create party") ] +3271 113:[ main.root("screen"):remove(mod.node) ] >> 98:[ main.root("screen")\remove(mod.node) ] +3325 114:[ for _, button in pairs(mod.buttons) do ] >> 99:[ for _, button in pairs(mod.buttons) ] +3347 115:[ bp.remove(button) ] >> 100:[ bp.remove(button) ] +3309 116:[ end ] >> 99:[ for _, button in pairs(mod.buttons) ] +3366 117:[ mod.loaded = false ] >> 101:[ mod.loaded = false ] +3218 118:[ end ] >> 96:[ mod.unload = () -> ] +3386 119:[ return mod ] >> 103:[ mod ] diff --git a/debug/defeat_menu.lua.X b/debug/defeat_menu.lua.X new file mode 100644 index 0000000..811be30 --- /dev/null +++ b/debug/defeat_menu.lua.X @@ -0,0 +1,63 @@ +Pos Lua >> Moon +2 1:[ local main = require("main") ] >> 2:[ main = require "main" ] +24 2:[ local bp = require("broadphase") ] >> 3:[ bp = require "broadphase" ] +50 3:[ local color = require("color") ] >> 4:[ color = require "color" ] +74 4:[ local ui = require("ui") ] >> 5:[ ui = require "ui" ] +93 5:[ local world = require("world") ] >> 7:[ world = require "world" --delete when done ] +154 7:[ Server = world.Server ] >> 8:[ import Server from world ] +178 9:[ World = world.World ] >> 9:[ import World from world ] +185 10:[ local mod = ... ] >> 10:[ mod = ... ] +208 11:[ local nwidth = 6 ] >> 13:[ nwidth = 6 ] +219 12:[ local section_width = 32 ] >> 14:[ section_width = 32 ] +238 13:[ local start_x = (-32) * (nwidth / 2) ] >> 15:[ start_x = (-32)*(nwidth/2) ] +265 14:[ mod.node = am.group() ] >> 16:[ mod.node = am.group! ] +286 15:[ mod.node:append(am.sprite("data/defeat_screen.png")) ] >> 17:[ mod.node\append(am.sprite("data/defeat_screen.png")) ] +339 16:[ local start_y = 0 ] >> 18:[ start_y = 0 ] +351 17:[ local padding = 32 ] >> 19:[ padding = 32 ] +364 18:[ local buttonspecs = { ] >> 20:[ buttonspecs = { ] +397 20:[ y_off = start_y, ] >> 22:[ y_off: start_y, ] +414 21:[ text = "Menu" ] >> 23:[ text: "Menu" ] +364 23:[ } ] >> 20:[ buttonspecs = { ] +430 24:[ mod.load = function() ] >> 28:[ mod.load = () -> ] +448 25:[ print("creating main menu") ] >> 29:[ print("creating main menu") ] +477 26:[ main.root("screen"):append(mod.node) ] >> 30:[ main.root("screen")\append(mod.node) ] +538 27:[ for name, button_tbl in pairs(buttonspecs) do ] >> 31:[ for name, button_tbl in pairs buttonspecs ] +559 28:[ local button_extra = ui.create_big_button(mod.node, 6, start_x, button_tbl.y_off) ] >> 32:[ button_extra = ui.create_big_button(mod.node,6,start_x,button_tbl.y_off) ] +634 29:[ button_extra.node:append(am.translate(start_x + ((nwidth * section_width) / 2), button_tbl.y_off - 32) ^ am.text(button_tbl.text, color.fg)) ] >> 33:[ button_extra.node\append(am.translate(start_x+((nwidth*section_width)/2),button_tbl.y_off - 32)^ am.text(button_tbl.text,color.fg)) ] +768 30:[ mod[name] = button_extra ] >> 34:[ mod[name] = button_extra ] +515 31:[ end ] >> 31:[ for name, button_tbl in pairs buttonspecs ] +794 32:[ local touch_indicator = am.group() ] >> 35:[ touch_indicator = am.group! ] +823 33:[ local touch_cursor = am.sprite("data/cursor.png", vec4(1, 1, 1, 1), "left", "top") ] >> 36:[ touch_cursor = am.sprite("data/cursor.png",vec4(1,1,1,1),"left","top") ] +895 34:[ local touch_loc = am.translate(0, 0) ^ touch_cursor ] >> 37:[ touch_loc = am.translate(0,0)^ touch_cursor ] +940 35:[ touch_indicator:append(touch_loc) ] >> 38:[ touch_indicator\append(touch_loc) ] +975 36:[ mod.node:append(am.translate(0, 100) ^ am.scale(3) ^ am.text("You failed to\nremain silly")) ] >> 39:[ mod.node\append(am.translate(0,100)^ am.scale(3)^ am.text("You failed to\nremain silly")) ] +1066 37:[ mod.node:action("click_interpreter", coroutine.create(function() ] >> 40:[ mod.node\action("click_interpreter",coroutine.create(()-> ] +1131 38:[ while true do ] >> 41:[ while true ] +1142 39:[ if #main.win:active_touches() > 0 then ] >> 42:[ if #main.win\active_touches! > 0 ] +1177 40:[ local touch = main.win:touch_position(1) ] >> 43:[ touch = main.win\touch_position(1) ] +1216 41:[ touch_cursor.color = vec4(1, 1, 1, 1) ] >> 44:[ touch_cursor.color = vec4(1,1,1,1) ] +1255 42:[ touch_loc.x = touch.x ] >> 45:[ touch_loc.x = touch.x ] +1281 43:[ touch_loc.y = touch.y ] >> 46:[ touch_loc.y = touch.y ] +1307 44:[ local col_but = bp.check(touch.x, touch.y + 64) ] >> 47:[ col_but = bp.check(touch.x, touch.y+64) ] +1353 45:[ if #col_but > 0 then ] >> 48:[ if #col_but > 0 ] +1372 46:[ touch_cursor.color = vec4(0.5, 0.5, 0.5, 0.5) ] >> 49:[ touch_cursor.color = vec4(0.5,0.5,0.5,0.5) ] +1351 47:[ end ] >> 48:[ if #col_but > 0 ] +1421 48:[ if #col_but > 0 then ] >> 50:[ if #col_but > 0 ] +1440 49:[ print("Collided with button:", col_but) ] >> 51:[ print("Collided with button:",col_but) ] +1484 50:[ print("mod.create prty was:", mod.create_party) ] >> 52:[ print("mod.create prty was:",mod.create_party) ] +1538 51:[ if col_but[1] == mod.menu then ] >> 53:[ if col_but[1] == mod.menu ] +1568 52:[ am.eval_js("location.reload()") ] >> 54:[ am.eval_js("location.reload()") ] +1536 53:[ end ] >> 53:[ if col_but[1] == mod.menu ] +1419 54:[ end ] >> 50:[ if #col_but > 0 ] +1612 56:[ touch_cursor.color = vec4(0, 0, 0, 0) ] >> 56:[ touch_cursor.color = vec4(0,0,0,0) ] +1650 58:[ coroutine.yield() ] >> 57:[ coroutine.yield! ] +1126 59:[ end ] >> 41:[ while true ] +1066 60:[ end)) ] >> 40:[ mod.node\action("click_interpreter",coroutine.create(()-> ] +1672 61:[ return mod.node:append(touch_indicator) ] >> 59:[ mod.node\append(touch_indicator) ] +430 62:[ end ] >> 28:[ mod.load = () -> ] +1706 63:[ mod.unload = function() ] >> 61:[ mod.unload = () -> ] +1726 64:[ main.root("screen"):remove(mod.node) ] >> 62:[ main.root("screen")\remove(mod.node) ] +1764 65:[ bp.remove(mod.create_party) ] >> 63:[ bp.remove(mod.create_party) ] +1793 66:[ return bp.remove(mod.join_party) ] >> 64:[ bp.remove(mod.join_party) ] +1706 67:[ end ] >> 61:[ mod.unload = () -> ] +1820 68:[ return mod ] >> 66:[ mod ] diff --git a/debug/dispatch.lua.X b/debug/dispatch.lua.X new file mode 100644 index 0000000..b8528ee --- /dev/null +++ b/debug/dispatch.lua.X @@ -0,0 +1,50 @@ +Pos Lua >> Moon +28 1:[ local mod = ... ] >> 3:[ mod = ... ] +38 2:[ local char = require("char") ] >> 4:[ char = require "char" ] +80 4:[ KeyInput = char.KeyInput ] >> 5:[ import KeyInput from char ] +86 5:[ local main = require("main") ] >> 6:[ main = require "main" ] +109 6:[ local set_input ] >> 8:[ set_input = (inputs, key, value) -> ] +109 7:[ set_input = function(inputs, key, value) ] >> 8:[ set_input = (inputs, key, value) -> ] +160 8:[ for _index_0 = 1, #inputs do ] >> 9:[ for input in *inputs ] +160 9:[ local input = inputs[_index_0] ] >> 9:[ for input in *inputs ] +171 10:[ if input.key == key then ] >> 10:[ if input.key == key ] +233 11:[ input.value = value ] >> 12:[ input.value = value ] +256 12:[ return ] >> 13:[ return ] +169 13:[ end ] >> 10:[ if input.key == key ] +109 15:[ end ] >> 8:[ set_input = (inputs, key, value) -> ] +264 16:[ local controls = { ] >> 15:[ controls = { ] +284 17:[ right = "right", ] >> 16:[ right: "right", ] +300 18:[ left = "left", ] >> 17:[ left: "left", ] +313 19:[ up = "up", ] >> 18:[ up: "up" ] +325 20:[ jump = "z", ] >> 19:[ jump: "z", ] +337 21:[ down = "down", ] >> 20:[ down: "down" ] +351 22:[ dash = "c", ] >> 21:[ dash: "c" ] +363 23:[ swing = "x" ] >> 22:[ swing: "x" ] +264 24:[ } ] >> 15:[ controls = { ] +371 25:[ mod.control = function(character) ] >> 25:[ mod.control = (character) -> ] +401 26:[ return character.node:action(coroutine.create(function() ] >> 26:[ character.node\action(coroutine.create(() -> ] +453 27:[ while true do ] >> 27:[ while true ] +472 28:[ for k, v in pairs(controls) do ] >> 28:[ for k,v in pairs controls ] +492 29:[ set_input(character.inputs, k, main.win:key_down(v)) ] >> 29:[ set_input(character.inputs,k,main.win\key_down(v)) ] +462 30:[ end ] >> 28:[ for k,v in pairs controls ] +546 31:[ coroutine.yield() ] >> 30:[ coroutine.yield() ] +448 32:[ end ] >> 27:[ while true ] +401 33:[ end)) ] >> 26:[ character.node\action(coroutine.create(() -> ] +371 34:[ end ] >> 25:[ mod.control = (character) -> ] +569 35:[ mod.slime_ai = function(character) ] >> 33:[ mod.slime_ai = (character) -> ] +600 36:[ return character.node:action(coroutine.create(function() ] >> 34:[ character.node\action(coroutine.create(() -> ] +647 37:[ local time_offset = math.random() ] >> 35:[ time_offset = math.random() ] +677 38:[ local last_action = am.current_time() + time_offset ] >> 36:[ last_action = am.current_time() + time_offset ] +730 39:[ while true do ] >> 37:[ while true ] +739 40:[ local time_diff = am.current_time() - last_action ] >> 38:[ time_diff = am.current_time() - last_action ] +788 41:[ if time_diff > 1.3 then ] >> 39:[ if time_diff > 1.3 ] +809 42:[ last_action = am.current_time() + math.random() ] >> 40:[ last_action = am.current_time() + math.random() ] +866 43:[ elseif time_diff > 1.1 then ] >> 41:[ elseif time_diff > 1.1 ] +887 44:[ set_input(character.inputs, "jump_left", false) ] >> 42:[ set_input(character.inputs,"jump_left",false) ] +942 45:[ elseif time_diff > 1 then ] >> 43:[ elseif time_diff > 1 ] +961 46:[ set_input(character.inputs, "jump_left", true) ] >> 44:[ set_input(character.inputs,"jump_left",true) ] +1010 48:[ coroutine.yield() ] >> 46:[ coroutine.yield() ] +725 49:[ end ] >> 37:[ while true ] +600 50:[ end)) ] >> 34:[ character.node\action(coroutine.create(() -> ] +569 51:[ end ] >> 33:[ mod.slime_ai = (character) -> ] +1033 52:[ return mod ] >> 49:[ mod ] diff --git a/debug/e_bethany.lua.X b/debug/e_bethany.lua.X new file mode 100644 index 0000000..a3fc840 --- /dev/null +++ b/debug/e_bethany.lua.X @@ -0,0 +1,25 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_brood") ] >> 3:[ require "a_brood" ] +70 4:[ local mod = ... ] >> 5:[ mod = ... ] +81 5:[ mod.char = { ] >> 7:[ mod.char = { ] +100 6:[ name = "Brooding Bethany", ] >> 8:[ name: "Brooding Bethany", ] +125 7:[ cr = 8, ] >> 9:[ cr: 8, ] +147 8:[ default_position = 2, ] >> 10:[ default_position: 2 ] +171 10:[ reg.Brood ] >> 11:[ default_abilities: {reg.Brood}, ] +198 12:[ default_maxhp = 4, ] >> 12:[ default_maxhp: 4, ] +214 13:[ default_hp = 1, ] >> 13:[ default_hp: 1, ] +238 14:[ default_maxstamina = 1, ] >> 14:[ default_maxstamina: 1, ] +259 15:[ default_stamina = 1, ] >> 15:[ default_stamina: 1, ] +280 16:[ default_maxmana = 0, ] >> 16:[ default_maxmana: 0, ] +298 17:[ default_mana = 0, ] >> 17:[ default_mana: 0, ] +310 18:[ sprite = "data/e_brood.png", ] >> 18:[ sprite:"data/e_brood.png", ] +355 20:[ print("while selecting action, by abilities were:", self.data.abilities) ] >> 20:[ print("while selecting action, by abilities were:",@data.abilities) ] +425 21:[ return self.data.abilities[1] ] >> 21:[ @data.abilities[1] ] +81 23:[ } ] >> 7:[ mod.char = { ] +456 24:[ for k, v in pairs(mod.char) do ] >> 23:[ for k,v in pairs(mod.char) ] +474 25:[ mod[k] = v ] >> 24:[ mod[k] = v ] +446 26:[ end ] >> 23:[ for k,v in pairs(mod.char) ] +486 27:[ char.enemies[mod.char.name] = mod.char ] >> 26:[ char.enemies[mod.char.name] = mod.char ] +526 28:[ return mod ] >> 28:[ mod ] diff --git a/debug/e_child.lua.X b/debug/e_child.lua.X new file mode 100644 index 0000000..6a53917 --- /dev/null +++ b/debug/e_child.lua.X @@ -0,0 +1,25 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_pass") ] >> 3:[ require "a_pass" ] +69 4:[ local mod = ... ] >> 5:[ mod = ... ] +80 5:[ mod.char = { ] >> 7:[ mod.char = { ] +99 6:[ name = "An actual child", ] >> 8:[ name: "An actual child", ] +123 7:[ cr = 1, ] >> 9:[ cr: 1, ] +145 8:[ default_position = 1, ] >> 10:[ default_position: 1 ] +169 10:[ reg.Pass ] >> 11:[ default_abilities: {reg.Pass}, ] +195 12:[ default_maxhp = 1, ] >> 12:[ default_maxhp: 1, ] +211 13:[ default_hp = 1, ] >> 13:[ default_hp: 1, ] +235 14:[ default_maxstamina = 1, ] >> 14:[ default_maxstamina: 1, ] +256 15:[ default_stamina = 1, ] >> 15:[ default_stamina: 1, ] +277 16:[ default_maxmana = 0, ] >> 16:[ default_maxmana: 0, ] +295 17:[ default_mana = 0, ] >> 17:[ default_mana: 0, ] +307 18:[ sprite = "data/e_child.png", ] >> 18:[ sprite:"data/e_child.png", ] +352 20:[ print("while selecting action, by abilities were:", self.data.abilities) ] >> 20:[ print("while selecting action, by abilities were:",@data.abilities) ] +422 21:[ return self.data.abilities[1] ] >> 21:[ @data.abilities[1] ] +80 23:[ } ] >> 7:[ mod.char = { ] +453 24:[ for k, v in pairs(mod.char) do ] >> 23:[ for k,v in pairs(mod.char) ] +471 25:[ mod[k] = v ] >> 24:[ mod[k] = v ] +443 26:[ end ] >> 23:[ for k,v in pairs(mod.char) ] +483 27:[ char.enemies[mod.char.name] = mod.char ] >> 26:[ char.enemies[mod.char.name] = mod.char ] +523 28:[ return mod ] >> 28:[ mod ] diff --git a/debug/e_mopey_marvin.lua.X b/debug/e_mopey_marvin.lua.X new file mode 100644 index 0000000..117fece --- /dev/null +++ b/debug/e_mopey_marvin.lua.X @@ -0,0 +1,25 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_mope") ] >> 3:[ require "a_mope" ] +69 4:[ local mod = ... ] >> 5:[ mod = ... ] +80 5:[ mod.char = { ] >> 7:[ mod.char = { ] +99 6:[ name = "Mopey Marvin", ] >> 8:[ name: "Mopey Marvin", ] +120 7:[ cr = 5, ] >> 9:[ cr: 5, ] +142 8:[ default_position = 2, ] >> 10:[ default_position: 2 ] +166 10:[ reg.Mope ] >> 11:[ default_abilities: {reg.Mope}, ] +192 12:[ default_maxhp = 4, ] >> 12:[ default_maxhp: 4, ] +208 13:[ default_hp = 1, ] >> 13:[ default_hp: 1, ] +232 14:[ default_maxstamina = 1, ] >> 14:[ default_maxstamina: 1, ] +253 15:[ default_stamina = 1, ] >> 15:[ default_stamina: 1, ] +274 16:[ default_maxmana = 0, ] >> 16:[ default_maxmana: 0, ] +292 17:[ default_mana = 0, ] >> 17:[ default_mana: 0, ] +304 18:[ sprite = "data/e_mope.png", ] >> 18:[ sprite:"data/e_mope.png", ] +348 20:[ print("while selecting action, by abilities were:", self.data.abilities) ] >> 20:[ print("while selecting action, by abilities were:",@data.abilities) ] +418 21:[ return self.data.abilities[1] ] >> 21:[ @data.abilities[1] ] +80 23:[ } ] >> 7:[ mod.char = { ] +449 24:[ for k, v in pairs(mod.char) do ] >> 23:[ for k,v in pairs(mod.char) ] +467 25:[ mod[k] = v ] >> 24:[ mod[k] = v ] +439 26:[ end ] >> 23:[ for k,v in pairs(mod.char) ] +479 27:[ char.enemies[mod.char.name] = mod.char ] >> 26:[ char.enemies[mod.char.name] = mod.char ] +519 28:[ return mod ] >> 28:[ mod ] diff --git a/debug/e_rat.lua.X b/debug/e_rat.lua.X new file mode 100644 index 0000000..4bb4c86 --- /dev/null +++ b/debug/e_rat.lua.X @@ -0,0 +1,26 @@ +Pos Lua >> Moon +2 1:[ local char = require("char") ] >> 2:[ char = require "char" ] +24 2:[ local reg = require("ability_reg") ] >> 3:[ reg = require "ability_reg" ] +52 3:[ require("a_rat_bite") ] >> 4:[ require "a_rat_bite" ] +74 4:[ local mod = ... ] >> 6:[ mod = ... ] +85 5:[ return mod ] >> 8:[ return mod ] +97 6:[ mod.char = { ] >> 10:[ mod.char = { ] +116 7:[ name = "Rat", ] >> 11:[ name: "Rat", ] +128 8:[ cr = 1, ] >> 12:[ cr: 1, ] +150 9:[ default_position = 1, ] >> 13:[ default_position: 1 ] +174 11:[ reg.RatBite ] >> 14:[ default_abilities: {reg.RatBite}, ] +203 13:[ default_maxhp = 1, ] >> 15:[ default_maxhp: 1, ] +219 14:[ default_hp = 1, ] >> 16:[ default_hp: 1, ] +243 15:[ default_maxstamina = 1, ] >> 17:[ default_maxstamina: 1, ] +264 16:[ default_stamina = 1, ] >> 18:[ default_stamina: 1, ] +285 17:[ default_maxmana = 0, ] >> 19:[ default_maxmana: 0, ] +303 18:[ default_mana = 0, ] >> 20:[ default_mana: 0, ] +315 19:[ sprite = "data/e_rat.png", ] >> 21:[ sprite:"data/e_rat.png", ] +358 21:[ print("while selecting action, by abilities were:", self.data.abilities) ] >> 23:[ print("while selecting action, by abilities were:",@data.abilities) ] +428 22:[ return self.data.abilities[1] ] >> 24:[ @data.abilities[1] ] +97 24:[ } ] >> 10:[ mod.char = { ] +459 25:[ for k, v in pairs(mod.char) do ] >> 26:[ for k,v in pairs(mod.char) ] +477 26:[ mod[k] = v ] >> 27:[ mod[k] = v ] +449 27:[ end ] >> 26:[ for k,v in pairs(mod.char) ] +489 28:[ char.enemies[mod.char.name] = mod.char ] >> 29:[ char.enemies[mod.char.name] = mod.char ] +529 29:[ return mod ] >> 31:[ mod ] diff --git a/debug/e_ruminating_randy.lua.X b/debug/e_ruminating_randy.lua.X new file mode 100644 index 0000000..b7b6c45 --- /dev/null +++ b/debug/e_ruminating_randy.lua.X @@ -0,0 +1,25 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local reg = require("ability_reg") ] >> 2:[ reg = require "ability_reg" ] +51 3:[ require("a_ruminate") ] >> 3:[ require "a_ruminate" ] +73 4:[ local mod = ... ] >> 5:[ mod = ... ] +84 5:[ mod.char = { ] >> 7:[ mod.char = { ] +103 6:[ name = "Ruminating Randy", ] >> 8:[ name: "Ruminating Randy", ] +128 7:[ cr = 5, ] >> 9:[ cr: 5, ] +150 8:[ default_position = 3, ] >> 10:[ default_position: 3 ] +174 10:[ reg.Ruminate ] >> 11:[ default_abilities: {reg.Ruminate}, ] +204 12:[ default_maxhp = 4, ] >> 12:[ default_maxhp: 4, ] +220 13:[ default_hp = 1, ] >> 13:[ default_hp: 1, ] +244 14:[ default_maxstamina = 1, ] >> 14:[ default_maxstamina: 1, ] +265 15:[ default_stamina = 1, ] >> 15:[ default_stamina: 1, ] +286 16:[ default_maxmana = 0, ] >> 16:[ default_maxmana: 0, ] +304 17:[ default_mana = 0, ] >> 17:[ default_mana: 0, ] +316 18:[ sprite = "data/e_rum.png", ] >> 18:[ sprite:"data/e_rum.png", ] +359 20:[ print("while selecting action, by abilities were:", self.data.abilities) ] >> 20:[ print("while selecting action, by abilities were:",@data.abilities) ] +429 21:[ return self.data.abilities[1] ] >> 21:[ @data.abilities[1] ] +84 23:[ } ] >> 7:[ mod.char = { ] +460 24:[ for k, v in pairs(mod.char) do ] >> 23:[ for k,v in pairs(mod.char) ] +478 25:[ mod[k] = v ] >> 24:[ mod[k] = v ] +450 26:[ end ] >> 23:[ for k,v in pairs(mod.char) ] +490 27:[ char.enemies[mod.char.name] = mod.char ] >> 26:[ char.enemies[mod.char.name] = mod.char ] +530 28:[ return mod ] >> 28:[ mod ] diff --git a/debug/e_sullen_salley.lua.X b/debug/e_sullen_salley.lua.X new file mode 100644 index 0000000..0c73e1c --- /dev/null +++ b/debug/e_sullen_salley.lua.X @@ -0,0 +1,25 @@ +Pos Lua >> Moon +2 1:[ local char = require("char") ] >> 2:[ char = require "char" ] +24 2:[ local reg = require("ability_reg") ] >> 3:[ reg = require "ability_reg" ] +52 3:[ require("a_sulk") ] >> 4:[ require "a_sulk" ] +70 4:[ local mod = ... ] >> 6:[ mod = ... ] +81 5:[ mod.char = { ] >> 8:[ mod.char = { ] +100 6:[ name = "Sullen Sally", ] >> 9:[ name: "Sullen Sally", ] +121 7:[ cr = 2, ] >> 10:[ cr: 2, ] +143 8:[ default_position = 1, ] >> 11:[ default_position: 1 ] +167 10:[ reg.Sulk ] >> 12:[ default_abilities: {reg.Sulk}, ] +193 12:[ default_maxhp = 3, ] >> 13:[ default_maxhp: 3, ] +209 13:[ default_hp = 1, ] >> 14:[ default_hp: 1, ] +233 14:[ default_maxstamina = 1, ] >> 15:[ default_maxstamina: 1, ] +254 15:[ default_stamina = 1, ] >> 16:[ default_stamina: 1, ] +275 16:[ default_maxmana = 0, ] >> 17:[ default_maxmana: 0, ] +293 17:[ default_mana = 0, ] >> 18:[ default_mana: 0, ] +305 18:[ sprite = "data/e_sullen.png", ] >> 19:[ sprite:"data/e_sullen.png", ] +351 20:[ print("while selecting action, by abilities were:", self.data.abilities) ] >> 21:[ print("while selecting action, by abilities were:",@data.abilities) ] +421 21:[ return self.data.abilities[1] ] >> 22:[ @data.abilities[1] ] +81 23:[ } ] >> 8:[ mod.char = { ] +452 24:[ for k, v in pairs(mod.char) do ] >> 24:[ for k,v in pairs(mod.char) ] +470 25:[ mod[k] = v ] >> 25:[ mod[k] = v ] +442 26:[ end ] >> 24:[ for k,v in pairs(mod.char) ] +482 27:[ char.enemies[mod.char.name] = mod.char ] >> 27:[ char.enemies[mod.char.name] = mod.char ] +522 28:[ return mod ] >> 29:[ mod ] diff --git a/debug/join_party_menu.lua.X b/debug/join_party_menu.lua.X new file mode 100644 index 0000000..a7b627e --- /dev/null +++ b/debug/join_party_menu.lua.X @@ -0,0 +1,72 @@ +Pos Lua >> Moon +2 1:[ local main = require("main") ] >> 2:[ main = require "main" ] +24 2:[ local world = require("world") ] >> 3:[ world = require "world" ] +48 3:[ local color = require("color") ] >> 4:[ color = require "color" ] +72 4:[ local bp = require("broadphase") ] >> 5:[ bp = require "broadphase" ] +98 5:[ local ui = require("ui") ] >> 6:[ ui = require "ui" ] +133 7:[ World = world.World ] >> 7:[ import World from world ] +141 8:[ local mod = ... ] >> 9:[ mod = ... ] +152 9:[ mod.node = am.group() ] >> 11:[ mod.node = am.group! ] +173 10:[ mod.node:append(am.sprite("data/join.png")) ] >> 12:[ mod.node\append(am.sprite("data/join.png")) ] +217 11:[ local default_text = "..." ] >> 13:[ default_text = "..." ] +238 12:[ mod.load = function() ] >> 14:[ mod.load = () -> ] +256 13:[ mod.loaded = true ] >> 15:[ mod.loaded = true ] +275 14:[ print("Loading join_party_menu") ] >> 16:[ print("Loading join_party_menu") ] +309 15:[ main.root("screen"):append(mod.node) ] >> 17:[ main.root("screen")\append(mod.node) ] +347 16:[ mod.buttons = ui.create_join_input(mod.node) ] >> 18:[ mod.buttons = ui.create_join_input(mod.node) ] +393 17:[ mod.node:append(am.translate(0, -135) ^ am.text(default_text, color.fg, "center", "top"):tag("join_id")) ] >> 19:[ mod.node\append(am.translate(0,-135)^ am.text(default_text, color.fg, "center","top")\tag("join_id")) ] +496 18:[ local touch_indicator = am.group() ] >> 20:[ touch_indicator = am.group! ] +525 19:[ local touch_cursor = am.sprite("data/cursor.png", vec4(1, 1, 1, 1), "left", "top") ] >> 21:[ touch_cursor = am.sprite("data/cursor.png",vec4(1,1,1,1),"left","top") ] +597 20:[ local backspace = ui.create_any_button(mod.node, 2, 2, 150, -25) ] >> 22:[ backspace = ui.create_any_button(mod.node,2,2,150,-25) ] +653 21:[ backspace.node:append(am.translate(164, -41) ^ am.scale(2) ^ am.text("<-", color.fg, "left", "top")) ] >> 23:[ backspace.node\append(am.translate(164,-41)^ am.scale(2)^ am.text("<-", color.fg, "left","top")) ] +751 22:[ local touch_loc = am.translate(0, 0) ^ touch_cursor ] >> 24:[ touch_loc = am.translate(0,0)^ touch_cursor ] +796 23:[ touch_indicator:append(touch_loc) ] >> 25:[ touch_indicator\append(touch_loc) ] +831 24:[ mod.node:append(touch_indicator) ] >> 26:[ mod.node\append(touch_indicator) ] +865 25:[ print("char selector:", char_selector) ] >> 27:[ print("char selector:",char_selector) ] +904 26:[ return mod.node:action(coroutine.create(function() ] >> 28:[ mod.node\action(coroutine.create(() -> ] +950 27:[ while true do ] >> 29:[ while true ] +961 28:[ if #main.win:active_touches() > 0 then ] >> 30:[ if #main.win\active_touches! > 0 ] +996 29:[ local touch = main.win:touch_position(1) ] >> 31:[ touch = main.win\touch_position(1) ] +1035 30:[ touch_cursor.color = vec4(1, 1, 1, 1) ] >> 32:[ touch_cursor.color = vec4(1,1,1,1) ] +1074 31:[ touch_loc.x = touch.x ] >> 33:[ touch_loc.x = touch.x ] +1100 32:[ touch_loc.y = touch.y ] >> 34:[ touch_loc.y = touch.y ] +1126 33:[ local col_but = bp.check(touch.x, touch.y + 40) ] >> 35:[ col_but = bp.check(touch.x, touch.y + 40) ] +1172 34:[ local n = mod.node("join_id") ] >> 36:[ n = mod.node("join_id") ] +1202 35:[ if #col_but > 0 then ] >> 37:[ if #col_but > 0 ] +1221 36:[ touch_cursor.color = vec4(0.5, 0.5, 0.5, 0.5) ] >> 38:[ touch_cursor.color = vec4(0.5,0.5,0.5,0.5) ] +1200 37:[ end ] >> 37:[ if #col_but > 0 ] +1270 38:[ if main.win:touch_began(1) then ] >> 39:[ if main.win\touch_began(1) ] +1316 39:[ for _, button in pairs(mod.buttons) do ] >> 40:[ for _, button in pairs(mod.buttons) ] +1344 40:[ if col_but[1] == button then ] >> 41:[ if col_but[1] == button ] +1375 41:[ if n.text == default_text then ] >> 42:[ if n.text == default_text ] +1407 42:[ n.text = "" ] >> 43:[ n.text = "" ] +1373 43:[ end ] >> 42:[ if n.text == default_text ] +1426 44:[ print("Found pressed button", button) ] >> 44:[ print("Found pressed button",button) ] +1470 45:[ n.text = n.text .. button.text ] >> 45:[ n.text = n.text .. button.text ] +1342 46:[ end ] >> 41:[ if col_but[1] == button ] +1300 47:[ end ] >> 40:[ for _, button in pairs(mod.buttons) ] +1508 48:[ if col_but[1] == backspace then ] >> 46:[ if col_but[1] == backspace ] +1539 49:[ n.text = n.text:sub(1, string.len(n.text) - 1) ] >> 47:[ n.text = n.text\sub(1,string.len(n.text)-1) ] +1506 50:[ end ] >> 46:[ if col_but[1] == backspace ] +1268 51:[ end ] >> 39:[ if main.win\touch_began(1) ] +1589 52:[ if #n.text > 5 then ] >> 48:[ if #n.text > 5 ] +1607 53:[ print("Time to join!") ] >> 49:[ print("Time to join!") ] +1635 54:[ local lobby = require("lobby_menu") ] >> 50:[ lobby = require("lobby_menu") ] +1670 55:[ table.insert(main.action_queue, { ] >> 51:[ table.insert(main.action_queue,{lobby.load,{n.text}}) ] +1702 56:[ lobby.load, ] >> 51:[ table.insert(main.action_queue,{lobby.load,{n.text}}) ] +1714 58:[ n.text ] >> 51:[ table.insert(main.action_queue,{lobby.load,{n.text}}) ] +1670 60:[ }) ] >> 51:[ table.insert(main.action_queue,{lobby.load,{n.text}}) ] +1729 61:[ mod.unload() ] >> 52:[ mod.unload! ] +1587 62:[ end ] >> 48:[ if #n.text > 5 ] +959 63:[ end ] >> 30:[ if #main.win\active_touches! > 0 ] +1745 64:[ coroutine.yield() ] >> 54:[ coroutine.yield! ] +945 65:[ end ] >> 29:[ while true ] +904 66:[ end)) ] >> 28:[ mod.node\action(coroutine.create(() -> ] +238 67:[ end ] >> 14:[ mod.load = () -> ] +1767 68:[ mod.unload = function() ] >> 57:[ mod.unload = () -> ] +1787 69:[ main.root("screen"):remove(mod.node) ] >> 58:[ main.root("screen")\remove(mod.node) ] +1841 70:[ for _, button in pairs(mod.buttons) do ] >> 59:[ for _, button in pairs(mod.buttons) ] +1863 71:[ bp.remove(button) ] >> 60:[ bp.remove(button) ] +1825 72:[ end ] >> 59:[ for _, button in pairs(mod.buttons) ] +1767 73:[ end ] >> 57:[ mod.unload = () -> ] +1882 74:[ return mod ] >> 62:[ mod ] diff --git a/debug/lobby_menu.lua.X b/debug/lobby_menu.lua.X new file mode 100644 index 0000000..f50cb4d --- /dev/null +++ b/debug/lobby_menu.lua.X @@ -0,0 +1,88 @@ +Pos Lua >> Moon +1 1:[ local main = require("main") ] >> 1:[ main = require "main" ] +23 2:[ local color = require("color") ] >> 2:[ color = require "color" ] +47 3:[ local ui = require("ui") ] >> 3:[ ui = require "ui" ] +65 4:[ local world = require("world") ] >> 4:[ world = require "world" ] +89 5:[ local char = require("char") ] >> 5:[ char = require "char" ] +111 6:[ local player = require("player") ] >> 6:[ player = require "player" ] +137 7:[ local bp = require("broadphase") ] >> 7:[ bp = require "broadphase" ] +163 8:[ local action = require("action") ] >> 8:[ action = require "action" ] +189 9:[ local room = require("room") ] >> 9:[ room = require "room" ] +228 11:[ World = world.World ] >> 10:[ import World from world ] +258 13:[ LocalPlayer = player.LocalPlayer ] >> 11:[ import LocalPlayer from player ] +287 15:[ LobbyRoom = room.LobbyRoom ] >> 12:[ import LobbyRoom from room ] +294 16:[ local mod = ... ] >> 14:[ mod = ... ] +305 17:[ mod.node = am.group() ] >> 16:[ mod.node = am.group! ] +376 18:[ mod.node:append(am.translate(0, main.height / 2) ^ am.text("Join lobby...", color.fg, "center", "top"):tag("join_id")) ] >> 18:[ mod.node\append(am.translate(0,main.height/2)^ am.text("Join lobby...", color.fg, "center","top")\tag("join_id")) ] +490 19:[ local char_selector = am.translate(0, (main.height / 2) + 64) ] >> 19:[ char_selector = am.translate(0,(main.height/2)+64) ] +541 20:[ mod.loaded = false ] >> 20:[ mod.loaded = false ] +560 21:[ mod.load = function(id) ] >> 21:[ mod.load = (id) -> ] +580 22:[ main.world = World() ] >> 22:[ main.world = World! ] +601 23:[ main.world:set_room(LobbyRoom()) ] >> 23:[ main.world\set_room(LobbyRoom!) ] +634 24:[ main.world:join(id) ] >> 24:[ main.world\join(id) ] +655 25:[ mod.node("join_id").text = "Lobby id:" .. id ] >> 25:[ mod.node("join_id").text = "Lobby id:" .. id ] +701 26:[ main.root("screen"):append(mod.node) ] >> 26:[ main.root("screen")\append(mod.node) ] +739 27:[ local touch_indicator = am.group() ] >> 27:[ touch_indicator = am.group! ] +768 28:[ local touch_cursor = am.sprite("data/cursor.png", vec4(1, 1, 1, 1), "left", "top") ] >> 28:[ touch_cursor = am.sprite("data/cursor.png",vec4(1,1,1,1),"left","top") ] +840 29:[ local touch_loc = am.translate(0, 0) ^ touch_cursor ] >> 29:[ touch_loc = am.translate(0,0)^ touch_cursor ] +885 30:[ touch_indicator:append(touch_loc) ] >> 30:[ touch_indicator\append(touch_loc) ] +920 31:[ char_selector = ui.create_char_selector2(mod.node) ] >> 31:[ char_selector = ui.create_char_selector2(mod.node) ] +972 32:[ local char_right, char_left, char_text = char_selector[1], char_selector[2], char_selector[3] ] >> 32:[ char_right, char_left, char_text = char_selector[1], char_selector[2], char_selector[3] ] +1061 33:[ mod.buttons = { ] >> 33:[ mod.buttons = {char_left, char_right} ] +1076 34:[ char_left, ] >> 33:[ mod.buttons = {char_left, char_right} ] +1086 35:[ char_right ] >> 33:[ mod.buttons = {char_left, char_right} ] +1061 36:[ } ] >> 33:[ mod.buttons = {char_left, char_right} ] +1100 37:[ local classes = char.class_order ] >> 34:[ classes = char.class_order ] +1128 38:[ local class_s = 1 ] >> 35:[ class_s = 1 ] +1141 39:[ char_right.color = color.transparent ] >> 36:[ char_right.color = color.transparent ] +1179 40:[ char_left.color = color.transparent ] >> 37:[ char_left.color = color.transparent ] +1216 41:[ mod.node:action(coroutine.create(function() ] >> 38:[ mod.node\action(coroutine.create(() -> ] +1262 42:[ while not main.world.client_open() do ] >> 39:[ while not main.world.client_open! ] +1294 43:[ coroutine.yield() ] >> 40:[ coroutine.yield! ] +1257 44:[ end ] >> 39:[ while not main.world.client_open! ] +1313 45:[ char_left.color = color.white ] >> 41:[ char_left.color = color.white ] +1345 46:[ char_right.color = color.white ] >> 42:[ char_right.color = color.white ] +1378 47:[ char_text.text = "Tumbler" ] >> 43:[ char_text.text = "Tumbler" ] +1407 48:[ main.world:load() ] >> 44:[ main.world\load! ] +1426 49:[ action.sync_players() ] >> 45:[ action.sync_players! ] +1454 50:[ while true do ] >> 46:[ while true ] +1465 51:[ if #main.win:active_touches() > 0 then ] >> 47:[ if #main.win\active_touches! > 0 ] +1501 52:[ local touch = main.win:touch_position(1) ] >> 48:[ touch = main.win\touch_position(1) ] +1540 53:[ touch_cursor.color = vec4(1, 1, 1, 1) ] >> 49:[ touch_cursor.color = vec4(1,1,1,1) ] +1579 54:[ touch_loc.x = touch.x ] >> 50:[ touch_loc.x = touch.x ] +1605 55:[ touch_loc.y = touch.y ] >> 51:[ touch_loc.y = touch.y ] +1631 56:[ local col_but = bp.check(touch.x, touch.y + 64) ] >> 52:[ col_but = bp.check(touch.x, touch.y + 64) ] +1679 57:[ if #col_but > 0 then ] >> 53:[ if #col_but > 0 ] +1698 58:[ touch_cursor.color = vec4(0.5, 0.5, 0.5, 0.5) ] >> 54:[ touch_cursor.color = vec4(0.5,0.5,0.5,0.5) ] +1677 59:[ end ] >> 53:[ if #col_but > 0 ] +1747 60:[ if #col_but > 0 and main.win:touch_began(1) then ] >> 55:[ if #col_but > 0 and main.win\touch_began(1) ] +1796 61:[ if col_but[1] == char_left then ] >> 56:[ if col_but[1] == char_left ] +1827 62:[ class_s = class_s - 1 ] >> 57:[ class_s = class_s - 1 ] +1857 63:[ if class_s == 0 then ] >> 58:[ if class_s == 0 ] +1878 64:[ class_s = #classes ] >> 59:[ class_s = #classes ] +1855 65:[ end ] >> 58:[ if class_s == 0 ] +1794 66:[ end ] >> 56:[ if col_but[1] == char_left ] +1904 67:[ if col_but[1] == char_right then ] >> 60:[ if col_but[1] == char_right ] +1936 68:[ class_s = class_s + 1 ] >> 61:[ class_s = class_s + 1 ] +1966 69:[ if class_s > #classes then ] >> 62:[ if class_s > #classes ] +1993 70:[ class_s = 1 ] >> 63:[ class_s = 1 ] +1964 71:[ end ] >> 62:[ if class_s > #classes ] +1902 72:[ end ] >> 60:[ if col_but[1] == char_right ] +2010 73:[ char_text.text = classes[class_s] ] >> 64:[ char_text.text = classes[class_s] ] +2049 74:[ action.request_class_change(classes[class_s]) ] >> 65:[ action.request_class_change(classes[class_s]) ] +1745 75:[ end ] >> 55:[ if #col_but > 0 and main.win\touch_began(1) ] +2107 77:[ touch_cursor.color = vec4(0, 0, 0, 0) ] >> 67:[ touch_cursor.color = vec4(0,0,0,0) ] +2145 79:[ coroutine.yield() ] >> 68:[ coroutine.yield! ] +1449 80:[ end ] >> 46:[ while true ] +1216 81:[ end)) ] >> 38:[ mod.node\action(coroutine.create(() -> ] +2168 82:[ mod.node:append(touch_indicator) ] >> 71:[ mod.node\append(touch_indicator) ] +2202 83:[ mod.loaded = true ] >> 72:[ mod.loaded = true ] +560 84:[ end ] >> 21:[ mod.load = (id) -> ] +2221 85:[ mod.unload = function() ] >> 74:[ mod.unload = () -> ] +2241 86:[ main.root("screen"):remove(mod.node) ] >> 75:[ main.root("screen")\remove(mod.node) ] +2295 87:[ for _, button in pairs(mod.buttons) do ] >> 76:[ for _, button in pairs(mod.buttons) ] +2317 88:[ bp.remove(button) ] >> 77:[ bp.remove(button) ] +2279 89:[ end ] >> 76:[ for _, button in pairs(mod.buttons) ] +2336 90:[ mod.loaded = false ] >> 78:[ mod.loaded = false ] +2221 91:[ end ] >> 74:[ mod.unload = () -> ] +2356 92:[ return mod ] >> 80:[ mod ] diff --git a/debug/main.lua.X b/debug/main.lua.X new file mode 100644 index 0000000..173b3d7 --- /dev/null +++ b/debug/main.lua.X @@ -0,0 +1,73 @@ +Pos Lua >> Moon +1 1:[ local mod = ... ] >> 1:[ mod = ... ] +12 2:[ require("ext") ] >> 3:[ require "ext" ] +26 3:[ mod.width = 640 ] >> 4:[ mod.width = 640 ] +42 4:[ mod.height = 480 ] >> 5:[ mod.height = 480 ] +59 5:[ local win = am.window({ ] >> 6:[ win = am.window{ ] +83 6:[ title = "Fools Rush In", ] >> 7:[ title: "Fools Rush In" ] +107 7:[ width = mod.width, ] >> 8:[ width: mod.width ] +126 8:[ height = mod.height, ] >> 9:[ height: mod.height ] +151 9:[ clear_color = vec4(85 / 255, 180 / 255, 255 / 255, 255 / 255) ] >> 10:[ clear_color: vec4(85/255,180/255,255/255,255/255) ] +59 10:[ }) ] >> 6:[ win = am.window{ ] +191 11:[ mod.root = am.group() ] >> 12:[ mod.root = am.group() ] +213 12:[ mod.pips = 5 ] >> 13:[ mod.pips = 5 ] +226 13:[ local char = require("char") ] >> 14:[ char = require "char" ] +248 14:[ local player = require("player") ] >> 15:[ player = require "player" ] +297 16:[ LocalPlayer = player.LocalPlayer ] >> 16:[ import LocalPlayer from player ] +305 17:[ local util = require("util") ] >> 17:[ util = require "util" ] +327 18:[ local world = require("world") ] >> 18:[ world = require "world" ] +368 20:[ World = world.World ] >> 19:[ import World from world ] +375 21:[ local main_menu = require("main_menu") ] >> 20:[ main_menu = require "main_menu" ] +407 22:[ local rng_seed = am.eval_js("Math.random()") ] >> 21:[ rng_seed = am.eval_js("Math.random()") ] +446 23:[ math.randomseed(rng_seed * 1000) ] >> 22:[ math.randomseed(rng_seed*1000) ] +478 24:[ mod.screenpos = util.Vec2() ] >> 24:[ mod.screenpos = util.Vec2! ] +506 25:[ mod.reload = function() ] >> 26:[ mod.reload = () -> ] +561 26:[ mod.screen = am.group():tag("screen") ^ am.translate(0, 0) ] >> 28:[ mod.screen = am.group!\tag("screen")^ am.translate(0,0)--Things that should draw on top of everything else, like a hud ] +681 27:[ mod.world_close = am.group():tag("close") ^ am.translate(0, 0) ] >> 29:[ mod.world_close = am.group!\tag("close")^ am.translate(0,0)--Things that should draw "close to the camera", fast-parallax background ] +815 28:[ mod.world = am.translate(0, 0) ^ am.group({ ] >> 30:[ mod.world = am.translate(0,0) ^ am.group({ ] +860 29:[ am.group():tag("world_front"), ] >> 31:[ am.group!\tag("world_front"), -- things in front of players ] +922 30:[ am.group():tag("world_characters"), ] >> 32:[ am.group!\tag("world_characters"), -- players ] +970 31:[ am.group():tag("world_behind") ] >> 33:[ am.group!\tag("world_behind"), -- things behind players ] +815 32:[ }):tag("world") ] >> 30:[ mod.world = am.translate(0,0) ^ am.group({ ] +1082 33:[ mod.world_far = am.group():tag("far") ^ am.translate(0, 0) ] >> 35:[ mod.world_far = am.group!\tag("far")^ am.translate(0,0) --Things that move slowly in the background ] +1183 34:[ mod.background = am.group():tag("bg") ] >> 36:[ mod.background = am.group!\tag("bg")--The background does not move, draws behind everything. ] +1277 35:[ mod.root = am.group({ ] >> 37:[ mod.root = am.group{ ] +1300 36:[ mod.background, ] >> 38:[ mod.background, ] +1318 37:[ mod.world_far, ] >> 39:[ mod.world_far, ] +1335 38:[ mod.world, ] >> 40:[ mod.world, ] +1348 39:[ mod.world_close, ] >> 41:[ mod.world_close, ] +1367 40:[ mod.screen ] >> 42:[ mod.screen, ] +1277 41:[ }) ] >> 37:[ mod.root = am.group{ ] +1383 42:[ win.scene = mod.root ] >> 44:[ win.scene = mod.root ] +1405 43:[ mod.action_queue = { ] >> 45:[ mod.action_queue = { ] +1429 45:[ main_menu.load, ] >> 46:[ {main_menu.load, {}} ] +1405 48:[ } ] >> 45:[ mod.action_queue = { ] +1455 49:[ mod.root:action(coroutine.create(function() ] >> 49:[ mod.root\action(coroutine.create(() -> ] +1501 50:[ while true do ] >> 50:[ while true ] +1512 51:[ if mod.server then ] >> 51:[ if mod.server ] +1528 52:[ mod.server:update() ] >> 52:[ mod.server\update! ] +1510 53:[ end ] >> 51:[ if mod.server ] +1550 54:[ coroutine.yield() ] >> 53:[ coroutine.yield! ] +1496 55:[ end ] >> 50:[ while true ] +1455 56:[ end)) ] >> 49:[ mod.root\action(coroutine.create(() -> ] +1572 57:[ return mod.root:action(coroutine.create(function() ] >> 55:[ mod.root\action(coroutine.create(() -> ] +1618 58:[ while true do ] >> 56:[ while true ] +1627 59:[ local start_time = am.current_time() ] >> 57:[ start_time = am.current_time! ] +1660 60:[ mod.world.x = -mod.screenpos.x ] >> 58:[ mod.world.x = -mod.screenpos.x ] +1694 61:[ mod.world.y = -mod.screenpos.y ] >> 59:[ mod.world.y = -mod.screenpos.y ] +1730 62:[ if #mod.action_queue > 0 then ] >> 60:[ if #mod.action_queue > 0 ] +1757 63:[ local action = table.remove(mod.action_queue) ] >> 61:[ action = table.remove(mod.action_queue) ] +1801 64:[ local f, args = action[1], action[2] ] >> 62:[ f, args = action[1], action[2] ] +1836 65:[ f(unpack(args)) ] >> 63:[ f(unpack(args)) ] +1728 66:[ end ] >> 60:[ if #mod.action_queue > 0 ] +1857 67:[ if mod.world then ] >> 64:[ if mod.world ] +1872 68:[ mod.world:update() ] >> 65:[ mod.world\update! ] +1855 69:[ end ] >> 64:[ if mod.world ] +1893 70:[ local end_time = am.current_time() ] >> 66:[ end_time = am.current_time! ] +1925 71:[ coroutine.yield() ] >> 68:[ coroutine.yield! ] +1613 72:[ end ] >> 56:[ while true ] +1572 73:[ end)) ] >> 55:[ mod.root\action(coroutine.create(() -> ] +506 74:[ end ] >> 26:[ mod.reload = () -> ] +1946 75:[ mod.reload() ] >> 70:[ mod.reload! ] +1958 76:[ mod.win = win ] >> 71:[ mod.win = win ] +1972 77:[ return mod ] >> 72:[ mod ] diff --git a/debug/main_menu.lua.X b/debug/main_menu.lua.X new file mode 100644 index 0000000..f9a715b --- /dev/null +++ b/debug/main_menu.lua.X @@ -0,0 +1,79 @@ +Pos Lua >> Moon +2 1:[ local main = require("main") ] >> 2:[ main = require "main" ] +24 2:[ local bp = require("broadphase") ] >> 3:[ bp = require "broadphase" ] +50 3:[ local color = require("color") ] >> 4:[ color = require "color" ] +74 4:[ local ui = require("ui") ] >> 5:[ ui = require "ui" ] +93 5:[ local world = require("world") ] >> 7:[ world = require "world" --delete when done ] +154 7:[ Server = world.Server ] >> 8:[ import Server from world ] +178 9:[ World = world.World ] >> 9:[ import World from world ] +185 10:[ local mod = ... ] >> 10:[ mod = ... ] +208 11:[ local nwidth = 6 ] >> 13:[ nwidth = 6 ] +219 12:[ local section_width = 32 ] >> 14:[ section_width = 32 ] +238 13:[ local start_x = (-32) * (nwidth / 2) ] >> 15:[ start_x = (-32)*(nwidth/2) ] +265 14:[ mod.node = am.group() ] >> 16:[ mod.node = am.group! ] +286 15:[ mod.node:append(am.sprite("data/main_bg.png")) ] >> 17:[ mod.node\append(am.sprite("data/main_bg.png")) ] +333 16:[ local start_y = 0 ] >> 18:[ start_y = 0 ] +345 17:[ local padding = 32 ] >> 19:[ padding = 32 ] +358 18:[ local buttonspecs = { ] >> 20:[ buttonspecs = { ] +399 20:[ y_off = start_y, ] >> 22:[ y_off: start_y, ] +416 21:[ text = "Create Troupe" ] >> 23:[ text: "Create Troupe" ] +460 24:[ y_off = start_y + 64 + padding, ] >> 26:[ y_off: start_y + 64 + padding, ] +492 25:[ text = "Join Troupe" ] >> 27:[ text: "Join Troupe" ] +358 27:[ } ] >> 20:[ buttonspecs = { ] +514 28:[ mod.load = function() ] >> 32:[ mod.load = () -> ] +532 29:[ print("creating main menu") ] >> 33:[ print("creating main menu") ] +561 30:[ main.root("screen"):append(mod.node) ] >> 34:[ main.root("screen")\append(mod.node) ] +622 31:[ for name, button_tbl in pairs(buttonspecs) do ] >> 35:[ for name, button_tbl in pairs buttonspecs ] +643 32:[ local button_extra = ui.create_big_button(mod.node, 6, start_x, button_tbl.y_off) ] >> 36:[ button_extra = ui.create_big_button(mod.node,6,start_x,button_tbl.y_off) ] +718 33:[ button_extra.node:append(am.translate(start_x + ((nwidth * section_width) / 2), button_tbl.y_off - 32) ^ am.text(button_tbl.text, color.fg)) ] >> 37:[ button_extra.node\append(am.translate(start_x+((nwidth*section_width)/2),button_tbl.y_off - 32)^ am.text(button_tbl.text,color.fg)) ] +852 34:[ mod[name] = button_extra ] >> 38:[ mod[name] = button_extra ] +599 35:[ end ] >> 35:[ for name, button_tbl in pairs buttonspecs ] +878 36:[ local touch_indicator = am.group() ] >> 39:[ touch_indicator = am.group! ] +907 37:[ local touch_cursor = am.sprite("data/cursor.png", vec4(1, 1, 1, 1), "left", "top") ] >> 40:[ touch_cursor = am.sprite("data/cursor.png",vec4(1,1,1,1),"left","top") ] +979 38:[ local touch_loc = am.translate(0, 0) ^ touch_cursor ] >> 41:[ touch_loc = am.translate(0,0)^ touch_cursor ] +1024 39:[ touch_indicator:append(touch_loc) ] >> 42:[ touch_indicator\append(touch_loc) ] +1059 40:[ mod.node:append(am.translate(0, -150) ^ am.scale(3) ^ am.text("Fools Rush In")) ] >> 43:[ mod.node\append(am.translate(0,-150)^ am.scale(3)^ am.text("Fools Rush In")) ] +1137 41:[ mod.node:action("click_interpreter", coroutine.create(function() ] >> 44:[ mod.node\action("click_interpreter",coroutine.create(()-> ] +1202 42:[ while true do ] >> 45:[ while true ] +1211 43:[ print("Main menu loop") ] >> 46:[ print("Main menu loop") ] +1240 44:[ if #main.win:active_touches() > 0 then ] >> 47:[ if #main.win\active_touches! > 0 ] +1275 45:[ local touch = main.win:touch_position(1) ] >> 48:[ touch = main.win\touch_position(1) ] +1314 46:[ touch_cursor.color = vec4(1, 1, 1, 1) ] >> 49:[ touch_cursor.color = vec4(1,1,1,1) ] +1353 47:[ touch_loc.x = touch.x ] >> 50:[ touch_loc.x = touch.x ] +1379 48:[ touch_loc.y = touch.y ] >> 51:[ touch_loc.y = touch.y ] +1405 49:[ local col_but = bp.check(touch.x, touch.y + 64) ] >> 52:[ col_but = bp.check(touch.x, touch.y+64) ] +1451 50:[ if #col_but > 0 then ] >> 53:[ if #col_but > 0 ] +1470 51:[ touch_cursor.color = vec4(0.5, 0.5, 0.5, 0.5) ] >> 54:[ touch_cursor.color = vec4(0.5,0.5,0.5,0.5) ] +1449 52:[ end ] >> 53:[ if #col_but > 0 ] +1519 53:[ if #col_but > 0 then ] >> 55:[ if #col_but > 0 ] +1538 54:[ print("Collided with button:", col_but) ] >> 56:[ print("Collided with button:",col_but) ] +1582 55:[ print("mod.create prty was:", mod.create_party) ] >> 57:[ print("mod.create prty was:",mod.create_party) ] +1636 56:[ if col_but[1] == mod.create_party then ] >> 58:[ if col_but[1] == mod.create_party ] +1674 57:[ print("Creating party") ] >> 59:[ print("Creating party") ] +1704 58:[ local create_party = require("create_party_menu") ] >> 60:[ create_party = require "create_party_menu" ] +1753 59:[ table.insert(main.action_queue, { ] >> 61:[ table.insert(main.action_queue,{create_party.load, {}}) ] +1785 60:[ create_party.load, ] >> 61:[ table.insert(main.action_queue,{create_party.load, {}}) ] +1753 62:[ }) ] >> 61:[ table.insert(main.action_queue,{create_party.load, {}}) ] +1815 63:[ mod.unload() ] >> 62:[ mod.unload! ] +1833 64:[ coroutine.yield() ] >> 63:[ coroutine.yield! ] +1861 65:[ elseif col_but[1] == mod.join_party then ] >> 64:[ elseif col_but[1] == mod.join_party ] +1897 66:[ print("Joining party") ] >> 65:[ print("Joining party") ] +1926 67:[ local join_party = require("join_party_menu") ] >> 66:[ join_party = require "join_party_menu" ] +1971 68:[ table.insert(main.action_queue, { ] >> 67:[ table.insert(main.action_queue,{join_party.load, {}}) ] +2003 69:[ join_party.load, ] >> 67:[ table.insert(main.action_queue,{join_party.load, {}}) ] +1971 71:[ }) ] >> 67:[ table.insert(main.action_queue,{join_party.load, {}}) ] +2031 72:[ mod.unload() ] >> 68:[ mod.unload! ] +2049 73:[ coroutine.yield() ] >> 69:[ coroutine.yield! ] +1517 75:[ end ] >> 55:[ if #col_but > 0 ] +2078 77:[ touch_cursor.color = vec4(0, 0, 0, 0) ] >> 71:[ touch_cursor.color = vec4(0,0,0,0) ] +2116 79:[ coroutine.yield() ] >> 72:[ coroutine.yield! ] +1197 80:[ end ] >> 45:[ while true ] +1137 81:[ end)) ] >> 44:[ mod.node\action("click_interpreter",coroutine.create(()-> ] +2138 82:[ return mod.node:append(touch_indicator) ] >> 74:[ mod.node\append(touch_indicator) ] +514 83:[ end ] >> 32:[ mod.load = () -> ] +2172 84:[ mod.unload = function() ] >> 76:[ mod.unload = () -> ] +2192 85:[ main.root("screen"):remove(mod.node) ] >> 77:[ main.root("screen")\remove(mod.node) ] +2230 86:[ bp.remove(mod.create_party) ] >> 78:[ bp.remove(mod.create_party) ] +2259 87:[ return bp.remove(mod.join_party) ] >> 79:[ bp.remove(mod.join_party) ] +2172 88:[ end ] >> 76:[ mod.unload = () -> ] +2286 89:[ return mod ] >> 81:[ mod ] diff --git a/debug/party.lua.X b/debug/party.lua.X new file mode 100644 index 0000000..23cf263 --- /dev/null +++ b/debug/party.lua.X @@ -0,0 +1,46 @@ +Pos Lua >> Moon +81 1:[ local room = require("room") ] >> 3:[ room = require("room") ] +104 2:[ local main = require("main") ] >> 4:[ main = require("main") ] +127 3:[ local char = require("char") ] >> 5:[ char = require("char") ] +171 5:[ Character = char.Character ] >> 6:[ import Character from char ] +198 7:[ LobbyRoom = room.LobbyRoom ] >> 7:[ import LobbyRoom from room ] +204 8:[ local mod = ... ] >> 8:[ mod = ... ] +367 14:[ assert(uname, "cannot find a nil party member") ] >> 18:[ assert(uname, "cannot find a nil party member") ] +417 15:[ assert(type(uname) == "string", "Member should be called with a peer id") ] >> 19:[ assert(type(uname) == "string", "Member should be called with a peer id") ] +493 16:[ return self.members[uname] ] >> 20:[ @members[uname] ] +528 19:[ local i = 0 ] >> 22:[ i = 0 ] +546 20:[ for k, v in pairs(self.members) do ] >> 23:[ for k,v in pairs(@members) ] +566 21:[ i = i + 1 ] >> 24:[ i += 1 ] +536 22:[ end ] >> 23:[ for k,v in pairs(@members) ] +575 23:[ return i ] >> 25:[ i ] +604 26:[ assert(member.uname, "cannot add a nil party member") ] >> 27:[ assert(member.uname, "cannot add a nil party member") ] +660 27:[ assert(type(member.uname) == "string", "Member should be called with a peer id") ] >> 28:[ assert(type(member.uname) == "string", "Member should be called with a peer id") ] +743 28:[ self.members[member.uname] = member ] >> 29:[ @members[member.uname] = member ] +777 29:[ member.party = self ] >> 30:[ member.party = @ ] +796 30:[ return self.node:append(member.node) ] >> 31:[ @node\append(member.node) ] +852 33:[ self.members[member.uname] = nil ] >> 33:[ @members[member.uname] = nil ] +883 34:[ member.party = nil ] >> 34:[ member.party = nil ] +904 35:[ return self.node:remove(member.node) ] >> 35:[ @node\remove(member.node) ] +954 38:[ self.room = nroom ] >> 37:[ @room = nroom ] +985 39:[ for id, char in pairs(self.members) do ] >> 38:[ for id, char in pairs(@members) ] +1005 40:[ char:enter_room(nroom) ] >> 39:[ char\enter_room(nroom) ] +970 41:[ end ] >> 38:[ for id, char in pairs(@members) ] +1049 44:[ local members = { } ] >> 42:[ members = {} ] +1080 45:[ for _, member in pairs(self.members) do ] >> 43:[ for _, member in pairs(@members) ] +1100 46:[ members[member.uname] = member:serialize() ] >> 44:[ members[member.uname] = member\serialize! ] +1064 47:[ end ] >> 43:[ for _, member in pairs(@members) ] +1144 48:[ return am.to_json(members) ] >> 45:[ am.to_json(members) ] +1191 51:[ local rp = Party() ] >> 48:[ rp = Party! ] +1205 52:[ local tbl = am.parse_json(data) ] >> 49:[ tbl = am.parse_json(data) ] +1254 53:[ for uname, payload in pairs(tbl) do ] >> 50:[ for uname, payload in pairs(tbl) ] +1269 54:[ local tchar = Character.deserialize(payload) ] >> 51:[ tchar = Character.deserialize(payload) ] +1311 55:[ rp:add_member(tchar) ] >> 52:[ rp\add_member(tchar) ] +1233 56:[ end ] >> 50:[ for uname, payload in pairs(tbl) ] +1334 57:[ return rp ] >> 53:[ rp ] +238 63:[ self.members = { } ] >> 12:[ @members = {} ] +254 64:[ self.rnode = am.group() ] >> 13:[ @rnode = am.group! ] +275 65:[ self.node = am.translate(0, 0) ] >> 14:[ @node = am.translate(0,0) ] +303 66:[ self.rnode:append(self.node) ] >> 15:[ @rnode\append(@node) ] +326 67:[ self.room = LobbyRoom() ] >> 16:[ @room = LobbyRoom! ] +1340 82:[ mod["Party"] = Party ] >> 57:[ mod["Party"] = Party ] +1361 83:[ return mod ] >> 58:[ mod ] diff --git a/debug/pixelize.lua.X b/debug/pixelize.lua.X new file mode 100644 index 0000000..a9cea53 --- /dev/null +++ b/debug/pixelize.lua.X @@ -0,0 +1,2 @@ +Pos Lua >> Moon + diff --git a/debug/player.lua.X b/debug/player.lua.X new file mode 100644 index 0000000..b2e4078 --- /dev/null +++ b/debug/player.lua.X @@ -0,0 +1,38 @@ +Pos Lua >> Moon +1 1:[ local char = require("char") ] >> 1:[ char = require "char" ] +23 2:[ local util = require("util") ] >> 2:[ util = require "util" ] +45 3:[ local main = require("main") ] >> 3:[ main = require "main" ] +67 4:[ local bp = require("broadphase") ] >> 4:[ bp = require "broadphase" ] +113 6:[ KeyInput = char.KeyInput ] >> 5:[ import KeyInput from char ] +135 8:[ Vec2 = util.Vec2 ] >> 6:[ import Vec2 from util ] +142 9:[ local mod = ... ] >> 8:[ mod = ... ] +227 13:[ local _parent_0 = char.Character ] >> 10:[ class RemotePlayer extends char.Character ] +279 19:[ return _class_0.__parent.__init(self, uname, data, charclass) ] >> 12:[ super(uname, data, charclass) ] +335 51:[ local _parent_0 = char.Character ] >> 14:[ class LocalPlayer extends char.Character ] +435 54:[ _class_0.__parent.__base.draw(self, ...) ] >> 19:[ super(...) ] +448 55:[ local healthnode = am.group() ^ { ] >> 20:[ healthnode = am.group() ^ {am.translate(-main.width/2,main.height/2) ^ am.text(string.format("Health:%d", @health), vec4(255,255,255,255), "left","top")\tag "health text"} ] +475 56:[ am.translate(-main.width / 2, main.height / 2) ^ am.text(string.format("Health:%d", self.health), vec4(255, 255, 255, 255), "left", "top"):tag("health text") ] >> 20:[ healthnode = am.group() ^ {am.translate(-main.width/2,main.height/2) ^ am.text(string.format("Health:%d", @health), vec4(255,255,255,255), "left","top")\tag "health text"} ] +448 57:[ } ] >> 20:[ healthnode = am.group() ^ {am.translate(-main.width/2,main.height/2) ^ am.text(string.format("Health:%d", @health), vec4(255,255,255,255), "left","top")\tag "health text"} ] +622 58:[ return self.node:append(healthnode) ] >> 21:[ @node\append(healthnode) ] +684 61:[ if am.current_time() - self.last_dammage > 1 then ] >> 24:[ if am.current_time! - @last_dammage > 1 ] +725 62:[ self.health = self.health - ammt ] >> 25:[ @health -= ammt ] +744 63:[ self.last_dammage = am.current_time(); ] >> 26:[ @last_dammage = am.current_time! ] +780 64:[ (self.node)("health text").text = string.format("Health:%d", self.health) ] >> 27:[ (@node)("health text").text = string.format("Health:%d",@health) ] +850 65:[ if self.health == 0 then ] >> 28:[ if @health == 0 ] +868 66:[ return self:die() ] >> 29:[ @\die! ] +848 67:[ end ] >> 28:[ if @health == 0 ] +682 68:[ end ] >> 24:[ if am.current_time! - @last_dammage > 1 ] +900 71:[ if other.canfall then ] >> 32:[ if other.canfall ] +918 72:[ return "cross" ] >> 33:[ return "cross" ] +898 73:[ end ] >> 32:[ if other.canfall ] +937 74:[ if other.hurtbox then ] >> 34:[ if other.hurtbox ] +957 75:[ if other.owner ~= self then ] >> 35:[ if other.owner ~= @ ] +979 76:[ self:take_damage(other, 1) ] >> 36:[ @take_damage(other,1) ] +955 77:[ end ] >> 35:[ if other.owner ~= @ ] +1004 78:[ return "cross" ] >> 37:[ return "cross" ] +1029 80:[ return "slide" ] >> 39:[ return "slide" ] +1155 84:[ return _class_0.__parent.__base.die(self, ...) ] >> 43:[ super(...) ] +386 91:[ return _class_0.__parent.__init(self, uname, data, charclass) ] >> 16:[ super(uname, data, charclass) ] +1169 120:[ mod["RemotePlayer"] = RemotePlayer ] >> 47:[ mod["RemotePlayer"] = RemotePlayer ] +1204 121:[ mod["LocalPlayer"] = LocalPlayer ] >> 48:[ mod["LocalPlayer"] = LocalPlayer ] +1237 122:[ return mod ] >> 49:[ mod ] diff --git a/debug/room.lua.X b/debug/room.lua.X new file mode 100644 index 0000000..00ec1e5 --- /dev/null +++ b/debug/room.lua.X @@ -0,0 +1,89 @@ +Pos Lua >> Moon +112 1:[ local main = require("main") ] >> 3:[ main = require "main" ] +134 2:[ local char = require("char") ] >> 4:[ char = require "char" ] +177 4:[ Character = char.Character ] >> 5:[ import Character from char ] +183 5:[ local mod = ... ] >> 6:[ mod = ... ] +1188 11:[ return table.insert(self.parties, party) ] >> 44:[ table.insert(@parties,party) ] +1241 14:[ return self.data.locations[n] ] >> 47:[ return @data.locations[n] ] +1290 17:[ return mod.SimpleRoom() ] >> 50:[ mod.SimpleRoom! ] +1496 20:[ local ser_tbl = { ] >> 58:[ ser_tbl = { ] +1516 21:[ name = self.__class.__name, ] >> 59:[ name:@@__name, ] +1534 22:[ data = self.data ] >> 60:[ data:@data ] +1496 23:[ } ] >> 58:[ ser_tbl = { ] +1613 24:[ for position, ptbl in pairs(ser_tbl.data.locations) do ] >> 63:[ for position, ptbl in pairs(ser_tbl.data.locations) ] +1668 25:[ for pid, character in pairs(ptbl) do ] >> 64:[ for pid, character in pairs(ptbl) ] +1687 26:[ if character.uname then ] >> 65:[ if character.uname ] +1709 27:[ ptbl[pid] = { ] >> 66:[ ptbl[pid] = {uname:character.uname} ] +1728 28:[ uname = character.uname ] >> 66:[ ptbl[pid] = {uname:character.uname} ] +1709 29:[ } ] >> 66:[ ptbl[pid] = {uname:character.uname} ] +1759 31:[ ptbl[pid] = character:serialize() ] >> 68:[ ptbl[pid] = character\serialize! ] +1647 33:[ end ] >> 64:[ for pid, character in pairs(ptbl) ] +1592 34:[ end ] >> 63:[ for position, ptbl in pairs(ser_tbl.data.locations) ] +1794 35:[ local ret = am.to_json(ser_tbl) ] >> 69:[ ret = am.to_json(ser_tbl) ] +1822 36:[ return ret ] >> 70:[ ret ] +1854 39:[ local tbl = am.parse_json(data) ] >> 73:[ tbl = am.parse_json(data) ] +1882 40:[ local typ = mod.Room.children[tbl.name] ] >> 74:[ typ = mod.Room.children[tbl.name] ] +1918 41:[ return typ(tbl.data) ] >> 75:[ typ(tbl.data) ] +1954 44:[ return string.format("<%s>", self.__class.__name) ] >> 78:[ return string.format("<%s>",@@__name) ] +778 50:[ self.parties = { } ] >> 30:[ @parties = {} ] +794 51:[ self.actions_taken = { } ] >> 31:[ @actions_taken = {} ] +816 52:[ self.special = { } ] >> 32:[ @special = {} ] +832 53:[ self.node = am.group() ] >> 33:[ @node = am.group! ] +852 54:[ self.data = data or { ] >> 34:[ @data = data or {locations: {{},{},{},{},{},{},{},{}}} ] +852 65:[ } ] >> 34:[ @data = data or {locations: {{},{},{},{},{},{},{},{}}} ] +930 66:[ for position, ptbl in pairs(self.data.locations) do ] >> 35:[ for position, ptbl in pairs(@data.locations) ] +978 67:[ for pid, character in pairs(ptbl) do ] >> 36:[ for pid, character in pairs(ptbl) ] +997 68:[ if character.uname then ] >> 37:[ if character.uname ] +1043 69:[ ptbl[pid] = main.world.player_party:member(character.uname) ] >> 39:[ ptbl[pid] = main.world.player_party\member(character.uname) ] +1117 71:[ ptbl[pid] = Character.deserialize(character) ] >> 41:[ ptbl[pid] = Character.deserialize(character) ] +957 73:[ end ] >> 36:[ for pid, character in pairs(ptbl) ] +909 74:[ end ] >> 35:[ for position, ptbl in pairs(@data.locations) ] +745 88:[ self.children = { } ] >> 28:[ @children = {} ] +1336 90:[ assert(child.distribute_party, "Rooms must be able to distribute parties") ] >> 53:[ assert(child.distribute_party, "Rooms must be able to distribute parties") ] +1413 91:[ self.__class.children[child.__name] = child ] >> 54:[ @@.children[child.__name] = child ] +1449 92:[ mod[child.__name] = child ] >> 55:[ mod[child.__name] = child ] +2016 99:[ local _parent_0 = Room ] >> 80:[ class LobbyRoom extends Room ] +2129 102:[ return main.root("bg"):append(self.node) ] >> 86:[ main.root("bg")\append(@node) ] +2175 105:[ return main.root("bg"):remove(self.node) ] >> 88:[ main.root("bg")\remove(@node) ] +2278 111:[ assert(position, "Position my not be nil") ] >> 94:[ assert(position, "Position my not be nil") ] +2323 112:[ return ((main.width / 9) * position) ] >> 95:[ ((main.width/9) * position) ] +2390 115:[ error("lobbyroom player_position_of") ] >> 98:[ error("lobbyroom player_position_of") ] +2430 116:[ assert(position, "Position may not be nil") ] >> 99:[ assert(position, "Position may not be nil") ] +2476 117:[ return -((main.width / 9) * position) ] >> 100:[ -((main.width/9) * position) ] +2039 124:[ _class_0.__parent.__init(self, ...) ] >> 82:[ super(...) ] +2052 125:[ self.floor_y = -208 ] >> 83:[ @floor_y = -208 ] +2070 126:[ return self.node:append(am.sprite("data/lobby_bg.png")) ] >> 84:[ @node\append(am.sprite("data/lobby_bg.png")) ] +2528 158:[ local _parent_0 = Room ] >> 102:[ class CampRoom extends Room ] +2683 161:[ return main.root("bg"):append(self.node) ] >> 109:[ main.root("bg")\append(@node) ] +2730 164:[ return main.root("bg"):remove(self.node) ] >> 112:[ main.root("bg")\remove(@node) ] +2815 167:[ for _, player in pairs(playerparty) do ] >> 115:[ for _,player in pairs(playerparty) ] +2838 168:[ table.insert(ret[player.position], player) ] >> 116:[ table.insert(ret[player.position],player) ] +2800 169:[ end ] >> 115:[ for _,player in pairs(playerparty) ] +2551 176:[ _class_0.__parent.__init(self, ...) ] >> 104:[ super(...) ] +2564 177:[ self.floor_y = -207 ] >> 105:[ @floor_y = -207 ] +2582 178:[ self.node:append(am.sprite("data/camp.png")) ] >> 106:[ @node\append(am.sprite("data/camp.png")) ] +2625 179:[ self.data.locations = { ] >> 107:[ @data.locations = {{},{},{},{},{},{},{},{}} ] +2625 188:[ } ] >> 107:[ @data.locations = {{},{},{},{},{},{},{},{}} ] +2905 220:[ local _parent_0 = Room ] >> 118:[ class SimpleRoom extends Room ] +3014 223:[ return main.root("bg"):append(self.node) ] >> 124:[ main.root("bg")\append(@node) ] +3061 226:[ return main.root("bg"):remove(self.node) ] >> 127:[ main.root("bg")\remove(@node) ] +3156 229:[ for _, player in pairs(playerparty.members) do ] >> 130:[ for _,player in pairs(playerparty.members) ] +3187 230:[ local loc = self.data.locations[5 - player.data.position] ] >> 131:[ loc = @data.locations[5-player.data.position] ] +3236 231:[ table.insert(loc, player) ] >> 132:[ table.insert(loc,player) ] +3264 232:[ player:set_location(loc) ] >> 133:[ player\set_location(loc) ] +3141 233:[ end ] >> 130:[ for _,player in pairs(playerparty.members) ] +3305 234:[ for _, enemy in pairs(enemyparty.members) do ] >> 134:[ for _,enemy in pairs(enemyparty.members) ] +3335 235:[ local loc = self.data.locations[enemy.data.position + 4] ] >> 135:[ loc = @data.locations[enemy.data.position+4] ] +3383 236:[ table.insert(loc, enemy) ] >> 136:[ table.insert(loc,enemy) ] +3410 237:[ enemy:set_location(loc) ] >> 137:[ enemy\set_location(loc) ] +3291 238:[ end ] >> 134:[ for _,enemy in pairs(enemyparty.members) ] +3473 241:[ assert(position, "Position may not be nil") ] >> 140:[ assert(position, "Position may not be nil") ] +3519 242:[ return -((main.width / 9) * position) ] >> 141:[ -((main.width/9) * position) ] +3585 245:[ assert(position, "Position my not be nil") ] >> 144:[ assert(position, "Position my not be nil") ] +3630 246:[ return ((main.width / 9) * position) ] >> 145:[ ((main.width/9) * position) ] +2928 253:[ _class_0.__parent.__init(self, ...) ] >> 120:[ super(...) ] +2941 254:[ self.floor_y = -207 ] >> 121:[ @floor_y = -207 ] +2959 255:[ return self.node:append(am.sprite("data/room.png")) ] >> 122:[ @node\append(am.sprite("data/room.png")) ] +3661 284:[ mod.Room = Room ] >> 149:[ mod.Room = Room ] +3677 285:[ mod.SimpleRoom = SimpleRoom ] >> 150:[ mod.SimpleRoom = SimpleRoom ] +3706 286:[ return mod ] >> 152:[ mod ] diff --git a/debug/ui.lua.X b/debug/ui.lua.X new file mode 100644 index 0000000..a4c941d --- /dev/null +++ b/debug/ui.lua.X @@ -0,0 +1,247 @@ +Pos Lua >> Moon +24 1:[ local bp = require("broadphase") ] >> 2:[ bp = require "broadphase" ] +50 2:[ local main = require("main") ] >> 3:[ main = require "main" ] +72 3:[ local action = require("action") ] >> 4:[ action = require "action" ] +98 4:[ local color = require("color") ] >> 5:[ color = require "color" ] +122 5:[ local reg = require("ability_reg") ] >> 6:[ reg = require "ability_reg" ] +150 6:[ local char = require("char") ] >> 7:[ char = require "char" ] +189 8:[ Enemy = char.Enemy ] >> 8:[ import Enemy from char ] +195 9:[ local mod = ... ] >> 9:[ mod = ... ] +206 10:[ mod.big_frame_top_left = { ] >> 11:[ mod.big_frame_top_left = { ] +242 11:[ texture = "ui.png", ] >> 12:[ texture: "ui.png", ] +257 12:[ s1 = 0, ] >> 13:[ s1: 0 ] +264 13:[ t1 = 0, ] >> 14:[ t1: 0 ] +271 14:[ s2 = 0, ] >> 15:[ s2: 0 ] +278 15:[ t2 = 0 ] >> 16:[ t2: 0 ] +206 16:[ } ] >> 11:[ mod.big_frame_top_left = { ] +375 17:[ mod.create_big_button = function(node, segments, x, y) ] >> 20:[ mod.create_big_button = (node, segments, x, y) -> ] +439 18:[ local section_width = 32 ] >> 22:[ section_width = 32 ] +460 19:[ local ret = { } ] >> 24:[ ret = {} ] +470 20:[ local trans = am.translate(x, y) ] >> 25:[ trans = am.translate(x,y) ] +497 21:[ local button = am.group() ] >> 26:[ button = am.group! ] +517 22:[ button:append(trans ^ am.sprite("data/big_frame_top_left.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 27:[ button\append(trans^ am.sprite("data/big_frame_top_left.png",vec4(1,1,1,1),"left","top")) ] +615 23:[ for i = 1, segments - 2 do ] >> 28:[ for i = 1,segments - 2 ] +633 24:[ button:append(am.translate(((-32) * (segments / 2)) + 32 * i, y) ^ am.sprite("data/big_frame_top_mid.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 29:[ button\append(am.translate(((-32)*(segments/2)) + 32*i,y)^ am.sprite("data/big_frame_top_mid.png",vec4(1,1,1,1),"left","top")) ] +608 25:[ end ] >> 28:[ for i = 1,segments - 2 ] +761 26:[ button:append(am.translate((32 * ((segments / 2) - 1)), y) ^ am.sprite("data/big_frame_top_right.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 30:[ button\append(am.translate((32*((segments/2)-1)),y)^ am.sprite("data/big_frame_top_right.png",vec4(1,1,1,1),"left","top")) ] +885 27:[ ret["node"] = button ] >> 31:[ ret["node"] = button ] +907 28:[ bp.add(ret, x, y, segments * 32, 64) ] >> 32:[ bp.add(ret,x,y,segments*32,64) ] +939 29:[ node:append(button) ] >> 33:[ node\append(button) ] +960 30:[ return ret ] >> 34:[ ret ] +375 31:[ end ] >> 20:[ mod.create_big_button = (node, segments, x, y) -> ] +966 32:[ mod.create_small_button = function(node, segments, x, y) ] >> 37:[ mod.create_small_button = (node, segments, x, y) -> ] +1019 33:[ assert(node ~= nil, "node was nil") ] >> 38:[ assert(node ~= nil, "node was nil") ] +1056 34:[ assert(type(segments) == "number", "segments must be a numbeR") ] >> 39:[ assert(type(segments) == "number","segments must be a numbeR") ] +1120 35:[ assert(segments > 1, "segments must be at least 2") ] >> 40:[ assert(segments > 1, "segments must be at least 2") ] +1186 36:[ local section_width = 18 ] >> 42:[ section_width = 18 ] +1206 37:[ local section_height = 40 ] >> 43:[ section_height = 40 ] +1228 38:[ local ret = { } ] >> 45:[ ret = {} ] +1238 39:[ local trans = am.translate(x, y) ] >> 46:[ trans = am.translate(x,y) ] +1265 40:[ local button = am.group() ] >> 47:[ button = am.group! ] +1285 41:[ button:append(trans ^ am.sprite("data/small_frame_left.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 48:[ button\append(trans^ am.sprite("data/small_frame_left.png",vec4(1,1,1,1),"left","top")) ] +1381 42:[ for i = 1, segments - 2 do ] >> 49:[ for i = 1,segments - 2 ] +1399 43:[ button:append(am.translate(x + (section_width * i), y) ^ am.sprite("data/small_frame_mid.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 50:[ button\append(am.translate(x + (section_width*i),y)^ am.sprite("data/small_frame_mid.png",vec4(1,1,1,1),"left","top")) ] +1374 44:[ end ] >> 49:[ for i = 1,segments - 2 ] +1519 45:[ button:append(am.translate(x + (section_width * (segments - 1)), y) ^ am.sprite("data/small_frame_right.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 51:[ button\append(am.translate(x+(section_width*(segments - 1)),y)^ am.sprite("data/small_frame_right.png",vec4(1,1,1,1),"left","top")) ] +1652 46:[ ret["node"] = button ] >> 52:[ ret["node"] = button ] +1674 47:[ bp.add(ret, x, y, segments * section_width, section_height) ] >> 53:[ bp.add(ret,x,y,segments*section_width,section_height) ] +1729 48:[ node:append(button) ] >> 54:[ node\append(button) ] +1750 49:[ return ret ] >> 55:[ ret ] +966 50:[ end ] >> 37:[ mod.create_small_button = (node, segments, x, y) -> ] +1755 51:[ mod.create_any_button = function(node, x_segs, y_segs, x, y) ] >> 57:[ mod.create_any_button = (node, x_segs, y_segs, x, y) -> ] +1812 52:[ assert(x_segs >= 2, "x must have at least 2 segments") ] >> 58:[ assert(x_segs >= 2, "x must have at least 2 segments") ] +1868 53:[ assert(y_segs >= 2, "y must have at leats 2 segments") ] >> 59:[ assert(y_segs >= 2, "y must have at leats 2 segments") ] +1924 54:[ local section_width, section_height = 32, 32 ] >> 60:[ section_width, section_height = 32,32 ] +1963 55:[ local ret = { } ] >> 61:[ ret = {} ] +1973 56:[ local button = am.group() ] >> 62:[ button = am.group! ] +1993 57:[ button:append(am.translate(x, y) ^ am.sprite("data/any_frame_top_left.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 63:[ button\append(am.translate(x,y)^ am.sprite("data/any_frame_top_left.png",vec4(1,1,1,1),"left","top")) ] +2103 58:[ for i = 1, x_segs - 2 do ] >> 64:[ for i = 1, x_segs - 2 ] +2120 59:[ button:append(am.translate(x + (i * section_width), y) ^ am.sprite("data/any_frame_top_mid.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 65:[ button\append(am.translate(x + (i * section_width),y)^ am.sprite("data/any_frame_top_mid.png",vec4(1,1,1,1),"left","top")) ] +2096 60:[ end ] >> 64:[ for i = 1, x_segs - 2 ] +2244 61:[ button:append(am.translate(x + ((x_segs - 1) * section_width), y) ^ am.sprite("data/any_frame_top_right.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 66:[ button\append(am.translate(x + ((x_segs-1)*section_width),y)^ am.sprite("data/any_frame_top_right.png",vec4(1,1,1,1),"left","top")) ] +2384 62:[ for i = 1, y_segs - 2 do ] >> 67:[ for i = 1, y_segs - 2 ] +2401 63:[ button:append(am.translate(x, y - (i * section_height)) ^ am.sprite("data/any_frame_mid_left.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 68:[ button\append(am.translate(x,y - (i * section_height))^ am.sprite("data/any_frame_mid_left.png",vec4(1,1,1,1),"left","top")) ] +2535 64:[ for j = 1, x_segs - 2 do ] >> 69:[ for j = 1, x_segs - 2 ] +2553 65:[ button:append(am.translate(x + (j * section_width), y - (i * section_height)) ^ am.sprite("data/any_frame_mid_mid.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 70:[ button\append(am.translate(x + (j * section_width),y - (i * section_height))^ am.sprite("data/any_frame_mid_mid.png",vec4(1,1,1,1),"left","top")) ] +2528 66:[ end ] >> 69:[ for j = 1, x_segs - 2 ] +2701 67:[ button:append(am.translate(x + ((x_segs - 1) * section_width), y - (i * section_height)) ^ am.sprite("data/any_frame_mid_right.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 71:[ button\append(am.translate(x + ((x_segs-1)*section_width),y - (i * section_height))^ am.sprite("data/any_frame_mid_right.png",vec4(1,1,1,1),"left","top")) ] +2377 68:[ end ] >> 67:[ for i = 1, y_segs - 2 ] +2857 69:[ button:append(am.translate(x, y - ((y_segs - 1) * section_height)) ^ am.sprite("data/any_frame_bot_left.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 72:[ button\append(am.translate(x,y - ((y_segs-1)*section_height))^ am.sprite("data/any_frame_bot_left.png",vec4(1,1,1,1),"left","top")) ] +2997 70:[ for i = 1, x_segs - 2 do ] >> 73:[ for i = 1, x_segs - 2 ] +3014 71:[ button:append(am.translate(x + (i * section_width), y - ((y_segs - 1) * section_height)) ^ am.sprite("data/any_frame_bot_mid.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 74:[ button\append(am.translate(x + (i * section_width),y - ((y_segs-1)*section_height))^ am.sprite("data/any_frame_bot_mid.png",vec4(1,1,1,1),"left","top")) ] +2990 72:[ end ] >> 73:[ for i = 1, x_segs - 2 ] +3168 73:[ button:append(am.translate(x + ((x_segs - 1) * section_width), y - ((y_segs - 1) * section_height)) ^ am.sprite("data/any_frame_bot_right.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 75:[ button\append(am.translate(x+((x_segs-1)*section_width),y - ((y_segs-1)*section_height))^ am.sprite("data/any_frame_bot_right.png",vec4(1,1,1,1),"left","top")) ] +3329 74:[ button:append(am.translate(x, y):tag("loc")) ] >> 76:[ button\append(am.translate(x,y)\tag("loc")) ] +3374 75:[ ret["node"] = button ] >> 77:[ ret["node"] = button ] +3396 76:[ bp.add(ret, x, y, x_segs * section_width, y_segs * section_height) ] >> 78:[ bp.add(ret,x,y,x_segs*section_width,y_segs*section_height) ] +3456 77:[ node:append(button) ] >> 79:[ node\append(button) ] +3477 78:[ return ret ] >> 80:[ ret ] +1755 79:[ end ] >> 57:[ mod.create_any_button = (node, x_segs, y_segs, x, y) -> ] +3482 80:[ mod.create_char_selector2 = function(node) ] >> 82:[ mod.create_char_selector2 = (node) -> ] +3521 81:[ local left = mod.create_any_button(node, 2, 2, 96, 100) ] >> 83:[ left = mod.create_any_button(node,2,2,96,100) ] +3568 82:[ local right = mod.create_any_button(node, 2, 2, -96 - (32 * 2), 100) ] >> 84:[ right = mod.create_any_button(node,2,2,-96-(32*2),100) ] +3624 83:[ local text = am.text("Loading...", vec4(1, 1, 1, 1), "center", "top") ] >> 85:[ text = am.text("Loading...",vec4(1,1,1,1),"center","top") ] +3683 84:[ node:append(am.translate(0, 100) ^ text) ] >> 86:[ node\append(am.translate(0,100)^ text) ] +3724 86:[ left, ] >> 87:[ {left, right, text} ] +3729 87:[ right, ] >> 87:[ {left, right, text} ] +3736 88:[ text ] >> 87:[ {left, right, text} ] +3482 90:[ end ] >> 82:[ mod.create_char_selector2 = (node) -> ] +3744 91:[ mod.create_lobby_player = function(node, peerid) ] >> 89:[ mod.create_lobby_player = (node, peerid) -> ] +3789 92:[ local floor_y = -200 ] >> 90:[ floor_y = -200 ] +3805 93:[ local rng_x = math.random(main.width) - (main.width / 2) ] >> 91:[ rng_x = math.random(main.width) - (main.width/2) ] +3744 94:[ end ] >> 89:[ mod.create_lobby_player = (node, peerid) -> ] +3855 95:[ mod.create_char_selector = function(node) ] >> 93:[ mod.create_char_selector = (node) -> ] +3893 96:[ local s = am.group() ] >> 94:[ s = am.group! ] +3908 97:[ local slx = (-96 / 2) - 18 ] >> 95:[ slx = (-96/2)-18 ] +3926 98:[ local sly = (96 / 2) ] >> 96:[ sly = (96/2) ] +3940 99:[ local srx = (96 / 2) ] >> 97:[ srx = (96/2) ] +3954 100:[ local sry = (96 / 2) ] >> 98:[ sry = (96/2) ] +3968 101:[ local scroll_left_node = am.translate(slx, sly) ^ am.sprite("data/selector_left.png", vec4(1, 1, 1, 1), "left", "top") ] >> 99:[ scroll_left_node = am.translate(slx,sly)^ am.sprite("data/selector_left.png", vec4(1,1,1,1), "left","top") ] +4076 102:[ local scroll_left = { ] >> 100:[ scroll_left = { ] +4099 103:[ node = scroll_left_node ] >> 101:[ node: scroll_left_node ] +4076 104:[ } ] >> 100:[ scroll_left = { ] +4121 105:[ local scroll_right_node = am.translate(srx, sry) ^ am.sprite("data/selector_right.png", vec4(1, 1, 1, 1), "left", "top") ] >> 103:[ scroll_right_node = am.translate(srx,sry)^ am.sprite("data/selector_right.png", vec4(1,1,1,1), "left","top") ] +4231 106:[ local scroll_right = { ] >> 104:[ scroll_right = { ] +4255 107:[ node = scroll_right_node ] >> 105:[ node: scroll_right_node ] +4231 108:[ } ] >> 104:[ scroll_right = { ] +4278 109:[ s:append(scroll_left_node) ] >> 107:[ s\append(scroll_left_node) ] +4306 110:[ s:append(scroll_right_node) ] >> 108:[ s\append(scroll_right_node) ] +4335 111:[ bp.add(scroll_left, slx, sly, 18, 40) ] >> 109:[ bp.add(scroll_left,slx,sly,18,40) ] +4370 112:[ bp.add(scroll_right, srx, sry, 18, 40) ] >> 110:[ bp.add(scroll_right,srx,sry,18,40) ] +4406 113:[ node:append(s) ] >> 111:[ node\append(s) ] +4423 115:[ scroll_left, ] >> 112:[ {scroll_left, scroll_right} ] +4435 116:[ scroll_right ] >> 112:[ {scroll_left, scroll_right} ] +3855 118:[ end ] >> 93:[ mod.create_char_selector = (node) -> ] +4451 119:[ mod.fadeout = function() ] >> 114:[ mod.fadeout = () -> ] +4472 120:[ local fadeout_walltime = 0.1 ] >> 115:[ fadeout_walltime = 0.1 ] +4496 121:[ local screen = main.root("screen") ] >> 116:[ screen = main.root("screen") ] +4526 122:[ local hw = main.width / 2 ] >> 117:[ hw = main.width/2 ] +4545 123:[ local hh = main.height / 2 ] >> 118:[ hh = main.height/2 ] +4565 124:[ local bg = color.bg ] >> 119:[ bg = color.bg ] +4580 125:[ local start_color = vec4(bg.r, bg.g, bg.b, 0) ] >> 120:[ start_color = vec4(bg.r,bg.g,bg.b,0) ] +4618 126:[ local fadeout = am.rect(-hw, hh, hw, -hh, color.bg):tag("fade") ] >> 121:[ fadeout = am.rect(-hw,hh,hw,-hh,color.bg)\tag("fade") ] +4673 127:[ return screen:action(am.tween(0.1, { ] >> 122:[ screen\action(am.tween(0.1, { ] +4711 128:[ color = color.bg ] >> 123:[ color: color.bg ] +4673 129:[ })) ] >> 122:[ screen\action(am.tween(0.1, { ] +4451 130:[ end ] >> 114:[ mod.fadeout = () -> ] +4727 131:[ mod.fadein = function() ] >> 126:[ mod.fadein = () -> ] +4747 132:[ local fadein_walltime = 0.1 ] >> 127:[ fadein_walltime = 0.1 ] +4770 133:[ local fade = main.root("fade") ] >> 128:[ fade = main.root("fade") ] +4796 134:[ return fade:action(am.tween(0.1, { ] >> 129:[ fade\action(am.tween(0.1, { ] +4832 135:[ color = color.transparent ] >> 130:[ color: color.transparent ] +4796 136:[ })) ] >> 129:[ fade\action(am.tween(0.1, { ] +4727 137:[ end ] >> 126:[ mod.fadein = () -> ] +4857 138:[ mod.create_join_input = function(node) ] >> 133:[ mod.create_join_input = (node) -> ] +4892 139:[ local segments = 3 ] >> 134:[ segments=3 ] +4904 140:[ local button_width = segments * 18 ] >> 135:[ button_width = segments*18 ] +4932 141:[ local button_height = 40 ] >> 136:[ button_height = 40 ] +4952 142:[ local cell_padding = 18 ] >> 137:[ cell_padding = 18 ] +4971 143:[ local grid_w = 4 ] >> 138:[ grid_w = 4 ] +4983 144:[ local grid_h = 4 ] >> 139:[ grid_h = 4 ] +4995 145:[ local buttons = { } ] >> 140:[ buttons = {} ] +5056 146:[ local start_x = cell_padding - ((grid_w / 2) * button_width) - (((grid_w - 1) / 2) * cell_padding) ] >> 142:[ start_x = cell_padding - ((grid_w/2) * button_width) - (((grid_w - 1)/2) * cell_padding) ] +5146 147:[ local start_y = 0 + ((grid_h / 2) * button_height) + (((grid_h - 1) / 2) * cell_padding) ] >> 143:[ start_y = 0 + ((grid_h/2) * button_height) + (((grid_h - 1)/2) * cell_padding) ] +5233 148:[ for i = 0, grid_h - 1 do ] >> 144:[ for i = 0,grid_h - 1 ] +5256 149:[ for j = 0, grid_w - 1 do ] >> 145:[ for j = 0, grid_w - 1 ] +5274 150:[ local button_x = start_x + (j * button_width) + ((j - 1) * cell_padding) ] >> 146:[ button_x = start_x + (j * button_width) + ((j-1) * cell_padding) ] +5342 151:[ local button_y = start_y - (i * button_height) - ((i - 1) * cell_padding) ] >> 147:[ button_y = start_y - (i * button_height) - ((i-1) * cell_padding) ] +5411 152:[ local small_button = mod.create_small_button(node, 3, button_x, button_y) ] >> 148:[ small_button = mod.create_small_button(node,3,button_x,button_y) ] +5479 153:[ table.insert(buttons, small_button) ] >> 149:[ table.insert(buttons, small_button) ] +5518 154:[ local rnode = small_button.node ] >> 150:[ rnode = small_button.node ] +5547 155:[ local text_map = { ] >> 151:[ text_map = { ] +5564 156:[ "0", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5568 157:[ "1", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5572 158:[ "2", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5576 159:[ "3", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5580 160:[ "4", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5584 161:[ "5", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5588 162:[ "6", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5592 163:[ "7", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5596 164:[ "8", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5600 165:[ "9", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5604 166:[ "a", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5608 167:[ "b", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5612 168:[ "c", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5616 169:[ "d", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5620 170:[ "e", ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5624 171:[ "f" ] >> 152:[ "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" ] +5547 172:[ } ] >> 151:[ text_map = { ] +5636 173:[ local bt = text_map[(i * grid_w) + j + 1] ] >> 154:[ bt = text_map[(i * grid_w) + j + 1] ] +5675 174:[ rnode:append(am.translate(button_x + 16, button_y - 10) ^ am.text(bt, vec4(1, 1, 1, 1), "left", "top")) ] >> 155:[ rnode\append(am.translate(button_x+16,button_y-10)^ am.text(bt,vec4(1,1,1,1),"left","top")) ] +5770 175:[ small_button["text"] = bt ] >> 156:[ small_button["text"] = bt ] +5249 176:[ end ] >> 145:[ for j = 0, grid_w - 1 ] +5226 177:[ end ] >> 144:[ for i = 0,grid_h - 1 ] +5801 178:[ local selected = mod.create_big_button(node, 6, -32 * 3, -100) ] >> 158:[ selected = mod.create_big_button(node,6,-32*3,-100) ] +5854 179:[ return buttons ] >> 159:[ buttons ] +4857 180:[ end ] >> 133:[ mod.create_join_input = (node) -> ] +5863 181:[ mod.tween_hit = function(char, target, at_f) ] >> 161:[ mod.tween_hit = (char, target, at_f) -> -- char is a character, target is a location (number) ] +5958 182:[ local x_from, x_to = char.node("char_translate").x, 0 ] >> 162:[ x_from, x_to = char.node("char_translate").x, 0 ] +6007 183:[ local room = char.room ] >> 163:[ room = char.room ] +6027 184:[ if char.__class == Enemy then ] >> 164:[ if char.__class == Enemy then ] +6113 185:[ x_to = room:player_location_of(target) ] >> 166:[ x_to = room\player_location_of(target) ] +6217 187:[ x_to = room:enemy_location_of(target) ] >> 169:[ x_to = room\enemy_location_of(target) ] +6256 189:[ am.wait(am.tween(char.node("char_translate"), 0.1, { ] >> 170:[ am.wait(am.tween(char.node("char_translate"), 0.1, {x: x_to},am.windup)) ] +6310 190:[ x = x_to ] >> 170:[ am.wait(am.tween(char.node("char_translate"), 0.1, {x: x_to},am.windup)) ] +6256 191:[ }, am.windup)) ] >> 170:[ am.wait(am.tween(char.node("char_translate"), 0.1, {x: x_to},am.windup)) ] +6332 192:[ if at_f then ] >> 171:[ if at_f ] +6340 193:[ at_f() ] >> 172:[ at_f! ] +6330 194:[ end ] >> 171:[ if at_f ] +6347 195:[ return am.wait(am.tween(char.node("char_translate"), 0.1, { ] >> 173:[ am.wait(am.tween(char.node("char_translate"), 0.1, {x: x_from},am.linear)) ] +6401 196:[ x = x_from ] >> 173:[ am.wait(am.tween(char.node("char_translate"), 0.1, {x: x_from},am.linear)) ] +6347 197:[ }, am.linear)) ] >> 173:[ am.wait(am.tween(char.node("char_translate"), 0.1, {x: x_from},am.linear)) ] +5863 198:[ end ] >> 161:[ mod.tween_hit = (char, target, at_f) -> -- char is a character, target is a location (number) ] +6423 199:[ mod.build_infocard = function(node, ability) ] >> 175:[ mod.build_infocard = (node, ability) -> ] +6464 200:[ local x_segs = 10 ] >> 176:[ x_segs = 10 ] +6477 201:[ local y_segs = 4 ] >> 177:[ y_segs = 4 ] +6489 202:[ local x = -310 ] >> 178:[ x = -310 ] +6499 203:[ local y = 80 ] >> 179:[ y = 80 ] +6508 204:[ local section_width, section_height = 32, 32 ] >> 180:[ section_width, section_height = 32,32 ] +6547 205:[ local button = am.group() ] >> 181:[ button = am.group! ] +6567 206:[ button:append(am.translate(x, y) ^ am.sprite("data/any_frame_top_left.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 182:[ button\append(am.translate(x,y)^ am.sprite("data/any_frame_top_left.png",vec4(1,1,1,1),"left","top")) ] +6677 207:[ for i = 1, x_segs - 2 do ] >> 183:[ for i = 1, x_segs - 2 ] +6694 208:[ button:append(am.translate(x + (i * section_width), y) ^ am.sprite("data/any_frame_top_mid.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 184:[ button\append(am.translate(x + (i * section_width),y)^ am.sprite("data/any_frame_top_mid.png",vec4(1,1,1,1),"left","top")) ] +6670 209:[ end ] >> 183:[ for i = 1, x_segs - 2 ] +6818 210:[ button:append(am.translate(x + ((x_segs - 1) * section_width), y) ^ am.sprite("data/any_frame_top_right.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 185:[ button\append(am.translate(x + ((x_segs-1)*section_width),y)^ am.sprite("data/any_frame_top_right.png",vec4(1,1,1,1),"left","top")) ] +6958 211:[ for i = 1, y_segs - 2 do ] >> 186:[ for i = 1, y_segs - 2 ] +6975 212:[ button:append(am.translate(x, y - (i * section_height)) ^ am.sprite("data/any_frame_mid_left.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 187:[ button\append(am.translate(x,y - (i * section_height))^ am.sprite("data/any_frame_mid_left.png",vec4(1,1,1,1),"left","top")) ] +7109 213:[ for j = 1, x_segs - 2 do ] >> 188:[ for j = 1, x_segs - 2 ] +7127 214:[ button:append(am.translate(x + (j * section_width), y - (i * section_height)) ^ am.sprite("data/any_frame_mid_mid.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 189:[ button\append(am.translate(x + (j * section_width),y - (i * section_height))^ am.sprite("data/any_frame_mid_mid.png",vec4(1,1,1,1),"left","top")) ] +7102 215:[ end ] >> 188:[ for j = 1, x_segs - 2 ] +7275 216:[ button:append(am.translate(x + ((x_segs - 1) * section_width), y - (i * section_height)) ^ am.sprite("data/any_frame_mid_right.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 190:[ button\append(am.translate(x + ((x_segs-1)*section_width),y - (i * section_height))^ am.sprite("data/any_frame_mid_right.png",vec4(1,1,1,1),"left","top")) ] +6951 217:[ end ] >> 186:[ for i = 1, y_segs - 2 ] +7431 218:[ button:append(am.translate(x, y - ((y_segs - 1) * section_height)) ^ am.sprite("data/any_frame_bot_left.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 191:[ button\append(am.translate(x,y - ((y_segs-1)*section_height))^ am.sprite("data/any_frame_bot_left.png",vec4(1,1,1,1),"left","top")) ] +7571 219:[ for i = 1, x_segs - 2 do ] >> 192:[ for i = 1, x_segs - 2 ] +7588 220:[ button:append(am.translate(x + (i * section_width), y - ((y_segs - 1) * section_height)) ^ am.sprite("data/any_frame_bot_mid.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 193:[ button\append(am.translate(x + (i * section_width),y - ((y_segs-1)*section_height))^ am.sprite("data/any_frame_bot_mid.png",vec4(1,1,1,1),"left","top")) ] +7564 221:[ end ] >> 192:[ for i = 1, x_segs - 2 ] +7742 222:[ button:append(am.translate(x + ((x_segs - 1) * section_width), y - ((y_segs - 1) * section_height)) ^ am.sprite("data/any_frame_bot_right.png", vec4(1, 1, 1, 1), "left", "top")) ] >> 194:[ button\append(am.translate(x+((x_segs-1)*section_width),y - ((y_segs-1)*section_height))^ am.sprite("data/any_frame_bot_right.png",vec4(1,1,1,1),"left","top")) ] +7903 223:[ button:append(am.translate(x, y):tag("loc")) ] >> 195:[ button\append(am.translate(x,y)\tag("loc")) ] +7948 224:[ button("loc"):append(am.scale(2) ^ am.translate(16, -8) ^ am.text(ability.text, color.fg, "left", "top")) ] >> 196:[ button("loc")\append(am.scale(2)^ am.translate(16,-8)^ am.text(ability.text, color.fg, "left","top")) ] +8051 225:[ button("loc"):append(am.scale(1) ^ am.translate(16, -48) ^ am.text(ability.description, color.fg, "left", "top")) ] >> 197:[ button("loc")\append(am.scale(1)^ am.translate(16,-48)^ am.text(ability.description, color.fg, "left","top")) ] +8162 226:[ button("loc"):append(am.scale(1) ^ am.translate(16, -80) ^ am.text("Speed:" .. tostring(ability.speed), color.fg, "left", "top")) ] >> 198:[ button("loc")\append(am.scale(1)^ am.translate(16,-80)^ am.text("Speed:" .. tostring(ability.speed), color.fg, "left","top")) ] +8289 227:[ button("loc"):append(am.scale(1) ^ am.translate(16, -108) ^ am.text("Hits:", color.fg, "left", "center")) ] >> 199:[ button("loc")\append(am.scale(1)^ am.translate(16,-108)^ am.text("Hits:",color.fg,"left","center")) ] +8397 228:[ for i = 1, 8 do ] >> 200:[ for i = 1,8 ] +8404 229:[ button("loc"):append(am.translate(42 + (i * 24), -96) ^ am.sprite("data/pip_frame.png", color.white, "left", "top")) ] >> 201:[ button("loc")\append(am.translate(42 + (i*24), -96)^ am.sprite("data/pip_frame.png",color.white,"left","top")) ] +8519 230:[ if ability.hits_icon[i] == 1 then ] >> 202:[ if ability.hits_icon[i] == 1 ] +8549 231:[ button("loc"):append(am.translate(42 + (i * 24), -96) ^ am.sprite("data/pip_light.png", color.white, "left", "top")) ] >> 203:[ button("loc")\append(am.translate(42 + (i*24), -96)^ am.sprite("data/pip_light.png",color.white,"left","top")) ] +8517 232:[ end ] >> 202:[ if ability.hits_icon[i] == 1 ] +8390 233:[ end ] >> 200:[ for i = 1,8 ] +8662 234:[ node:append(button) ] >> 205:[ node\append(button) ] +8683 235:[ return button ] >> 206:[ button ] +6423 236:[ end ] >> 175:[ mod.build_infocard = (node, ability) -> ] +8693 237:[ mod.battle_log = function(text) ] >> 209:[ mod.battle_log = (text) -> ] +8721 238:[ local sx, sy = math.random(-100, 100), math.random(-40, 40) ] >> 210:[ sx, sy = math.random(-100,100), math.random(-40,40) ] +8774 239:[ local trans = am.translate(sx, sy) ] >> 211:[ trans = am.translate(sx,sy) ] +8803 240:[ trans:action(am.tween(3, { ] >> 212:[ trans\action(am.tween(3,{y:sy + 40})) ] +8830 241:[ y = sy + 40 ] >> 212:[ trans\action(am.tween(3,{y:sy + 40})) ] +8803 242:[ })) ] >> 212:[ trans\action(am.tween(3,{y:sy + 40})) ] +8842 243:[ local t = am.text(text, color.fg) ] >> 213:[ t = am.text(text, color.fg) ] +8871 244:[ t:action(am.tween(3, { ] >> 214:[ t\action(am.tween(3,{color:color.transparent})) ] +8898 245:[ color = color.transparent ] >> 214:[ t\action(am.tween(3,{color:color.transparent})) ] +8871 246:[ })) ] >> 214:[ t\action(am.tween(3,{color:color.transparent})) ] +8920 247:[ t:action(coroutine.create(function() ] >> 215:[ t\action(coroutine.create( () -> ] +8955 248:[ am.wait(am.delay(4)) ] >> 216:[ am.wait(am.delay(4)) ] +8978 249:[ return main.root("screen"):remove(trans) ] >> 217:[ main.root("screen")\remove(trans) ] +8920 250:[ end)) ] >> 215:[ t\action(coroutine.create( () -> ] +9017 251:[ return main.root("screen"):append(trans ^ t) ] >> 219:[ main.root("screen")\append(trans^ t) ] +8693 252:[ end ] >> 209:[ mod.battle_log = (text) -> ] +9055 253:[ return mod ] >> 221:[ mod ] diff --git a/debug/util.lua.X b/debug/util.lua.X new file mode 100644 index 0000000..de80fa8 --- /dev/null +++ b/debug/util.lua.X @@ -0,0 +1,26 @@ +Pos Lua >> Moon +24 1:[ local mod = ... ] >> 3:[ mod = ... ] +64 9:[ self.x = x or 0 ] >> 7:[ @x = x or 0 ] +78 10:[ self.y = y or 0 ] >> 8:[ @y = y or 0 ] +92 11:[ self.z = z or 0 ] >> 9:[ @z = z or 0 ] +171 31:[ return math.abs(self.x * self.y) ] >> 15:[ area: () => math.abs(@x * @y) ] +209 34:[ return Vec2(a.x - b.x, a.y - b.y) ] >> 17:[ Vec2(a.x-b.x,a.y-b.y) ] +250 37:[ return Vec2(a.x + b.x, a.y + b.y) ] >> 19:[ Vec2(a.x + b.x, a.y + b.y) ] +133 43:[ self.x = x or 0 ] >> 13:[ @x = x or 0 ] +147 44:[ self.y = y or 0 ] >> 14:[ @y = y or 0 ] +343 59:[ local drawable ] >> 24:[ drawable = (c) -> ] +343 60:[ drawable = function(c) ] >> 24:[ drawable = (c) -> ] +362 61:[ return assert(c.sprite or c.anim) ] >> 25:[ assert(c.sprite or c.anim) ] +343 62:[ end ] >> 24:[ drawable = (c) -> ] +390 63:[ local anim_co ] >> 27:[ anim_co = (a) -> ] +390 64:[ anim_co = function(a) ] >> 27:[ anim_co = (a) -> ] +413 65:[ while true do ] >> 28:[ while true ] +421 66:[ a.keyframe = math.floor(am.current_time() * 4) % #(a.anim) ] >> 29:[ a.keyframe = math.floor(am.current_time()*4) % #(a.anim) ] +480 67:[ assert(a.anim[a.keyframe + 1], "Failed to find an appropriate image to draw.") ] >> 30:[ assert(a.anim[a.keyframe + 1], "Failed to find an appropriate image to draw.") ] +561 68:[ a.node:replace("sprite", am.sprite(a.anim[a.keyframe + 1]):tag("sprite")) ] >> 31:[ a.node\replace("sprite",am.sprite(a.anim[a.keyframe + 1])\tag "sprite") ] +635 69:[ coroutine.yield() ] >> 32:[ coroutine.yield() ] +408 70:[ end ] >> 28:[ while true ] +390 71:[ end ] >> 27:[ anim_co = (a) -> ] +655 72:[ mod["Vec2"] = Vec2 ] >> 35:[ mod["Vec2"] = Vec2 ] +674 73:[ mod["Vec3"] = Vec3 ] >> 36:[ mod["Vec3"] = Vec3 ] +693 74:[ return mod ] >> 37:[ mod ] diff --git a/debug/world.lua.X b/debug/world.lua.X new file mode 100644 index 0000000..524eaf3 --- /dev/null +++ b/debug/world.lua.X @@ -0,0 +1,376 @@ +Pos Lua >> Moon +29 1:[ local mod = ... ] >> 3:[ mod = ... ] +39 2:[ local connect = require("connect") ] >> 4:[ connect = require "connect" ] +67 3:[ local lobby = require("lobby") ] >> 5:[ lobby = require "lobby" ] +91 4:[ local joined = require("joined") ] >> 6:[ joined = require "joined" ] +117 5:[ local party = require("party") ] >> 7:[ party = require "party" ] +141 6:[ local char = require("char") ] >> 8:[ char = require "char" ] +184 8:[ Character = char.Character ] >> 9:[ import Character from char ] +207 10:[ Enemy = char.Enemy ] >> 10:[ import Enemy from char ] +230 12:[ Party = party.Party ] >> 11:[ import Party from party ] +237 13:[ local player = require("player") ] >> 12:[ player = require "player" ] +287 15:[ RemotePlayer = player.RemotePlayer ] >> 13:[ import RemotePlayer from player ] +318 17:[ LocalPlayer = player.LocalPlayer ] >> 14:[ import LocalPlayer from player ] +326 18:[ local main = require("main") ] >> 15:[ main = require "main" ] +348 19:[ local room = require("room") ] >> 16:[ room = require "room" ] +386 21:[ Room = room.Room ] >> 17:[ import Room from room ] +413 23:[ LobbyRoom = room.LobbyRoom ] >> 18:[ import LobbyRoom from room ] +419 24:[ local ui = require("ui") ] >> 19:[ ui = require "ui" ] +437 25:[ local ability = require("ability_reg") ] >> 20:[ ability = require "ability_reg" ] +1117 31:[ local peer = msg.peer ] >> 40:[ peer = msg.peer ] +1135 32:[ self.players[peer] = RemotePlayer(peer, nil, char.classes.Tumbler) ] >> 41:[ @players[peer] = RemotePlayer(peer,nil,char.classes.Tumbler) ] +1198 33:[ am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 42:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_player_joined",uname:peer,class:"Tumbler"}))) ] +1262 34:[ msg = "info_player_joined", ] >> 42:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_player_joined",uname:peer,class:"Tumbler"}))) ] +1289 35:[ uname = peer, ] >> 42:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_player_joined",uname:peer,class:"Tumbler"}))) ] +1300 36:[ class = "Tumbler" ] >> 42:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_player_joined",uname:peer,class:"Tumbler"}))) ] +1198 37:[ }))) ] >> 42:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_player_joined",uname:peer,class:"Tumbler"}))) ] +1318 38:[ if self.host == nil then ] >> 43:[ if @host == nil ] +1335 39:[ self.host = peer ] >> 44:[ @host = peer ] +1316 40:[ end ] >> 43:[ if @host == nil ] +1382 43:[ if self.game_state == "lobby" then ] >> 46:[ if @game_state == "lobby" ] +1411 44:[ if self.players[msg.peer] then ] >> 47:[ if @players[msg.peer] ] +1435 45:[ self.players[msg.peer]:set_class(char.classes[msg.class]) ] >> 48:[ @players[msg.peer]\set_class(char.classes[msg.class]) ] +1501 47:[ self.players[msg.peer] = RemotePlayer(msg.peer, nil, char.classes[msg.class]) ] >> 50:[ @players[msg.peer] = RemotePlayer(msg.peer,nil,char.classes[msg.class]) ] +1576 49:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)", msg.peer, am.to_json({ ] >> 51:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)",msg.peer,am.to_json({msg: "confirm_class_change", class: msg.class}))) ] +1655 50:[ msg = "confirm_class_change", ] >> 51:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)",msg.peer,am.to_json({msg: "confirm_class_change", class: msg.class}))) ] +1686 51:[ class = msg.class ] >> 51:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)",msg.peer,am.to_json({msg: "confirm_class_change", class: msg.class}))) ] +1576 52:[ }))) ] >> 51:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)",msg.peer,am.to_json({msg: "confirm_class_change", class: msg.class}))) ] +1704 53:[ return am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 52:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_class_change",uname:msg.peer,class:msg.class}))) ] +1768 54:[ msg = "info_class_change", ] >> 52:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_class_change",uname:msg.peer,class:msg.class}))) ] +1794 55:[ uname = msg.peer, ] >> 52:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_class_change",uname:msg.peer,class:msg.class}))) ] +1809 56:[ class = msg.class ] >> 52:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_class_change",uname:msg.peer,class:msg.class}))) ] +1704 57:[ }))) ] >> 52:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_class_change",uname:msg.peer,class:msg.class}))) ] +1833 59:[ return am.eval_js(string.format("GLOBAL.send_message(%q,%q)", msg.peer, am.to_json({ ] >> 54:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)",msg.peer,am.to_json({msg: "deny_class_change", class:@players[msg.peer].class}))) ] +1912 60:[ msg = "deny_class_change", ] >> 54:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)",msg.peer,am.to_json({msg: "deny_class_change", class:@players[msg.peer].class}))) ] +1940 61:[ class = self.players[msg.peer].class ] >> 54:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)",msg.peer,am.to_json({msg: "deny_class_change", class:@players[msg.peer].class}))) ] +1833 62:[ }))) ] >> 54:[ am.eval_js(string.format("GLOBAL.send_message(%q,%q)",msg.peer,am.to_json({msg: "deny_class_change", class:@players[msg.peer].class}))) ] +2005 66:[ if msg.peer == self.host and self.game_state == "lobby" then ] >> 56:[ if msg.peer == @host and @game_state == "lobby" ] +2054 67:[ self.player_party = Party() ] >> 57:[ @player_party = Party! ] +2136 68:[ for _, chartbl in pairs(self.players) do ] >> 59:[ for _, chartbl in pairs(@players) ] +2157 69:[ chartbl.position = chartbl.class.default_position ] >> 60:[ chartbl.position = chartbl.class.default_position ] +2211 70:[ chartbl.hp = chartbl.class.default_hp ] >> 61:[ chartbl.hp = chartbl.class.default_hp ] +2253 71:[ self.player_party:add_member(chartbl) ] >> 62:[ @player_party\add_member(chartbl) ] +2119 72:[ end ] >> 59:[ for _, chartbl in pairs(@players) ] +2290 73:[ self:campaign_start() ] >> 63:[ @campaign_start! ] +2310 74:[ return am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 64:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_campaign_start",time_ref:@player_start_time}))) ] +2374 75:[ msg = "info_campaign_start", ] >> 64:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_campaign_start",time_ref:@player_start_time}))) ] +2405 76:[ time_ref = self.player_start_time ] >> 64:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_campaign_start",time_ref:@player_start_time}))) ] +2310 77:[ }))) ] >> 64:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_campaign_start",time_ref:@player_start_time}))) ] +2003 78:[ end ] >> 56:[ if msg.peer == @host and @game_state == "lobby" ] +2451 81:[ self.game_state = "room_entry" ] >> 66:[ @game_state = "room_entry" ] +2481 82:[ self.player_start_time = am.eval_js("new Date().getTime()") ] >> 67:[ @player_start_time = am.eval_js("new Date().getTime()") ] +2540 83:[ room = Room.generate(self.cr) ] >> 68:[ room = Room.generate(@cr) ] +2569 84:[ self.room = room ] >> 69:[ @room = room ] +2585 85:[ self.enemy_party = self:generate_enemies() ] >> 70:[ @enemy_party = @generate_enemies! ] +2622 86:[ self.enemy_party:set_room(room) ] >> 71:[ @enemy_party\set_room(room) ] +2653 87:[ self.player_party:set_room(room) ] >> 72:[ @player_party\set_room(room) ] +2685 88:[ am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 73:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +2754 89:[ msg = "info_enemy_party", ] >> 74:[ msg: "info_enemy_party", ] +2784 90:[ data = self.enemy_party:serialize() ] >> 75:[ data: @enemy_party\serialize! ] +2685 91:[ }))) ] >> 73:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +2820 92:[ room:distribute_party(self.player_party, self.enemy_party) ] >> 77:[ room\distribute_party(@player_party,@enemy_party) ] +2873 93:[ am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 78:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_room",data:room\serialize!,time_ref:@player_start_time}))) ] +2937 94:[ msg = "info_room", ] >> 78:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_room",data:room\serialize!,time_ref:@player_start_time}))) ] +2954 95:[ data = room:serialize(), ] >> 78:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_room",data:room\serialize!,time_ref:@player_start_time}))) ] +2979 96:[ time_ref = self.player_start_time ] >> 78:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_room",data:room\serialize!,time_ref:@player_start_time}))) ] +2873 97:[ }))) ] >> 78:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"info_room",data:room\serialize!,time_ref:@player_start_time}))) ] +3005 98:[ self.game_state = "room_players" ] >> 79:[ @game_state = "room_players" ] +3066 101:[ local player_ser = { } ] >> 82:[ player_ser = {} ] +3105 102:[ for peerid, player in pairs(self.players) do ] >> 83:[ for peerid, player in pairs(@players) ] +3125 103:[ player_ser[peerid] = player:serialize() ] >> 84:[ player_ser[peerid] = player\serialize! ] +3084 104:[ end ] >> 83:[ for peerid, player in pairs(@players) ] +3166 105:[ return am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 85:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"respond_player_list", data:player_ser}))) ] +3230 106:[ msg = "respond_player_list", ] >> 85:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"respond_player_list", data:player_ser}))) ] +3258 107:[ data = player_ser ] >> 85:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"respond_player_list", data:player_ser}))) ] +3166 108:[ }))) ] >> 85:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({msg:"respond_player_list", data:player_ser}))) ] +3298 111:[ if self.game_state == "room_players" then ] >> 87:[ if @game_state == "room_players" ] +3334 112:[ if not self.dead_players[msg.peer] then ] >> 88:[ if not @dead_players[msg.peer] ] +3367 113:[ self.set_actions[msg.peer] = ability[msg.action] ] >> 89:[ @set_actions[msg.peer] = ability[msg.action] ] +3332 114:[ end ] >> 88:[ if not @dead_players[msg.peer] ] +3296 115:[ end ] >> 87:[ if @game_state == "room_players" ] +3428 118:[ local msg = am.eval_js("GLOBAL.get_message()") ] >> 91:[ msg = am.eval_js("GLOBAL.get_message()") ] +3473 119:[ if msg ~= nil then ] >> 92:[ if msg != nil ] +3490 120:[ if msg.msg == "data" then ] >> 93:[ if msg.msg == "data" ] +3513 121:[ local info = am.parse_json(msg.data) ] >> 94:[ info = am.parse_json(msg.data) ] +3548 122:[ info.peer = msg.peer ] >> 95:[ info.peer = msg.peer -- server messages have an extra "peer" field that the client didn't add. ] +3649 123:[ if self[info.msg] then ] >> 96:[ if @[info.msg] ] +3667 124:[ self[info.msg](self, info) ] >> 97:[ @[info.msg](@,info) ] +3701 126:[ print("Failed to find server message handler:", msg, "no handler", info.msg) ] >> 99:[ print("Failed to find server message handler:",msg,"no handler",info.msg) ] +3787 129:[ print("Msg was nil") ] >> 101:[ print("Msg was nil") ] +3471 131:[ end ] >> 92:[ if msg != nil ] +3833 132:[ if self.game_state == "room_players" then ] >> 103:[ if @game_state == "room_players" ] +3869 133:[ if am.eval_js("new Date().getTime()") > self.player_start_time + 6000 then ] >> 104:[ if am.eval_js("new Date().getTime()") > @player_start_time + 6000 ] +3982 134:[ local npc_actions = { } ] >> 106:[ npc_actions = {} ] +4003 135:[ local used_actions = { } ] >> 107:[ used_actions = {} ] +4025 136:[ local party_index = { } ] >> 108:[ party_index = {} ] +4046 137:[ local character_index = { } ] >> 109:[ character_index = {} ] +4088 138:[ for uname, npc in pairs(self.enemy_party.members) do ] >> 110:[ for uname, npc in pairs(@enemy_party.members) ] +4122 139:[ npc_actions[uname] = npc:select_action() ] >> 111:[ npc_actions[uname] = npc\select_action! ] +4167 140:[ table.insert(used_actions, npc_actions[uname]) ] >> 112:[ table.insert(used_actions, npc_actions[uname]) ] +4219 141:[ party_index[npc_actions[uname]] = self.enemy_party ] >> 113:[ party_index[npc_actions[uname]] = @enemy_party ] +4271 142:[ character_index[npc_actions[uname]] = npc ] >> 114:[ character_index[npc_actions[uname]] = npc ] +4071 143:[ end ] >> 110:[ for uname, npc in pairs(@enemy_party.members) ] +4317 144:[ local total_actions = { } ] >> 115:[ total_actions = {} ] +4350 145:[ for k, v in pairs(npc_actions) do ] >> 116:[ for k,v in pairs(npc_actions) ] +4375 146:[ total_actions[k] = v.__name ] >> 117:[ total_actions[k] = v.__name ] +4340 147:[ end ] >> 116:[ for k,v in pairs(npc_actions) ] +4417 148:[ for k, v in pairs(self.set_actions) do ] >> 118:[ for k,v in pairs(@set_actions) ] +4443 149:[ total_actions[k] = v.__name ] >> 119:[ total_actions[k] = v.__name ] +4476 150:[ table.insert(used_actions, v) ] >> 120:[ table.insert(used_actions, v) ] +4511 151:[ party_index[v] = self.player_party ] >> 121:[ party_index[v] = @player_party ] +4547 152:[ character_index[v] = self.player_party:member(k) ] >> 122:[ character_index[v] = @player_party\member(k) ] +4407 153:[ end ] >> 118:[ for k,v in pairs(@set_actions) ] +4649 154:[ table.sort(used_actions, function(a, b) ] >> 124:[ table.sort(used_actions, (a,b) -> ] +4688 155:[ return a.speed < b.speed ] >> 125:[ a.speed < b.speed ] +4649 156:[ end) ] >> 124:[ table.sort(used_actions, (a,b) -> ] +4757 157:[ for k, v in ipairs(used_actions) do ] >> 128:[ for k,v in ipairs(used_actions) ] +4784 158:[ local tchar = character_index[v] ] >> 129:[ tchar = character_index[v] ] +4816 159:[ v.__class.use(self, party_index[v], tchar) ] >> 130:[ v.__class.use(@,party_index[v],tchar) ] +4747 160:[ end ] >> 128:[ for k,v in ipairs(used_actions) ] +4858 161:[ am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 131:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +4928 162:[ msg = "info_actions", ] >> 132:[ msg:"info_actions", ] +4954 163:[ data = total_actions ] >> 133:[ data: total_actions ] +4858 164:[ }))) ] >> 131:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +5012 165:[ self.game_state = "room_battle_animate" ] >> 136:[ @game_state = "room_battle_animate" ] +5052 166:[ self.set_actions = { } ] >> 137:[ @set_actions = {} ] +3867 167:[ end ] >> 104:[ if am.eval_js("new Date().getTime()") > @player_start_time + 6000 ] +3831 168:[ end ] >> 103:[ if @game_state == "room_players" ] +5074 169:[ if self.game_state == "room_battle_animate" then ] >> 138:[ if @game_state == "room_battle_animate" --only exists for 1 tick, calc dammge, check if room is done, check if we're defeated, ect. ] +5207 170:[ local _ = self.calculate_damage ] >> 139:[ @calculate_damage ] +5228 171:[ self.player_start_time = am.eval_js("new Date().getTime()") + 500 ] >> 140:[ @player_start_time = am.eval_js("new Date().getTime()")+500 --500 ms for animations ] +5315 172:[ self.game_state = "room_players" ] >> 141:[ @game_state = "room_players" ] +5347 173:[ am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 142:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +5416 174:[ msg = "info_timeref", ] >> 143:[ msg:"info_timeref", ] +5445 175:[ time_ref = self.player_start_time ] >> 144:[ time_ref:@player_start_time ] +5347 176:[ }))) ] >> 142:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +5475 177:[ local dead_characters = { } ] >> 146:[ dead_characters = {} ] +5517 178:[ for uname, char in pairs(self.player_party.members) do ] >> 147:[ for uname, char in pairs(@player_party.members) ] +5553 179:[ if char.data.hp <= 0 then ] >> 148:[ if char.data.hp <= 0 ] +5577 180:[ table.insert(dead_characters, uname) ] >> 149:[ table.insert(dead_characters,uname) ] +5618 181:[ char:die() ] >> 150:[ char\die! ] +5633 182:[ self.player_party:remove_member(char) ] >> 151:[ @player_party\remove_member(char) ] +5672 183:[ self.dead_players[uname] = true ] >> 152:[ @dead_players[uname] = true ] +5551 184:[ end ] >> 148:[ if char.data.hp <= 0 ] +5499 185:[ end ] >> 147:[ for uname, char in pairs(@player_party.members) ] +5721 186:[ for uname, char in pairs(self.enemy_party.members) do ] >> 153:[ for uname, char in pairs(@enemy_party.members) ] +5756 187:[ if char.data.hp <= 0 then ] >> 154:[ if char.data.hp <= 0 ] +5780 188:[ table.insert(dead_characters, uname) ] >> 155:[ table.insert(dead_characters,uname) ] +5821 189:[ char:die() ] >> 156:[ char\die! ] +5836 190:[ self.enemy_party:remove_member(char) ] >> 157:[ @enemy_party\remove_member(char) ] +5754 191:[ end ] >> 154:[ if char.data.hp <= 0 ] +5703 192:[ end ] >> 153:[ for uname, char in pairs(@enemy_party.members) ] +5872 193:[ am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 158:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +5941 194:[ msg = "info_deaths", ] >> 159:[ msg:"info_deaths", ] +5965 195:[ data = dead_characters ] >> 160:[ data:dead_characters ] +5872 196:[ }))) ] >> 158:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +5994 197:[ if self.player_party:nmembers() == 0 then ] >> 162:[ if @player_party\nmembers! == 0 ] +6028 198:[ self.game_state = "defeat" ] >> 163:[ @game_state = "defeat" ] +6060 199:[ elseif self.enemy_party:nmembers() == 0 then ] >> 164:[ elseif @enemy_party\nmembers! == 0 ] +6093 200:[ am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 165:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +6163 201:[ msg = "info_loot", ] >> 166:[ msg:"info_loot" ] +6189 202:[ time_ref = self.player_start_time ] >> 167:[ time_ref:@player_start_time ] +6093 203:[ }))) ] >> 165:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +6277 204:[ self.player_start_time = am.eval_js("new Date().getTime()") ] >> 170:[ @player_start_time = am.eval_js("new Date().getTime()") ] +6337 205:[ self.game_state = "victory" ] >> 171:[ @game_state = "victory" ] +5072 207:[ end ] >> 138:[ if @game_state == "room_battle_animate" --only exists for 1 tick, calc dammge, check if room is done, check if we're defeated, ect. ] +6365 208:[ if self.game_state == "defeat" then ] >> 172:[ if @game_state == "defeat" ] +6393 209:[ am.eval_js(string.format("GLOBAL.broadcast(%q)", am.to_json({ ] >> 173:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +6462 210:[ msg = "info_defeat" ] >> 174:[ msg:"info_defeat" ] +6393 211:[ }))) ] >> 173:[ am.eval_js(string.format("GLOBAL.broadcast(%q)",am.to_json({ ] +6487 212:[ self.game_state = "done" ] >> 176:[ @game_state = "done" ] +6363 213:[ end ] >> 172:[ if @game_state == "defeat" ] +6512 214:[ if self.game_state == "victory" then ] >> 177:[ if @game_state == "victory" ] +6543 215:[ if am.eval_js("new Date().getTime()") > self.player_start_time + 6000 then ] >> 178:[ if am.eval_js("new Date().getTime()") > @player_start_time + 6000 -- a few seconds for victory! (and animations) ] +6658 216:[ self.cr = self.cr + 1 ] >> 179:[ @cr += 1 ] +6671 217:[ return self:campaign_start() ] >> 180:[ @campaign_start! ] +6541 218:[ end ] >> 178:[ if am.eval_js("new Date().getTime()") > @player_start_time + 6000 -- a few seconds for victory! (and animations) ] +6510 219:[ end ] >> 177:[ if @game_state == "victory" ] +6717 222:[ return print("calculating dammage...") ] >> 183:[ print("calculating dammage...") ] +6776 225:[ local enemies = { } ] >> 186:[ enemies = {} ] +6791 226:[ local tcr = self.cr ] >> 187:[ tcr = @cr ] +6803 227:[ local possible_enemies = { } ] >> 188:[ possible_enemies = {} ] +6837 228:[ for k, v in pairs(char.enemies) do ] >> 189:[ for k,v in pairs(char.enemies) ] +6861 229:[ table.insert(possible_enemies, v) ] >> 190:[ table.insert(possible_enemies,v) ] +6827 230:[ end ] >> 189:[ for k,v in pairs(char.enemies) ] +6896 231:[ local enemy_party = Party() ] >> 191:[ enemy_party = Party! ] +6924 232:[ while tcr > 0 and #possible_enemies > 0 do ] >> 192:[ while tcr > 0 and #possible_enemies > 0 ] +6962 233:[ local filtered_enemies = { } ] >> 193:[ filtered_enemies = {} ] +7002 234:[ for _, enemy in pairs(possible_enemies) do ] >> 194:[ for _, enemy in pairs(possible_enemies) ] +7033 235:[ if enemy.cr <= tcr then ] >> 195:[ if enemy.cr <= tcr ] +7055 236:[ table.insert(filtered_enemies, enemy) ] >> 196:[ table.insert(filtered_enemies,enemy) ] +7031 237:[ end ] >> 195:[ if enemy.cr <= tcr ] +6987 238:[ end ] >> 194:[ for _, enemy in pairs(possible_enemies) ] +7095 239:[ table.shuffle(filtered_enemies) ] >> 197:[ table.shuffle(filtered_enemies) ] +7130 240:[ local rng_enemy = table.remove(filtered_enemies) ] >> 198:[ rng_enemy = table.remove(filtered_enemies) ] +7176 241:[ tcr = tcr - rng_enemy.cr ] >> 199:[ tcr = tcr - rng_enemy.cr ] +7204 242:[ enemy_party:add_member(Enemy(nil, rng_enemy)) ] >> 200:[ enemy_party\add_member(Enemy(nil,rng_enemy)) ] +6919 243:[ end ] >> 192:[ while tcr > 0 and #possible_enemies > 0 ] +7251 244:[ return enemy_party ] >> 201:[ enemy_party ] +496 250:[ self.server = true ] >> 24:[ @server = true ] +513 251:[ self.client = false ] >> 25:[ @client = false ] +531 252:[ am.eval_js(connect) ] >> 26:[ am.eval_js(connect) ] +553 253:[ am.eval_js(lobby) ] >> 27:[ am.eval_js(lobby) ] +573 254:[ self.lobby_id = am.eval_js("GLOBAL.lobby_id") ] >> 28:[ @lobby_id = am.eval_js("GLOBAL.lobby_id") ] +617 255:[ self.game_state = "lobby" ] >> 29:[ @game_state = "lobby" --lobby, room_entry, room_players, room_battle_animate, victory, camp_entry, camp_players_animate, defeat, done ] +753 256:[ self.game_state_extra = 0 ] >> 30:[ @game_state_extra = 0 ] +777 257:[ self.players = { } ] >> 31:[ @players = {} --[peer_id] = tbl ] +811 258:[ self.set_actions = { } ] >> 32:[ @set_actions = {} --[peer_id] = "name" ] +852 259:[ self.player_party = nil ] >> 33:[ @player_party = nil -- the party, created at campaign start ] +914 260:[ self.host = nil ] >> 34:[ @host = nil --who is the lobby host, with the power to start the game? ] +987 261:[ self.enemy_party = nil ] >> 35:[ @enemy_party = nil -- The enemy party ] +1027 262:[ self.updates = { } ] >> 36:[ @updates = {} ] +1043 263:[ self.dead_players = { } ] >> 37:[ @dead_players = {} --[peer_id] = true ] +1083 264:[ self.cr = 1 ] >> 38:[ @cr = 1 ] +7663 284:[ am.eval_js(joined) ] >> 221:[ am.eval_js(joined) ] +7684 285:[ return am.eval_js("CLIENT.join('" .. id .. "');") ] >> 222:[ am.eval_js("CLIENT.join('" .. id .. "');") ] +7748 288:[ return am.eval_js("CLIENT.open") ] >> 224:[ am.eval_js("CLIENT.open") ] +7793 291:[ return am.eval_js("CLIENT.peer") ] >> 226:[ am.eval_js("CLIENT.peer") ] +7853 294:[ return self.localplayer:set_class(char.classes[msg.class]) ] >> 228:[ @localplayer\set_class(char.classes[msg.class]) ] +7932 297:[ return self.localplayer:set_class(char.classes[msg.class]) ] >> 230:[ @localplayer\set_class(char.classes[msg.class]) ] +8036 300:[ for peerid, chardata in pairs(msg.data) do ] >> 232:[ for peerid, chardata in pairs(msg.data) ] +8058 301:[ if not self.player_party:member(peerid) then ] >> 233:[ if not @player_party\member(peerid) ] +8098 302:[ if peerid == am.eval_js("CLIENT.peer._id") then ] >> 234:[ if peerid == am.eval_js("CLIENT.peer._id") ] +8144 303:[ self.localplayer = Character.deserialize(chardata) ] >> 235:[ @localplayer = Character.deserialize(chardata) ] +8196 304:[ self.player_party:add_member(self.localplayer) ] >> 236:[ @player_party\add_member(@localplayer) ] +8240 305:[ self.localplayer:enter_room(self.player_party.room) ] >> 237:[ @localplayer\enter_room(@player_party.room) ] +8298 307:[ local newplayer = Character.deserialize(chardata) ] >> 239:[ newplayer = Character.deserialize(chardata) ] +8347 308:[ self.player_party:add_member(newplayer) ] >> 240:[ @player_party\add_member(newplayer) ] +8388 309:[ newplayer:enter_room(self.player_party.room) ] >> 241:[ newplayer\enter_room(@player_party.room) ] +8441 312:[ print("Do nothing...") ] >> 243:[ print("Do nothing...") ] +8013 314:[ end ] >> 232:[ for peerid, chardata in pairs(msg.data) ] +8497 317:[ if msg.uname == self.localplayer.uname then ] >> 245:[ if msg.uname == @localplayer.uname ] +8533 318:[ return ] >> 246:[ return ] +8495 319:[ end ] >> 245:[ if msg.uname == @localplayer.uname ] +8544 320:[ if not self.player_party:member(msg.uname) then ] >> 247:[ if not @player_party\member(msg.uname) ] +8584 321:[ return self.player_party:add_member(Character.deserialize(msg.class)) ] >> 248:[ @player_party\add_member(Character.deserialize(msg.class)) ] +8653 323:[ return self.player_party:member(msg.uname):set_class(char.classes[msg.class]) ] >> 250:[ @player_party\member(msg.uname)\set_class(char.classes[msg.class]) ] +8754 327:[ if msg.uname == am.eval_js("CLIENT.peer._id") then ] >> 252:[ if msg.uname == am.eval_js("CLIENT.peer._id") ] +8803 328:[ if self.localplayer ~= nil then ] >> 253:[ if @localplayer != nil ] +8828 329:[ return ] >> 254:[ return ] +8801 330:[ end ] >> 253:[ if @localplayer != nil ] +8838 331:[ self.localplayer = LocalPlayer(msg.uname, { }, char.classes[msg.class]) ] >> 255:[ @localplayer = LocalPlayer(msg.uname, {}, char.classes[msg.class]) ] +8908 332:[ self.player_party:add_member(self.localplayer) ] >> 256:[ @player_party\add_member(@localplayer) ] +8950 333:[ return self.localplayer:enter_room(self.player_party.room) ] >> 257:[ @localplayer\enter_room(@player_party.room) ] +9002 334:[ elseif not self.player_party:member(msg.uname) then ] >> 258:[ elseif not @player_party\member(msg.uname) ] +9042 335:[ local newplayer = RemotePlayer(msg.uname, nil, char.classes[msg.class]) ] >> 259:[ newplayer = RemotePlayer(msg.uname, nil, char.classes[msg.class]) ] +9111 336:[ self.player_party:add_member(newplayer) ] >> 260:[ @player_party\add_member(newplayer) ] +9150 337:[ return newplayer:enter_room(self.player_party.room) ] >> 261:[ newplayer\enter_room(@player_party.room) ] +9201 339:[ return print("Do nothing") ] >> 263:[ print("Do nothing") ] +9254 343:[ local lobby_menu = require("lobby_menu") ] >> 265:[ lobby_menu = require "lobby_menu" ] +9290 344:[ local create_party_menu = require("create_party_menu") ] >> 266:[ create_party_menu = require "create_party_menu" ] +9342 345:[ if create_party_menu.loaded then ] >> 267:[ if create_party_menu.loaded ] +9371 346:[ create_party_menu.unload() ] >> 268:[ create_party_menu.unload! ] +9340 347:[ end ] >> 267:[ if create_party_menu.loaded ] +9401 348:[ if lobby_menu.loaded then ] >> 269:[ if lobby_menu.loaded ] +9423 349:[ lobby_menu.unload() ] >> 270:[ lobby_menu.unload! ] +9399 350:[ end ] >> 269:[ if lobby_menu.loaded ] +9444 351:[ local battle_menu = require("battle_menu") ] >> 271:[ battle_menu = require "battle_menu" ] +9482 352:[ battle_menu.load() ] >> 272:[ battle_menu.load! ] +9502 353:[ ui.fadeout() ] >> 273:[ ui.fadeout! ] +9516 354:[ self.time_ref = msg.time_ref ] >> 274:[ @time_ref = msg.time_ref ] +9564 357:[ self.room = Room.deserialize(msg.data) ] >> 276:[ @room = Room.deserialize(msg.data) ] +9601 358:[ self.time_ref = msg.time_ref ] >> 277:[ @time_ref = msg.time_ref ] +9628 359:[ self:set_room(self.room) ] >> 278:[ @set_room(@room) ] +9647 360:[ local battle_menu = require("battle_menu") ] >> 279:[ battle_menu = require "battle_menu" ] +9685 361:[ battle_menu.victory = false ] >> 280:[ battle_menu.victory = false ] +9715 362:[ return main.root:remove("infocard") ] >> 281:[ main.root\remove("infocard") ] +9770 365:[ main.root:remove("infocard") ] >> 283:[ main.root\remove("infocard") ] +9801 366:[ self.time_ref = msg.time_ref ] >> 284:[ @time_ref = msg.time_ref ] +9858 369:[ if self.enemy_party then ] >> 286:[ if @enemy_party ] +9875 370:[ self.node:remove(self.enemy_party.rnode) ] >> 287:[ @node\remove(@enemy_party.rnode) ] +9856 371:[ end ] >> 286:[ if @enemy_party ] +9910 372:[ self.enemy_party = Party.deserialize(msg.data) ] >> 288:[ @enemy_party = Party.deserialize(msg.data) ] +9955 373:[ self.enemy_party:set_room(self.room) ] >> 289:[ @enemy_party\set_room(@room) ] +9988 374:[ if self.room.__class ~= LobbyRoom then ] >> 290:[ if @room.__class != LobbyRoom ] +10019 375:[ self.enemy_party:set_room(self.room) ] >> 291:[ @enemy_party\set_room(@room) ] +9986 376:[ end ] >> 290:[ if @room.__class != LobbyRoom ] +10050 377:[ local battle_menu = require("battle_menu") ] >> 292:[ battle_menu = require "battle_menu" ] +10088 378:[ battle_menu.victory = false ] >> 293:[ battle_menu.victory = false ] +10118 379:[ return main.root:remove("infocard") ] >> 294:[ main.root\remove("infocard") ] +10208 382:[ local battle_menu = require("battle_menu") ] >> 297:[ battle_menu = require("battle_menu") ] +10247 383:[ local defeat_menu = require("defeat_menu") ] >> 298:[ defeat_menu = require("defeat_menu") ] +10286 384:[ table.insert(main.action_queue, { ] >> 299:[ table.insert(main.action_queue,{battle_menu.unload, {}}) ] +10318 385:[ battle_menu.unload, ] >> 299:[ table.insert(main.action_queue,{battle_menu.unload, {}}) ] +10286 387:[ }) ] >> 299:[ table.insert(main.action_queue,{battle_menu.unload, {}}) ] +10345 388:[ return table.insert(main.action_queue, { ] >> 300:[ table.insert(main.action_queue,{defeat_menu.load,{}}) ] +10377 389:[ defeat_menu.load, ] >> 300:[ table.insert(main.action_queue,{defeat_menu.load,{}}) ] +10345 391:[ }) ] >> 300:[ table.insert(main.action_queue,{defeat_menu.load,{}}) ] +10422 394:[ self.time_ref = msg.time_ref ] >> 302:[ @time_ref = msg.time_ref ] +10449 395:[ local battle_menu = require("battle_menu") ] >> 303:[ battle_menu = require "battle_menu" ] +10487 396:[ battle_menu.victory = true ] >> 304:[ battle_menu.victory = true ] +10516 397:[ return main.root:remove("infocard") ] >> 305:[ main.root\remove("infocard") ] +10592 400:[ for uname, updated in pairs(msg.data) do ] >> 307:[ for uname, updated in pairs(msg.data) ] +10612 401:[ local tchar = self.player_party:member(uname) or self.enemy_party:member(uname) ] >> 308:[ tchar = @player_party\member(uname) or @enemy_party\member(uname) ] +10691 402:[ for k, v in pairs(updated) do ] >> 309:[ for k,v in pairs(updated) ] +10711 403:[ tchar.data[k] = v ] >> 310:[ tchar.data[k] = v ] +10681 404:[ end ] >> 309:[ for k,v in pairs(updated) ] +10571 405:[ end ] >> 307:[ for uname, updated in pairs(msg.data) ] +10769 408:[ for _, uname in pairs(msg.data) do ] >> 312:[ for _, uname in pairs(msg.data) ] +10791 409:[ if self.player_party:member(uname) then ] >> 313:[ if @player_party\member(uname) ] +10824 410:[ local tchar = self.player_party:member(uname) ] >> 314:[ tchar = @player_party\member(uname) ] +10864 411:[ tchar:die() ] >> 315:[ tchar\die! ] +10879 412:[ self.player_party:remove_member(tchar) ] >> 316:[ @player_party\remove_member(tchar) ] +10923 413:[ elseif self.enemy_party:member(uname) then ] >> 317:[ elseif @enemy_party\member(uname) ] +10955 414:[ local tchar = self.enemy_party:member(uname) ] >> 318:[ tchar = @enemy_party\member(uname) ] +10994 415:[ tchar:die() ] >> 319:[ tchar\die! ] +11009 416:[ self.enemy_party:remove_member(tchar) ] >> 320:[ @enemy_party\remove_member(tchar) ] +10754 418:[ end ] >> 312:[ for _, uname in pairs(msg.data) ] +11094 421:[ for uname, action_name in pairs(msg.data) do ] >> 322:[ for uname, action_name in pairs(msg.data) ] +11114 422:[ local action = ability[action_name] ] >> 323:[ action = ability[action_name] ] +11149 423:[ if self.player_party:member(uname) then ] >> 324:[ if @player_party\member(uname) ] +11182 424:[ action.use(self, self.player_party, self.player_party:member(uname)) ] >> 325:[ action.use(@,@player_party,@player_party\member(uname)) ] +11242 425:[ ui.battle_log(string.format("%s used %s", self.player_party:member(uname).class.name, action.text)) ] >> 326:[ ui.battle_log(string.format("%s used %s",@player_party\member(uname).class.name,action.text)) ] +11345 426:[ elseif self.enemy_party:member(uname) then ] >> 327:[ elseif @enemy_party\member(uname) ] +11377 427:[ action.use(self, self.enemy_party, self.enemy_party:member(uname)) ] >> 328:[ action.use(@,@enemy_party,@enemy_party\member(uname)) ] +11435 428:[ ui.battle_log(string.format("%s used %s", uname, action.text)) ] >> 329:[ ui.battle_log(string.format("%s used %s",uname,action.text)) ] +11069 430:[ end ] >> 322:[ for uname, action_name in pairs(msg.data) ] +11498 431:[ return main.root:remove("infocard") ] >> 330:[ main.root\remove("infocard") ] +11544 434:[ local msg = am.eval_js("CLIENT.get()") ] >> 332:[ msg = am.eval_js("CLIENT.get()") ] +11581 435:[ if msg ~= nil then ] >> 333:[ if msg != nil ] +11596 436:[ local info = am.parse_json(msg) ] >> 334:[ info = am.parse_json(msg) ] +11627 437:[ if self[info.msg] then ] >> 335:[ if @[info.msg] ] +11644 438:[ return self[info.msg](self, info) ] >> 336:[ @[info.msg](@,info) ] +11676 440:[ return print("Failed to find client message handler", info) ] >> 338:[ print("Failed to find client message handler", info) ] +11579 442:[ end ] >> 333:[ if msg != nil ] +11755 445:[ self.localplayer = player ] >> 340:[ @localplayer = player ] +11779 446:[ self.player_party:add_member(player) ] >> 341:[ @player_party\add_member(player) ] +11814 447:[ return self.localplayer:enter_room(self.player_party.room) ] >> 342:[ @localplayer\enter_room(@player_party.room) ] +11881 450:[ self.room = room ] >> 344:[ @room = room ] +11896 451:[ assert(self.room, "cannot set a nil room") ] >> 345:[ assert(@room, "cannot set a nil room") ] +11937 452:[ assert(self.room.load, "rooms must have a .load") ] >> 346:[ assert(@room.load, "rooms must have a .load") ] +11987 453:[ if self.player_party.room then ] >> 347:[ if @player_party.room ] +12010 454:[ self.player_party.room:unload() ] >> 348:[ @player_party.room\unload! ] +11985 455:[ end ] >> 347:[ if @player_party.room ] +12082 456:[ self.room:load() ] >> 350:[ @room\load! ] +12124 457:[ self.player_party:set_room(room) ] >> 352:[ @player_party\set_room(room) ] +12157 458:[ if self.enemy_party then ] >> 353:[ if @enemy_party ] +12176 459:[ if self.enemy_party.room then ] >> 354:[ if @enemy_party.room ] +12199 460:[ self.enemy_party.room:unload() ] >> 355:[ @enemy_party.room\unload! ] +12174 461:[ end ] >> 354:[ if @enemy_party.room ] +12228 462:[ self.enemy_party:set_room(self.room) ] >> 356:[ @enemy_party\set_room(@room) ] +12155 463:[ end ] >> 353:[ if @enemy_party ] +12303 464:[ if self.enemy_party then ] >> 358:[ if @enemy_party ] +12391 465:[ return self.node:append(self.enemy_party.rnode) ] >> 361:[ @node\append(@enemy_party.rnode) ] +12301 466:[ end ] >> 358:[ if @enemy_party ] +12439 469:[ return main.root("world_characters"):append(self.node) ] >> 363:[ main.root("world_characters")\append(@node) ] +7289 475:[ self.client = true ] >> 205:[ @client = true ] +7306 476:[ self.server = false ] >> 206:[ @server = false ] +7324 477:[ am.eval_js(connect) ] >> 207:[ am.eval_js(connect) ] +7346 478:[ self.players = { } ] >> 208:[ @players = {} ] +7362 479:[ self.player_party = Party() ] >> 209:[ @player_party = Party! ] +7387 480:[ self.enemy_party = nil ] >> 210:[ @enemy_party = nil ] +7408 481:[ main.root("world_characters"):append(self.player_party.node) ] >> 211:[ main.root("world_characters")\append(@player_party.node) ] +7467 482:[ self.parties = { ] >> 212:[ @parties = {@player_party} ] +7479 483:[ self.player_party ] >> 212:[ @parties = {@player_party} ] +7467 484:[ } ] >> 212:[ @parties = {@player_party} ] +7496 485:[ self.node = am.group() ] >> 213:[ @node = am.group! ] +7516 486:[ self.node:append(self.player_party.node) ] >> 214:[ @node\append(@player_party.node) ] +7551 487:[ self.node:action(coroutine.create(function() ] >> 215:[ @node\action(coroutine.create(()-> ] +7594 488:[ while true do ] >> 216:[ while true ] +7604 489:[ coroutine.yield() ] >> 217:[ coroutine.yield! ] +7589 490:[ end ] >> 216:[ while true ] +7551 491:[ end)) ] >> 215:[ @node\action(coroutine.create(()-> ] +7628 492:[ self.localplayer = nil ] >> 219:[ @localplayer = nil ] +12485 507:[ mod["World"] = World ] >> 366:[ mod["World"] = World ] +12506 508:[ mod["Server"] = Server ] >> 367:[ mod["Server"] = Server ] +12529 509:[ return mod ] >> 368:[ mod ] |
