Compare commits

..

84 Commits

Author SHA1 Message Date
Unrud
b278a63e11 Makefile: Fail target version when not a git repository 2021-03-13 15:58:11 +00:00
Paul Chote
7ba140e471 Fail Situation Critical if Volkov is killed before entering the world. 2021-03-13 15:55:39 +00:00
Paul Chote
df476dd96f Fix non-relative path handling in install logic. 2021-03-13 15:52:52 +00:00
Paul Chote
f813f2bd46 Fix lobby checkbox event rectangle overlapping with scrollbars. 2021-03-05 18:56:46 +01:00
Paul Chote
c9c24490e6 Fix rendering artifacts with RA's dialog5 background. 2021-03-05 18:36:08 +01:00
penev92
11d84041d9 Added the "missing" song to the D2k TestFiles
Since it's music it's optional, so the players still won't know anything happened, but if they do open the content manager they will have a chance for an automatic installation.
2021-02-28 12:29:27 +00:00
pizzaoverhead
7ec9bdf0d0 Fix TLS error on Win7. 2021-02-28 10:15:52 +00:00
penev92
ef59b07a2d Fixed D2k VQA videos crashing the game 2021-02-19 13:38:23 +01:00
Unrud
74e3ded764 AppStream Metadata: Add violence-worship: moderate 2021-02-14 14:17:22 +00:00
Unrud
a46fab4ece Update AppStream metadata for linux packaging
A few small improvements:
* The type `desktop` was renamed to `desktop-appliaction` (a long time ago)
* Add `launchable` to tell how the application can be launched
* Use `https` for homepage link
* Add link to the bugtracker
* Update `oars-1.0` to `oars-1.1`
* Remove all unnecessary `content_attribute` entries with value `none`
2021-02-14 14:17:16 +00:00
Smittytron
81a7c3446d Add clarifying objective to Monster Tank Madness 2021-02-12 02:35:42 +01:00
Orb
a3404fac66 APC Balance Tweak Commit 2021-02-09 23:08:55 +01:00
Paul Chote
bb2276498b Fix Tanya's prone firing animations. 2021-02-02 23:06:27 +01:00
Unrud
7367b546e8 Use version from VERSION file
The `VERSION` variable doesn't work with a release tarball, because it requires git to be set correctly.
Instead this reads the version from the `VERSION` file.
2021-02-01 23:14:12 +01:00
abcdefg30
becc180956 Increase the reload delay of the prison colt to match the normal colt 2021-01-31 22:36:16 +00:00
abcdefg30
656ce35330 Fix the gun sounds not playing in Allies05a 2021-01-31 22:36:13 +00:00
Smittytron
2575b41492 Fix crash in Allies 05a on SamBarrel kill 2021-01-31 18:53:02 +01:00
abcdefg30
acaf535b67 Remove the 'docs' target from the windows make file 2021-01-30 21:08:59 +00:00
Paul Chote
503a434a4b Fix Concrete placement on invalid terrain. 2021-01-30 14:48:35 +01:00
Smittytron
e27c093536 Remove SpawnActorOnDeath from civilian structures 2021-01-30 13:50:20 +01:00
Paul Chote
fed7daa03d Ignore invalid server entries instead of the entire list. 2021-01-30 13:46:22 +01:00
Paul Chote
3906c6efab Don't crash if a null uid is given to QueryRemoteMapDetails. 2021-01-30 13:46:20 +01:00
Paul Chote
ae018235d0 Prevent AttackPopupTurreted.TickIdle from running while disabled. 2021-01-30 13:16:45 +01:00
Paul Chote
a8f6256c04 Restore missing versioned source code package. 2021-01-30 13:05:54 +01:00
reaperrr
de6a9dc8da Fix RA inf death anims playing too fast 2021-01-30 01:24:03 +00:00
Paul Chote
f14e3669e3 Fix Tanya firing animation. 2021-01-29 15:03:37 +01:00
Paul Chote
21eb585a28 Support burst-specific infantry attack animations. 2021-01-29 15:03:24 +01:00
Paul Chote
f8dddf0502 Reduce Tanya firing rate. 2021-01-29 15:03:13 +01:00
Paul Chote
d3482c0f18 Suppress error messages from make.ps1 clean.
Also removed obsolete ./*/bin removal.
2021-01-29 14:54:15 +01:00
Paul Chote
d1c9b8d30f Keep Discord join button active for spectators. 2021-01-29 14:39:53 +01:00
Paul Chote
d2a6b7370e Remove first-client check from LobbySettingsNotification.
ClientWithIndex may rarely be null, causing a crash.
In any case we do want to report these changes to the first client, as
somebody else may have changed the settings and left.
2021-01-29 14:33:56 +01:00
Paul Chote
20b55ab5db Fix bot-controlled aircraft stalling above cloaked targets. 2021-01-29 14:30:00 +01:00
Paul Chote
c7ffc4d24f Increase map chooser dialog size to match the lobby. 2021-01-25 20:44:05 +01:00
Smittytron
2ce83bb51f Change hospital owner in Nod07b 2021-01-24 10:52:52 +00:00
teinarss
ea9f967acd Add Map and server name to discord details 2021-01-22 14:14:27 +01:00
Paul Chote
4a6927b513 Fix AutoTarget.ChooseTarget ignoring AttackBase.TargetFrozenActors. 2021-01-21 19:25:25 +01:00
Paul Chote
cab611b8dd Fix make check ignoring TARGETPLATFORM override. 2021-01-19 09:34:45 +01:00
Paul Chote
47bfa8bce8 Fix Sardarkaur not attacking while attack-moving. 2021-01-17 19:45:06 +01:00
Matthias Mailänder
40c452b07e Update path according to latest appstream specifications. 2021-01-16 20:04:15 +01:00
Matthias Mailänder
f1b238d7bf Document the target platform parameter during install
as it otherwise copies the system binaries.
2021-01-16 20:04:13 +01:00
Matthias Mailänder
0028a26193 Get rid of unnecessary Makefile variables. 2021-01-16 20:04:12 +01:00
Matthias Mailänder
bcdbd02f1c Don't contain the build root in the wrappers. 2021-01-16 20:04:10 +01:00
Matthias Mailänder
805fc5cade Create BIN_PATH first on shortcut installation. 2021-01-16 20:04:09 +01:00
VonNah
90ddbbc934 Fix vehicle explosion and missile impact sounds in Tiberian Dawn 2021-01-16 01:32:34 +00:00
VonNah
5f9126f274 Fixed an issue where RadarUp and DisablePower/EnablePower use the wrong sound effects.
Signed-off-by: VonNah <vonnahora@gmail.com>
2021-01-16 00:48:58 +00:00
Paul Chote
a1011efd98 Update apt metadata before installing dependencies. 2021-01-12 23:11:20 +01:00
Paul Chote
135ee781d4 Fix infantry freezing death animations in Top o' the World mission. 2021-01-11 11:32:50 +01:00
Paul Chote
56ef43145b Fix Grenadier death animation in Sarin Gas 3 mission. 2021-01-11 11:32:49 +01:00
Paul Chote
ff1bfe162b Add death types support to the Lua Kill() API. 2021-01-11 11:32:47 +01:00
Paul Chote
c642162d55 Cancel support power targeting if power cannot be activated. 2021-01-10 22:43:41 +01:00
Paul Chote
4bec1d1950 Add a per-player handicap option to the lobby.
Handicaps reduce unit health, firepower, and build speed.
2021-01-10 22:23:08 +01:00
Paul Chote
e769f51169 Increase lobby and server list width. 2021-01-10 22:22:56 +01:00
Paul Chote
ee19990749 Switch make.ps1 to downloading from our GeoIP data mirror. 2021-01-10 21:13:18 +01:00
Matthias Mailänder
0eefb0bc8c Fix syntax errors. 2021-01-10 21:10:21 +01:00
Matthias Mailänder
dd10b52955 Use the GitHub action variable for clickable links. 2021-01-10 21:10:19 +01:00
Matthias Mailänder
9a8b5da727 Update SDL 2 nuget package to match the platform. 2021-01-10 21:04:21 +01:00
Smittytron
53fe004c01 Add Aftermath mission Shock Therapy 2021-01-10 02:35:30 +01:00
Paul Chote
eea0ca1a4e Avoid BuildUnit crash if the item is invalidated before the task runs. 2021-01-10 01:34:26 +01:00
Paul Chote
ccbc78ea98 Add a setting to pause the shellmap. 2021-01-10 00:24:39 +01:00
Paul Chote
befcbe3677 Group bot AttackMove orders. 2021-01-09 23:56:18 +01:00
Orb
1f48359899 Playtest-Balance-Tweaks Commit 2021-01-09 23:23:21 +01:00
Matthias Mailänder
c4aed8af3f Fix error NU1101: Unable to find package. 2021-01-03 14:09:57 +01:00
Paul Chote
2d30913f06 Disable AttackPopupTurreted state changes when paused. 2021-01-03 12:47:03 +01:00
nvrnight
e3c96cf283 Issue #18936: The game no longer crashes when TextFieldWidget sends Enter key press and onSelect action is null. 2021-01-03 12:28:24 +01:00
Smittytron
325f414d45 Fix palettes in Fall of Greece 1 2021-01-02 22:46:19 +01:00
Smittytron
4371fb058b Add campaign-palettes to missions lacking it 2021-01-02 22:46:11 +01:00
Paul Chote
1d3461f5da Fix exit priority ordering. 2021-01-02 15:42:38 +01:00
Paul Chote
271f2ce539 Start rally point lines at the spawn position instead of the exit cell. 2021-01-02 15:29:37 +01:00
Paul Chote
8c29a44795 Prevent Health: 100 from being added to actors. 2021-01-02 15:11:56 +01:00
Paul Chote
226b96f9b0 Add a friendly type name for Nullable<T>. 2021-01-02 11:39:34 +01:00
abcdefg30
fa75891f62 Explicitly return on failure in make.ps1 2020-12-30 17:33:29 +01:00
Ivaylo Draganov
9c4dd4a08a Update launch.json to work with the new launcher 2020-12-30 17:32:23 +01:00
Nah
a75de2dd8b Update defaults.yaml
Fix the Building's SoundOnDamageTransition DamagedSounds with the correct one and add a second sound file to DestroyedSounds for more variation like in the original Tiberian Dawn.
2020-12-30 14:07:16 +00:00
abcdefg30
5249841ab7 Move myes1 and mrise1 from Select to Move Mechanic Voices 2020-12-30 02:01:21 +00:00
abcdefg30
01204eb414 Enable mechanic voices from Aftermath 2020-12-30 02:01:17 +00:00
Smittytron
58e86d1499 Remove out of bounds actors from Exodus 2020-12-30 01:51:55 +00:00
Smittytron
3b3c6a6647 Fix lag issue on Exodus by narrowing exit area 2020-12-30 01:51:48 +00:00
abcdefg30
31c6e3826e Correct Shock Trooper Move and Select voices 2020-12-29 21:15:42 +01:00
Orb
14f5c9d228 Fix-MT-Sound-Commit 2020-12-28 10:57:25 +01:00
Paul Chote
97d165ed94 Fix an incorrect comment in install_assemblies_mono 2020-12-24 12:11:20 +01:00
abcdefg30
d6c9bedd5a Add the 9th Dark Tournament map as "Oil Spill" 2020-12-21 21:14:17 +01:00
Paul Chote
00bc08e9a8 Fix api output directory. 2020-12-14 18:36:23 +01:00
Paul Chote
924cf4a885 Fix docs.openra.net repository reference. 2020-12-14 18:36:15 +01:00
Paul Chote
1f7eef8ffc Fix docs.openra.net documentation workflow. 2020-12-13 16:24:41 +00:00
170 changed files with 2955 additions and 1523 deletions

View File

@@ -18,6 +18,7 @@ jobs:
run: |
mono --version
make check
mono ~/.nuget/packages/nunit.consolerunner/3.11.1/tools/nunit3-console.exe --noresult bin/OpenRA.Test.dll
- name: Check Mods
run: |
@@ -26,26 +27,19 @@ jobs:
make test
windows:
name: Windows (Net 5.0)
name: Windows (Framework 4.7)
runs-on: windows-2019
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Install .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Check Code
shell: powershell
run: |
# Work around runtime failures on the GH Actions runner
dotnet nuget locals all --clear
.\make.ps1 check
dotnet build OpenRA.Test\OpenRA.Test.csproj -c Debug --nologo -p:TargetPlatform=win-x64
dotnet test bin\OpenRA.Test.dll --test-adapter-path:.
Invoke-Expression "$home\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe --noresult bin/OpenRA.Test.dll"
- name: Check Mods
run: |

View File

@@ -15,17 +15,15 @@ jobs:
if: github.repository == 'openra/openra'
steps:
- name: Download Packages
env:
GIT_TAG: ${{ github.event.inputs.tag }}
run: |
wget -q "https://github.com/${{ github.repository }}/releases/download/${GIT_TAG}/OpenRA-${GIT_TAG}-x64.exe"
wget -q "https://github.com/${{ github.repository }}/releases/download/${GIT_TAG}/OpenRA-${GIT_TAG}-x64-winportable.zip" -O "OpenRA-${GIT_TAG}-x64-win-itch.zip"
wget -q "https://github.com${{ github.repository }}/releases/download/${GIT_TAG}/OpenRA-${GIT_TAG}.dmg"
wget -q "https://github.com/${{ github.repository }}/releases/download/${GIT_TAG}/OpenRA-Dune-2000-x86_64.AppImage"
wget -q "https://github.com/${{ github.repository }}/releases/download/${GIT_TAG}/OpenRA-Red-Alert-x86_64.AppImage"
wget -q "https://github.com/${{ github.repository }}/releases/download/${GIT_TAG}/OpenRA-Tiberian-Dawn-x86_64.AppImage"
wget -q "https://raw.githubusercontent.com/${{ github.repository }}/${GIT_TAG}/packaging/.itch.toml"
zip -u "OpenRA-${GIT_TAG}-x64-win-itch.zip" .itch.toml
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-${{ github.event.inputs.tag }}-x64.exe"
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-${{ github.event.inputs.tag }}-x64-winportable.zip" -O "OpenRA-${{ github.event.inputs.tag }}-x64-win-itch.zip"
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-${{ github.event.inputs.tag }}.dmg"
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-Dune-2000-x86_64.AppImage"
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-Red-Alert-x86_64.AppImage"
wget -q "https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/OpenRA-Tiberian-Dawn-x86_64.AppImage"
wget -q "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.inputs.tag }}/packaging/.itch.toml"
zip -u "OpenRA-${{ github.event.inputs.tag }}-x64-win-itch.zip" .itch.toml
- name: Publish Windows Installer
uses: josephbmanley/butler-publish-itchio-action@master
@@ -35,7 +33,7 @@ jobs:
ITCH_GAME: openra
ITCH_USER: openra-developers
VERSION: ${{ github.event.inputs.tag }}
PACKAGE: OpenRA-${{ github.event.inputs.tag }}}-x64.exe"
PACKAGE: OpenRA-${{ github.event.inputs.tag }}}-x64.exe
- name: Publish Windows Itch Bundle
uses: josephbmanley/butler-publish-itchio-action@master
@@ -55,7 +53,7 @@ jobs:
ITCH_GAME: openra
ITCH_USER: openra-developers
VERSION: ${{ github.event.inputs.tag }}
PACKAGE: OpenRA-${{ github.event.inputs.tag }}}.dmg"
PACKAGE: OpenRA-${{ github.event.inputs.tag }}}.dmg
- name: Publish RA AppImage
uses: josephbmanley/butler-publish-itchio-action@master

View File

@@ -8,6 +8,30 @@ on:
- 'devtest-*'
jobs:
source:
name: Source Tarball
runs-on: ubuntu-20.04
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Prepare Environment
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
- name: Package Source
run: |
mkdir -p build/source
./packaging/source/buildpackage.sh "${GIT_TAG}" "${PWD}/build/source"
- name: Upload Packages
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
overwrite: true
file_glob: true
file: build/source/*
linux:
name: Linux AppImages
runs-on: ubuntu-20.04
@@ -39,11 +63,6 @@ jobs:
- name: Clone Repository
uses: actions/checkout@v2
- name: Install .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Prepare Environment
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
@@ -74,15 +93,11 @@ jobs:
- name: Clone Repository
uses: actions/checkout@v2
- name: Install .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Prepare Environment
run: |
echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
sudo apt install nsis wine64
sudo apt-get update
sudo apt-get install nsis
- name: Package Installers
run: |

20
.vscode/launch.json vendored
View File

@@ -11,9 +11,8 @@
"type": "mono"
},
"request": "launch",
"program": "${workspaceRoot}/OpenRA.Game.exe",
"cwd": "${workspaceRoot}",
"args": ["Game.Mod=cnc"],
"program": "${workspaceRoot}/bin/OpenRA.exe",
"args": ["Game.Mod=cnc", "Engine.EngineDir=.."],
"preLaunchTask": "build",
},
{
@@ -26,9 +25,8 @@
"type": "mono"
},
"request": "launch",
"program": "${workspaceRoot}/OpenRA.Game.exe",
"cwd": "${workspaceRoot}",
"args": ["Game.Mod=ra"],
"program": "${workspaceRoot}/bin/OpenRA.exe",
"args": ["Game.Mod=ra", "Engine.EngineDir=.."],
"preLaunchTask": "build",
},
{
@@ -41,9 +39,8 @@
"type": "mono"
},
"request": "launch",
"program": "${workspaceRoot}/OpenRA.Game.exe",
"cwd": "${workspaceRoot}",
"args": ["Game.Mod=d2k"],
"program": "${workspaceRoot}/bin/OpenRA.exe",
"args": ["Game.Mod=d2k", "Engine.EngineDir=.."],
"preLaunchTask": "build",
},
{
@@ -56,9 +53,8 @@
"type": "mono"
},
"request": "launch",
"program": "${workspaceRoot}/OpenRA.Game.exe",
"cwd": "${workspaceRoot}",
"args": ["Game.Mod=ts"],
"program": "${workspaceRoot}/bin/OpenRA.exe",
"args": ["Game.Mod=ts", "Engine.EngineDir=.."],
"preLaunchTask": "build",
},
]

View File

@@ -8,16 +8,18 @@ Windows
Compiling OpenRA requires the following dependencies:
* [Windows PowerShell >= 4.0](http://microsoft.com/powershell) (included by default in recent Windows 10 versions)
* [.NET 5 SDK](https://dotnet.microsoft.com/download/dotnet/5.0) (or via Visual Studio)
* [.NET Framework 4.7.2 (Developer Pack)](https://dotnet.microsoft.com/download/dotnet-framework/net472) (or via Visual Studio 2017)
* [.NET Core 2.2 SDK](https://dotnet.microsoft.com/download/dotnet-core/2.2) (or via Visual Studio 2017)
To compile OpenRA, open the `OpenRA.sln` solution in the main folder, build it from the command-line with `dotnet` or use the Makefile analogue command `make all` scripted in PowerShell syntax.
To compile OpenRA, open the `OpenRA.sln` solution in the main folder, build it from the command-line with MSBuild or use the Makefile analogue command `make all` scripted in PowerShell syntax.
Run the game with `launch-game.cmd`. It can be handed arguments that specify the exact mod one wishes to run, for example, run `launch-game.cmd Game.Mod=ra` to launch Red Alert, `launch-game.cmd Game.Mod=cnc` to start Tiberian dawn or `launch-game.cmd Game.Mod=d2k` to launch Dune 2000.
Linux
=====
Mono, version 6.4 or later, is required to compile OpenRA. You can add the [upstream mono repository](https://www.mono-project.com/download/stable/#download-lin) for your distro to obtain the latest version if your system packages are not sufficient.
Mono, version 5.18 or later, is required to compile OpenRA. You can add the [upstream mono repository](https://www.mono-project.com/download/stable/#download-lin) for your distro to obtain the latest version if your system packages are not sufficient.
To compile OpenRA, run `make` from the command line. After this one can run the game with `./launch-game.sh`. It is also possible to specify the mod you wish to run from the command line, e.g. with `./launch-game.sh Game.Mod=ts` if you wish to try the experimental Tiberian Sun mod.
@@ -97,7 +99,7 @@ macOS
=====
Before compiling OpenRA you must install the following dependencies:
* [Mono >= 6.4](https://www.mono-project.com/download/stable/#download-mac)
* [Mono >= 5.18](https://www.mono-project.com/download/stable/#download-mac)
To compile OpenRA, run `make` from the command line. Run with `./launch-game.sh`.

View File

@@ -15,6 +15,10 @@
# to compile and install Red Alert, Tiberian Dawn, and Dune 2000, run:
# make [prefix=/foo] [bindir=/bar/bin] install
#
# to compile and install Red Alert, Tiberian Dawn, and Dune 2000
# using system libraries for native dependencies, run:
# make [prefix=/foo] [bindir=/bar/bin] TARGETPLATFORM=unix-generic install
#
# to install Linux startup scripts, desktop files, icons, and MIME metadata
# make install-linux-shortcuts
#
@@ -28,14 +32,14 @@
############################## TOOLCHAIN ###############################
#
# List of .NET assemblies that we can guarantee exist
WHITELISTED_OPENRA_ASSEMBLIES = OpenRA.dll OpenRA.Utility.dll OpenRA.Server.dll OpenRA.Platforms.Default.dll OpenRA.Game.dll OpenRA.Mods.Common.dll OpenRA.Mods.Cnc.dll OpenRA.Mods.D2k.dll
WHITELISTED_OPENRA_ASSEMBLIES = OpenRA.exe OpenRA.Utility.exe OpenRA.Server.exe OpenRA.Platforms.Default.dll OpenRA.Game.dll OpenRA.Mods.Common.dll OpenRA.Mods.Cnc.dll OpenRA.Mods.D2k.dll
# These are explicitly shipped alongside our core files by the packaging script
WHITELISTED_THIRDPARTY_ASSEMBLIES = ICSharpCode.SharpZipLib.dll FuzzyLogicLibrary.dll Eluant.dll BeaconLib.dll Open.Nat.dll SDL2-CS.dll OpenAL-CS.Core.dll DiscordRPC.dll Newtonsoft.Json.dll
# These are shipped in our custom minimal mono runtime and also available in the full system-installed .NET/mono stack
# This list *must* be kept in sync with the files packaged by the AppImageSupport and OpenRALauncherOSX repositories
WHITELISTED_CORE_ASSEMBLIES = mscorlib.dll System.dll System.Configuration.dll System.Core.dll System.Numerics.dll System.Security.dll System.Xml.dll Mono.Security.dll netstandard.dll Microsoft.Win32.Registry.dll System.Security.AccessControl.dll System.Security.Principal.Windows.dll System.Xml.Linq.dll System.Runtime.Serialization.dll
WHITELISTED_CORE_ASSEMBLIES = mscorlib.dll System.dll System.Configuration.dll System.Core.dll System.Numerics.dll System.Security.dll System.Xml.dll Mono.Security.dll netstandard.dll
######################### UTILITIES/SETTINGS ###########################
#
@@ -48,10 +52,6 @@ bindir ?= $(prefix)/bin
libdir ?= $(prefix)/lib
gameinstalldir ?= $(libdir)/openra
BIN_INSTALL_DIR = $(DESTDIR)$(bindir)
DATA_INSTALL_DIR = $(DESTDIR)$(datadir)
OPENRA_INSTALL_DIR = $(DESTDIR)$(gameinstalldir)
# Toolchain
CWD = $(shell pwd)
MSBUILD = msbuild -verbosity:m -nologo
@@ -61,7 +61,8 @@ RM_R = $(RM) -r
RM_F = $(RM) -f
RM_RF = $(RM) -rf
VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`)
# Only for use in target version:
VERSION := $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || (c=$$(git rev-parse --short HEAD 2>/dev/null) && echo git-$$c))
# Detect target platform for dependencies if not given by the user
ifndef TARGETPLATFORM
@@ -78,13 +79,13 @@ endif
endif
endif
OPENRA_UTILITY = ENGINE_DIR=".." $(MONO) --debug bin/OpenRA.Utility.dll
OPENRA_UTILITY = ENGINE_DIR=".." $(MONO) --debug bin/OpenRA.Utility.exe
##################### DEVELOPMENT BUILDS AND TESTS #####################
#
all:
@command -v $(firstword $(MSBUILD)) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.18."; exit 1)
@$(MSBUILD) -t:Build -restore -p:Configuration=Release -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true -p:DefineConstants="MONO"
@$(MSBUILD) -t:Build -restore -p:Configuration=Release -p:TargetPlatform=$(TARGETPLATFORM)
ifeq ($(TARGETPLATFORM), unix-generic)
@./configure-system-libraries.sh
endif
@@ -92,13 +93,16 @@ endif
clean:
@-$(RM_RF) ./bin ./*/bin ./*/obj
@$(MSBUILD) -t:Clean -p:Mono=true
@$(MSBUILD) -t:Clean
@-$(RM_F) IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP
check:
@echo
@echo "Compiling in debug mode..."
@$(MSBUILD) -t:build -restore -p:Configuration=Debug -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true -p:DefineConstants="MONO"
@$(MSBUILD) -t:build -restore -p:Configuration=Debug -p:TargetPlatform=$(TARGETPLATFORM)
ifeq ($(TARGETPLATFORM), unix-generic)
@./configure-system-libraries.sh
endif
@echo
@echo "Checking runtime assemblies..."
@$(OPENRA_UTILITY) all --check-runtime-assemblies $(WHITELISTED_OPENRA_ASSEMBLIES) $(WHITELISTED_THIRDPARTY_ASSEMBLIES) $(WHITELISTED_CORE_ASSEMBLIES)
@@ -133,18 +137,21 @@ test: all
############# LOCAL INSTALLATION AND DOWNSTREAM PACKAGING ##############
#
version: VERSION mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml
@sh -c '. ./packaging/functions.sh; set_engine_version $(VERSION) .'
@sh -c '. ./packaging/functions.sh; set_mod_version $(VERSION) mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml'
ifeq ($(VERSION),)
$(error Unable to determine new version (requires git or override of variable VERSION))
endif
@sh -c '. ./packaging/functions.sh; set_engine_version "$(VERSION)" .'
@sh -c '. ./packaging/functions.sh; set_mod_version "$(VERSION)" mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml'
install:
@sh -c '. ./packaging/functions.sh; install_assemblies_mono $(CWD) $(OPENRA_INSTALL_DIR) $(TARGETPLATFORM) True True True'
@sh -c '. ./packaging/functions.sh; install_data $(CWD) $(OPENRA_INSTALL_DIR) cnc d2k ra'
@sh -c '. ./packaging/functions.sh; install_assemblies_mono $(CWD) $(DESTDIR)$(gameinstalldir) $(TARGETPLATFORM) True True True'
@sh -c '. ./packaging/functions.sh; install_data $(CWD) $(DESTDIR)$(gameinstalldir) cnc d2k ra'
install-linux-shortcuts:
@sh -c '. ./packaging/functions.sh; install_linux_shortcuts $(CWD) $(OPENRA_INSTALL_DIR) $(BIN_INSTALL_DIR) $(DATA_INSTALL_DIR) $(VERSION) cnc d2k ra'
@sh -c '. ./packaging/functions.sh; install_linux_shortcuts $(CWD) "$(DESTDIR)" "$(gameinstalldir)" "$(bindir)" "$(datadir)" "$(shell head -n1 VERSION)" cnc d2k ra'
install-linux-appdata:
@sh -c '. ./packaging/functions.sh; install_linux_appdata $(CWD) $(DATA_INSTALL_DIR) cnc d2k ra'
@sh -c '. ./packaging/functions.sh; install_linux_appdata $(CWD) "$(DESTDIR)" "$(datadir)" cnc d2k ra'
help:
@echo 'to compile, run:'
@@ -160,7 +167,11 @@ help:
@echo ' make test'
@echo
@echo 'to compile and install Red Alert, Tiberian Dawn, and Dune 2000 run:'
@echo ' make [prefix=/foo] install'
@echo ' make [prefix=/foo] [TARGETPLATFORM=unix-generic] install'
@echo
@echo 'to compile and install Red Alert, Tiberian Dawn, and Dune 2000'
@echo 'using system libraries for native dependencies, run:'
@echo ' make [prefix=/foo] [bindir=/bar/bin] TARGETPLATFORM=unix-generic install'
@echo
@echo 'to install Linux startup scripts, desktop files, icons, and MIME metadata'
@echo ' make install-linux-shortcuts'

View File

@@ -297,7 +297,6 @@ namespace OpenRA
EngineVersion = "Unknown";
Console.WriteLine("Engine version is {0}", EngineVersion);
Console.WriteLine("Runtime: {0}", Platform.RuntimeVersion);
// Special case handling of Game.Mod argument: if it matches a real filesystem path
// then we use this to override the mod search path, and replace it with the mod id
@@ -330,16 +329,9 @@ namespace OpenRA
try
{
var rendererPath = Path.Combine(Platform.BinDir, "OpenRA.Platforms." + p + ".dll");
#if !MONO
var loader = new AssemblyLoader(rendererPath);
var platformType = loader.LoadDefaultAssembly().GetTypes().SingleOrDefault(t => typeof(IPlatform).IsAssignableFrom(t));
#else
var assembly = Assembly.LoadFile(rendererPath);
var platformType = assembly.GetTypes().SingleOrDefault(t => typeof(IPlatform).IsAssignableFrom(t));
#endif
var platformType = assembly.GetTypes().SingleOrDefault(t => typeof(IPlatform).IsAssignableFrom(t));
if (platformType == null)
throw new InvalidOperationException("Platform dll must include exactly one IPlatform implementation.");

View File

@@ -123,6 +123,7 @@ namespace OpenRA
DisplayFactionId = runtimePlayer.DisplayFaction.InternalName,
Color = runtimePlayer.Color,
Team = client.Team,
Handicap = client.Handicap,
SpawnPoint = runtimePlayer.SpawnPoint,
IsRandomFaction = runtimePlayer.Faction.InternalName != client.Faction,
IsRandomSpawnPoint = runtimePlayer.DisplaySpawnPoint == 0,
@@ -166,6 +167,7 @@ namespace OpenRA
/// <summary>The team ID on start-up, or 0 if the player is not part of a team.</summary>
public int Team;
public int SpawnPoint;
public int Handicap;
/// <summary>True if the faction was chosen at random; otherwise, false.</summary>
public bool IsRandomFaction;

View File

@@ -168,7 +168,10 @@ namespace OpenRA.Graphics
for (var x = 0; x < template.Size.X; x++)
{
var tile = new TerrainTile(template.Id, (byte)(i++));
if (!tileset.TryGetTileInfo(tile, out var tileInfo))
var tileInfo = tileset.GetTileInfo(tile);
// Empty tile
if (tileInfo == null)
continue;
var sprite = TileSprite(tile);

View File

@@ -206,8 +206,6 @@ namespace OpenRA
public readonly MiniYaml NotificationDefinitions;
public readonly MiniYaml TranslationDefinitions;
public readonly Dictionary<CPos, TerrainTile> ReplacedInvalidTerrainTiles = new Dictionary<CPos, TerrainTile>();
// Generated data
public readonly MapGrid Grid;
public IReadOnlyPackage Package { get; private set; }
@@ -289,6 +287,7 @@ namespace OpenRA
this.modData = modData;
var size = new Size(width, height);
Grid = modData.Manifest.Get<MapGrid>();
var tileRef = new TerrainTile(tileset.Templates.First().Key, 0);
Title = "Name your map here";
Author = "Your name here";
@@ -311,7 +310,7 @@ namespace OpenRA
Tiles.CellEntryChanged += UpdateRamp;
}
Tiles.Clear(tileset.DefaultTerrainTile);
Tiles.Clear(tileRef);
PostInit();
}
@@ -431,18 +430,12 @@ namespace OpenRA
foreach (var uv in AllCells.MapCoords)
CustomTerrain[uv] = byte.MaxValue;
// Replace invalid tiles and cache ramp state
// Cache initial ramp state
var tileset = Rules.TileSet;
foreach (var uv in AllCells.MapCoords)
foreach (var uv in AllCells)
{
if (!tileset.TryGetTileInfo(Tiles[uv], out var info))
{
ReplacedInvalidTerrainTiles[uv.ToCPos(this)] = Tiles[uv];
Tiles[uv] = tileset.DefaultTerrainTile;
info = tileset.GetTileInfo(tileset.DefaultTerrainTile);
}
Ramp[uv] = info.RampType;
var tile = tileset.GetTileInfo(Tiles[uv]);
Ramp[uv] = tile != null ? tile.RampType : (byte)0;
}
AllEdgeCells = UpdateEdgeCells();
@@ -450,7 +443,8 @@ namespace OpenRA
void UpdateRamp(CPos cell)
{
Ramp[cell] = Rules.TileSet.GetTileInfo(Tiles[cell]).RampType;
var tile = Rules.TileSet.GetTileInfo(Tiles[cell]);
Ramp[cell] = tile != null ? tile.RampType : (byte)0;
}
void InitializeCellProjection()
@@ -676,26 +670,32 @@ namespace OpenRA
Color left, right;
var tileset = Rules.TileSet;
var type = tileset.GetTileInfo(Tiles[uv]);
if (type.MinColor != type.MaxColor)
if (type != null)
{
left = Exts.ColorLerp(Game.CosmeticRandom.NextFloat(), type.MinColor, type.MaxColor);
right = Exts.ColorLerp(Game.CosmeticRandom.NextFloat(), type.MinColor, type.MaxColor);
if (type.MinColor != type.MaxColor)
{
left = Exts.ColorLerp(Game.CosmeticRandom.NextFloat(), type.MinColor, type.MaxColor);
right = Exts.ColorLerp(Game.CosmeticRandom.NextFloat(), type.MinColor, type.MaxColor);
}
else
left = right = type.MinColor;
if (tileset.MinHeightColorBrightness != 1.0f || tileset.MaxHeightColorBrightness != 1.0f)
{
var scale = float2.Lerp(tileset.MinHeightColorBrightness, tileset.MaxHeightColorBrightness, Height[uv] * 1f / Grid.MaximumTerrainHeight);
left = Color.FromArgb((int)(scale * left.R).Clamp(0, 255), (int)(scale * left.G).Clamp(0, 255), (int)(scale * left.B).Clamp(0, 255));
right = Color.FromArgb((int)(scale * right.R).Clamp(0, 255), (int)(scale * right.G).Clamp(0, 255), (int)(scale * right.B).Clamp(0, 255));
}
}
else
left = right = type.MinColor;
if (tileset.MinHeightColorBrightness != 1.0f || tileset.MaxHeightColorBrightness != 1.0f)
{
var scale = float2.Lerp(tileset.MinHeightColorBrightness, tileset.MaxHeightColorBrightness, Height[uv] * 1f / Grid.MaximumTerrainHeight);
left = Color.FromArgb((int)(scale * left.R).Clamp(0, 255), (int)(scale * left.G).Clamp(0, 255), (int)(scale * left.B).Clamp(0, 255));
right = Color.FromArgb((int)(scale * right.R).Clamp(0, 255), (int)(scale * right.G).Clamp(0, 255), (int)(scale * right.B).Clamp(0, 255));
}
left = right = Color.Black;
return (left, right);
}
public byte[] SavePreview()
{
var tileset = Rules.TileSet;
var actorTypes = Rules.Actors.Values.Where(a => a.HasTraitInfo<IMapPreviewSignatureInfo>());
var actors = ActorDefinitions.Where(a => actorTypes.Where(ai => ai.Name == a.Value.Value).Any());
var positions = new List<(MPos Position, Color Color)>();
@@ -715,73 +715,76 @@ namespace OpenRA
foreach (var worldimpsi in worldimpsis)
worldimpsi.PopulateMapPreviewSignatureCells(this, worldActorInfo, null, positions);
var isRectangularIsometric = Grid.Type == MapGridType.RectangularIsometric;
// Fudge the heightmap offset by adding as much extra as we need / can.
// This tries to correct for our incorrect assumption that MPos == PPos
var heightOffset = Math.Min(Grid.MaximumTerrainHeight, MapSize.Y - Bounds.Bottom);
var width = Bounds.Width;
var height = Bounds.Height + heightOffset;
var bitmapWidth = width;
if (isRectangularIsometric)
bitmapWidth = 2 * bitmapWidth - 1;
var stride = bitmapWidth * 4;
var pxStride = 4;
var minimapData = new byte[stride * height];
(Color Left, Color Right) terrainColor = default((Color, Color));
for (var y = 0; y < height; y++)
using (var stream = new MemoryStream())
{
for (var x = 0; x < width; x++)
var isRectangularIsometric = Grid.Type == MapGridType.RectangularIsometric;
// Fudge the heightmap offset by adding as much extra as we need / can.
// This tries to correct for our incorrect assumption that MPos == PPos
var heightOffset = Math.Min(Grid.MaximumTerrainHeight, MapSize.Y - Bounds.Bottom);
var width = Bounds.Width;
var height = Bounds.Height + heightOffset;
var bitmapWidth = width;
if (isRectangularIsometric)
bitmapWidth = 2 * bitmapWidth - 1;
var stride = bitmapWidth * 4;
var pxStride = 4;
var minimapData = new byte[stride * height];
(Color Left, Color Right) terrainColor = default((Color, Color));
for (var y = 0; y < height; y++)
{
var uv = new MPos(x + Bounds.Left, y + Bounds.Top);
// FirstOrDefault will return a (MPos.Zero, Color.Transparent) if positions is empty
var actorColor = positions.FirstOrDefault(ap => ap.Position == uv).Color;
if (actorColor.A == 0)
terrainColor = GetTerrainColorPair(uv);
if (isRectangularIsometric)
for (var x = 0; x < width; x++)
{
// Odd rows are shifted right by 1px
var dx = uv.V & 1;
var xOffset = pxStride * (2 * x + dx);
if (x + dx > 0)
var uv = new MPos(x + Bounds.Left, y + Bounds.Top);
// FirstOrDefault will return a (MPos.Zero, Color.Transparent) if positions is empty
var actorColor = positions.FirstOrDefault(ap => ap.Position == uv).Color;
if (actorColor.A == 0)
terrainColor = GetTerrainColorPair(uv);
if (isRectangularIsometric)
{
var z = y * stride + xOffset - pxStride;
// Odd rows are shifted right by 1px
var dx = uv.V & 1;
var xOffset = pxStride * (2 * x + dx);
if (x + dx > 0)
{
var z = y * stride + xOffset - pxStride;
var c = actorColor.A == 0 ? terrainColor.Left : actorColor;
minimapData[z++] = c.R;
minimapData[z++] = c.G;
minimapData[z++] = c.B;
minimapData[z] = c.A;
}
if (xOffset < stride)
{
var z = y * stride + xOffset;
var c = actorColor.A == 0 ? terrainColor.Right : actorColor;
minimapData[z++] = c.R;
minimapData[z++] = c.G;
minimapData[z++] = c.B;
minimapData[z] = c.A;
}
}
else
{
var z = y * stride + pxStride * x;
var c = actorColor.A == 0 ? terrainColor.Left : actorColor;
minimapData[z++] = c.R;
minimapData[z++] = c.G;
minimapData[z++] = c.B;
minimapData[z] = c.A;
}
if (xOffset < stride)
{
var z = y * stride + xOffset;
var c = actorColor.A == 0 ? terrainColor.Right : actorColor;
minimapData[z++] = c.R;
minimapData[z++] = c.G;
minimapData[z++] = c.B;
minimapData[z] = c.A;
}
}
else
{
var z = y * stride + pxStride * x;
var c = actorColor.A == 0 ? terrainColor.Left : actorColor;
minimapData[z++] = c.R;
minimapData[z++] = c.G;
minimapData[z++] = c.B;
minimapData[z] = c.A;
}
}
}
var png = new Png(minimapData, bitmapWidth, height);
return png.Save();
var png = new Png(minimapData, bitmapWidth, height);
return png.Save();
}
}
public bool Contains(CPos cell)

View File

@@ -166,6 +166,7 @@ namespace OpenRA
public void QueryRemoteMapDetails(string repositoryUrl, IEnumerable<string> uids, Action<MapPreview> mapDetailsReceived = null, Action queryFailed = null)
{
var maps = uids.Distinct()
.Where(uid => uid != null)
.Select(uid => previews[uid])
.Where(p => p.Status == MapStatus.Unavailable)
.ToDictionary(p => p.Uid, p => p);

View File

@@ -50,6 +50,9 @@ namespace OpenRA
public bool LockTeam = false;
public int Team = 0;
public bool LockHandicap = false;
public int Handicap = 0;
public string[] Allies = { };
public string[] Enemies = { };

View File

@@ -23,8 +23,6 @@ namespace OpenRA
}
public override int GetHashCode() { return Type.GetHashCode() ^ Index.GetHashCode(); }
public override string ToString() { return Type + "," + Index; }
}
public struct ResourceTile

View File

@@ -221,30 +221,25 @@ namespace OpenRA
public byte GetTerrainIndex(TerrainTile r)
{
var tile = Templates[r.Type][r.Index];
if (tile.TerrainType != byte.MaxValue)
return tile.TerrainType;
if (!Templates.TryGetValue(r.Type, out var tpl))
return defaultWalkableTerrainIndex;
if (tpl.Contains(r.Index))
{
var tile = tpl[r.Index];
if (tile != null && tile.TerrainType != byte.MaxValue)
return tile.TerrainType;
}
return defaultWalkableTerrainIndex;
}
public TerrainTileInfo GetTileInfo(TerrainTile r)
{
return Templates[r.Type][r.Index];
if (!Templates.TryGetValue(r.Type, out var tpl))
return null;
return tpl.Contains(r.Index) ? tpl[r.Index] : null;
}
public bool TryGetTileInfo(TerrainTile r, out TerrainTileInfo info)
{
if (!Templates.TryGetValue(r.Type, out var tpl) || !tpl.Contains(r.Index))
{
info = null;
return false;
}
info = tpl[r.Index];
return info != null;
}
public TerrainTile DefaultTerrainTile { get { return new TerrainTile(Templates.First().Key, 0); } }
}
}

View File

@@ -25,6 +25,7 @@ namespace OpenRA.Network
public readonly string Faction;
public readonly int SpawnPoint;
public readonly int Team;
public readonly int Handicap;
public readonly string Slot;
public readonly string Bot;
public readonly bool IsAdmin;
@@ -39,6 +40,7 @@ namespace OpenRA.Network
Faction = client.Faction;
SpawnPoint = client.SpawnPoint;
Team = client.Team;
Handicap = client.Handicap;
Slot = client.Slot;
Bot = client.Bot;
IsAdmin = client.IsAdmin;
@@ -53,6 +55,7 @@ namespace OpenRA.Network
client.Faction = Faction;
client.SpawnPoint = SpawnPoint;
client.Team = Team;
client.Handicap = Handicap;
client.Slot = Slot;
client.Bot = Bot;
client.IsAdmin = IsAdmin;

View File

@@ -144,6 +144,7 @@ namespace OpenRA.Network
public ClientState State = ClientState.Invalid;
public int Team;
public int Handicap;
public string Slot; // Slot ID, or null for observer
public string Bot; // Bot type, null for real clients
public int BotControllerClientIndex; // who added the bot to the slot
@@ -193,6 +194,7 @@ namespace OpenRA.Network
public bool LockFaction;
public bool LockColor;
public bool LockTeam;
public bool LockHandicap;
public bool LockSpawn;
public bool Required;

View File

@@ -15,7 +15,6 @@ using System.IO;
using System.Linq;
using System.Reflection;
using OpenRA.Primitives;
using OpenRA.Support;
namespace OpenRA
{
@@ -43,48 +42,25 @@ namespace OpenRA
if (resolvedPath == null)
throw new FileNotFoundException("Assembly `{0}` not found.".F(path));
LoadAssembly(assemblyList, resolvedPath);
// .NET doesn't provide any way of querying the metadata of an assembly without either:
// (a) loading duplicate data into the application domain, breaking the world.
// (b) crashing if the assembly has already been loaded.
// We can't check the internal name of the assembly, so we'll work off the data instead
var hash = CryptoUtil.SHA1Hash(File.ReadAllBytes(resolvedPath));
if (!ResolvedAssemblies.TryGetValue(hash, out var assembly))
{
assembly = Assembly.LoadFile(resolvedPath);
ResolvedAssemblies.Add(hash, assembly);
}
assemblyList.Add(assembly);
}
AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly;
assemblies = assemblyList.SelectMany(asm => asm.GetNamespaces().Select(ns => (asm, ns))).ToArray();
}
void LoadAssembly(List<Assembly> assemblyList, string resolvedPath)
{
// .NET doesn't provide any way of querying the metadata of an assembly without either:
// (a) loading duplicate data into the application domain, breaking the world.
// (b) crashing if the assembly has already been loaded.
// We can't check the internal name of the assembly, so we'll work off the data instead
var hash = CryptoUtil.SHA1Hash(File.ReadAllBytes(resolvedPath));
if (!ResolvedAssemblies.TryGetValue(hash, out var assembly))
{
#if MONO
assembly = Assembly.LoadFile(resolvedPath);
ResolvedAssemblies.Add(hash, assembly);
// Allow mods to use libraries.
var assemblyPath = Path.GetDirectoryName(resolvedPath);
if (assemblyPath != null)
{
foreach (var referencedAssembly in assembly.GetReferencedAssemblies())
{
var depedencyPath = Path.Combine(assemblyPath, referencedAssembly.Name + ".dll");
if (File.Exists(depedencyPath))
LoadAssembly(assemblyList, depedencyPath);
}
}
#else
var loader = new AssemblyLoader(resolvedPath);
assembly = loader.LoadDefaultAssembly();
ResolvedAssemblies.Add(hash, assembly);
#endif
}
assemblyList.Add(assembly);
}
Assembly ResolveAssembly(object sender, ResolveEventArgs e)
{
foreach (var a in AppDomain.CurrentDomain.GetAssemblies())

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -39,11 +39,6 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<AdditionalFiles Include="../stylecop.json" />
</ItemGroup>
<ItemGroup Condition="'$(Mono)' == ''">
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="5.0.0-preview.3-runtime.20214.6" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
</ItemGroup>
<Target Name="DisableAnalyzers" BeforeTargets="CoreCompile" Condition="'$(Configuration)'=='Release'">
<!-- Disable code style analysis on Release builds to improve compile-time performance -->
<ItemGroup Condition="'$(Configuration)'=='Release'">

View File

@@ -58,6 +58,7 @@ namespace OpenRA
public readonly bool Playable = true;
public readonly int ClientIndex;
public readonly CPos HomeLocation;
public readonly int Handicap;
public readonly PlayerReference PlayerReference;
public readonly bool IsBot;
public readonly string BotType;
@@ -180,6 +181,8 @@ namespace OpenRA
HomeLocation = assignSpawnPoints?.AssignHomeLocation(world, client, playerRandom) ?? pr.HomeLocation;
SpawnPoint = assignSpawnPoints?.SpawnPointForPlayer(this) ?? client.SpawnPoint;
DisplaySpawnPoint = client.SpawnPoint;
Handicap = client.Handicap;
}
else
{
@@ -195,6 +198,7 @@ namespace OpenRA
DisplayFaction = ResolveDisplayFaction(world, pr.Faction);
HomeLocation = pr.HomeLocation;
SpawnPoint = DisplaySpawnPoint = 0;
Handicap = pr.Handicap;
}
if (!spectating)

View File

@@ -93,6 +93,8 @@ namespace OpenRA.Server
c.SpawnPoint = pr.Spawn;
if (pr.LockTeam)
c.Team = pr.Team;
if (pr.LockHandicap)
c.Team = pr.Handicap;
c.Color = pr.LockColor ? pr.Color : c.PreferredColor;
}
@@ -437,6 +439,7 @@ namespace OpenRA.Server
Faction = "Random",
SpawnPoint = 0,
Team = 0,
Handicap = 0,
State = Session.ClientState.Invalid,
};

View File

@@ -256,6 +256,8 @@ namespace OpenRA
public int IntroductionPromptVersion = 0;
public MPGameFilters MPGameFilters = MPGameFilters.Waiting | MPGameFilters.Empty | MPGameFilters.Protected | MPGameFilters.Started;
public bool PauseShellmap = false;
}
public class Settings

View File

@@ -1,363 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
// Not used/usable on Mono. Only used for Dotnet Core.
// Based on https://github.com/natemcmaster/DotNetCorePlugins and used under the terms of the Apache 2.0 license
#if !MONO
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Loader;
using Microsoft.Extensions.DependencyModel;
namespace OpenRA.Support
{
public class AssemblyLoader
{
readonly string mainAssembly;
readonly AssemblyLoadContext context;
public Assembly LoadDefaultAssembly() => context.LoadFromAssemblyPath(mainAssembly);
public AssemblyLoader(string assemblyFile)
{
mainAssembly = assemblyFile;
var baseDir = Path.GetDirectoryName(assemblyFile);
context = CreateLoadContext(baseDir, assemblyFile);
}
static AssemblyLoadContext CreateLoadContext(string baseDir, string assemblyFile)
{
var depsJsonFile = Path.Combine(baseDir, Path.GetFileNameWithoutExtension(assemblyFile) + ".deps.json");
var builder = new AssemblyLoadContextBuilder();
builder.TryAddDependencyContext(depsJsonFile, out _);
builder.SetBaseDirectory(baseDir);
return builder.Build();
}
}
public class AssemblyLoadContextBuilder
{
readonly Dictionary<string, ManagedLibrary> managedLibraries = new Dictionary<string, ManagedLibrary>(StringComparer.Ordinal);
readonly Dictionary<string, NativeLibrary> nativeLibraries = new Dictionary<string, NativeLibrary>(StringComparer.Ordinal);
string basePath;
public AssemblyLoadContext Build()
{
return new ManagedLoadContext(basePath, managedLibraries, nativeLibraries);
}
public AssemblyLoadContextBuilder SetBaseDirectory(string path)
{
if (string.IsNullOrEmpty(path))
throw new ArgumentException("Argument must not be null or empty.", nameof(path));
if (!Path.IsPathRooted(path))
throw new ArgumentException("Argument must be a full path.", nameof(path));
basePath = path;
return this;
}
public AssemblyLoadContextBuilder AddManagedLibrary(ManagedLibrary library)
{
managedLibraries.Add(library.Name.Name, library);
return this;
}
public AssemblyLoadContextBuilder AddNativeLibrary(NativeLibrary library)
{
ValidateRelativePath(library.AppLocalPath);
nativeLibraries.Add(library.Name, library);
return this;
}
static void ValidateRelativePath(string probingPath)
{
if (string.IsNullOrEmpty(probingPath))
throw new ArgumentException("Value must not be null or empty.", nameof(probingPath));
if (Path.IsPathRooted(probingPath))
throw new ArgumentException("Argument must be a relative path.", nameof(probingPath));
}
}
class ManagedLoadContext : AssemblyLoadContext
{
readonly string basePath;
readonly Dictionary<string, ManagedLibrary> managedAssemblies;
readonly Dictionary<string, NativeLibrary> nativeLibraries;
static readonly string[] NativeLibraryExtensions;
static readonly string[] NativeLibraryPrefixes;
static readonly string[] ManagedAssemblyExtensions =
{
".dll",
".ni.dll",
".exe",
".ni.exe"
};
static ManagedLoadContext()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
NativeLibraryPrefixes = new[] { "" };
NativeLibraryExtensions = new[] { ".dll" };
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
NativeLibraryPrefixes = new[] { "", "lib", };
NativeLibraryExtensions = new[] { ".dylib" };
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
NativeLibraryPrefixes = new[] { "", "lib" };
NativeLibraryExtensions = new[] { ".so", ".so.1" };
}
else
{
NativeLibraryPrefixes = Array.Empty<string>();
NativeLibraryExtensions = Array.Empty<string>();
}
}
public ManagedLoadContext(string baseDirectory, Dictionary<string, ManagedLibrary> managedAssemblies, Dictionary<string, NativeLibrary> nativeLibraries)
{
basePath = baseDirectory ?? throw new ArgumentNullException(nameof(baseDirectory));
this.managedAssemblies = managedAssemblies ?? throw new ArgumentNullException(nameof(managedAssemblies));
this.nativeLibraries = nativeLibraries ?? throw new ArgumentNullException(nameof(nativeLibraries));
}
protected override Assembly Load(AssemblyName assemblyName)
{
// If default context is preferred, check first for types in the default context unless the dependency has been declared as private
try
{
var defaultAssembly = Default.LoadFromAssemblyName(assemblyName);
if (defaultAssembly != null)
return null;
}
catch
{
// Swallow errors in loading from the default context
}
if (managedAssemblies.TryGetValue(assemblyName.Name, out var library) && SearchForLibrary(library, out var path))
return LoadFromAssemblyPath(path);
return null;
}
protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
{
foreach (var prefix in NativeLibraryPrefixes)
if (nativeLibraries.TryGetValue(prefix + unmanagedDllName, out var library) && SearchForLibrary(library, prefix, out var path))
return LoadUnmanagedDllFromPath(path);
return base.LoadUnmanagedDll(unmanagedDllName);
}
bool SearchForLibrary(ManagedLibrary library, out string path)
{
// 1. Search in base path
foreach (var ext in ManagedAssemblyExtensions)
{
var local = Path.Combine(basePath, library.Name.Name + ext);
if (File.Exists(local))
{
path = local;
return true;
}
}
path = null;
return false;
}
bool SearchForLibrary(NativeLibrary library, string prefix, out string path)
{
// 1. Search in base path
foreach (var ext in NativeLibraryExtensions)
{
var candidate = Path.Combine(basePath, $"{prefix}{library.Name}{ext}");
if (File.Exists(candidate))
{
path = candidate;
return true;
}
}
// 2. Search in base path + app local (for portable deployments of netcoreapp)
var local = Path.Combine(basePath, library.AppLocalPath);
if (File.Exists(local))
{
path = local;
return true;
}
path = null;
return false;
}
}
public class ManagedLibrary
{
public AssemblyName Name { get; private set; }
public static ManagedLibrary CreateFromPackage(string assetPath)
{
return new ManagedLibrary
{
Name = new AssemblyName(Path.GetFileNameWithoutExtension(assetPath))
};
}
}
public class NativeLibrary
{
public string Name { get; private set; }
public string AppLocalPath { get; private set; }
public static NativeLibrary CreateFromPackage(string assetPath)
{
return new NativeLibrary
{
Name = Path.GetFileNameWithoutExtension(assetPath),
AppLocalPath = assetPath
};
}
}
public static class DependencyContextExtensions
{
public static AssemblyLoadContextBuilder TryAddDependencyContext(this AssemblyLoadContextBuilder builder, string depsFilePath, out Exception error)
{
error = null;
try
{
builder.AddDependencyContext(depsFilePath);
}
catch (Exception ex)
{
error = ex;
}
return builder;
}
public static AssemblyLoadContextBuilder AddDependencyContext(this AssemblyLoadContextBuilder builder, string depsFilePath)
{
var reader = new DependencyContextJsonReader();
using (var file = File.OpenRead(depsFilePath))
{
var deps = reader.Read(file);
builder.SetBaseDirectory(Path.GetDirectoryName(depsFilePath));
builder.AddDependencyContext(deps);
}
return builder;
}
static string GetFallbackRid()
{
string ridBase;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
ridBase = "win10";
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
ridBase = "linux";
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
ridBase = "osx.10.12";
else
return "any";
switch (RuntimeInformation.OSArchitecture)
{
case Architecture.X86:
return ridBase + "-x86";
case Architecture.X64:
return ridBase + "-x64";
case Architecture.Arm:
return ridBase + "-arm";
case Architecture.Arm64:
return ridBase + "-arm64";
}
return ridBase;
}
public static AssemblyLoadContextBuilder AddDependencyContext(this AssemblyLoadContextBuilder builder, DependencyContext dependencyContext)
{
var ridGraph = dependencyContext.RuntimeGraph.Any()
? dependencyContext.RuntimeGraph
: DependencyContext.Default.RuntimeGraph;
var rid = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier();
var fallbackRid = GetFallbackRid();
var fallbackGraph = ridGraph.FirstOrDefault(g => g.Runtime == rid)
?? ridGraph.FirstOrDefault(g => g.Runtime == fallbackRid)
?? new RuntimeFallbacks("any");
foreach (var managed in dependencyContext.ResolveRuntimeAssemblies(fallbackGraph))
builder.AddManagedLibrary(managed);
foreach (var native in dependencyContext.ResolveNativeAssets(fallbackGraph))
builder.AddNativeLibrary(native);
return builder;
}
static IEnumerable<ManagedLibrary> ResolveRuntimeAssemblies(this DependencyContext depContext, RuntimeFallbacks runtimeGraph)
{
var rids = GetRids(runtimeGraph);
return from library in depContext.RuntimeLibraries
from assetPath in SelectAssets(rids, library.RuntimeAssemblyGroups)
select ManagedLibrary.CreateFromPackage(assetPath);
}
static IEnumerable<NativeLibrary> ResolveNativeAssets(this DependencyContext depContext, RuntimeFallbacks runtimeGraph)
{
var rids = GetRids(runtimeGraph);
return from library in depContext.RuntimeLibraries
from assetPath in SelectAssets(rids, library.NativeLibraryGroups)
where !assetPath.EndsWith(".a", StringComparison.Ordinal)
select NativeLibrary.CreateFromPackage(assetPath);
}
static IEnumerable<string> GetRids(RuntimeFallbacks runtimeGraph)
{
return Enumerable.Concat(new[] { runtimeGraph.Runtime }, runtimeGraph?.Fallbacks ?? Enumerable.Empty<string>());
}
static IEnumerable<string> SelectAssets(IEnumerable<string> rids, IEnumerable<RuntimeAssetGroup> groups)
{
foreach (var rid in rids)
{
var group = groups.FirstOrDefault(g => g.Runtime == rid);
if (group != null)
return group.AssetPaths;
}
return groups.GetDefaultAssets();
}
}
}
#endif

View File

@@ -32,6 +32,7 @@ namespace OpenRA
readonly List<IEffect> effects = new List<IEffect>();
readonly List<IEffect> unpartitionedEffects = new List<IEffect>();
readonly List<ISync> syncedEffects = new List<ISync>();
readonly GameSettings gameSettings;
readonly Queue<Action<World>> frameEndActions = new Queue<Action<World>>();
@@ -226,6 +227,7 @@ namespace OpenRA
};
RulesContainTemporaryBlocker = map.Rules.Actors.Any(a => a.Value.HasTraitInfo<ITemporaryBlockerInfo>());
gameSettings = Game.Settings.Game;
}
public void AddToMaps(Actor self, IOccupySpace ios)
@@ -424,7 +426,9 @@ namespace OpenRA
wasLoadingGameSave = false;
}
if (!Paused)
// Allow users to pause the shellmap via the settings menu
// Some traits initialize important state during the first tick, so we must allow it to tick at least once
if (!Paused && (Type != WorldType.Shellmap || !gameSettings.PauseShellmap || WorldTick == 0))
{
WorldTick++;

View File

@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework Condition="'$(Mono)' == ''">net5.0</TargetFramework>
<TargetFramework Condition="'$(Mono)' != ''">netstandard2.1</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -18,8 +17,6 @@
<CodeAnalysisRuleSet>..\OpenRA.ruleset</CodeAnalysisRuleSet>
<Configurations>Release;Debug</Configurations>
<AssemblyName>OpenRA</AssemblyName>
<IsPublishable Condition="'$(CopyGenericLauncher)' == 'False'">false</IsPublishable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup>
<TargetPlatform Condition="$([MSBuild]::IsOsPlatform('Windows'))">win-x64</TargetPlatform>
@@ -65,8 +62,4 @@
<Analyzer Remove="@(Analyzer)" />
</ItemGroup>
</Target>
<ItemGroup>
<TrimmerRootAssembly Include="netstandard" />
<TrimmerRootAssembly Include="System.IO.Pipes" />
</ItemGroup>
</Project>

View File

@@ -32,6 +32,11 @@ namespace OpenRA.Mods.Cnc.FileFormats
public static class AudReader
{
public static byte[] LoadSound(byte[] raw, ref int index)
{
return ImaAdpcmReader.LoadImaAdpcmSound(raw, ref index);
}
public static float SoundLength(Stream s)
{
var sampleRate = s.ReadUInt16();

View File

@@ -1,138 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using OpenRA.FileSystem;
using OpenRA.Primitives;
namespace OpenRA.Mods.Cnc.FileSystem
{
/// <summary>
/// This class supports loading unencrypted V3 .meg files using
/// reference documentation from here https://modtools.petrolution.net/docs/MegFileFormat
/// </summary>
public class MegV3Loader : IPackageLoader
{
const uint UnencryptedMegID = 0xFFFFFFFF;
// Float value 0.99, but it is simpler to read and compare as an integer
const uint MegVersion = 0x3F7D70A4;
public bool TryParsePackage(Stream s, string filename, OpenRA.FileSystem.FileSystem context, out IReadOnlyPackage package)
{
var position = s.Position;
var id = s.ReadUInt32();
var version = s.ReadUInt32();
s.Position = position;
if (id != UnencryptedMegID || version != MegVersion)
{
package = null;
return false;
}
package = new MegFile(s, filename);
return true;
}
public sealed class MegFile : IReadOnlyPackage
{
readonly Stream s;
readonly Dictionary<string, (uint Offset, int Length)> contents = new Dictionary<string, (uint Offset, int Length)>();
public MegFile(Stream s, string filename)
{
Name = filename;
this.s = s;
var id = s.ReadUInt32();
var version = s.ReadUInt32();
if (id != UnencryptedMegID || version != MegVersion)
throw new Exception("Invalid file signature for meg file");
var headerSize = s.ReadUInt32();
var numStrings = s.ReadUInt32();
var numFiles = s.ReadUInt32();
var stringsSize = s.ReadUInt32();
var stringsStart = s.Position;
var filenames = new List<string>();
// The file names are an indexed array of strings
for (var i = 0; i < numStrings; i++)
{
var length = s.ReadUInt16();
filenames.Add(s.ReadASCII(length));
}
// The header indicates where we should be, so verify it
if (s.Position != stringsSize + stringsStart)
throw new Exception("File name table in .meg file inconsistent");
// Now we load each file entry and associated info
for (var i = 0; i < numFiles; i++)
{
// Ignore flags, crc, index
s.Position += 10;
var size = s.ReadUInt32();
var offset = s.ReadUInt32();
var nameIndex = s.ReadUInt16();
contents[filenames[nameIndex]] = (offset, (int)size);
}
if (s.Position != headerSize)
throw new Exception("Expected to be at data start offset");
}
public string Name { get; }
public IEnumerable<string> Contents => contents.Keys;
public bool Contains(string filename)
{
return contents.ContainsKey(filename);
}
public void Dispose()
{
s.Dispose();
}
public Stream GetStream(string filename)
{
// Look up the index of the filename
if (!contents.TryGetValue(filename, out var index))
return null;
return SegmentStream.CreateWithoutOwningStream(s, index.Offset, index.Length);
}
public IReadOnlyPackage OpenPackage(string filename, OpenRA.FileSystem.FileSystem context)
{
var childStream = GetStream(filename);
if (childStream == null)
return null;
if (context.TryParsePackage(childStream, filename, out var package))
return package;
childStream.Dispose();
return null;
}
}
}
}

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<LangVersion>7.3</LangVersion>
@@ -11,7 +11,6 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<CodeAnalysisRuleSet>..\OpenRA.ruleset</CodeAnalysisRuleSet>
<IsPublishable Condition="'$(CopyCncDll)' == 'False'">false</IsPublishable>
</PropertyGroup>
<ItemGroup>
<!-- Work around an issue where Rider does not detect files in the project root using the default glob -->
@@ -38,4 +37,4 @@
<Analyzer Remove="@(Analyzer)" />
</ItemGroup>
</Target>
</Project>
</Project>

View File

@@ -82,6 +82,9 @@ namespace OpenRA.Mods.Cnc.Traits
protected override bool CanAttack(Actor self, in Target target)
{
if (IsTraitPaused)
return false;
if (state == PopupState.Closed)
{
state = PopupState.Transitioning;
@@ -103,6 +106,9 @@ namespace OpenRA.Mods.Cnc.Traits
void INotifyIdle.TickIdle(Actor self)
{
if (IsTraitDisabled || IsTraitPaused)
return;
if (state == PopupState.Open && idleTicks++ > info.CloseDelay)
{
var facingOffset = new WVec(0, -1024, 0).Rotate(WRot.FromYaw(info.DefaultFacing));

View File

@@ -120,7 +120,7 @@ namespace OpenRA.Mods.Cnc.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -174,7 +174,7 @@ namespace OpenRA.Mods.Cnc.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}
@@ -274,7 +274,7 @@ namespace OpenRA.Mods.Cnc.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -142,6 +142,13 @@ namespace OpenRA.Mods.Common.Activities
// We don't know where the target actually is, so move to where we last saw it
if (useLastVisibleTarget)
{
// HACK: Bot players ignore the standard visibility checks in target.Recalculate,
// which means that targetIsHiddenActor is always false, allowing lastVisibleMaximumRange
// to be assigned zero range by attackAircraft.GetMaximumRangeVersusTarget for e.g. cloaked actors.
// Catch and cancel this edge case to avoid the aircraft stopping mid-air!
if (self.Owner.IsBot && lastVisibleMaximumRange == WDist.Zero)
return true;
// We've reached the assumed position but it is not there - give up
if (checkTarget.IsInRange(pos, lastVisibleMaximumRange))
return true;

View File

@@ -89,6 +89,9 @@ namespace OpenRA.Mods.Common.Widgets
var tile = world.Map.Tiles[cell];
var tileInfo = world.Map.Rules.TileSet.GetTileInfo(tile);
if (tileInfo == null)
return false;
var terrainType = world.Map.Rules.TileSet.TerrainInfo[tileInfo.TerrainType];
if (mapResources[cell].Type == ResourceType.ResourceType)

View File

@@ -72,8 +72,7 @@ namespace OpenRA.Mods.Common.Effects
return;
var exit = building.NearestExitOrDefault(targetLineNodes[0]);
var exitPos = exit != null ? building.World.Map.CenterOfCell(building.Location + exit.Info.ExitCell) : building.CenterPosition;
targetLineNodes.Insert(0, exitPos);
targetLineNodes.Insert(0, building.CenterPosition + (exit?.Info.SpawnOffset ?? WVec.Zero));
}
IEnumerable<IRenderable> IEffect.Render(WorldRenderer wr) { return SpriteRenderable.None; }

View File

@@ -319,7 +319,7 @@ namespace OpenRA.Mods.Common.FileFormats
// Annoyingly, the complete table is not applied until the frame
// *after* the one that contains the 8th chunk.
// Do we have a set of partial lookup tables ready to apply?
if (currentChunkBuffer == chunkBufferParts)
if (currentChunkBuffer == chunkBufferParts && chunkBufferParts != 0)
{
if (!cbpIsCompressed)
cbf = (byte[])cbp.Clone();

View File

@@ -1,25 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using System;
using System.Linq;
namespace OpenRA.Mods.Common.Lint
{
public class CheckMapTiles : ILintMapPass
{
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData, Map map)
{
foreach (var kv in map.ReplacedInvalidTerrainTiles)
emitError("Cell {0} references invalid terrain tile {1}.".F(kv.Key, kv.Value));
}
}
}

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<LangVersion>7.3</LangVersion>
@@ -11,7 +11,6 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<CodeAnalysisRuleSet>..\OpenRA.ruleset</CodeAnalysisRuleSet>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<!-- Work around an issue where Rider does not detect files in the project root using the default glob -->
@@ -25,7 +24,6 @@
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
<Private>False</Private>
</ProjectReference>
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="OpenRA-FuzzyLogicLibrary" Version="1.0.1" />
<PackageReference Include="DiscordRichPresence" Version="1.0.150" />
<PackageReference Include="rix0rrr.BeaconLib" Version="1.0.2" />

View File

@@ -21,12 +21,14 @@ namespace OpenRA.Mods.Common.Scripting
{
readonly SpawnMapActors sma;
readonly World world;
readonly GameSettings gameSettings;
public MapGlobal(ScriptContext context)
: base(context)
{
sma = context.World.WorldActor.Trait<SpawnMapActors>();
world = context.World;
gameSettings = Game.Settings.Game;
// Register map actors as globals (yuck!)
foreach (var kv in sma.Actors)
@@ -109,6 +111,9 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Returns true if there is only one human player.")]
public bool IsSinglePlayer { get { return Context.World.LobbyInfo.NonBotPlayers.Count() == 1; } }
[Desc("Returns true if this is a shellmap and the player has paused animations.")]
public bool IsPausedShellmap { get { return Context.World.Type == WorldType.Shellmap && gameSettings.PauseShellmap; } }
[Desc("Returns the value of a `ScriptLobbyDropdown` selected in the game lobby.")]
public LuaValue LobbyOption(string id)
{

View File

@@ -9,6 +9,8 @@
*/
#endregion
using Eluant;
using OpenRA.Primitives;
using OpenRA.Scripting;
using OpenRA.Traits;
@@ -34,10 +36,18 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Maximum health of the actor.")]
public int MaxHealth { get { return health.MaxHP; } }
[Desc("Kill the actor.")]
public void Kill()
[Desc("Kill the actor. damageTypes may be omitted, specified as a string, or as table of strings.")]
public void Kill(object damageTypes = null)
{
health.InflictDamage(Self, Self, new Damage(health.MaxHP), true);
Damage damage;
if (damageTypes is string d)
damage = new Damage(health.MaxHP, new BitSet<DamageType>(new[] { d }));
else if (damageTypes is LuaTable t && t.TryGetClrValue(out string[] ds))
damage = new Damage(health.MaxHP, new BitSet<DamageType>(ds));
else
damage = new Damage(health.MaxHP);
health.InflictDamage(Self, Self, damage, true);
}
}
}

View File

@@ -52,6 +52,16 @@ namespace OpenRA.Mods.Common.Scripting
}
}
[Desc("The player's handicap level.")]
public int Handicap
{
get
{
var c = Player.World.LobbyInfo.Clients.FirstOrDefault(i => i.Index == Player.ClientIndex);
return c?.Handicap ?? 0;
}
}
[Desc("Returns true if the player is a bot.")]
public bool IsBot { get { return Player.IsBot; } }

View File

@@ -43,6 +43,7 @@ namespace OpenRA.Mods.Common.Server
{ "name", Name },
{ "faction", Faction },
{ "team", Team },
{ "handicap", Handicap },
{ "spawn", Spawn },
{ "clear_spawn", ClearPlayerSpawn },
{ "color", PlayerColor },
@@ -245,6 +246,7 @@ namespace OpenRA.Mods.Common.Server
client.Slot = null;
client.SpawnPoint = 0;
client.Team = 0;
client.Handicap = 0;
client.Color = Color.White;
server.SyncLobbyClients();
CheckAutoStart(server);
@@ -377,6 +379,7 @@ namespace OpenRA.Mods.Common.Server
Faction = "Random",
SpawnPoint = 0,
Team = 0,
Handicap = 0,
State = Session.ClientState.NotReady,
BotControllerClientIndex = controllerClientIndex
};
@@ -736,6 +739,7 @@ namespace OpenRA.Mods.Common.Server
targetClient.Slot = null;
targetClient.SpawnPoint = 0;
targetClient.Team = 0;
targetClient.Handicap = 0;
targetClient.Color = Color.White;
targetClient.State = Session.ClientState.NotReady;
server.SendMessage("{0} moved {1} to spectators.".F(client.Name, targetClient.Name));
@@ -824,6 +828,42 @@ namespace OpenRA.Mods.Common.Server
}
}
static bool Handicap(S server, Connection conn, Session.Client client, string s)
{
lock (server.LobbyInfo)
{
var parts = s.Split(' ');
var targetClient = server.LobbyInfo.ClientWithIndex(Exts.ParseIntegerInvariant(parts[0]));
// Only the host can change other client's info
if (targetClient.Index != client.Index && !client.IsAdmin)
return true;
// Map has disabled handicap changes
if (server.LobbyInfo.Slots[targetClient.Slot].LockHandicap)
return true;
if (!Exts.TryParseIntegerInvariant(parts[1], out var handicap))
{
Log.Write("server", "Invalid handicap: {0}", s);
return false;
}
// Handicaps may be set between 0 - 95% in steps of 5%
var options = Enumerable.Range(0, 20).Select(i => 5 * i);
if (!options.Contains(handicap))
{
Log.Write("server", "Invalid handicap: {0}", s);
return false;
}
targetClient.Handicap = handicap;
server.SyncLobbyClients();
return true;
}
}
static bool ClearPlayerSpawn(S server, Connection conn, Session.Client client, string s)
{
var spawnPoint = Exts.ParseIntegerInvariant(s);
@@ -1003,6 +1043,7 @@ namespace OpenRA.Mods.Common.Server
LockFaction = pr.LockFaction,
LockColor = pr.LockColor,
LockTeam = pr.LockTeam,
LockHandicap = pr.LockHandicap,
LockSpawn = pr.LockSpawn,
Required = pr.Required,
};

