Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
StanleySweet committed Jul 22, 2022
0 parents commit 494794a
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
21 changes: 21 additions & 0 deletions License.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Stanislas Dolcini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions Readme.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Death Match Game Mode

This modification for [0 A.D: Empires Ascendant](https://play0ad.com) adds a new game mode to the game setup.

21 changes: 21 additions & 0 deletions maps/scripts/DeathMatch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: © 2022 Stanislas Daniel Claude Dolcini
*/

{
const cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager);
if (!cmpPlayerManager)
return;

// Skip Gaia.
for (let i = 1; i < cmpPlayerManager.GetNumPlayers(); ++i)
{
const cmpTechnologyManager = Engine.QueryInterface(cmpPlayerManager.GetPlayerByID(i), IID_TechnologyManager);
if (!cmpTechnologyManager)
continue;

for (const templateName of TechnologyTemplates.GetNames().filter(a => TechnologyTemplates.Has(a)))
cmpTechnologyManager.ResearchTechnology(templateName);
}
}
8 changes: 8 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "deathmatch_gamemode",
"label": "Death Match Game Mode",
"version": "1.0.0",
"url": "",
"description": "Adds a mode that researches all technologies for all players.",
"dependencies": ["0ad=0.0.26"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"TranslatedKeys": [
"Title",
"Description"
],
"Data": {
"Title": "Death Match",
"Description": "All technologies are now researched.",
"Scripts": [
"scripts/TriggerHelper.js",
"scripts/DeathMatch.js"
],
"Default": false,
"DisabledWhenChecked": [],
"GUIOrder": 20
}
}

0 comments on commit 494794a

Please sign in to comment.