Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- filename: @QA2D.lua
- -- version: lua51
- -- line: [0, 0] id: 0
- parse("mp_wpndmg \"Chainsaw\" 0")
- parse("mp_wpndmg \"Grenade Launcher\" 100")
- parse("mp_wpndmg \"Rocket Launcher\" 0")
- parse("mp_wpndmg \"Laser\" 0")
- parse("mp_wpndmg \"Machete\" 50")
- parse("mp_wpndmg \"M3\" 0")
- parse("mp_wpndmg \"TMP\" 0")
- parse("mp_wpndmg \"Galil\" 0")
- parse("mp_wpndmg \"XM1014\" 0")
- parse("restart")
- Achievements = {
- [1] = {
- name = "Double kill",
- tip = "made double kill",
- needcount = 1,
- imgoff = "",
- imgon = "",
- },
- [2] = {
- name = "Flying killer",
- tip = "Kill a player in flight",
- needcount = 1,
- imgoff = "",
- imgon = "",
- },
- }
- qa_maiw = {
- 1,
- 200,
- 100,
- 100,
- 100,
- 200,
- 100,
- 200,
- 100
- }
- qa_agwp = {
- 1,
- 1,
- 10,
- 10,
- 10,
- 50,
- 10,
- 100,
- 20
- }
- qa_agap = {
- 1,
- 50,
- 10,
- 5,
- 5,
- 30,
- 10,
- 60,
- 15
- }
- qa_weaponsspeed = {
- 0,
- 5,
- 5,
- 6,
- 0,
- 7,
- 0,
- 5,
- 5
- }
- qa_mapitems = {}
- qa_itemsimg = {}
- qa_strike_delay = 40
- qa_player_radius = 14
- qa_time = 0
- rtime = 0
- qa_first_blood = false
- qa_players = {}
- planes = planes or {}
- jumps = jupms or {}
- blocks = blocks or {}
- deadlyframe = deadlyframe or {}
- trains = trains or {}
- paths = paths or {}
- qa_npcsdrops = 0
- qa_copyright = "\xa9"
- qa_leader = 0
- qa_lasercolors = {
- [0] = {
- 255,
- 255,
- 100
- },
- [1] = {
- 50,
- 50,
- 255
- },
- [2] = {
- 150,
- 150,
- 255
- },
- [3] = {
- 50,
- 255,
- 50
- },
- [4] = {
- 255,
- 255,
- 0
- },
- [5] = {
- 100,
- 100,
- 0
- },
- [6] = {
- 100,
- 100,
- 100
- },
- [7] = {
- 10,
- 10,
- 10
- },
- }
- qa_item_types = {
- [1] = {
- imgpath = "gfx/qa2d/items/Machine Gun ammo.png",
- },
- [2] = {
- imgpath = "gfx/qa2d/items/Shotgun ammo.png",
- },
- [3] = {
- imgpath = "gfx/qa2d/items/Grenade Launcher ammo.png",
- },
- [4] = {
- imgpath = "gfx/qa2d/items/Rocket Launcher ammo.png",
- },
- [5] = {
- imgpath = "gfx/qa2d/items/Plasma gun ammo.png",
- },
- [6] = {
- imgpath = "gfx/qa2d/items/Railgun ammo.png",
- },
- [10] = {
- imgpath = "gfx/qa2d/items/shotgun.png",
- },
- [11] = {
- imgpath = "gfx/qa2d/items/bfg.png",
- },
- [21] = {
- imgpath = "gfx/qa2d/items/Lightning gun ammo .png",
- },
- [22] = {
- imgpath = "gfx/qa2d/items/BFG-10K ammo.png",
- },
- [38] = {
- imgpath = "gfx/qa2d/items/lightinggun.png",
- },
- [45] = {
- imgpath = "gfx/qa2d/items/railgun.png",
- },
- [48] = {
- imgpath = "gfx/qa2d/items/rocketlauncher.png",
- },
- [49] = {
- imgpath = "gfx/qa2d/items/grenadelauncher.png",
- },
- [51] = {
- imgpath = "gfx/qa2d/items/invisibility.png",
- },
- [52] = {
- imgpath = "gfx/qa2d/items/medkit+100.png",
- },
- [53] = {
- imgpath = "gfx/qa2d/items/teleport.png",
- },
- [57] = {
- imgpath = "gfx/qa2d/items/yarmor.png",
- },
- [58] = {
- imgpath = "gfx/qa2d/items/rarmor.png",
- },
- [60] = {
- imgpath = "gfx/qa2d/items/regeneration.png",
- },
- [61] = {
- imgpath = "gfx/qa2d/items/haste.png",
- },
- [62] = {
- imgpath = "gfx/qa2d/items/quad.png",
- },
- [64] = {
- imgpath = "gfx/qa2d/items/medkit+50.png",
- },
- [65] = {
- imgpath = "gfx/qa2d/items/medkit+25.png",
- },
- [66] = {
- imgpath = "gfx/qa2d/items/medkit+5.png",
- },
- [67] = {
- imgpath = "gfx/qa2d/items/shard.png",
- },
- [68] = {
- imgpath = "gfx/qa2d/items/megahealth.png",
- },
- [70] = {
- imgpath = "gfx/qa2d/items/redflag.png",
- },
- [71] = {
- imgpath = "gfx/qa2d/items/blueflag.png",
- },
- [82] = {
- imgpath = "gfx/qa2d/items/regen.png",
- },
- [84] = {
- imgpath = "gfx/qa2d/items/invis.png",
- },
- [85] = {
- imgpath = "gfx/qa2d/items/plazmagun.png",
- },
- }
- qa_weapon_types = {
- [21] = {
- name = "Mashinegun",
- attack = "lighte",
- distance = 1024,
- damage = 5,
- count = 1,
- range = 4,
- speed = 2000,
- time = 8,
- updates = 800,
- alpha = 100,
- imglength = 6,
- imgflipping = true,
- exp_size = 1,
- offset = 30,
- speedrot = 0,
- hitflash = false,
- hitsound = "weapons/bullethit.wav",
- imgpath = "gfx/weapons/bullet.png",
- txthit = "was machinegunned by %s",
- },
- [85] = {
- name = "Plasmagun",
- attack = "bullet",
- damage = 20,
- count = 1,
- range = 4,
- imglength = 32,
- speed = 640,
- time = 8,
- updates = 100,
- exp_size = 34,
- offset = 20,
- speedrot = 64,
- hitflash = true,
- hitsound = "weapons/plasma_exp.wav",
- imgpath = "gfx/weapons/plasma.bmp",
- txtSuicide = "melted itself",
- txthit = "was melted by %s\'s plasmagun",
- txtradiushit = "was melted by %s\'s plasmagun",
- },
- [11] = {
- name = "BFG10K",
- attack = "bullet",
- imglength = 72,
- damage = 100,
- count = 1,
- range = 2,
- exp_size = 40,
- speed = 400,
- time = 8,
- updates = 40,
- offset = 15,
- speedrot = 0,
- hitflash = true,
- hitsound = "weapons/explode6.wav",
- imgpath = "gfx/weapons/bfg.png",
- txtSuicide = "should have used a smaller gun",
- txthit = "was blasted by %s\'s BFG",
- txtradiushit = "was blasted by %s\'s BFG",
- },
- [38] = {
- name = "Lighting",
- attack = "lighte",
- distance = 320,
- count = 1,
- damage = 8,
- offset = 23,
- range = 0,
- imgflipping = true,
- imglength = 300,
- alpha = 75,
- hitflash = true,
- imgpath = "gfx/weapons/lighting.png",
- sound = "weapons/lightninggun.wav",
- txthit = "was burned by %s",
- },
- [87] = {
- name = "Railgun",
- attack = "lighte",
- distance = 1024,
- count = 1,
- damage = 100,
- offset = 23,
- range = 1,
- imgflipping = true,
- imglength = 24,
- alpha = 150,
- hitflash = true,
- imgpath = "gfx/weapons/rail1.png",
- imgpath2 = "gfx/weapons/rail2.png",
- hitsound = "weapons/plasma_exp.wav",
- txthit = "was railed by %s",
- },
- [10] = {
- name = "Shotgun",
- attack = "lighte",
- distance = 1024,
- damage = 10,
- count = 11,
- range = 24,
- speed = 2000,
- time = 8,
- updates = 600,
- alpha = 100,
- imglength = 6,
- imgflipping = true,
- exp_size = 1,
- offset = 30,
- speedrot = 0,
- hitflash = true,
- hitsound = "weapons/bullethit.wav",
- imgpath = "gfx/weapons/bullet.png",
- txthit = "was gunned down by %s",
- },
- [77] = {
- name = "RocketLauncher",
- attack = "bullet",
- damage = 100,
- count = 1,
- range = 1,
- speed = 512,
- time = 8,
- updates = 100,
- alpha = 255,
- imglength = 32,
- imgflipping = false,
- exp_size = 40,
- offset = 18,
- speedrot = 0,
- hitflash = true,
- hitsound = "weapons/explode6.wav",
- imgpath = "gfx/weapons/rocket.png",
- txtSuicide = "blew itself up",
- txthit = "ate %s\'s rocket",
- txtradiushit = "almost dodged %s\'s rocket",
- },
- [69] = {
- name = "Gauntlet",
- attack = "none",
- damage = 50,
- txthit = "was pummeled by %s\'s gauntlet",
- },
- [49] = {
- name = "GranadeLauncher",
- attack = "none",
- damage = 50,
- txtSuicide = "tripped on its own grenade",
- txthit = "was pummeled by %s",
- },
- }
- qa_bullets = {}
- addhook("buildattempt", "qa_buildattempt")
- function qa_buildattempt(r0_1, r1_1, r2_1, r3_1)
- -- line: [281, 299] id: 1
- if r1_1 == 20 then
- if qa_players[r0_1].rocketreloaded == 1 then
- parse("sv_sound \"weapons/rocketlauncher.wav\"")
- qa_players[r0_1].rocketreloaded = 0
- timer(800, "qa_rocketreload", r0_1)
- qa_attack(r0_1)
- end
- return 1
- elseif r1_1 == 21 then
- if qa_players[r0_1].laserreloaded == 1 then
- qa_players[r0_1].laserreloaded = 0
- parse("sv_sound \"weapons/laser.wav\"")
- timer(1500, "qa_laserreload", r0_1)
- qa_attack(r0_1)
- end
- return 1
- end
- end
- function qa_rocketreload(r0_2)
- -- line: [301, 303] id: 2
- qa_players[tonumber(r0_2)].rocketreloaded = 1
- end
- function qa_laserreload(r0_3)
- -- line: [305, 307] id: 3
- qa_players[tonumber(r0_3)].laserreloaded = 1
- end
- addhook("attack", "qa_attack")
- function qa_attack(r0_4)
- -- line: [311, 393] id: 4
- local r1_4 = qa_weapon_types[player(r0_4, "weapontype")]
- if r1_4 then
- local r2_4 = player(r0_4, "x")
- local r3_4 = player(r0_4, "y")
- local r4_4 = (player(r0_4, "rot") - 90 + math.random() - 0.5) * 3.14 / 180
- local r5_4 = math.cos(r4_4)
- local r6_4 = math.sin(r4_4)
- if r1_4.attack == "bullet" then
- for r10_4 = 1, r1_4.count, 1 do
- qa_bullet_create(r2_4, r3_4, r4_4 + (math.random() - 0.5) * r1_4.range * 3.14 / 180, r1_4, r0_4)
- end
- elseif r1_4.attack ~= "shell" and r1_4.attack == "lighte" then
- for r10_4 = 1, r1_4.count, 1 do
- local r11_4 = r4_4 + (math.random() - 0.5) * r1_4.range * 3.14 / 180
- local r12_4 = math.cos(r11_4)
- local r13_4 = math.sin(r11_4)
- local r14_4 = r2_4 + r5_4 * r1_4.offset
- local r15_4 = r3_4 + r6_4 * r1_4.offset
- local r16_4 = r14_4
- local r17_4 = r15_4
- local r18_4 = false
- for r22_4 = 1, r1_4.distance, 1 do
- r17_4 = r17_4 + r13_4
- r16_4 = r16_4 + r12_4
- local r23_4 = math.floor(r16_4 / 32)
- local r24_4 = math.floor(r17_4 / 32)
- local r25_4 = false
- if tile(r23_4, r24_4, "wall") and not tile(r23_4, r24_4, "obstacle") then
- qa_weapon_lighting_hit(r14_4, r15_4, r16_4, r17_4, r11_4, r1_4, r0_4)
- if entity(r23_4, r24_4, "exists") and entity(r23_4, r24_4, "typename") == "Env_Breakable" then
- parse("explosion " .. r23_4 * 32 + 16 .. " " .. r24_4 * 32 + 16 .. " 1 " .. r1_4.damage .. " " .. r0_4)
- elseif r1_4.name == "Railgun" and entity(r23_4, r24_4, "exists") and entity(r23_4, r24_4, "typename") == "Trigger_Hit" then
- parse("trigger " .. entity(r23_4, r24_4, "trigger"))
- end
- r25_4 = true
- else
- for r29_4, r30_4 in pairs(player(0, "tableliving")) do
- local r31_4 = player(r30_4, "x") - r16_4
- local r32_4 = player(r30_4, "y") - r17_4
- if r31_4 * r31_4 + r32_4 * r32_4 < qa_player_radius * qa_player_radius and r25_4 == false then
- qa_weapon_lighting_hit(r14_4, r15_4, r16_4, r17_4, r11_4, r1_4, r0_4)
- qa_player_damage(r0_4, r1_4, r30_4, nil, r30_4)
- r25_4 = true
- break
- end
- end
- end
- if r25_4 then
- break
- end
- end
- if r18_4 == false then
- qa_weapon_lighting_hit(r14_4, r15_4, r16_4, r17_4, r11_4, r1_4, r0_4)
- end
- end
- end
- end
- local r2_4 = {
- 69,
- 21,
- 10,
- 49,
- 77,
- 85,
- 87,
- 38,
- 11
- }
- wtype = 0
- for r6_4 = 2, 9, 1 do
- if player(r0_4, "weapontype") == r2_4[r6_4] then
- wtype = r6_4
- break
- end
- end
- if wtype > 0 then
- qa_players[r0_4].ammo[wtype] = math.max(qa_players[r0_4].ammo[wtype] - 1, 0)
- if qa_players[r0_4].ammo[wtype] < 1 then
- if wtype == 7 then
- qa_players[r0_4].lasercolor = 0
- end
- local r3_4 = player(r0_4, "weapontype")
- for r7_4 = -9, -1, 1 do
- if qa_players[r0_4].weapons[-r7_4] == 1 and 0 < qa_players[r0_4].ammo[-r7_4] then
- parse("setweapon " .. r0_4 .. " " .. r2_4[-r7_4])
- break
- end
- end
- parse("strip " .. r0_4 .. " " .. r3_4)
- qa_HUD(r0_4 .. " 1 1")
- else
- parse("equip " .. r0_4 .. " " .. player(r0_4, "weapontype"))
- qa_HUD(r0_4 .. " 1")
- end
- end
- end
- function qa_totable(r0_5, r1_5)
- -- line: [395, 402] id: 5
- local r2_5 = {}
- if not r1_5 then
- r1_5 = "[^%s]+"
- end
- for r6_5 in string.gmatch(r0_5, r1_5) do
- table.insert(r2_5, r6_5)
- end
- return r2_5
- end
- qa_ammo = {
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 21,
- 22
- }
- function qa_HUD(r0_6)
- -- line: [406, 521] id: 6
- local r1_6 = qa_totable(r0_6)
- local r2_6 = tonumber(r1_6[1])
- local r3_6 = tonumber(r1_6[2])
- local r4_6 = tonumber(r1_6[3])
- local r5_6 = tonumber(r1_6[4])
- local r6_6 = tonumber(r1_6[5])
- local r7_6 = tonumber(r1_6[6])
- local r8_6 = tonumber(r1_6[7])
- local r9_6 = tonumber(r1_6[8])
- local r10_6 = tonumber(r1_6[9])
- if player(r2_6, "exists") and not player(r2_6, "bot") then
- if qa_players[r2_6].ha == nil then
- qa_players[r2_6].ha = {}
- end
- local r11_6 = {
- 69,
- 21,
- 10,
- 49,
- 77,
- 85,
- 87,
- 38,
- 11
- }
- wtype = 0
- for r15_6 = 1, 9, 1 do
- if player(r2_6, "weapontype") == r11_6[r15_6] then
- wtype = r15_6
- break
- end
- end
- if wtype == 0 and 0 < player(r2_6, "health") then
- parse("equip " .. r2_6 .. " 69")
- parse("setweapon " .. r2_6 .. " 69")
- qa_HUD(r2_6 .. " 1 1")
- r3_6 = 0
- r4_6 = 0
- end
- qa_players[r2_6].oldWeapon = player(r2_6, "weapontype")
- if r3_6 or r4_6 then
- if qa_players[r2_6].ha[0] ~= nil then
- freeimage(qa_players[r2_6].ha[0])
- qa_players[r2_6].ha[0] = nil
- end
- if qa_players[r2_6].ha[1] ~= nil then
- freeimage(qa_players[r2_6].ha[1])
- qa_players[r2_6].ha[1] = nil
- end
- if qa_players[r2_6].ha[2] ~= nil then
- freeimage(qa_players[r2_6].ha[2])
- qa_players[r2_6].ha[2] = nil
- end
- end
- if qa_players[r2_6].ha[3] ~= nil and r4_6 then
- freeimage(qa_players[r2_6].ha[3])
- qa_players[r2_6].ha[3] = nil
- end
- if qa_players[r2_6].ha[4] ~= nil and r4_6 then
- freeimage(qa_players[r2_6].ha[4])
- qa_players[r2_6].ha[4] = nil
- end
- if qa_players[r2_6].ha[5] ~= nil and r7_6 then
- freeimage(qa_players[r2_6].ha[5])
- qa_players[r2_6].ha[5] = nil
- end
- if r8_6 then
- if qa_players[r2_6].ha[6] ~= nil and (qa_players[r2_6].armor < 1 or 0 < player(r2_6, "health")) then
- freeimage(qa_players[r2_6].ha[6])
- qa_players[r2_6].ha[6] = nil
- end
- if qa_players[r2_6].ha[7] ~= nil then
- freeimage(qa_players[r2_6].ha[7])
- qa_players[r2_6].ha[7] = nil
- end
- if qa_players[r2_6].ha[8] ~= nil then
- freeimage(qa_players[r2_6].ha[8])
- qa_players[r2_6].ha[8] = nil
- end
- if qa_players[r2_6].ha[9] ~= nil then
- freeimage(qa_players[r2_6].ha[9])
- qa_players[r2_6].ha[9] = nil
- end
- end
- if r9_6 then
- if qa_players[r2_6].ha[10] ~= nil and (qa_players[r2_6].invisibility == 0 or player(r2_6, "health") < 1) then
- freeimage(qa_players[r2_6].ha[10])
- qa_players[r2_6].ha[10] = nil
- parse("hudtxt2 " .. r2_6 .. " 36")
- end
- if qa_players[r2_6].ha[11] ~= nil and (qa_players[r2_6].speedtime == 0 or player(r2_6, "health") < 1) then
- freeimage(qa_players[r2_6].ha[11])
- qa_players[r2_6].ha[11] = nil
- parse("hudtxt2 " .. r2_6 .. " 38")
- end
- if qa_players[r2_6].ha[12] ~= nil and (qa_players[r2_6].quadtime == 0 or player(r2_6, "health") < 1) then
- freeimage(qa_players[r2_6].ha[12])
- qa_players[r2_6].ha[12] = nil
- parse("hudtxt2 " .. r2_6 .. " 39")
- end
- if qa_players[r2_6].ha[13] ~= nil and (qa_players[r2_6].regentime == 0 or player(r2_6, "health") < 1) then
- freeimage(qa_players[r2_6].ha[13])
- qa_players[r2_6].ha[13] = nil
- parse("hudtxt2 " .. r2_6 .. " 37")
- end
- end
- if r10_6 and qa_players[r2_6].ha[14] ~= nil and qa_players[r2_6].bonus == 0 then
- freeimage(qa_players[r2_6].ha[14])
- qa_players[r2_6].ha[14] = nil
- end
- if player(r2_6, "health") > 0 then
- if 1 < wtype and wtype < 10 then
- if r3_6 then
- if string.len(tostring(qa_players[r2_6].ammo[wtype])) >= 3 then
- qa_players[r2_6].ha[0] = image("gfx/qa2d/hud/" .. string.sub(tostring(qa_players[r2_6].ammo[wtype]), string.len(tostring(qa_players[r2_6].ammo[wtype])) - 2, string.len(tostring(qa_players[r2_6].ammo[wtype])) - 2) .. ".png", 540, 460, 2, r2_6)
- imageblend(qa_players[r2_6].ha[0], 1)
- imagecolor(qa_players[r2_6].ha[0], 255, 255, 0)
- end
- if string.len(tostring(qa_players[r2_6].ammo[wtype])) >= 2 then
- qa_players[r2_6].ha[1] = image("gfx/qa2d/hud/" .. string.sub(tostring(qa_players[r2_6].ammo[wtype]), string.len(tostring(qa_players[r2_6].ammo[wtype])) - 1, string.len(tostring(qa_players[r2_6].ammo[wtype])) - 1) .. ".png", 565, 460, 2, r2_6)
- imageblend(qa_players[r2_6].ha[1], 1)
- imagecolor(qa_players[r2_6].ha[1], 255, 255, 0)
- end
- qa_players[r2_6].ha[2] = image("gfx/qa2d/hud/" .. string.sub(tostring(qa_players[r2_6].ammo[wtype]), string.len(tostring(qa_players[r2_6].ammo[wtype])), string.len(tostring(qa_players[r2_6].ammo[wtype]))) .. ".png", 590, 460, 2, r2_6)
- imageblend(qa_players[r2_6].ha[2], 1)
- imagecolor(qa_players[r2_6].ha[2], 255, 255, 0)
- end
- if r4_6 then
- qa_players[r2_6].ha[3] = image(qa_item_types[qa_ammo[wtype]].imgpath, 620, 460, 2, r2_6)
- imagescale(qa_players[r2_6].ha[3], 1.5, 1.5)
- if wtype == 7 and qa_players[r2_6].ha[4] == nil then
- qa_players[r2_6].ha[4] = image("gfx/qa2d/items/railgun_light.png", 1, 0, 200 + r2_6, 0)
- imagealpha(qa_players[r2_6].ha[4], 0.5)
- if qa_players[r2_6].invisibility > 0 then
- imagealpha(qa_players[r2_6].ha[4], 0.25)
- end
- end
- end
- if (r4_6 or r6_6) and wtype == 7 then
- qa_players[r2_6].lasercolor = player(r2_6, "spraycolor")
- imagecolor(qa_players[r2_6].ha[4], qa_lasercolors[qa_players[r2_6].lasercolor][1], qa_lasercolors[qa_players[r2_6].lasercolor][2], qa_lasercolors[qa_players[r2_6].lasercolor][3])
- end
- end
- if (r4_6 or r5_6) and 0 < wtype and wtype < 10 then
- parse("speedmod " .. r2_6 .. " " .. qa_weaponsspeed[wtype] + 7 + math.min(qa_players[r2_6].speedtime, 1) * 9)
- end
- if r7_6 then
- qa_players[r2_6].ha[5] = image("gfx/player/head/" .. player(r2_6, "team") .. "-" .. player(r2_6, "look") .. ".png", 110, 460, 2, r2_6)
- end
- if r8_6 and 1 <= qa_players[r2_6].armor then
- if qa_players[r2_6].ha[6] == nil then
- qa_players[r2_6].ha[6] = image("gfx/player/head/armor.png", 220, 460, 2, r2_6)
- end
- qa_players[r2_6].ha[7] = image("gfx/qa2d/hud/" .. string.sub(math.floor(qa_players[r2_6].armor), string.len(math.floor(qa_players[r2_6].armor)), string.len(math.floor(qa_players[r2_6].armor))) .. ".png", 190, 460, 2, r2_6)
- imageblend(qa_players[r2_6].ha[7], 1)
- imagecolor(qa_players[r2_6].ha[7], 255, 255, 0)
- if qa_players[r2_6].armor >= 10 then
- qa_players[r2_6].ha[8] = image("gfx/qa2d/hud/" .. string.sub(math.floor(qa_players[r2_6].armor), string.len(math.floor(qa_players[r2_6].armor)) - 1, string.len(math.floor(qa_players[r2_6].armor)) - 1) .. ".png", 165, 460, 2, r2_6)
- imageblend(qa_players[r2_6].ha[8], 1)
- imagecolor(qa_players[r2_6].ha[8], 255, 255, 0)
- end
- if qa_players[r2_6].armor >= 100 then
- qa_players[r2_6].ha[9] = image("gfx/qa2d/hud/" .. string.sub(math.floor(qa_players[r2_6].armor), 1, 1) .. ".png", 140, 460, 2, r2_6)
- imageblend(qa_players[r2_6].ha[9], 1)
- imagecolor(qa_players[r2_6].ha[9], 255, 255, 0)
- end
- end
- if r9_6 then
- if 0 < qa_players[r2_6].invisibility and qa_players[r2_6].ha[10] == nil then
- qa_players[r2_6].ha[10] = image("gfx/qa2d/hud/iconpowerup_invis.png", 20, 300, 2, r2_6)
- imagescale(qa_players[r2_6].ha[10], 0.5, 0.5)
- end
- if 0 < qa_players[r2_6].speedtime and qa_players[r2_6].ha[11] == nil then
- qa_players[r2_6].ha[11] = image("gfx/qa2d/hud/iconpowerup_haste.png", 20, 340, 2, r2_6)
- imagescale(qa_players[r2_6].ha[11], 0.5, 0.5)
- end
- if 0 < qa_players[r2_6].quadtime and qa_players[r2_6].ha[12] == nil then
- qa_players[r2_6].ha[12] = image("gfx/qa2d/hud/iconpowerup_quad.png", 20, 380, 2, r2_6)
- imagescale(qa_players[r2_6].ha[12], 0.5, 0.5)
- end
- if 0 < qa_players[r2_6].regentime and qa_players[r2_6].ha[13] == nil then
- qa_players[r2_6].ha[13] = image("gfx/qa2d/hud/iconpowerup_regen.png", 20, 420, 2, r2_6)
- imagescale(qa_players[r2_6].ha[13], 0.5, 0.5)
- end
- end
- if r10_6 and 0 < qa_players[r2_6].bonus and qa_players[r2_6].ha[14] == nil then
- qa_players[r2_6].ha[14] = image("gfx/qa2d/hud/" .. ({
- "iconholdable_medkit.png",
- "iconpowerup_teleporter.png",
- "iconholdable_kamikaze.png"
- })[qa_players[r2_6].bonus], 20, 260, 2, r2_6)
- imagescale(qa_players[r2_6].ha[14], 0.5, 0.5)
- end
- end
- end
- end
- function qa_ScoreTable(r0_7)
- -- line: [523, 711] id: 7
- r0_7 = qa_totable(r0_7)
- id = tonumber(r0_7[1]) or 0
- mode = tonumber(r0_7[2])
- if 0 < id and not player(id, "bot") then
- if game("sv_gamemode") == "1" then
- if qa_players[id].scoretableimg == nil and mode == nil then
- qa_players[id].scoretableimg = image("gfx/qa2d/scoretable1.png", 320, 240, 2, id)
- for r4_7 = 1, 16, 1 do
- if qa_tableofplayers[r4_7] ~= nil then
- parse("hudtxt2 " .. id .. " " .. r4_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers[r4_7][1], "name") .. "; " .. 35 + 310 * math.floor(r4_7 / 9) .. " " .. 65 + 35 * r4_7 - 280 * math.floor(r4_7 / 9))
- parse("hudtxt2 " .. id .. " " .. r4_7 + 15 .. " \xa9255255255" .. qa_tableofplayers[r4_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers[r4_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers[r4_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers[r4_7][1], "deaths"))) .. "; " .. 250 + 310 * math.floor(r4_7 / 9) .. " " .. 65 + 35 * r4_7 - 280 * math.floor(r4_7 / 9) .. "; -1")
- else
- parse("hudtxt2 " .. id .. " " .. r4_7 - 1)
- parse("hudtxt2 " .. id .. " " .. r4_7 + 15)
- end
- end
- elseif qa_players[id].scoretableimg ~= nil then
- freeimage(qa_players[id].scoretableimg)
- for r4_7 = 0, 32, 1 do
- parse("hudtxt2 " .. id .. " " .. r4_7)
- end
- qa_players[id].scoretableimg = nil
- end
- elseif qa_players[id].scoretableimg == nil and mode == nil then
- qa_players[id].scoretableimg = image("gfx/qa2d/scoretable2.png", 320, 240, 2, id)
- for r4_7, r5_7 in pairs(player(0, "table")) do
- if not player(r5_7, "bot") and qa_players[r5_7].scoretableimg ~= nil then
- for r9_7 = 1, 8, 1 do
- if qa_tableofplayers_t[r9_7] ~= nil then
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 7 .. " \xa9255255255" .. player(qa_tableofplayers_t[r9_7][1], "name") .. "; 35 " .. 65 + 35 * r9_7)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 24 .. " \xa9255255255" .. qa_tableofplayers_t[r9_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers_t[r9_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers_t[r9_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers_t[r9_7][1], "deaths"))) .. "; 250 " .. 65 + 35 * r9_7 .. " 1")
- else
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 7)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 24)
- end
- if qa_tableofplayers_ct[r9_7] ~= nil then
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers_ct[r9_7][1], "name") .. "; 345 " .. 65 + 35 * r9_7)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15 .. " \xa9255255255" .. qa_tableofplayers_ct[r9_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"))) .. "; 560 " .. 65 + 35 * r9_7 .. " 1")
- else
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15)
- end
- parse("hudtxt2 " .. r5_7 .. " 33 " .. qa_copyright .. "255255255" .. game("mp_winlimit") .. "/" .. qa_tableofplayers_t_score .. "/" .. qa_tableofplayers_ct_score .. "/" .. qa_players[r5_7].kills .. ";600 430; 1")
- end
- end
- end
- elseif qa_players[id].scoretableimg ~= nil then
- freeimage(qa_players[id].scoretableimg)
- for r4_7 = 0, 32, 1 do
- parse("hudtxt2 " .. id .. " " .. r4_7)
- end
- qa_players[id].scoretableimg = nil
- end
- elseif id == 0 and mode == nil then
- for r4_7, r5_7 in pairs(player(0, "table")) do
- if not player(r5_7, "bot") then
- if qa_players[r5_7].scoretableimg then
- freeimage(qa_players[r5_7].scoretableimg)
- end
- for r9_7 = 0, 32, 1 do
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7)
- end
- qa_players[r5_7].scoretableimg = nil
- end
- end
- if game("sv_gamemode") == "1" then
- image("gfx/qa2d/scoretable1.png", 320, 240, 2, 0)
- for r4_7 = 1, 16, 1 do
- if qa_tableofplayers[r4_7] ~= nil then
- parse("hudtxt " .. r4_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers[r4_7][1], "name") .. "; " .. 35 + 310 * math.floor(r4_7 / 9) .. " " .. 65 + 35 * r4_7 - 280 * math.floor(r4_7 / 9))
- parse("hudtxt " .. r4_7 + 15 .. " \xa9255255255" .. qa_tableofplayers[r4_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers[r4_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers[r4_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers[r4_7][1], "deaths"))) .. "; " .. 250 + 310 * math.floor(r4_7 / 9) .. " " .. 65 + 35 * r4_7 - 280 * math.floor(r4_7 / 9) .. "; -1")
- else
- parse("hudtxt " .. r4_7 - 1)
- parse("hudtxt " .. r4_7 + 15)
- end
- end
- else
- image("gfx/qa2d/scoretable2.png", 320, 240, 2, 0)
- for r4_7 = 1, 8, 1 do
- if qa_tableofplayers_t[r4_7] ~= nil then
- parse("hudtxt " .. r4_7 + 7 .. " \xa9255255255" .. player(qa_tableofplayers_t[r4_7][1], "name") .. "; 35 " .. 65 + 35 * r4_7)
- parse("hudtxt " .. r4_7 + 24 .. " \xa9255255255" .. qa_tableofplayers_t[r4_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers_t[r4_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers_t[r4_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers_t[r4_7][1], "deaths"))) .. "; 250 " .. 65 + 35 * r4_7 .. " 1")
- else
- parse("hudtxt " .. r4_7 + 7)
- parse("hudtxt " .. r4_7 + 24)
- end
- if qa_tableofplayers_ct[r4_7] ~= nil then
- parse("hudtxt " .. r4_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers_ct[r4_7][1], "name") .. "; 345 " .. 65 + 35 * r4_7)
- parse("hudtxt " .. r4_7 + 15 .. " \xa9255255255" .. qa_tableofplayers_ct[r4_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers_ct[r4_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers_ct[r4_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers_ct[r4_7][1], "deaths"))) .. "; 560 " .. 65 + 35 * r4_7 .. " 1")
- else
- parse("hudtxt " .. r4_7 - 1)
- parse("hudtxt " .. r4_7 + 15)
- end
- end
- end
- elseif id == 0 and mode == 1 then
- if game("sv_gamemode") == "1" then
- qa_tableofplayers = {}
- for r4_7, r5_7 in pairs(player(0, "table")) do
- qa_tableofplayers[r4_7] = {
- r5_7,
- qa_players[r5_7].kills
- }
- end
- for r4_7 = 1, #qa_tableofplayers - 1, 1 do
- for r8_7 = 1, #qa_tableofplayers, 1 do
- if r4_7 < r8_7 and qa_tableofplayers[r4_7][2] < qa_tableofplayers[r8_7][2] or r8_7 < r4_7 and qa_tableofplayers[r8_7][2] < qa_tableofplayers[r4_7][2] then
- qa_tableofplayers[r4_7] = qa_tableofplayers[r8_7]
- qa_tableofplayers[r8_7] = qa_tableofplayers[r4_7]
- end
- end
- end
- for r4_7, r5_7 in pairs(player(0, "table")) do
- if not player(r5_7, "bot") then
- if qa_players[r5_7].scoretableimg ~= nil then
- for r9_7 = 1, 16, 1 do
- if qa_tableofplayers[r9_7] ~= nil then
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers[r9_7][1], "name") .. "; " .. 35 + 310 * math.floor(r9_7 / 9) .. " " .. 65 + 35 * r9_7 - 280 * math.floor(r9_7 / 9))
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15 .. " \xa9255255255" .. qa_tableofplayers[r9_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers[r9_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers[r9_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers[r9_7][1], "deaths"))) .. "; " .. 250 + 310 * math.floor(r9_7 / 9) .. " " .. 65 + 35 * r9_7 - 280 * math.floor(r9_7 / 9) .. "; -1")
- else
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15)
- end
- end
- end
- parse("hudtxt2 " .. r5_7 .. " 33 " .. qa_copyright .. "255255255" .. game("mp_winlimit") .. "/" .. qa_players[math.max(qa_leader, 1)].kills .. "/" .. qa_players[r5_7].kills .. ";600 430; 1")
- end
- end
- else
- qa_tableofplayers_t = {}
- qa_tableofplayers_ct = {}
- qa_tableofplayers_t_score = 0
- qa_tableofplayers_ct_score = 0
- for r4_7, r5_7 in pairs(player(0, "team1")) do
- qa_tableofplayers_t_score = qa_tableofplayers_t_score + qa_players[r5_7].kills
- qa_tableofplayers_t[r4_7] = {
- r5_7,
- qa_players[r5_7].kills
- }
- end
- for r4_7, r5_7 in pairs(player(0, "team2")) do
- qa_tableofplayers_ct_score = qa_tableofplayers_ct_score + qa_players[r5_7].kills
- qa_tableofplayers_ct[r4_7] = {
- r5_7,
- qa_players[r5_7].kills
- }
- end
- for r4_7 = 1, #qa_tableofplayers_t - 1, 1 do
- for r8_7 = 1, #qa_tableofplayers_t, 1 do
- if r4_7 < r8_7 and qa_tableofplayers_t[r4_7][2] < qa_tableofplayers_t[r8_7][2] or r8_7 < r4_7 and qa_tableofplayers_t[r8_7][2] < qa_tableofplayers_t[r4_7][2] then
- qa_tableofplayers_t[r4_7] = qa_tableofplayers_t[r8_7]
- qa_tableofplayers_t[r8_7] = qa_tableofplayers_t[r4_7]
- end
- end
- end
- for r4_7 = 1, #qa_tableofplayers_ct - 1, 1 do
- for r8_7 = 1, #qa_tableofplayers_ct, 1 do
- if r4_7 < r8_7 and qa_tableofplayers_ct[r4_7][2] < qa_tableofplayers_ct[r8_7][2] or r8_7 < r4_7 and qa_tableofplayers_ct[r8_7][2] < qa_tableofplayers_ct[r4_7][2] then
- qa_tableofplayers_ct[r4_7] = qa_tableofplayers_ct[r8_7]
- qa_tableofplayers_ct[r8_7] = qa_tableofplayers_ct[r4_7]
- end
- end
- end
- for r4_7, r5_7 in pairs(player(0, "table")) do
- if not player(r5_7, "bot") then
- if qa_players[r5_7].scoretableimg ~= nil then
- for r9_7 = 1, 8, 1 do
- if qa_tableofplayers_t[r9_7] ~= nil then
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 7 .. " \xa9255255255" .. player(qa_tableofplayers_t[r9_7][1], "name") .. "; 35 " .. 65 + 35 * r9_7)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 24 .. " \xa9255255255" .. qa_tableofplayers_t[r9_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers_t[r9_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers_t[r9_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers_t[r9_7][1], "deaths"))) .. "; 250 " .. 65 + 35 * r9_7 .. " 1")
- else
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 7)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 24)
- end
- if qa_tableofplayers_ct[r9_7] ~= nil then
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1 .. " \xa9255255255" .. player(qa_tableofplayers_ct[r9_7][1], "name") .. "; 345 " .. 65 + 35 * r9_7)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15 .. " \xa9255255255" .. qa_tableofplayers_ct[r9_7][2] .. " " .. string.sub(" " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"), string.len((" " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers_ct[r9_7][1], "deaths"))) .. "; 560 " .. 65 + 35 * r9_7 .. " 1")
- else
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 - 1)
- parse("hudtxt2 " .. r5_7 .. " " .. r9_7 + 15)
- end
- end
- end
- parse("hudtxt2 " .. r5_7 .. " 33 " .. qa_copyright .. "255255255" .. game("mp_winlimit") .. "/" .. qa_tableofplayers_t_score .. "/" .. qa_tableofplayers_ct_score .. "/" .. qa_players[r5_7].kills .. ";600 430; 1")
- end
- end
- end
- end
- end
- function qa_weapon_lighting_hit(r0_8, r1_8, r2_8, r3_8, r4_8, r5_8, r6_8)
- -- line: [713, 749] id: 8
- local r7_8 = r2_8 - r0_8
- local r8_8 = r3_8 - r1_8
- local r9_8 = math.sqrt(r7_8 * r7_8 + r8_8 * r8_8)
- local r10_8 = nil
- r10_8 = image(r5_8.imgpath, 0, 0, 1)
- if r5_8.name == "Railgun" then
- imagecolor(r10_8, qa_lasercolors[qa_players[r6_8].lasercolor][1], qa_lasercolors[qa_players[r6_8].lasercolor][2], qa_lasercolors[qa_players[r6_8].lasercolor][3])
- else
- imageblend(r10_8, 1)
- end
- imagepos(r10_8, r0_8 + r7_8 / 2, r1_8 + r8_8 / 2, r4_8 * 180 / 3.14 + 90)
- tween_alpha(r10_8, r5_8.alpha, 0)
- if r5_8.imgflipping then
- local r11_8 = imagescale
- local r12_8 = r10_8
- local r13_8 = math.random()
- if r13_8 > 0.5 then
- r13_8 = 1 or -1
- else
- goto label_73 -- block#6 is visited secondly
- end
- local r14_8 = r9_8 / r5_8.imglength
- local r15_8 = math.random()
- if r15_8 > 0.5 then
- r15_8 = 1 or -1
- else
- goto label_84 -- block#9 is visited secondly
- end
- r11_8(r12_8, r13_8, r14_8 * r15_8)
- else
- imagescale(r10_8, 1, r9_8 / r5_8.imglength)
- end
- timer(r5_8.alpha, "freeimage", r10_8)
- if r5_8.name == "Lighting" or r5_8.name == "Railgun" then
- if r5_8.name == "Railgun" then
- r10_8 = image(r5_8.imgpath2, 0, 0, 1)
- imagepos(r10_8, r0_8 + r7_8 / 2, r1_8 + r8_8 / 2, r4_8 * 180 / 3.14 + 90)
- local r11_8 = imagescale
- local r12_8 = r10_8
- local r13_8 = math.random()
- if r13_8 > 0.5 then
- r13_8 = 1 or -1
- else
- goto label_135 -- block#17 is visited secondly
- end
- local r14_8 = r9_8 / r5_8.imglength
- local r15_8 = math.random()
- if r15_8 > 0.5 then
- r15_8 = 1 or -1
- else
- goto label_146 -- block#20 is visited secondly
- end
- r11_8(r12_8, r13_8, r14_8 * r15_8)
- imagecolor(r10_8, -qa_lasercolors[qa_players[r6_8].lasercolor][1], -qa_lasercolors[qa_players[r6_8].lasercolor][2], -qa_lasercolors[qa_players[r6_8].lasercolor][3])
- tween_alpha(r10_8, r5_8.alpha, 0)
- timer(r5_8.alpha, "freeimage", r10_8)
- r10_8 = image("gfx/sprites/railexp.png", r2_8, r3_8, 1)
- imagecolor(r10_8, qa_lasercolors[qa_players[r6_8].lasercolor][1], qa_lasercolors[qa_players[r6_8].lasercolor][2], qa_lasercolors[qa_players[r6_8].lasercolor][3])
- else
- r10_8 = image("gfx/sprites/railexp.png", r2_8, r3_8, 1)
- imageblend(r10_8, 1)
- imagecolor(r10_8, 75, 75, 255)
- end
- tween_rotateconstantly(r10_8, 875)
- timer(100, "freeimage", r10_8)
- end
- end
- GAME_NEW = true
- addhook("startround", "qa_startround")
- function qa_startround(r0_9)
- -- line: [756, 832] id: 9
- if GAME_NEW then
- freetimer()
- qa_players = {}
- for r4_9 = 1, 32, 1 do
- qa_players[r4_9] = {}
- qa_players[r4_9].total_combo = 0
- qa_players[r4_9].total_impressive = 0
- qa_players[r4_9].total_humilation = 0
- qa_players[r4_9].lhit = 0
- qa_players[r4_9].kills = 0
- end
- qa_first_blood = false
- qa_leader = 0
- end
- qa_itemsimg = {}
- qa_mapitems = {}
- for r4_9 = 0, map("xsize"), 1 do
- for r8_9 = 0, map("ysize"), 1 do
- if entity(r4_9, r8_9, "exists") and entity(r4_9, r8_9, "typename") == "Env_Item" and entity(r4_9, r8_9, "int1") == 3 then
- qa_mapitems[#qa_mapitems + 1] = {}
- qa_mapitems[#qa_mapitems].itype = entity(r4_9, r8_9, "int0")
- qa_mapitems[#qa_mapitems].delay = entity(r4_9, r8_9, "int2")
- qa_mapitems[#qa_mapitems].x = r4_9
- qa_mapitems[#qa_mapitems].y = r8_9
- qa_mapitems[#qa_mapitems].TTS = 0
- additem(#qa_mapitems)
- end
- end
- end
- for r4_9, r5_9 in pairs(blocks) do
- r5_9.imgid = image(r5_9.imgfile, (r5_9.sx * 32 + r5_9.ex * 32 + 32) / 2, (r5_9.sy * 32 + r5_9.ey * 32 + 32) / 2, 3)
- imagescale(r5_9.imgid, 1 / r5_9.imgsize[1] * (r5_9.ex + 1 - r5_9.sx) * 32, 1 / r5_9.imgsize[2] * (r5_9.ey + 1 - r5_9.sy) * 32)
- imagealpha(r5_9.imgid, 0)
- imageblend(r5_9.imgid, 0)
- end
- for r4_9, r5_9 in pairs(trains) do
- r5_9.imgid = image(r5_9.imgfile, paths[r5_9.nextpath].x, paths[r5_9.nextpath].y, 0)
- imagescale(r5_9.imgid, 1 / r5_9.imgsize[1] * r5_9.sizex, 1 / r5_9.imgsize[2] * r5_9.sizey)
- r5_9.x = paths[r5_9.nextpath].x
- r5_9.y = paths[r5_9.nextpath].y
- r5_9.dx = 0
- r5_9.dy = 0
- qa_train_nextpath(id)
- end
- for r4_9 = 1, 32, 1 do
- qa_players[r4_9].last_shot = -10
- qa_players[r4_9].combo_shots = 0
- qa_players[r4_9].fly_controleble = 0
- qa_players[r4_9].fly_steps = 0
- qa_players[r4_9].fly_x = 0
- qa_players[r4_9].fly_y = 0
- qa_players[r4_9].fly_dx = 0
- qa_players[r4_9].fly_dy = 0
- qa_players[r4_9].strike_timer = -1
- qa_players[r4_9].strikes = {}
- qa_players[r4_9].ammo = {}
- qa_players[r4_9].weapons = {}
- end
- for r4_9, r5_9 in ipairs(player(0, "table")) do
- if player(r5_9, "team") > 0 then
- parse("spawnplayer " .. r5_9 .. " " .. player(r5_9, "x") .. " " .. player(r5_9, "y"))
- end
- end
- qa_ScoreTable("0 1")
- GAME_NEW = false
- end
- addhook("second", "qa_spawnitems")
- function qa_spawnitems()
- -- line: [835, 856] id: 10
- for r3_10 = 1, #qa_mapitems, 1 do
- if qa_mapitems[r3_10].TTS > 0 then
- qa_mapitems[r3_10].TTS = qa_mapitems[r3_10].TTS - 1
- if qa_mapitems[r3_10].TTS == 0 then
- additem(r3_10)
- end
- end
- end
- for r3_10 = 1, #qa_itemsimg, 1 do
- if qa_itemsimg[r3_10] ~= nil and qa_itemsimg[r3_10].fadeout ~= nil and 0 < qa_itemsimg[r3_10].fadeout then
- qa_itemsimg[r3_10].fadeout = qa_itemsimg[r3_10].fadeout - 1
- if qa_itemsimg[r3_10].fadeout == 0 then
- removeitem(r3_10)
- end
- end
- end
- end
- function additem(r0_11, r1_11, r2_11, r3_11, r4_11, r5_11)
- -- line: [858, 878] id: 11
- if r1_11 == 60 or r1_11 == 61 or r1_11 == 62 or r1_11 == 51 then
- parse("sv_sound \"items/poweruprespawn.wav\"")
- end
- if r0_11 > 0 then
- r1_11 = qa_mapitems[r0_11].itype
- r2_11 = qa_mapitems[r0_11].x
- r3_11 = qa_mapitems[r0_11].y
- r4_11 = 0
- dontremoveble = qa_mapitems[r0_11].dontremoveble
- else
- r4_11 = tonumber(game("mp_weaponfadeout"))
- end
- parse("spawnitem " .. r1_11 .. " " .. r2_11 .. " " .. r3_11)
- qa_itemsimg[item(0, "table")[#item(0, "table")]] = {}
- qa_itemsimg[item(0, "table")[#item(0, "table")]].mapitem = r0_11
- qa_itemsimg[item(0, "table")[#item(0, "table")]].fadeout = r4_11
- qa_itemsimg[item(0, "table")[#item(0, "table")]].img = image(qa_item_types[r1_11].imgpath, r2_11 * 32 + 16, r3_11 * 32 + 16, 0)
- qa_itemsimg[item(0, "table")[#item(0, "table")]].bonustime = r5_11 or 30
- tween_rotateconstantly(qa_itemsimg[item(0, "table")[#item(0, "table")]].img, qa_item_types[r1_11].speedrot or 2)
- end
- function removeitem(r0_12)
- -- line: [880, 893] id: 12
- if qa_itemsimg[r0_12].mapitem == 0 or 0 < qa_itemsimg[r0_12].mapitem and 0 < qa_mapitems[qa_itemsimg[r0_12].mapitem].delay then
- parse("removeitem " .. r0_12)
- if qa_itemsimg[r0_12] ~= nil and qa_itemsimg[r0_12].img ~= nil then
- freeimage(qa_itemsimg[r0_12].img)
- if qa_itemsimg[r0_12].mapitem > 0 then
- qa_mapitems[qa_itemsimg[r0_12].mapitem].TTS = qa_mapitems[qa_itemsimg[r0_12].mapitem].delay
- end
- end
- qa_itemsimg[r0_12] = nil
- end
- end
- function qa_bullet_create(r0_13, r1_13, r2_13, r3_13, r4_13)
- -- line: [896, 930] id: 13
- local r5_13 = #qa_bullets + 1
- local r6_13 = math.cos(r2_13)
- oy = math.sin(r2_13)
- ox = r6_13
- r6_13 = {
- type = r3_13,
- player = r4_13,
- y = r1_13 + oy * r3_13.offset,
- x = r0_13 + ox * r3_13.offset,
- }
- if 0 < ox and ox < qa_players[r4_13].fly_dx or ox < 0 and qa_players[r4_13].fly_dx < ox then
- r6_13.dx = ox * r3_13.speed / r3_13.updates + qa_players[r4_13].fly_dx / r3_13.updates / 50 * math.abs(ox)
- else
- r6_13.dx = ox * r3_13.speed / r3_13.updates
- end
- if 0 < oy and oy < qa_players[r4_13].fly_dy or oy < 0 and qa_players[r4_13].fly_dy < oy then
- r6_13.dy = oy * r3_13.speed / r3_13.updates + qa_players[r4_13].fly_dy / r3_13.updates / 50 * math.abs(oy)
- else
- r6_13.dy = oy * r3_13.speed / r3_13.updates
- end
- r6_13.updates = r3_13.time * r3_13.updates
- r6_13.update = 0
- r6_13.update_speed = r3_13.updates / 50
- r6_13.imgid = image(r3_13.imgpath, 0, 0, 1)
- imagepos(r6_13.imgid, r6_13.x, r6_13.y, r2_13 * 180 / 3.14 + 90)
- imageblend(r6_13.imgid, 1)
- tween_rotateconstantly(r6_13.imgid, r3_13.speedrot)
- tween_move(r6_13.imgid, 1000 * r3_13.time, r6_13.x + r6_13.updates * r6_13.dx, r6_13.y + r6_13.updates * r6_13.dy)
- qa_bullets[r5_13] = r6_13
- end
- function qa_bullet_delete(r0_14, r1_14)
- -- line: [933, 940] id: 14
- if r1_14 then
- timer(r1_14, "freeimage", qa_bullets[r0_14].imgid)
- else
- freeimage(qa_bullets[r0_14].imgid)
- end
- table.remove(qa_bullets, r0_14)
- end
- addhook("always", "qa_always_bullets")
- function qa_always_bullets()
- -- line: [944, 965] id: 15
- local r0_15 = 1
- local r1_15 = 0
- while qa_bullets[r0_15] do
- r1_15 = 0
- local r2_15 = qa_bullets[r0_15]
- r2_15.update = qa_bullets[r0_15].update + qa_bullets[r0_15].update_speed
- while true do
- r2_15 = qa_bullets[r0_15]
- if r2_15 then
- r2_15 = qa_bullets[r0_15].update
- if 1 <= r2_15 and r1_15 == 0 then
- qa_bullets[r0_15].update = qa_bullets[r0_15].update - 1
- local r3_15 = qa_bullets[r0_15].updates - 1
- qa_bullets[r0_15].updates = r3_15
- r2_15 = qa_bullets[r0_15].updates
- if r2_15 > 0 then
- r2_15 = qa_bullet_step(r0_15)
- r1_15 = r2_15
- else
- qa_bullet_delete(r0_15)
- r1_15 = 1
- end
- else
- break
- end
- else
- break
- end
- end
- r2_15 = r0_15 + 1
- r0_15 = r2_15 - r1_15
- end
- end
- function qa_bullet_step(r0_16)
- -- line: [968, 1006] id: 16
- qa_bullets[r0_16].x = qa_bullets[r0_16].x + qa_bullets[r0_16].dx
- qa_bullets[r0_16].y = qa_bullets[r0_16].y + qa_bullets[r0_16].dy
- local r1_16 = math.floor(qa_bullets[r0_16].x / 32)
- local r2_16 = math.floor(qa_bullets[r0_16].y / 32)
- if tile(r1_16, r2_16, "wall") and not tile(r1_16, r2_16, "obstacle") then
- if entity(r1_16, r2_16, "exists") and entity(r1_16, r2_16, "typename") == "Trigger_Hit" and entity(r1_16, r2_16, "state") == false then
- parse("trigger " .. entity(r1_16, r2_16, "trigger"))
- elseif entity(r1_16, r2_16, "exists") and entity(r1_16, r2_16, "typename") == "Env_Breakable" then
- parse("explosion " .. r1_16 * 32 + 16 .. " " .. r2_16 * 32 + 16 .. " 1 " .. qa_bullets[r0_16].type.damage .. " " .. id)
- end
- qa_bullets_exposion(r0_16, 0)
- return 1
- end
- for r6_16, r7_16 in pairs(player(0, "tableliving")) do
- local r8_16 = player(r7_16, "x")
- local r9_16 = player(r7_16, "y")
- local r10_16 = r8_16 - qa_bullets[r0_16].x
- local r11_16 = r9_16 - qa_bullets[r0_16].y
- if r10_16 * r10_16 + r11_16 * r11_16 < 196 then
- parse("sv_sound \"player/hit1.wav\"")
- qa_bullets_exposion(r0_16, r7_16)
- return 1
- end
- end
- for r6_16, r7_16 in pairs(object(0, "table")) do
- if object(r7_16, "type") == 30 then
- local r8_16 = object(r7_16, "x")
- local r9_16 = object(r7_16, "y")
- local r10_16 = r8_16 - qa_bullets[r0_16].x
- local r11_16 = r9_16 - qa_bullets[r0_16].y
- if r10_16 * r10_16 + r11_16 * r11_16 < 196 then
- qa_bullets_exposion(r0_16, 0)
- return 1
- end
- end
- end
- return 0
- end
- function qa_bullets_exposion(r0_17, r1_17)
- -- line: [1009, 1060] id: 17
- local r2_17 = qa_bullets[r0_17]
- local r3_17 = qa_bullets[r0_17].type
- parse("sv_sound \"" .. r3_17.hitsound .. "\"")
- if r3_17.hitflash then
- if r3_17.name == "BFG10K" then
- freeimage(qa_bullets[r0_17].imgid)
- qa_bullets[r0_17].imgid = image("gfx/weapons/bfgs.png", qa_bullets[r0_17].x, qa_bullets[r0_17].y, 1, 0)
- tween_rotateconstantly(qa_bullets[r0_17].imgid, 666)
- qa_bullet_delete(r0_17, 96)
- elseif r3_17.name == "Plasmagun" then
- freeimage(qa_bullets[r0_17].imgid)
- qa_bullets[r0_17].imgid = image("gfx/weapons/plasmas.bmp", qa_bullets[r0_17].x, qa_bullets[r0_17].y, 1, 0)
- imageblend(qa_bullets[r0_17].imgid, 1)
- imagescale(qa_bullets[r0_17].imgid, 1.5, 1.5)
- tween_rotateconstantly(qa_bullets[r0_17].imgid, 511)
- qa_bullet_delete(r0_17, 96)
- elseif r3_17.name == "RocketLauncher" then
- parse("explosion " .. r2_17.x .. " " .. r2_17.y .. " 40 0 0")
- parse("effect \"flare\" " .. r2_17.x .. " " .. r2_17.y .. " 99999 1 96 96 96")
- parse("effect \"fire\" " .. r2_17.x .. " " .. r2_17.y .. " 99999 8 255 255 255")
- qa_bullet_delete(r0_17, 0)
- else
- imagescale(qa_bullets[r0_17].imgid, 2, 2)
- tween_move(qa_bullets[r0_17].imgid, 50, qa_bullets[r0_17].x - qa_bullets[r0_17].dx * 0, qa_bullets[r0_17].y - qa_bullets[r0_17].dy * 0)
- qa_bullet_delete(r0_17, 50)
- end
- else
- qa_bullet_delete(r0_17)
- end
- for r7_17, r8_17 in pairs(player(0, "tableliving")) do
- local r9_17 = math.min(r3_17.exp_size + 14 - math.sqrt((player(r8_17, "x") - r2_17.x) ^ 2 + (player(r8_17, "y") - r2_17.y) ^ 2), r3_17.exp_size)
- if 0 < r9_17 and (r8_17 == r2_17.player or game("sv_friendlyfire") == "1" or game("sv_friendlyfire") == "0" and player(r2_17.player, "team") ~= player(r8_17, "team")) then
- qa_player_damage(r2_17.player, r3_17, r8_17, r3_17.damage / r3_17.exp_size * r9_17, r1_17)
- end
- end
- for r7_17, r8_17 in pairs(object(0, "table")) do
- if object(r8_17, "type") == 30 and 0 < math.min(r3_17.exp_size + 14 - math.sqrt((object(r8_17, "x") - r2_17.x) ^ 2 + (object(r8_17, "y") - r2_17.y) ^ 2), r3_17.exp_size) then
- parse("killobject " .. r8_17)
- end
- end
- end
- function qa_player_damage(r0_18, r1_18, r2_18, r3_18, r4_18)
- -- line: [1063, 1107] id: 18
- qa_players[r2_18].regeneration_dubl = 1
- if r3_18 == nil then
- r3_18 = r1_18.damage * math.max(math.min(qa_players[r0_18].quadtime, 1) * 4, 1)
- end
- local r5_18 = qa_players[r2_18].armor - r3_18 * 0.67
- local r6_18 = player(r2_18, "health") - r3_18 * 0.33
- if r5_18 < 0 then
- r6_18 = r6_18 + r5_18
- r5_18 = 0
- end
- if r6_18 > 0 then
- parse("sethealth " .. r2_18 .. " " .. r6_18)
- qa_players[r2_18].armor = r5_18
- qa_HUD(r2_18 .. " 0 0 0 0 0 1")
- else
- parse("customkill " .. r0_18 .. " \"killed\" " .. r2_18)
- if game("sv_gamemode") == "4" then
- if player(r0_18, "team") == 1 then
- if player(r2_18, "team") == 2 then
- parse("maket " .. r2_18)
- else
- parse("makect " .. r0_18)
- end
- elseif player(r0_18, "team") == 2 then
- if player(r2_18, "team") == 1 then
- parse("makect " .. r2_18)
- else
- parse("maket " .. r0_18)
- end
- end
- end
- kn = player(r0_18, "name")
- vn = player(r2_18, "name")
- if r0_18 == r2_18 then
- reason = vn .. " " .. r1_18.txtSuicide
- elseif r2_18 == r4_18 then
- reason = vn .. " " .. string.format(r1_18.txthit, kn)
- else
- reason = vn .. " " .. string.format(r1_18.txtradiushit, kn)
- end
- qa_customkill(reason)
- end
- end
- addhook("join", "qa_player_join")
- function qa_player_join(r0_19)
- -- line: [1111, 1121] id: 19
- qa_players[r0_19].fly_steps = 0
- qa_players[r0_19].fly_x = 0
- qa_players[r0_19].fly_y = 0
- qa_players[r0_19].fly_dx = 0
- qa_players[r0_19].fly_dy = 0
- qa_players[r0_19].kills = 0
- timer(1000, "qa_starts", r0_19)
- timer(1000, "qa_itemsreload")
- end
- function qa_itemsreload()
- -- line: [1123, 1129] id: 20
- for r3_20, r4_20 in pairs(item(0, "table")) do
- if qa_itemsimg[r4_20] ~= nil then
- tween_rotateconstantly(qa_itemsimg[r4_20].img, qa_item_types[item(r4_20, "type")].speedrot or 2)
- end
- end
- end
- addhook("move", "qa_move")
- function qa_move(r0_21, r1_21, r2_21, r3_21)
- -- line: [1133, 1163] id: 21
- if qa_players[r0_21].fly_steps == 0 and qa_players[r0_21].ontrain == 0 then
- for r7_21, r8_21 in pairs(jumps) do
- if r8_21[1] <= r1_21 and r8_21[2] <= r2_21 and r1_21 < r8_21[3] and r2_21 < r8_21[4] then
- qa_player_fly_start(r0_21, r8_21[5], r8_21[6], r8_21.steps, r8_21.cont)
- parse("sv_sound \"env/jumppad.wav\"")
- break
- end
- end
- for r7_21, r8_21 in pairs(planes) do
- if r8_21[1] <= r1_21 and r8_21[2] <= r2_21 and r1_21 < r8_21[3] and r2_21 < r8_21[4] then
- local r9_21 = qa_player_fly_start
- local r10_21 = r0_21
- local r11_21 = r8_21[5]
- local r12_21 = r8_21[6]
- local r13_21 = r8_21.steps or 1
- r9_21(r10_21, r11_21, r12_21, r13_21, r8_21.cont or 1)
- break
- end
- end
- for r7_21, r8_21 in pairs(trains) do
- if object(r8_21.imgid, "x") - r8_21.sizex / 2 < r1_21 and r1_21 < object(r8_21.imgid, "x") + r8_21.sizex / 2 and object(r8_21.imgid, "y") - r8_21.sizey / 2 < r2_21 and r2_21 < object(r8_21.imgid, "y") + r8_21.sizey / 2 then
- qa_players[r0_21].ontrain = r7_21
- end
- end
- elseif qa_players[r0_21].ontrain ~= 0 then
- train = trains[qa_players[r0_21].ontrain]
- if object(train.imgid, "x") - train.sizex / 2 >= r1_21 or r1_21 >= object(train.imgid, "x") + train.sizex / 2 or object(train.imgid, "y") - train.sizey / 2 >= r2_21 or r2_21 >= object(train.imgid, "y") + train.sizey / 2 then
- qa_players[r0_21].ontrain = 0
- qa_movetile(r0_21, player(r0_21, "tilex"), player(r0_21, "tiley"))
- end
- end
- end
- addhook("trigger", "qa_trigger")
- function qa_trigger(r0_22, r1_22)
- -- line: [1166, 1174] id: 22
- for r5_22, r6_22 in pairs(blocks) do
- if r6_22.name == r0_22 and r6_22.imgid ~= nil then
- parse("sv_sound \"env/DR1_STRT.WAV\"")
- tween_alpha(r6_22.imgid, r6_22.timetodowned, 1)
- timer(r6_22.timetodowned, "blockactivate", r5_22)
- end
- end
- end
- function blockactivate(r0_23)
- -- line: [1176, 1188] id: 23
- r0_23 = blocks[tonumber(r0_23)]
- tween_alpha(r0_23.imgid, r0_23.timetouped, 0)
- parse("sv_sound \"env/DR1_END.WAV\"")
- for r4_23, r5_23 in pairs(player(0, "tableliving")) do
- x = player(r5_23, "tilex")
- y = player(r5_23, "tiley")
- if r0_23.sx <= x and r0_23.sy <= y and x <= r0_23.ex and y <= r0_23.ey then
- parse("customkill 0 \"was squished\" " .. r5_23)
- qa_customkill(player(r5_23, "name") .. " was squished")
- end
- end
- end
- addhook("movetile", "qa_movetile")
- function qa_movetile(r0_24, r1_24, r2_24)
- -- line: [1191, 1207] id: 24
- local r3_24 = tile(r1_24, r2_24, "frame")
- if qa_players[r0_24].fly_steps == 0 and qa_players[r0_24].ontrain == 0 and deadlyframe[r3_24] ~= nil then
- if deadlyframe[r3_24].type == "hole" then
- parse("customkill 0 \"was in the wrong place\" " .. r0_24)
- parse("sv_sound \"player/die_abyss.wav\"")
- elseif deadlyframe[r3_24].type == "lava" then
- parse("customkill 0 \"does a back flip into the lava\" " .. r0_24)
- parse("sv_sound \"player/die_toxic.ogg\"")
- else
- parse("customkill 0 \"" .. deadlyframe[r3_24].type .. "\" " .. r0_24)
- if deadlyframe[r3_24].sound ~= nil then
- parse("sv_sound \"" .. deadlyframe[r3_24].sound .. "\"")
- end
- end
- end
- end
- function qa_player_fly_start(r0_25, r1_25, r2_25, r3_25, r4_25)
- -- line: [1210, 1215] id: 25
- qa_players[r0_25].fly_steps = r3_25 or 1
- local r7_25 = player(r0_25, "x")
- qa_players[r0_25].fly_y = player(r0_25, "y")
- qa_players[r0_25].fly_x = r7_25
- qa_players[r0_25].fly_dy = r2_25 / qa_players[r0_25].fly_steps
- qa_players[r0_25].fly_dx = r1_25 / qa_players[r0_25].fly_steps
- qa_players[r0_25].fly_controleble = r4_25 or 0
- end
- function qa_player_fly_update(r0_26)
- -- line: [1218, 1243] id: 26
- if qa_players[r0_26].fly_steps >= 1 then
- qa_players[r0_26].fly_steps = qa_players[r0_26].fly_steps - 1
- if qa_players[r0_26].fly_controleble ~= 0 then
- qa_players[r0_26].fly_x = (-qa_players[r0_26].fly_x + player(r0_26, "x")) / qa_players[r0_26].fly_controleble + qa_players[r0_26].fly_x + qa_players[r0_26].fly_dx
- qa_players[r0_26].fly_y = (-qa_players[r0_26].fly_y + player(r0_26, "y")) / qa_players[r0_26].fly_controleble + qa_players[r0_26].fly_y + qa_players[r0_26].fly_dy
- else
- qa_players[r0_26].fly_x = qa_players[r0_26].fly_x + qa_players[r0_26].fly_dx
- qa_players[r0_26].fly_y = qa_players[r0_26].fly_y + qa_players[r0_26].fly_dy
- end
- if 0 < qa_players[r0_26].fly_x - 16 and 0 < qa_players[r0_26].fly_y - 16 and qa_players[r0_26].fly_x + 16 < map("xsize") * 32 and qa_players[r0_26].fly_y + 16 < map("ysize") * 32 then
- parse("setpos " .. r0_26 .. " " .. qa_players[r0_26].fly_x .. " " .. qa_players[r0_26].fly_y)
- end
- if qa_players[r0_26].fly_steps == 0 then
- qa_players[r0_26].fly_dx = 0
- qa_players[r0_26].fly_dy = 0
- qa_move(r0_26, player(r0_26, "x"), player(r0_26, "y"))
- qa_movetile(r0_26, player(r0_26, "tilex"), player(r0_26, "tiley"))
- end
- if qa_players[r0_26].fly_steps == 0 then
- qa_player_fly_end(r0_26)
- end
- end
- end
- function qa_player_fly_end(r0_27)
- -- line: [1246, 1248] id: 27
- parse("sv_sound2 " .. r0_27 .. " \"player/fall1.wav\"")
- end
- addhook("always", "qa_always")
- function qa_always()
- -- line: [1252, 1257] id: 28
- for r3_28, r4_28 in pairs(player(0, "tableliving")) do
- qa_player_fly_update(r4_28)
- end
- end
- addhook("join", "qa_combo_join", -1)
- function qa_combo_join(r0_29)
- -- line: [1261, 1271] id: 29
- qa_players[r0_29].total_combo = 0
- qa_players[r0_29].total_impressive = 0
- qa_players[r0_29].total_humilation = 0
- qa_players[r0_29].last_shot = -10
- qa_players[r0_29].combo_shots = 0
- qa_players[r0_29].strike_timer = -1
- qa_players[r0_29].strikes = {}
- end
- addhook("ms100", "qa_combo_ms100")
- function qa_combo_ms100()
- -- line: [1275, 1315] id: 30
- qa_time = qa_time + 0.1
- for r3_30, r4_30 in pairs(player(0, "table")) do
- if 0 < qa_players[r4_30].combo_shots and 2 < qa_time - qa_players[r4_30].last_shot then
- if qa_players[r4_30].combo_shots >= 2 then
- qa_players[r4_30].total_combo = qa_players[r4_30].total_combo + 1
- end
- qa_players[r4_30].combo_shots = 0
- end
- end
- for r3_30, r4_30 in ipairs(player(0, "tableliving")) do
- if qa_players[r4_30].oldWeapon ~= player(r4_30, "weapontype") then
- qa_HUD(r4_30 .. " 1 1")
- end
- end
- for r3_30, r4_30 in pairs(player(0, "table")) do
- local r5_30 = player(r4_30, "money")
- if r5_30 > 1 then
- parse("setmoney " .. r4_30 .. " " .. r5_30 - r5_30)
- end
- local r6_30 = qa_players[r4_30]
- if r6_30.strike_timer >= 0 then
- r6_30.strike_timer = r6_30.strike_timer - 1
- end
- if r6_30.strike_timer == 0 then
- for r10_30, r11_30 in ipairs(r6_30.strikes) do
- freeimage(r11_30)
- end
- r6_30.strikes = {}
- end
- end
- for r3_30, r4_30 in pairs(player(0, "tableliving")) do
- if qa_players[r4_30].speedtime > 1 then
- parse("effect \"colorsmoke\" " .. player(r4_30, "x") .. " " .. player(r4_30, "y") .. " 1 1 96 96 96")
- end
- end
- end
- qa_strikes = {}
- function qa_strike_show(r0_31, r1_31)
- -- line: [1320, 1331] id: 31
- local r2_31 = qa_players[r0_31]
- r2_31.strike_timer = qa_strike_delay
- local r3_31 = r2_31.strikes
- if #r3_31 > 0 then
- for r7_31, r8_31 in ipairs(r3_31) do
- imagepos(r8_31, r7_31 * 20 - (#r3_31 + 1) * 10 - 10 + 320, 210, 0)
- end
- end
- local r4_31 = #r3_31 + 1
- r3_31[r4_31] = image(r1_31, r4_31 * 10 - 10 + 320, 210, 2, r0_31)
- end
- addhook("kill", "qa_kill")
- function qa_kill(r0_32, r1_32, r2_32)
- -- line: [1335, 1414] id: 32
- if r1_32 ~= r0_32 then
- local r3_32 = qa_players[r0_32]
- r3_32.combo_shots = r3_32.combo_shots + 1
- r3_32.last_shot = qa_time
- if r3_32.combo_shots >= 2 then
- parse("sv_sound2 \"..killer..\" \"fun/excellent.wav\"")
- qa_strike_show(r0_32, "gfx/qa2d/excellent.png")
- end
- if r2_32 == 69 then
- qa_strike_show(r0_32, "gfx/qa2d/humiliation.png")
- parse("sv_sound2 " .. r0_32 .. " \"fun/humiliation.wav\"")
- r3_32.total_humilation = r3_32.total_humilation + 1
- end
- if r3_32.combo_shots == 1 and qa_first_blood == false then
- qa_first_blood = true
- parse("sv_sound \"fun/firstblood.wav\"")
- elseif r3_32.combo_shots == 2 then
- parse("sv_sound \"fun/doublekill.wav\"")
- elseif r3_32.combo_shots == 3 then
- parse("sv_sound \"fun/triplekill.wav\"")
- elseif r3_32.combo_shots == 4 then
- parse("sv_sound \"fun/killingspree.wav\"")
- elseif r3_32.combo_shots == 5 then
- parse("sv_sound \"fun/rampage.wav\"")
- elseif r3_32.combo_shots == 6 then
- parse("sv_sound \"fun/multikill.wav\"")
- elseif r3_32.combo_shots == 7 then
- parse("sv_sound \"fun/ultrakill.wav\"")
- elseif r3_32.combo_shots == 8 then
- parse("sv_sound \"fun/monsterkill.wav\"")
- elseif r3_32.combo_shots == 9 then
- parse("sv_sound \"fun/unstoppable.wav\"")
- elseif r3_32.combo_shots >= 10 then
- parse("sv_sound \"fun/godlike.wav\"")
- end
- qa_players[r1_32].armor = 0
- if game("sv_gamemode") == "1" or player(r0_32, "team") ~= player(r1_32, "team") then
- r3_32.kills = r3_32.kills + 1
- else
- r3_32.kills = r3_32.kills - 1
- end
- if game("sv_gamemode") == "1" then
- if qa_leader == 0 then
- qa_leader = r0_32
- parse("sv_sound2 " .. r0_32 .. " \"fun/tiedlead.wav\"")
- elseif r0_32 ~= qa_leader and qa_players[qa_leader].kills < r3_32.kills then
- parse("sv_sound2 " .. qa_leader .. " \"fun/lostlead.wav\"")
- parse("sv_sound2 " .. r0_32 .. " \"fun/tiedlead.wav\"")
- qa_leader = r0_32
- end
- if 0 < tonumber(game("mp_winlimit")) and r0_32 == qa_leader then
- if tonumber(game("mp_winlimit")) <= r3_32.kills then
- parse("sv_sound \"fun/gameend.wav\"")
- timer(0, "qa_endround")
- elseif r3_32.kills + 1 == tonumber(game("mp_winlimit")) then
- parse("sv_sound \"fun/1_frag.wav\"")
- elseif r3_32.kills + 2 == tonumber(game("mp_winlimit")) then
- parse("sv_sound \"fun/2_frags.wav\"")
- elseif r3_32.kills + 3 == tonumber(game("mp_winlimit")) then
- parse("sv_sound \"fun/3_frags.wav\"")
- end
- end
- else
- qa_ScoreTable("0 1")
- if 0 < tonumber(game("mp_winlimit")) and (tonumber(game("mp_winlimit")) <= qa_tableofplayers_t_score or tonumber(game("mp_winlimit")) <= qa_tableofplayers_ct_score) then
- parse("sv_sound \"fun/gameend.wav\"")
- timer(0, "qa_endround")
- end
- end
- end
- end
- function qa_endround()
- -- line: [1416, 1474] id: 33
- freetimer()
- qa_end = true
- if #qa_bullets > 0 then
- for r3_33 = 1, #qa_bullets, 1 do
- qa_bullet_delete(1)
- end
- end
- for r3_33, r4_33 in pairs(object(0, "table")) do
- if object(r4_33, "type") == 40 then
- freeimage(r4_33)
- end
- end
- qa_ScoreTable(0)
- function qa_spawnitems()
- -- line: [1430, 1430] id: 34
- end
- freehook("join", "qa_player_join")
- freehook("die", "qa_die")
- function qa_startplay(r0_35)
- -- line: [1433, 1462] id: 35
- if game("sv_gamemode") == "1" then
- for r4_35 = 1, #16, 1 do
- if qa_tableofplayers[r4_35] ~= nil then
- timer(0, "parse", "hudtxt " .. r4_35 - 1 .. " \xa9255255255" .. string.sub(player(qa_tableofplayers[r4_35][1], "name"), 1, 15) .. "; " .. 70 + 310 * math.floor(r4_35 / 9) .. " " .. 65 + 35 * r4_35 - 280 * math.floor(r4_35 / 9))
- timer(0, "parse", "hudtxt " .. r4_35 + 15 .. " \xa9255255255" .. qa_tableofplayers[r4_35][2] .. " " .. string.sub(" " .. player(qa_tableofplayers[r4_35][1], "deaths"), string.len((" " .. player(qa_tableofplayers[r4_35][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers[r4_35][1], "deaths"))) .. "; " .. 250 + 310 * math.floor(r4_35 / 9) .. " " .. 65 + 35 * r4_35 - 280 * math.floor(r4_35 / 9) .. " -1")
- else
- timer(0, "parse", "hudtxt " .. r4_35 - 1)
- timer(0, "parse", "hudtxt " .. r4_35 + 15)
- end
- end
- else
- for r4_35 = 1, 8, 1 do
- if qa_tableofplayers_t[r4_35] ~= nil then
- timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 7 .. " \xa9255255255" .. player(qa_tableofplayers_t[r4_35][1], "name") .. "; 35 " .. 65 + 35 * r4_35)
- timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 24 .. " \xa9255255255" .. qa_tableofplayers_t[r4_35][2] .. " " .. string.sub(" " .. player(qa_tableofplayers_t[r4_35][1], "deaths"), string.len((" " .. player(qa_tableofplayers_t[r4_35][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers_t[r4_35][1], "deaths"))) .. "; 250 " .. 65 + 35 * r4_35 .. " 1")
- else
- timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 7)
- timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 24)
- end
- if qa_tableofplayers_ct[r4_35] ~= nil then
- timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 - 1 .. " \xa9255255255" .. player(qa_tableofplayers_ct[r4_35][1], "name") .. "; 345 " .. 65 + 35 * r4_35)
- timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 15 .. " \xa9255255255" .. qa_tableofplayers_ct[r4_35][2] .. " " .. string.sub(" " .. player(qa_tableofplayers_ct[r4_35][1], "deaths"), string.len((" " .. player(qa_tableofplayers_ct[r4_35][1], "deaths"))) - 4, string.len(" " .. player(qa_tableofplayers_ct[r4_35][1], "deaths"))) .. "; 560 " .. 65 + 35 * r4_35 .. " 1")
- else
- timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 - 1)
- timer(0, "parse", "hudtxt " .. r0_35 .. " " .. r4_35 + 15)
- end
- end
- end
- end
- for r3_33, r4_33 in pairs(player(0, "team1")) do
- if player(r4_33, "health") > 0 then
- parse("setdeaths " .. r4_33 .. " " .. player(r4_33, "deaths") - 1)
- end
- parse("makespec " .. r4_33)
- end
- for r3_33, r4_33 in pairs(player(0, "team2")) do
- if player(r4_33, "health") > 0 then
- parse("setdeaths " .. r4_33 .. " " .. player(r4_33, "deaths") - 1)
- end
- parse("makespec " .. r4_33)
- end
- addhook("team", "qa_team")
- function qa_team(r0_36, r1_36, r2_36)
- -- line: [1472, 1472] id: 36
- return 1
- end
- timer(10000, "parse", "changemap " .. game("nextmap"))
- end
- addhook("attack", "qa_strike_attack")
- function qa_strike_attack(r0_37)
- -- line: [1477, 1484] id: 37
- if qa_players[r0_37].last_shot == 87 then
- qa_players[r0_37].laser_shot = true
- else
- qa_players[r0_37].laser_shot = false
- end
- qa_players[r0_37].last_shot = 0
- end
- addhook("hit", "qa_hit_bullets")
- function qa_hit_bullets(r0_38, r1_38, r2_38, r3_38, r4_38)
- -- line: [1488, 1501] id: 38
- if r1_38 > 0 then
- if qa_players[r1_38].laser_shot then
- qa_players[r1_38].total_impressive = qa_players[r1_38].total_impressive + 1
- parse("sv_sound2 " .. r1_38 .. " \"fun/impressive.wav\"")
- qa_strike_show(r1_38, "gfx/qa2d/impressive.png")
- end
- qa_players[r1_38].last_shot = r2_38
- if r2_38 == 69 or r2_38 == 49 then
- qa_player_damage(r1_38, qa_weapon_types[r2_38], r0_38, r3_38, r0_38)
- return 1
- end
- end
- end
- qa_players = {}
- for r3_0 = 1, 32, 1 do
- qa_players[r3_0] = {}
- qa_players[r3_0].total_combo = 0
- qa_players[r3_0].total_impressive = 0
- qa_players[r3_0].total_humilation = 0
- qa_players[r3_0].last_shot = -10
- qa_players[r3_0].combo_shots = 0
- qa_players[r3_0].lhit = 0
- qa_players[r3_0].fly_controleble = 1
- qa_players[r3_0].fly_steps = 0
- qa_players[r3_0].fly_x = 0
- qa_players[r3_0].fly_y = 0
- qa_players[r3_0].fly_dx = 0
- qa_players[r3_0].fly_dy = 0
- qa_players[r3_0].strike_timer = -1
- qa_players[r3_0].strikes = {}
- end
- addhook("walkover", "qa_walkover")
- function qa_walkover(r0_39, r1_39, r2_39, r3_39, r4_39, r5_39)
- -- line: [1528, 1705] id: 39
- if player(r0_39, "health") > 0 then
- local r6_39 = itemtype(r2_39, "name")
- local r7_39 = qa_players[r0_39].armor
- local r8_39 = player(r0_39, "health")
- local r9_39 = player(r0_39, "money")
- if r2_39 == 62 then
- parse("sv_sound \"items/quad.wav\"")
- if qa_players[r0_39].quadtime < 1 then
- qa_players[r0_39].quadimg = image("gfx/player/randomplayer.bmp", 1, 0, r0_39 + 200)
- imagecolor(qa_players[r0_39].quadimg, 0, 255, 255)
- end
- qa_players[r0_39].quadtime = qa_players[r0_39].quadtime + qa_itemsimg[r1_39].bonustime
- removeitem(r1_39)
- parse("hudtxt2 " .. r0_39 .. " 39 " .. qa_copyright .. "175175255" .. qa_players[r0_39].quadtime .. ";40 375")
- qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 1")
- return 1
- elseif r2_39 == 51 then
- parse("sv_sound \"items/invisibility.wav\"")
- qa_players[r0_39].invisibility = qa_players[r0_39].invisibility + qa_itemsimg[r1_39].bonustime
- parse("setarmor " .. r0_39 .. " 206")
- removeitem(r1_39)
- parse("hudtxt2 " .. r0_39 .. " 36 " .. qa_copyright .. "050050255" .. qa_players[r0_39].invisibility .. ";40 295")
- qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 1")
- return 1
- elseif r2_39 == 61 then
- parse("sv_sound \"items/haste.wav\"")
- qa_players[r0_39].speedtime = qa_players[r0_39].speedtime + qa_itemsimg[r1_39].bonustime
- qa_HUD(r0_39 .. " 0 0 1")
- removeitem(r1_39)
- parse("hudtxt2 " .. r0_39 .. " 38 " .. qa_copyright .. "255255125" .. qa_players[r0_39].speedtime .. ";40 335")
- qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 1")
- return 1
- elseif r2_39 == 60 then
- parse("sv_sound \"items/regeneration.wav\"")
- if qa_players[r0_39].regentime < 1 then
- qa_players[r0_39].regenimg = image("gfx/qa2d/q_sphere.png", 0, 0, r0_39 + 200)
- imagecolor(qa_players[r0_39].regenimg, 255, 0, 0)
- tween_rotateconstantly(qa_players[r0_39].regenimg, 32)
- end
- qa_players[r0_39].regentime = qa_players[r0_39].regentime + qa_itemsimg[r1_39].bonustime
- removeitem(r1_39)
- parse("hudtxt2 " .. r0_39 .. " 37 " .. qa_copyright .. "255050050" .. qa_players[r0_39].regentime .. ";40 415")
- qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 1")
- return 1
- elseif r2_39 == 57 then
- if r7_39 < 200 then
- parse("sv_sound \"items/kevlar.wav\"")
- qa_players[r0_39].armor = math.min(r7_39 + 50, 200)
- removeitem(r1_39)
- qa_HUD(r0_39 .. " 0 0 0 0 0 1")
- end
- return 1
- elseif r2_39 == 58 then
- if r7_39 < 200 then
- parse("sv_sound \"items/kevlar.wav\"")
- qa_players[r0_39].armor = math.min(r7_39 + 100, 200)
- removeitem(r1_39)
- qa_HUD(r0_39 .. " 0 0 0 0 0 1")
- end
- return 1
- elseif r2_39 == 64 then
- if r8_39 < 100 then
- parse("sv_sound \"items/health.wav\"")
- parse("sethealth " .. r0_39 .. " " .. math.min(r8_39 + 50, 100))
- removeitem(r1_39)
- return 1
- end
- return 1
- elseif r2_39 == 65 then
- if r8_39 < 100 then
- parse("sv_sound \"items/health.wav\"")
- parse("sethealth " .. r0_39 .. " " .. math.min(r8_39 + 25, 100))
- removeitem(r1_39)
- end
- return 1
- elseif r2_39 == 66 then
- parse("sv_sound \"items/health.wav\"")
- parse("sethealth " .. r0_39 .. " " .. r8_39 + 5)
- removeitem(r1_39)
- return 1
- elseif r2_39 == 68 then
- parse("sv_sound \"items/megahealth.wav\"")
- parse("sethealth " .. r0_39 .. " " .. r8_39 + 100)
- removeitem(r1_39)
- return 1
- elseif r2_39 == 67 then
- if r7_39 < 201 then
- parse("sv_sound \"items/shard.wav\"")
- qa_players[r0_39].armor = math.min(r7_39 + 5, 200)
- removeitem(r1_39)
- qa_HUD(r0_39 .. " 0 0 0 0 0 1")
- end
- return 1
- elseif 52 <= r2_39 and r2_39 <= 53 then
- if qa_players[r0_39].bonus == 0 then
- qa_players[r0_39].bonus = r2_39 - 51
- removeitem(r1_39)
- qa_HUD(r0_39 .. " 0 0 0 0 0 0 0 0 1")
- end
- return 1
- elseif r2_39 ~= 70 and r2_39 ~= 71 then
- parse("sv_sound \"items/pickup.wav\"")
- removeitem(r1_39)
- if r2_39 == 1 then
- qa_players[r0_39].ammo[2] = math.min(qa_players[r0_39].ammo[2] + qa_agap[2], qa_maiw[2])
- if qa_players[r0_39].weapons[2] == 1 then
- parse("equip " .. r0_39 .. " 21")
- end
- qa_HUD(r0_39 .. " 1")
- return 1
- elseif r2_39 == 2 then
- qa_players[r0_39].ammo[3] = math.min(qa_players[r0_39].ammo[3] + qa_agap[3], qa_maiw[3])
- if qa_players[r0_39].weapons[3] == 1 then
- parse("equip " .. r0_39 .. " 10")
- end
- qa_HUD(r0_39 .. " 1")
- return 1
- elseif r2_39 == 3 then
- qa_players[r0_39].ammo[4] = math.min(qa_players[r0_39].ammo[4] + qa_agap[4], qa_maiw[4])
- if qa_players[r0_39].weapons[4] == 1 then
- parse("equip " .. r0_39 .. " 49")
- end
- qa_HUD(r0_39 .. " 1")
- return 1
- elseif r2_39 == 4 then
- qa_players[r0_39].ammo[5] = math.min(qa_players[r0_39].ammo[5] + qa_agap[5], qa_maiw[5])
- if qa_players[r0_39].weapons[5] == 1 then
- parse("equip " .. r0_39 .. " 77")
- end
- qa_HUD(r0_39 .. " 1")
- return 1
- elseif r2_39 == 5 then
- qa_players[r0_39].ammo[6] = math.min(qa_players[r0_39].ammo[6] + qa_agap[6], qa_maiw[6])
- if qa_players[r0_39].weapons[6] == 1 then
- parse("equip " .. r0_39 .. " 85")
- end
- qa_HUD(r0_39 .. " 1")
- return 1
- elseif r2_39 == 6 then
- qa_players[r0_39].ammo[7] = math.min(qa_players[r0_39].ammo[7] + qa_agap[7], qa_maiw[7])
- if qa_players[r0_39].weapons[7] == 1 then
- parse("equip " .. r0_39 .. " 87")
- end
- qa_HUD(r0_39 .. " 1")
- return 1
- elseif r2_39 == 21 then
- qa_players[r0_39].ammo[8] = math.min(qa_players[r0_39].ammo[8] + qa_agap[8], qa_maiw[8])
- if qa_players[r0_39].weapons[8] == 1 then
- parse("equip " .. r0_39 .. " 38")
- end
- qa_HUD(r0_39 .. " 1")
- return 1
- elseif r2_39 == 22 then
- qa_players[r0_39].ammo[9] = math.min(qa_players[r0_39].ammo[9] + qa_agap[9], qa_maiw[9])
- if qa_players[r0_39].weapons[9] == 1 then
- parse("equip " .. r0_39 .. " 11")
- end
- qa_HUD(r0_39 .. " 1")
- return 1
- end
- if r2_39 == 21 then
- parse("equip " .. r0_39 .. " " .. r2_39)
- if qa_players[r0_39].weapons[2] == 0 then
- parse("setweapon " .. r0_39 .. " " .. r2_39)
- end
- qa_players[r0_39].ammo[2] = math.max(math.min(qa_players[r0_39].ammo[2] + qa_players[r0_39].weapons[2], qa_maiw[2]), qa_agwp[2])
- qa_players[r0_39].weapons[2] = 1
- elseif r2_39 == 10 then
- parse("equip " .. r0_39 .. " " .. r2_39)
- if qa_players[r0_39].weapons[3] == 0 then
- parse("setweapon " .. r0_39 .. " " .. r2_39)
- end
- qa_players[r0_39].ammo[3] = math.max(math.min(qa_players[r0_39].ammo[3] + qa_players[r0_39].weapons[3], qa_maiw[3]), qa_agwp[3])
- qa_players[r0_39].weapons[3] = 1
- elseif r2_39 == 11 then
- parse("equip " .. r0_39 .. " " .. r2_39)
- if qa_players[r0_39].weapons[9] == 0 then
- parse("setweapon " .. r0_39 .. " " .. r2_39)
- end
- qa_players[r0_39].ammo[9] = math.max(math.min(qa_players[r0_39].ammo[9] + qa_players[r0_39].weapons[9], qa_maiw[9]), qa_agwp[9])
- qa_players[r0_39].weapons[9] = 1
- elseif r2_39 == 38 then
- parse("equip " .. r0_39 .. " " .. r2_39)
- if qa_players[r0_39].weapons[8] == 0 then
- parse("setweapon " .. r0_39 .. " " .. r2_39)
- end
- qa_players[r0_39].ammo[8] = math.max(math.min(qa_players[r0_39].ammo[8] + qa_players[r0_39].weapons[8], qa_maiw[8]), qa_agwp[8])
- qa_players[r0_39].weapons[8] = 1
- elseif r2_39 == 45 then
- parse("equip " .. r0_39 .. " 87")
- if qa_players[r0_39].weapons[7] == 0 then
- parse("setweapon " .. r0_39 .. " 87")
- end
- qa_players[r0_39].ammo[7] = math.max(math.min(qa_players[r0_39].ammo[7] + qa_players[r0_39].weapons[7], qa_maiw[7]), qa_agwp[7])
- qa_players[r0_39].weapons[7] = 1
- elseif r2_39 == 85 then
- parse("equip " .. r0_39 .. " " .. r2_39)
- if qa_players[r0_39].weapons[6] == 0 then
- parse("setweapon " .. r0_39 .. " " .. r2_39)
- end
- qa_players[r0_39].ammo[6] = math.max(math.min(qa_players[r0_39].ammo[6] + qa_players[r0_39].weapons[6], qa_maiw[6]), qa_agwp[6])
- qa_players[r0_39].weapons[6] = 1
- elseif r2_39 == 48 then
- parse("equip " .. r0_39 .. " 77")
- if qa_players[r0_39].weapons[5] == 0 then
- parse("setweapon " .. r0_39 .. " " .. 77)
- end
- qa_players[r0_39].ammo[5] = math.max(math.min(qa_players[r0_39].ammo[5] + qa_players[r0_39].weapons[5], qa_maiw[5]), qa_agwp[5])
- qa_players[r0_39].weapons[5] = 1
- qa_HUD(r0_39 .. " 1 1")
- return 1
- elseif r2_39 == 49 then
- parse("equip " .. r0_39 .. " " .. r2_39)
- if qa_players[r0_39].weapons[4] == 0 then
- parse("setweapon " .. r0_39 .. " " .. r2_39)
- end
- qa_players[r0_39].ammo[4] = math.max(math.min(qa_players[r0_39].ammo[4] + qa_players[r0_39].weapons[4], qa_maiw[4]), qa_agwp[4])
- qa_players[r0_39].weapons[4] = 1
- end
- qa_HUD(r0_39 .. " 1 1")
- return 1
- end
- end
- end
- addhook("second", "qa_second")
- function qa_second()
- -- line: [1709, 1774] id: 40
- for r3_40, r4_40 in pairs(player(0, "tableliving")) do
- local r5_40 = qa_players[r4_40].armor
- local r6_40 = player(r4_40, "health")
- local r7_40 = qa_players[r4_40]
- if r5_40 > 100 then
- r7_40.armor = r5_40 - 1
- qa_HUD(r4_40 .. " 0 0 0 0 0 1")
- end
- if r6_40 > 100 then
- parse("sethealth " .. r4_40 .. " " .. r6_40 - 1)
- end
- if r7_40.quadtime > 0 then
- parse("sv_sound2 " .. r4_40 .. " \"items/sqd.wav\"")
- r7_40.quadtime = r7_40.quadtime - 1
- if r7_40.quadtime == 0 then
- freeimage(r7_40.quadimg)
- qa_HUD(r4_40 .. " 0 0 0 0 0 0 0 1")
- else
- parse("hudtxt2 " .. r4_40 .. " 39 " .. qa_copyright .. "175175255" .. r7_40.quadtime .. ";40 375")
- end
- end
- if r7_40.speedtime > 0 then
- parse("sv_sound2 " .. r4_40 .. " \"items/health5.wav\"")
- r7_40.speedtime = r7_40.speedtime - 1
- if r7_40.speedtime == 0 then
- qa_HUD(r4_40 .. " 0 0 1 0 0 0 0 1")
- else
- parse("hudtxt2 " .. r4_40 .. " 38 " .. qa_copyright .. "255255125" .. r7_40.speedtime .. ";40 335")
- end
- end
- if r7_40.regentime > 0 then
- parse("sv_sound2 " .. r4_40 .. " \"items/regen.wav\"")
- r7_40.regentime = r7_40.regentime - 1
- local r8_40 = 0
- if r7_40.regeneration_dubl == 0 then
- r8_40 = math.max(player(r4_40, "health") - 195, 0)
- parse("sethealth " .. r4_40 .. " " .. player(r4_40, "health") + 5)
- else
- r8_40 = math.max(player(r4_40, "health") - 185, 0)
- parse("sethealth " .. r4_40 .. " " .. player(r4_40, "health") + 15)
- end
- r7_40.armor = math.min(r5_40 + r8_40, 200)
- qa_HUD(r4_40 .. " 0 0 0 0 0 1")
- if r7_40.regentime == 0 then
- freeimage(r7_40.regenimg)
- qa_HUD(r4_40 .. " 0 0 0 0 0 0 0 1")
- else
- parse("hudtxt2 " .. r4_40 .. " 37 " .. qa_copyright .. "255050050" .. r7_40.regentime .. ";40 415")
- end
- end
- if r7_40.invisibility > 0 then
- parse("sv_sound2 " .. r4_40 .. " \"items/regen.wav\"")
- r7_40.invisibility = r7_40.invisibility - 1
- if r7_40.invisibility < 1 then
- parse("setarmor " .. r4_40 .. " 0")
- qa_HUD(r4_40 .. " 0 0 0 0 0 0 0 1")
- else
- parse("hudtxt2 " .. r4_40 .. " 36 " .. qa_copyright .. "050050255" .. r7_40.invisibility .. ";40 295")
- end
- end
- r7_40.regeneration_dubl = 0
- end
- end
- addhook("drop", "qa_drops")
- function qa_drops(r0_41, r1_41, r2_41)
- -- line: [1778, 1782] id: 41
- if player(r0_41, "health") > 0 then
- return 1
- end
- end
- addhook("die", "qa_die")
- function qa_die(r0_42, r1_42, r2_42)
- -- line: [1786, 1822] id: 42
- if not tile(player(r0_42, "tilex"), player(r0_42, "tiley"), "deadly") and (deadlyframe[tile(player(r0_42, "tilex"), player(r0_42, "tiley"), "frame")] == nil or 0 < qa_players[r0_42].fly_steps or 0 < qa_players[r0_42].ontrain) then
- parse("effect \"colorsmoke\" " .. player(r0_42, "x") .. " " .. player(r0_42, "y") .. " 1 1 200 0 0")
- local r3_42 = player(r0_42, "weapontype")
- if r3_42 ~= 21 and r3_42 ~= 69 and 0 < r3_42 then
- if r3_42 == 77 then
- r3_42 = 48
- elseif r3_42 == 87 then
- r3_42 = 45
- end
- additem(0, r3_42, player(r0_42, "tilex"), player(r0_42, "tiley"))
- end
- if qa_players[r0_42].quadtime > 0 then
- additem(0, 62, player(r0_42, "tilex"), player(r0_42, "tiley"), 1, qa_players[r0_42].quadtime)
- end
- if qa_players[r0_42].speedtime > 0 then
- additem(0, 61, player(r0_42, "tilex"), player(r0_42, "tiley"), 1, qa_players[r0_42].speedtime)
- end
- if qa_players[r0_42].regentime > 0 then
- additem(0, 60, player(r0_42, "tilex"), player(r0_42, "tiley"), 1, qa_players[r0_42].regentime)
- end
- if qa_players[r0_42].invisibility > 0 then
- additem(0, 51, player(r0_42, "tilex"), player(r0_42, "tiley"), 1, qa_players[r0_42].invisibility)
- end
- end
- if qa_players[r0_42].quadtime > 0 then
- timer(0, "freeimage", qa_players[r0_42].quadimg)
- end
- if qa_players[r0_42].regentime > 0 then
- timer(0, "freeimage", qa_players[r0_42].regenimg)
- end
- qa_players[r0_42].armor = 0
- qa_players[r0_42].bonus = 0
- timer(0, "qa_HUD", r0_42 .. " 1 1 0 0 1 1 0 1 1")
- timer(0, "qa_ScoreTable", r0_42 .. " 1")
- qa_players[r0_42].weapons = nil
- qa_players[r0_42].last_shot = 0
- qa_ScoreTable("0 1")
- return 1
- end
- addhook("spawn", "qa_starts")
- function qa_starts(r0_43)
- -- line: [1826, 1879] id: 43
- qa_ScoreTable(r0_43 .. " 1")
- parse("setmaxhealth " .. r0_43 .. " 200")
- parse("sethealth " .. r0_43 .. " 100")
- parse("strip " .. r0_43 .. " 50")
- if qa_players[r0_43] == nil then
- qa_players[r0_43] = {}
- end
- if qa_players[r0_43].kills == nil then
- qa_players[r0_43].kills = 0
- end
- qa_players[r0_43].weapons = {}
- qa_players[r0_43].ammo = {}
- for r4_43 = 1, 9, 1 do
- qa_players[r0_43].weapons[r4_43] = 0
- qa_players[r0_43].ammo[r4_43] = 0
- end
- qa_players[r0_43].ontrain = 0
- qa_players[r0_43].fly_controleble = 1
- qa_players[r0_43].fly_steps = 0
- qa_players[r0_43].last_shot = -10
- qa_players[r0_43].combo_shots = 0
- qa_players[r0_43].lasercolor = player(r0_43, "spraycolor")
- qa_players[r0_43].lhit = 0
- qa_players[r0_43].weapons[2] = 1
- qa_players[r0_43].weapons[1] = 1
- qa_players[r0_43].oldWeapon = 69
- qa_players[r0_43].bonus = 0
- qa_players[r0_43].quadtime = 0
- qa_players[r0_43].speedtime = 0
- qa_players[r0_43].regentime = 0
- qa_players[r0_43].invisibility = 0
- qa_players[r0_43].regeneration_dubl = 1
- qa_players[r0_43].rocketreloaded = 1
- qa_players[r0_43].laserreloaded = 1
- qa_players[r0_43].fly_dx = 0
- qa_players[r0_43].fly_dy = 0
- timer(0, "qa_HUD", r0_43 .. " 1 1 1 0 1 1")
- local r1_43 = tonumber(game("sv_gamemode"))
- if r1_43 == 0 or r1_43 == 4 then
- qa_players[r0_43].ammo[22] = 200
- qa_players[r0_43].ammo[21] = 200
- qa_players[r0_43].ammo[6] = 200
- qa_players[r0_43].ammo[5] = 200
- qa_players[r0_43].ammo[4] = 200
- qa_players[r0_43].ammo[3] = 200
- qa_players[r0_43].ammo[2] = 200
- qa_players[r0_43].ammo[1] = 200
- parse("sethealth " .. r0_43 .. " 200")
- qa_players[r0_43].armor = 200
- return "10,11,21,38,49,69,77,87,89"
- else
- qa_players[r0_43].armor = 0
- qa_players[r0_43].ammo[2] = 100
- qa_players[r0_43].ammo[1] = 1
- return "21,69"
- end
- end
- addhook("leave", "qa_leave")
- function qa_leave(r0_44)
- -- line: [1883, 1893] id: 44
- qa_players[r0_44].fly_controleble = 1
- qa_players[r0_44].total_combo = 0
- qa_players[r0_44].total_impressive = 0
- qa_players[r0_44].total_humilation = 0
- qa_players[r0_44].last_shot = 0
- qa_players[r0_44].combo_shots = 0
- qa_players[r0_44].fly_steps = 0
- qa_players[r0_44].lhit = 0
- timer(0, "qa_ScoreTable", "0 1")
- end
- qa_autoslots = {
- 69,
- 21,
- 10,
- 49,
- 77,
- 85,
- 87,
- 38,
- 11
- }
- addhook("say", "qa_sayslot")
- function qa_sayslot(r0_45, r1_45)
- -- line: [1898, 1979] id: 45
- if string.sub(r1_45, 1, 6) == "#@slot" then
- if 0 < player(r0_45, "health") and 0 < qa_players[r0_45].weapons[tonumber(string.sub(r1_45, 7, 7))] and 0 < qa_players[r0_45].ammo[tonumber(string.sub(r1_45, 7, 7))] then
- parse("setweapon " .. r0_45 .. " " .. qa_autoslots[tonumber(string.sub(r1_45, 7, 7))])
- qa_HUD(r0_45 .. " 1 1")
- end
- return 1
- elseif r1_45 == "#@WeaponHUD" then
- if player(r0_45, "health") > 0 then
- qa_HUD(r0_45 .. " 1 1")
- end
- return 1
- elseif r1_45 == "#@WeaponNEXT" then
- if player(r0_45, "health") > 0 then
- for r5_45 = 1, 9, 1 do
- if player(r0_45, "weapontype") == qa_autoslots[r5_45] then
- for r9_45 = r5_45 + 1, 10, 1 do
- if r9_45 == 10 then
- parse("setweapon " .. r0_45 .. " " .. qa_autoslots[1])
- elseif 0 < qa_players[r0_45].weapons[r9_45] and 0 < qa_players[r0_45].ammo[r9_45] then
- parse("setweapon " .. r0_45 .. " " .. qa_autoslots[r9_45])
- goto label_141
- end
- end
- break
- end
- end
- ::label_141::
- qa_HUD(r0_45 .. " 1 1")
- end
- return 1
- elseif r1_45 == "#@WeaponPREV" then
- if player(r0_45, "health") > 0 then
- for r5_45 = 1, 9, 1 do
- if player(r0_45, "weapontype") == qa_autoslots[r5_45] then
- for r9_45 = -r5_45 + 1, 0, 1 do
- if r9_45 == 0 then
- for r13_45 = -9, 1, 1 do
- if 0 < qa_players[r0_45].weapons[-r13_45] and 0 < qa_players[r0_45].ammo[-r13_45] then
- parse("setweapon " .. r0_45 .. " " .. qa_autoslots[-r13_45])
- goto label_227
- end
- end
- goto label_227
- elseif qa_players[r0_45].weapons[-r9_45] > 0 then
- parse("setweapon " .. r0_45 .. " " .. qa_autoslots[-r9_45])
- goto label_227
- end
- end
- break
- end
- end
- ::label_227::
- qa_HUD(r0_45 .. " 1 1")
- end
- return 1
- elseif r1_45 == "#@taunt" then
- if player(r0_45, "health") then
- parse("sv_sound \"taunt/sarge.wav\"")
- end
- return 1
- elseif r1_45 == "#@scoretable" then
- if not qa_end then
- qa_ScoreTable(r0_45)
- end
- return 1
- elseif r1_45 == "#@usebonus" then
- if 0 < player(r0_45, "health") and 0 < qa_players[r0_45].bonus then
- if qa_players[r0_45].bonus == 1 then
- parse("sethealth " .. r0_45 .. " " .. player(r0_45, "health") + 100)
- parse("sv_sound2 " .. r0_45 .. " \"items/health5.wav\"")
- elseif qa_players[r0_45].bonus == 2 then
- local r2_45, r3_45 = randomentity(math.random(0, 1))
- parse("setpos " .. r0_45 .. " " .. r2_45 * 32 + 16 .. " " .. r3_45 * 32 + 16)
- parse("sv_sound2 " .. r0_45 .. " \"respawn/respawn.wav\"")
- end
- qa_players[r0_45].bonus = 0
- qa_HUD(r0_45 .. " 0 0 0 0 0 0 0 0 1")
- end
- return 1
- end
- end
- addhook("objectkill", "qa_npcdrop")
- function qa_npcdrop(r0_46, r1_46)
- -- line: [1982, 1990] id: 46
- if object(r0_46, "type") == 30 and object(r0_46, "player") == 4 and tile(object(r0_46, "tilex"), object(r0_46, "tiley"), "deadly") ~= true then
- additem(0, 87, object(r0_46, "tilex"), object(r0_46, "tiley"))
- end
- end
- addhook("flagcapture", "qa_flagcapture")
- function qa_flagcapture(r0_47, r1_47, r2_47, r3_47)
- -- line: [1993, 1996] id: 47
- qa_players[r0_47].kills = qa_players[r0_47].kills + 8
- return 0
- end
- addhook("always", "qa_train_update")
- function qa_train_update()
- -- line: [1999, 2011] id: 48
- for r3_48, r4_48 in pairs(trains) do
- if r4_48.imgid ~= nil then
- for r8_48, r9_48 in pairs(player(0, "tableliving")) do
- if qa_players[r9_48].ontrain == r3_48 then
- parse("setpos " .. r9_48 .. " " .. math.floor(player(r9_48, "x")) + math.floor(object(r4_48.imgid, "x")) - r4_48.x .. " " .. math.floor(player(r9_48, "y")) + math.floor(object(r4_48.imgid, "y")) - r4_48.y)
- end
- end
- r4_48.x = math.floor(object(r4_48.imgid, "x"))
- r4_48.y = math.floor(object(r4_48.imgid, "y"))
- end
- end
- end
- function qa_train_nextpath(r0_49)
- -- line: [2013, 2021] id: 49
- r0_49 = tonumber(r0_49)
- train = trains[tonumber(r0_49)]
- train.x = math.floor(object(train.imgid, "x"))
- train.y = math.floor(object(train.imgid, "y"))
- tween_move(train.imgid, paths[train.nextpath].time, paths[train.nextpath].x, paths[train.nextpath].y)
- timer(paths[train.nextpath].time, "qa_train_nextpath", r0_49)
- train.nextpath = paths[train.nextpath].nextpath
- end
- qa_customkillstrings = {}
- function qa_customkill(r0_50)
- -- line: [2024, 2031] id: 50
- qa_customkillstrings[#qa_customkillstrings + 1] = r0_50
- timer(4000, "qa_customkill_remove")
- local r1_50 = #qa_customkillstrings
- for r5_50 = 0, 3, 1 do
- parse("hudtxt " .. 32 + r5_50 .. " " .. qa_copyright .. "255255255" .. (qa_customkillstrings[math.max(r1_50 + r5_50 - 3, r5_50 + 1)] or "") .. ";10 " .. 10 + r5_50 * 15)
- end
- end
- function qa_customkill_remove()
- -- line: [2033, 2039] id: 51
- table.remove(qa_customkillstrings, 1)
- local r0_51 = #qa_customkillstrings
- for r4_51 = 0, 3, 1 do
- parse("hudtxt " .. 32 + r4_51 .. " " .. qa_copyright .. "255255255" .. (qa_customkillstrings[math.max(r0_51 + r4_51 - 3, r4_51 + 1)] or "") .. ";10 " .. 10 + r4_51 * 15)
- end
- end
- addhook("minute", "qa_anoncer_time")
- function qa_anoncer_time(r0_52)
- -- line: [2042, 2057] id: 52
- local r1_52 = tonumber(game("mp_roundtime"))
- if r1_52 > 0 then
- rtime = rtime + 1
- if r1_52 - rtime == 5 then
- parse("sv_sound \"fun/5_MIN.wav\"")
- end
- if r1_52 - rtime == 1 then
- parse("sv_sound \"fun/1_MIN.wav\"")
- end
- if r1_52 - rtime == 0 then
- parse("sv_sound \"fun/gameend.wav\"")
- timer(0, "qa_endround")
- end
- end
- end
- addhook("join", "qa_startplay")
- function qa_startplay(r0_53)
- -- line: [2061, 2067] id: 53
- if #player(0, "table") == 2 then
- parse("sv_sound \"fun/prepare.wav\"")
- timer(1000, "parse", "sv_sound fun/321fight.wav")
- timer(5000, "parse", "restart")
- end
- end
- function qa_check_win()
- -- line: [2070, 2081] id: 54
- if player(0, "team1") == 0 then
- msg("\xa9000000255BLUE WIN!@C")
- parse("sv_sound \"fun/gameend.wav\"")
- parse("restart")
- end
- if player(0, "team2") == 0 then
- msg("\xa9255000000RED WIN!@C")
- parse("sv_sound \"fun/gameend.wav\"")
- parse("restart")
- end
- end
- addhook("team", "qa_bot_skin_name")
- function qa_bot_skin_name(r0_55)
- -- line: [2084, 2116] id: 55
- local r1_55 = player(r0_55, "look")
- local r2_55 = player(r0_55, "team")
- if player(r0_55, "bot") then
- if r2_55 == 1 then
- if r1_55 == 0 then
- parse("setname " .. r0_55 .. " Orbb")
- end
- if r1_55 == 1 then
- parse("setname " .. r0_55 .. " Bones")
- end
- if r1_55 == 2 then
- parse("setname " .. r0_55 .. " Doom")
- end
- if r1_55 == 3 then
- parse("setname " .. r0_55 .. " Sarge")
- end
- elseif r2_55 == 2 then
- if r1_55 == 0 then
- parse("setname " .. r0_55 .. " Sorlag")
- end
- if r1_55 == 1 then
- parse("setname " .. r0_55 .. " Visor")
- end
- if r1_55 == 2 then
- parse("setname " .. r0_55 .. " Gorre")
- end
- if r1_55 == 3 then
- parse("setname " .. r0_55 .. " Phobos")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement