فهرست منبع

Reorganize everything;

bjorn 9 سال پیش
والد
کامیت
2a218cb545
85فایلهای تغییر یافته به همراه205 افزوده شده و 205 حذف شده
  1. 14 14
      app/context/editor.lua
  2. 15 15
      app/context/game.lua
  3. 11 11
      app/context/menu.lua
  4. 3 3
      app/context/patcher.lua
  5. 10 10
      app/context/server.lua
  6. 0 0
      app/logic/buffs.lua
  7. 0 0
      app/logic/collision.lua
  8. 1 1
      app/logic/map.lua
  9. 1 1
      app/logic/spell.lua
  10. 0 0
      app/logic/spells.lua
  11. 0 0
      app/logic/weapon.lua
  12. 0 0
      app/media/effects.lua
  13. 0 0
      app/media/particles.lua
  14. 0 0
      app/media/sound.lua
  15. 0 0
      app/media/view.lua
  16. 15 15
      app/net/client.lua
  17. 2 2
      app/net/core.lua
  18. 0 0
      app/net/goregous.lua
  19. 34 34
      app/net/server.lua
  20. 0 0
      app/net/stream.lua
  21. 1 1
      app/player/base.lua
  22. 8 8
      app/player/controller.lua
  23. 4 4
      app/player/dummy.lua
  24. 7 7
      app/player/main.lua
  25. 1 1
      app/player/robot.lua
  26. 10 10
      app/player/server.lua
  27. 0 0
      app/ui/editor/debug.lua
  28. 0 0
      app/ui/editor/deletor.lua
  29. 0 0
      app/ui/editor/dragger.lua
  30. 0 0
      app/ui/editor/grid.lua
  31. 0 0
      app/ui/editor/saver.lua
  32. 0 0
      app/ui/editor/scaler.lua
  33. 0 0
      app/ui/editor/selector.lua
  34. 3 3
      app/ui/editor/view.lua
  35. 0 0
      app/ui/hud/blood.lua
  36. 0 0
      app/ui/hud/buffs.lua
  37. 1 1
      app/ui/hud/chat.lua
  38. 3 3
      app/ui/hud/classSelect.lua
  39. 17 17
      app/ui/hud/controller.lua
  40. 0 0
      app/ui/hud/dead.lua
  41. 0 0
      app/ui/hud/debug.lua
  42. 1 1
      app/ui/hud/feed.lua
  43. 0 0
      app/ui/hud/gameOver.lua
  44. 0 0
      app/ui/hud/health.lua
  45. 0 0
      app/ui/hud/icons.lua
  46. 1 1
      app/ui/hud/killPopup.lua
  47. 0 0
      app/ui/hud/left.lua
  48. 0 0
      app/ui/hud/players.lua
  49. 0 0
      app/ui/hud/right.lua
  50. 3 3
      app/ui/hud/scoreboard.lua
  51. 0 0
      app/ui/menu/alert.lua
  52. 0 0
      app/ui/menu/back.lua
  53. 0 0
      app/ui/menu/background.lua
  54. 0 0
      app/ui/menu/input.lua
  55. 1 1
      app/ui/menu/login.lua
  56. 4 4
      app/ui/menu/main.lua
  57. 0 0
      app/ui/menu/options.lua
  58. 0 0
      app/ui/menu/ribbon.lua
  59. 1 1
      app/ui/menu/serverList.lua
  60. 0 0
      app/util/context.lua
  61. 0 0
      app/util/event.lua
  62. 0 0
      app/util/input.lua
  63. 1 1
      data/buff/adrenaline.lua
  64. 1 1
      data/mods/deathmatch.lua
  65. 4 4
      data/mods/epidemic.lua
  66. 1 1
      data/prop/cartserver.lua
  67. 2 2
      data/skill/bloodlust.lua
  68. 1 1
      data/skill/cleave.lua
  69. 1 1
      data/skill/overexertion.lua
  70. 2 2
      data/skill/subterfuge.lua
  71. 1 1
      data/spell/battleaxe.lua
  72. 1 1
      data/spell/cleave.lua
  73. 1 1
      data/spell/dagger.lua
  74. 1 1
      data/spell/dusk.lua
  75. 1 1
      data/spell/energyrifle.lua
  76. 2 2
      data/spell/lazor.lua
  77. 2 2
      data/spell/plasmacannon.lua
  78. 1 1
      data/spell/rocketboots.lua
  79. 2 2
      data/spell/shotgun.lua
  80. 2 2
      data/spell/smg.lua
  81. 1 1
      data/weapon/energyrifle.lua
  82. 2 2
      data/weapon/plasmacannon.lua
  83. 1 1
      data/weapon/shotgun.lua
  84. 1 1
      data/weapon/smg.lua
  85. 1 1
      main.lua

+ 14 - 14
app/editor/context.lua → app/context/editor.lua

@@ -2,20 +2,20 @@ local Editor = class()
 
 function Editor:load(options)
   self.options = options
-  self.grid = app.editor.grid()
+  self.grid = app.ui.editor.grid()
 
-  self.event = app.core.event()
-  self.view = app.editor.view()
-  self.effects = app.core.effects()
+  self.event = app.util.event()
+  self.view = app.ui.editor.view()
+  self.effects = app.media.effects()
   self.effects:remove('deathDesaturate')