View File

@@ -22,9 +22,6 @@ namespace OpenRA.Mods.Common.Server
{
lock (server.LobbyInfo)
{
if (server.LobbyInfo.ClientWithIndex(conn.PlayerIndex).IsAdmin)
return;
var defaults = new Session.Global();
LobbyCommands.LoadMapSettings(server, defaults, server.Map.Rules);

View File

@@ -13,7 +13,6 @@ using System;
using System.Collections.Generic;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BeaconLib;
using OpenRA.Network;
using OpenRA.Server;
@@ -108,7 +107,7 @@ namespace OpenRA.Mods.Common.Server
{
isBusy = true;
Task.Run(() =>
Action a = () =>
{
try
{
@@ -161,7 +160,9 @@ namespace OpenRA.Mods.Common.Server
}
isBusy = false;
});
};
a.BeginInvoke(null, null);
}
}
}

View File

@@ -348,8 +348,11 @@ namespace OpenRA.Mods.Common.Traits
return chosenTarget;
var targetsInRange = self.World.FindActorsInCircle(self.CenterPosition, scanRange)
.Select(Target.FromActor)
.Concat(self.Owner.FrozenActorLayer.FrozenActorsInCircle(self.World, self.CenterPosition, scanRange)
.Select(Target.FromActor);
if (allowMove || ab.Info.TargetFrozenActors)
targetsInRange = targetsInRange
.Concat(self.Owner.FrozenActorLayer.FrozenActorsInCircle(self.World, self.CenterPosition, scanRange)
.Select(Target.FromFrozenActor));
foreach (var target in targetsInRange)

View File

@@ -53,8 +53,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
if (AttackOrFleeFuzzy.Default.CanAttack(owner.Units, enemyUnits))
{
foreach (var u in owner.Units)
owner.Bot.QueueOrder(new Order("AttackMove", u, Target.FromCell(owner.World, owner.TargetActor.Location), false));
owner.Bot.QueueOrder(new Order("AttackMove", null, Target.FromCell(owner.World, owner.TargetActor.Location), false, groupedActors: owner.Units.ToArray()));
// We have gathered sufficient units. Attack the nearest enemy unit.
owner.FuzzyStateMachine.ChangeState(owner, new GroundUnitsAttackMoveState(), true);
@@ -124,8 +123,9 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
// Since units have different movement speeds, they get separated while approaching the target.
// Let them regroup into tighter formation.
owner.Bot.QueueOrder(new Order("Stop", leader, false));
foreach (var unit in owner.Units.Where(a => !ownUnits.Contains(a)))
owner.Bot.QueueOrder(new Order("AttackMove", unit, Target.FromCell(owner.World, leader.Location), false));
var units = owner.Units.Where(a => !ownUnits.Contains(a)).ToArray();
owner.Bot.QueueOrder(new Order("AttackMove", null, Target.FromCell(owner.World, leader.Location), false, groupedActors: units));
}
else
{
@@ -138,8 +138,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
owner.FuzzyStateMachine.ChangeState(owner, new GroundUnitsAttackState(), true);
}
else
foreach (var a in owner.Units)
owner.Bot.QueueOrder(new Order("AttackMove", a, Target.FromCell(owner.World, owner.TargetActor.Location), false));
owner.Bot.QueueOrder(new Order("AttackMove", null, Target.FromCell(owner.World, owner.TargetActor.Location), false, groupedActors: owner.Units.ToArray()));
}
if (ShouldFlee(owner))

View File

@@ -78,8 +78,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
if (AttackOrFleeFuzzy.Default.CanAttack(owner.Units, enemyUnits))
{
foreach (var u in owner.Units)
owner.Bot.QueueOrder(new Order("AttackMove", u, Target.FromCell(owner.World, owner.TargetActor.Location), false));
owner.Bot.QueueOrder(new Order("AttackMove", null, Target.FromCell(owner.World, owner.TargetActor.Location), false, groupedActors: owner.Units.ToArray()));
// We have gathered sufficient units. Attack the nearest enemy unit.
owner.FuzzyStateMachine.ChangeState(owner, new NavyUnitsAttackMoveState(), true);
@@ -149,8 +148,9 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
// Since units have different movement speeds, they get separated while approaching the target.
// Let them regroup into tighter formation.
owner.Bot.QueueOrder(new Order("Stop", leader, false));
foreach (var unit in owner.Units.Where(a => !ownUnits.Contains(a)))
owner.Bot.QueueOrder(new Order("AttackMove", unit, Target.FromCell(owner.World, leader.Location), false));
var units = owner.Units.Where(a => !ownUnits.Contains(a)).ToArray();
owner.Bot.QueueOrder(new Order("AttackMove", null, Target.FromCell(owner.World, leader.Location), false, groupedActors: units));
}
else
{
@@ -163,8 +163,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
owner.FuzzyStateMachine.ChangeState(owner, new NavyUnitsAttackState(), true);
}
else
foreach (var a in owner.Units)
owner.Bot.QueueOrder(new Order("AttackMove", a, Target.FromCell(owner.World, owner.TargetActor.Location), false));
owner.Bot.QueueOrder(new Order("AttackMove", null, Target.FromCell(owner.World, owner.TargetActor.Location), false, groupedActors: owner.Units.ToArray()));
}
if (ShouldFlee(owner))

