diff --git a/bitmaps/loadpictures/donations.jpg b/bitmaps/loadpictures/manual/donations.jpg similarity index 100% rename from bitmaps/loadpictures/donations.jpg rename to bitmaps/loadpictures/manual/donations.jpg diff --git a/effects/cannons.lua b/effects/cannons.lua index 0febf95ee5f..6018187ff24 100644 --- a/effects/cannons.lua +++ b/effects/cannons.lua @@ -598,6 +598,60 @@ local definitions = { }, }, }, + ["starfire_arty"] = { + flame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + colormap = [[0.35 0.45 0.45 0.015 0.5 0.5 0.5 0.015 0.7 0.7 0.7 0.015 0 0 0 0.015]], + dir = [[dir]], + frontoffset = 0, --0.04 + fronttexture = [[glow]], --glow + length = -5, + sidetexture = [[shot]], + size = 2.2, + sizegrowth = -0.18, + ttl = 6, + --rotParams = [[0 , 0, -180 r360]], + useairlos = true, + castShadow = true, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.67, + colormap = [[0.9 0.95 0.97 0.017 0.6 0.65 0.7 0.017 0 0 0 0]], + directional = true, + emitrot = 25, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.15, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1.5, + particlespeedspread = 2.0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 0.4, + texture = [[gunshotglow]], + useairlos = true, + castShadow = true, + }, + }, + }, } diff --git a/effects/unitsmokes.lua b/effects/unitsmokes.lua index ced427ba0e4..e543489b3de 100644 --- a/effects/unitsmokes.lua +++ b/effects/unitsmokes.lua @@ -11,7 +11,7 @@ return { delay = [[0 r300]], explosiongenerator = [[custom:smokegen-part]], pos = [[-2 r4, 0 r5, -2 r4]], - --alwaysvisible = true, + alwaysvisible = false, }, }, }, @@ -43,7 +43,7 @@ return { texture = [[smoke-anim]], animParams = [[8,6,50 r50]], rotParams = [[-16 r16, -8 r8, -180 r360]], - useairlos = true, + useairlos = false, castShadow = true, }, }, @@ -93,7 +93,7 @@ return { texture = [[smoke-ice-anim]], animParams = [[8,8,60 r40]], rotParams = [[-4 r8, -6 r12, -180 r360]], - useairlos = true, + useairlos = false, castShadow = true, }, }, @@ -143,7 +143,7 @@ return { texture = [[smoke-beh-anim]], animParams = [[8,8,50 r50]], rotParams = [[-16 r16, -8 r8, -180 r360]], - useairlos = true, + useairlos = false, castShadow = true, }, }, @@ -177,7 +177,7 @@ return { sizegrowth = 0.09, sizemod = 1, texture = [[dirt]], - useairlos = true, + useairlos = false, }, }, }, @@ -207,7 +207,7 @@ return { sizegrowth = 0.08, sizemod = 1, texture = [[dirt]], - useairlos = true, + useairlos = false, }, }, fire = { @@ -235,7 +235,7 @@ return { sizegrowth = -0.05, sizemod = 0.9, texture = [[dirt]], - useairlos = true, + useairlos = false, }, }, fireglow = { @@ -263,7 +263,7 @@ return { sizegrowth = -0.5, sizemod = 1, texture = [[glow]], - useairlos = true, + useairlos = false, }, }, }, @@ -293,7 +293,7 @@ return { sizegrowth = -0.05, sizemod = 0.9, texture = [[flame]], - useairlos = true, + useairlos = false, }, }, fireglow = { @@ -321,7 +321,7 @@ return { sizegrowth = -0.5, sizemod = 1, texture = [[glow2]], - useairlos = true, + useairlos = false, }, }, }, diff --git a/gamedata/alldefs_post.lua b/gamedata/alldefs_post.lua index 5a56c7e94ba..8b5d9ae9115 100644 --- a/gamedata/alldefs_post.lua +++ b/gamedata/alldefs_post.lua @@ -239,6 +239,7 @@ function UnitDef_Post(name, uDef) if modOptions.evocom then if uDef.customparams.isevocom or uDef.customparams.iscommander then + uDef.customparams.combatradius = 0 if uDef.power then uDef.power = uDef.power/modOptions.evocomxpmultiplier else @@ -255,8 +256,13 @@ function UnitDef_Post(name, uDef) uDef.customparams.evolution_announcement_size = 18.5 uDef.customparams.evolution_target = "corcomlvl2" uDef.customparams.evolution_condition = "timer" + elseif name == "legcomlvl2" then + uDef.energymake = 50 + uDef.metalmake = 3 elseif name == "legcomlvl3" then uDef.customparams.evolution_announcement = "Legion commanders have upgraded to level 4" + uDef.energymake = 75 + uDef.metalmake = 5 elseif name == "legcomlvl4" then uDef.customparams.evolution_announcement = "Legion commanders have upgraded to level 5" uDef.customparams.evolution_announcement_size = 18.5 @@ -264,6 +270,11 @@ function UnitDef_Post(name, uDef) uDef.customparams.evolution_condition = "timer" uDef.customparams.workertimeboost = 5 uDef.customparams.wtboostunittype = "MOBILE" + uDef.energymake = 125 + uDef.metalmake = 9 + uDef.customparams.inheritxpratemultiplier = 0.5 + uDef.customparams.childreninheritxp = "DRONE BOTCANNON" + uDef.customparams.parentsinheritxp = "MOBILEBUILT DRONE BOTCANNON" end end end diff --git a/gamedata/armordefs.lua b/gamedata/armordefs.lua index a5da328bbd6..7aaf5aaaf7a 100644 --- a/gamedata/armordefs.lua +++ b/gamedata/armordefs.lua @@ -66,6 +66,7 @@ local armorDefs = { "armdrag", "armfort", "cordrag", + "legdrag", "corfort", "scavdrag", "scavfort", @@ -206,6 +207,7 @@ local armorDefs = { "cormakr", "cormart", "cormaw", + "legdtr", "cormex", "cormh", "cormist", @@ -347,6 +349,7 @@ local armorDefs = { "armamb", "armguard", "corpun", + "legcluster", "cortoast", "armanni", "cordoom", @@ -360,6 +363,7 @@ local armorDefs = { "armuwadves", "armuwadvms", "corerad", + "leglupara", "coruwadves", "coruwadvms", @@ -582,12 +586,6 @@ local armorDefs = { raptor = { - "raptor_queen_veryeasy", - "raptor_queen_easy", - "raptor_queen_normal", - "raptor_queen_hard", - "raptor_queen_veryhard", - "raptor_queen_epic", "raptor_land_swarmer_basic_t2_v1", "raptor_land_swarmer_basic_t2_v2", "raptor_land_swarmer_basic_t2_v3", @@ -638,6 +636,15 @@ local armorDefs = { "raptor_hive", "raptor_antinuke", }, + raptorqueen = + { + "raptor_queen_veryeasy", + "raptor_queen_easy", + "raptor_queen_normal", + "raptor_queen_hard", + "raptor_queen_veryhard", + "raptor_queen_epic", + }, } -- add scavenger variants diff --git a/gamedata/icontypes.lua b/gamedata/icontypes.lua index 04cff113256..c93b54678ad 100644 --- a/gamedata/icontypes.lua +++ b/gamedata/icontypes.lua @@ -2099,6 +2099,10 @@ local icontypes = { bitmap = "icons/bot_worker.png", size = 0.99749994 }, + legcluster = { + bitmap = "icons/def_t1_arty.png", + size = 1.1500000 + }, legcom = { bitmap = "icons/legcom.png", size = 1.60000002 @@ -2243,10 +2247,18 @@ local icontypes = { bitmap = "icons/factory_bot.png", size = 1.52250004 }, + legdtr = { + bitmap = "icons/wall_0.4.png", + size = 0.41999999 + }, leglob = { bitmap = "icons/bot_plasma_t1.png", size = 0.80000001 }, + leglupara = { + bitmap = "icons/aa_flak_t15.png", + size = 1.3 + }, legmed = { bitmap = "icons/corban_1.6.png", size = 1.85 diff --git a/gamedata/scavengers/unitdef_post.lua b/gamedata/scavengers/unitdef_post.lua index 6c6101d989b..38d0ff92917 100644 --- a/gamedata/scavengers/unitdef_post.lua +++ b/gamedata/scavengers/unitdef_post.lua @@ -8,13 +8,15 @@ local function scavUnitDef_Post(name, uDef) -- replaced uniticons if uDef.buildpic then + --Spring.Echo("FILEEXISTS", VFS.FileExists("unitpics/scavengers/"..uDef.buildpic)) --local nonScavName = string.sub(uDef.unitname, 1, string.len(uDef.unitname)-5) if (not string.find(uDef.buildpic, "scavengers")) and (not string.find(uDef.buildpic, "raptor")) and (not string.find(uDef.buildpic, "critters")) and (not string.find(uDef.buildpic, "lootboxes")) and (not string.find(uDef.buildpic, "other")) - and (not string.find(uDef.buildpic, "alternative")) then + and (not string.find(uDef.buildpic, "alternative")) + and (VFS.FileExists("unitpics/scavengers/"..uDef.buildpic)) then uDef.buildpic = "scavengers/"..uDef.buildpic end end @@ -82,13 +84,13 @@ local function scavUnitDef_Post(name, uDef) -- Remove wrecks of units you shouldn't be able to capture - if uDef.featuredefs and uDef.corpse and (uDef.buildoptions or (not uDef.canmove)) then - if uDef.corpse == "DEAD" and uDef.featuredefs.heap then - uDef.corpse = "HEAP" - elseif uDef.corpse then - uDef.corpse = nil - end - end + -- if uDef.featuredefs and uDef.corpse and (uDef.buildoptions or (not uDef.canmove)) then + -- if uDef.corpse == "DEAD" and uDef.featuredefs.heap then + -- uDef.corpse = "HEAP" + -- elseif uDef.corpse then + -- uDef.corpse = nil + -- end + -- end -- Set autoheal of scav units if uDef.health then @@ -124,6 +126,9 @@ local function scavUnitDef_Post(name, uDef) if uDef.builddistance then uDef.builddistance = uDef.builddistance * 2 end + if uDef.workertime then + uDef.workertime = uDef.workertime * 4 + end end end diff --git a/gamedata/unitdefs_post.lua b/gamedata/unitdefs_post.lua index 0d43f3fa160..865cc5fc117 100644 --- a/gamedata/unitdefs_post.lua +++ b/gamedata/unitdefs_post.lua @@ -3,9 +3,8 @@ VFS.Include("gamedata/alldefs_post.lua") VFS.Include("gamedata/post_save_to_customparams.lua") local system = VFS.Include("gamedata/system.lua") -local scavengersEnabled = true +local scavengersEnabled = false if Spring.GetTeamList then - scavengersEnabled = false local teamList = Spring.GetTeamList() for _, teamID in ipairs(teamList) do local luaAI = Spring.GetTeamLuaAI(teamID) @@ -14,7 +13,7 @@ if Spring.GetTeamList then end end end -if Spring.GetModOptions().ruins == "enabled" then +if Spring.GetModOptions().ruins == "enabled" or Spring.GetModOptions().forceallunits == true then scavengersEnabled = true end diff --git a/icons/aa_flak_t15.png b/icons/aa_flak_t15.png new file mode 100644 index 00000000000..f7ea718a841 Binary files /dev/null and b/icons/aa_flak_t15.png differ diff --git a/icons/def_t1_impulse.png b/icons/def_t1_impulse.png new file mode 100644 index 00000000000..5642f772a81 Binary files /dev/null and b/icons/def_t1_impulse.png differ diff --git a/icons/inverted/corthermite.png b/icons/inverted/corthermite.png new file mode 100644 index 00000000000..04006413a39 Binary files /dev/null and b/icons/inverted/corthermite.png differ diff --git a/language/de/features.json b/language/de/features.json index beee5516eb0..e89a6a658b1 100644 --- a/language/de/features.json +++ b/language/de/features.json @@ -29,9 +29,9 @@ "mushroomsPurple": "Lilane Pilze", "obelisk": "Obelisk von Seth", "peyote": "Peyote", - "pilha_crystal1": "Kleiner Kristall", - "pilha_crystal2": "Mittelgroßer Kristall", - "pilha_crystal3": "Großer Kristall", + "crystalSmall": "Kleiner Kristall ", + "crystalMedium": "Mittelgroßer Kristall", + "crystalLarge": "Großer Kristall", "pipe1.0": "Rohr 1.0", "pipe2.0": "Rohr 2.0", "pipe3.0": "Rohr 3.0", @@ -48,6 +48,9 @@ "thermalregulator": "Wärmeregler", "pthornclump": "Eine sehr trockene und spröde Pflanze", "rock": "Fels", + "rockBarren": "Kahler Felsen", + "rockMossy": "Moosiger Felsen", + "rockSnowy": "Verschneiter Felsen", "slrockcl1": "Felsformation", "statueEasterIsland": "Osterinselstatue", "streetlamp_1": "Große Straßenlaterne", diff --git a/language/en/tips.json b/language/en/tips.json index 041ba182b7e..21d78d911b4 100644 --- a/language/en/tips.json +++ b/language/en/tips.json @@ -67,10 +67,10 @@ "teamDownLastCommander": "Warning: Your team is down to its last commander.", "youHaveLastCommander": "Warning: You have the last commander.", "chooseStartLoc": "Choose your starting location", - "gameStarted": "battle started", - "battleEnded": "battle ended", - "gamePaused": "paused", - "gameUnpaused": "unpaused", + "gameStarted": "Battle started", + "battleEnded": "Battle ended", + "gamePaused": "Paused", + "gameUnpaused": "Unpaused", "playerDisconnected": "A player has disconnected", "playerAdded": "A player has been added to the game", "playerResigned": "A player has resigned", diff --git a/language/en/units.json b/language/en/units.json index 5938a8ee5d2..4a65a3fb3f4 100644 --- a/language/en/units.json +++ b/language/en/units.json @@ -675,6 +675,7 @@ "legcomt2def": "Tactical Defense Commander", "legcomt2off": "Tactical Offense Commander", "legcomt2com": "Combat Commander", + "legcluster": "Amputator", "legdrag": "Dragon's Teeth", "legdtf": "Dragon's Maw", "legdtl": "Dragon's Claw", @@ -701,7 +702,9 @@ "legkeres": "Keres", "leglht": "Pharos", "leglab": "Legion Bot Lab", + "legdtr": "Dragon's Jaw", "leglob": "Lobber", + "leglupara": "Lupara", "legmed": "Medusa", "legmex": "Metal Extractor", "legmext15": "Overcharged Metal Extractor", @@ -1451,6 +1454,7 @@ "legcib": "Drops a Juno Bomb to Remove Mines, Scouts, Radars, and Jammers", "legck": "Construction Bot", "legcv": "Construction Vehicle", + "legcluster": "Area Control Cluster Artillery", "legdrag": "Fortification", "legdtf": "Pop-up Flamethrower Turret", "legdtl": "Pop-up Lightning Turret", @@ -1476,7 +1480,9 @@ "legkeres": "Heavy Assault and Anti-Swarm Tank", "leglht": "Light Heat Ray Tower", "leglab": "Bot Lab", + "legdtr": "Pop-up Riot Cannon Turret", "leglob": "Light Plasma Bot", + "leglupara": "Bomb-Resistant Medium-Range Anti-Air Flak Battery", "legmed": "Heavy Rocket Tank", "legmex": "Extracts Slightly Reduced Metal and Produces 7 Energy", "legmext15": "Extracts Extra Metal at a High Energy Cost", diff --git a/language/ru/features.json b/language/ru/features.json new file mode 100644 index 00000000000..9f4afbd99dc --- /dev/null +++ b/language/ru/features.json @@ -0,0 +1,75 @@ +{ + "features": { + "names": { + "armstone": "Надгробие Командира", + "corstone": "Надгробие Командира", + "ancientRocks": "Древняя горная порода", + "bush": "Куст", + "bushSmall": "Кустик", + "bushMedium": "Кустарник", + "bushLarge": "Большой кустарник", + "bushLarger": "Огромный кустарник", + "cactusSanPedro": "Сан-Педро", + "candycane": "Мятная палочка", + "raptor_egg": "Яйцо", + "crystalSapphire": "Сапфировый кристалл", + "crystals": "Кристалл", + "energySpire": "Энергетический шпиль", + "fern_big": "Большой папоротник", + "fern": "Папоротник", + "ferns": "Папоротники", + "fernStone": "Папоротники и камень", + "fernStones": "Папоротники и камни", + "geocrack": "Геотермальный разлом", + "geovent": "Геотермальный источник", + "heap": "Обломки", + "metal": "Содержит металл", + "mushroomsOrange": "Оранжевые грибы", + "mushroomsTan": "Смуглые грибы", + "mushroomsPurple": "Фиолетовые грибы", + "obelisk": "Обелиск Сета", + "peyote": "Кактус", + "crystalSmall": "Маленький кристалл", + "crystalMedium": "Кристалл", + "crystalLarge": "Большой кристалл", + "pipe1.0": "Труба 1.0", + "pipe2.0": "Труба 2.0", + "pipe3.0": "Труба 3.0", + "pipe4.0": "Труба 4.0", + "pipe5.0": "Труба 5.0", + "pipe6.0": "Труба 6.0", + "pipeline": "Трубопровод", + "powerhouse": "Электростанция", + "industrial_structure_pipes_1": "Строительные трубы", + "pressurevalve": "Клапан давления", + "radardish_1": "Спутниковая тарелка", + "regulatorcomplex": "Регуляторный комплекс", + "seismicmonitor": "Сейсмический датчик", + "thermalregulator": "Терморегулятор", + "pthornclump": "Очень сухое и ломкое растение", + "rock": "Камень", + "rockBarren": "Пустынный Камень", + "rockMossy": "Замшелый Камень", + "rockSnowy": "Заснеженный Камень", + "slrockcl1": "Груда камней", + "statueEasterIsland": "Моаи", + "streetlamp_1": "Большой уличный фонарь", + "tree": "Дерево", + "smothtree123dead": "Ствол дерева", + "smothdeadtree1": "Мертвое дерево", + "crystaltree1": "Хрустальное дерево", + "treeAleppoPine": "Алеппская сосна", + "treeBanyan": "Баньян", + "treeBaobab": "Баобаб", + "treeCedar": "Кедровое дерево", + "treeDeciduous": "Лиственное дерево", + "treeFir": "Ель", + "treePalm": "Пальма", + "treePalms": "Пальмы", + "treeDeadPalms": "Мертвые пальмы", + "treePalmetto": "Сереноя", + "treePine": "Сосна", + "xmascomwreck": "Рождественские останки Командира" + } + } +} diff --git a/luaintro/Addons/main.lua b/luaintro/Addons/main.lua index 5284dc136dc..9ae82f6580f 100644 --- a/luaintro/Addons/main.lua +++ b/luaintro/Addons/main.lua @@ -12,13 +12,7 @@ if addon.InGetInfo then end local loadscreens = VFS.DirList("bitmaps/loadpictures/") -local backgroundTexture = loadscreens[1+(math.floor((1000*os.clock())%#loadscreens))] -- hacky hotfix for http://springrts.com/mantis/view.php?id=4572 -if not VFS.FileExists(backgroundTexture) then -- because encountering white loadscreens once in a while (this is not a real fix ofc) - backgroundTexture = loadscreens[1+(math.floor((1000*os.clock())%#loadscreens))] -- hacky hotfix for http://springrts.com/mantis/view.php?id=4572 -end -if not backgroundTexture then - backgroundTexture = loadscreens[1] -end +local backgroundTexture = loadscreens[math.random(#loadscreens)] local showTips = (Spring.GetConfigInt("loadscreen_tips",1) == 1) if string.find(backgroundTexture, "guide") then @@ -130,7 +124,9 @@ if showTips then local index = math.random(#tipKeys) randomTip = Spring.I18N('tips.loadscreen.' .. tipKeys[index]) end -if string.find(backgroundTexture, "donations") then + +if math.random(1,8) == 1 then + backgroundTexture = "bitmaps/loadpictures/manual/donations.jpg" randomTip = Spring.I18N('tips.loadscreen.donations') end diff --git a/luarules/configs/scav_spawn_defs.lua b/luarules/configs/scav_spawn_defs.lua index 3f56b2a6559..dfc7cbf8330 100644 --- a/luarules/configs/scav_spawn_defs.lua +++ b/luarules/configs/scav_spawn_defs.lua @@ -701,6 +701,7 @@ local AirUnitsList = { ["corape_scav"] = 1, ["corhurc_scav"] = 1, ["corcrw_scav"] = 1, + ["corcrwh_scav"] = 1, --Legion ["legnap_scav"] = 1, ["legmineb_scav"] = 1, @@ -1169,7 +1170,7 @@ addNewSquad({ type = "basicLand", minAnger = 40, units = { "3 armmart_scav","1 a addNewSquad({ type = "airLand", minAnger = 40, units = { "3 armawac_scav","3 corawac_scav",}, weight = 4, maxAnger = 50}) --T2 Air Scouts addNewSquad({ type = "airLand", minAnger = 40, units = { "2 armstil_scav",}, weight = 4, maxAnger = 50}) --EMP Bombers addNewSquad({ type = "airLand", minAnger = 50, units = { "20 armhawk_scav","20 corvamp_scav",}, weight = 4, maxAnger = 60}) --Fighters -addNewSquad({ type = "airLand", minAnger = 50, units = { "1 armblade_scav","15 armbrawl_scav","1 legfort_scav","1 corcrw_scav","15 corape_scav"}, weight = 4, maxAnger = 60}) --T2 Gunships +addNewSquad({ type = "airLand", minAnger = 50, units = { "1 armblade_scav","15 armbrawl_scav","1 legfort_scav","1 corcrw_scav", "1 corcrwh_scav","15 corape_scav"}, weight = 4, maxAnger = 60}) --T2 Gunships ------Tier 3 60-80% --Dilluters addNewSquad({ type = "basicLand", minAnger = 60, units = { "15 armfav_scav","15 corfav_scav",}, weight = 8, maxAnger = 1000}) --Rover Whole Tier Length @@ -1181,49 +1182,49 @@ addNewSquad({ type = "basicLand", minAnger = 60, units = { "6 corshiva_scav","2 addNewSquad({ type = "basicLand", minAnger = 70, units = { "2 armvang_scav","2 corcat_scav","1 armyork_scav","1 corsent_scav",}, weight = 4, maxAnger = 1000}) --T3 Arty/AA --AirLand addNewSquad({ type = "airLand", minAnger = 65, units = { "40 armfig_scav","40 corveng_scav",}, weight = 4, maxAnger = 1000}) --T2 Fighters -addNewSquad({ type = "airLand", minAnger = 65, units = { "1 armblade_scav","15 armbrawl_scav","1 legfort_scav","1 corcrw_scav","15 corape_scav"}, weight = 2, maxAnger = 100}) --T2 Gunships +addNewSquad({ type = "airLand", minAnger = 65, units = { "1 armblade_scav","15 armbrawl_scav","1 legfort_scav","1 corcrw_scav", "1 corcrwh_scav","15 corape_scav"}, weight = 2, maxAnger = 100}) --T2 Gunships -- evocoms -addNewSquad({ type = "specialLand", minAnger = 10, units = { "1 armcom_scav",}, weight = 1, maxAnger = 50}) -addNewSquad({ type = "specialLand", minAnger = 10, units = { "1 corcom_scav",}, weight = 1, maxAnger = 50}) -addNewSquad({ type = "specialLand", minAnger = 10, units = { "1 legcom_scav",}, weight = 1, maxAnger = 50}) +addNewSquad({ type = "specialLand", minAnger = 0, units = { "2 armcom_scav",}, weight = 1, maxAnger = 20}) +addNewSquad({ type = "specialLand", minAnger = 0, units = { "2 corcom_scav",}, weight = 1, maxAnger = 20}) +addNewSquad({ type = "specialLand", minAnger = 0, units = { "2 legcom_scav",}, weight = 1, maxAnger = 20}) -addNewSquad({ type = "specialLand", minAnger = 20, units = { "1 armcomlvl2_scav",}, weight = 1, maxAnger = 60}) -addNewSquad({ type = "specialLand", minAnger = 20, units = { "1 corcomlvl2_scav",}, weight = 1, maxAnger = 60}) -addNewSquad({ type = "specialLand", minAnger = 20, units = { "1 legcomlvl2_scav",}, weight = 1, maxAnger = 60}) +addNewSquad({ type = "specialLand", minAnger = 10, units = { "2 armcomlvl2_scav",}, weight = 1, maxAnger = 30}) +addNewSquad({ type = "specialLand", minAnger = 10, units = { "2 corcomlvl2_scav",}, weight = 1, maxAnger = 30}) +addNewSquad({ type = "specialLand", minAnger = 10, units = { "2 legcomlvl2_scav",}, weight = 1, maxAnger = 30}) -addNewSquad({ type = "specialLand", minAnger = 30, units = { "1 armcomlvl3_scav",}, weight = 1, maxAnger = 70}) -addNewSquad({ type = "specialLand", minAnger = 30, units = { "1 corcomlvl3_scav",}, weight = 1, maxAnger = 70}) -addNewSquad({ type = "specialLand", minAnger = 30, units = { "1 legcomlvl3_scav",}, weight = 1, maxAnger = 70}) +addNewSquad({ type = "specialLand", minAnger = 20, units = { "2 armcomlvl3_scav",}, weight = 1, maxAnger = 40}) +addNewSquad({ type = "specialLand", minAnger = 20, units = { "2 corcomlvl3_scav",}, weight = 1, maxAnger = 40}) +addNewSquad({ type = "specialLand", minAnger = 20, units = { "2 legcomlvl3_scav",}, weight = 1, maxAnger = 40}) -addNewSquad({ type = "specialLand", minAnger = 40, units = { "1 armcomlvl4_scav",}, weight = 1, maxAnger = 80}) -addNewSquad({ type = "specialLand", minAnger = 40, units = { "1 corcomlvl4_scav",}, weight = 1, maxAnger = 80}) -addNewSquad({ type = "specialLand", minAnger = 40, units = { "1 legcomlvl4_scav",}, weight = 1, maxAnger = 80}) +addNewSquad({ type = "specialLand", minAnger = 30, units = { "2 armcomlvl4_scav",}, weight = 1, maxAnger = 50}) +addNewSquad({ type = "specialLand", minAnger = 30, units = { "2 corcomlvl4_scav",}, weight = 1, maxAnger = 50}) +addNewSquad({ type = "specialLand", minAnger = 30, units = { "2 legcomlvl4_scav",}, weight = 1, maxAnger = 50}) -addNewSquad({ type = "specialLand", minAnger = 50, units = { "1 armcomlvl5_scav",}, weight = 1, maxAnger = 90}) -addNewSquad({ type = "specialLand", minAnger = 50, units = { "1 corcomlvl5_scav",}, weight = 1, maxAnger = 90}) -addNewSquad({ type = "specialLand", minAnger = 50, units = { "1 legcomlvl5_scav",}, weight = 1, maxAnger = 90}) +addNewSquad({ type = "specialLand", minAnger = 40, units = { "2 armcomlvl5_scav",}, weight = 1, maxAnger = 60}) +addNewSquad({ type = "specialLand", minAnger = 40, units = { "2 corcomlvl5_scav",}, weight = 1, maxAnger = 60}) +addNewSquad({ type = "specialLand", minAnger = 40, units = { "2 legcomlvl5_scav",}, weight = 1, maxAnger = 60}) -addNewSquad({ type = "specialLand", minAnger = 60, units = { "1 armcomlvl6_scav",}, weight = 1, maxAnger = 100}) -addNewSquad({ type = "specialLand", minAnger = 60, units = { "1 corcomlvl6_scav",}, weight = 1, maxAnger = 100}) -addNewSquad({ type = "specialLand", minAnger = 60, units = { "1 legcomlvl6_scav",}, weight = 1, maxAnger = 100}) +addNewSquad({ type = "specialLand", minAnger = 50, units = { "2 armcomlvl6_scav",}, weight = 1, maxAnger = 70}) +addNewSquad({ type = "specialLand", minAnger = 50, units = { "2 corcomlvl6_scav",}, weight = 1, maxAnger = 70}) +addNewSquad({ type = "specialLand", minAnger = 50, units = { "2 legcomlvl6_scav",}, weight = 1, maxAnger = 70}) -addNewSquad({ type = "specialLand", minAnger = 70, units = { "1 armcomlvl7_scav",}, weight = 1, maxAnger = 110}) -addNewSquad({ type = "specialLand", minAnger = 70, units = { "1 corcomlvl7_scav",}, weight = 1, maxAnger = 110}) -addNewSquad({ type = "specialLand", minAnger = 70, units = { "1 legcomlvl7_scav",}, weight = 1, maxAnger = 110}) +addNewSquad({ type = "specialLand", minAnger = 60, units = { "2 armcomlvl7_scav",}, weight = 1, maxAnger = 80}) +addNewSquad({ type = "specialLand", minAnger = 60, units = { "2 corcomlvl7_scav",}, weight = 1, maxAnger = 80}) +addNewSquad({ type = "specialLand", minAnger = 60, units = { "2 legcomlvl7_scav",}, weight = 1, maxAnger = 80}) -addNewSquad({ type = "specialLand", minAnger = 80, units = { "1 armcomlvl8_scav",}, weight = 1, maxAnger = 120}) -addNewSquad({ type = "specialLand", minAnger = 80, units = { "1 corcomlvl8_scav",}, weight = 1, maxAnger = 120}) -addNewSquad({ type = "specialLand", minAnger = 80, units = { "1 legcomlvl8_scav",}, weight = 1, maxAnger = 120}) +addNewSquad({ type = "specialLand", minAnger = 70, units = { "2 armcomlvl8_scav",}, weight = 1, maxAnger = 90}) +addNewSquad({ type = "specialLand", minAnger = 70, units = { "2 corcomlvl8_scav",}, weight = 1, maxAnger = 90}) +addNewSquad({ type = "specialLand", minAnger = 70, units = { "2 legcomlvl8_scav",}, weight = 1, maxAnger = 90}) -addNewSquad({ type = "specialLand", minAnger = 90, units = { "1 armcomlvl9_scav",}, weight = 1, maxAnger = 130}) -addNewSquad({ type = "specialLand", minAnger = 90, units = { "1 corcomlvl9_scav",}, weight = 1, maxAnger = 130}) -addNewSquad({ type = "specialLand", minAnger = 90, units = { "1 legcomlvl9_scav",}, weight = 1, maxAnger = 130}) +addNewSquad({ type = "specialLand", minAnger = 80, units = { "2 armcomlvl9_scav",}, weight = 1, maxAnger = 100}) +addNewSquad({ type = "specialLand", minAnger = 80, units = { "2 corcomlvl9_scav",}, weight = 1, maxAnger = 100}) +addNewSquad({ type = "specialLand", minAnger = 80, units = { "2 legcomlvl9_scav",}, weight = 1, maxAnger = 100}) -addNewSquad({ type = "specialLand", minAnger = 100, units = { "1 armcomlvl10_scav",}, weight = 1, maxAnger = 1000}) -addNewSquad({ type = "specialLand", minAnger = 100, units = { "1 corcomlvl10_scav",}, weight = 1, maxAnger = 1000}) -addNewSquad({ type = "specialLand", minAnger = 100, units = { "1 legcomlvl10_scav",}, weight = 1, maxAnger = 1000}) +addNewSquad({ type = "specialLand", minAnger = 90, units = { "2 armcomlvl10_scav",}, weight = 1, maxAnger = 1000}) +addNewSquad({ type = "specialLand", minAnger = 90, units = { "2 corcomlvl10_scav",}, weight = 1, maxAnger = 1000}) +addNewSquad({ type = "specialLand", minAnger = 90, units = { "2 legcomlvl10_scav",}, weight = 1, maxAnger = 1000}) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Settings -- Adjust these ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/luarules/gadgets/gfx_raptor_scum_gl4.lua b/luarules/gadgets/gfx_raptor_scum_gl4.lua index e5554808e28..7135262fe7c 100644 --- a/luarules/gadgets/gfx_raptor_scum_gl4.lua +++ b/luarules/gadgets/gfx_raptor_scum_gl4.lua @@ -19,6 +19,25 @@ end if gadgetHandler:IsSyncedCode() then + local scavengerAITeamID = 999 + local raptorsAITeamID = 999 + + local teams = Spring.GetTeamList() + for i = 1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == 'ScavengersAI' then + scavengerAITeamID = i - 1 + break + end + end + for i = 1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == 'RaptorsAI' then + raptorsAITeamID = i - 1 + break + end + end + local scumSpawnerIDs = {} @@ -217,8 +236,8 @@ if gadgetHandler:IsSyncedCode() then return scumID end - function gadget:UnitCreated(unitID, unitDefID) - if scumSpawnerIDs[unitDefID] then + function gadget:UnitCreated(unitID, unitDefID, unitTeam) + if scumSpawnerIDs[unitDefID] and (unitTeam == scavengerAITeamID or unitTeam == raptorsAITeamID) then local px, py, pz = Spring.GetUnitPosition(unitID) local gf = Spring.GetGameFrame() diff --git a/luarules/gadgets/pve_areahealers.lua b/luarules/gadgets/pve_areahealers.lua index fb8b54ccaf8..c984f927f22 100644 --- a/luarules/gadgets/pve_areahealers.lua +++ b/luarules/gadgets/pve_areahealers.lua @@ -24,38 +24,42 @@ else end local aliveHealers = {} -local healersTable = { - [UnitDefNames["raptor_land_swarmer_heal_t1_v1"].id] = { - healingpower = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].repairSpeed, - healingrange = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].buildDistance*2, - canbehealed = false, - }, - [UnitDefNames["raptor_land_swarmer_heal_t2_v1"].id] = { - healingpower = UnitDefNames["raptor_land_swarmer_heal_t2_v1"].repairSpeed, - healingrange = UnitDefNames["raptor_land_swarmer_heal_t2_v1"].buildDistance*2, - canbehealed = false, - }, - [UnitDefNames["raptor_land_swarmer_heal_t3_v1"].id] = { - healingpower = UnitDefNames["raptor_land_swarmer_heal_t3_v1"].repairSpeed, - healingrange = UnitDefNames["raptor_land_swarmer_heal_t3_v1"].buildDistance*2, - canbehealed = false, - }, - [UnitDefNames["raptor_land_swarmer_heal_t4_v1"].id] = { - healingpower = UnitDefNames["raptor_land_swarmer_heal_t4_v1"].repairSpeed, - healingrange = UnitDefNames["raptor_land_swarmer_heal_t4_v1"].buildDistance*2, - canbehealed = false, - }, - [UnitDefNames["raptor_matriarch_healer"].id] = { - healingpower = UnitDefNames["raptor_matriarch_healer"].repairSpeed, - healingrange = UnitDefNames["raptor_matriarch_healer"].buildDistance*2, - canbehealed = false, - }, -} +local healersTable = {} +if Spring.Utilities.Gametype.IsRaptors() then + local healersTableRaptors = { + [UnitDefNames["raptor_land_swarmer_heal_t1_v1"].id] = { + healingpower = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].repairSpeed, + healingrange = UnitDefNames["raptor_land_swarmer_heal_t1_v1"].buildDistance*2, + canbehealed = false, + }, + [UnitDefNames["raptor_land_swarmer_heal_t2_v1"].id] = { + healingpower = UnitDefNames["raptor_land_swarmer_heal_t2_v1"].repairSpeed, + healingrange = UnitDefNames["raptor_land_swarmer_heal_t2_v1"].buildDistance*2, + canbehealed = false, + }, + [UnitDefNames["raptor_land_swarmer_heal_t3_v1"].id] = { + healingpower = UnitDefNames["raptor_land_swarmer_heal_t3_v1"].repairSpeed, + healingrange = UnitDefNames["raptor_land_swarmer_heal_t3_v1"].buildDistance*2, + canbehealed = false, + }, + [UnitDefNames["raptor_land_swarmer_heal_t4_v1"].id] = { + healingpower = UnitDefNames["raptor_land_swarmer_heal_t4_v1"].repairSpeed, + healingrange = UnitDefNames["raptor_land_swarmer_heal_t4_v1"].buildDistance*2, + canbehealed = false, + }, + [UnitDefNames["raptor_matriarch_healer"].id] = { + healingpower = UnitDefNames["raptor_matriarch_healer"].repairSpeed, + healingrange = UnitDefNames["raptor_matriarch_healer"].buildDistance*2, + canbehealed = false, + }, + } + table.append(healersTable, healersTableRaptors) +end for unitDefID, unitDef in pairs(UnitDefs) do if unitDef.customParams.isscavenger and unitDef.canRepair and unitDef.repairSpeed and unitDef.buildDistance then healersTable[unitDefID] = { - healingpower = unitDef.repairSpeed, + healingpower = unitDef.repairSpeed*0.1, healingrange = unitDef.buildDistance*2, canbehealed = true, } diff --git a/luarules/gadgets/pve_builder_controller.lua b/luarules/gadgets/pve_builder_controller.lua new file mode 100644 index 00000000000..8d2b5da59cb --- /dev/null +++ b/luarules/gadgets/pve_builder_controller.lua @@ -0,0 +1,96 @@ +function gadget:GetInfo() + return { + name = "PvE Builder Controller", + desc = "Gives extra orders to scav and raptor builders", + author = "Damgam", + date = "2024", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true + } +end + +if not gadgetHandler:IsSyncedCode() then + return +end + +if Spring.Utilities.Gametype.IsRaptors() then + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Raptor Defense Spawner Activated!") +elseif Spring.Utilities.Gametype.IsScavengers() then + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Scav Defense Spawner Activated!") +else + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Defense Spawner Deactivated!") + return false +end + +local scavengerAITeamID = 999 +--local raptorsAITeamID = 999 + +local teams = Spring.GetTeamList() +for i = 1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == 'ScavengersAI' then + scavengerAITeamID = i - 1 + break + end +end +--for i = 1, #teams do +-- local luaAI = Spring.GetTeamLuaAI(teams[i]) +-- if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == 'RaptorsAI' then +-- raptorsAITeamID = i - 1 +-- break +-- end +--end + +local builderDefs = {} +for unitDefID, data in pairs(UnitDefs) do + if data.buildOptions and #data.buildOptions > 0 then + builderDefs[unitDefID] = { + range = data.builddistance or 256, + buildOptions = data.buildOptions, + unitDefID = unitDefID, + unitDefName = data.name, + } + end +end + +local aliveBuilders = {} + +function gadget:UnitCreated(unitID, unitDefID, unitTeam) + --if builderDefs[unitDefID] and (unitTeam == scavengerAITeamID or unitTeam == raptorsAITeamID) then + if builderDefs[unitDefID] and (unitTeam == scavengerAITeamID) then + aliveBuilders[unitID] = builderDefs[unitDefID] + end +end + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID) + if aliveBuilders[unitID] then + aliveBuilders[unitID] = nil + end +end + +function gadget:GameFrame(frame) + if frame%30 == 9 then + for unitID, data in pairs(aliveBuilders) do + if Spring.GetUnitNearestEnemy(unitID, data.range*5, true) and math.random(0,30) == 0 then + --Spring.Echo(data.unitDefName, "NearestEnemyInRange") + if (Spring.GetUnitCommands(unitID, -1)[1] and Spring.GetUnitCommands(unitID, -1)[1].id > 0 and Spring.GetUnitCommands(unitID, -1)[1].id ~= CMD.REPAIR) or not (Spring.GetUnitCommands(unitID, -1)[1]) then + --Spring.Echo(data.unitDefName, "Isn't building anything") + local turretOptions = {} + for buildOptionIndex, buildOptionID in pairs(data.buildOptions) do + --Spring.Echo("buildOptionID", buildOptionID, UnitDefs[buildOptionID].name) + if buildOptionID and UnitDefs[buildOptionID].weapons and #UnitDefs[buildOptionID].weapons > 0 then + turretOptions[#turretOptions+1] = buildOptionID + --Spring.Echo(data.unitDefName, UnitDefs[buildOptionID].name, "Is a turret") + end + end + if #turretOptions > 1 then + local turret = turretOptions[math.random(1, #turretOptions)] + local x,y,z = Spring.GetUnitPosition(unitID) + Spring.GiveOrderToUnit(unitID, -turret, {x+math.random(-data.range, data.range), y, z+math.random(-data.range, data.range)}, {}) + end + end + end + end + end +end \ No newline at end of file diff --git a/luarules/gadgets/pve_nuke_controller.lua b/luarules/gadgets/pve_nuke_controller.lua index 5c97ff85b86..cf5dc416a84 100644 --- a/luarules/gadgets/pve_nuke_controller.lua +++ b/luarules/gadgets/pve_nuke_controller.lua @@ -23,6 +23,25 @@ else return false end +local scavengerAITeamID = 999 +local raptorsAITeamID = 999 + +local teams = Spring.GetTeamList() +for i = 1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == 'ScavengersAI' then + scavengerAITeamID = i - 1 + break + end +end +for i = 1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == 'RaptorsAI' then + raptorsAITeamID = i - 1 + break + end +end + local nukeDefs = {} for _, unitDefName in ipairs({"raptor_turret_meteor_t4_v1", "corsilo_scav", "armsilo_scav","corjuno_scav", "armjuno_scav"}) do if UnitDefNames[unitDefName] then @@ -33,7 +52,7 @@ end local aliveNukeLaunchers = {} function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if nukeDefs[unitDefID] then + if nukeDefs[unitDefID] and (unitTeam == scavengerAITeamID or unitTeam == raptorsAITeamID) then aliveNukeLaunchers[unitID] = Spring.GetGameSeconds() + math.random(5,10) end end @@ -52,6 +71,7 @@ local difficulties = { veryhard = 600, epic = 500, } + local gridSize = difficulties[Spring.GetModOptions().raptor_difficulty] local mapSizeX = Game.mapSizeX local mapSizeZ = Game.mapSizeZ diff --git a/luarules/gadgets/unit_custom_weapons_cluster.lua b/luarules/gadgets/unit_custom_weapons_cluster.lua new file mode 100644 index 00000000000..1f57e2f6978 --- /dev/null +++ b/luarules/gadgets/unit_custom_weapons_cluster.lua @@ -0,0 +1,325 @@ +function gadget:GetInfo() + return { + name = 'Cluster Munitions', + desc = 'Custom behavior for projectiles that explode and split on impact.', + author = 'efrec', + version = '1.0', + date = '2024-05', + license = 'GNU GPL, v2 or later', + layer = 0, + enabled = true + } +end + +if not gadgetHandler:IsSyncedCode() then return false end + +-------------------------------------------------------------------------------------------------------------- +-- Configuration --------------------------------------------------------------------------------------------- + +-- Default settings ----------------------------------------------------------------------------------------- + +local defaultSpawnDef = "cluster_munition" -- def used, by default +local defaultSpawnNum = 5 -- number of spawned projectiles, by default +local defaultTtl = 300 -- detonate projectiles after time = ttl, by default +local defaultVelocity = 240 -- speed of spawned projectiles, by default +local defaultBouncing = false -- whether sub-munitions 'bounce' off of units, by default + +-- General settings ------------------------------------------------------------------------------------------ + +local customParamName = "cluster" -- in the weapondef, the parameter name to set to `true` +local maxSplitNumber = 20 -- protect game performance against stupid ideas +local minBulkReflect = 80000 -- smallest unit bulk that causes reflection as if terrain + +-- CustomParams setup --------------------------------------------------------------------------------------- + +-- primary_weapon = { +-- customparams = { +-- cluster = true, +-- [def = ,] +-- [number = ,] +-- [bouncing = true | false,] +-- }, +-- }, +-- cluster_munition = { +-- [maxvelocity = ,] +-- [range = ,] +-- } + +-------------------------------------------------------------------------------------------------------------- +-- Localize -------------------------------------------------------------------------------------------------- + +local abs = math.abs +local sign = math.sgn +local max = math.max +local min = math.min +local rand = math.random +local sqrt = math.sqrt +local cos = math.cos +local sin = math.sin + +local spGetGroundHeight = Spring.GetGroundHeight +local spGetGroundNormal = Spring.GetGroundNormal +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitRadius = Spring.GetUnitRadius +local spGetUnitsInSphere = Spring.GetUnitsInSphere +local spSpawnProjectile = Spring.SpawnProjectile + +local GAME_SPEED = Game.gameSpeed +local mapGravity = Game.gravity / GAME_SPEED / GAME_SPEED * -1 + +local SetWatchExplosion = Script.SetWatchExplosion + +-------------------------------------------------------------------------------------------------------------- +-- Initialize ------------------------------------------------------------------------------------------------ + +-- Reusable tables for reducing garbage + +local weaponCache = { + explVel = 0, + explAoe = 0, + def = defaultSpawnDef, + number = defaultSpawnNum, + projDef = 0, + projVel = defaultVelocity / GAME_SPEED, + projTtl = defaultTtl, + check = 0 +} + +local spawnCache = { + pos = { 0, 0, 0 }, + speed = { 0, 0, 0 }, + owner = 0, + ttl = defaultTtl, + gravity = mapGravity, +} + +-- Information table for cluster weapons + +local spawnableTypes = { + Cannon = true , + EMGCannon = true , + Fire = false , -- but possible + LightningCannon = false , -- but possible + MissileLauncher = false , -- but possible +} + +local dataTable = {} -- Info on each cluster weapon. +local wDefNamesToIDs = {} -- Says it on the tin + +for wdid, wdef in pairs(WeaponDefs) do + wDefNamesToIDs[wdef.name] = wdid + + if wdef.customParams and wdef.customParams[customParamName] then + dataTable[wdid] = {} + dataTable[wdid].explAoe = wdef.damageAreaOfEffect or 12 + dataTable[wdid].explVel = wdef.explosionSpeed or (8 + max(30, wdef.damages[0] / 20)) / (9 + sqrt(max(30, wdef.damages[0] / 20)) * 0.7) * 0.5 + dataTable[wdid].bouncing = wdef.customParams.bouncing or defaultBouncing + dataTable[wdid].number = tonumber(wdef.customParams.number) or defaultSpawnNum + dataTable[wdid].def = wdef.customParams.def or (string.split(wdef.name, "_"))[1] .. '_' .. defaultSpawnDef + + dataTable[wdid].projDef = -1 + dataTable[wdid].projTtl = defaultTtl + dataTable[wdid].projVel = defaultVelocity / GAME_SPEED + dataTable[wdid].colDist = max(12, sqrt(dataTable[wdid].explAoe)) + end +end + +-- Information for cluster munitions + +for wdid, data in pairs(dataTable) do + local cmdid = wDefNamesToIDs[data.def] + local cmdef = WeaponDefs[cmdid] + + dataTable[wdid].projDef = cmdid + dataTable[wdid].projTtl = cmdef.ttl or defaultTtl + + -- Range and velocity are closely related so may be in disagreement. Average them (more or less): + local projVel = cmdef.projectileSpeed or cmdef.startvelocity + projVel = projVel and projVel * GAME_SPEED or defaultVelocity + if cmdef.range > 10 then + local rangeVel = sqrt(cmdef.range * abs(mapGravity)) -- inverse range calc for launch @ 45deg + dataTable[wdid].projVel = (projVel + rangeVel) / 2 + else + dataTable[wdid].projVel = projVel + end + + -- We check for collisions within a radius: + dataTable[wdid].colDist = max(dataTable[wdid].colDist, dataTable[wdid].projVel / 120) + + -- Prevent the grenade apocalypse: + if dataTable[cmdid] ~= nil then + Spring.Echo('[clustermun] [warn] Preventing recursive explosions: ' .. cmdid) + dataTable[cmdid] = nil + end + + -- Remove unspawnable projectiles: + if spawnableTypes[cmdef.type] ~= true then + Spring.Echo('[clustermun] [warn] Invalid spawned weapon type: ' .. + dataTable[wdid].def .. ' is not spawnable (' .. (cmdef.type or 'nil!') .. ')') + dataTable[wdid] = nil + end +end + +-- Information on how sturdy units are, basically + +local unitBulk = {} +for udid, udef in pairs(UnitDefs) do + unitBulk[udid] = min( + ( sqrt(udef.health) + + sqrt(udef.metalCost) * udef.xsize * udef.zsize * sqrt(udef.radius) + ) / minBulkReflect, + 1.0 + ) +end + +-------------------------------------------------------------------------------------------------------------- +-- Functions ------------------------------------------------------------------------------------------------- + +local function RandomVector3() + local m1, m2, m3, m4 -- Marsaglia procedure: + repeat -- The method begins by sampling & rejecting points. + m1 = 2 * rand() - 1 -- The result can be transformed into radial coords. + m2 = 2 * rand() - 1 -- Rand floats are expensive, though. Might replace. + m3 = m1 * m1 + m2 * m2 + until (m3 < 1) + m4 = sqrt(1 - m3) + return 2 * m1 * m4 , -- x + 2 * m2 * m4 , -- y + 1 - 2 * m3 -- z +end + +-- Randomness produces clumping at small sample sizes, so we scatter evenly-spaced vectors instead. +-- Credit to Hardin, Sloane, & Smith (and contribs). +local packedSpheres = { + [1] = 0, + [2] = { 1, 0, 0, -1, 0, 0 }, + [3] = { 1, 0, 0, -0.5, 0, 0.866025403784439, -0.5, 0, -0.866025403784438 }, + [4] = { -0.577350269072, 0.577350269072, -0.577350269072, 0.577350269072, 0.577350269072, 0.577350269072, -0.577350269072, -0.577350269072, 0.577350269072, 0.577350269072, -0.577350269072, -0.577350269072 }, + [5] = { -1.478255937088018300e-01, 8.557801392177640800e-01, 4.957700547280610200e-01, 9.298520676823500700e-01, -3.330452755499895800e-01, -1.563840677968503200e-01, -7.820264758448114400e-01, -5.227348665222011400e-01, -3.393859902820995400e-01, -3.612306945786420600e-02, -5.056147808319168000e-01, 8.620027942282061400e-01, 3.612306958303366400e-02, 5.056147801034870400e-01, -8.620027946502272200e-01 }, + [6] = { 0.212548255920, -0.977150570601, 0.000000000000, -0.977150570601, -0.212548255920, 0.000000000000, -0.212548255920, 0.977150570601, 0.000000000000, 0.977150570601, 0.212548255920, 0.000000000000, 0.000000000000, 0.000000000000, 1.000000000000, 0.000000000000, 0.000000000000, -1.000000000000 }, + [7] = { -9.476914051796328000e-01, -2.052179514558175300e-01, 2.444720698749264500e-01, 8.503710682661692600e-01, 4.830848344829018500e-01, 2.085619547004717300e-01, -4.995609516538522300e-01, 3.276811928816584800e-01, -8.019126457503652500e-01, -3.344875986220292000e-01, 8.899589445240678700e-01, 3.099856826204648300e-01, 2.420381484495352800e-02, -9.924430055046316000e-01, 1.202957030483007100e-01, 5.426485704335360500e-02, -8.987314180840469400e-02, 9.944738024058507000e-01, 5.948684088498340500e-01, -2.881863468134767100e-01, -7.503867040818149600e-01 }, + [8] = { -7.941044876934105800e-01, 3.289288487526511000e-01, 5.110810846464987100e-01, 3.289288487526511000e-01, -7.941044876934105800e-01, -5.110810846464987100e-01, 7.941044876934105800e-01, 3.289288487526511000e-01, -5.110810846464987100e-01, -3.289288487526511000e-01, -7.941044876934105800e-01, 5.110810846464987100e-01, -7.941044876934105800e-01, -3.289288487526511000e-01, -5.110810846464987100e-01, 3.289288487526511000e-01, 7.941044876934105800e-01, 5.110810846464987100e-01, 7.941044876934105800e-01, -3.289288487526511000e-01, 5.110810846464987100e-01, -3.289288487526511000e-01, 7.941044876934105800e-01, -5.110810846464987100e-01 }, +} + +local function DistributedVectorSet(n) + if n == nil or n < 1 then return end + local vectors = packedSpheres[n] or {} + if vectors == {} and n <= maxSplitNumber then + -- Random samples are likely enough to look distributed for n > 8. Source: I made it up. + for ii = 1, 3*(n-1)+1, 3 do + vectors[ii], vectors[ii + 1], vectors[ii + 2] = RandomVector3() + end + end + return vectors +end + +local function GetSurfaceDeflection(explArea, projSpeed, nearCheck, ex, ey, ez, bouncing) + local distSurface = ey - spGetGroundHeight(ex, ez) + local x, y, z, s = spGetGroundNormal(ex, ez, false) + + -- If not in close contact with the surface, get a better guess. + -- This uses naive geometry, but it's cheap on ops and not too bad. + if distSurface > 12 then + local n = cos(s) * sin(s) * distSurface + distSurface = ey - spGetGroundHeight(ex+x*n, ez+z*n) + x, y, z, _ = spGetGroundNormal(ex+x*n, ez+z*n, false) + distSurface = abs(x*ex + y*ey + z*ez) + x, y, z = x / distSurface, y / distSurface, z / distSurface + end + + if not bouncing then + local scale = sqrt(projSpeed) / max(12, distSurface) -- idk, seems to work + return { x * scale, y * scale, z * scale } + else + -- No easy way to get units by collider distance; I believe this is by midpoint: + local collisions = spGetUnitsInSphere(ex, ey, ez, max(nearCheck, 80)) -- 80 is a fairly wide net. + -- When hitting a unit directly, we can determine how much to "bounce" off it. + -- This is used to keep grenades-of-grenades from detonating on contact instead of spreading out. + local bounce, radius, ux, uy, uz, cx, cy, cz, cw + for _, uid in pairs(collisions) do + bounce = unitBulk[spGetUnitDefID(uid)] + -- Arbitrary cutoff to ignore cheap, spammy units. + if bounce > 0.05 then + radius = spGetUnitRadius(uid) + ux, uy, uz = spGetUnitPosition(uid, true) + + cx = ex - ux + cy = ey - uy + cz = ez - uz + cw = cx * cx + cy * cy + cz * cz + cw = cw * max(1.0, cw - radius * radius) + + x = x + bounce * (1 - abs(cx) / cw) * sign(cx) + y = y + bounce * (1 - abs(cy) / cw) * sign(cy) + z = z + bounce * (1 - abs(cz) / cw) * sign(cz) + end + end + return { x, y, z } + end +end + +local function SpawnClusterProjectiles(data, attackerID, projID, ex, ey, ez, deflect) + local projNum = data.number + local projVel = data.projVel + + spawnCache.owner = attackerID or -1 + spawnCache.ttl = data.projTtl + + -- Initial direction vectors are evenly spaced. + local distribute = DistributedVectorSet(projNum) + + local vx, vy, vz, dist, norm + for ii = 0, (projNum-1) do + -- Avoid shooting into terrain by adding deflection. + dist = min(1, (data.explVel + data.projVel) / 12) * (data.bouncing and 4 or 1) + vx = distribute[(3*ii+1)] + deflect[1] * dist + vy = distribute[(3*ii+2)] + deflect[2] * dist + vz = distribute[(3*ii+3)] + deflect[3] * dist + + -- When the initial directions are not random, add jitter. + if projNum <= #packedSpheres then + vx = vx + rand(-projNum, projNum) / projNum * 0.86 + vy = vy + rand(-projNum, projNum) / projNum * 0.42 + vz = vz + rand(-projNum, projNum) / projNum * 0.86 + end + + -- Adjust vector length to the speed/magnitude. + norm = sqrt(vx*vx + vy*vy + vz*vz) or 1 + vx = vx * projVel / norm + vy = vy * projVel / norm + vz = vz * projVel / norm + spawnCache.speed = { vx, vy, vz } + + -- Pre-scatter projectiles. + spawnCache.pos = { ex + vx*4, ey + vy*2*min(4, max(1, projVel / (abs(vx) + abs(vz)))), ez + vz*4 } + + spSpawnProjectile(data.projDef, spawnCache) + end +end + +-------------------------------------------------------------------------------------------------------------- +-- Gadget callins -------------------------------------------------------------------------------------------- + +function gadget:Initialize() + for wdid, _ in pairs(dataTable) do + SetWatchExplosion(wdid, true) + end +end + +function gadget:Explosion(weaponDefID, ex, ey, ez, attackerID, projID) + if not dataTable[weaponDefID] then return end + + weaponCache = dataTable[weaponDefID] + + -- Scatter munitions away from terrain (and heavy units) as appropriate. + local deflect = GetSurfaceDeflection( + weaponCache.explAoe, + weaponCache.projVel, + weaponCache.colDist, + ex, ey, ez, + weaponCache.bouncing + ) + + SpawnClusterProjectiles(weaponCache, attackerID, projID, ex, ey, ez, deflect) +end diff --git a/luarules/gadgets/unit_evolution.lua b/luarules/gadgets/unit_evolution.lua index 4587f934c34..ac598b50e5e 100644 --- a/luarules/gadgets/unit_evolution.lua +++ b/luarules/gadgets/unit_evolution.lua @@ -74,6 +74,8 @@ if gadgetHandler:IsSyncedCode() then local TIMER_CHECK_FREQUENCY = 30 -- gameframes + + include("luarules/configs/customcmds.h.lua") --messages[1] = textColor .. Spring.I18N('ui.raptors.wave1', {waveNumber = raptorEventArgs.waveCount}) @@ -139,7 +141,7 @@ if gadgetHandler:IsSyncedCode() then spGiveOrderToUnit(newUnitID, CMD.FIRE_STATE, { states.firestate }, { }) spGiveOrderToUnit(newUnitID, CMD.MOVE_STATE, { states.movestate }, { }) spGiveOrderToUnit(newUnitID, CMD.REPEAT, { states["repeat"] and 1 or 0 }, { }) - spGiveOrderToUnit(newUnitID, CMD.CLOAK, { states.cloak and 1 or 0 }, { }) + spGiveOrderToUnit(newUnitID, CMD_WANT_CLOAK, { states.cloak and 1 or 0 }, { }) spGiveOrderToUnit(newUnitID, CMD.ONOFF, { 1 }, { }) spGiveOrderToUnit(newUnitID, CMD.TRAJECTORY, { states.trajectory and 1 or 0 }, { }) end diff --git a/luarules/gadgets/unit_inherit_creation_xp.lua b/luarules/gadgets/unit_inherit_creation_xp.lua new file mode 100644 index 00000000000..f98eaa9b4c0 --- /dev/null +++ b/luarules/gadgets/unit_inherit_creation_xp.lua @@ -0,0 +1,155 @@ +function gadget:GetInfo() + return { + name = "Inherit Creation Units XP", + desc = "Allows units with added UnitDefs to gain a defined fraction of the XP earned by their creations.", + author = "SethDGamre and Xehrath", + date = "May 2024", + license = "Public domain", + layer = 0, + enabled = true + } +end + +-- synced only +if not gadgetHandler:IsSyncedCode() then return false end + +--**********unit customparams to add to unitdef*********** +-- inheritxpratemultiplier = 1, -- defined in unitdef customparams of the parent unit. It's a number by which XP gained by children is multiplied and passed to the parent after power difference calculations +-- childreninheritxp = "MOBILEBUILT DRONE BOTCANNON", -- determines what kinds of units linked to parent inherit XP +-- parentsinheritxp = "MOBILEBUILT DRONE BOTCANNON", -- determines what kinds of units linked to the parent will give the parent XP + +local inheritChildrenXP = {} -- stores the value of XP rate to be derived from unitdef +local childrenInheritXP = {} -- stores the string that represents the types of units that will inherit the parent's XP when created +local parentsInheritXP = {} -- stores the string that represents the types of units the parent will gain xp from +local childrenWithParents = {} --stores the parent/child relationships format. Each entry stores key of unitID with an array of {unitID, builderID, xpInheritance} +local mobileUnits = {} +local unitPowerDefs = {} +local unitsList = {} + +for id, def in pairs(UnitDefs) do + if def.customParams.inheritxpratemultiplier then + inheritChildrenXP[id] = def.customParams.inheritxpratemultiplier or 1 + end + if def.customParams.parentsinheritxp then + parentsInheritXP[id] = def.customParams.parentsinheritxp or " " + else parentsInheritXP[id] = " " + end + if def.customParams.childreninheritxp then + childrenInheritXP[id] = def.customParams.childreninheritxp or " " + else childrenInheritXP[id] = " " + end + if def.speed and def.speed ~= 0 then + mobileUnits[id] = true + end + if def.power then + unitPowerDefs[id] = def.power + end +end + +if table.count(inheritChildrenXP) <= 0 then -- this enables or disables the gadget + return false +end + +local function calculatePowerDiffXP(childID, parentID) -- this function calculates the right proportion of XP to inherit from child as though they were attacking the target themself. + local childDefID = Spring.GetUnitDefID(childID) + local parentDefID = Spring.GetUnitDefID(parentID) + local childPower = unitPowerDefs[childDefID] + local parentPower = unitPowerDefs[parentDefID] + return (childPower/parentPower)*inheritChildrenXP[parentDefID] +end + +local initializeList = {} +local ignoreList = {} +function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) + if builderID and mobileUnits[Spring.GetUnitDefID(unitID)] and string.find(parentsInheritXP[Spring.GetUnitDefID(builderID)], "MOBILEBUILT") then -- only mobile combat units will pass xp + childrenWithParents[unitID] = { + unitid=unitID, + parentunitid=builderID, + parentxpmultiplier=calculatePowerDiffXP(unitID, builderID), + childinheritsXP = childrenInheritXP[Spring.GetUnitDefID(unitID)], + childtype = "MOBILEBUILT", + } + end + unitsList[unitID] = true +end + +function gadget:UnitFinished(unitID, unitDefID, unitTeam) + initializeList[unitID] = true --must initialize after finishing building otherwise child XP inheritance won't happen +end + +local xpGainParents = {} --stores the unitID's of parents that inherit xp +local lastRunFrame = 0 +local oldChildXPValues = {} +function gadget:GameFrame(frame) + if frame > (lastRunFrame + 30) then + for unitID, value in pairs(unitsList) do + local parentID + if not ignoreList[unitID] then + if initializeList[unitID] == true then -- check for parenthood + local unitDefID = Spring.GetUnitDefID(unitID) + local parentDefID + if Spring.GetUnitRulesParam(unitID, "carrier_host_unit_id") then --estabalishes unit_carrier_spawner parenthood + parentID = Spring.GetUnitRulesParam(unitID, "carrier_host_unit_id") + if string.find(parentsInheritXP[Spring.GetUnitDefID(parentID)], "DRONE") then + childrenWithParents[unitID] = { + unitid = unitID, + parentunitid = parentID, + parentxpmultiplier = calculatePowerDiffXP(unitID, parentID), + childinheritsXP = childrenInheritXP[unitDefID], + childtype = "DRONE", + } + end + end + if Spring.GetUnitRulesParam(unitID, "parent_unit_id") then --estabalishes unit_explosion_spawner parenthood + parentID = Spring.GetUnitRulesParam(unitID, "parent_unit_id") + if string.find(parentsInheritXP[Spring.GetUnitDefID(parentID)], "BOTCANNON") then + childrenWithParents[unitID] = { + unitid = unitID, + parentunitid = parentID, + parentxpmultiplier = calculatePowerDiffXP(unitID, parentID), + childinheritsXP = childrenInheritXP[unitDefID], + childtype = "BOTCANNON", + } + end + end + if childrenWithParents[unitID] then + parentID = childrenWithParents[unitID].parentunitid --sets parentID if it's not already set + parentDefID = Spring.GetUnitDefID(parentID) -- gets the parentDefID + end + if parentID ~= nil and childrenInheritXP[parentDefID] and childrenWithParents[unitID] then --if the parent has the unitdef, set childxp to parent xp. + local parentTypes = childrenInheritXP[parentDefID] + if string.find(parentTypes, childrenWithParents[unitID].childtype) then -- if child is correcty type, set xp + local parentXP = Spring.GetUnitExperience(parentID) + Spring.SetUnitExperience(unitID, parentXP) + oldChildXPValues[unitID] = parentXP --add parent xp to the oldxp value to exclude it from inheritance + end + end + if inheritChildrenXP[unitDefID] then -- if parent inherits xp, then add to list of units to inherit xp + xpGainParents[unitID] = true + end + if not xpGainParents[unitID] and not childrenWithParents[unitID] then --if not a parent or a child of a parent who inherits xp, add to ignore list + ignoreList[unitID] = true + end + initializeList[unitID] = nil -- this concludes innitialization + end + if childrenWithParents[unitID] then + parentID = childrenWithParents[unitID].parentunitid + local oldXP = oldChildXPValues[unitID] or 0 + local newXP = Spring.GetUnitExperience(unitID) or 0 + local parentXP = Spring.GetUnitExperience(parentID) or 0 + local multiplier = childrenWithParents[unitID].parentxpmultiplier + local gainedXP = (parentXP*10000000 + ((newXP-oldXP)*10000000*multiplier))/10000000 --10000000 is to prevent very small numbers being lost during calculation + oldChildXPValues[unitID] = newXP + Spring.SetUnitExperience(parentID, gainedXP) + end + end + end + end +end + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam) + + childrenWithParents[unitID] = nil --removes units from lists when destroyed + ignoreList[unitID] = nil + initializeList[unitID] = nil +end \ No newline at end of file diff --git a/luarules/gadgets/unit_workertime_boost.lua b/luarules/gadgets/unit_workertime_boost.lua index 6088ae30775..f6804514886 100644 --- a/luarules/gadgets/unit_workertime_boost.lua +++ b/luarules/gadgets/unit_workertime_boost.lua @@ -5,16 +5,16 @@ function gadget:GetInfo() author = "SethDGamre", date = "April 2024", license = "Public domain", - layer = 1, + layer = 0, enabled = true } end + + -- synced only if not gadgetHandler:IsSyncedCode() then return false end --- is unba com on -if not Spring.GetModOptions().evocom then return false end local boosttriggers = {} -- stores what words parsed from the wtboostunittype "trigger" boost local mobileunits = {} -- stores the names of units that can move @@ -23,7 +23,6 @@ local originalworkertimes = {} -- workertimeboost = number -- in the unitdefs of the builder. This is the mulitplier by which workertime is boosted. -- wtboostunittype = defined in unitdef of builder, it's a table of strings such as "MOBILE" which defines what units boost buildpower for the builder. ---step 1, FOR make a table containing the names of the units that can boost for id, def in pairs(UnitDefs) do if def.buildSpeed then if def.customParams.workertimeboost then @@ -31,23 +30,24 @@ for id, def in pairs(UnitDefs) do boostedworkertimes[id] = def.buildSpeed * def.customParams.workertimeboost--adds the key "id" unitname to the list. Boostable builders represented the boosted workertime. end end - if def.speed and def.speed ~= 0 then mobileunits[id] = true end - if def.customParams.wtboostunittype then boosttriggers[id] = def.customParams.wtboostunittype --stores the string of the builder that defines unit categories end end +if table.count(originalworkertimes) <= 0 then -- this enables or disables the gadget + return false +end + local boostedtofinish = {}-- going to store the key of unitID equal to the builderID function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) if builderID ~= nil then local boost = boostedworkertimes[Spring.GetUnitDefID(builderID) or -1] local trigger = boosttriggers[Spring.GetUnitDefID(builderID) or -1] - if boost and trigger and builderID then if string.find(trigger, "MOBILE") and mobileunits[unitDefID] then Spring.SetUnitBuildSpeed(builderID, boost) @@ -65,4 +65,4 @@ function gadget:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOp Spring.SetUnitBuildSpeed(unitID, originalworkertimes[unitDefID]) boostedtofinish[unitID] = nil end -end +end \ No newline at end of file diff --git a/luaui/Widgets/gfx_DrawUnitShape_GL4.lua b/luaui/Widgets/gfx_DrawUnitShape_GL4.lua index e504a6d311c..3a85817135f 100644 --- a/luaui/Widgets/gfx_DrawUnitShape_GL4.lua +++ b/luaui/Widgets/gfx_DrawUnitShape_GL4.lua @@ -215,6 +215,11 @@ local VBOTables = {} local corUnitDefIDs = {} local armUnitDefIDs = {} +local unitDefIDtoTex1 = {} -- Keys unit def IDs to whichever tex1 is used +local tex1ToVBO = {['arm_color.dds'] = true, ['cor_color.dds'] = true, ['leg_color.dds'] = true, ['legmech_color.dds'] = true} -- Keys texture1 to which VBO is used, small intermediate table, not really used +local unitDeftoUnitShapeVBOTable = {} -- The important one, which keys the unitDefID to the actual vbo table to be used +local uniqueIDtoUnitShapeVBOTable = {} + local owners = {} -- maps uniqueIDs to their optional owners local uniqueID = 0 @@ -313,15 +318,15 @@ local function DrawUnitShapeGL4(unitDefID, px, py, pz, rotationY, alpha, teamID, if ownerID then owners[updateID] = ownerID end - local DrawUnitShapeVBOTable - --Spring.Echo("DrawUnitShapeGL4", "unitDefID", unitDefID, UnitDefs[unitDefID].name, "to unitDefID", uniqueID,"elemID", elementID) - if corUnitDefIDs[unitDefID] then DrawUnitShapeVBOTable = corDrawUnitShapeVBOTable - elseif armUnitDefIDs[unitDefID] then DrawUnitShapeVBOTable = armDrawUnitShapeVBOTable - else - Spring.Echo("DrawUnitShapeGL4: The given unitDefID", unitDefID, UnitDefs[unitDefID].name, "is neither arm nor cor, only those two are supported at the moment") + local DrawUnitShapeVBOTable = unitDeftoUnitShapeVBOTable[unitDefID] + + if not DrawUnitShapeVBOTable then + Spring.Echo("DrawUnitShapeGL4: The given unitDefID", unitDefID, UnitDefs[unitDefID].name, "is missing a target DrawUnitShapeVBOTable") Spring.Debug.TraceFullEcho(nil,nil,nil,"DrawUnitGL4") return nil end + uniqueIDtoUnitShapeVBOTable[uniqueID] = DrawUnitShapeVBOTable + --Spring.Echo("DrawUnitShapeGL4", "unitDefID", unitDefID, UnitDefs[unitDefID].name, "to unitDefID", uniqueID,"elemID", elementID) instanceCache[1], instanceCache[2], instanceCache[3], instanceCache[4] = px, py, pz, rotationY instanceCache[5], instanceCache[6], instanceCache[7], instanceCache[8] = alpha, 1, teamcoloroverride, highlight @@ -359,13 +364,22 @@ end ---@param uniqueID number the unique id of whatever you want to stop drawing ---@return the ownerID the uniqueID was associated to local function StopDrawUnitShapeGL4(uniqueID) - if corDrawUnitShapeVBOTable.instanceIDtoIndex[uniqueID] then - popElementInstance(corDrawUnitShapeVBOTable, uniqueID) - elseif armDrawUnitShapeVBOTable.instanceIDtoIndex[uniqueID] then - popElementInstance(armDrawUnitShapeVBOTable, uniqueID) + + if uniqueIDtoUnitShapeVBOTable[uniqueID] then + local DrawUnitShapeVBOTable = uniqueIDtoUnitShapeVBOTable[uniqueID] + if DrawUnitShapeVBOTable.instanceIDtoIndex[uniqueID] then + popElementInstance(DrawUnitShapeVBOTable, uniqueID) + else + Spring.Echo("DrawUnitShapeGL4: the given uniqueID", uniqueID," is not present in the DrawUnitShapeVBOTable", DrawUnitShapeVBOTable.vboname, "that we expected it to be in" ) + end + else - Spring.Echo("Unable to remove what you wanted in StopDrawUnitShapeGL4", uniqueID) + + Spring.Echo("DrawUnitShapeGL4: the given uniqueID", uniqueID," is not present in the uniqueIDtoUnitShapeVBOTable, it might already have been removed?") end + + uniqueIDtoUnitShapeVBOTable[uniqueID] = nil + local owner = owners[uniqueID] owners[uniqueID] = nil --Spring.Echo("Popped element", uniqueID) @@ -385,9 +399,20 @@ local function StopDrawAll(ownerID) break end end + if uniqueIDtoUnitShapeVBOTable[uniqueID] then + local DrawUnitShapeVBOTable = uniqueIDtoUnitShapeVBOTable[uniqueID] + if DrawUnitShapeVBOTable.instanceIDtoIndex[uniqueID] then + popElementInstance(DrawUnitShapeVBOTable, uniqueID) + else + Spring.Echo("DrawUnitShapeGL4 StopDrawAll: the given uniqueID", uniqueID," is not present in the DrawUnitShapeVBOTable", DrawUnitShapeVBOTable.vboname, "that we expected it to be in" ) + end + end + owners[uniqueID] = nil ownedCount = ownedCount + 1 + end + end return ownedCount end @@ -418,6 +443,10 @@ function widget:Initialize() return end for unitDefID, unitDef in pairs(UnitDefs) do + if unitDef.model and unitDef.model.textures and unitDef.model.textures.tex1 then + unitDefIDtoTex1[unitDefID] = unitDef.model.textures.tex1:lower() + end + if unitDef.model and unitDef.model.textures and unitDef.model.textures.tex1:lower() == "arm_color.dds" then armUnitDefIDs[unitDefID] = true elseif unitDef.model and unitDef.model.textures and unitDef.model.textures.tex1:lower() == "cor_color.dds" then @@ -425,6 +454,8 @@ function widget:Initialize() end end + + local vertexVBO = gl.GetVBO(GL.ARRAY_BUFFER, false) -- GL.ARRAY_BUFFER, false local indexVBO = gl.GetVBO(GL.ELEMENT_ARRAY_BUFFER, false) -- GL.ARRAY_BUFFER, false vertexVBO:ModelsVBO() @@ -441,15 +472,39 @@ function widget:Initialize() local unitIDAttributeIndex = 9 corDrawUnitVBOTable = makeInstanceVBOTable(VBOLayout, maxElements, "corDrawUnitVBOTable", unitIDAttributeIndex, "unitID") armDrawUnitVBOTable = makeInstanceVBOTable(VBOLayout, maxElements, "armDrawUnitVBOTable", unitIDAttributeIndex, "unitID") - corDrawUnitShapeVBOTable = makeInstanceVBOTable(VBOLayout, maxElements, "corDrawUnitShapeVBOTable", unitIDAttributeIndex, "unitDefID") - armDrawUnitShapeVBOTable = makeInstanceVBOTable(VBOLayout, maxElements, "armDrawUnitShapeVBOTable", unitIDAttributeIndex, "unitDefID") - VBOTables = {corDrawUnitVBOTable, corDrawUnitShapeVBOTable, armDrawUnitVBOTable, armDrawUnitShapeVBOTable} + + VBOTables = {corDrawUnitVBOTable, armDrawUnitVBOTable} for i,VBOTable in ipairs(VBOTables) do -- attach everything together VBOTable.VAO = makeVAOandAttach(vertexVBO, VBOTable.instanceVBO, indexVBO) VBOTable.indexVBO = indexVBO VBOTable.vertexVBO = vertexVBO end + + -- This section is for automatically creating all vbos for all posible tex combos. + -- However it is disabled here, as there are only 4 true tex combos, as defined above in tex1ToVBOx + --for unitDefID, tex1 in pairs(unitDefIDtoTex1) do + -- if not tex1ToVBO[tex1] then Spring.Echo("DrawUnitShape unique tex1 is",tex1) end + -- tex1ToVBO[tex1] = true + --end + + for tex1, _ in pairs(tex1ToVBO) do + local vboname = 'DrawUnitShapeVBOTable:' .. tex1 + local vboTable = makeInstanceVBOTable(VBOLayout, maxElements, vboname, unitIDAttributeIndex, "unitDefID") + vboTable.VAO = makeVAOandAttach(vertexVBO, vboTable.instanceVBO, indexVBO) + vboTable.indexVBO = indexVBO + vboTable.vertexVBO = vertexVBO + tex1ToVBO[tex1] = vboTable + end + + for unitDefID, tex1 in pairs(unitDefIDtoTex1) do + if tex1ToVBO[tex1] then + unitDeftoUnitShapeVBOTable[unitDefID] = tex1ToVBO[tex1] + -- This is very important, we need to remember an example unitDefID here + -- to use to retrive the corresponding texture bucket + unitDeftoUnitShapeVBOTable[unitDefID].UnitShapeTexturesUnitDefID = unitDefID + end + end local unitIDs = Spring.GetAllUnits() local featuresIDs = Spring.GetAllFeatures() @@ -523,6 +578,16 @@ function widget:Shutdown() VBOTable.VAO:Delete() end end + + for tex1,VBOTable in ipairs(tex1ToVBO) do + if VBOTable.VAO then + if Spring.Utilities.IsDevMode() then + dumpAndCompareInstanceData(VBOTable) + end + VBOTable.VAO:Delete() + end + end + if unitShader then unitShader:Finalize() end if unitShapeShader then unitShapeShader:Finalize() end @@ -538,28 +603,32 @@ function widget:Shutdown() widgetHandler:DeregisterGlobal('StopDrawUnitGL4') widgetHandler:DeregisterGlobal('StopDrawUnitShapeGL4') widgetHandler:DeregisterGlobal('armDrawUnitShapeVBOTable') - widgetHandler:DeregisterGlobal('armDrawUnitShapeVBOTable') + widgetHandler:DeregisterGlobal('corDrawUnitShapeVBOTable') widgetHandler:DeregisterGlobal('StopDrawAll') end -function widget:DrawWorldPreUnit() -- this is for UnitDef - if armDrawUnitShapeVBOTable.usedElements > 0 or corDrawUnitShapeVBOTable.usedElements > 0 then - gl.Culling(GL.BACK) - gl.DepthMask(true) - gl.DepthTest(GL.LEQUAL) - --gl.PolygonOffset ( 0.5,0.5 ) - unitShapeShader:Activate() - unitShapeShader:SetUniform("iconDistance",27 * Spring.GetConfigInt("UnitIconDist", 200)) - if (corDrawUnitShapeVBOTable.usedElements > 0 ) then - gl.UnitShapeTextures(corcomUnitDefID, true) - corDrawUnitShapeVBOTable.VAO:Submit() - end - if (armDrawUnitShapeVBOTable.usedElements > 0 ) then - gl.UnitShapeTextures(armcomUnitDefID, true) - armDrawUnitShapeVBOTable.VAO:Submit() +function widget:DrawWorldPreUnit() -- this is for UnitDef + local active = false + + for tex1, unitShapeVBOTable in pairs(tex1ToVBO) do + if unitShapeVBOTable.usedElements > 0 then + + if not active then + gl.Culling(GL.BACK) + gl.DepthMask(true) + gl.DepthTest(GL.LEQUAL) + --gl.PolygonOffset ( 0.5,0.5 ) + unitShapeShader:Activate() + unitShapeShader:SetUniform("iconDistance",27 * Spring.GetConfigInt("UnitIconDist", 200)) + active = true + end + + gl.UnitShapeTextures(unitShapeVBOTable.UnitShapeTexturesUnitDefID, true) + unitShapeVBOTable.VAO:Submit() end - + end + if active then unitShapeShader:Deactivate() gl.UnitShapeTextures(udefID, false) --gl.PolygonOffset( false ) diff --git a/luaui/Widgets/gui_advplayerslist.lua b/luaui/Widgets/gui_advplayerslist.lua index e1c8317c9df..215954fa831 100644 --- a/luaui/Widgets/gui_advplayerslist.lua +++ b/luaui/Widgets/gui_advplayerslist.lua @@ -1431,9 +1431,9 @@ function SortList() end end local deadTeamSize = 0.66 - playerScale = math.max(0.4, math.min(1, 33 / (aliveTeams+(deadTeams*deadTeamSize)))) + playerScale = math.max(0.4, math.min(1, 31 / (aliveTeams+(deadTeams*deadTeamSize)))) if #Spring_GetAllyTeamList() > 24 then - playerScale = playerScale - (playerScale * ((#Spring_GetAllyTeamList()-2)/500)) -- reduce size some more when mega ffa + playerScale = playerScale - (playerScale * ((#Spring_GetAllyTeamList()-2)/400)) -- reduce size some more when mega ffa end -- calls the (cascade) sorting for players diff --git a/luaui/Widgets/gui_info.lua b/luaui/Widgets/gui_info.lua index fedd4504b3d..685f993f0b0 100644 --- a/luaui/Widgets/gui_info.lua +++ b/luaui/Widgets/gui_info.lua @@ -113,6 +113,12 @@ local GL_ONE = GL.ONE local hideBuildlist +-- Reverse armor type table +local armorIndex = {} +for ii = 1, #Game.armorTypes do + armorIndex[Game.armorTypes[ii]] = ii +end + local function round(value, numDecimalPlaces) if value then return string.format("%0." .. numDecimalPlaces .. "f", math.round(value, numDecimalPlaces)) @@ -260,6 +266,21 @@ local function refreshUnitInfo() end + local function calculateClusterDPS(def, damage) + local prevMinDps = unitDefInfo[unitDefID].mindps or 0 + local prevMaxDps = unitDefInfo[unitDefID].maxdps or 0 + + local munition = def.customParams.def or unitDef.name .. '_' .. 'cluster_munition' + local cmNumber = def.customParams.number or 5 -- note: keep in sync with cluster defaults. + local cmDamage = WeaponDefNames[munition].damages[0] + + local mainDps = math_floor((def.salvoSize * def.projectiles) / def.reload * (damage)) + local cmunDps = math_floor((def.salvoSize * def.projectiles) / def.reload * (cmNumber * cmDamage)) + unitDefInfo[unitDefID].mindps = prevMinDps + mainDps + unitDefInfo[unitDefID].maxdps = prevMaxDps + mainDps + cmunDps + end + + local function setEnergyAndMetalCosts(def) if def.energyCost > 0 and (not unitDefInfo[unitDefID].energyPerShot or def.energyCost > unitDefInfo[unitDefID].energyPerShot) then unitDefInfo[unitDefID].energyPerShot = def.energyCost @@ -302,20 +323,28 @@ local function refreshUnitInfo() calculateWeaponDPS(weaponDef, weaponDef.damages[0]) --Damage to default armor category end - elseif - unitDef.customParams.isevocom or --for evolving commanders - unitDef.name == 'armcom' or - unitDef.name == 'corcom' or - unitDef.name == 'armvang' or - unitDef.name == 'corkarg' then + elseif + unitDef.customParams.isevocom or -- use primary weapon for evolving commanders + unitDef.name == 'armcom' or -- ignore underwater secondary + unitDef.name == 'corcom' or + unitDef.name == 'corkarg' or -- ignore secondary weapons, kick + unitDef.name == 'armguard' or -- ignore high-trajectory modes + unitDef.name == 'corpun' or + unitDef.name == 'legcluster' or + unitDef.name == 'armamb' or + unitDef.name == 'cortoast' or + unitDef.name == 'armvang' + then unitExempt = true if i == 1 then --Calculating using first weapon only setEnergyAndMetalCosts(weaponDef) if weaponDef.type == "BeamLaser" then calculateLaserDPS(weaponDef, weaponDef.damages[0]) + elseif weaponDef.customParams and weaponDef.customParams.cluster then -- Bullets that shoot other, smaller bullets + calculateClusterDPS(weaponDef, weaponDef.damages[0]) elseif weapons[i].onlyTargets['vtol'] ~= nil then - calculateWeaponDPS(weaponDef, weaponDef.damages[14] ) --Damage to air category + calculateWeaponDPS(weaponDef, weaponDef.damages[armorIndex.vtol]) --Damage to air category else calculateWeaponDPS(weaponDef, weaponDef.damages[0]) --Damage to default armor category end @@ -337,7 +366,30 @@ local function refreshUnitInfo() if i==3 then calculateWeaponDPS(weaponDef, weaponDef.damages[0]) --Damage to default armor category end + + elseif weaponDef.customParams then + if weaponDef.customParams.cluster then -- Bullets that explode into other, smaller bullets + unitExempt = true + calculateClusterDPS(weaponDef, weaponDef.damages[0]) + elseif weaponDef.customParams.speceffect == "split" then -- Bullets that split into other, smaller bullets + unitExempt = true + local splitd = WeaponDefNames[weaponDef.customParams.def].damages[0] + local splitn = weaponDef.customParams.number or 1 + calculateWeaponDPS(weaponDef, splitd * splitn) + end + elseif weaponDef.customParams.spark_basedamage then -- Lightning + unitExempt = true + local forkd = weaponDef.customParams.spark_forkdamage + local forkn = weaponDef.customParams.spark_maxunits or 1 + calculateWeaponDPS(weaponDef, weaponDef.damages[0] * (1 + forkd * forkn)) + if unitExempt and weaponDef.paralyzer then -- DPS => EMP + unitDefInfo[unitDefID].minemp = unitDefInfo[unitDefID].mindps + unitDefInfo[unitDefID].maxemp = unitDefInfo[unitDefID].maxdps + unitDefInfo[unitDefID].mindps = nil + unitDefInfo[unitDefID].maxdps = nil + end end + if unitDefInfo[unitDefID].mainWeapon == i then unitDefInfo[unitDefID].range = weaponDef.range unitDefInfo[unitDefID].reloadTime = weaponDef.reload @@ -347,7 +399,7 @@ local function refreshUnitInfo() local defDmg if weapons[1].onlyTargets['vtol'] ~= nil then --if main weapon isn't dedicated aa, then all weapons calculate using default armor category - defDmg = weaponDef.damages[14] + defDmg = weaponDef.damages[armorIndex.vtol] else defDmg = weaponDef.damages[0] end @@ -367,7 +419,6 @@ local function refreshUnitInfo() unitDefInfo[unitDefID].minemp = mindps + prevMinDps unitDefInfo[unitDefID].maxemp = maxdps + prevMaxDps end - elseif weaponDef.paralyzer == true and unitDef.name ~= 'armthor' then -- exclude thor emp missile local defDmg = weaponDef.damages[0] --Damage to default armor category local emp = math_floor(defDmg * weaponDef.salvoSize / weaponDef.reload) @@ -381,7 +432,7 @@ local function refreshUnitInfo() local defDmg if weapons[1].onlyTargets['vtol'] ~= nil then --if main weapon isn't dedicated aa, then all weapons calculate using default armor category - defDmg = weaponDef.damages[14] + defDmg = weaponDef.damages[armorIndex.vtol] else defDmg = weaponDef.damages[0] end diff --git a/luaui/Widgets/gui_options.lua b/luaui/Widgets/gui_options.lua index 4e27d9f0f1e..2b990b5ee59 100644 --- a/luaui/Widgets/gui_options.lua +++ b/luaui/Widgets/gui_options.lua @@ -3231,6 +3231,11 @@ function init() onchange = function(i, value) local language = languageCodes[value] WG['language'].setLanguage(language) + if widgetHandler.orderList["Notifications"] ~= nil then + widgetHandler:DisableWidget("Notifications") + widgetHandler:EnableWidget("Notifications") + init() + end end }, { id = "uiscale", group = "ui", category = types.basic, name = Spring.I18N('ui.settings.option.interface') .. widgetOptionColor .. " " .. Spring.I18N('ui.settings.option.uiscale'), type = "slider", min = 0.8, max = 1.3, step = 0.01, value = Spring.GetConfigFloat("ui_scale", 1), description = '', diff --git a/luaui/Widgets/gui_unit_stats.lua b/luaui/Widgets/gui_unit_stats.lua index 4c2181d9402..afa48e93773 100644 --- a/luaui/Widgets/gui_unit_stats.lua +++ b/luaui/Widgets/gui_unit_stats.lua @@ -177,6 +177,12 @@ for unitDefID, unitDef in pairs(UnitDefs) do end end +-- Reverse armor type table +local armorTypes = {} +for ii = 1, #Game.armorTypes do + armorTypes[Game.armorTypes[ii]] = ii +end + ------------------------------------------------------------------------------------ -- Functions ------------------------------------------------------------------------------------ @@ -573,19 +579,44 @@ local function drawStats(uDefID, uID) local wDefId = wepsCompact[i] local uWep = wDefs[wDefId] - if uWep.customParams and uWep.customParams.def then - uWep = wDefs[WeaponDefNames[uWep.customParams.def].id] + + -- Handle projectiles that spawn additional projectiles. + -- Many properties (might) have nothing to do with the spawned projectile: + local burst = uWep.salvoSize * uWep.projectiles + local range = uWep.range + local reload = uWep.reload + local accuracy = uWep.accuracy + local moveError = uWep.targetMoveError + local defaultDamage = uWep.damages[0] + if defaultDamage < uWep.damages[armorTypes.vtol] then + defaultDamage = uWep.damages[armorTypes.vtol] end - if uWep.range > 0 then - local oBurst = uWep.salvoSize * uWep.projectiles - local oRld = max(0.00000000001,uWep.stockpile == true and uWep.stockpileTime/30 or uWep.reload) + if uWep.customParams then + if uWep.customParams.spark_basedamage then + local spDamage = uWep.customParams.spark_basedamage * uWep.customParams.spark_forkdamage + local spCount = uWep.customParams.spark_maxunits + defaultDamage = defaultDamage + spDamage * spCount + elseif uWep.customParams.speceffect == "split" then + burst = burst * (uWep.customParams.number or 1) + uWep = WeaponDefNames[uWep.customParams.def] or uWep + defaultDamage = uWep.damages[0] + elseif uWep.customParams.cluster then + local munition = uWep.customParams.def or uDef.name .. '_' .. 'cluster_munition' + local cmNumber = uWep.customParams.number or 5 -- note: keep in sync with cluster defaults + local cmDamage = WeaponDefNames[munition].damages[0] + defaultDamage = defaultDamage + cmDamage * cmNumber + end + end + + if range > 0 then + local oRld = max(0.00000000001, uWep.stockpile == true and uWep.stockpileTime/30 or uWep.reload) if uID and useExp and not ((uWep.stockpile and uWep.stockpileTime)) then - oRld = spGetUnitWeaponState(uID,weaponNums[i] or -1,"reloadTimeXP") or spGetUnitWeaponState(uID,weaponNums[i] or -1,"reloadTime") or oRld + oRld = spGetUnitWeaponState(uID, weaponNums[i] or -1, "reloadTimeXP") or + spGetUnitWeaponState(uID, weaponNums[i] or -1, "reloadTime") or oRld end - local wepCount = wepCounts[wDefId] - local typeName = uWep.type local wpnName = uWep.description + local wepCount = wepCounts[wDefId] if i == deathWeaponIndex then wpnName = texts.deathexplosion oRld = 1 @@ -598,27 +629,20 @@ local function drawStats(uDefID, uID) else DrawText(texts.weap..":", wpnName) end - local reload = uWep.reload - local accuracy = uWep.accuracy - local moveError = uWep.targetMoveError - local range = uWep.range - --local reload = spGetUnitWeaponState(uID,weaponNums[i] or -1,"reloadTimeXP") or spGetUnitWeaponState(uID,weaponNums[i] or -1,"reloadTime") or uWep.reload - --local accuracy = spGetUnitWeaponState(uID,weaponNums[i] or -1,"accuracy") or uWep.accuracy - --local moveError = spGetUnitWeaponState(uID,weaponNums[i] or -1,"targetMoveError") or uWep.targetMoveError - local reloadBonus = reload ~= 0 and (uWep.reload/reload-1) or 0 - local accuracyBonus = accuracy ~= 0 and (uWep.accuracy/accuracy-1) or 0 - local moveErrorBonus = moveError ~= 0 and (uWep.targetMoveError/moveError-1) or 0 - --local range = spGetUnitWeaponState(uID,weaponNums[i] or -1,"range") or uWep.range - - local rangeBonus = range ~= 0 and (range/uWep.range-1) or 0 + if uExp ~= 0 then + local rangeBonus = range ~= 0 and (range/uWep.range-1) or 0 + local reloadBonus = reload ~= 0 and (uWep.reload/reload-1) or 0 + local accuracyBonus = accuracy ~= 0 and (uWep.accuracy/accuracy-1) or 0 + local moveErrorBonus = moveError ~= 0 and (uWep.targetMoveError/moveError-1) or 0 DrawText(texts.exp..":", format("+%d%% "..texts.accuracy..", +%d%% "..texts.aim..", +%d%% "..texts.firerate..", +%d%% "..texts.range, accuracyBonus*100, moveErrorBonus*100, reloadBonus*100, rangeBonus*100 )) end + local infoText = "" if wpnName == texts.deathexplosion or wpnName == texts.selfdestruct then infoText = format("%d "..texts.aoe..", %d%% "..texts.edge, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) else - infoText = format("%.2f", (useExp and reload or uWep.reload))..texts.s.." "..texts.reload..", "..format("%d "..texts.range..", %d "..texts.aoe..", %d%% "..texts.edge, useExp and range or uWep.range, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) + infoText = format("%.2f", (useExp and reload or uWep.reload))..texts.s.." "..texts.reload..", "..format("%d "..texts.range..", %d "..texts.aoe..", %d%% "..texts.edge, useExp and range or uWep.range, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) end if uWep.damages.paralyzeDamageTime > 0 then infoText = format("%s, %ds "..texts.paralyze, infoText, uWep.damages.paralyzeDamageTime) @@ -633,54 +657,77 @@ local function drawStats(uDefID, uID) infoText = format("%.2f", (useExp and reload or uWep.reload)).."s "..texts.reload..", "..format("%d "..texts.range, useExp and range or uWep.range) end DrawText(texts.info..":", infoText) - local defaultDamage = uWep.damages[0] + + -- Draw the damage and damage modifiers strings. local cat = 0 local oDmg = uWep.damages[cat] local catName = Game.armorTypes[cat] - local burst = uWep.salvoSize if string.find(uWep.name, "disintegrator") then - DrawText(texts.dmg..":", yellow..texts.infinite) - elseif wpnName == texts.deathexplosion or wpnName == texts.selfdestruct then - if catName and oDmg and (oDmg ~= defaultDamage or cat == 0) then - local dmgString - local dps = defaultDamage * burst / (useExp and reload or uWep.reload) - local bDamages = defaultDamage * burst - dmgString = texts.burst.." = "..(format(yellow .. "%d", bDamages))..white.."." - DrawText(texts.dmg..":", dmgString) - end - local dmgString = white - for cat=1, #uWep.damages do - local oDmg = uWep.damages[cat] - local catName = Game.armorTypes[cat] + DrawText(texts.dmg..": ", texts.infinite) + else + local dmgString = "" + if wpnName == texts.deathexplosion or wpnName == texts.selfdestruct then if catName and oDmg and (oDmg ~= defaultDamage or cat == 0) then - dmgString = dmgString..white..catName.." = "..(format(yellow .. "%d", (oDmg*100/defaultDamage)))..yellow.."%"..white.."; " + local dps = defaultDamage * burst / (useExp and reload or uWep.reload) + local bDamages = defaultDamage * burst + dmgString = texts.burst.." = "..(format(yellow .. "%d", bDamages))..white.."." end - end - DrawText(texts.modifiers..":", dmgString) - else - if catName and oDmg and (oDmg ~= defaultDamage or cat == 0) then - local dmgString - local dps = defaultDamage * burst / (useExp and reload or uWep.reload) - local bDamages = defaultDamage * burst - totaldps = totaldps + wepCount*dps - totalbDamages = totalbDamages + wepCount* bDamages - dmgString = texts.dps.." = "..(format(yellow .. "%d", dps))..white.."; "..texts.burst.." = "..(format(yellow .. "%d", bDamages))..white.."." - if wepCount > 1 then - dmgString = dmgString .. white .. " ("..texts.each..")" + else + if catName and oDmg and (oDmg ~= defaultDamage or cat == 0) then + local dps = defaultDamage * burst / (useExp and reload or uWep.reload) + local bDamages = defaultDamage * burst + totaldps = totaldps + wepCount*dps + totalbDamages = totalbDamages + wepCount* bDamages + dmgString = texts.dps.." = "..(format(yellow .. "%d", dps))..white.."; "..texts.burst.." = "..(format(yellow .. "%d", bDamages))..white.."." + if wepCount > 1 then + dmgString = dmgString .. white .. " ("..texts.each..")" + end end - DrawText(texts.dmg..":", dmgString) end - local dmgString = white - for cat=1, #uWep.damages do - local oDmg = uWep.damages[cat] + DrawText(texts.dmg..":", dmgString) + + local modString = "" + -- Group armor types by the damage they take. + local modifiers = {} + local defaultRate = uWep.damages[0] or 0 + local defaultName = Game.armorTypes[0] or 'default' + for cat = 0, #uWep.damages do local catName = Game.armorTypes[cat] - if catName and oDmg and (oDmg ~= defaultDamage or cat == 0) then - dmgString = dmgString..white..catName.." = "..(format(yellow .. "%d", (oDmg*100/defaultDamage)))..yellow.."%"..white.."; " + local catDamage = uWep.damages[cat] or defaultRate + + if catName and catDamage then + local rate = catDamage + if not modifiers[rate] then modifiers[rate] = {} end + if rate == defaultRate then + modifiers[rate] = { defaultName } + defaultRate = rate + else + table.insert(modifiers[rate], catName) + end end end - DrawText(texts.modifiers..":", dmgString) - end + local sorted = {} + for k ,_ in pairs(modifiers) do table.insert(sorted, k) end + table.sort(sorted, function(a, b) return a > b end) -- descending sort + local maxDamage = sorted[1] + + modString = "default = "..yellow..format("%d", 100 * defaultRate / maxDamage).."%" + local count = 0 + for _ in pairs(modifiers) do count = count + 1 end + if count > 1 then + for _, rate in pairs(sorted) do + if rate ~= defaultRate then + local armors = table.concat(modifiers[rate], ", ") + local percent = format("%d", floor(100 * rate / maxDamage)) + if armors and percent then + modString = modString..white.."; "..armors.." = "..yellow..percent.."%" + end + end + end + end + DrawText(texts.modifiers..":", modString..'.') + end if uWep.metalCost > 0 or uWep.energyCost > 0 then diff --git a/luaui/Widgets/snd_notifications.lua b/luaui/Widgets/snd_notifications.lua index 9f538a975b0..7db3ae82b6e 100644 --- a/luaui/Widgets/snd_notifications.lua +++ b/luaui/Widgets/snd_notifications.lua @@ -13,7 +13,7 @@ end local defaultVoiceSet = 'en/allison' -local useDefaultVoiceFallback = true -- when a voiceset has missing file, try to load the default voiceset file instead +local useDefaultVoiceFallback = false -- when a voiceset has missing file, try to load the default voiceset file instead local useDefaultVoiceFallbackCustom = true -- only used for dynamicly added notifications like scavengers do local silentTime = 0.7 -- silent time between queued notifications @@ -35,6 +35,18 @@ VFS.Include('common/wav.lua') local language = Spring.GetConfigString('language', 'en') local voiceSet = Spring.GetConfigString('voiceset', defaultVoiceSet) +if string.sub(voiceSet, 1, 2) ~= language then + local languageDirs = VFS.SubDirs('sounds/voice', '*') + for k, f in ipairs(languageDirs) do + local langDir = string.sub(f, 14, string.len(f)-1) + local files = VFS.SubDirs('sounds/voice/'..langDir, '*') + for k, file in ipairs(files) do + local dirname = string.sub(file, 14, string.len(file)-1) + voiceSet = langDir..'/'..dirname + break + end + end +end local LastPlay = {} local notification = {} @@ -400,14 +412,18 @@ function widget:Initialize() queueNotification(value, force) end end - WG['notifications'].playNotification = function(value) - if notification[value] then - if notification[value].voiceFiles and #notification[value].voiceFiles > 0 then - local m = #notification[value].voiceFiles > 1 and math.random(1, #notification[value].voiceFiles) or 1 - Spring.PlaySoundFile(notification[value].voiceFiles[m], globalVolume, 'ui') + WG['notifications'].playNotification = function(event) + if notification[event] then + if notification[event].voiceFiles and #notification[event].voiceFiles > 0 then + local m = #notification[event].voiceFiles > 1 and math.random(1, #notification[event].voiceFiles) or 1 + if notification[event].voiceFiles[m] then + Spring.PlaySoundFile(notification[event].voiceFiles[m], globalVolume, 'ui') + else + Spring.Echo('notification "'..event..'" missing sound file: #'..m) + end end - if displayMessages and WG['messages'] and notification[value].textID then - WG['messages'].addMessage(Spring.I18N(notification[value].textID)) + if displayMessages and WG['messages'] and notification[event].textID then + WG['messages'].addMessage(Spring.I18N(notification[event].textID)) end end end @@ -727,15 +743,19 @@ local function playNextSound() local isTutorialNotification = (string.sub(event, 1, 2) == 't_') if not muteWhenIdle or not isIdle or isTutorialNotification then local m = 1 - if spoken and notification[event].voiceFiles and notification[event].voiceFiles[1] ~= '' then + if spoken and #notification[event].voiceFiles > 0 then local m = #notification[event].voiceFiles > 1 and math.random(1, #notification[event].voiceFiles) or 1 - Spring.PlaySoundFile(notification[event].voiceFiles[m], globalVolume, 'ui') - local duration = wavFileLengths[string.sub(notification[event].voiceFiles[m], 8)] - if not duration then - duration = ReadWAV(notification[event].voiceFiles[m]) - duration = duration.Length + if notification[event].voiceFiles[m] then + Spring.PlaySoundFile(notification[event].voiceFiles[m], globalVolume, 'ui') + local duration = wavFileLengths[string.sub(notification[event].voiceFiles[m], 8)] + if not duration then + duration = ReadWAV(notification[event].voiceFiles[m]) + duration = duration.Length + end + nextSoundQueued = sec + (duration or 3) + silentTime + else + Spring.Echo('notification "'..event..'" missing sound file: #'..m) end - nextSoundQueued = sec + (duration or 3) + silentTime end if displayMessages and WG['messages'] and notification[event].textID then WG['messages'].addMessage(Spring.I18N(notification[event].textID)) diff --git a/luaui/configs/buildmenu_sorting.lua b/luaui/configs/buildmenu_sorting.lua index 5e9a867126f..12f398b7ad2 100644 --- a/luaui/configs/buildmenu_sorting.lua +++ b/luaui/configs/buildmenu_sorting.lua @@ -543,6 +543,7 @@ local unitOrderTable = { ['legforti'] = 104506, --exscavengers ['armclaw'] = 104600, ['armlwall'] = 104650, + ['legdtr'] = 104704, --legion ['corscavdtl'] = 104705, --scavengers ['legdtl'] = 104706, --exscavengers ['cormaw'] = 104800, @@ -573,6 +574,7 @@ local unitOrderTable = { ['legdefcarryt1'] = 106800, ['armguard'] = 106800, ['corpun'] = 106900, + ['legcluster'] = 106950, --DEFENSES LAND T2 ['legmg'] = 107000, --land/AA machinegun @@ -605,6 +607,7 @@ local unitOrderTable = { ['cormadsam'] = 130400, ['armcir'] = 130500, ['corerad'] = 130600, + ['leglupara'] = 130700, ['armflak'] = 153000, ['corflak'] = 153500, diff --git a/luaui/configs/gridmenu_layouts.lua b/luaui/configs/gridmenu_layouts.lua index fe6ff14ee28..824f6000c6c 100644 --- a/luaui/configs/gridmenu_layouts.lua +++ b/luaui/configs/gridmenu_layouts.lua @@ -575,7 +575,7 @@ local unitGrids = { { "cordl", }, -- coastal torp launcher }, { - { "corrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth + { "corrad", "coreyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth { "corfrad", "corfdrag", }, -- floating radar, shark's teeth { }, -- empty }, @@ -775,7 +775,7 @@ local unitGrids = { { "cordl", }, -- coastal torp launcher }, { - { "legrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth + { "legrad", "coreyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth { "corfrad", "corfdrag", }, -- floating radar, shark's teeth { }, -- empty }, @@ -797,9 +797,9 @@ local unitGrids = { { "cordl", }, -- coastal torp launcher }, { - { "legrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth + { "legrad", "coreyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { }, -- empty }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard @@ -819,9 +819,9 @@ local unitGrids = { { "cordl", }, -- coastal torp launcher }, { - { "legrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth + { "legrad", "coreyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { }, -- empty }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard @@ -841,9 +841,9 @@ local unitGrids = { { "cordl", }, -- coastal torp launcher }, { - { "legrad", "coreyes", "cordrag", }, -- radar, perimeter camera, dragon's teeth + { "legrad", "coreyes", "legdrag", }, -- radar, perimeter camera, dragon's teeth { "corfrad", "corfdrag", }, -- floating radar, shark's teeth - { }, -- empty + { }, -- empty }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard @@ -869,8 +869,8 @@ local unitGrids = { }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "leginfestor", }, -- nano, infestor, floating nano - { "corhp", "corfhp", }, -- hover lab, floating hover lab + { "cornanotc", "leginfestor", "cornanotcplat",}, -- nano, infestor, floating nano + { "corhp", "corfhp", }, -- hover lab, floating hover lab } }, legcomlvl6 = { @@ -891,7 +891,7 @@ local unitGrids = { }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "leginfestor" }, -- nano, infestor, floating nano + { "cornanotc", "leginfestor", "cornanotcplat",}, -- nano, infestor, floating nano { "corhp", "corfhp", }, -- hover lab, floating hover lab } }, @@ -913,7 +913,7 @@ local unitGrids = { }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "leginfestor", }, -- nano, infestor, floating nano + { "cornanotc", "leginfestor", "cornanotcplat",}, -- nano, infestor, floating nano { "corhp", "corfhp", }, -- hover lab, floating hover lab } }, @@ -935,7 +935,7 @@ local unitGrids = { }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "leginfestor", }, -- nano, infestor, floating nano + { "cornanotc", "leginfestor", "cornanotcplat",}, -- nano, infestor, floating nano { "corhp", "corfhp", }, -- hover lab, floating hover lab } }, @@ -957,7 +957,7 @@ local unitGrids = { }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "leginfestor", }, -- nano, infestor, floating nano + { "cornanotc", "leginfestor", "cornanotcplat",}, -- nano, infestor, floating nano { "corhp", "corfhp", }, -- hover lab, floating hover lab } }, @@ -979,7 +979,7 @@ local unitGrids = { }, { { "leglab", "legvp", "legap", "corsy", }, -- bot lab, veh lab, air lab, shipyard - { "leginfestor", }, -- nano, infestor, floating nano + { "cornanotc", "leginfestor", "cornanotcplat",}, -- nano, infestor, floating nano { "corhp", "corfhp", }, -- hover lab, floating hover lab } }, @@ -1036,13 +1036,13 @@ local unitGrids = { { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "corhlt", "cormaw", }, -- LLT, machine gun, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "", "legdtr", }, -- LLT, machine gun, HLT, flame turret + { "corrl", "cormadsam", "leglupara", }, -- basic AA, SAM, eradicator + { "cordl", "legcluster", }, -- coastal torp launcher, punisher }, { - { "legrad", "coreyes", "cordrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { }, + { "legrad", "coreyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "corasp", "corfasp" }, -- air repair pad, floating air repair pad { "corjuno", }, -- juno }, { @@ -1105,13 +1105,13 @@ local unitGrids = { { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "corhlt", "cormaw", }, -- LLT, machine gun, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "", "legdtr", }, -- LLT, machine gun, HLT, flame turret + { "corrl", "cormadsam", "leglupara", }, -- basic AA, SAM, eradicator + { "cordl", "legcluster", }, -- coastal torp launcher, punisher }, { - { "legrad", "coreyes", "cordrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { }, + { "legrad", "coreyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "corasp", "corfasp" }, -- air repair pad, floating air repair pad { "corjuno", }, -- juno }, { @@ -1173,13 +1173,13 @@ local unitGrids = { { "corestor", "cormstor", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "corhlt", "cormaw", }, -- LLT, machine gun, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", }, -- coastal torp launcher, punisher + { "leglht", "legmg", "", "legdtr", }, -- LLT, machine gun, HLT, flame turret + { "corrl", "cormadsam", "leglupara", }, -- basic AA, SAM, eradicator + { "cordl", "legcluster", }, -- coastal torp launcher, punisher }, { - { "legrad", "coreyes", "cordrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer - { }, + { "legrad", "coreyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer + { "", "", "corasp", "corfasp" }, -- air repair pad, floating air repair pad { "corjuno", }, -- juno }, { @@ -1381,12 +1381,12 @@ local unitGrids = { { "corestor", "cormstor", "coruwes", "corfmkr", }, -- e storage, m storage, (uw e stor), (fl. T1 converter) }, { - { "leglht", "legmg", "corhlt", "cormaw", }, -- LLT, machine gun, HLT, flame turret - { "corrl", "cormadsam", "corerad", }, -- basic AA, SAM, eradicator - { "cordl", "corpun", "corptl", "corfhlt", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT + { "leglht", "legmg", "corhlt", "legdtr", }, -- LLT, machine gun, HLT, flame turret + { "corrl", "cormadsam", "leglupara", "corfrt" }, -- basic AA, SAM, eradicator, floating AA + { "cordl", "legcluster", "corptl", "corfhlt", }, -- coastal torp launcher, punisher, offshore torp launcher, floating HLT }, { - { "legrad", "coreyes", "cordrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer + { "legrad", "coreyes", "legdrag", "legjam", }, -- radar, perimeter camera, dragon's teeth, jammer { "corfrad", "corfdrag", }, -- floating radar, shark's teeth { "corjuno", }, -- juno }, diff --git a/modoptions.lua b/modoptions.lua index 9cb49a7ef0b..75433f8dfeb 100644 --- a/modoptions.lua +++ b/modoptions.lua @@ -7,6 +7,7 @@ -- key: the string used in the script.txt -- name: the displayed name -- desc: the description (could be used as a tooltip) +-- hint: greyed out text that appears in input field when empty -- type: the option type ('list','string','number','bool') -- def: the default value -- min: minimum value for number options @@ -571,6 +572,7 @@ local options = { key = "tweakunits", name = "Tweak Units", desc = "For advanced users!!! A base64 encoded lua table of unit parameters to change.", + hint = "Input must be base64", section = "options_unit_modifiers", type = "string", def = "", @@ -580,6 +582,7 @@ local options = { key = "tweakdefs", name = "Tweak Defs", desc = "For advanced users!!! A base64 encoded snippet of code that modifies game definitions.", + hint = "Input must be base64", section = "options_unit_modifiers", type = "string", def = "", diff --git a/objects3d/Units/legcluster.s3o b/objects3d/Units/legcluster.s3o new file mode 100644 index 00000000000..273fa3e8932 Binary files /dev/null and b/objects3d/Units/legcluster.s3o differ diff --git a/objects3d/Units/legcluster_dead.s3o b/objects3d/Units/legcluster_dead.s3o new file mode 100644 index 00000000000..c5a7d210050 Binary files /dev/null and b/objects3d/Units/legcluster_dead.s3o differ diff --git a/objects3d/Units/legdrag.s3o b/objects3d/Units/legdrag.s3o new file mode 100644 index 00000000000..8090484ccd1 Binary files /dev/null and b/objects3d/Units/legdrag.s3o differ diff --git a/objects3d/Units/legdrag_dead.s3o b/objects3d/Units/legdrag_dead.s3o new file mode 100644 index 00000000000..8090484ccd1 Binary files /dev/null and b/objects3d/Units/legdrag_dead.s3o differ diff --git a/objects3d/Units/legdtr.s3o b/objects3d/Units/legdtr.s3o new file mode 100644 index 00000000000..0439416621a Binary files /dev/null and b/objects3d/Units/legdtr.s3o differ diff --git a/objects3d/Units/legdtr_dead.s3o b/objects3d/Units/legdtr_dead.s3o new file mode 100644 index 00000000000..8090484ccd1 Binary files /dev/null and b/objects3d/Units/legdtr_dead.s3o differ diff --git a/objects3d/Units/leglaw.s3o b/objects3d/Units/leglaw.s3o new file mode 100644 index 00000000000..1fe8e2fc45d Binary files /dev/null and b/objects3d/Units/leglaw.s3o differ diff --git a/objects3d/Units/leglaw_dead.s3o b/objects3d/Units/leglaw_dead.s3o new file mode 100644 index 00000000000..f33a2b7509e Binary files /dev/null and b/objects3d/Units/leglaw_dead.s3o differ diff --git a/objects3d/Units/leglht.s3o b/objects3d/Units/leglht.s3o index ccfec510bc6..10765435014 100644 Binary files a/objects3d/Units/leglht.s3o and b/objects3d/Units/leglht.s3o differ diff --git a/objects3d/Units/leglupara.s3o b/objects3d/Units/leglupara.s3o new file mode 100644 index 00000000000..0d051745e1a Binary files /dev/null and b/objects3d/Units/leglupara.s3o differ diff --git a/objects3d/Units/leglupara_dead.s3o b/objects3d/Units/leglupara_dead.s3o new file mode 100644 index 00000000000..e0010adf151 Binary files /dev/null and b/objects3d/Units/leglupara_dead.s3o differ diff --git a/scripts/Units/corcomhilvl.bos b/scripts/Units/corcomhilvl.bos index 1b7c2d3ce44..c2d0327f13b 100644 --- a/scripts/Units/corcomhilvl.bos +++ b/scripts/Units/corcomhilvl.bos @@ -6,7 +6,7 @@ piece torso, lfirept, rbigflash, nanospray, nanolathe, luparm, ruparm, pelvis, rthigh, lthigh, biggun, lleg, l_foot, rleg, r_foot, head, teleport, aimx1, aimy1, nanol1, nanol2, nanol3, leye, reye, eyeflare, cagelight, cagelight_emit, headmount, hatpoint, crown, medalsilver, medalbronze, medalgold, torsofrontmarker; -static-var bMoving, bAiming, Busy, gun_3, gun_2, gun_eye, counter, +static-var bMoving, bAiming, Busy, gun_6, gun_3, gun_2, gun_eye, counter, bIsBuilding, buildPitch, buildHeading, maxSpeed, currentSpeed, animSpeed, justMoved, shotcount; // for the AimPrimary script, to skip wait-for-turn if needed @@ -807,6 +807,7 @@ Create() gun_2 = torso; Busy = 1; gun_3 = torso; + gun_6 = torso; gun_eye = head; buildHeading = 0; buildPitch = 0; @@ -860,6 +861,7 @@ StartMoving() { bMoving = TRUE; gun_3 = torso; + gun_6 = torso; gun_eye = head; signal SIG_WALK; set-signal-mask SIG_WALK; @@ -887,6 +889,7 @@ QueryNanoPiece(piecenum) RestorePosition() { gun_3 = torso; + gun_6 = torso; set-signal-mask SIG_AIM1; sleep 2000; turn aimy1 to y-axis <0.000000> speed <90.000000>; @@ -940,7 +943,11 @@ QueryPrimary(piecenum) AimPrimary(heading, pitch) { - if( gun_3 == 1 ) + if( gun_3 == 1) + { + return (0); + } + if( gun_6 == 1) { return (0); } @@ -1032,7 +1039,11 @@ AimSecondary(heading, pitch) { return (0); } - if( gun_3 == 1 ) + if( gun_3 == 1) + { + return (0); + } + if( gun_6 == 1) { return (0); } @@ -1115,6 +1126,56 @@ FireWeapon5() return (0); } +AimFromWeapon6(piecenum) +{ + piecenum = rbigflash; + return (0); +} + +QueryWeapon6(piecenum) +{ + piecenum = rbigflash; + return (0); +} + +AimWeapon6(heading, pitch) +{ + if( gun_3 == 1 ) + { + return (0); + } + if( bIsBuilding ) + { + return (0); + } + var reloading; + reloading = (get GAME_FRAME) < (get WEAPON_RELOADSTATE(6)); + if( reloading ) + { + return(0); + } + signal SIG_AIM1; + set-signal-mask SIG_AIM1; + gun_6 = lfirept; + bAiming = TRUE; + turn aimy1 to y-axis heading speed <360.000000>; + turn aimx1 to x-axis <0> - pitch speed <360.000000>; + //turn ruparm to x-axis <0> speed <360>; + wait-for-turn aimy1 around y-axis; + //wait-for-turn biggun around x-axis; + return (1); +} + +FireWeapon6() +{ + //shotcount = shotcount + 1; + emit-sfx 1024 + 0 from rbigflash; + //call-script lua_UnitScriptLight(1, shotcount); + gun_6 = torso; + call-script bigfire(); + return (0); +} + StartBuilding(heading, pitch) { show nanospray; diff --git a/scripts/Units/corcomhilvl.cob b/scripts/Units/corcomhilvl.cob index d1dd19cf59d..5857acb2eb5 100644 Binary files a/scripts/Units/corcomhilvl.cob and b/scripts/Units/corcomhilvl.cob differ diff --git a/scripts/Units/legcluster.bos b/scripts/Units/legcluster.bos new file mode 100644 index 00000000000..d8bb0ce7fb5 --- /dev/null +++ b/scripts/Units/legcluster.bos @@ -0,0 +1,196 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + + +piece base, turret, sleeve, barrel, flare; +//piece flare1, flare2, base, turret, barrel1, barrel2, sleeves; + +static-var trajectoryMode, lastHeading; + +#define SIGNAL_AIM 1 +#define LOW_TRAJECTORY 0 +#define HIGH_TRAJECTORY 1 + + +Create() +{ + hide flare; +} + +#define SMOKEPIECE base +#include "smokeunit_thread_nohit.h" + +RequestState(requestedState) +{ + trajectoryMode = requestedstate; +} + +Activate() +{ + signal SIGNAL_AIM; + start-script RequestState(HIGH_TRAJECTORY); +} + +Deactivate() +{ + signal SIGNAL_AIM; + start-script RequestState(LOW_TRAJECTORY); +} + +restoreAfterDelay() +{ + set-signal-mask SIGNAL_AIM; + sleep 3500; + if(lastHeading > <-180.000000>) + { + turn turret to y-axis <180.000000> speed <30.000000>; + } + if(lastHeading > <-135.000000>) + { + turn turret to y-axis <270.000000> speed <30.000000>; + } + if(lastHeading > <-45.000000>) + { + turn turret to y-axis <0.000000> speed <30.000000>; + } + if(lastHeading > <45.000000>) + { + turn turret to y-axis <90.000000> speed <30.000000>; + } + if(lastHeading > <135.000000>) + { + turn turret to y-axis <180.000000> speed <30.000000>; + } + turn sleeve to x-axis <0.000000> speed <45.000000>; +} + +aimCommon(heading, pitch) +{ + turn turret to y-axis heading speed <30.000000>; + turn sleeve to x-axis <0.000000> - pitch speed <45.000000>; + lastHeading = heading; + wait-for-turn turret around y-axis; + wait-for-turn sleeve around x-axis; + start-script restoreAfterDelay(); +} + +AimPrimary(heading, pitch) +{ + if( trajectoryMode != LOW_TRAJECTORY ) + { + return(0); + } + + signal SIGNAL_AIM; + set-signal-mask SIGNAL_AIM; + call-script aimCommon(heading, pitch); + + // Prevent low-trajectory "bonus shots" while high-trajectory is reloading + var reloading; + reloading = (get GAME_FRAME) < (get WEAPON_RELOADSTATE(2)); + if( reloading ) + { + return(0); + } + + return (1); +} + +AimSecondary(heading, pitch) +{ + if( trajectoryMode != HIGH_TRAJECTORY ) + { + return(0); + } + + signal SIGNAL_AIM; + set-signal-mask SIGNAL_AIM; + call-script aimCommon(heading, pitch); + return (1); +} + +AimFromPrimary(piecenum) +{ + piecenum = sleeve; +} + +AimFromSecondary(piecenum) +{ + piecenum = sleeve; +} + +fireCommon() +{ + emit-sfx 1024 + 0 from flare; + move barrel to z-axis [-6.250000] now; + sleep 100; + move barrel to z-axis [0.000000] speed [2.5000000]; +} + +FirePrimary() +{ + call-script fireCommon(); +} + +FireSecondary() +{ + call-script fireCommon(); +} + +QueryPrimary(piecenum) +{ + piecenum = flare; +} + +QuerySecondary(piecenum) +{ + piecenum = flare; +} + +SweetSpot(piecenum) +{ + piecenum = base; +} + +Killed(severity, corpsetype) +{ + if( severity <= 25 ) + { + corpsetype = 1 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode turret type BITMAPONLY | NOHEATCLOUD; + explode sleeve type BITMAPONLY | NOHEATCLOUD; + explode barrel type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode flare type BITMAPONLY | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 50 ) + { + corpsetype = 2 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode turret type FALL | NOHEATCLOUD; + explode sleeve type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type FALL | NOHEATCLOUD; + explode flare type FALL | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 99 ) + { + corpsetype = 3 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode turret type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode sleeve type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode barrel type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode flare type SMOKE | FALL | NOHEATCLOUD; + return(corpsetype); + } + corpsetype = 3 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode turret type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + explode sleeve type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + explode flare type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + return corpsetype; +} diff --git a/scripts/Units/legcluster.cob b/scripts/Units/legcluster.cob new file mode 100644 index 00000000000..ee1ef69fee8 Binary files /dev/null and b/scripts/Units/legcluster.cob differ diff --git a/scripts/Units/legdrag.bos b/scripts/Units/legdrag.bos new file mode 100644 index 00000000000..d5e4800870d --- /dev/null +++ b/scripts/Units/legdrag.bos @@ -0,0 +1,10 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base; + +Create() +{ +} diff --git a/scripts/Units/legdrag.cob b/scripts/Units/legdrag.cob new file mode 100644 index 00000000000..56d04aaa1f8 Binary files /dev/null and b/scripts/Units/legdrag.cob differ diff --git a/scripts/Units/legdtr.bos b/scripts/Units/legdtr.bos new file mode 100644 index 00000000000..e1d863856db --- /dev/null +++ b/scripts/Units/legdtr.bos @@ -0,0 +1,188 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, turretbase, turretstrut, barrel, flare, firepoint, lida, lidb, aimfrom, aimpoint; + +static-var is_open, restore_delay, Stunned; + +// Signal definitions +#define SIG_AIM 2 + +Close() +{ + set-signal-mask SIG_AIM; + is_open = 0; + turn barrel to x-axis <30> speed <50>; + wait-for-turn barrel around x-axis; + turn turretstrut to x-axis <60> speed <50>; + wait-for-turn turretstrut around x-axis; + move turretbase to y-axis [-40] speed [50]; + wait-for-move turretbase along y-axis; + turn lida to z-axis <180> speed <160>; + turn lidb to z-axis <-180> speed <160>; + wait-for-turn lida around z-axis; + hide aimpoint; + hide aimfrom; + hide flare; + hide firepoint; + set ARMORED to 1; +} + +Open() +{ + set ARMORED to 0; + turn lida to z-axis <0> speed <400>; + turn lidb to z-axis <0> speed <400>; + wait-for-turn lidb around z-axis; + move turretbase to y-axis [0] speed [150]; //move turretbase, turretstrut, barrel to original open spot + wait-for-move turretbase along y-axis; // wait for turretbase, turretstrut, barrel to move + turn turretstrut to x-axis <0> speed <150>; // turn turretstrut, barrel, around x-axis to partially open position + // wait-for-turn turretstrut around x-axis; // wait for turretstrut + turn barrel to x-axis <0> speed <150>; // turn barrel around x-axis to fully open position + wait-for-turn barrel around x-axis; + is_open = 1; +} + +Create() +{ + hide aimpoint; + hide aimfrom; + hide flare; + hide firepoint; + restore_delay = 2000; + is_open = 0; + // move turretbase to y-axis [-20] now; + // move turretstrut to y-axis [-10] now; + // move barrel to y-axis [-5] now; + + while ( get BUILD_PERCENT_LEFT ) + { + sleep 250; + } + sleep 250; + if ( is_open == 0 ) + { + start-script Close(); + } +} + + +ExecuteRestoreAfterDelay() +{ + if (Stunned) { + return (1); + } + hide aimpoint; + hide aimfrom; + hide flare; + hide firepoint; + start-script Close(); +} + +SetStunned(State) +{ + Stunned = State; + if (!Stunned) { + start-script ExecuteRestoreAfterDelay(); + } +} + +RestoreAfterDelay() +{ + sleep restore_delay; + start-script ExecuteRestoreAfterDelay(); +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + + if ( is_open == 0 ) + { + start-script Open(); + start-script RestoreAfterDelay(); + } + + while( is_open == 0 ) + { + sleep 150; + } + + turn turretbase to y-axis heading speed <200.000000>; + turn barrel to x-axis <0.000000> - pitch speed <200.000000>; + wait-for-turn turretbase around y-axis; + wait-for-turn barrel around x-axis; + start-script RestoreAfterDelay(); + return(1); +} + +FirePrimary() +{ + emit-sfx 1024 + 0 from flare; +} + +QueryPrimary(piecenum) +{ + if (is_open == 1) + { + piecenum = flare; + } + else + { + piecenum = aimfrom; + } +} + +SweetSpot(piecenum) +{ + piecenum = aimpoint; +} + +AimFromPrimary(piecenum) +{ + piecenum = flare; +} + +Killed(severity, corpsetype) +{ + if( severity <= 25 ) + { + corpsetype = 1 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode turretbase type BITMAPONLY | NOHEATCLOUD; + explode turretstrut type BITMAPONLY | NOHEATCLOUD; + explode barrel type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode flare type BITMAPONLY | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 50 ) + { + corpsetype = 2 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode turretbase type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode turretstrut type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type FALL | NOHEATCLOUD; + explode flare type FALL | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 99 ) + { + corpsetype = 3 ; + explode base type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode turretbase type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode turretstrut type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode flare type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + return(corpsetype); + } + corpsetype = 3 ; + explode base type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode turretbase type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode turretstrut type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode flare type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + return corpsetype; +} \ No newline at end of file diff --git a/scripts/Units/legdtr.cob b/scripts/Units/legdtr.cob new file mode 100644 index 00000000000..2cd3d787af5 Binary files /dev/null and b/scripts/Units/legdtr.cob differ diff --git a/scripts/Units/leglupara.bos b/scripts/Units/leglupara.bos new file mode 100644 index 00000000000..aace6e8b4e3 --- /dev/null +++ b/scripts/Units/leglupara.bos @@ -0,0 +1,125 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +// piece flare1, flare2, flare3, flare4, base, xturret, barrel1, barrel2, barrel3, barrel4, yturret1, yturret2; +piece base, turret, strut, barrel, flare, radar, radarSpinEMPTY; + +static-var gun_1; + +// Signal definitions +#define SIG_AIM 2 + +#define SMOKEPIECE base +#include "smokeunit_thread_nohit.h" + +static-var Stunned; +ExecuteRestoreAfterDelay() +{ + if (Stunned) { + return (1); + } + + spin turret around y-axis speed <25.0>; + turn strut to x-axis <-30> speed <25.0>; + +} +SetStunned(State) +{ + Stunned = State; + if (!Stunned) { + start-script ExecuteRestoreAfterDelay(); + } +} +RestoreAfterDelay() +{ + sleep 5000; + start-script ExecuteRestoreAfterDelay(); +} + +Create() +{ + hide flare; + turn radarSpinEMPTY to x-axis <31.2> now; + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + spin radar around y-axis speed <-50.0>; + start-script ExecuteRestoreAfterDelay(); +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + + turn turret to y-axis heading speed <1200>; + // turn barrel to x-axis <0> - pitch speed <950>; + turn strut to x-axis <0> - pitch speed <950>; + wait-for-turn turret around y-axis; + wait-for-turn barrel around x-axis; + + start-script RestoreAfterDelay(); + return (1); +} + +FirePrimary() +{ + emit-sfx 1024 + 0 from flare; + sleep 100; + return (0); +} + +QueryPrimary(piecenum) +{ + piecenum = flare; +} + +AimFromPrimary(piecenum) +{ + piecenum = barrel; +} + +SweetSpot(piecenum) +{ + piecenum = base; +} + +Killed(severity, corpsetype) +{ + if( severity <= 25 ) + { + corpsetype = 1 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode strut type BITMAPONLY | NOHEATCLOUD; + explode radar type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type BITMAPONLY | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 50 ) + { + corpsetype = 2 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode strut type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode radar type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type FIRE | SMOKE | FALL | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 99 ) + { + corpsetype = 3 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode strut type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode radar type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type FIRE | SMOKE | FALL | NOHEATCLOUD; + return(corpsetype); + } + corpsetype = 3 ; + explode base type BITMAPONLY | NOHEATCLOUD; + explode strut type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode radar type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode barrel type FIRE | SMOKE | FALL | NOHEATCLOUD; + return corpsetype; +} diff --git a/scripts/Units/leglupara.cob b/scripts/Units/leglupara.cob new file mode 100644 index 00000000000..4252f3329d9 Binary files /dev/null and b/scripts/Units/leglupara.cob differ diff --git a/sounds/voice/en/allison/GameStarted.wav b/sounds/voice/en/allison/GameStarted.wav index 4f9bd1e2476..1fee84bd39f 100644 Binary files a/sounds/voice/en/allison/GameStarted.wav and b/sounds/voice/en/allison/GameStarted.wav differ diff --git a/unitpics/legcluster.dds b/unitpics/legcluster.dds new file mode 100644 index 00000000000..f0de3797eba Binary files /dev/null and b/unitpics/legcluster.dds differ diff --git a/unitpics/legdrag.dds b/unitpics/legdrag.dds new file mode 100644 index 00000000000..a2a267306d8 Binary files /dev/null and b/unitpics/legdrag.dds differ diff --git a/unitpics/legdtr.dds b/unitpics/legdtr.dds new file mode 100644 index 00000000000..e9dc6b9e423 Binary files /dev/null and b/unitpics/legdtr.dds differ diff --git a/unitpics/leglupara.dds b/unitpics/leglupara.dds new file mode 100644 index 00000000000..6d541866793 Binary files /dev/null and b/unitpics/leglupara.dds differ diff --git a/units/ArmShips/T2/armcarry2.lua b/units/ArmShips/T2/armcarry2.lua index 33a969a0239..facf86b5a62 100644 --- a/units/ArmShips/T2/armcarry2.lua +++ b/units/ArmShips/T2/armcarry2.lua @@ -54,6 +54,9 @@ return { normaltex = "unittextures/Arm_normal.dds", subfolder = "armships/t2", techlevel = 2, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/ArmShips/T2/armdronecarry.lua b/units/ArmShips/T2/armdronecarry.lua index 2d488c66802..e84381eb5d2 100644 --- a/units/ArmShips/T2/armdronecarry.lua +++ b/units/ArmShips/T2/armdronecarry.lua @@ -49,6 +49,9 @@ return { normaltex = "unittextures/Arm_normal.dds", subfolder = "armships/t2", techlevel = 2, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/ArmShips/T2/armtrident.lua b/units/ArmShips/T2/armtrident.lua index 725236bfa1e..63cdd74c891 100644 --- a/units/ArmShips/T2/armtrident.lua +++ b/units/ArmShips/T2/armtrident.lua @@ -44,6 +44,9 @@ return { normaltex = "unittextures/Arm_normal.dds", subfolder = "armships/t2", techlevel = 2, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/ArmVehicles/armsam2.lua b/units/ArmVehicles/armsam2.lua index 5867a8bc368..9490c2be048 100644 --- a/units/ArmVehicles/armsam2.lua +++ b/units/ArmVehicles/armsam2.lua @@ -120,7 +120,8 @@ return { impulsefactor = 0, metalpershot = 0, name = "Missiles", - range = 650, + proximityPriority = 100, + range = 700, reloadtime = 0.5, soundhitwet = "splshbig", startvelocity = 450, @@ -157,7 +158,7 @@ return { model = "cormissile.s3o", name = "Light g2a missile launcher", noselfdamage = true, - range = 650, + range = 700, reloadtime = 3.33333, smoketrail = true, smokePeriod = 8, @@ -240,6 +241,7 @@ return { badtargetcategory = "NOTAIR", def = "BOGUS_MISSILE", onlytargetcategory = "NOTSUB", + fastautoretargeting = true, }, [2] = { badtargetcategory = "NOTAIR", diff --git a/units/CorShips/T2/corcarry2.lua b/units/CorShips/T2/corcarry2.lua index bbc3e5d9b65..d0a90d1ee84 100644 --- a/units/CorShips/T2/corcarry2.lua +++ b/units/CorShips/T2/corcarry2.lua @@ -54,6 +54,9 @@ return { normaltex = "unittextures/cor_normal.dds", subfolder = "corships/t2", techlevel = 2, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/CorShips/T2/cordronecarry.lua b/units/CorShips/T2/cordronecarry.lua index b49ec5ce46f..410c70ce236 100644 --- a/units/CorShips/T2/cordronecarry.lua +++ b/units/CorShips/T2/cordronecarry.lua @@ -49,6 +49,9 @@ return { normaltex = "unittextures/cor_normal.dds", subfolder = "corships/t2", techlevel = 2, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/CorShips/T2/corsentinel.lua b/units/CorShips/T2/corsentinel.lua index 99455bce5a4..944b01682e0 100644 --- a/units/CorShips/T2/corsentinel.lua +++ b/units/CorShips/T2/corsentinel.lua @@ -45,6 +45,9 @@ return { normaltex = "unittextures/Cor_normal.dds", subfolder = "corships/t2", techlevel = 2, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/CorVehicles/cormist2.lua b/units/CorVehicles/cormist2.lua index 00bf94c8219..dbf7831be53 100644 --- a/units/CorVehicles/cormist2.lua +++ b/units/CorVehicles/cormist2.lua @@ -120,7 +120,8 @@ return { impulsefactor = 0, metalpershot = 0, name = "Missiles", - range = 650, + proximityPriority = 100, + range = 700, reloadtime = 0.5, soundhitwet = "splshbig", startvelocity = 450, @@ -157,7 +158,7 @@ return { name = "Light g2a missile launcher", noselfdamage = true, predictboost = 1, - range = 650, + range = 700, reloadtime = 2.5, smoketrail = true, smokePeriod = 8, @@ -203,6 +204,7 @@ return { model = "cormissile.s3o", name = "Light g2g missile launcher", noselfdamage = true, + predictboost = 1, range = 600, reloadtime = 2.5, smoketrail = true, @@ -236,6 +238,7 @@ return { badtargetcategory = "NOTAIR", def = "BOGUS_MISSILE", onlytargetcategory = "NOTSUB", + fastautoretargeting = true, }, [2] = { badtargetcategory = "NOTAIR", diff --git a/units/Legion/Bots/legbal.lua b/units/Legion/Bots/legbal.lua index bfeaa3d5742..402c1cd5b22 100644 --- a/units/Legion/Bots/legbal.lua +++ b/units/Legion/Bots/legbal.lua @@ -119,7 +119,7 @@ return { name = "Rockets", noselfdamage = true, range = 460, - reloadtime = 5, + reloadtime = 5.5, smoketrail = true, smokePeriod = 11, smoketime = 28, diff --git a/units/Legion/Constructors/legca.lua b/units/Legion/Constructors/legca.lua index 8360ec8bd29..184dc596e32 100644 --- a/units/Legion/Constructors/legca.lua +++ b/units/Legion/Constructors/legca.lua @@ -58,15 +58,13 @@ return { "coreyes", "legrad", "legdrag", - "legdtl", - "legdtf", - "legdtm", + "legdtr", "leglht", "legmg", - "corpun", + "legcluster", "corrl", "cormadsam", - "corerad", + "leglupara", "cordl", "legjam", "corjuno", diff --git a/units/Legion/Constructors/legck.lua b/units/Legion/Constructors/legck.lua index 233fa9b4b3c..525d06343af 100644 --- a/units/Legion/Constructors/legck.lua +++ b/units/Legion/Constructors/legck.lua @@ -57,15 +57,13 @@ return { "coreyes", "legrad", "legdrag", - "legdtl", - "legdtf", - "legdtm", + "legdtr", "leglht", "legmg", - "corpun", + "legcluster", "corrl", "cormadsam", - "corerad", + "leglupara", "cordl", "legjam", "corjuno", diff --git a/units/Legion/Constructors/legcv.lua b/units/Legion/Constructors/legcv.lua index 473a21dbd58..286e117a57a 100644 --- a/units/Legion/Constructors/legcv.lua +++ b/units/Legion/Constructors/legcv.lua @@ -62,15 +62,13 @@ return { "coreyes", "legrad", "legdrag", - "legdtl", - "legdtf", - "legdtm", + "legdtr", "leglht", "legmg", - "corpun", + "legcluster", "corrl", "cormadsam", - "corerad", + "leglupara", "cordl", "legjam", "corjuno", diff --git a/units/Legion/Constructors/legotter.lua b/units/Legion/Constructors/legotter.lua index 3e32afa3522..d31898e1b11 100644 --- a/units/Legion/Constructors/legotter.lua +++ b/units/Legion/Constructors/legotter.lua @@ -62,32 +62,30 @@ return { [17] = "coreyes", [18] = "legrad", [19] = "legdrag", - [20] = "legdtl", - [21] = "legdtf", - [22] = "legdtm", - [23] = "leglht", - [24] = "legmg", - [25] = "corpun", - [26] = "corrl", - [27] = "cormadsam", - [28] = "corerad", - [29] = "corjuno", - [30] = "cordl", - [31] = "legjam", - [32] = "corfhp", - [33] = "coramsub", - [34] = "corplat", - [35] = "corsy", - [36] = "cortide", - [37] = "corfmkr", - [38] = "coruwms", - [39] = "coruwes", - [40] = "corfdrag", - [41] = "corfrad", - [42] = "corfhlt", - [43] = "corfrt", - [44] = "corptl", - [45] = "coruwgeo", + [20] = "legdtr", + [21] = "leglht", + [22] = "legmg", + [23] = "legcluster", + [24] = "corrl", + [25] = "cormadsam", + [26] = "leglupara", + [27] = "corjuno", + [28] = "cordl", + [29] = "legjam", + [30] = "corfhp", + [31] = "coramsub", + [32] = "corplat", + [33] = "corsy", + [34] = "cortide", + [35] = "corfmkr", + [36] = "coruwms", + [37] = "coruwes", + [38] = "corfdrag", + [39] = "corfrad", + [40] = "corfhlt", + [41] = "corfrt", + [42] = "corptl", + [43] = "coruwgeo", }, customparams = { unitgroup = 'builder', diff --git a/units/Legion/Defenses/legbastion.lua b/units/Legion/Defenses/legbastion.lua index 9174b2644c8..b48a3834a1d 100644 --- a/units/Legion/Defenses/legbastion.lua +++ b/units/Legion/Defenses/legbastion.lua @@ -132,7 +132,7 @@ return { predictboost = 0.3, proximitypriority = 1, range = 1100, - reloadtime = 2.5, + reloadtime = 3, rgbcolor = "1 0.5 0", rgbcolor2 = "0.9 1.0 0.5", soundhitdry = "", diff --git a/units/Legion/Defenses/legcluster.lua b/units/Legion/Defenses/legcluster.lua new file mode 100644 index 00000000000..d269c245314 --- /dev/null +++ b/units/Legion/Defenses/legcluster.lua @@ -0,0 +1,226 @@ +return { + legcluster = { + maxacc = 0, + activatewhenbuilt = false, + maxdec = 0, + buildangle = 8192, + energycost = 11000, + metalcost = 850, + buildpic = "LEGCLUSTER.DDS", + buildtime = 19300, + canrepeat = false, + category = "ALL NOTLAND WEAPON NOTSUB NOTSHIP NOTAIR NOTHOVER SURFACE EMPABLE", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "47 47 47", + collisionvolumetype = "CylY", + corpse = "DEAD", + explodeas = "largeBuildingexplosiongeneric", + footprintx = 4, + footprintz = 4, + idleautoheal = 5, + idletime = 1800, + health = 2900, + maxslope = 12, + maxwaterdepth = 0, + nochasecategory = "MOBILE", + objectname = "Units/LEGCLUSTER.s3o", + onoffable = true, + script = "Units/LEGCLUSTER.cob", + seismicsignature = 0, + selfdestructas = "largeBuildingExplosionGenericSelfd", + sightdistance = 455, + yardmap = "oooooooooooooooo", + customparams = { + usebuildinggrounddecal = true, + buildinggrounddecaltype = "decals/legcluster_aoplane.dds", + buildinggrounddecalsizey = 1, + buildinggrounddecalsizex = 1, + buildinggrounddecaldecayspeed = 30, + unitgroup = 'weapon', + model_author = "ZephyrSkies", + normaltex = "unittextures/leg_normal.dds", + onoffname = "trajectory", + subfolder = "corbuildings/landdefenceoffence", + }, + featuredefs = { + dead = { + blocking = true, + category = "corpses", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "47 47 47", + collisionvolumetype = "Box", + damage = 1764, + featuredead = "HEAP", + footprintx = 4, + footprintz = 4, + height = 20, + metal = 936, + object = "Units/legcluster_dead.s3o", + reclaimable = true, + }, + heap = { + blocking = false, + category = "heaps", + collisionvolumescales = "85.0 14.0 6.0", + collisionvolumetype = "cylY", + damage = 882, + footprintx = 3, + footprintz = 3, + height = 3, + metal = 373, + object = "Units/cor4X4B.s3o", + reclaimable = true, + resurrectable = 0, + }, + }, + sfxtypes = { + explosiongenerators = { + [1] = "custom:barrelshot-medium", + }, + pieceexplosiongenerators = { + [1] = "deathceg2", + [2] = "deathceg3", + [3] = "deathceg4", + }, + }, + sounds = { + canceldestruct = "cancel2", + cloak = "kloak2", + uncloak = "kloak2un", + underattack = "warning1", + cant = { + [1] = "cantdo4", + }, + count = { + [1] = "count6", + [2] = "count5", + [3] = "count4", + [4] = "count3", + [5] = "count2", + [6] = "count1", + }, + ok = { + [1] = "twrturn3", + }, + select = { + [1] = "twrturn3", + }, + }, + weapondefs = { + plasma = { + accuracy = 75, + areaofeffect = 120, + avoidfeature = false, + -- burst = 3, + -- burstrate = 0.2, + -- sprayangle = 200, + cegtag = "starfire_arty", + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.4, + explosiongenerator = "custom:ministarfire-explosion", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.5, + name = "Long-range g2g plasma cannon", + noselfdamage = true, + range = 1000, + reloadtime = 4.0, + rgbcolor = "0.7 0.7 1.0 1.0 1.0 1.0 1.0 1.0", + soundhit = "xplomed2", + soundhitwet = "splsmed", + soundstart = "cannhvy5", + turret = true, + weapontype = "Cannon", + weaponvelocity = 450, + customparams = { + cluster = true, + bouncing = true, + number = 3, + }, + damage = { + default = 150, + lboats = 150, + subs = 37, + vtol = 37, + }, + }, + cluster_munition = { + areaofeffect = 100, + avoidfeature = false, + cegtag = "ministarfire", + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.3, + explosiongenerator = "custom:ministarfire-explosion", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.5, + name = "Plasma burst", + noselfdamage = true, + range = 180, + rgbcolor = "0.7 0.7 1.0 1.0 1.0 1.0 1.0 1.0", + soundhit = "xplomed2", + soundhitwet = "splsmed", + soundstart = "cannhvy5", + weapontype = "Cannon", + weaponvelocity = 450, + damage = { + default = 100, + lboats = 100, + subs = 25, + vtol = 25, + }, + }, + plasma_high = { + accuracy = 75, + areaofeffect = 200, + avoidfeature = false, + cegtag = "starfire_arty", + craterareaofeffect = 208, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.4, + explosiongenerator = "custom:ministarfire-explosion", + gravityaffected = "true", + hightrajectory = 1, + impulseboost = 0.123, + impulsefactor = 0.5, + name = "Long-range g2g plasma cannon", + noselfdamage = true, + range = 1000, + reloadtime = 9.4, + rgbcolor = "0.7 0.7 1.0 1.0 1.0 1.0 1.0 1.0", + soundhit = "xplomed2", + soundhitwet = "splsmed", + soundstart = "cannhvy5", + turret = true, + weapontype = "Cannon", + weaponvelocity = 450, + customparams = { + cluster = true, + bouncing = true, + number = 6, + }, + damage = { + default = 200, + subs = 37, + vtol = 37, + }, + }, + }, + weapons = { + [1] = { + badtargetcategory = "VTOL", + def = "PLASMA", + maindir = "0 1 0", + maxangledif = 230, + onlytargetcategory = "SURFACE", + }, + [2] = { + def = "PLASMA_HIGH", + onlytargetcategory = "SURFACE", + }, + }, + }, +} diff --git a/units/Legion/Defenses/legdefcarryt1.lua b/units/Legion/Defenses/legdefcarryt1.lua index d29500573ad..423e9ae8d67 100644 --- a/units/Legion/Defenses/legdefcarryt1.lua +++ b/units/Legion/Defenses/legdefcarryt1.lua @@ -45,6 +45,9 @@ return { removewait = true, subfolder = "corbuildings/landdefenceoffence", legacyname = "Gaat Gun", + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/Legion/Defenses/legdrag.lua b/units/Legion/Defenses/legdrag.lua index ecaf4622e36..8633a54b4e4 100644 --- a/units/Legion/Defenses/legdrag.lua +++ b/units/Legion/Defenses/legdrag.lua @@ -6,7 +6,7 @@ return { maxdec = 0, energycost = 0, metalcost = 8, - buildpic = "scavengers/CORSCAVDRAG.DDS", + buildpic = "LEGDRAG.DDS", buildtime = 255, canattack = false, canrepeat = false, @@ -25,22 +25,22 @@ return { health = 2800, maxslope = 64, maxwaterdepth = 0, - objectname = "scavs/scavdrag.s3o", + objectname = "Units/legdrag.s3o", repairable = false, - script = "Units/cordrag.cob", + script = "Units/legdrag.cob", seismicsignature = 0, selfdestructas = "WallExplosionConcrete", selfdestructcountdown = 1, sightdistance = 1, yardmap = "ffff", customparams = { - usebuildinggrounddecal = false, - buildinggrounddecaltype = "decals/scavdtf_aoplane.dds", + usebuildinggrounddecal = true, + buildinggrounddecaltype = "decals/legdtr_aoplane.dds", buildinggrounddecalsizey = 4, buildinggrounddecalsizex = 4, buildinggrounddecaldecayspeed = 30, - model_author = "Mr Bob", - normaltex = "unittextures/cor_normal.dds", + model_author = "ZephyrSkies", + normaltex = "unittextures/leg_normal.dds", objectify = true, paralyzemultiplier = 0, removestop = true, diff --git a/units/Legion/Defenses/legdtr.lua b/units/Legion/Defenses/legdtr.lua new file mode 100644 index 00000000000..759a7b7a9ed --- /dev/null +++ b/units/Legion/Defenses/legdtr.lua @@ -0,0 +1,164 @@ +return { + legdtr = { + maxacc = 0, + buildangle = 8192, + energycost = 1550, + metalcost = 290, + buildpic = "LEGDTR.DDS", + buildtime = 4420, + canrepeat = false, + category = "ALL NOTLAND WEAPON NOTSUB NOTSHIP NOTAIR NOTHOVER SURFACE EMPABLE", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "32 22 32", + collisionvolumetype = "CylY", + corpse = "DEAD", + damagemodifier = 0.25, + decoyfor = "legdrag", + explodeas = "smallBuildingexplosiongeneric", + footprintx = 2, + footprintz = 2, + hidedamage = true, + idleautoheal = 10, + idletime = 900, + levelground = false, + mass = 10000000000, + health = 1610, + maxslope = 18, + maxwaterdepth = 0, + nochasecategory = "MOBILE", + objectname = "Units/LEGDTR.s3o", + radardistancejam = 8, + script = "Units/LEGDTR.cob", + seismicsignature = 0, + selfdestructas = "tinyBuildingExplosionGenericSelfd", + sightdistance = 440, + stealth = true, + turnrate = 0, + upright = true, + yardmap = "ffff", + customparams = { + neutral_when_closed = true, + usebuildinggrounddecal = true, + buildinggrounddecaltype = "decals/legdtr_aoplane.dds", + buildinggrounddecalsizey = 4, + buildinggrounddecalsizex = 4, + buildinggrounddecaldecayspeed = 30, + unitgroup = 'weapon', + decoyfor = "LEGLAW", + model_author = "ZephyrSkies", + normaltex = "unittextures/leg_normal.dds", + removewait = true, + subfolder = "Legion/Defenses", + }, + featuredefs = { + dead = { + autoreclaimable = 0, + blocking = true, + category = "corpses", + collisionvolumeoffsets = "0.0 0.0149960864258 0.116882324219", + collisionvolumescales = "32.042388916 19.5953521729 32.6287231445", + collisionvolumetype = "Box", + damage = 600, + featuredead = "ROCKTEETH", + footprintx = 2, + footprintz = 2, + height = 20, + metal = 177, + object = "Units/legdrag_dead.s3o", + reclaimable = true, + }, + rockteeth = { + animating = 0, + animtrans = 0, + blocking = false, + category = "heaps", + collisionvolumescales = "35.0 4.0 6.0", + collisionvolumetype = "cylY", + damage = 500, + footprintx = 2, + footprintz = 2, + height = 20, + metal = 2, + object = "Units/cor1X1A.s3o", + reclaimable = true, + shadtrans = 1, + }, + }, + sfxtypes = { + explosiongenerators = { + [1] = "custom:barrelshot-medium-impulse", + }, + pieceexplosiongenerators = { + [1] = "deathceg3", + [2] = "deathceg4-fire", + }, + }, + sounds = { + canceldestruct = "cancel2", + cloak = "kloak1", + uncloak = "kloak1un", + underattack = "warning1", + cant = { + [1] = "cantdo4", + }, + count = { + [1] = "count6", + [2] = "count5", + [3] = "count4", + [4] = "count3", + [5] = "count2", + [6] = "count1", + }, + ok = { + [1] = "servmed2", + }, + select = { + [1] = "servmed2", + }, + }, + weapondefs = { + corlevlr_weapon = { + areaofeffect = 140, + avoidfeature = false, + burnblow = true, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.9, + explosiongenerator = "custom:genericshellexplosion-large", + impulsefactor = 2.0, + impulseboost = 2.0, + name = "Area Control Riot Cannon", + noselfdamage = true, + range = 400, + reloadtime = 2.0, + soundhit = "corlevlrhit", + soundhitwet = "splsmed", + soundstart = "largegun", + soundhitvolume = 12.0, + soundstartvolume = 14.0, + separation = 2.0, + nogap = false, + size = 3, + sizeDecay = 0.07, + stages = 10, + alphaDecay = 0.10, + turret = true, + weapontype = "Cannon", + weaponvelocity = 600, + damage = { + default = 240, + commanders = 375, + subs = 90, + vtol = 35, + }, + }, + }, + weapons = { + [1] = { + badtargetcategory = "VTOL", + def = "CORLEVLR_WEAPON", + onlytargetcategory = "SURFACE", + }, + }, + }, +} diff --git a/units/Legion/Defenses/leglupara.lua b/units/Legion/Defenses/leglupara.lua new file mode 100644 index 00000000000..da7f82650a2 --- /dev/null +++ b/units/Legion/Defenses/leglupara.lua @@ -0,0 +1,165 @@ +return { + leglupara = { + maxacc = 0, + airsightdistance = 1000, + maxdec = 0, + buildangle = 65536, + energycost = 7900, + metalcost = 800, + buildpic = "LEGLUPARA.DDS", + buildtime = 12000, + canrepeat = false, + category = "ALL NOTLAND WEAPON NOTSUB NOTSHIP NOTAIR NOTHOVER SURFACE EMPABLE", + collisionvolumeoffsets = "0 -5 0", + collisionvolumescales = "45 65 45", + collisionvolumetype = "CylY", + corpse = "DEAD", + explodeas = "mediumBuildingexplosiongeneric", + footprintx = 2, + footprintz = 2, + idleautoheal = 5, + idletime = 1800, + health = 4000, + maxslope = 10, + maxwaterdepth = 0, + nochasecategory = "ALL", + objectname = "Units/LEGLUPARA.s3o", + script = "Units/LEGLUPARA.cob", + seismicsignature = 0, + selfdestructas = "mediumBuildingExplosionGenericSelfd", + sightdistance = 380, + yardmap = "oooo", + customparams = { + usebuildinggrounddecal = true, + buildinggrounddecaltype = "decals/leglupara_aoplane.dds", + buildinggrounddecalsizey = 1, + buildinggrounddecalsizex = 1, + buildinggrounddecaldecayspeed = 30, + unitgroup = 'aa', + model_author = "ZephyrSkies", + normaltex = "unittextures/leg_normal.dds", + removewait = true, + subfolder = "legion/defenses", + }, + featuredefs = { + dead = { + blocking = true, + category = "corpses", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "55 85 55", + collisionvolumetype = "CylY", + damage = 1560, + featuredead = "HEAP", + footprintx = 2, + footprintz = 2, + height = 20, + metal = 370, + object = "Units/leglupara_dead.s3o", + reclaimable = true, + }, + heap = { + blocking = false, + category = "heaps", + collisionvolumescales = "35.0 4.0 6.0", + collisionvolumetype = "cylY", + damage = 780, + footprintx = 2, + footprintz = 2, + height = 4, + metal = 150, + object = "corunits/arm2x2c.s3o.s3o", + reclaimable = true, + resurrectable = 0, + }, + }, + sfxtypes = { + explosiongenerators = { + [1] = "custom:barrelshot-flak", + }, + pieceexplosiongenerators = { + [1] = "deathceg2", + [2] = "deathceg3", + [3] = "deathceg4", + }, + }, + sounds = { + canceldestruct = "cancel2", + cloak = "kloak1", + uncloak = "kloak1un", + underattack = "warning1", + cant = { + [1] = "cantdo4", + }, + count = { + [1] = "count6", + [2] = "count5", + [3] = "count4", + [4] = "count3", + [5] = "count2", + [6] = "count1", + }, + ok = { + [1] = "twrturn3", + }, + select = { + [1] = "twrturn3", + }, + }, + weapondefs = { + legflak_gun = { + accuracy = 1000, + sprayangle = 200, + areaofeffect = 150, + avoidfeature = false, + avoidfriendly = false, + burnblow = true, + canattackground = false, + burst = 2, + burstrate = 0.01, + cegtag = "flaktrailaa", + collidefriendly = false, + craterareaofeffect = 192, + craterboost = 0, + cratermult = 0, + cylindertargeting = 1, + edgeeffectiveness = 1, + explosiongenerator = "custom:flak", + gravityaffected = "true", + impulseboost = 0, + impulsefactor = 0, + mygravity = 0.01, + name = "Medium g2a Flak Blunderbuss", + noselfdamage = true, + predictboost = 1, + range = 1125, + reloadtime = 1.8, + soundhit = "flakhit2", + soundhitwet = "splslrg", + soundstart = "flakfire", + soundhitvolume = 7.5, + soundstartvolume = 9, + stages = 0, + turret = true, + weapontimer = 1, + weapontype = "Cannon", + weaponvelocity = 1600, + damage = { + vtol = 250, + }, + rgbcolor = { + [1] = 1, + [2] = 0.33, + [3] = 0.7, + }, + }, + }, + weapons = { + [1] = { + badtargetcategory = "NOTAIR LIGHTAIRSCOUT", + def = "LEGFLAK_GUN", + onlytargetcategory = "VTOL", + }, + }, + }, +} + diff --git a/units/Legion/Defenses/legstarfall.lua b/units/Legion/Defenses/legstarfall.lua index cd708f87034..e5c918305c0 100644 --- a/units/Legion/Defenses/legstarfall.lua +++ b/units/Legion/Defenses/legstarfall.lua @@ -3,8 +3,8 @@ return { maxacc = 0, maxdec = 0, buildangle = 29096, - energycost = 600000, - metalcost = 52500, + energycost = 660000, + metalcost = 58000, buildpic = "legstarfall.DDS", buildtime = 1400000, canrepeat = false, @@ -20,7 +20,7 @@ return { footprintz = 8, idleautoheal = 5, idletime = 1800, - health = 33500, + health = 26000, maxslope = 13, maxwaterdepth = 0, objectname = "Units/legstarfall.s3o", diff --git a/units/Legion/Economy/legadvsol.lua b/units/Legion/Economy/legadvsol.lua index 6b409a06097..ccd8c159d2e 100644 --- a/units/Legion/Economy/legadvsol.lua +++ b/units/Legion/Economy/legadvsol.lua @@ -4,10 +4,10 @@ return { activatewhenbuilt = true, maxdec = 0, buildangle = 33000, - energycost = 3500, + energycost = 4200, metalcost = 480, buildpic = "LEGADVSOL.DDS", - buildtime = 12000, + buildtime = 14000, canrepeat = false, category = "ALL NOTSUB NOWEAPON NOTAIR NOTHOVER SURFACE EMPABLE", collisionvolumeoffsets = "0 0 0", diff --git a/units/Legion/Labs/legvp.lua b/units/Legion/Labs/legvp.lua index 2172a49f97e..b8999039a0b 100644 --- a/units/Legion/Labs/legvp.lua +++ b/units/Legion/Labs/legvp.lua @@ -43,6 +43,7 @@ return { [6] = "leggat", [7] = "legbar", [8] = "legrail", + [9] = "cormlv", }, customparams = { usebuildinggrounddecal = true, diff --git a/units/Legion/Legion EvoCom/legcomlvl10.lua b/units/Legion/Legion EvoCom/legcomlvl10.lua index 38aa8d3e275..38fa4971e00 100644 --- a/units/Legion/Legion EvoCom/legcomlvl10.lua +++ b/units/Legion/Legion EvoCom/legcomlvl10.lua @@ -19,7 +19,7 @@ return { collisionvolumescales = "37 69 37", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 1500, + energymake = 2000, energystorage = 100, explodeas = "commanderExplosion", footprintx = 2, @@ -35,7 +35,7 @@ return { maxslope = 20, speed = 49.5, maxwaterdepth = 35, - metalmake = 100, + metalmake = 50, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -111,6 +111,8 @@ return { [50] = "legkeres", [51] = "legpede", [52] = "corasp", + [53] = "cornanotc", + [54] = "cornanotcplat", }, customparams = { unitgroup = 'builder', @@ -126,6 +128,9 @@ return { workertimeboost = 6, wtboostunittype = "MOBILE", stockpileLimit = 4, + inheritxpratemultiplier = 0.5, + childreninheritxp = "DRONE BOTCANNON", + parentsinheritxp = "MOBILEBUILT DRONE BOTCANNON", }, featuredefs = { dead = { @@ -243,7 +248,7 @@ return { }, }, torpedo = { - areaofeffect = 16, + areaofeffect = 75, avoidfeature = false, avoidfriendly = true, burnblow = true, @@ -259,7 +264,7 @@ return { flighttime = 1.8, impulseboost = 0.123, impulsefactor = 0.123, - model = "cortorpedo.s3o", + model = "coradvtorpedo.s3o", name = "Level1TorpedoLauncher", noselfdamage = true, predictboost = 1, @@ -275,7 +280,7 @@ return { weaponacceleration = 50, weapontimer = 3, weapontype = "TorpedoLauncher", - weaponvelocity = 200, + weaponvelocity = 425, damage = { -- commanders = 375, default = 400, --278.4375, diff --git a/units/Legion/Legion EvoCom/legcomlvl5.lua b/units/Legion/Legion EvoCom/legcomlvl5.lua index 0d8cf34328b..73bcdfb83f0 100644 --- a/units/Legion/Legion EvoCom/legcomlvl5.lua +++ b/units/Legion/Legion EvoCom/legcomlvl5.lua @@ -19,7 +19,7 @@ return { collisionvolumescales = "37 69 37", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + energymake = 200, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,7 +35,7 @@ return { maxslope = 20, speed = 39.5, maxwaterdepth = 35, - metalmake = 20, + metalmake = 14, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -106,6 +106,8 @@ return { [42] = "corsy", [43] = "corhp", [44] = "corfhp", + [45] = "cornanotc", + [46] = "cornanotcplat", }, customparams = { unitgroup = 'builder', @@ -126,8 +128,10 @@ return { evolution_target = "legcomlvl6", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, - + combatradius = 0, + inheritxpratemultiplier = 0.5, + childreninheritxp = "DRONE BOTCANNON", + parentsinheritxp = "MOBILEBUILT DRONE BOTCANNON", }, featuredefs = { dead = { @@ -275,7 +279,7 @@ return { name = "Level1TorpedoLauncher", noselfdamage = true, predictboost = 1, - range = 450, + range = 500, reloadtime = 0.8, soundhit = "xplodep2", soundstart = "torpedo1", @@ -287,7 +291,7 @@ return { weaponacceleration = 50, weapontimer = 3, weapontype = "TorpedoLauncher", - weaponvelocity = 200, + weaponvelocity = 425, damage = { -- commanders = 375, default = 250, --278.4375, diff --git a/units/Legion/Legion EvoCom/legcomlvl6.lua b/units/Legion/Legion EvoCom/legcomlvl6.lua index 28f693038ea..46f6b331ac4 100644 --- a/units/Legion/Legion EvoCom/legcomlvl6.lua +++ b/units/Legion/Legion EvoCom/legcomlvl6.lua @@ -19,7 +19,7 @@ return { collisionvolumescales = "37 69 37", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + energymake = 325, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -106,6 +106,8 @@ return { [42] = "corsy", [43] = "corhp", [44] = "corfhp", + [45] = "cornanotc", + [46] = "cornanotcplat", }, customparams = { unitgroup = 'builder', @@ -126,7 +128,10 @@ return { evolution_target = "legcomlvl7", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, + inheritxpratemultiplier = 0.5, + childreninheritxp = "DRONE BOTCANNON", + parentsinheritxp = "MOBILEBUILT DRONE BOTCANNON", }, featuredefs = { dead = { @@ -254,7 +259,7 @@ return { }, }, torpedo = { - areaofeffect = 16, + areaofeffect = 75, avoidfeature = false, avoidfriendly = true, burnblow = true, @@ -270,11 +275,11 @@ return { flighttime = 1.8, impulseboost = 0.123, impulsefactor = 0.123, - model = "cortorpedo.s3o", + model = "coradvtorpedo.s3o", name = "Level1TorpedoLauncher", noselfdamage = true, predictboost = 1, - range = 450, + range = 500, reloadtime = 0.8, soundhit = "xplodep2", soundstart = "torpedo1", @@ -286,7 +291,7 @@ return { weaponacceleration = 50, weapontimer = 3, weapontype = "TorpedoLauncher", - weaponvelocity = 200, + weaponvelocity = 425, damage = { -- commanders = 375, default = 300, --278.4375, diff --git a/units/Legion/Legion EvoCom/legcomlvl7.lua b/units/Legion/Legion EvoCom/legcomlvl7.lua index 7cf3b924828..c972a95d705 100644 --- a/units/Legion/Legion EvoCom/legcomlvl7.lua +++ b/units/Legion/Legion EvoCom/legcomlvl7.lua @@ -19,7 +19,7 @@ return { collisionvolumescales = "37 69 37", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + energymake = 525, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,7 +35,7 @@ return { maxslope = 20, speed = 43.5, maxwaterdepth = 35, - metalmake = 20, + metalmake = 27, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -109,6 +109,8 @@ return { [45] = "corfhp", [46] = "cormabm", [47] = "corasp", + [48] = "cornanotc", + [49] = "cornanotcplat", }, customparams = { unitgroup = 'builder', @@ -129,7 +131,11 @@ return { evolution_target = "legcomlvl8", evolution_condition = "timer", evolution_timer = 99999, + combatradius = 0, combatradius = 500, + inheritxpratemultiplier = 0.5, + childreninheritxp = "DRONE BOTCANNON", + parentsinheritxp = "MOBILEBUILT DRONE BOTCANNON", }, featuredefs = { dead = { @@ -244,7 +250,7 @@ return { }, }, torpedo = { - areaofeffect = 16, + areaofeffect = 75, avoidfeature = false, avoidfriendly = true, burnblow = true, @@ -260,7 +266,7 @@ return { flighttime = 1.8, impulseboost = 0.123, impulsefactor = 0.123, - model = "cortorpedo.s3o", + model = "coradvtorpedo.s3o", name = "Level1TorpedoLauncher", noselfdamage = true, predictboost = 1, @@ -276,7 +282,7 @@ return { weaponacceleration = 50, weapontimer = 3, weapontype = "TorpedoLauncher", - weaponvelocity = 200, + weaponvelocity = 425, damage = { -- commanders = 375, default = 300, --278.4375, diff --git a/units/Legion/Legion EvoCom/legcomlvl8.lua b/units/Legion/Legion EvoCom/legcomlvl8.lua index 7afd6fe9e48..ed2135c9989 100644 --- a/units/Legion/Legion EvoCom/legcomlvl8.lua +++ b/units/Legion/Legion EvoCom/legcomlvl8.lua @@ -19,7 +19,7 @@ return { collisionvolumescales = "37 69 37", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + energymake = 850, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,7 +35,7 @@ return { maxslope = 20, speed = 45.5, maxwaterdepth = 35, - metalmake = 20, + metalmake = 34, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -109,6 +109,8 @@ return { [45] = "corfhp", [46] = "cormabm", [47] = "corasp", + [48] = "cornanotc", + [49] = "cornanotcplat", }, customparams = { unitgroup = 'builder', @@ -128,8 +130,11 @@ return { evolution_announcement_size = 18.5, evolution_target = "legcomlvl9", evolution_condition = "timer", - evolution_timer = 210, - combatradius = 500, + evolution_timer = 99999, + combatradius = 0, + inheritxpratemultiplier = 0.5, + childreninheritxp = "DRONE BOTCANNON", + parentsinheritxp = "MOBILEBUILT DRONE BOTCANNON", }, featuredefs = { dead = { @@ -244,7 +249,7 @@ return { }, }, torpedo = { - areaofeffect = 16, + areaofeffect = 75, avoidfeature = false, avoidfriendly = true, burnblow = true, @@ -260,7 +265,7 @@ return { flighttime = 1.8, impulseboost = 0.123, impulsefactor = 0.123, - model = "cortorpedo.s3o", + model = "coradvtorpedo.s3o", name = "Level1TorpedoLauncher", noselfdamage = true, predictboost = 1, @@ -276,7 +281,7 @@ return { weaponacceleration = 50, weapontimer = 3, weapontype = "TorpedoLauncher", - weaponvelocity = 200, + weaponvelocity = 425, damage = { -- commanders = 375, default = 350, --278.4375, diff --git a/units/Legion/Legion EvoCom/legcomlvl9.lua b/units/Legion/Legion EvoCom/legcomlvl9.lua index 8b20c8cb458..4162d85cf2f 100644 --- a/units/Legion/Legion EvoCom/legcomlvl9.lua +++ b/units/Legion/Legion EvoCom/legcomlvl9.lua @@ -19,7 +19,7 @@ return { collisionvolumescales = "37 69 37", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 1500, + energymake = 1375, energystorage = 100, explodeas = "commanderExplosion", footprintx = 2, @@ -35,7 +35,7 @@ return { maxslope = 20, speed = 47.5, maxwaterdepth = 35, - metalmake = 100, + metalmake = 42, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -110,6 +110,8 @@ return { [49] = "cormabm", [50] = "legkeres", [51] = "corasp", + [52] = "cornanotc", + [53] = "cornanotcplat", }, customparams = { unitgroup = 'builder', @@ -130,7 +132,10 @@ return { evolution_target = "legcomlvl10", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, + inheritxpratemultiplier = 0.5, + childreninheritxp = "DRONE BOTCANNON", + parentsinheritxp = "MOBILEBUILT DRONE BOTCANNON", }, featuredefs = { dead = { @@ -248,7 +253,7 @@ return { }, }, torpedo = { - areaofeffect = 16, + areaofeffect = 75, avoidfeature = false, avoidfriendly = true, burnblow = true, @@ -264,7 +269,7 @@ return { flighttime = 1.8, impulseboost = 0.123, impulsefactor = 0.123, - model = "cortorpedo.s3o", + model = "coradvtorpedo.s3o", name = "Level1TorpedoLauncher", noselfdamage = true, predictboost = 1, @@ -280,7 +285,7 @@ return { weaponacceleration = 50, weapontimer = 3, weapontype = "TorpedoLauncher", - weaponvelocity = 200, + weaponvelocity = 425, damage = { -- commanders = 375, default = 350, --278.4375, diff --git a/units/Legion/Vehicles/T2 Vehicles/legfloat.lua b/units/Legion/Vehicles/T2 Vehicles/legfloat.lua index b8aae2bec1e..7f9eccc928f 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legfloat.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legfloat.lua @@ -21,7 +21,7 @@ return { idleautoheal = 5, idletime = 1800, leavetracks = true, - maxdamage = 3000, + maxdamage = 3500, maxslope = 10, speed = 60, maxwaterdepth = 12, diff --git a/units/Legion/Vehicles/T2 Vehicles/legvcarry.lua b/units/Legion/Vehicles/T2 Vehicles/legvcarry.lua index f467875c6bd..b6aedbbfc83 100644 --- a/units/Legion/Vehicles/T2 Vehicles/legvcarry.lua +++ b/units/Legion/Vehicles/T2 Vehicles/legvcarry.lua @@ -49,6 +49,9 @@ return { subfolder = "armvehicles", weapon1turretx = 45, weapon1turrety = 80, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/Legion/Vehicles/leghades.lua b/units/Legion/Vehicles/leghades.lua index 4ad4e6e0b00..d61edaf895b 100644 --- a/units/Legion/Vehicles/leghades.lua +++ b/units/Legion/Vehicles/leghades.lua @@ -2,8 +2,8 @@ return { leghades = { maxacc = 0.06788, maxdec = 0.13575, - energycost = 600, - metalcost = 50, + energycost = 750, + metalcost = 60, buildpic = "LEGHADES.DDS", buildtime = 1500, canmove = true, diff --git a/units/Legion/legcomlvl3.lua b/units/Legion/legcomlvl3.lua index 86e4566e9f0..31d97db49ab 100644 --- a/units/Legion/legcomlvl3.lua +++ b/units/Legion/legcomlvl3.lua @@ -71,7 +71,7 @@ return { [8] = "legvp", [9] = "legap", [10] = "coreyes", - [11] = "corrad", + [11] = "legrad", [12] = "legdrag", [13] = "leglht", [14] = "corrl", @@ -244,7 +244,7 @@ return { name = "Level1TorpedoLauncher", noselfdamage = true, predictboost = 1, - range = 400, + range = 500, reloadtime = 1.2, soundhit = "xplodep2", soundstart = "torpedo1", @@ -256,7 +256,7 @@ return { weaponacceleration = 50, weapontimer = 3, weapontype = "TorpedoLauncher", - weaponvelocity = 200, + weaponvelocity = 425, damage = { default = 250, subs = 125, diff --git a/units/Legion/legcomlvl4.lua b/units/Legion/legcomlvl4.lua index bf4c9e35632..b288344b56e 100644 --- a/units/Legion/legcomlvl4.lua +++ b/units/Legion/legcomlvl4.lua @@ -71,7 +71,7 @@ return { [8] = "legvp", [9] = "legap", [10] = "coreyes", - [11] = "corrad", + [11] = "legrad", [12] = "legdrag", [13] = "leglht", [14] = "corrl", diff --git a/units/Scavengers/Air/cordronecarryair.lua b/units/Scavengers/Air/cordronecarryair.lua index b1e78085f64..03ccdc05551 100644 --- a/units/Scavengers/Air/cordronecarryair.lua +++ b/units/Scavengers/Air/cordronecarryair.lua @@ -51,6 +51,9 @@ return { normaltex = "unittextures/cor_normal.dds", subfolder = "scavengers/air", techlevel = 3, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua b/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua index 6406ed7c2f2..9e23b414ca1 100644 --- a/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua +++ b/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua @@ -42,6 +42,9 @@ return { --removewait = true, subfolder = "armbuildings/landdefenceoffence", techlevel = 2, + inheritxpratemultiplier = 1, + childreninheritxp = "BOTCANNON", + parentsinheritxp = "BOTCANNON", }, featuredefs = { dead = { diff --git a/units/Scavengers/Vehicles/armdronecarryland.lua b/units/Scavengers/Vehicles/armdronecarryland.lua index b281b214c0d..656b80f3ec5 100644 --- a/units/Scavengers/Vehicles/armdronecarryland.lua +++ b/units/Scavengers/Vehicles/armdronecarryland.lua @@ -48,6 +48,9 @@ return { normaltex = "unittextures/Arm_normal.dds", subfolder = "scavengers/vehicles", techlevel = 3, + inheritxpratemultiplier = 1, + childreninheritxp = "DRONE", + parentsinheritxp = "DRONE", }, featuredefs = { dead = { diff --git a/units/other/evocom/armcomlvl10.lua b/units/other/evocom/armcomlvl10.lua index 853ab3e4541..e2be05186c4 100644 --- a/units/other/evocom/armcomlvl10.lua +++ b/units/other/evocom/armcomlvl10.lua @@ -23,7 +23,8 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 1500, + decloakonfire = false, + energymake = 2000, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,11 +36,11 @@ return { idletime = 450, sightemitheight = 40, mass = 99999, - health = 22000, + health = 15600, maxslope = 20, speed = 60, maxwaterdepth = 35, - metalmake = 100, + metalmake = 50, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -270,7 +271,7 @@ return { name = "UWSupernovaBeam", noselfdamage = true, range = 500, - reloadtime = 0.3, + reloadtime = 0.28, rgbcolor = "0.5 0.7 0.10", rgbcolor2 = "1 1 1", soundhitdry = "", @@ -285,8 +286,8 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 1900, - subs = 1150, + default = 1400, + subs = 700, }, }, disintegrator = { @@ -328,6 +329,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/armcomlvl2.lua b/units/other/evocom/armcomlvl2.lua index b4d4efcd8b6..a59fc5c1d3f 100644 --- a/units/other/evocom/armcomlvl2.lua +++ b/units/other/evocom/armcomlvl2.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 25, + energymake = 50, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -38,7 +38,7 @@ return { maxslope = 20, speed = 37.5, maxwaterdepth = 35, - metalmake = 2, + metalmake = 3, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -103,7 +103,7 @@ return { normaltex = "unittextures/Arm_normal.dds", paralyzemultiplier = 0.025, subfolder = "", - combatradius = 500, + combatradius = 0, evolution_announcement = "Armada commanders have upgraded to level 3", evolution_announcement_size = 18.5, evolution_target = "armcomlvl3", @@ -307,6 +307,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/armcomlvl3.lua b/units/other/evocom/armcomlvl3.lua index 5379ce48e78..0ef2fbe4e6d 100644 --- a/units/other/evocom/armcomlvl3.lua +++ b/units/other/evocom/armcomlvl3.lua @@ -23,7 +23,8 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 25, + decloakonfire = false, + energymake = 75, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,11 +36,11 @@ return { idletime = 1800, sightemitheight = 40, mass = 4900, - health = 8000, + health = 7200, maxslope = 20, speed = 60, maxwaterdepth = 35, - metalmake = 2, + metalmake = 5, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -113,7 +114,7 @@ return { evolution_target = "armcomlvl4", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, stockpileLimit = 30, }, featuredefs = { @@ -258,7 +259,7 @@ return { name = "J7NSLaser", noselfdamage = true, range = 450, - reloadtime = 0.25, + reloadtime = 0.44, rgbcolor = "0.2 0.8 0.3", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -316,6 +317,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/armcomlvl4.lua b/units/other/evocom/armcomlvl4.lua index eebd0bf807b..bcadb35e089 100644 --- a/units/other/evocom/armcomlvl4.lua +++ b/units/other/evocom/armcomlvl4.lua @@ -23,7 +23,8 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 25, + decloakonfire = false, + energymake = 125, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,11 +36,11 @@ return { idletime = 900, sightemitheight = 40, mass = 4900, - health = 10000, + health = 8400, maxslope = 20, speed = 60, maxwaterdepth = 35, - metalmake = 2, + metalmake = 9, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -113,7 +114,7 @@ return { evolution_target = "armcomlvl5", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, stockpileLimit = 30, }, featuredefs = { @@ -258,7 +259,7 @@ return { name = "J7NSLaser", noselfdamage = true, range = 450, - reloadtime = 0.178, + reloadtime = 0.36, rgbcolor = "0.2 0.8 0.3", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -316,6 +317,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/armcomlvl5.lua b/units/other/evocom/armcomlvl5.lua index fa81e67adf1..1b214409d9a 100644 --- a/units/other/evocom/armcomlvl5.lua +++ b/units/other/evocom/armcomlvl5.lua @@ -23,7 +23,8 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + decloakonfire = false, + energymake = 200, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,11 +36,11 @@ return { idletime = 900, sightemitheight = 40, mass = 99999, - health = 12000, + health = 9600, maxslope = 20, speed = 60, maxwaterdepth = 35, - metalmake = 20, + metalmake = 14, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -127,7 +128,7 @@ return { evolution_target = "armcomlvl6", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, stockpileLimit = 30, workertimeboost = 4, wtboostunittype = "MOBILE", @@ -277,7 +278,7 @@ return { name = "UltravioletRayBeam", noselfdamage = true, range = 475, - reloadtime = 0.47, + reloadtime = 0.74, rgbcolor = "0.6 0.2 0.6", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -335,6 +336,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/armcomlvl6.lua b/units/other/evocom/armcomlvl6.lua index 649c89d9985..62892edf3f6 100644 --- a/units/other/evocom/armcomlvl6.lua +++ b/units/other/evocom/armcomlvl6.lua @@ -23,7 +23,8 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + decloakonfire = false, + energymake = 325, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,7 +36,7 @@ return { idletime = 900, sightemitheight = 40, mass = 99999, - health = 14000, + health = 10800, maxslope = 20, speed = 60, maxwaterdepth = 35, @@ -127,7 +128,7 @@ return { evolution_target = "armcomlvl7", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, stockpileLimit = 30, workertimeboost = 4, wtboostunittype = "MOBILE", @@ -277,7 +278,7 @@ return { name = "UltravioletRayBeam", noselfdamage = true, range = 475, - reloadtime = 0.397, + reloadtime = 0.54, rgbcolor = "0.6 0.2 0.6", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -335,6 +336,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/armcomlvl7.lua b/units/other/evocom/armcomlvl7.lua index 64136381268..d5ab94301ec 100644 --- a/units/other/evocom/armcomlvl7.lua +++ b/units/other/evocom/armcomlvl7.lua @@ -23,7 +23,8 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + decloakonfire = false, + energymake = 525, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,11 +36,11 @@ return { idletime = 450, sightemitheight = 40, mass = 99999, - health = 16000, + health = 12000, maxslope = 20, speed = 60, maxwaterdepth = 35, - metalmake = 20, + metalmake = 27, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -127,7 +128,7 @@ return { evolution_target = "armcomlvl8", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, stockpileLimit = 30, workertimeboost = 4, wtboostunittype = "MOBILE", @@ -277,7 +278,7 @@ return { name = "UltravioletRayBeam", noselfdamage = true, range = 500, - reloadtime = 0.382, + reloadtime = 0.43, rgbcolor = "0.6 0.2 0.6", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -292,7 +293,7 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 1400, + default = 1200, subs = 600, }, }, @@ -335,6 +336,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/armcomlvl8.lua b/units/other/evocom/armcomlvl8.lua index 2a05cde38b7..e34b4aaead6 100644 --- a/units/other/evocom/armcomlvl8.lua +++ b/units/other/evocom/armcomlvl8.lua @@ -23,7 +23,8 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + decloakonfire = false, + energymake = 850, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,11 +36,11 @@ return { idletime = 450, sightemitheight = 40, mass = 99999, - health = 18000, + health = 13200, maxslope = 20, speed = 60, maxwaterdepth = 35, - metalmake = 20, + metalmake = 34, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -126,7 +127,7 @@ return { evolution_target = "armcomlvl9", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, stockpileLimit = 30, workertimeboost = 4, wtboostunittype = "MOBILE", @@ -276,7 +277,7 @@ return { name = "UWSupernovaBeam", noselfdamage = true, range = 500, - reloadtime = 0.3, + reloadtime = 0.40, rgbcolor = "0.1 0.2 0.7", rgbcolor2 = "0.9 0.9 0.9", soundhitdry = "", @@ -291,8 +292,8 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 1500, - subs = 800, + default = 1400, + subs = 700, }, }, disintegrator = { @@ -334,6 +335,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/armcomlvl9.lua b/units/other/evocom/armcomlvl9.lua index 402bbb3e8b5..07291ff5da7 100644 --- a/units/other/evocom/armcomlvl9.lua +++ b/units/other/evocom/armcomlvl9.lua @@ -23,7 +23,8 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 1500, + decloakonfire = false, + energymake = 1375, energystorage = 500, explodeas = "commanderExplosion", footprintx = 2, @@ -35,11 +36,11 @@ return { idletime = 450, sightemitheight = 40, mass = 99999, - health = 20000, + health = 14400, maxslope = 20, speed = 60, maxwaterdepth = 35, - metalmake = 100, + metalmake = 42, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -126,7 +127,7 @@ return { evolution_target = "armcomlvl10", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, stockpileLimit = 30, workertimeboost = 4, wtboostunittype = "MOBILE", @@ -276,7 +277,7 @@ return { name = "UWSupernovaBeam", noselfdamage = true, range = 500, - reloadtime = 0.3, + reloadtime = 0.33, rgbcolor = "0.2 0.3 0.8", rgbcolor2 = "1 1 1", soundhitdry = "", @@ -291,8 +292,8 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 1750, - subs = 1000, + default = 1400, + subs = 700, }, }, disintegrator = { @@ -334,6 +335,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/babyunits/babyarmvader.lua b/units/other/evocom/babyunits/babyarmvader.lua index afea4834727..6bad7bb74a5 100644 --- a/units/other/evocom/babyunits/babyarmvader.lua +++ b/units/other/evocom/babyunits/babyarmvader.lua @@ -4,7 +4,7 @@ return { maxacc = 0.5589, activatewhenbuilt = true, maxdec = 0.5589, - energycost = 0, + energycost = 500, metalcost = 0, buildpic = "ARMVADER.DDS", buildtime = 7900, @@ -35,6 +35,7 @@ return { nochasecategory = "VTOL", objectname = "Units/ARMVADER.s3o", pushresistant = false, + power = 20000, script = "Units/ARMVADER.cob", seismicsignature = 0, selfdestructas = "BABYARMVADER_EXP1", diff --git a/units/other/evocom/corcomlvl10.lua b/units/other/evocom/corcomlvl10.lua index a4a797cb121..084962c4b34 100644 --- a/units/other/evocom/corcomlvl10.lua +++ b/units/other/evocom/corcomlvl10.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 1500, + energymake = 2000, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -38,12 +38,12 @@ return { maxslope = 20, speed = 47, maxwaterdepth = 35, - metalmake = 100, + metalmake = 50, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", nochasecategory = "ALL", - objectname = "Units/CORCOMHILVL"..(Spring.GetModOptions().xmas and '-XMAS' or '')..".s3o", + objectname = "Units/CORCOMHILVL.s3o", pushresistant = true, radardistance = 1500, radaremitheight = 40, @@ -115,7 +115,7 @@ return { paralyzemultiplier = 0.025, subfolder = "", shield_color_mult = 0.8, - shield_power = 24000, + shield_power = 30000, shield_radius = 100, maxrange = "500", }, @@ -249,7 +249,7 @@ return { weapontype = "Flame", weaponvelocity = 500, damage = { - default = 130, + default = 120, subs = 49, } }, @@ -273,8 +273,8 @@ return { laserflaresize = 5.5, name = "UWSupernovaBeam", noselfdamage = true, - range = 600, - reloadtime = 0.3, + range = 500, + reloadtime = 0.4, rgbcolor = "0.5 0.7 0.10", rgbcolor2 = "1 1 1", soundhitdry = "", @@ -289,8 +289,8 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 1900, - subs = 1150, + default = 1400, + subs = 700, }, }, disintegrator = { @@ -332,6 +332,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, corcomeyelaser = { @@ -392,13 +393,13 @@ return { armortype = "shields", force = 2.5, intercepttype = 11111, - power = 36000, - powerregen = 1200, - powerregenenergy = 120, + power = 30000, + powerregen = 500, + powerregenenergy = 50, radius = 100, repulser = false, smart = true, - startingpower = 36000, + startingpower = 30000, visiblerepulse = false, badcolor = { [1] = 1, @@ -413,6 +414,33 @@ return { [4] = 0.17, }, }, + }, + armcannon = { + areaofeffect = 292, + avoidfeature = false, + craterareaofeffect = 292, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "custom:genericshellexplosion-large-aoe", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 600, + reloadtime = 3, + soundhit = "xplomed4", + soundhitwet = "splslrg", + soundstart = "cannhvy2", + turret = true, + weapontype = "Cannon", + weaponvelocity = 310, + damage = { + default = 1350, + subs = 300, + vtol = 100, + }, }, }, weapons = { @@ -439,6 +467,11 @@ return { onlytargetcategory = "NOTSUB", fastautoretargeting = true, }, + [6] = { + def = "ARMCANNON", + onlytargetcategory = "SURFACE", + fastautoretargeting = true, + }, }, }, } diff --git a/units/other/evocom/corcomlvl2.lua b/units/other/evocom/corcomlvl2.lua index 5c9bb4c168a..fa3e85837a5 100644 --- a/units/other/evocom/corcomlvl2.lua +++ b/units/other/evocom/corcomlvl2.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 25, + energymake = 50, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -38,7 +38,7 @@ return { maxslope = 20, speed = 37.5, maxwaterdepth = 35, - metalmake = 2, + metalmake = 3, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -107,7 +107,7 @@ return { evolution_target = "corcomlvl3", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, }, featuredefs = { dead = { @@ -310,6 +310,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, repulsor1 = { diff --git a/units/other/evocom/corcomlvl3.lua b/units/other/evocom/corcomlvl3.lua index 0976d295d6a..1a2b00e2d14 100644 --- a/units/other/evocom/corcomlvl3.lua +++ b/units/other/evocom/corcomlvl3.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 25, + energymake = 75, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -38,7 +38,7 @@ return { maxslope = 20, speed = 37.5, maxwaterdepth = 35, - metalmake = 2, + metalmake = 5, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -107,9 +107,9 @@ return { evolution_target = "corcomlvl4", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, shield_color_mult = 0.8, - shield_power = 5000, + shield_power = 6250, shield_radius = 100, }, featuredefs = { @@ -261,7 +261,7 @@ return { name = "J7NSLaser", noselfdamage = true, range = 450, - reloadtime = 0.25, + reloadtime = 0.46, rgbcolor = "0.2 0.8 0.3", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -319,6 +319,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, corcomeyelaser = { @@ -376,13 +377,13 @@ return { armortype = "shields", force = 2.5, intercepttype = 11111, - power = 7500, - powerregen = 250, - powerregenenergy = 25, + power = 6250, + powerregen = 100, + powerregenenergy = 10, radius = 100, repulser = false, smart = true, - startingpower = 7500, + startingpower = 6250, visiblerepulse = false, badcolor = { [1] = 1, diff --git a/units/other/evocom/corcomlvl4.lua b/units/other/evocom/corcomlvl4.lua index 9d17e4c431a..22a6ee451cd 100644 --- a/units/other/evocom/corcomlvl4.lua +++ b/units/other/evocom/corcomlvl4.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 25, + energymake = 125, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -38,7 +38,7 @@ return { maxslope = 20, speed = 37.5, maxwaterdepth = 35, - metalmake = 2, + metalmake = 9, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -103,14 +103,14 @@ return { paralyzemultiplier = 0.025, subfolder = "", shield_color_mult = 0.8, - shield_power = 6300, + shield_power = 7800, shield_radius = 100, evolution_announcement = "Cortex commanders have upgraded to level 5", evolution_announcement_size = 18.5, evolution_target = "corcomlvl5", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, }, featuredefs = { dead = { @@ -233,7 +233,7 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 450, + default = 400, subs = 200, }, }, @@ -259,8 +259,8 @@ return { laserflaresize = 5.5, name = "J7NSLaser", noselfdamage = true, - range = 500, - reloadtime = 0.178, + range = 450, + reloadtime = 0.42, rgbcolor = "0.2 0.8 0.3", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -318,6 +318,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, corcomeyelaser = { @@ -375,13 +376,13 @@ return { armortype = "shields", force = 2.5, intercepttype = 11111, - power = 9450, - powerregen = 315, - powerregenenergy = 31, + power = 7800, + powerregen = 150, + powerregenenergy = 15, radius = 100, repulser = false, smart = true, - startingpower = 9450, + startingpower = 7800, visiblerepulse = false, badcolor = { [1] = 1, @@ -397,6 +398,33 @@ return { }, }, }, + armcannon = { + areaofeffect = 144, + avoidfeature = false, + craterareaofeffect = 292, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "custom:genericshellexplosion-medium", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 500, + reloadtime = 3, + soundhit = "corlevlrhit", + soundhitwet = "splslrg", + soundstart = "corlevlr", + turret = true, + weapontype = "Cannon", + weaponvelocity = 310, + damage = { + default = 190, + subs = 100, + vtol = 23, + }, + }, }, weapons = { [1] = { @@ -421,7 +449,12 @@ return { def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", fastautoretargeting = true, - }, + }, + [6] = { + def = "ARMCANNON", + onlytargetcategory = "SURFACE", + fastautoretargeting = true, + }, }, }, } diff --git a/units/other/evocom/corcomlvl5.lua b/units/other/evocom/corcomlvl5.lua index 5bf493f98f2..bc90c908c4f 100644 --- a/units/other/evocom/corcomlvl5.lua +++ b/units/other/evocom/corcomlvl5.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + energymake = 200, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -38,7 +38,7 @@ return { maxslope = 20, speed = 39, maxwaterdepth = 35, - metalmake = 20, + metalmake = 14, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -114,14 +114,14 @@ return { paralyzemultiplier = 0.025, subfolder = "", shield_color_mult = 0.8, - shield_power = 7800, + shield_power = 9800, shield_radius = 100, evolution_announcement = "Cortex commanders have upgraded to level 6", evolution_announcement_size = 18.5, evolution_target = "corcomlvl6", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, }, featuredefs = { dead = { @@ -249,7 +249,7 @@ return { weapontype = "Flame", weaponvelocity = 300, damage = { - default = 97, + default = 90, subs = 25, }, }, @@ -273,8 +273,8 @@ return { laserflaresize = 5.5, name = "UltravioletRayBeam", noselfdamage = true, - range = 550, - reloadtime = 0.47, + range = 475, + reloadtime = 0.92, rgbcolor = "0.6 0.2 0.6", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -332,6 +332,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, corcomeyelaser = { @@ -389,13 +390,13 @@ return { armortype = "shields", force = 2.5, intercepttype = 11111, - power = 11700, - powerregen = 390, - powerregenenergy = 39, + power = 9800, + powerregen = 200, + powerregenenergy = 20, radius = 100, repulser = false, smart = true, - startingpower = 11700, + startingpower = 9800, visiblerepulse = false, badcolor = { [1] = 1, @@ -411,6 +412,33 @@ return { }, }, }, + armcannon = { + areaofeffect = 144, + avoidfeature = false, + craterareaofeffect = 292, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "custom:genericshellexplosion-medium", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 500, + reloadtime = 3, + soundhit = "corlevlrhit", + soundhitwet = "splslrg", + soundstart = "corlevlr", + turret = true, + weapontype = "Cannon", + weaponvelocity = 310, + damage = { + default = 300, + subs = 100, + vtol = 23, + }, + }, }, weapons = { [1] = { @@ -435,7 +463,12 @@ return { def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", fastautoretargeting = true, - }, + }, + [6] = { + def = "ARMCANNON", + onlytargetcategory = "SURFACE", + fastautoretargeting = true, + }, }, }, } diff --git a/units/other/evocom/corcomlvl6.lua b/units/other/evocom/corcomlvl6.lua index ab323364ca6..cf95a32d240 100644 --- a/units/other/evocom/corcomlvl6.lua +++ b/units/other/evocom/corcomlvl6.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + energymake = 325, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -114,14 +114,14 @@ return { paralyzemultiplier = 0.025, subfolder = "", shield_color_mult = 0.8, - shield_power = 9800, + shield_power = 12200, shield_radius = 100, evolution_announcement = "Cortex commanders have upgraded to level 7", evolution_announcement_size = 18.5, evolution_target = "corcomlvl7", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, }, featuredefs = { dead = { @@ -249,7 +249,7 @@ return { weapontype = "Flame", weaponvelocity = 300, damage = { - default = 97, + default = 90, subs = 25, }, }, @@ -273,8 +273,8 @@ return { laserflaresize = 5.5, name = "UltravioletRayBeam", noselfdamage = true, - range = 550, - reloadtime = 0.397, + range = 475, + reloadtime = 0.70, rgbcolor = "0.6 0.2 0.6", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -331,6 +331,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, corcomeyelaser = { @@ -392,13 +393,13 @@ return { armortype = "shields", force = 2.5, intercepttype = 11111, - power = 14700, - powerregen = 490, - powerregenenergy = 49, + power = 12200, + powerregen = 250, + powerregenenergy = 25, radius = 100, repulser = false, smart = true, - startingpower = 14700, + startingpower = 12200, visiblerepulse = false, badcolor = { [1] = 1, @@ -414,6 +415,33 @@ return { }, }, }, + armcannon = { + areaofeffect = 144, + avoidfeature = false, + craterareaofeffect = 292, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "custom:genericshellexplosion-medium", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 500, + reloadtime = 3, + soundhit = "corlevlrhit", + soundhitwet = "splslrg", + soundstart = "corlevlr", + turret = true, + weapontype = "Cannon", + weaponvelocity = 310, + damage = { + default = 450, + subs = 120, + vtol = 28, + }, + }, }, weapons = { [1] = { @@ -438,7 +466,12 @@ return { def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", fastautoretargeting = true, - }, + }, + [6] = { + def = "ARMCANNON", + onlytargetcategory = "SURFACE", + fastautoretargeting = true, + }, }, }, } diff --git a/units/other/evocom/corcomlvl7.lua b/units/other/evocom/corcomlvl7.lua index 54893769430..87f2b1fc339 100644 --- a/units/other/evocom/corcomlvl7.lua +++ b/units/other/evocom/corcomlvl7.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + energymake = 525, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -38,7 +38,7 @@ return { maxslope = 20, speed = 42, maxwaterdepth = 35, - metalmake = 20, + metalmake = 27, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -114,14 +114,14 @@ return { paralyzemultiplier = 0.025, subfolder = "", shield_color_mult = 0.8, - shield_power = 12200, + shield_power = 15200, shield_radius = 100, evolution_announcement = "Cortex commanders have upgraded to level 8", evolution_announcement_size = 18.5, evolution_target = "corcomlvl8", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, }, featuredefs = { dead = { @@ -249,7 +249,7 @@ return { weapontype = "Flame", weaponvelocity = 300, damage = { - default = 97, + default = 90, subs = 25, }, }, @@ -273,8 +273,8 @@ return { laserflaresize = 5.5, name = "UltravioletRayBeam", noselfdamage = true, - range = 550, - reloadtime = 0.382, + range = 500, + reloadtime = 0.55, rgbcolor = "0.6 0.2 0.6", rgbcolor2 = "0.2 0.2 0.2", soundhitdry = "", @@ -289,7 +289,7 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 1400, + default = 1200, subs = 600, }, }, @@ -332,6 +332,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, corcomeyelaser = { @@ -393,13 +394,13 @@ return { armortype = "shields", force = 2.5, intercepttype = 11111, - power = 18300, - powerregen = 610, - powerregenenergy = 61, + power = 15200, + powerregen = 308, + powerregenenergy = 30, radius = 100, repulser = false, smart = true, - startingpower = 18300, + startingpower = 15200, visiblerepulse = false, badcolor = { [1] = 1, @@ -415,6 +416,33 @@ return { }, }, }, + armcannon = { + areaofeffect = 210, + avoidfeature = false, + craterareaofeffect = 292, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "custom:genericshellexplosion-large-aoe", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 550, + reloadtime = 3, + soundhit = "xplomed4", + soundhitwet = "splslrg", + soundstart = "largegun", + turret = true, + weapontype = "Cannon", + weaponvelocity = 310, + damage = { + default = 600, + subs = 130, + vtol = 35, + }, + }, }, weapons = { [1] = { @@ -439,7 +467,12 @@ return { def = "CORCOMEYELASER", onlytargetcategory = "NOTSUB", fastautoretargeting = true, - }, + }, + [6] = { + def = "ARMCANNON", + onlytargetcategory = "SURFACE", + fastautoretargeting = true, + }, }, }, } diff --git a/units/other/evocom/corcomlvl8.lua b/units/other/evocom/corcomlvl8.lua index ed97bb2dd3d..907171472f6 100644 --- a/units/other/evocom/corcomlvl8.lua +++ b/units/other/evocom/corcomlvl8.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 250, + energymake = 850, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -38,7 +38,7 @@ return { maxslope = 20, speed = 43.5, maxwaterdepth = 35, - metalmake = 20, + metalmake = 34, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -115,14 +115,14 @@ return { paralyzemultiplier = 0.025, subfolder = "", shield_color_mult = 0.8, - shield_power = 15000, + shield_power = 19000, shield_radius = 100, evolution_announcement = "Cortex commanders have upgraded to level 9", evolution_announcement_size = 18.5, evolution_target = "corcomlvl9", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, maxrange = "500", }, featuredefs = { @@ -255,7 +255,7 @@ return { weapontype = "Flame", weaponvelocity = 500, damage = { - default = 87, + default = 80, subs = 25, } }, @@ -279,8 +279,8 @@ return { laserflaresize = 5.5, name = "UWSupernovaBeam", noselfdamage = true, - range = 600, - reloadtime = 0.3, + range = 500, + reloadtime = 0.54, rgbcolor = "0.1 0.2 0.7", rgbcolor2 = "0.9 0.9 0.9", soundhitdry = "", @@ -295,8 +295,8 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 1500, - subs = 800, + default = 1400, + subs = 700, }, }, disintegrator = { @@ -338,6 +338,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, corcomeyelaser = { @@ -399,13 +400,13 @@ return { armortype = "shields", force = 2.5, intercepttype = 11111, - power = 22500, - powerregen = 750, - powerregenenergy = 75, + power = 19000, + powerregen = 366, + powerregenenergy = 36, radius = 100, repulser = false, smart = true, - startingpower = 22500, + startingpower = 19000, visiblerepulse = false, badcolor = { [1] = 1, @@ -421,6 +422,33 @@ return { }, }, }, + armcannon = { + areaofeffect = 210, + avoidfeature = false, + craterareaofeffect = 292, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "custom:genericshellexplosion-large-aoe", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 550, + reloadtime = 3, + soundhit = "xplomed4", + soundhitwet = "splslrg", + soundstart = "largegun", + turret = true, + weapontype = "Cannon", + weaponvelocity = 310, + damage = { + default = 700, + subs = 150, + vtol = 40, + }, + }, }, weapons = { [1] = { @@ -446,6 +474,11 @@ return { onlytargetcategory = "NOTSUB", fastautoretargeting = true, }, + [6] = { + def = "ARMCANNON", + onlytargetcategory = "SURFACE", + fastautoretargeting = true, + }, }, }, } diff --git a/units/other/evocom/corcomlvl9.lua b/units/other/evocom/corcomlvl9.lua index 8d5402494ec..6970305aa38 100644 --- a/units/other/evocom/corcomlvl9.lua +++ b/units/other/evocom/corcomlvl9.lua @@ -22,7 +22,7 @@ return { collisionvolumescales = "28 52 28", collisionvolumetype = "CylY", corpse = "DEAD", - energymake = 1500, + energymake = 1375, energystorage = 500, explodeas = "commanderexplosion", footprintx = 2, @@ -38,7 +38,7 @@ return { maxslope = 20, speed = 45, maxwaterdepth = 35, - metalmake = 100, + metalmake = 42, metalstorage = 500, mincloakdistance = 50, movementclass = "COMMANDERBOT", @@ -115,14 +115,14 @@ return { paralyzemultiplier = 0.025, subfolder = "", shield_color_mult = 0.8, - shield_power = 19000, + shield_power = 24000, shield_radius = 100, evolution_announcement = "Cortex commanders have upgraded to level 10 (max)", evolution_announcement_size = 18.5, evolution_target = "corcomlvl10", evolution_condition = "timer", evolution_timer = 99999, - combatradius = 500, + combatradius = 0, maxrange = "500", }, featuredefs = { @@ -255,7 +255,7 @@ return { weapontype = "Flame", weaponvelocity = 500, damage = { - default = 104, + default = 96, subs = 38, } }, @@ -279,8 +279,8 @@ return { laserflaresize = 5.5, name = "UWSupernovaBeam", noselfdamage = true, - range = 600, - reloadtime = 0.3, + range = 500, + reloadtime = 0.46, rgbcolor = "0.2 0.3 0.8", rgbcolor2 = "1 1 1", soundhitdry = "", @@ -295,8 +295,8 @@ return { weapontype = "BeamLaser", weaponvelocity = 700, damage = { - default = 1750, - subs = 1000, + default = 1400, + subs = 700, }, }, disintegrator = { @@ -338,6 +338,7 @@ return { commanders = 0, default = 99999, scavboss = 1000, + raptorqueen = 1000, }, }, corcomeyelaser = { @@ -398,13 +399,13 @@ return { armortype = "shields", force = 2.5, intercepttype = 11111, - power = 28500, - powerregen = 950, - powerregenenergy = 95, + power = 24000, + powerregen = 424, + powerregenenergy = 42, radius = 100, repulser = false, smart = true, - startingpower = 28500, + startingpower = 24000, visiblerepulse = false, badcolor = { [1] = 1, @@ -420,6 +421,33 @@ return { }, }, }, + armcannon = { + areaofeffect = 292, + avoidfeature = false, + craterareaofeffect = 292, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.15, + explosiongenerator = "custom:genericshellexplosion-large-aoe", + gravityaffected = "true", + impulseboost = 0.123, + impulsefactor = 0.123, + name = "HeavyCannon", + noselfdamage = true, + range = 600, + reloadtime = 3, + soundhit = "xplomed4", + soundhitwet = "splslrg", + soundstart = "cannhvy2", + turret = true, + weapontype = "Cannon", + weaponvelocity = 310, + damage = { + default = 900, + subs = 200, + vtol = 55, + }, + }, }, weapons = { [1] = { @@ -445,6 +473,11 @@ return { onlytargetcategory = "NOTSUB", fastautoretargeting = true, }, + [6] = { + def = "ARMCANNON", + onlytargetcategory = "SURFACE", + fastautoretargeting = true, + }, }, }, } diff --git a/units/other/raptors/Healer/raptor_land_swarmer_heal_t1_v1.lua b/units/other/raptors/Healer/raptor_land_swarmer_heal_t1_v1.lua index a207a5e3d68..12f6f8cb93c 100644 --- a/units/other/raptors/Healer/raptor_land_swarmer_heal_t1_v1.lua +++ b/units/other/raptors/Healer/raptor_land_swarmer_heal_t1_v1.lua @@ -10,7 +10,7 @@ return { builder = 1, buildpic = "raptors/raptorhealer.DDS", buildtime = 750, - canassist = 0, + canassist = 1, canbuild = 1, canguard = 1, canmove = 1, @@ -65,6 +65,10 @@ return { upright = false, waterline = 12, workertime = 250, + buildoptions = { + "raptor_turret_basic_t2_v1", + "raptor_turret_antiair_t2_v1", + }, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/raptors/Healer/raptor_land_swarmer_heal_t2_v1.lua b/units/other/raptors/Healer/raptor_land_swarmer_heal_t2_v1.lua index 96f815ded35..21c3fd1276f 100644 --- a/units/other/raptors/Healer/raptor_land_swarmer_heal_t2_v1.lua +++ b/units/other/raptors/Healer/raptor_land_swarmer_heal_t2_v1.lua @@ -10,7 +10,7 @@ return { builder = 1, buildpic = "raptors/raptorhealer.DDS", buildtime = 750, - canassist = 0, + canassist = 1, canbuild = 1, canguard = 1, canmove = 1, @@ -65,6 +65,12 @@ return { upright = false, waterline = 12, workertime = 500, + buildoptions = { + "raptor_turret_basic_t2_v1", + "raptor_turret_antiair_t2_v1", + "raptor_turret_acid_t2_v1", + "raptor_turret_emp_t2_v1", + }, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/raptors/Healer/raptor_land_swarmer_heal_t3_v1.lua b/units/other/raptors/Healer/raptor_land_swarmer_heal_t3_v1.lua index ef90203e54a..f284f1921f0 100644 --- a/units/other/raptors/Healer/raptor_land_swarmer_heal_t3_v1.lua +++ b/units/other/raptors/Healer/raptor_land_swarmer_heal_t3_v1.lua @@ -10,7 +10,7 @@ return { builder = 1, buildpic = "raptors/raptorhealer.DDS", buildtime = 750, - canassist = 0, + canassist = 1, canbuild = 1, canguard = 1, canmove = 1, @@ -65,6 +65,12 @@ return { upright = false, waterline = 12, workertime = 750, + buildoptions = { + "raptor_turret_basic_t3_v1", + "raptor_turret_antiair_t3_v1", + "raptor_turret_acid_t2_v1", + "raptor_turret_emp_t2_v1", + }, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/raptors/Healer/raptor_land_swarmer_heal_t4_v1.lua b/units/other/raptors/Healer/raptor_land_swarmer_heal_t4_v1.lua index d907d3b6f52..029b58434ea 100644 --- a/units/other/raptors/Healer/raptor_land_swarmer_heal_t4_v1.lua +++ b/units/other/raptors/Healer/raptor_land_swarmer_heal_t4_v1.lua @@ -10,7 +10,7 @@ return { builder = 1, buildpic = "raptors/raptorhealer.DDS", buildtime = 750, - canassist = 0, + canassist = 1, canbuild = 1, canguard = 1, canmove = 1, @@ -65,6 +65,12 @@ return { upright = false, waterline = 12, workertime = 1000, + buildoptions = { + "raptor_turret_basic_t3_v1", + "raptor_turret_antiair_t3_v1", + "raptor_turret_acid_t3_v1", + "raptor_turret_emp_t3_v1", + }, customparams = { subfolder = "other/raptors", model_author = "KDR_11k, Beherith", diff --git a/units/other/raptors/Miniqueen/raptor_matriarch_healer.lua b/units/other/raptors/Miniqueen/raptor_matriarch_healer.lua index 2855e0f309d..726bf1fffaa 100644 --- a/units/other/raptors/Miniqueen/raptor_matriarch_healer.lua +++ b/units/other/raptors/Miniqueen/raptor_matriarch_healer.lua @@ -60,6 +60,13 @@ return { upright = false, waterline = 40, workertime = 2500, + buildoptions = { + "raptor_turret_basic_t4_v1", + "raptor_turret_antiair_t4_v1", + "raptor_turret_acid_t4_v1", + "raptor_turret_emp_t4_v1", + "raptor_turret_meteor_t4_v1", + }, customparams = { subfolder = "other/raptors", normaltex = "unittextures/chicken_l_normals.png", diff --git a/units/other/raptors/Structures/raptor_hive.lua b/units/other/raptors/Structures/raptor_hive.lua index cf77f287a75..deca63604c9 100644 --- a/units/other/raptors/Structures/raptor_hive.lua +++ b/units/other/raptors/Structures/raptor_hive.lua @@ -15,7 +15,9 @@ return { collisionvolumeoffsets = "0 0 0", collisionvolumescales = "84 150 84", collisionvolumetype = "box", - energystorage = 1000, + metalmake = 100, + energymake = 1000, + energystorage = 10000, explodeas = "ROOST_DEATH", footprintx = 6, footprintz = 6, diff --git a/units/other/raptors/Structures/raptor_turret_acid_t2_v1.lua b/units/other/raptors/Structures/raptor_turret_acid_t2_v1.lua index d1f764b7d29..53f3457420f 100644 --- a/units/other/raptors/Structures/raptor_turret_acid_t2_v1.lua +++ b/units/other/raptors/Structures/raptor_turret_acid_t2_v1.lua @@ -21,7 +21,7 @@ return { collisionvolumetype = "box", energystorage = 500, explodeas = "bug_death", - extractsmetal = 0.001, + --extractsmetal = 0.001, footprintx = 2, footprintz = 2, idleautoheal = 15, diff --git a/units/other/raptors/Structures/raptor_turret_antiair_t2_v1.lua b/units/other/raptors/Structures/raptor_turret_antiair_t2_v1.lua index 33f081874aa..f620ba08a03 100644 --- a/units/other/raptors/Structures/raptor_turret_antiair_t2_v1.lua +++ b/units/other/raptors/Structures/raptor_turret_antiair_t2_v1.lua @@ -21,7 +21,7 @@ return { collisionvolumetype = "box", energystorage = 500, explodeas = "bug_death", - extractsmetal = 0.001, + --extractsmetal = 0.001, footprintx = 2, footprintz = 2, idleautoheal = 15, diff --git a/units/other/raptors/Structures/raptor_turret_antinuke_t2_v1.lua b/units/other/raptors/Structures/raptor_turret_antinuke_t2_v1.lua index 3b25bd789ec..55b7cb6eec1 100644 --- a/units/other/raptors/Structures/raptor_turret_antinuke_t2_v1.lua +++ b/units/other/raptors/Structures/raptor_turret_antinuke_t2_v1.lua @@ -21,7 +21,7 @@ return { collisionvolumetype = "box", energystorage = 500, explodeas = "bug_death", - extractsmetal = 0.001, + --extractsmetal = 0.001, footprintx = 2, footprintz = 2, idleautoheal = 15, diff --git a/units/other/raptors/Structures/raptor_turret_basic_t2_v1.lua b/units/other/raptors/Structures/raptor_turret_basic_t2_v1.lua index e8e4c44c8f7..8b485350fd0 100644 --- a/units/other/raptors/Structures/raptor_turret_basic_t2_v1.lua +++ b/units/other/raptors/Structures/raptor_turret_basic_t2_v1.lua @@ -21,7 +21,7 @@ return { collisionvolumetype = "box", energystorage = 500, explodeas = "bug_death", - extractsmetal = 0.001, + --extractsmetal = 0.001, footprintx = 2, footprintz = 2, idleautoheal = 15, diff --git a/units/other/raptors/Structures/raptor_turret_burrow_t2_v1.lua b/units/other/raptors/Structures/raptor_turret_burrow_t2_v1.lua index 3c5edaed793..9e45c22a2b2 100644 --- a/units/other/raptors/Structures/raptor_turret_burrow_t2_v1.lua +++ b/units/other/raptors/Structures/raptor_turret_burrow_t2_v1.lua @@ -21,7 +21,7 @@ return { collisionvolumetype = "box", energystorage = 500, explodeas = "bug_death", - extractsmetal = 0.001, + --extractsmetal = 0.001, footprintx = 2, footprintz = 2, idleautoheal = 15, diff --git a/units/other/raptors/Structures/raptor_turret_emp_t2_v1.lua b/units/other/raptors/Structures/raptor_turret_emp_t2_v1.lua index 147b9e0cb70..ce31734904a 100644 --- a/units/other/raptors/Structures/raptor_turret_emp_t2_v1.lua +++ b/units/other/raptors/Structures/raptor_turret_emp_t2_v1.lua @@ -21,7 +21,7 @@ return { collisionvolumetype = "box", energystorage = 500, explodeas = "bug_death", - extractsmetal = 0.001, + --extractsmetal = 0.001, footprintx = 2, footprintz = 2, idleautoheal = 15, diff --git a/unittextures/decals/legcluster_aoplane.dds b/unittextures/decals/legcluster_aoplane.dds new file mode 100644 index 00000000000..aa2216e66fd Binary files /dev/null and b/unittextures/decals/legcluster_aoplane.dds differ diff --git a/unittextures/decals/legdtr_aoplane.dds b/unittextures/decals/legdtr_aoplane.dds new file mode 100644 index 00000000000..e9c2421ae3d Binary files /dev/null and b/unittextures/decals/legdtr_aoplane.dds differ diff --git a/unittextures/decals/leglupara_aoplane.dds b/unittextures/decals/leglupara_aoplane.dds new file mode 100644 index 00000000000..8a0f031c0e6 Binary files /dev/null and b/unittextures/decals/leglupara_aoplane.dds differ