-  self.collision = app.core.collision()
-  self.map = app.map()
-  self.dragger = app.editor.dragger()
-  self.scaler = app.editor.scaler()
-  self.selector = app.editor.selector()
-  self.deletor = app.editor.deletor()
-  self.saver = app.editor.saver()
-  self.debug = app.editor.debug()
+  self.collision = app.logic.collision()
+  self.map = app.logic.map()
+  self.dragger = app.ui.editor.dragger()
+  self.scaler = app.ui.editor.scaler()
+  self.selector = app.ui.editor.selector()
+  self.deletor = app.ui.editor.deletor()
+  self.saver = app.ui.editor.saver()
+  self.debug = app.ui.editor.debug()
 
   self.widgets = {self.grid}
   self.components = {
@@ -51,8 +51,8 @@ end
 
 function Editor:keyreleased(key)
   if key == 'escape' then
-    app.core.context:remove(ctx)
-    app.core.context:add(app.menu.context)
+    app.util.context:remove(ctx)
+    app.util.context:add(app.context.menu)
   end
 end
 

+ 15 - 15
app/core/game.lua → app/context/game.lua

@@ -4,23 +4,23 @@ Game.tag = 'client'
 
 function Game:load(options)
 	self.options = options
-  self.event = app.core.event()
-  self.net = app.netClient()
-  self.input = app.core.input()
-  self.view = app.core.view()
-  self.collision = app.core.collision()
-  self.players = app.players()
-  self.spells = app.core.spells()
-  self.buffs = app.core.buffs()
-  self.particles = app.core.particles()
-  self.effects = app.core.effects()
-  self.sound = app.core.sound()
-  self.map = app.map()
-  self.hud = app.hud.controller()
+  self.event = app.util.event()
+  self.net = app.net.client()
+  self.input = app.util.input()
+  self.view = app.media.view()
+  self.collision = app.logic.collision()
+  self.players = app.player.controller()
+  self.spells = app.logic.spells()
+  self.buffs = app.logic.buffs()
+  self.particles = app.media.particles()
+  self.effects = app.media.effects()
+  self.sound = app.media.sound()
+  self.map = app.logic.map()
+  self.hud = app.ui.hud.controller()
 
   self.event:on('game.quit', function(data)
-    app.core.context:remove(ctx)
-    app.core.context:add(app.menu.context)
+    app.util.context:remove(ctx)
+    app.util.context:add(app.context.menu)
   end)
 end
 

+ 11 - 11
app/menu/context.lua → app/context/menu.lua

@@ -11,17 +11,17 @@ function Menu:load(user)
   love.mouse.setVisible(true)
   love.keyboard.setKeyRepeat(true)
 
-  self.ribbon = app.menu.ribbon()
-  self.background = app.menu.background()
-  self.input = app.menu.input()
-  self.options = app.menu.options()
-  self.back = app.menu.back()
-  self.alert = app.menu.alert()
+  self.ribbon = app.ui.menu.ribbon()
+  self.background = app.ui.menu.background()
+  self.input = app.ui.menu.input()
+  self.options = app.ui.menu.options()
+  self.back = app.ui.menu.back()
+  self.alert = app.ui.menu.alert()
 
   self.pages = {
-    login = app.menu.login(),
-    main = app.menu.main(),
-    serverlist = app.menu.serverList()
+    login = app.ui.menu.login(),
+    main = app.ui.menu.main(),
+    serverlist = app.ui.menu.serverList()
   }
 
   self:push(self.user.token and 'main' or 'login')
@@ -87,8 +87,8 @@ end
 function Menu:connect(ip)
   serverIp = ip
   serverPort = 6061
-  app.core.context:remove(self)
-  app.core.context:add(app.core.game, self.options.data)
+  app.util.context:remove(self)
+  app.util.context:add(app.context.game, self.options.data)
   love.keyboard.setKeyRepeat(false)
 end
 

+ 3 - 3
app/patcher.lua → app/context/patcher.lua

@@ -6,12 +6,12 @@ function Patcher:load()
   local os = love.system.getOS()
   if os == 'OS X' then os = 'OSX' end
 
-  local code, gameData = app.goregous:patch(version, os)
+  local code, gameData = app.net.goregous:patch(version, os)
   if false and code and f.exe(self['patch' .. os], self, code, gameData) then
     love.event.quit()
   else
-    app.core.context:remove(self)
-    app.core.context:add(app.menu.context)
+    app.util.context:remove(self)
+    app.util.context:add(app.context.menu)
   end
 end
 

+ 10 - 10
app/core/server.lua → app/context/server.lua

@@ -3,23 +3,23 @@ local Server = class()
 Server.tag = 'server'
 
 function Server:load()
-  self.event = app.core.event()
-  self.players = app.players()
-  self.spells = app.core.spells()
-  self.collision = app.core.collision()
-  self.buffs = app.core.buffs()
-  self.net = app.netServer()
-  self.map = app.map()
+  self.event = app.util.event()
+  self.players = app.player.controller()
+  self.spells = app.logic.spells()
+  self.collision = app.logic.collision()
+  self.buffs = app.logic.buffs()
+  self.net = app.net.server()
+  self.map = app.logic.map()
 
   for i = 1, 0 do
     local p = self.players.players[i]
     setmetatable(p, {__index = app.playerRobot})
-    self.net:emit(app.core.net.events.class, {id = i, class = 1, team = i % 2})
+    self.net:emit(app.net.core.events.class, {id = i, class = 1, team = i % 2})
   end
 
   self.event:on('game.quit', function()
-    goregous:send({'killServer'})
-    app.core.context:remove(ctx)
+    app.net.goregous:send({'killServer'})
+    app.util.context:remove(ctx)
   end)
 end
 

+ 0 - 0
app/core/buffs.lua → app/logic/buffs.lua


+ 0 - 0
app/core/collision.lua → app/logic/collision.lua


+ 1 - 1
app/map.lua → app/logic/map.lua

@@ -114,7 +114,7 @@ function Map:init(name)
     end
   end
 
-  ctx.event:on(app.core.net.events.prop, function(data)
+  ctx.event:on(app.net.core.events.prop, function(data)
     local prop = self.props[data.id]
     prop.x, prop.y = data.x / 10, data.y / 10
   end)

+ 1 - 1
app/core/spell.lua → app/logic/spell.lua

@@ -109,7 +109,7 @@ function Spell:damage(enemies, amount)
   amount = f.val(amount)
 
   table.each(enemies, function(enemy)
-    ctx.net:emit(app.core.net.events.damage, {id = enemy.id, from = self.owner.id, amount = amount(enemy), tick = tick})
+    ctx.net:emit(app.net.core.events.damage, {id = enemy.id, from = self.owner.id, amount = amount(enemy), tick = tick})
   end)
 end
 

+ 0 - 0
app/core/spells.lua → app/logic/spells.lua


+ 0 - 0
app/core/weapon.lua → app/logic/weapon.lua


+ 0 - 0
app/core/effects.lua → app/media/effects.lua


+ 0 - 0
app/core/particles.lua → app/media/particles.lua


+ 0 - 0
app/core/sound.lua → app/media/sound.lua


+ 0 - 0
app/core/view.lua → app/media/view.lua


+ 15 - 15
app/netclient.lua → app/net/client.lua

@@ -1,27 +1,27 @@
-local NetClient = extend(app.core.net)
+local NetClient = extend(app.net.core)
 
 NetClient.signatures = {}
-NetClient.signatures[app.core.net.messages.join] = {{'username', 'string'}, important = true}
-NetClient.signatures[app.core.net.messages.leave] = {important = true}
-NetClient.signatures[app.core.net.messages.class] = {{'class', '4bits'}, {'team', '1bit'}, important = true}
-NetClient.signatures[app.core.net.messages.input] = {
+NetClient.signatures[app.net.core.messages.join] = {{'username', 'string'}, important = true}
+NetClient.signatures[app.net.core.messages.leave] = {important = true}
+NetClient.signatures[app.net.core.messages.class] = {{'class', '4bits'}, {'team', '1bit'}, important = true}
+NetClient.signatures[app.net.core.messages.input] = {
   {'tick', '16bits'},
   {'w', 'bool'}, {'a', 'bool'}, {'s', 'bool'}, {'d', 'bool'},
   {'x', '12bits'}, {'y', '12bits'}, {'l', 'bool'}, {'r', 'bool'},
   {'slot', '3bits'}, {'reload', 'bool'},
   delta = {{'w', 'a', 's', 'd'}, {'x', 'y'}, 'l', 'r', 'slot', 'reload'}
 }
-NetClient.signatures[app.core.net.messages.chat] = {{'message', 'string'}, important = true}
+NetClient.signatures[app.net.core.messages.chat] = {{'message', 'string'}, important = true}
 
 NetClient.receive = {}
 NetClient.receive['default'] = function(self, event) ctx.event:emit(event.msg, event.data) end
 
-NetClient.receive[app.core.net.messages.join] = function(self, event)
+NetClient.receive[app.net.core.messages.join] = function(self, event)
   ctx.id = event.data.id
-  setmetatable(ctx.players:get(ctx.id), {__index = app.playerMain})
+  setmetatable(ctx.players:get(ctx.id), {__index = app.player.main})
 end
 
-NetClient.receive[app.core.net.messages.snapshot] = function(self, event)
+NetClient.receive[app.net.core.messages.snapshot] = function(self, event)
   ctx.tick = event.data.tick + math.floor(((event.peer:round_trip_time() / 2) / 1000) / tickRate)
   if env ~= 'release' then ctx.tick = event.data.tick end
   --ctx.map:load(event.data.map)
@@ -36,15 +36,15 @@ NetClient.receive[app.core.net.messages.snapshot] = function(self, event)
 end
 
 function NetClient:init()
-  self.other = app.netServer
+  self.other = app.net.server
   self:connectTo(serverIp, 6061)
   self.messageBuffer = {}
 
-  ctx.event:on(app.core.net.events.join, function(data)
+  ctx.event:on(app.net.core.events.join, function(data)
     ctx.players:get(data.id).username = data.username
   end)
 
-  ctx.event:on(app.core.net.events.sync, function(data)
+  ctx.event:on(app.net.core.events.sync, function(data)
     local p = ctx.players:get(data.id)
     if p and p.active then
       p:trace(data)
@@ -55,18 +55,18 @@ function NetClient:init()
     self:quit()
   end)
 
-  app.core.net.init(self)
+  app.net.core.init(self)
 end
 
 function NetClient:quit()
-  self:send(app.core.net.messages.leave)
+  self:send(app.net.core.messages.leave)
   self.host:flush()
   self.server:disconnect()
 end
 
 function NetClient:connect(event)
   self.server = event.peer
-  self:send(app.core.net.messages.join, {username = username})
+  self:send(app.net.core.messages.join, {username = username})
   event.peer:ping_interval(100)
   event.peer:ping()
 end

+ 2 - 2
app/core/net.lua → app/net/core.lua

@@ -23,8 +23,8 @@ Net.messages = {
 }
 
 function Net:init()
-  self.inStream = app.core.stream()
-  self.outStream = app.core.stream()
+  self.inStream = app.net.stream()
+  self.outStream = app.net.stream()
 end
 
 function Net:listen(port)

+ 0 - 0
app/goregous.lua → app/net/goregous.lua


+ 34 - 34
app/netserver.lua → app/net/server.lua

@@ -1,10 +1,10 @@
-local NetServer = extend(app.core.net)
+local NetServer = extend(app.net.core)
 
 NetServer.signatures = {}
-NetServer.signatures[app.core.net.events.join] = {{'id', '4bits'}, {'username', 'string'}, important = true}
-NetServer.signatures[app.core.net.events.leave] = {{'id', '4bits'}, {'reason', 'string'}, important = true}
-NetServer.signatures[app.core.net.events.class] = {{'id', '4bits'}, {'class', '4bits'}, {'team', '1bit'}, important = true}
-NetServer.signatures[app.core.net.events.sync] = {
+NetServer.signatures[app.net.core.events.join] = {{'id', '4bits'}, {'username', 'string'}, important = true}
+NetServer.signatures[app.net.core.events.leave] = {{'id', '4bits'}, {'reason', 'string'}, important = true}
+NetServer.signatures[app.net.core.events.class] = {{'id', '4bits'}, {'class', '4bits'}, {'team', '1bit'}, important = true}
+NetServer.signatures[app.net.core.events.sync] = {
   {'id', '4bits'},
   {'tick', '16bits'},
   {'ack', '16bits'},
@@ -14,17 +14,17 @@ NetServer.signatures[app.core.net.events.sync] = {
   {'weapon', '3bits'}, {'skill', '3bits'},
   delta = {'x', 'y', 'z', 'angle', 'health', 'shield', 'weapon', 'skill'}
 }
-NetServer.signatures[app.core.net.events.fire] = {
+NetServer.signatures[app.net.core.events.fire] = {
   {'id', '4bits'}, {'slot', '3bits'}, {'mx', '12bits'}, {'my', '12bits'},
   delta = {{'mx', 'my'}}
 }
-NetServer.signatures[app.core.net.events.damage] = {{'id', '4bits'}, {'amount', 'string'}, {'from', '4bits'}}
-NetServer.signatures[app.core.net.events.dead] = {{'id', '4bits'}, {'kill', '4bits'}, {'assists', {{'id', '4bits'}}}, important = true}
-NetServer.signatures[app.core.net.events.spawn] = {{'id', '4bits'}, important = true}
-NetServer.signatures[app.core.net.events.chat] = {{'message', 'string'}, important = true}
-NetServer.signatures[app.core.net.events.prop] = {{'id', '16bits'}, {'x', '16bits'}, {'y', '16bits'}}
-NetServer.signatures[app.core.net.messages.join] = {{'id', '4bits'}, important = true}
-NetServer.signatures[app.core.net.messages.snapshot] = {
+NetServer.signatures[app.net.core.events.damage] = {{'id', '4bits'}, {'amount', 'string'}, {'from', '4bits'}}
+NetServer.signatures[app.net.core.events.dead] = {{'id', '4bits'}, {'kill', '4bits'}, {'assists', {{'id', '4bits'}}}, important = true}
+NetServer.signatures[app.net.core.events.spawn] = {{'id', '4bits'}, important = true}
+NetServer.signatures[app.net.core.events.chat] = {{'message', 'string'}, important = true}
+NetServer.signatures[app.net.core.events.prop] = {{'id', '16bits'}, {'x', '16bits'}, {'y', '16bits'}}
+NetServer.signatures[app.net.core.messages.join] = {{'id', '4bits'}, important = true}
+NetServer.signatures[app.net.core.messages.snapshot] = {
   {'tick', '16bits'},
   {'map', 'string'},
   {'players', {{'id', '4bits'}, {'username', 'string'}, {'class', '4bits'}, {'team', '1bit'}}},
@@ -34,26 +34,26 @@ NetServer.signatures[app.core.net.messages.snapshot] = {
 NetServer.receive = {}
 NetServer.receive['default'] = f.empty
 
-NetServer.receive[app.core.net.messages.join] = function(self, event)
+NetServer.receive[app.net.core.messages.join] = function(self, event)
   local pid = self.peerToPlayer[event.peer]
   ctx.players:get(pid).username = event.data.username
-  self:send(app.core.net.messages.join, event.peer, {id = pid})
-  self:emit(app.core.net.events.join, {id = pid, username = event.data.username})
-  self:emit(app.core.net.events.chat, {message = '{white}' .. event.data.username .. ' has joined!'})
+  self:send(app.net.core.messages.join, event.peer, {id = pid})
+  self:emit(app.net.core.events.join, {id = pid, username = event.data.username})
+  self:emit(app.net.core.events.chat, {message = '{white}' .. event.data.username .. ' has joined!'})
   self:snapshot(event.peer)
 end
 
-NetServer.receive[app.core.net.messages.leave] = function(self, event) self:disconnect(event) end
+NetServer.receive[app.net.core.messages.leave] = function(self, event) self:disconnect(event) end
 
-NetServer.receive[app.core.net.messages.class] = function(self, event)
-  self:emit(app.core.net.events.class, {id = self.peerToPlayer[event.peer], class = event.data.class, team = event.data.team})
+NetServer.receive[app.net.core.messages.class] = function(self, event)
+  self:emit(app.net.core.events.class, {id = self.peerToPlayer[event.peer], class = event.data.class, team = event.data.team})
 end
 
-NetServer.receive[app.core.net.messages.input] = function(self, event)
+NetServer.receive[app.net.core.messages.input] = function(self, event)
   ctx.players:get(self.peerToPlayer[event.peer]):trace(event.data, event.peer:round_trip_time())
 end
 
-NetServer.receive[app.core.net.messages.chat] = function(self, event)
+NetServer.receive[app.net.core.messages.chat] = function(self, event)
   local pid = self.peerToPlayer[event.peer]
   local username = ctx.players:get(pid).username
   local color = ctx.players:get(pid).team == 0 and 'purple' or 'orange'
@@ -63,7 +63,7 @@ NetServer.receive[app.core.net.messages.chat] = function(self, event)
     for word in string.gmatch(message, '([^ ]+)') do
       table.insert(data, word)
     end
-    local function reply(message) self:send(app.core.net.events.chat, event.peer, {message = '{red}' .. message}) end
+    local function reply(message) self:send(app.net.core.events.chat, event.peer, {message = '{red}' .. message}) end
     local handlers = {
       ['/restart'] = function(data)
         if username ~= ctx.owner then return reply('permission denied') end
@@ -79,25 +79,25 @@ NetServer.receive[app.core.net.messages.chat] = function(self, event)
         for i = 1, ctx.players.max do
           if ctx.players:get(i).username == data[2] then player = i break end
         end
-        if not player then return self:send(app.core.net.events.chat, event.peer, {message = '{red}couldn\'t find player "' .. data[2] .. '"'}) end
+        if not player then return self:send(app.net.core.events.chat, event.peer, {message = '{red}couldn\'t find player "' .. data[2] .. '"'}) end
         for i = 1, ctx.players.max do
           local p = self.host:get_peer(i)
           if self.peerToPlayer[p] == player then peer = p break end
         end
-        if not peer then return self:send(app.core.net.events.chat, event.peer, {message = '{red}"' .. data[2] .. '" doesn\'t seem to be connected'}) end
+        if not peer then return self:send(app.net.core.events.chat, event.peer, {message = '{red}"' .. data[2] .. '" doesn\'t seem to be connected'}) end
         self:disconnect({peer = peer, reason = 'kicked'})
       end,
 
       ['/roll'] = function(data)
-        self:emit(app.core.net.events.chat, {message = '{red}' .. username .. ' rolled {green}' .. love.math.random(1, 100)})
+        self:emit(app.net.core.events.chat, {message = '{red}' .. username .. ' rolled {green}' .. love.math.random(1, 100)})
       end,
 
       ['/bjorn'] = function(data)
-        self:emit(app.core.net.events.chat, {message = '{purple}-_-'})
+        self:emit(app.net.core.events.chat, {message = '{purple}-_-'})
       end,
 
       default = function(data)
-        self:send(app.core.net.events.chat, event.peer, {message = '{red}unknown command "' .. data[1]:sub(2) .. '"'})
+        self:send(app.net.core.events.chat, event.peer, {message = '{red}unknown command "' .. data[1]:sub(2) .. '"'})
       end
     }
     handlers['/reset'] = handlers['/restart']
@@ -106,11 +106,11 @@ NetServer.receive[app.core.net.messages.chat] = function(self, event)
 
     return (handlers[data[1]] or handlers.default)(data)
   end
-  self:emit(app.core.net.events.chat, {message = '{' .. color .. '}' .. username .. '{white}: ' .. message})
+  self:emit(app.net.core.events.chat, {message = '{' .. color .. '}' .. username .. '{white}: ' .. message})
 end
 
 function NetServer:init()
-  self.other = app.netClient
+  self.other = app.net.client
 
   self:listen(6061)
   self.peerToPlayer = {}
@@ -121,7 +121,7 @@ function NetServer:init()
     self:quit()
   end)
 
-  app.core.net.init(self)
+  app.net.core.init(self)
 end
 
 function NetServer:quit()
@@ -145,8 +145,8 @@ function NetServer:disconnect(event)
   local pid = self.peerToPlayer[event.peer]
   local username = ctx.players:get(pid).username
   local reason = event.reason or 'left'
-  self:emit(app.core.net.events.chat, {message = '{white}' .. username .. ' has left (' .. reason .. ')'})
-  self:emit(app.core.net.events.leave, {id = pid, reason = reason})
+  self:emit(app.net.core.events.chat, {message = '{white}' .. username .. ' has left (' .. reason .. ')'})
+  self:emit(app.net.core.events.leave, {id = pid, reason = reason})
   self.peerToPlayer[event.peer] = nil
   event.peer:disconnect_now()
   if username == ctx.owner then
@@ -204,7 +204,7 @@ function NetServer:snapshot(peer)
       })
     end
   end
-  self:send(app.core.net.messages.snapshot, peer, {tick = tick, map = 'testArena', ['players'] = players})
+  self:send(app.net.core.messages.snapshot, peer, {tick = tick, map = 'testArena', ['players'] = players})
 end
 
 function NetServer:nextPlayerId()

+ 0 - 0
app/core/stream.lua → app/net/stream.lua


+ 1 - 1
app/player.lua → app/player/base.lua

@@ -218,7 +218,7 @@ function Player:slot(input, prev)
     local msg = {id = self.id, slot = slot, mx = obj.needsMouse and input.x, my = obj.needsMouse and input.y}
     obj:fire(self, input.x, input.y)
     if obj.targeted then obj.targeting = false end
-    ctx.net:emit(app.core.net.events.fire, msg)
+    ctx.net:emit(app.net.core.events.fire, msg)
   end
 
   for i = 1, 5 do

+ 8 - 8
app/players.lua → app/player/controller.lua

@@ -6,19 +6,19 @@ function Players:init()
   self.active = {}
 
   for i = 1, self.max do
-    self.players[i] = ctx.tag == 'server' and app.playerServer() or app.playerDummy()
+    self.players[i] = ctx.tag == 'server' and app.player.server() or app.player.dummy()
     self.players[i].id = i
   end
 
-  ctx.event:on(app.core.net.events.leave, function(data)
+  ctx.event:on(app.net.core.events.leave, function(data)
     self:deactivate(data.id)
   end)
 
-  ctx.event:on(app.core.net.events.class, function(data)
+  ctx.event:on(app.net.core.events.class, function(data)
     self:setClass(data.id, data.class, data.team)
   end)
 
-  ctx.event:on(app.core.net.events.fire, function(data)
+  ctx.event:on(app.net.core.events.fire, function(data)
     if ctx.id and data.id ~= ctx.id then
       local p = self:get(data.id)
       local slot = p.slots[data.slot]
@@ -26,7 +26,7 @@ function Players:init()
     end
   end)
 
-  ctx.event:on(app.core.net.events.damage, function(data)
+  ctx.event:on(app.net.core.events.damage, function(data)
     local to, from = self:get(data.id), self:get(data.from)
     to.lastHurt = tick
     if data.id ~= data.from then
@@ -50,7 +50,7 @@ function Players:init()
     })
   end)
 
-  ctx.event:on(app.core.net.events.dead, function(data)
+  ctx.event:on(app.net.core.events.dead, function(data)
     local killer, victim = self:get(data.kill), self:get(data.id)
     if data.kill ~= data.id then
       killer.kills = killer.kills + 1
@@ -60,7 +60,7 @@ function Players:init()
     victim:die()
   end)
 
-  ctx.event:on(app.core.net.events.spawn, function(data)
+  ctx.event:on(app.net.core.events.spawn, function(data)
     local p = self:get(data.id)
     p.ded = false
     p:spawn()
@@ -68,7 +68,7 @@ function Players:init()
 
   ctx.event:on('game.restart', function(data)
     self:each(function(p)
-      ctx.net:emit(app.core.net.events.spawn, {id = p.id})
+      ctx.net:emit(app.net.core.events.spawn, {id = p.id})
     end)
   end)
 end

+ 4 - 4
app/playerdummy.lua → app/player/dummy.lua

@@ -1,11 +1,11 @@
-local PlayerDummy = extend(app.player)
+local PlayerDummy = extend(app.player.base)
 
 local function drawTick() return tick - (interp / tickRate) end
 
 function PlayerDummy:activate()
   self.history = {}
 
-  app.player.activate(self)
+  app.player.base.activate(self)
 end
 
 function PlayerDummy:update()
@@ -15,7 +15,7 @@ function PlayerDummy:update()
 
   self:slot()
 
-  app.player.update(self)
+  app.player.base.update(self)
 end
 
 function PlayerDummy:get(t)
@@ -58,7 +58,7 @@ function PlayerDummy:draw()
   self.drawAngle = lerpd.angle
   self.drawX, self.drawY = ctx.view:three(lerpd.x, lerpd.y, lerpd.z)
   self.drawScale = 1 + (ctx.view:convertZ(lerpd.z) / 500)
-  app.player.draw(lerpd)
+  app.player.base.draw(lerpd)
 end
 
 function PlayerDummy:trace(data)

+ 7 - 7
app/playermain.lua → app/player/main.lua

@@ -1,4 +1,4 @@
-local PlayerMain = extend(app.player)
+local PlayerMain = extend(app.player.base)
 
 function PlayerMain:activate()
   self.prev = setmetatable({}, self.meta)
@@ -13,7 +13,7 @@ function PlayerMain:activate()
 
   ctx.view.target = self
 
-  app.player.activate(self)
+  app.player.base.activate(self)
 end
 
 function PlayerMain:get(t)
@@ -28,7 +28,7 @@ function PlayerMain:update()
   if self.ded then
     self.ded = timer.rot(self.ded)
     self:fade()
-    return app.player.update(self)
+    return app.player.base.update(self)
   end
 
   self.prev.x = self.x
@@ -52,9 +52,9 @@ function PlayerMain:update()
     end
   end
 
-  ctx.net:send(app.core.net.messages.input, input)
+  ctx.net:send(app.net.core.messages.input, input)
 
-  app.player.update(self)
+  app.player.base.update(self)
 
   self.prev.input = input
 end
@@ -65,7 +65,7 @@ function PlayerMain:draw()
   self.drawAngle = lerpd.angle
   self.drawX, self.drawY = ctx.view:three(lerpd.x, lerpd.y, lerpd.z)
   self.drawScale = 1 + (ctx.view:convertZ(lerpd.z) / 500)
-  app.player.draw(lerpd)
+  app.player.base.draw(lerpd)
 end
 
 function PlayerMain:trace(data)
@@ -132,7 +132,7 @@ end
 
 function PlayerMain:die()
   if self.heartbeatSound then self.heartbeatSound:pause() end
-  app.player.die(self)
+  app.player.base.die(self)
   ctx.view:screenshake(20)
   ctx.view.target = nil
   ctx.view.target = self.killer

+ 1 - 1
app/playerrobot.lua → app/player/robot.lua

@@ -1,4 +1,4 @@
-local PlayerRobot = extend(app.playerServer)
+local PlayerRobot = extend(app.player.server)
 
 function PlayerRobot:activate()
   app.playerServer.activate(self)

+ 10 - 10
app/playerserver.lua → app/player/server.lua

@@ -1,4 +1,4 @@
-local PlayerServer = extend(app.player)
+local PlayerServer = extend(app.player.base)
 
 function PlayerServer:activate()
   self.shields = {}
@@ -13,7 +13,7 @@ function PlayerServer:activate()
   self.spawnTimer = 0
   self.spawnMultiplier = 0
 
-  app.player.activate(self)
+  app.player.base.activate(self)
 end
 
 function PlayerServer:get(t)
@@ -37,7 +37,7 @@ end
 function PlayerServer:update()
   if self.ded then
     self:time()
-    return app.player.update(self)
+    return app.player.base.update(self)
   end
 
   self:time()
@@ -60,7 +60,7 @@ function PlayerServer:update()
       if spawn.team == self.team then
         self.health = math.min(self.health + amount, self.maxHealth)
       else
-        ctx.event:emit(app.core.net.events.damage, {id = self.id, amount = amount, from = self.id, tick = tick})
+        ctx.event:emit(app.net.core.events.damage, {id = self.id, amount = amount, from = self.id, tick = tick})
       end
     else
       self.spawnMultiplier = 0
@@ -69,7 +69,7 @@ function PlayerServer:update()
     self.spawnTimer = .5
   end
 
-  app.player.update(self)
+  app.player.base.update(self)
 end
 
 function PlayerServer:trace(data, ping)
@@ -137,7 +137,7 @@ function PlayerServer:trace(data, ping)
     msg.id = self.id
     msg.tick = tick
     msg.ack = self.ack
-    ctx.net:emit(app.core.net.events.sync, msg)
+    ctx.net:emit(app.net.core.events.sync, msg)
 
     -- Undo lag compensation
     ctx.players:each(function(p)
@@ -151,12 +151,12 @@ function PlayerServer:trace(data, ping)
 end
 
 function PlayerServer:time()
-  self.ded = timer.rot(self.ded, function() ctx.net:emit(app.core.net.events.spawn, {id = self.id}) end)
+  self.ded = timer.rot(self.ded, function() ctx.net:emit(app.net.core.events.spawn, {id = self.id}) end)
   if self.ded == 0 then self.ded = false end
 end
 
 function PlayerServer:spell(kind)
-  app.player.spell(self, kind)
+  app.player.base.spell(self, kind)
 end
 
 function PlayerServer:hurt(data)
@@ -194,7 +194,7 @@ function PlayerServer:hurt(data)
         if playerHurt[2][2] > 0 then table.insert(assists, {id = playerHurt[2][1]}) end
       end
 
-      ctx.net:emit(app.core.net.events.dead, {id = self.id, kill = data.from, assists = assists})
+      ctx.net:emit(app.net.core.events.dead, {id = self.id, kill = data.from, assists = assists})
     else
       f.exe(self.shields[1].callback, self)
       table.remove(self.shields, 1)
@@ -210,7 +210,7 @@ function PlayerServer:spawn()
   table.clear(self.hurtHistory)
   table.clear(self.helpHistory)
 
-  app.player.spawn(self)
+  app.player.base.spawn(self)
 end
 
 PlayerServer.logic = f.empty

+ 0 - 0
app/editor/debug.lua → app/ui/editor/debug.lua


+ 0 - 0
app/editor/deletor.lua → app/ui/editor/deletor.lua


+ 0 - 0
app/editor/dragger.lua → app/ui/editor/dragger.lua


+ 0 - 0
app/editor/grid.lua → app/ui/editor/grid.lua


+ 0 - 0
app/editor/saver.lua → app/ui/editor/saver.lua


+ 0 - 0
app/editor/scaler.lua → app/ui/editor/scaler.lua


+ 0 - 0
app/editor/selector.lua → app/ui/editor/selector.lua


+ 3 - 3
app/editor/view.lua → app/ui/editor/view.lua

@@ -1,4 +1,4 @@
-local View = extend(app.core.view)
+local View = extend(app.media.view)
 
 function View:init()
   self.targetScale = 1
@@ -7,11 +7,11 @@ function View:init()
   self.yVel = 0
   self.maxSpeed = 20
 
-  app.core.view.init(self)
+  app.media.view.init(self)
 end
 
 function View:update()
-  app.core.view.update(self)
+  app.media.view.update(self)
 
   if not love.keyboard.isDown('lctrl') then
     if love.keyboard.isDown('w') then

+ 0 - 0
app/hud/blood.lua → app/ui/hud/blood.lua


+ 0 - 0
app/hud/buffs.lua → app/ui/hud/buffs.lua


+ 1 - 1
app/hud/chat.lua → app/ui/hud/chat.lua

@@ -59,7 +59,7 @@ function Chat:keypressed(key)
     if key == 'backspace' then self.message = self.message:sub(1, -2)
     elseif key == 'return' or key == 'escape' then
       if #self.message > 0 and key ~= 'escape' then
-        ctx.net:send(app.core.net.messages.chat, {
+        ctx.net:send(app.net.core.messages.chat, {
           message = self.message
         })
       end

+ 3 - 3
app/hud/classSelect.lua → app/ui/hud/classSelect.lua

@@ -11,7 +11,7 @@ function ClassSelect:init()
   self.utility = 0
   self.teamCt = {0, 0}
 
-  ctx.event:on(app.core.net.events.class, function(data)
+  ctx.event:on(app.net.core.events.class, function(data)
     if data.id == ctx.id then self.active = false end
   end)
 end
@@ -112,7 +112,7 @@ function ClassSelect:keypressed(key)
     for i = 1, #data.class do
       local class = data.class[data.class.list[i]]
       if not class.locked and key == tostring(i) then
-        ctx.net:send(app.core.net.messages.class, {
+        ctx.net:send(app.net.core.messages.class, {
           class = i,
           team = ctx.id > 1 and 1 or 0
         })
@@ -133,7 +133,7 @@ function ClassSelect:mousereleased(x, y, button)
   if self.active and button == 'l' then
     for i = 1, #data.class.list do
       if not data.class[data.class.list[i]].locked and math.inside(x, y, u * .09 * i, v * .326, u * .08, u * .08) then
-        ctx.net:send(app.core.net.messages.class, {
+        ctx.net:send(app.net.core.messages.class, {
           class = i,
           team = self.team
         })

+ 17 - 17
app/hud/controller.lua → app/ui/hud/controller.lua

@@ -5,23 +5,23 @@ local g = love.graphics
 function Hud:init()
   self._debug = false
 
-  self.players = app.hud.players()
-  self.blood = app.hud.blood()
-  self.left = app.hud.left()
-  self.health = app.hud.health()
-  self.icons = app.hud.icons()
-  self.right = app.hud.right()
-  self.buffs = app.hud.buffs()
-  self.feed = app.hud.feed()
-  self.chat = app.hud.chat()
-  self.scoreboard = app.hud.scoreboard()
-  self.dead = app.hud.dead()
-  self.killPopup = app.hud.killPopup()
-  self.gameOver = app.hud.gameOver()
-  self.classSelect = app.hud.classSelect()
-  self.debug = app.hud.debug()
-
-  ctx.event:on(app.core.net.events.chat, function(data) self.chat:add(data) end)
+  self.players = app.ui.hud.players()
+  self.blood = app.ui.hud.blood()
+  self.left = app.ui.hud.left()
+  self.health = app.ui.hud.health()
+  self.icons = app.ui.hud.icons()
+  self.right = app.ui.hud.right()
+  self.buffs = app.ui.hud.buffs()
+  self.feed = app.ui.hud.feed()
+  self.chat = app.ui.hud.chat()
+  self.scoreboard = app.ui.hud.scoreboard()
+  self.dead = app.ui.hud.dead()
+  self.killPopup = app.ui.hud.killPopup()
+  self.gameOver = app.ui.hud.gameOver()
+  self.classSelect = app.ui.hud.classSelect()
+  self.debug = app.ui.hud.debug()
+
+  ctx.event:on(app.net.core.events.chat, function(data) self.chat:add(data) end)
   ctx.view:register(self, 'gui')
 
   self.u = ctx.view.frame.width

+ 0 - 0
app/hud/dead.lua → app/ui/hud/dead.lua


+ 0 - 0
app/hud/debug.lua → app/ui/hud/debug.lua


+ 1 - 1
app/hud/feed.lua → app/ui/hud/feed.lua

@@ -6,7 +6,7 @@ function Feed:init()
   self.entries = {}
   self.alpha = 0
 
-  ctx.event:on(app.core.net.events.dead, function(data) self:insert(data) end)
+  ctx.event:on(app.net.core.events.dead, function(data) self:insert(data) end)
 end
 
 function Feed:update()

+ 0 - 0
app/hud/gameOver.lua → app/ui/hud/gameOver.lua


+ 0 - 0
app/hud/health.lua → app/ui/hud/health.lua


+ 0 - 0
app/hud/icons.lua → app/ui/hud/icons.lua


+ 1 - 1
app/hud/killPopup.lua → app/ui/hud/killPopup.lua

@@ -7,7 +7,7 @@ function KillPopup:init()
   self.multikill = {}
   self.multikillTick = {}
   self.feed = {}
-  ctx.event:on(app.core.net.events.dead, function(data)
+  ctx.event:on(app.net.core.events.dead, function(data)
     self.streak[data.id] = 0
     if data.id ~= data.kill then
       self.multikill[data.kill] = self.multikill[data.kill] or 0

+ 0 - 0
app/hud/left.lua → app/ui/hud/left.lua


+ 0 - 0
app/hud/players.lua → app/ui/hud/players.lua


+ 0 - 0
app/hud/right.lua → app/ui/hud/right.lua


+ 3 - 3
app/hud/scoreboard.lua → app/ui/hud/scoreboard.lua

@@ -3,9 +3,9 @@ local Scoreboard = class()
 local g = love.graphics
 
 function Scoreboard:init()
-  ctx.event:on(app.core.net.events.class, function(data) self:refresh() end)
-  ctx.event:on(app.core.net.events.dead, function(data) self:refresh() end)
-  ctx.event:on(app.core.net.events.leave, function(data) self:refresh() end)
+  ctx.event:on(app.net.core.events.class, function(data) self:refresh() end)
+  ctx.event:on(app.net.core.events.dead, function(data) self:refresh() end)
+  ctx.event:on(app.net.core.events.leave, function(data) self:refresh() end)
 
   self.names = {[0] = '', [1] = ''}
   self.ks = {[0] = '', [1] = ''}

+ 0 - 0
app/menu/alert.lua → app/ui/menu/alert.lua


+ 0 - 0
app/menu/back.lua → app/ui/menu/back.lua


+ 0 - 0
app/menu/background.lua → app/ui/menu/background.lua


+ 0 - 0
app/menu/input.lua → app/ui/menu/input.lua


+ 1 - 1
app/menu/login.lua → app/ui/menu/login.lua

@@ -54,7 +54,7 @@ function Login:login()
   local username = ctx.input:val('username')
   if #username == 0 then return end
 
-  local success = app.goregous:login(username)
+  local success = app.net.goregous:login(username)
   if success then
     _G['username'] = username
     ctx.user.username = username

+ 4 - 4
app/menu/main.lua → app/ui/menu/main.lua

@@ -36,9 +36,9 @@ function Main:mousepressed(x, y, button)
 end
 
 function Main:host()
-  local success = app.goregous:createServer()
+  local success = app.net.goregous:createServer()
   if success then
-    local server = app.core.context:add(app.core.server)
+    local server = app.util.context:add(app.context.server)
     server.owner = username
     ctx:connect('localhost')
   else
@@ -51,8 +51,8 @@ function Main:join()
 end
 
 function Main:edit()
-  app.core.context:remove(ctx)
-  app.core.context:add(app.editor.context, ctx.options.data)
+  app.util.context:remove(ctx)
+  app.util.context:add(app.context.editor, ctx.options.data)
 end
 
 return Main

+ 0 - 0
app/menu/options.lua → app/ui/menu/options.lua


+ 0 - 0
app/menu/ribbon.lua → app/ui/menu/ribbon.lua


+ 1 - 1
app/menu/serverList.lua → app/ui/menu/serverList.lua

@@ -61,7 +61,7 @@ function ServerList:mousepressed(x, y, button)
 end
 
 function ServerList:refresh()
-  self.servers = app.goregous:listServers()
+  self.servers = app.net.goregous:listServers()
 end
 
 return ServerList

+ 0 - 0
app/core/context.lua → app/util/context.lua


+ 0 - 0
app/core/event.lua → app/util/event.lua


+ 0 - 0
app/core/input.lua → app/util/input.lua


+ 1 - 1
data/buff/adrenaline.lua

@@ -29,7 +29,7 @@ function Adrenaline:update()
   self.hurtTimer = self.hurtTimer - 1
   if self.hurtTimer <= 0 then
     local amt = math.min(Adrenaline.drain * Adrenaline.rate, self.owner.health - 1)
-    ctx.net:emit(app.core.net.events.damage, {id = self.owner.id, amount = amt, from = self.owner.id, tick = tick})
+    ctx.net:emit(app.net.core.events.damage, {id = self.owner.id, amount = amt, from = self.owner.id, tick = tick})
     self.hurtTimer = math.round(Adrenaline.rate / tickRate)
     for _ = 1, 8 do
       ctx.event:emit('particle.create', {

+ 1 - 1
data/mods/deathmatch.lua

@@ -5,7 +5,7 @@ Deathmatch.pointsPerKill = 1
 Deathmatch.experiencePerKill = 0
 
 function Deathmatch:init()
-  ctx.event:on(app.core.net.events.dead, function(data)
+  ctx.event:on(app.net.core.events.dead, function(data)
     if data.id == data.kill then return end
 
     local killer = ctx.players:get(data.kill)

+ 4 - 4
data/mods/epidemic.lua

@@ -4,19 +4,19 @@ Epidemic.code = 'epidemic'
 function Epidemic:init(map)
   self.timer = 5 * 60
 
-  ctx.event:on(app.core.net.events.dead, function(_data)
+  ctx.event:on(app.net.core.events.dead, function(_data)
     if _data.id == _data.kill then return end
     local p = ctx.players:get(_data.id)
     if p.team == purple then
-      ctx.net:emit(app.core.net.events.class, {id = _data.id, class = p.class.id, team = orange})
+      ctx.net:emit(app.net.core.events.class, {id = _data.id, class = p.class.id, team = orange})
       ctx.players:each(function(p)
         if p.team == orange then ctx.buffs:add(p, 'zombieboost') end
       end)
     end
   end)
 
-  ctx.event:on(app.core.net.events.class, function(data) self:refresh() end)
-  ctx.event:on(app.core.net.messages.leave, function(data) self:refresh() end)
+  ctx.event:on(app.net.core.events.class, function(data) self:refresh() end)
+  ctx.event:on(app.net.core.messages.leave, function(data) self:refresh() end)
 
   for i = #map.props, 1, -1 do
     local p = map.props[i]

+ 1 - 1
data/prop/cartserver.lua

@@ -70,7 +70,7 @@ function CartServer:update()
       ctx.map:modExec('scoring', 'win', purple)
     end
 
-    ctx.net:emit(app.core.net.events.prop, {id = self.id, x = math.round(self.x * 10), y = math.round(self.y * 10)})
+    ctx.net:emit(app.net.core.events.prop, {id = self.id, x = math.round(self.x * 10), y = math.round(self.y * 10)})
   end
 end
 

+ 2 - 2
data/skill/bloodlust.lua

@@ -13,7 +13,7 @@ Bloodlust.type = 'passive'
 -- Behavior
 ----------------
 function Bloodlust:activate(owner)
-  ctx.event:on(app.core.net.events.dead, function(data)
+  ctx.event:on(app.net.core.events.dead, function(data)
     if data.kill == owner.id and data.id ~= owner.id then
       ctx.buffs:add(owner, 'bloodlust')
     end
@@ -21,7 +21,7 @@ function Bloodlust:activate(owner)
 end
 
 function Bloodlust:deactivate(owner)
-  ctx.event:remove(app.core.net.events.dead, self)
+  ctx.event:remove(app.net.core.events.dead, self)
 end
 
 function Bloodlust:value(owner)

+ 1 - 1
data/skill/cleave.lua

@@ -23,7 +23,7 @@ end
 
 function Cleave:fire(owner)
   ctx.spells:activate(owner.id, data.spell.cleave)
-  ctx.net:emit(app.core.net.events.damage, {id = owner.id, amount = self.cost, from = owner.id, tick = tick})
+  ctx.net:emit(app.net.core.events.damage, {id = owner.id, amount = self.cost, from = owner.id, tick = tick})
   self.timer = self.cooldown
 end
 

+ 1 - 1
data/skill/overexertion.lua

@@ -12,7 +12,7 @@ function Overexertion:canFire(owner)
 end
 
 function Overexertion:fire(owner)
-  ctx.net:emit(app.core.net.events.damage, {id = owner.id, amount = self.cost, from = owner.id, tick = tick})
+  ctx.net:emit(app.net.core.events.damage, {id = owner.id, amount = self.cost, from = owner.id, tick = tick})
   ctx.buffs:add(owner, 'overexertion')
 end
 

+ 2 - 2
data/skill/subterfuge.lua

@@ -6,7 +6,7 @@ Subterfuge.text = 'When you get a kill you cloak.'
 Subterfuge.type = 'passive'
 
 function Subterfuge:activate(owner)
-	ctx.event:on(app.core.net.events.dead, function(data)
+	ctx.event:on(app.net.core.events.dead, function(data)
 		if data.kill == owner.id then
 			ctx.buffs:add(owner, 'subterfuge')
 		end
@@ -14,7 +14,7 @@ function Subterfuge:activate(owner)
 end
 
 function Subterfuge:deactivate(owner)
-  ctx.event:remove(app.core.net.events.dead, self)
+  ctx.event:remove(app.net.core.events.dead, self)
 end
 
 function Subterfuge:value(owner)

+ 1 - 1
data/spell/battleaxe.lua

@@ -1,4 +1,4 @@
-local BattleAxe = extend(app.core.spell)
+local BattleAxe = extend(app.logic.spell)
 BattleAxe.code = 'battleaxe'
 BattleAxe.duration = .5
 BattleAxe.radius = 45

+ 1 - 1
data/spell/cleave.lua

@@ -1,4 +1,4 @@
-local Cleave = extend(app.core.spell)
+local Cleave = extend(app.logic.spell)
 
 Cleave.code = 'cleave'
 Cleave.radius = 175

+ 1 - 1
data/spell/dagger.lua

@@ -1,4 +1,4 @@
-local Dagger = extend(app.core.spell)
+local Dagger = extend(app.logic.spell)
 Dagger.code = 'dagger'
 Dagger.radius = 18
 Dagger.distance = 45

+ 1 - 1
data/spell/dusk.lua

@@ -1,4 +1,4 @@
-local Dusk = extend(app.core.spell)
+local Dusk = extend(app.logic.spell)
 
 Dusk.code = 'dusk'
 Dusk.maxDistance = 300

+ 1 - 1
data/spell/energyrifle.lua

@@ -1,4 +1,4 @@
-local EnergyRifle = extend(app.core.spell)
+local EnergyRifle = extend(app.logic.spell)
 EnergyRifle.code = 'energyrifle'
 
 EnergyRifle.image = data.media.graphics.effects.pulse

+ 2 - 2
data/spell/lazor.lua

@@ -1,4 +1,4 @@
-local Lazor = extend(app.core.spell)
+local Lazor = extend(app.logic.spell)
 Lazor.code = 'lazor'
 
 Lazor.maxCharge = 1.2
@@ -34,7 +34,7 @@ function Lazor:update()
         hit[p.id] = true
         local buff = ctx.buffs:get(p, 'plasmasickness')
         local damage = 70 + 50 * (buff and buff.stacks or 0)
-        ctx.net:emit(app.core.net.events.damage, {id = p.id, from = self.owner.id, amount = damage, tick = tick})
+        ctx.net:emit(app.net.core.events.damage, {id = p.id, from = self.owner.id, amount = damage, tick = tick})
         ctx.buffs:remove(p, 'plasmasickness')
       end)
     end

+ 2 - 2
data/spell/plasmacannon.lua

@@ -1,4 +1,4 @@
-local PlasmaCannon = extend(app.core.spell)
+local PlasmaCannon = extend(app.logic.spell)
 PlasmaCannon.code = 'plasmacannon'
 
 function PlasmaCannon:activate(charge)
@@ -57,7 +57,7 @@ function PlasmaCannon:update()
     self.x, self.y = self.x + math.dx(dis, self.angle), self.y + math.dy(dis, self.angle)
     local targets = ctx.collision:circleTest(self.x, self.y, self.radius, {tag = 'player', fn = function(p) return p.team ~= self.owner.team end, all = true})
     table.each(targets, function(p)
-      ctx.net:emit(app.core.net.events.damage, {id = p.id, amount = self.damage, from = self.owner.id, tick = tick})
+      ctx.net:emit(app.net.core.events.damage, {id = p.id, amount = self.damage, from = self.owner.id, tick = tick})
       ctx.buffs:add(p, 'plasmasickness')
     end)
     ctx.event:emit('particle.create', {

+ 1 - 1
data/spell/rocketboots.lua

@@ -1,4 +1,4 @@
-local RocketBoots = extend(app.core.spell)
+local RocketBoots = extend(app.logic.spell)
 
 RocketBoots.code = 'rocketboots'
 RocketBoots.maxDistance = 410

+ 2 - 2
data/spell/shotgun.lua

@@ -1,4 +1,4 @@
-local Shotgun = extend(app.core.spell)
+local Shotgun = extend(app.logic.spell)
 Shotgun.code = 'shotgun'
 
 Shotgun.duration = .1
@@ -45,7 +45,7 @@ Shotgun.activate = function(self)
         local n, f = self.len * .25, self.len * .75
         local l, h = data.weapon.shotgun.damage * .4, data.weapon.shotgun.damage * 1
         local damage = l + ((h - l) * ((f - math.clamp(len, n, f)) / f))
-        ctx.net:emit(app.core.net.events.damage, {id = p.id, amount = damage, from = self.owner.id, tick = tick})
+        ctx.net:emit(app.net.core.events.damage, {id = p.id, amount = damage, from = self.owner.id, tick = tick})
       end
 
       table.insert(self.bullets, {

+ 2 - 2
data/spell/smg.lua

@@ -1,4 +1,4 @@
-local SMG = extend(app.core.spell)
+local SMG = extend(app.logic.spell)
 SMG.code = 'smg'
 
 SMG.duration = .12
@@ -38,7 +38,7 @@ SMG.activate = function(self)
 
   if target then
     self.len = math.distance(self.x, self.y, target.x, target.y)
-    ctx.net:emit(app.core.net.events.damage, {id = target.id, amount = data.weapon.smg.damage, from = self.owner.id, tick = tick})
+    ctx.net:emit(app.net.core.events.damage, {id = target.id, amount = data.weapon.smg.damage, from = self.owner.id, tick = tick})
   end
 
   for _ = 1, 4 do

+ 1 - 1
data/weapon/energyrifle.lua

@@ -1,4 +1,4 @@
-local EnergyRifle = extend(app.core.weapon)
+local EnergyRifle = extend(app.logic.weapon)
 
 ----------------
 -- Meta

+ 2 - 2
data/weapon/plasmacannon.lua

@@ -62,11 +62,11 @@ function PlasmaCannon:update()
 end
 
 function PlasmaCannon:draw(owner)
-  app.core.weapon.draw(self, owner)
+  app.logic.weapon.draw(self, owner)
 end
 
 function PlasmaCannon:select(owner)
-  app.core.weapon.select(self, owner)
+  app.logic.weapon.select(self, owner)
   self.charge = 0
 end
 

+ 1 - 1
data/weapon/shotgun.lua

@@ -1,4 +1,4 @@
-local Shotgun = extend(app.core.weapon)
+local Shotgun = extend(app.logic.weapon)
 
 ----------------
 -- Meta

+ 1 - 1
data/weapon/smg.lua

@@ -1,4 +1,4 @@
-local SMG = extend(app.core.weapon)
+local SMG = extend(app.logic.weapon)
 
 ----------------
 -- Meta

+ 1 - 1
main.lua

@@ -7,4 +7,4 @@ setmetatable(_G, {
   __index = require('lib/cargo').init('/')
 })
 
-app.core.context:bind(app.patcher)
+app.util.context:bind(app.context.patcher)