View File

@@ -55,10 +55,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
Backoff--;
}
else
{
foreach (var a in owner.Units)
owner.Bot.QueueOrder(new Order("AttackMove", a, Target.FromCell(owner.World, owner.TargetActor.Location), false));
}
owner.Bot.QueueOrder(new Order("AttackMove", null, Target.FromCell(owner.World, owner.TargetActor.Location), false, groupedActors: owner.Units.ToArray()));
}
public void Deactivate(Squad owner) { }

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
// This is important because p may have side-effects that trigger a desync if not
// called on the same exits in the same order!
var all = Exits(actor, productionType)
.OrderBy(e => e.Info.Priority)
.OrderByDescending(e => e.Info.Priority)
.ThenBy(e => (actor.World.Map.CenterOfCell(actor.Location + e.Info.ExitCell) - pos).LengthSquared)
.ToList();

View File

@@ -0,0 +1,40 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Modifies the damage applied to this actor based on the owner's handicap.")]
public class HandicapDamageMultiplierInfo : TraitInfo
{
public override object Create(ActorInitializer init) { return new HandicapDamageMultiplier(init.Self); }
}
public class HandicapDamageMultiplier : IDamageModifier
{
readonly Actor self;
public HandicapDamageMultiplier(Actor self)
{
this.self = self;
}
int IDamageModifier.GetDamageModifier(Actor attacker, Damage damage)
{
// Equivalent to the health handicap from C&C3:
// 5% handicap = 95% health = 105% damage
// 50% handicap = 50% health = 200% damage
// 95% handicap = 5% health = 2000% damage
return 10000 / (100 - self.Owner.Handicap);
}
}
}

View File

@@ -0,0 +1,40 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Modifies the damage applied by this actor based on the owner's handicap.")]
public class HandicapFirepowerMultiplierInfo : TraitInfo
{
public override object Create(ActorInitializer init) { return new HandicapFirepowerMultiplier(init.Self); }
}
public class HandicapFirepowerMultiplier : IFirepowerModifier
{
readonly Actor self;
public HandicapFirepowerMultiplier(Actor self)
{
this.self = self;
}
int IFirepowerModifier.GetFirepowerModifier()
{
// Equivalent to the firepower handicap from C&C3:
// 5% handicap = 95% firepower
// 50% handicap = 50% firepower
// 95% handicap = 5% firepower
return 100 - self.Owner.Handicap;
}
}
}

View File

@@ -0,0 +1,32 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Modifies the production time of this actor based on the producer's handicap.")]
public class HandicapProductionTimeMultiplierInfo : TraitInfo<HandicapProductionTimeMultiplier>, IProductionTimeModifierInfo
{
int IProductionTimeModifierInfo.GetProductionTimeModifier(TechTree techTree, string queue)
{
// Equivalent to the build speed handicap from C&C3:
// 5% handicap = 105% build time
// 50% handicap = 150% build time
// 95% handicap = 195% build time
return 100 + techTree.Owner.Handicap;
}
}
public class HandicapProductionTimeMultiplier { }
}

View File

@@ -412,8 +412,11 @@ namespace OpenRA.Mods.Common.Traits
var hasPlayedSound = false;
BeginProduction(new ProductionItem(this, order.TargetString, cost, playerPower, () => self.World.AddFrameEndTask(_ =>
{
var isBuilding = unit.HasTraitInfo<BuildingInfo>();
// Make sure the item hasn't been invalidated between the ProductionItem ticking and this FrameEndTask running
if (!Queue.Any(i => i.Done && i.Item == unit.Name))
return;
var isBuilding = unit.HasTraitInfo<BuildingInfo>();
if (isBuilding && !hasPlayedSound)
hasPlayedSound = Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
else if (!isBuilding)

View File

@@ -106,6 +106,8 @@ namespace OpenRA.Mods.Common.Traits
return ret;
}
public Player Owner { get { return player; } }
class Watcher
{
public readonly string Key;

View File

@@ -29,8 +29,10 @@ namespace OpenRA.Mods.Common.Traits.Render
public readonly string DefaultAttackSequence = null;
[SequenceReference(dictionaryReference: LintDictionaryReference.Values)]
[Desc("Attack sequence to use for each armament.")]
public readonly Dictionary<string, string> AttackSequences = new Dictionary<string, string>();
[Desc("Attack sequence to use for each armament.",
"A dictionary of [armament name]: [sequence name(s)].",
"Multiple sequence names can be defined to specify per-burst animations.")]
public readonly Dictionary<string, string[]> AttackSequences = new Dictionary<string, string[]>();
[SequenceReference]
public readonly string[] IdleSequences = { };
@@ -133,11 +135,21 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public void Attacking(Actor self, in Target target, Armament a)
void Attacking(Actor self, Armament a, Barrel barrel)
{
var info = GetDisplayInfo();
if (!info.AttackSequences.TryGetValue(a.Info.Name, out var sequence))
sequence = info.DefaultAttackSequence;
var sequence = info.DefaultAttackSequence;
if (info.AttackSequences.TryGetValue(a.Info.Name, out var sequences) && sequences.Length > 0)
{
sequence = sequences[0];
// Find the sequence corresponding to this barrel/burst.
if (barrel != null && sequences.Length > 1)
for (var i = 0; i < sequences.Length; i++)
if (a.Barrels[i] == barrel)
sequence = sequences[i];
}
if (!string.IsNullOrEmpty(sequence) && DefaultAnimation.HasSequence(NormalizeInfantrySequence(self, sequence)))
{
@@ -148,12 +160,9 @@ namespace OpenRA.Mods.Common.Traits.Render
void INotifyAttack.PreparingAttack(Actor self, in Target target, Armament a, Barrel barrel)
{
// Lambdas can't use 'in' variables, so capture a copy for later
var attackTarget = target;
// HACK: The FrameEndTask makes sure that this runs after Tick(), preventing that from
// overriding the animation when an infantry unit stops to attack
self.World.AddFrameEndTask(_ => Attacking(self, attackTarget, a));
self.World.AddFrameEndTask(_ => Attacking(self, a, barrel));
}
void INotifyAttack.Attacking(Actor self, in Target target, Armament a, Barrel barrel) { }

View File

@@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Traits
void IOrderGenerator.Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -309,7 +309,7 @@ namespace OpenRA.Mods.Common.Traits
protected override void Tick(World world)
{
// Cancel the OG if we can't use the power
if (!manager.Powers.ContainsKey(order))
if (!manager.Powers.TryGetValue(order, out var p) || !p.Active || !p.Ready)
world.CancelInputMode();
}

View File

@@ -64,6 +64,7 @@ namespace OpenRA.Mods.Common.Traits
DisplayFactionId = clientFaction.InternalName,
Color = client.Color,
Team = client.Team,
Handicap = client.Handicap,
SpawnPoint = resolvedSpawnPoint,
IsRandomFaction = clientFaction.RandomFactionMembers.Any(),
IsRandomSpawnPoint = client.SpawnPoint == 0,

View File

@@ -214,6 +214,10 @@ namespace OpenRA.Mods.Common.Traits
if (factionInit != null && factionInit.Value == Owner.Faction)
return false;
var healthInit = init as HealthInit;
if (healthInit != null && healthInit.Value == 100)
return false;
// TODO: Other default values will need to be filtered
// here after we have built a properties panel
return true;

View File

@@ -78,7 +78,10 @@ namespace OpenRA.Mods.Common.Traits
for (var x = 0; x < TerrainTemplate.Size.X; x++)
{
var tile = new TerrainTile(TerrainTemplate.Id, (byte)i++);
if (!world.Map.Rules.TileSet.TryGetTileInfo(tile, out var tileInfo))
var tileInfo = world.Map.Rules.TileSet.GetTileInfo(tile);
// Empty tile
if (tileInfo == null)
continue;
var sprite = wr.Theater.TileSprite(tile, 0);

View File

@@ -218,6 +218,9 @@ namespace OpenRA.Mods.Common
if (t.IsGenericType && t.GetGenericTypeDefinition().GetInterfaces().Any(e => e.IsGenericType && e.GetGenericTypeDefinition() == typeof(IEnumerable<>)))
return "Collection of {0}".F(FriendlyTypeName(t.GetGenericArguments().First()));
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>))
return "{0} (optional)".F(t.GetGenericArguments().Select(FriendlyTypeName).First());
if (t == typeof(int) || t == typeof(uint))
return "Integer";

View File

@@ -104,7 +104,6 @@ namespace OpenRA.Mods.Common.UtilityCommands
" for (var j = 0; j < ctx.canvas.height / 4; j++)",
" for (var i = j % 2; i < ctx.canvas.width / 4; i += 2)",
" ctx.fillRect(4 * i, 4 * j, 4, 4);",
" ctx.imageSmoothingEnabled = false;",
" ctx.drawImage(image, 0, 0, c.width, c.height);",
" ctx.strokeStyle = \"#ffff00\";",
" ctx.lineWidth = 1;",

View File

@@ -268,11 +268,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
case "delete":
{
var sourcePath = Path.Combine(path, i.Value.Value);
// Try as an absolute path
if (!File.Exists(sourcePath))
sourcePath = Platform.ResolvePath(i.Value.Value);
// Yaml path may be specified relative to a named directory (e.g. ^SupportDir) or the detected disc path
var sourcePath = i.Value.Value.StartsWith("^") ? Platform.ResolvePath(i.Value.Value) : Path.Combine(path, i.Value.Value);
Log.Write("debug", "Deleting {0}", sourcePath);
File.Delete(sourcePath);
@@ -325,11 +322,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
static void ExtractFromPackage(ExtractionType type, string path, MiniYaml actionYaml, List<string> extractedFiles, Action<string> updateMessage)
{
var sourcePath = Path.Combine(path, actionYaml.Value);
// Try as an absolute path
if (!File.Exists(sourcePath))
sourcePath = Platform.ResolvePath(actionYaml.Value);
// Yaml path may be specified relative to a named directory (e.g. ^SupportDir) or the detected disc path
var sourcePath = actionYaml.Value.StartsWith("^") ? Platform.ResolvePath(actionYaml.Value) : Path.Combine(path, actionYaml.Value);
using (var source = File.OpenRead(sourcePath))
{
@@ -384,11 +378,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
static void ExtractFromMSCab(string path, MiniYaml actionYaml, List<string> extractedFiles, Action<string> updateMessage)
{
var sourcePath = Path.Combine(path, actionYaml.Value);
// Try as an absolute path
if (!File.Exists(sourcePath))
sourcePath = Platform.ResolvePath(actionYaml.Value);
// Yaml path may be specified relative to a named directory (e.g. ^SupportDir) or the detected disc path
var sourcePath = actionYaml.Value.StartsWith("^") ? Platform.ResolvePath(actionYaml.Value) : Path.Combine(path, actionYaml.Value);
using (var source = File.OpenRead(sourcePath))
{
@@ -418,11 +409,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
static void ExtractFromISCab(string path, MiniYaml actionYaml, List<string> extractedFiles, Action<string> updateMessage)
{
var sourcePath = Path.Combine(path, actionYaml.Value);
// Try as an absolute path
if (!File.Exists(sourcePath))
sourcePath = Platform.ResolvePath(actionYaml.Value);
// Yaml path may be specified relative to a named directory (e.g. ^SupportDir) or the detected disc path
var sourcePath = actionYaml.Value.StartsWith("^") ? Platform.ResolvePath(actionYaml.Value) : Path.Combine(path, actionYaml.Value);
var volumeNode = actionYaml.Nodes.FirstOrDefault(n => n.Key == "Volumes");
if (volumeNode == null)

View File

@@ -624,6 +624,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
LobbyUtils.SetupEditableColorWidget(template, slot, client, orderManager, shellmapWorld, colorPreview);
LobbyUtils.SetupEditableFactionWidget(template, slot, client, orderManager, factions);
LobbyUtils.SetupEditableTeamWidget(template, slot, client, orderManager, map);
LobbyUtils.SetupEditableHandicapWidget(template, slot, client, orderManager, map);
LobbyUtils.SetupEditableSpawnWidget(template, slot, client, orderManager, map);
LobbyUtils.SetupEditableReadyWidget(template, slot, client, orderManager, map);
}
@@ -640,6 +641,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (isHost)
{
LobbyUtils.SetupEditableTeamWidget(template, slot, client, orderManager, map);
LobbyUtils.SetupEditableHandicapWidget(template, slot, client, orderManager, map);
LobbyUtils.SetupEditableSpawnWidget(template, slot, client, orderManager, map);
LobbyUtils.SetupPlayerActionWidget(template, slot, client, orderManager, worldRenderer,
lobby, () => panel = PanelType.Kick, () => panel = PanelType.Players);
@@ -648,6 +650,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
LobbyUtils.SetupNameWidget(template, slot, client, orderManager, worldRenderer);
LobbyUtils.SetupTeamWidget(template, slot, client);
LobbyUtils.SetupHandicapWidget(template, slot, client);
LobbyUtils.SetupSpawnWidget(template, slot, client);
}
@@ -752,7 +755,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void UpdateDiscordStatus()
{
var mapTitle = map.Title;
var numberOfPlayers = 0;
var slots = 0;
@@ -771,6 +773,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
}
// Add extra slots to keep the join button active for spectators
if (numberOfPlayers == slots && orderManager.LobbyInfo.GlobalSettings.AllowSpectators)
slots = numberOfPlayers + 1;
var details = map.Title + " - " + orderManager.LobbyInfo.GlobalSettings.ServerName;
if (updateDiscordStatus)
{
string secret = null;
@@ -781,8 +788,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
var state = skirmishMode ? DiscordState.InSkirmishLobby : DiscordState.InMultiplayerLobby;
DiscordService.UpdateStatus(state, mapTitle, secret, numberOfPlayers, slots);
DiscordService.UpdateStatus(state, details, secret, numberOfPlayers, slots);
updateDiscordStatus = false;
}
else
@@ -790,7 +797,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (!skirmishMode)
DiscordService.UpdatePlayers(numberOfPlayers, slots);
DiscordService.UpdateDetails(mapTitle);
DiscordService.UpdateDetails(details);
}
}
@@ -806,7 +813,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Ui.CloseWindow();
var state = skirmishMode ? DiscordState.PlayingSkirmish : DiscordState.PlayingMultiplayer;
DiscordService.UpdateStatus(state);
var details = map.Title + " - " + orderManager.LobbyInfo.GlobalSettings.ServerName;
DiscordService.UpdateStatus(state, details);
onStart();
}

View File

@@ -146,6 +146,25 @@ namespace OpenRA.Mods.Common.Widgets.Logic
dropdown.ShowDropDown("TEAM_DROPDOWN_TEMPLATE", 150, options, setupItem);
}
public static void ShowHandicapDropDown(DropDownButtonWidget dropdown, Session.Client client,
OrderManager orderManager)
{
Func<int, ScrollItemWidget, ScrollItemWidget> setupItem = (ii, itemTemplate) =>
{
var item = ScrollItemWidget.Setup(itemTemplate,
() => client.Handicap == ii,
() => orderManager.IssueOrder(Order.Command("handicap {0} {1}".F(client.Index, ii))));
var label = "{0}%".F(ii);
item.Get<LabelWidget>("LABEL").GetText = () => label;
return item;
};
// Handicaps may be set between 0 - 95% in steps of 5%
var options = Enumerable.Range(0, 20).Select(i => 5 * i);
dropdown.ShowDropDown("TEAM_DROPDOWN_TEMPLATE", 150, options, setupItem);
}
public static void ShowSpawnDropDown(DropDownButtonWidget dropdown, Session.Client client,
OrderManager orderManager, IEnumerable<int> spawnPoints)
{
@@ -562,6 +581,29 @@ namespace OpenRA.Mods.Common.Widgets.Logic
HideChildWidget(parent, "TEAM_DROPDOWN");
}
public static void SetupEditableHandicapWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, MapPreview map)
{
var dropdown = parent.Get<DropDownButtonWidget>("HANDICAP_DROPDOWN");
dropdown.IsVisible = () => true;
dropdown.IsDisabled = () => s.LockTeam || orderManager.LocalClient.IsReady;
dropdown.OnMouseDown = _ => ShowHandicapDropDown(dropdown, c, orderManager);
var handicapLabel = new CachedTransform<int, string>(h => "{0}%".F(h));
dropdown.GetText = () => handicapLabel.Update(c.Handicap);
HideChildWidget(parent, "HANDICAP");
}
public static void SetupHandicapWidget(Widget parent, Session.Slot s, Session.Client c)
{
var team = parent.Get<LabelWidget>("HANDICAP");
team.IsVisible = () => true;
var handicapLabel = new CachedTransform<int, string>(h => "{0}%".F(h));
team.GetText = () => handicapLabel.Update(c.Handicap);
HideChildWidget(parent, "HANDICAP_DROPDOWN");
}
public static void SetupEditableSpawnWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, MapPreview map)
{
var dropdown = parent.Get<DropDownButtonWidget>("SPAWN_DROPDOWN");

View File

@@ -43,7 +43,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
this.modData = modData;
this.onSelect = onSelect;
var approving = new Action(() => { Ui.CloseWindow(); onSelect(selectedUid); });
var approving = new Action(() =>
{
Ui.CloseWindow();
onSelect?.Invoke(selectedUid);
});
var canceling = new Action(() => { Ui.CloseWindow(); onExit(); });
var okButton = widget.Get<ButtonWidget>("BUTTON_OK");

View File

@@ -334,14 +334,24 @@ namespace OpenRA.Mods.Common.Widgets.Logic
List<GameServer> games = null;
if (i.Error == null)
{
games = new List<GameServer>();
try
{
var data = Encoding.UTF8.GetString(i.Result);
var yaml = MiniYaml.FromString(data);
games = yaml.Select(a => new GameServer(a.Value))
.Where(gs => gs.Address != null)
.ToList();
foreach (var node in yaml)
{
try
{
var gs = new GameServer(node.Value);
if (gs.Address != null)
games.Add(gs);
}
catch
{
// Ignore any invalid games advertised.
}
}
}
catch
{

View File

@@ -246,6 +246,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
BindCheckboxPref(panel, "FRAME_LIMIT_CHECKBOX", ds, "CapFramerate");
BindIntSliderPref(panel, "FRAME_LIMIT_SLIDER", ds, "MaxFramerate");
BindCheckboxPref(panel, "PLAYER_STANCE_COLORS_CHECKBOX", gs, "UsePlayerStanceColors");
if (panel.GetOrNull<CheckboxWidget>("PAUSE_SHELLMAP_CHECKBOX") != null)
BindCheckboxPref(panel, "PAUSE_SHELLMAP_CHECKBOX", gs, "PauseShellmap");
var languageDropDownButton = panel.GetOrNull<DropDownButtonWidget>("LANGUAGE_DROPDOWNBUTTON");
if (languageDropDownButton != null)

View File

@@ -81,7 +81,10 @@ namespace OpenRA.Mods.Common.Widgets
for (var x = 0; x < Template.Size.X; x++)
{
var tile = new TerrainTile(Template.Id, (byte)(i++));
if (!tileset.TryGetTileInfo(tile, out var tileInfo))
var tileInfo = tileset.GetTileInfo(tile);
// Empty tile
if (tileInfo == null)
continue;
var sprite = worldRenderer.Theater.TileSprite(tile, 0);

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<LangVersion>7.3</LangVersion>
@@ -11,7 +11,6 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<CodeAnalysisRuleSet>..\OpenRA.ruleset</CodeAnalysisRuleSet>
<IsPublishable Condition="'$(CopyD2kDll)' == 'False'">false</IsPublishable>
</PropertyGroup>
<ItemGroup>
<!-- Work around an issue where Rider does not detect files in the project root using the default glob -->
@@ -38,4 +37,4 @@
<Analyzer Remove="@(Analyzer)" />
</ItemGroup>
</Target>
</Project>
</Project>

View File

@@ -86,7 +86,8 @@ namespace OpenRA.Mods.D2k.Traits.Buildings
// Fill the footprint with random variants
foreach (var c in info.Tiles(self.Location))
{
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue)
// Only place on allowed terrain types
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue || !info.TerrainTypes.Contains(map.GetTerrainInfo(c).Type))
continue;
// Don't place under other buildings (or their bib)
@@ -102,7 +103,9 @@ namespace OpenRA.Mods.D2k.Traits.Buildings
for (var i = 0; i < template.TilesCount; i++)
{
var c = self.Location + new CVec(i % template.Size.X, i / template.Size.X);
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue)
// Only place on allowed terrain types
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue || !info.TerrainTypes.Contains(map.GetTerrainInfo(c).Type))
continue;
// Don't place under other buildings (or their bib)

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<LangVersion>7.3</LangVersion>
@@ -11,7 +11,6 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<CodeAnalysisRuleSet>..\OpenRA.ruleset</CodeAnalysisRuleSet>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup>
<TargetPlatform Condition="$([MSBuild]::IsOsPlatform('Windows'))">win-x64</TargetPlatform>

View File

@@ -59,6 +59,7 @@ namespace OpenRA.Platforms.Default
Name = "ThreadedGraphicsContext RenderThread",
IsBackground = true
};
renderThread.SetApartmentState(ApartmentState.STA);
lock (syncObject)
{
// Start and wait for the rendering thread to have initialized before returning.

View File

@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework Condition="'$(Mono)' == ''">net5.0</TargetFramework>
<TargetFramework Condition="'$(Mono)' != ''">netstandard2.1</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -40,8 +39,4 @@
<Analyzer Remove="@(Analyzer)" />
</ItemGroup>
</Target>
<ItemGroup>
<TrimmerRootAssembly Include="netstandard" />
<TrimmerRootAssembly Include="System.IO.Pipes" />
</ItemGroup>
</Project>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>7.3</LangVersion>
<DebugSymbols>true</DebugSymbols>
@@ -10,7 +10,6 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<CodeAnalysisRuleSet>..\OpenRA.ruleset</CodeAnalysisRuleSet>
<IsPublishable>false</IsPublishable>
</PropertyGroup>
<ItemGroup>
<!-- Work around an issue where Rider does not detect files in the project root using the default glob -->
@@ -23,12 +22,14 @@
<ItemGroup>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj" />
<ProjectReference Include="..\OpenRA.Mods.Common\OpenRA.Mods.Common.csproj">
<Private>True</Private>
<Private>False</Private>
</ProjectReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit.Console" Version="3.11.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0-beta.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<AdditionalFiles Include="../stylecop.json" />
@@ -39,4 +40,4 @@
<Analyzer Remove="@(Analyzer)" />
</ItemGroup>
</Target>
</Project>
</Project>

View File

@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework Condition="'$(Mono)' == ''">net5.0</TargetFramework>
<TargetFramework Condition="'$(Mono)' != ''">netstandard2.1</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -40,8 +39,4 @@
<Analyzer Remove="@(Analyzer)" />
</ItemGroup>
</Target>
<ItemGroup>
<TrimmerRootAssembly Include="netstandard" />
<TrimmerRootAssembly Include="System.IO.Pipes" />
</ItemGroup>
</Project>

View File

@@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>winexe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ApplicationIcon>$(LauncherIcon)</ApplicationIcon>
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -12,12 +10,14 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
<OutputPath>../bin</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<ExternalConsole>false</ExternalConsole>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<CodeAnalysisRuleSet>..\OpenRA.ruleset</CodeAnalysisRuleSet>
<Configurations>Release;Debug</Configurations>
<AssemblyName>$(LauncherName)</AssemblyName>
<ApplicationIcon>$(LauncherIcon)</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<!-- Work around an issue where Rider does not detect files in the project root using the default glob -->
@@ -47,7 +47,7 @@
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Include="OpenRA-SDL2-CS" Version="1.0.27" />
<PackageReference Include="OpenRA-SDL2-CS" Version="1.0.28" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj" />
@@ -58,8 +58,4 @@
<Analyzer Remove="@(Analyzer)" />
</ItemGroup>
</Target>
<ItemGroup>
<TrimmerRootAssembly Include="netstandard" />
<TrimmerRootAssembly Include="System.IO.Pipes" />
</ItemGroup>
</Project>

View File

@@ -58,7 +58,9 @@ Global
{FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}.Release|Any CPU.Build.0 = Release|Any CPU
{6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CB8E1B7-6B36-4D93-8633-7C573E194AC4}.Release|Any CPU.Build.0 = Release|Any CPU
{54DAE0E0-3125-49D3-992E-A0E931EB5FC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54DAE0E0-3125-49D3-992E-A0E931EB5FC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54DAE0E0-3125-49D3-992E-A0E931EB5FC8}.Release|Any CPU.ActiveCfg = Release|Any CPU

View File

@@ -25,7 +25,7 @@ ShareAnonymizedIPs="${ShareAnonymizedIPs:-"True"}"
SupportDir="${SupportDir:-""}"
while true; do
mono --debug bin/OpenRA.Server.dll Engine.EngineDir=".." Game.Mod="$Mod" \
mono --debug bin/OpenRA.Server.exe Engine.EngineDir=".." Game.Mod="$Mod" \
Server.Name="$Name" \
Server.ListenPort="$ListenPort" \
Server.AdvertiseOnline="$AdvertiseOnline" \

View File

@@ -25,7 +25,7 @@ then
fi
# Launch the engine with the appropriate arguments
mono --debug bin/OpenRA.dll Engine.EngineDir=".." Engine.LaunchPath="$MODLAUNCHER" $MODARG "$@"
mono bin/OpenRA.exe Engine.EngineDir=".." Engine.LaunchPath="$MODLAUNCHER" $MODARG "$@"
# Show a crash dialog if something went wrong
if [ $? != 0 ] && [ $? != 1 ]; then

View File

@@ -10,7 +10,7 @@ function All-Command
return
}
dotnet build -c Release --nologo -p:TargetPlatform=win-x64
dotnet build /p:Configuration=Release /nologo
if ($lastexitcode -ne 0)
{
Write-Host "Build failed. If just the development tools failed to build, try installing Visual Studio. You may also still be able to run the game." -ForegroundColor Red
@@ -24,7 +24,8 @@ function All-Command
{
echo "Downloading IP2Location GeoIP database."
$target = Join-Path $pwd.ToString() "IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP"
(New-Object System.Net.WebClient).DownloadFile("https://download.ip2location.com/lite/IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP", $target)
[Net.ServicePointManager]::SecurityProtocol = 'Tls12'
(New-Object System.Net.WebClient).DownloadFile("https://github.com/OpenRA/GeoIP-Database/releases/download/monthly/IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP", $target)
}
}
@@ -36,9 +37,8 @@ function Clean-Command
}
dotnet clean /nologo
rm ./bin -r
rm ./*/bin -r
rm ./*/obj -r
Remove-Item ./bin -Recurse -ErrorAction Ignore
Remove-Item ./*/obj -Recurse -ErrorAction Ignore
Write-Host "Clean complete." -ForegroundColor Green
}
@@ -99,19 +99,19 @@ function Test-Command
Write-Host "Testing mods..." -ForegroundColor Cyan
Write-Host "Testing Tiberian Sun mod MiniYAML..." -ForegroundColor Cyan
Invoke-Expression "$utilityPath ts --check-yaml"
InvokeCommand "$utilityPath ts --check-yaml"
Write-Host "Testing Dune 2000 mod MiniYAML..." -ForegroundColor Cyan
Invoke-Expression "$utilityPath d2k --check-yaml"
InvokeCommand "$utilityPath d2k --check-yaml"
Write-Host "Testing Tiberian Dawn mod MiniYAML..." -ForegroundColor Cyan
Invoke-Expression "$utilityPath cnc --check-yaml"
InvokeCommand "$utilityPath cnc --check-yaml"
Write-Host "Testing Red Alert mod MiniYAML..." -ForegroundColor Cyan
Invoke-Expression "$utilityPath ra --check-yaml"
InvokeCommand "$utilityPath ra --check-yaml"
}
function Check-Command
{
Write-Host "Compiling in debug configuration..." -ForegroundColor Cyan
dotnet build -c Debug --nologo -p:TargetPlatform=win-x64
dotnet build /p:Configuration=Debug /nologo
if ($lastexitcode -ne 0)
{
Write-Host "Build failed." -ForegroundColor Red
@@ -120,10 +120,10 @@ function Check-Command
if ((CheckForUtility) -eq 0)
{
Write-Host "Checking for explicit interface violations..." -ForegroundColor Cyan
Invoke-Expression "$utilityPath all --check-explicit-interfaces"
InvokeCommand "$utilityPath all --check-explicit-interfaces"
Write-Host "Checking for incorrect conditional trait interface overrides..." -ForegroundColor Cyan
Invoke-Expression "$utilityPath all --check-conditional-trait-interface-overrides"
InvokeCommand "$utilityPath all --check-conditional-trait-interface-overrides"
}
}
@@ -152,20 +152,6 @@ function Check-Scripts-Command
}
}
function Docs-Command
{
if ((CheckForUtility) -eq 1)
{
return
}
./make.ps1 version
Invoke-Expression "$utilityPath all --docs" | Out-File -Encoding "UTF8" DOCUMENTATION.md
Invoke-Expression "$utilityPath all --weapon-docs" | Out-File -Encoding "UTF8" WEAPONS.md
Invoke-Expression "$utilityPath all --lua-docs" | Out-File -Encoding "UTF8" Lua-API.md
Invoke-Expression "$utilityPath all --settings-docs" | Out-File -Encoding "UTF8" Settings.md
}
function CheckForUtility
{
if (Test-Path $utilityPath)
@@ -201,6 +187,20 @@ function WaitForInput
}
}
function InvokeCommand
{
param($expression)
# $? is the return value of the called expression
# Invoke-Expression itself will always succeed, even if the invoked expression fails
# So temporarily store the return value in $success
$expression += '; $success = $?'
Invoke-Expression $expression
if ($success -eq $False)
{
exit 1
}
}
###############################################################
############################ Main #############################
###############################################################
@@ -223,7 +223,6 @@ if ($args.Length -eq 0)
Write-Host " test, t Tests the default mods for errors."
Write-Host " check, ck Checks .cs files for StyleCop violations."
Write-Host " check-scripts, cs Checks .lua files for syntax errors."
Write-Host " docs Generates the trait and Lua API documentation."
Write-Host ""
$command = (Read-Host "Enter command").Split(' ', 2)
}
@@ -249,7 +248,6 @@ switch ($execute)
{"test", "t" -contains $_} { Test-Command }
{"check", "ck" -contains $_} { Check-Command }
{"check-scripts", "cs" -contains $_} { Check-Scripts-Command }
"docs" { Docs-Command }
Default { Write-Host ("Invalid command '{0}'" -f $command) }
}

View File

@@ -366,18 +366,23 @@ scrollpanel-decorations:
Inherits: ^Chrome
Regions:
down: 836, 17, 16, 16
down-pressed: 836, 17, 16, 16
down-disabled: 853, 17, 16, 16
up: 870, 17, 16, 16
up-pressed: 870, 17, 16, 16
up-disabled: 887, 17, 16, 16
right: 904, 17, 16, 16
right-pressed: 904, 17, 16, 16
right-disabled: 921, 17, 16, 16
left: 938, 17, 16, 16
left-pressed: 938, 17, 16, 16
left-disabled: 955, 17, 16, 16
dropdown-decorations:
Inherits: ^Chrome
Regions:
marker: 836, 17, 16, 16
marker-pressed: 836, 17, 16, 16
marker-disabled: 853, 17, 16, 16
dropdown-separators:

View File

@@ -20,12 +20,13 @@ Container@LOBBY_MUSIC_BIN:
Height: 25
Text: Track
Font: Bold
Label@TYPE:
X: PARENT_RIGHT - 63
Label@LENGTH:
X: PARENT_RIGHT - 80
Height: 25
Width: 50
Text: Length
Font: Bold
Align: Right
Background@CONTROLS:
Background: panel-transparent
Width: 308

View File

@@ -23,21 +23,21 @@ Container@LOBBY_OPTIONS_BIN:
Height: 34
Children:
Checkbox@A:
Width: 175
Width: 220
Height: 20
Font: Regular
Visible: False
TooltipContainer: TOOLTIP_CONTAINER
Checkbox@B:
X: 195
Width: 175
X: 225
Width: 220
Height: 20
Font: Regular
Visible: False
TooltipContainer: TOOLTIP_CONTAINER
Checkbox@C:
X: 375
Width: 175
X: 450
Width: 190
Height: 20
Font: Regular
Visible: False
@@ -47,26 +47,26 @@ Container@LOBBY_OPTIONS_BIN:
Width: PARENT_RIGHT
Children:
Label@A_DESC:
Width: 80
Width: 140
Height: 25
Align: Right
Visible: False
DropDownButton@A:
X: 85
Width: 160
X: 145
Width: 180
Height: 25
Font: Regular
Visible: False
TooltipContainer: TOOLTIP_CONTAINER
Label@B_DESC:
X: PARENT_RIGHT - WIDTH - 183
Width: 160
X: PARENT_RIGHT - WIDTH - 203
Width: 140
Height: 25
Align: Right
Visible: False
DropDownButton@B:
X: PARENT_RIGHT - WIDTH - 18
Width: 160
Width: 180
Height: 25
Font: Regular
Visible: False

View File

@@ -16,34 +16,41 @@ Container@LOBBY_PLAYER_BIN:
Font: Bold
Label@COLOR:
X: 210
Width: 76
Width: 94
Height: 25
Text: Color
Align: Center
Font: Bold
Label@FACTION:
X: 291
X: 309
Width: 120
Height: 25
Text: Faction
Align: Center
Font: Bold
Label@TEAM:
X: 416
X: 460-25
Width: 50
Height: 25
Text: Team
Align: Center
Font: Bold
Label@HANDICAP:
X: 491
Width: 75
Height: 25
Text: Handicap
Align: Center
Font: Bold
Label@SPAWN:
X: 471
X: 571
Width: 50
Height: 25
Text: Spawn
Align: Left
Font: Bold
Label@STATUS:
X: 527
X: 627
Width: 20
Height: 25
Text: Ready
@@ -108,7 +115,7 @@ Container@LOBBY_PLAYER_BIN:
Visible: false
DropDownButton@COLOR:
X: 210
Width: 76
Width: 94
Height: 25
Font: Regular
IgnoreChildMouseOver: true
@@ -119,7 +126,7 @@ Container@LOBBY_PLAYER_BIN:
Width: PARENT_RIGHT - 35
Height: PARENT_BOTTOM - 12
DropDownButton@FACTION:
X: 291
X: 309
Width: 120
Height: 25
Font: Regular
@@ -138,17 +145,24 @@ Container@LOBBY_PLAYER_BIN:
Height: 25
Text: Faction
DropDownButton@TEAM_DROPDOWN:
X: 416
X: 435
Width: 50
Height: 25
Font: Regular
DropDownButton@HANDICAP_DROPDOWN:
X: 491
Width: 75
Height: 25
Font: Regular
TooltipContainer: TOOLTIP_CONTAINER
TooltipText: A handicap decreases the combat effectiveness of the player's forces
DropDownButton@SPAWN_DROPDOWN:
X: 471
X: 571
Width: 50
Height: 25
Font: Regular
Image@STATUS_IMAGE:
X: 529
X: 629
Y: 4
Width: 20
Height: 20
@@ -156,7 +170,7 @@ Container@LOBBY_PLAYER_BIN:
ImageName: checked
Visible: false
Checkbox@STATUS_CHECKBOX:
X: 527
X: 627
Y: 2
Width: 20
Height: 20
@@ -224,10 +238,10 @@ Container@LOBBY_PLAYER_BIN:
ColorBlock@COLORBLOCK:
X: 215
Y: 6
Width: 41
Width: 59
Height: 13
Container@FACTION:
X: 291
X: 309
Width: 120
Height: 25
Children:
@@ -242,29 +256,41 @@ Container@LOBBY_PLAYER_BIN:
Height: 25
Text: Faction
Label@TEAM:
X: 416
Width: 25
Height: 25
Align: Center
Label@SPAWN:
X: 471
X: 435
Width: 25
Height: 25
Align: Center
DropDownButton@TEAM_DROPDOWN:
X: 416
X: 435
Width: 50
Height: 25
Font: Regular
Visible: false
Label@HANDICAP:
X: 491
Width: 50
Height: 25
Align: Center
DropDownButton@HANDICAP_DROPDOWN:
X: 491
Width: 75
Height: 25
Font: Regular
TooltipContainer: TOOLTIP_CONTAINER
TooltipText: A handicap decreases the combat effectiveness of the player's forces
Label@SPAWN:
X: 571
Width: 25
Height: 25
Align: Center
DropDownButton@SPAWN_DROPDOWN:
X: 471
X: 571
Width: 50
Height: 25
Font: Regular
Visible: false
Image@STATUS_IMAGE:
X: 529
X: 629
Y: 4
Width: 20
Height: 20
@@ -291,7 +317,7 @@ Container@LOBBY_PLAYER_BIN:
Visible: false
Button@JOIN:
X: 210
Width: 338
Width: 438
Height: 25
Text: Play in this slot
Font: Regular
@@ -340,13 +366,13 @@ Container@LOBBY_PLAYER_BIN:
Template: ANONYMOUS_PLAYER_TOOLTIP
Label@SPECTATOR:
X: 210
Width: 341
Width: 441
Height: 25
Text: Spectator
Align: Center
Font: Bold
Image@STATUS_IMAGE:
X: 529
X: 629
Y: 4
Width: 20
Height: 20
@@ -354,7 +380,7 @@ Container@LOBBY_PLAYER_BIN:
ImageName: checked
Visible: false
Checkbox@STATUS_CHECKBOX:
X: 527
X: 627
Y: 2
Width: 20
Height: 20
@@ -421,13 +447,13 @@ Container@LOBBY_PLAYER_BIN:
Template: ANONYMOUS_PLAYER_TOOLTIP
Label@SPECTATOR:
X: 210
Width: 341
Width: 441
Height: 25
Text: Spectator
Align: Center
Font: Bold
Image@STATUS_IMAGE:
X: 527
X: 627
Y: 4
Width: 20
Height: 20
@@ -448,7 +474,7 @@ Container@LOBBY_PLAYER_BIN:
Text: Allow Spectators?
Button@SPECTATE:
X: 210
Width: 338
Width: 438
Height: 25
Text: Spectate
Font: Regular

View File

@@ -9,32 +9,32 @@ Container@LOBBY_SERVERS_BIN:
Children:
Label@NAME:
X: 5
Width: 255
Width: 355
Height: 25
Text: Server
Align: Center
Font: Bold
Label@PLAYERS:
X: 290
X: 390
Width: 85
Height: 25
Text: Players
Font: Bold
Label@LOCATION:
X: 380
X: 480
Width: 110
Height: 25
Text: Location
Font: Bold
Label@STATUS:
X: 495
X: 595
Width: 50
Height: 25
Text: Status
Font: Bold
LogicTicker@NOTICE_WATCHER:
Container@NOTICE_CONTAINER:
Width: 582
Width: PARENT_RIGHT
Height: 19
Children:
Background@bg:
@@ -87,12 +87,12 @@ Container@LOBBY_SERVERS_BIN:
Children:
LabelWithTooltip@TITLE:
X: 5
Width: 245
Width: 345
Height: 25
TooltipContainer: TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP
Image@PASSWORD_PROTECTED:
X: 272
X: 372
Y: 6
Width: 12
Height: 13
@@ -101,7 +101,7 @@ Container@LOBBY_SERVERS_BIN:
TooltipTemplate: SIMPLE_TOOLTIP
TooltipText: Requires Password
Image@REQUIRES_AUTHENTICATION:
X: 272
X: 372
Y: 6
Width: 12
Height: 13
@@ -110,17 +110,17 @@ Container@LOBBY_SERVERS_BIN:
TooltipTemplate: SIMPLE_TOOLTIP
TooltipText: Requires OpenRA forum account
LabelWithTooltip@PLAYERS:
X: 290
X: 390
Width: 85
Height: 25
TooltipContainer: TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP
Label@LOCATION:
X: 380
X: 480
Width: 110
Height: 25
Label@STATUS:
X: 495
X: 595
Width: 50
Height: 25
Label@PROGRESS_LABEL:
@@ -132,12 +132,12 @@ Container@LOBBY_SERVERS_BIN:
Visible: false
DropDownButton@FILTERS_DROPDOWNBUTTON:
Y: PARENT_BOTTOM + 5
Width: 151
Width: 180
Height: 25
Text: Filter Games
Font: Bold
Button@RELOAD_BUTTON:
X: 156
X: 185
Y: PARENT_BOTTOM + 5
Width: 26
Height: 25

View File

@@ -2,7 +2,7 @@ Container@SERVER_LOBBY:
Logic: LobbyLogic
X: (WINDOW_RIGHT - WIDTH) / 2
Y: (WINDOW_BOTTOM - 560) / 2
Width: 800
Width: 900
Height: 575
Children:
ColorPreviewManager@COLOR_MANAGER:
@@ -25,55 +25,57 @@ Container@SERVER_LOBBY:
DropDownButton@SLOTS_DROPDOWNBUTTON:
X: 15
Y: 254
Width: 182
Width: 211
Height: 25
Text: Slot Admin
Container@SKIRMISH_TABS:
X: 697 - WIDTH
Width: 465
Visible: False
Children:
Button@PLAYERS_TAB:
X: 202
Y: 248
Width: 129
Width: 151
Height: 31
Text: Players
Button@OPTIONS_TAB:
X: 336
X: 157
Y: 248
Width: 128
Width: 151
Height: 31
Text: Options
Button@MUSIC_TAB:
X: 469
X: 314
Y: 248
Width: 128
Width: 151
Height: 31
Text: Music
Container@MULTIPLAYER_TABS:
X: 697 - WIDTH
Width: 465
Visible: False
Children:
Button@PLAYERS_TAB:
X: 202
Y: 248
Width: 95
Width: 112
Height: 31
Text: Players
Button@OPTIONS_TAB:
X: 302
X: 118
Y: 248
Width: 95
Width: 112
Height: 31
Text: Options
Button@MUSIC_TAB:
X: 402
X: 236
Y: 248
Width: 95
Width: 112
Height: 31
Text: Music
Button@SERVERS_TAB:
X: 502
X: 354
Y: 248
Width: 95
Width: 111
Height: 31
Text: Servers
Button@CHANGEMAP_BUTTON:
@@ -85,7 +87,7 @@ Container@SERVER_LOBBY:
Container@TOP_PANELS_ROOT:
X: 15
Y: 30
Width: 582
Width: 682
Height: 219
Container@LOBBYCHAT:
X: 15

View File

@@ -2,7 +2,7 @@ Container@MAPCHOOSER_PANEL:
Logic: MapChooserLogic
X: (WINDOW_RIGHT - WIDTH) / 2
Y: (WINDOW_BOTTOM - 560) / 2
Width: 800
Width: 900
Height: 575
Children:
Label@TITLE:
@@ -64,7 +64,7 @@ Container@MAPCHOOSER_PANEL:
ScrollPanel@MAP_LIST:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Children:
ItemSpacing: 1
Container@USER_MAPS_TAB:
X: 15
Y: 45
@@ -74,18 +74,18 @@ Container@MAPCHOOSER_PANEL:
ScrollPanel@MAP_LIST:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Children:
ItemSpacing: 1
ScrollItem@MAP_TEMPLATE:
Width: 183
Height: 232
X: 2
Width: 210
Height: 262
X: 1
Visible: false
Children:
MapPreview@PREVIEW:
X: (PARENT_RIGHT - WIDTH) / 2
Y: 4
Width: 173
Height: 173
Y: 3
Width: 204
Height: 204
IgnoreMouseOver: true
IgnoreMouseInput: true
Label@TITLE:

View File

@@ -2,7 +2,7 @@ Container@MULTIPLAYER_PANEL:
Logic: MultiplayerLogic
X: (WINDOW_RIGHT - WIDTH) / 2
Y: (WINDOW_BOTTOM - 560) / 2
Width: 800
Width: 900
Height: 575
Children:
Label@TITLE:
@@ -25,25 +25,25 @@ Container@MULTIPLAYER_PANEL:
Children:
Label@NAME:
X: 5
Width: 255
Width: 355
Height: 25
Text: Server
Align: Center
Font: Bold
Label@PLAYERS:
X: 290
X: 390
Width: 85
Height: 25
Text: Players
Font: Bold
Label@LOCATION:
X: 380
X: 480
Width: 110
Height: 25
Text: Location
Font: Bold
Label@STATUS:
X: 495
X: 595
Width: 50
Height: 25
Text: Status
@@ -52,7 +52,7 @@ Container@MULTIPLAYER_PANEL:
Container@NOTICE_CONTAINER:
X: 15
Y: 30
Width: 582
Width: 682
Height: 19
Children:
Background@bg:
@@ -84,7 +84,7 @@ Container@MULTIPLAYER_PANEL:
ScrollPanel@SERVER_LIST:
X: 15
Y: 30
Width: 582
Width: 682
Height: PARENT_BOTTOM - 75
TopBottomSpacing: 2
Children:
@@ -107,12 +107,12 @@ Container@MULTIPLAYER_PANEL:
Children:
LabelWithTooltip@TITLE:
X: 5
Width: 245
Width: 345
Height: 25
TooltipContainer: TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP
Image@PASSWORD_PROTECTED:
X: 272
X: 372
Y: 6
Width: 12
Height: 13
@@ -121,7 +121,7 @@ Container@MULTIPLAYER_PANEL:
TooltipTemplate: SIMPLE_TOOLTIP
TooltipText: Requires Password
Image@REQUIRES_AUTHENTICATION:
X: 272
X: 372
Y: 6
Width: 12
Height: 13
@@ -130,23 +130,23 @@ Container@MULTIPLAYER_PANEL:
TooltipTemplate: SIMPLE_TOOLTIP
TooltipText: Requires OpenRA forum account
LabelWithTooltip@PLAYERS:
X: 290
X: 390
Width: 85
Height: 25
TooltipContainer: TOOLTIP_CONTAINER
TooltipTemplate: SIMPLE_TOOLTIP
Label@LOCATION:
X: 380
X: 480
Width: 110
Height: 25
Label@STATUS:
X: 495
X: 595
Width: 50
Height: 25
Label@PROGRESS_LABEL:
X: 15
Y: 31 + (PARENT_BOTTOM - 75 - HEIGHT) / 2
Width: 582
Width: 682
Height: 25
Font: Bold
Align: Center
@@ -231,20 +231,20 @@ Container@MULTIPLAYER_PANEL:
Children:
LogicTicker@ANIMATION:
Label@PLAYER_COUNT:
X: 198
X: 248
Y: PARENT_BOTTOM - 40
Width: 189
Height: 25
Align: Center
Font: Bold
Button@DIRECTCONNECT_BUTTON:
X: 387
X: 487
Y: PARENT_BOTTOM - 40
Width: 100
Height: 25
Text: Direct IP
Button@CREATE_BUTTON:
X: 492
X: 592
Y: PARENT_BOTTOM - 40
Width: 105
Height: 25

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -552,7 +552,7 @@ Actors:
Health: 99
Actor171: hosp
Location: 55,28
Owner: Civilians
Owner: GDI
Actor172: mtnk
Location: 51,40
Owner: GDI

Binary file not shown.

View File

@@ -67,7 +67,7 @@ HELI:
TurnSpeed: 28
Speed: 180
Health:
HP: 12000
HP: 12500
Armor:
Type: Light
RevealsShroud:

View File

@@ -187,6 +187,11 @@
AttackMove:
AssaultMoveCondition: assault-move
^PlayerHandicaps:
HandicapFirepowerMultiplier:
HandicapDamageMultiplier:
HandicapProductionTimeMultiplier:
^AcceptsCloakCrate:
Cloak:
InitialDelay: 15
@@ -224,6 +229,7 @@
Inherits@1: ^ExistsInWorld
Inherits@3: ^ClassicFacingSpriteActor
Inherits@selection: ^SelectableCombatUnit
Inherits@handicaps: ^PlayerHandicaps
Huntable:
OwnerLostAction:
Action: Kill
@@ -269,6 +275,7 @@
Inherits@1: ^ExistsInWorld
Inherits@3: ^ClassicFacingSpriteActor
Inherits@selection: ^SelectableCombatUnit
Inherits@handicaps: ^PlayerHandicaps
Huntable:
OwnerLostAction:
Action: Kill
@@ -323,6 +330,7 @@
Inherits@1: ^ExistsInWorld
Inherits@3: ^SpriteActor
Inherits@selection: ^SelectableCombatUnit
Inherits@handicaps: ^PlayerHandicaps
Huntable:
OwnerLostAction:
Action: Kill
@@ -492,6 +500,7 @@
Inherits@2: ^SpriteActor
Inherits@AUTOTARGET: ^AutoTargetGroundAssaultMove
Inherits@selection: ^SelectableCombatUnit
Inherits@handicaps: ^PlayerHandicaps
Huntable:
OwnerLostAction:
Action: Kill
@@ -546,11 +555,12 @@
Inherits@2: ^SpriteActor
Inherits@AUTOTARGET: ^AutoTargetGroundAssaultMove
Inherits@selection: ^SelectableCombatUnit
Inherits@handicaps: ^PlayerHandicaps
Huntable:
Health:
HP: 30000
HP: 40000
Armor:
Type: Wood
Type: Light
RevealsShroud:
Range: 6c0
Mobile:
@@ -601,6 +611,7 @@
^Plane:
Inherits@1: ^ExistsInWorld
Inherits@2: ^ClassicFacingSpriteActor
Inherits@handicaps: ^PlayerHandicaps
Huntable:
OwnerLostAction:
Action: Kill
@@ -626,6 +637,7 @@
Inherits@1: ^ExistsInWorld
Inherits@3: ^SpriteActor
Inherits@selection: ^SelectableCombatUnit
Inherits@handicaps: ^PlayerHandicaps
Huntable:
OwnerLostAction:
Action: Kill
@@ -653,6 +665,7 @@
Inherits@2: ^SpriteActor
Inherits@shape: ^1x1Shape
Inherits@selection: ^SelectableBuilding
Inherits@handicaps: ^PlayerHandicaps
Huntable:
OwnerLostAction:
Action: Kill
@@ -668,8 +681,8 @@
ActorPreviewPlaceBuildingPreview:
OverridePalette: placebuilding
SoundOnDamageTransition:
DamagedSounds: xplos.aud
DestroyedSounds: crumble.aud
DamagedSounds: xplobig4.aud
DestroyedSounds: crumble.aud, xplobig4.aud
WithSpriteBody:
Explodes:
Type: Footprint
@@ -992,9 +1005,9 @@
Inherits@1: ^ClassicFacingSpriteActor
Interactable:
Health:
HP: 14000
HP: 28000
Armor:
Type: Light
Type: Heavy
HiddenUnderFog:
Type: CenterPosition
AlwaysVisibleRelationships: None
@@ -1029,14 +1042,14 @@
Sequence: 1
IsDecoration: True
ChangesHealth:
Step: -100
Step: -200
StartIfBelow: 101
Delay: 6
^LightHusk:
Inherits: ^Husk
Health:
HP: 2000
HP: 4000
^HelicopterHusk:
Inherits: ^CommonHuskDefaults

View File

@@ -80,6 +80,9 @@ HARV:
EffectiveOwnerFromOwner: true
WithHarvestAnimation:
WithDockingAnimation:
Explodes@EMPTY:
Weapon: UnitExplodeHarvEmpty
EmptyWeapon: UnitExplodeHarvEmpty
Explodes:
RequiresCondition: !no-tiberium
Weapon: TiberiumExplosion
@@ -160,6 +163,9 @@ APC:
Types: Infantry
MaxWeight: 5
LoadingCondition: notmobile
Explodes:
Weapon: UnitExplodeBig
EmptyWeapon: UnitExplodeBig
SpawnActorOnDeath:
Actor: APC.Husk
OwnerType: InternalName
@@ -454,6 +460,9 @@ MTNK:
AttackTurreted:
WithMuzzleOverlay:
WithSpriteTurret:
Explodes:
Weapon: UnitExplodeBig
EmptyWeapon: UnitExplodeBig
SpawnActorOnDeath:
Actor: MTNK.Husk
OwnerType: InternalName
@@ -512,6 +521,9 @@ HTNK:
Delay: 10
StartIfBelow: 50
DamageCooldown: 200
Explodes:
Weapon: UnitExplodeMech
EmptyWeapon: UnitExplodeMech
SpawnActorOnDeath:
Actor: HTNK.Husk
OwnerType: InternalName
@@ -560,6 +572,9 @@ MSAM:
TargetFrozenActors: True
ForceFireIgnoresActors: True
WithSpriteTurret:
Explodes:
Weapon: UnitExplodeMech
EmptyWeapon: UnitExplodeMech
SpawnActorOnDeath:
Actor: MSAM.Husk
OwnerType: InternalName
@@ -629,7 +644,7 @@ STNK:
Inherits@EXPERIENCE: ^GainsExperience
Inherits@AUTOTARGET: ^AutoTargetAllAssaultMove
Valued:
Cost: 1000
Cost: 900
Tooltip:
Name: Stealth Tank
UpdatesPlayerStatistics:
@@ -648,7 +663,7 @@ STNK:
Health:
HP: 15000
Repairable:
HpPerStep: 682
HpPerStep: 758
Armor:
Type: Light
RevealsShroud:

View File

@@ -40,6 +40,7 @@
120mm:
Inherits: ^BallisticWeapon
Report: tnkfire4.aud
120mmDual:
Inherits: ^BallisticWeapon

View File

@@ -33,7 +33,7 @@ FlametankExplode:
DamageTypes: Prone50Percent, TriggerProne, FireDeath
Warhead@2Eff: CreateEffect
Explosions: big_napalm
ImpactSounds: xplobig6.aud
ImpactSounds: flamer2.aud
Warhead@3Smu: LeaveSmudge
SmudgeType: Scorch
@@ -74,8 +74,26 @@ UnitExplodeSmall:
Explosions: big_frag
ImpactSounds: xplobig4.aud
UnitExplodeBig:
Inherits: ^DamagingExplosionHE
Warhead@2Eff: CreateEffect
Explosions: big_frag
ImpactSounds: xplobig6.aud
UnitExplodeMech:
Inherits: ^DamagingExplosionHE
Warhead@2Eff: CreateEffect
Explosions: poof
ImpactSounds: xplosml2.aud
UnitExplodeHarvEmpty:
Inherits: ^DamagingExplosionHE
Warhead@2Eff: CreateEffect
Explosions: building
ImpactSounds: xplos.aud
UnitExplodeStealthTank:
Inherits: UnitExplodeSmall
Inherits: UnitExplodeBig
Warhead@1Dam: SpreadDamage
InvalidTargets: StealthTank

View File

@@ -65,6 +65,7 @@ Rockets:
BikeRockets:
Inherits: ^MissileWeapon
ReloadDelay: 60
Burst: 2
BurstDelays: 10
Projectile: Missile
@@ -129,6 +130,7 @@ MammothMissiles:
Heavy: 44
Warhead@3Eff: CreateEffect
Explosions: small_poof
ImpactSounds: xplobig4.aud
Warhead@4EffAir: CreateEffect
Explosions: small_building
@@ -163,6 +165,7 @@ MammothMissiles:
Heavy: 48
Warhead@3Eff: CreateEffect
Explosions: med_frag
ImpactSounds: xplobig4.aud
227mm.stnk:
Inherits: ^MissileWeapon
@@ -213,6 +216,7 @@ BoatMissile:
DamageTypes: Prone50Percent, TriggerProne, SmallExplosionDeath
Warhead@3Eff: CreateEffect
Explosions: small_poof
ImpactSounds: xplobig4.aud
Warhead@4EffAir: CreateEffect
Explosions: small_building

Some files were not shown because too many files have changed in this diff Show More