Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module = {
- messages = {
- en = {
- chat_welcome = '<J>%s, welcome to #towerdefense<PT> v. beta_1<J>\nType <b>!help</b> or press <b>[H]</b> for more information!';
- chat_help = '<N>If you\'re a <CH>shaman <N>use <i>F2-F5</i> to choose a tower. Press <b>[Ctrl]</b> to open towers-list.\nIf you\'re a <V>mouse<N> try to get the cheese.\n\nGoog luck!';
- chat_shaman = '<N>You\'re the <CH>shaman<N>! You have 10 seconds to place a towers.\nUse <i>F2-F5</i> to choose a tower and <b>arrow</b> to put it on the map!';
- };
- ru = {
- chat_welcome = '<J>%s, добро пожаловать в #towerdefense<PT> v. beta_1<J>\nНапиши <b>!help</b> или нажми английскую <b>[H]</b>, чтобы узнать больше.';
- chat_help = '<N>Если Вы - <CH>шаман <N>используйте <i>F2-F5</i> чтобы выбрать башню. Нажмите <b>[Ctrl]</b>, чтобы открыть список башен.\nЕсли Вы - <V>мышь<N> попытайтесь взять сыр.\n\nУдачи!';
- chat_shaman = '<N>Вы - <CH>шаман<N>! У Вас есть 10 секунд, чтобы расположить башни!\nИспользуйте <i>F2-F5</i> чтобы выбрать башню и <b>стрелку</b>, чтобы расположить ее на карте!';
- };
- };
- towers = {
- [1] = {call = 'Cannon Tower'; price = 6; obj = 18};
- [2] = {call = 'Ball Tower'; price = 3; obj = 6};
- [3] = {call = 'Bomb Tower'; price = 4, obj = 23};
- [4] = {call = 'Spirit Tower'; price = 3, obj = 24}
- };
- maps = {
- 1387919
- };
- coords = {
- -- [''] = {x = ; y = }
- ['@1387919'] = {x = 25; y = 329}
- };
- }
- towerdefense = {
- INIT = function()
- tfm.exec.newGame(module.maps[math.random(#module.maps)])
- end;
- setTower = function(x, y, angle)
- if angle == 0 then
- system.newTimer(function() tfm.exec.addShamanObject (17, x, y, 180, 100, 150, false) end, 2000, true)
- else
- system.newTimer(function() tfm.exec.addShamanObject (17, x, y, -angle, 100, 150, false) end, 2000, true)
- end
- end;
- }
- user = {
- bindShaman = function()
- for name,player in pairs(tfm.get.room.playerList) do
- if player.isShaman then
- for i,keys in ipairs({17, 113}) do
- system.bindKeyboard(name, keys, true, true)
- end
- end
- if not player.isShaman then
- for i,keys in ipairs({17, 113}) do
- system.bindKeyboard(name, keys, true, false)
- end
- end
- end
- end;
- spawn = function()
- local i = tfm.get.room.currentMap
- for name, player in pairs(tfm.get.room.playerList) do
- if not player.isShaman then
- tfm.exec.movePlayer(name, module.coords[i].x, 200)
- end
- end
- end;
- }
- UI = {
- openShop = function(g)
- ui.addTextArea(0, "", g, 248, 104, 296, 203, 0x10151a, 0x10151a, 1, true)
- ui.addTextArea(3, "<v><b><p align='center'><font size='15'>Shop</font></p>", g, 256, 72, 87, 40, 0x32454f, 0x32454f, 1, true)
- ui.addTextArea(2, "", g, 243, 103, 165, 202, 0x648fa3, 0x648fa3, 1, true)
- ui.addTextArea(1, "", g, 245, 104, 296, 203, 0x32454f, 0x32454f, 1, true)
- ui.addTextArea(6, "", g, 249, 280, 283, 16, 0x648fa3, 0x648fa3, 1, true)
- ui.addTextArea(8, "", g, 253, 283, 283, 16, 0x10151a, 0x10151a, 1, true)
- ui.addTextArea(5, "<a href='event:close'><p align='center'>Close</p></a>", g, 251, 281, 283, 16, 0x32454f, 0x32454f, 1, true)
- end;
- }
- function eventNewGame()
- started = true
- user.bindShaman()
- end
- function eventSummoningEnd (name, id, x, y, angle, xSpeed, ySpeed, other)
- towerdefense.setTower(x, y, angle)
- end
- function eventKeyboard(name, key, d, x, y)
- if key == 17 then
- UI.openShop(name)
- end
- end
- function eventLoop(time, rem)
- if time >= 10000 and started == true then
- started = false
- user.spawn()
- end
- end
- towerdefense.INIT()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement