Skip to content

Commit

Permalink
Merge branch 'beyond-all-reason:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsy authored May 11, 2024
2 parents 464b1e6 + d955349 commit 2863be9
Show file tree
Hide file tree
Showing 886 changed files with 25,704 additions and 5,408 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/transifex_rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Translations rebase from master

on:
workflow_dispatch:
schedule:
- cron: '15 5 * * 1'

permissions: write-all

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Git User
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Transifex Rebase
run: |
git checkout transifex-synchronization-source
git reset origin/master --hard
git push origin transifex-synchronization-source --force-with-lease
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
/.git
/.svn
.vscode/
.idea/
*.iml
.project
*.code-workspace
1 change: 0 additions & 1 deletion common/luaUtilities/base64.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-- $Id: api_base64.lua 3171 2008-11-06 09:06:29Z det $
-- Author: Alex Kloss
-- Contact: http://www.it-rfc.de
-- Date: 2006-2008
Expand Down
112 changes: 87 additions & 25 deletions common/tablefunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,98 @@ if not table.mergeInPlace then
end

if not table.toString then
function table.toString(data, key)
local dataType = type(data)
-- Check the type
if key then
if type(key) == "number" then
key = "[" .. key .. "]"
end
local stringRep = string.rep
local tableSort = table.sort
local DEFAULT_INDENT_STEP = 2

local function tableToString(tbl, options, _seen, _depth)
end

local function keyCmp(a, b)
a = tableToString(a)
b = tableToString(b)
return a < b
end

tableToString = function(tbl, options, _seen, _depth)
_seen = _seen or {}
_depth = _depth or 0

local inputType = type(tbl)

if inputType == "string" then
return "\"" .. tbl .. "\""
elseif inputType == "userdata" then
return tostring(tbl) or "<userdata>"
elseif inputType ~= "table" then
return tostring(tbl)
end
if dataType == "string" then
return key .. [[="]] .. data .. [["]]
elseif dataType == "number" then
return key .. "=" .. data
elseif dataType == "boolean" then
return key .. "=" .. ((data and "true") or "false")
elseif dataType == "table" then
local str
if key then
str = key .. "={"
else
str = "{"

if _seen[tbl] then
return "<recursive_reference>"
end

_seen[tbl] = true

local keys = {}
for key in pairs(tbl) do
keys[#keys + 1] = key
end
tableSort(keys, (options and options.keyCmp) or keyCmp)

local indent = (options and options.indent) or DEFAULT_INDENT_STEP

local str = "{"
if options and options.pretty then
str = str .. "\n"
end
for i, key in ipairs(keys) do
if options and options.pretty then
str = str .. stringRep(" ", (_depth + 1) * indent)
end
for k, v in pairs(data) do
str = str .. table.toString(v, k) .. ","
if key ~= i then
local keyType = type(key)
if keyType == "string" then
str = str .. key .. "="
elseif keyType == "number" then
str = str .. "[" .. key .. "]="
else
str = str .. "[" .. tableToString(key, options, _seen) .. "]="
end
end
return str .. "}"
else
error("table.toString Error: unknown data type: " .. dataType)
str = str .. tableToString(tbl[key], options, _seen, _depth + 1) .. ","
if options and options.pretty then
str = str .. "\n"
end
end
if #keys > 0 then
-- remove the last comma (normal) or newline (pretty)
str = str:sub(1, #str - 1)
end
if options and options.pretty then
str = str .. "\n" .. stringRep(" ", _depth * indent)
end
return ""
str = str .. "}"

return str
end

---Recursively turns a table into a string, suitable for printing.
---
---All types of keys and values are valid. How some special types are handled:
--- * `function` types are turned into "<function>"
--- * `userdata` types are turned into "<userdata>", unless they have a `tostring` metamethod, which is used instead
--- * cyclic or recursive references are turned into "<recursive_reference>"
--- * keys that are not strings or numbers (tables, functions, etc) are first run through table.toString
---
---In order to keep the output deterministic, keys are sorted.
---@param tbl table
---@param options table Optional parameters
---@param options.pretty boolean Whether to add newlines and indentation (default: false)
---@param options.indent number If pretty=true, the number of spaces to indent by at each indent step (default: 2)
---@param options.keyCmp function Custom comparison function for sorting keys. If provided, this function will be used instead of the default comparison based on `table.toString(key)`.
---@return string
table.toString = tableToString
end

if not table.invert then
Expand Down
39 changes: 39 additions & 0 deletions common/wav.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
-- Small library for getting the metadata of .wav files
-- Author: Beherith [email protected]
-- Based on http://soundfile.sapp.org/doc/WaveFormat/

local wavCache = {} -- A table keyed with the absolute path to the filename,


function ReadWAV(fname)
if wavCache[fname] then
return wavCache[fname]
end
if not VFS.FileExists(fname) then
Spring.Echo("ReadWAV: File does not exist:", fname)
return nil
end
local data = VFS.LoadFile(fname)
local ChunkID = string.sub(data, 1, 4)
local ChunkSize = VFS.UnpackU32(string.sub(data,5,8))
local Format = string.sub(data, 9, 12)
if ChunkID == "RIFF" and Format == "WAVE" then
local NumChannels = VFS.UnpackU16(string.sub(data, 23, 24))
local SampleRate = VFS.UnpackU32(string.sub(data, 25, 28))
local BitsPerSample = VFS.UnpackU16(string.sub(data, 35, 36))
--Spring.Echo(fname, ChunkID, ChunkSize, Format, NumChannels, SampleRate, BitsPerSample)

local Length = (ChunkSize - 36) / (SampleRate * NumChannels *(BitsPerSample/8))
--Spring.Echo(Length)
wavCache[fname] = {
NumChannels = NumChannels,
SampleRate = SampleRate,
BitsPerSample = BitsPerSample,
Length = Length
}
return wavCache[fname]
else
Spring.Echo("ReadWAV: File is not a RIFF .wav file:", fname)
end

end
44 changes: 22 additions & 22 deletions effects/waterwake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -378,28 +378,28 @@ return {
useairlos = false,
},
},
waterblastcircle = {
air = true,
class = [[CBitmapMuzzleFlame]],
count = 1,
ground = false,
underwater = 1,
water = true,
properties = {
colormap = [[0.20 0.20 0.20 0.11 0.25 0.25 0.25 0.20 0.11 0.11 0.11 0.11 0 0 0 0.01]],
dir = [[dir]],
frontoffset = 0,
fronttexture = [[explowaveblastxl]],
length = 45,
sidetexture = [[none]],
size = [[55 r4]],
sizegrowth = [[0.70 r0.13]],
ttl = [[24 r4]],
rotParams = [[-5 r10, -4 r8, -10 r20]],
pos = [[0, 1, 0]],
useairlos = false,
},
},
--waterblastcircle = {
-- air = true,
-- class = [[CBitmapMuzzleFlame]],
-- count = 1,
-- ground = false,
-- underwater = 1,
-- water = true,
-- properties = {
-- colormap = [[0.20 0.20 0.20 0.11 0.25 0.25 0.25 0.20 0.11 0.11 0.11 0.11 0 0 0 0.01]],
-- dir = [[dir]],
-- frontoffset = 0,
-- fronttexture = [[explowaveblastxl]], -- this doesnt exist
-- length = 45,
-- sidetexture = [[none]],
-- size = [[55 r4]],
-- sizegrowth = [[0.70 r0.13]],
-- ttl = [[24 r4]],
-- rotParams = [[-5 r10, -4 r8, -10 r20]],
-- pos = [[0, 1, 0]],
-- useairlos = false,
-- },
--},
splashes = {
air = true,
class = [[CSimpleParticleSystem]],
Expand Down
80 changes: 57 additions & 23 deletions gamedata/alldefs_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,37 @@ function UnitDef_Post(name, uDef)
end
end

if modOptions.evocom then
if uDef.customparams.isevocom or uDef.customparams.iscommander then
if uDef.power then
uDef.power = uDef.power/modOptions.evocomxpmultiplier
else
uDef.power = ((uDef.metalcost+(uDef.energycost/60))/modOptions.evocomxpmultiplier)
end
uDef.customparams.evolution_timer = modOptions.evocomleveluprate*60
if name == "armcom" then
uDef.customparams.evolution_announcement = "Armada commanders have upgraded to level 2"
uDef.customparams.evolution_announcement_size = 18.5
uDef.customparams.evolution_target = "armcomlvl2"
uDef.customparams.evolution_condition = "timer"
elseif name == "corcom" then
uDef.customparams.evolution_announcement = "Cortex commanders have upgraded to level 2"
uDef.customparams.evolution_announcement_size = 18.5
uDef.customparams.evolution_target = "corcomlvl2"
uDef.customparams.evolution_condition = "timer"
elseif name == "legcomlvl3" then
uDef.customparams.evolution_announcement = "Legion commanders have upgraded to level 4"
elseif name == "legcomlvl4" then
uDef.customparams.evolution_announcement = "Legion commanders have upgraded to level 5"
uDef.customparams.evolution_announcement_size = 18.5
uDef.customparams.evolution_target = "legcomlvl5"
uDef.customparams.evolution_condition = "timer"
uDef.customparams.workertimeboost = 5
uDef.customparams.wtboostunittype = "MOBILE"
end
end
end

if modOptions.unit_restrictions_notacnukes then
local TacNukes = {
armemp = true,
Expand Down Expand Up @@ -344,27 +375,30 @@ function UnitDef_Post(name, uDef)
uDef.buildoptions[numBuildoptions + 1] = "armzapper"
elseif name == "legavp" then
local numBuildoptions = #uDef.buildoptions

uDef.buildoptions[numBuildoptions + 1] = "corgatreap"
uDef.buildoptions[numBuildoptions + 2] = "corforge"
uDef.buildoptions[numBuildoptions + 3] = "corftiger"
uDef.buildoptions[numBuildoptions + 4] = "cortorch"
uDef.buildoptions[numBuildoptions + 5] = "corvac" --corprinter
elseif name == "coravp" then
local printerpresent = false

for ix, UnitName in pairs(uDef.buildoptions) do
if UnitName == "corvac" then
printerpresent = true
end
end

local numBuildoptions = #uDef.buildoptions
uDef.buildoptions[numBuildoptions + 1] = "corgatreap"
uDef.buildoptions[numBuildoptions + 2] = "corforge"
uDef.buildoptions[numBuildoptions + 3] = "corftiger"
uDef.buildoptions[numBuildoptions + 4] = "cortorch"
if (printerpresent == false) then
-- assuming sala and vac stay paired, this is tidiest solution
uDef.buildoptions[numBuildoptions + 5] = "corsala"
uDef.buildoptions[numBuildoptions + 6] = "corvac" --corprinter
uDef.buildoptions[numBuildoptions+1] = "corgatreap"
uDef.buildoptions[numBuildoptions+2] = "corforge"
uDef.buildoptions[numBuildoptions+3] = "corftiger"
uDef.buildoptions[numBuildoptions+4] = "cortorch"
uDef.buildoptions[numBuildoptions+5] = "corsiegebreaker"
if (printerpresent==false) then -- assuming sala and vac stay paired, this is tidiest solution
uDef.buildoptions[numBuildoptions+6] = "corvac" --corprinter

end
elseif name == "corgant" or name == "leggant" then
local numBuildoptions = #uDef.buildoptions
Expand Down Expand Up @@ -418,20 +452,20 @@ function UnitDef_Post(name, uDef)
uDef.buildoptions[numBuildoptions + 2] = "legministarfall"
uDef.buildoptions[numBuildoptions + 3] = "legwint2"
uDef.buildoptions[numBuildoptions + 4] = "corhllllt"
uDef.buildoptions[numBuildoptions + 6] = "cordoomt3"
uDef.buildoptions[numBuildoptions + 7] = "cornanotct2"
uDef.buildoptions[numBuildoptions + 5] = "cordoomt3"
uDef.buildoptions[numBuildoptions + 6] = "cornanotct2"
elseif name == "armasy" then
local numBuildoptions = #uDef.buildoptions
uDef.buildoptions[numBuildoptions + 1] = "armptt2"
uDef.buildoptions[numBuildoptions + 2] = "armdecadet3"
uDef.buildoptions[numBuildoptions + 3] = "armpshipt3"
uDef.buildoptions[numBuildoptions + 4] = "armserpt3"
uDef.buildoptions[numBuildoptions + 5] = "armcarry2"
uDef.buildoptions[numBuildoptions + 5] = "armtrident"
elseif name == "corasy" then
local numBuildoptions = #uDef.buildoptions
uDef.buildoptions[numBuildoptions + 1] = "corslrpc"
uDef.buildoptions[numBuildoptions + 2] = "coresuppt3"
uDef.buildoptions[numBuildoptions + 3] = "corcarry2"
uDef.buildoptions[numBuildoptions + 3] = "corsentinel"
end
end

Expand Down Expand Up @@ -649,19 +683,19 @@ function UnitDef_Post(name, uDef)


--mono beam settings
uDef.weapondefs.armdfly_paralyzer.reloadtime = 0.05--testing
uDef.weapondefs.armdfly_paralyzer.damage.default = 150--testing (~2800/s for parity with live)
uDef.weapondefs.armdfly_paralyzer.beamdecay = 0.95
uDef.weapondefs.armdfly_paralyzer.duration = 200--should be unused?
uDef.weapondefs.armdfly_paralyzer.beamttl = 2--frames visible.just leads to laggy ghosting if raised too high.
--uDef.weapondefs.armdfly_paralyzer.reloadtime = 0.05--testing
--uDef.weapondefs.armdfly_paralyzer.damage.default = 150--testing (~2800/s for parity with live)
--uDef.weapondefs.armdfly_paralyzer.beamdecay = 0.95
--uDef.weapondefs.armdfly_paralyzer.duration = 200--should be unused?
--uDef.weapondefs.armdfly_paralyzer.beamttl = 2--frames visible.just leads to laggy ghosting if raised too high.

--burst testing within monobeam
uDef.weapondefs.armdfly_paralyzer.damage.default = 250
uDef.weapondefs.armdfly_paralyzer.reloadtime = 1--testing
uDef.weapondefs.armdfly_paralyzer.beamttl = 3--frames visible.just leads to laggy ghosting if raised too high.
uDef.weapondefs.armdfly_paralyzer.beamBurst = true--testing
uDef.weapondefs.armdfly_paralyzer.burst = 10--testing
uDef.weapondefs.armdfly_paralyzer.burstRate = 0.1--testing
--uDef.weapondefs.armdfly_paralyzer.damage.default = 125
--uDef.weapondefs.armdfly_paralyzer.reloadtime = 1--testing
--uDef.weapondefs.armdfly_paralyzer.beamttl = 3--frames visible.just leads to laggy ghosting if raised too high.
--uDef.weapondefs.armdfly_paralyzer.beamBurst = true--testing
--uDef.weapondefs.armdfly_paralyzer.burst = 10--testing
--uDef.weapondefs.armdfly_paralyzer.burstRate = 0.1--testing

end

Expand Down
Loading

0 comments on commit 2863be9

Please sign in to comment.