Skip to content

Commit

Permalink
Reorganize global .lua files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender authored and abcdefg30 committed Nov 26, 2021
1 parent a502e85 commit 58b105f
Show file tree
Hide file tree
Showing 127 changed files with 169 additions and 129 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ check-scripts:
@echo "Checking for Lua syntax errors..."
@luac -p $(shell find mods/*/maps/* -iname '*.lua')
@luac -p $(shell find lua/* -iname '*.lua')
@luac -p $(shell find mods/*/bits/scripts/* -iname '*.lua')
@luac -p $(shell find mods/*/scripts/* -iname '*.lua')

test: all
@echo
Expand Down
2 changes: 1 addition & 1 deletion make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function Check-Scripts-Command
{
luac -p $script
}
foreach ($script in ls "mods/*/bits/scripts/*.lua")
foreach ($script in ls "mods/*/scripts/*.lua")
{
luac -p $script
}
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/cnc64gdi01/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, cnc64gdi01.lua
Scripts: campaign.lua, utils.lua, cnc64gdi01.lua
MusicPlaylist:
StartingMusic: aoi
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/funpark01/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, scj01ea.lua
Scripts: campaign.lua, utils.lua, scj01ea.lua
MusicPlaylist:
StartingMusic: j1
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi01/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi01.lua
Scripts: campaign.lua, utils.lua, gdi01.lua
MusicPlaylist:
StartingMusic: aoi
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi02/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi02.lua
Scripts: campaign.lua, utils.lua, gdi02.lua
MusicPlaylist:
StartingMusic: befeared
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi03/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi03.lua
Scripts: campaign.lua, utils.lua, gdi03.lua
MusicPlaylist:
StartingMusic: crep226m
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi04a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi04a.lua
Scripts: campaign.lua, utils.lua, gdi04a.lua
MusicPlaylist:
StartingMusic: fist226m
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi04b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi04b.lua
Scripts: campaign.lua, utils.lua, gdi04b.lua
MusicPlaylist:
StartingMusic: fist226m
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi04c/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi04c.lua
Scripts: campaign.lua, utils.lua, gdi04c.lua
MusicPlaylist:
StartingMusic: ind
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi05a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi05a.lua
Scripts: campaign.lua, utils.lua, gdi05a.lua
MusicPlaylist:
StartingMusic: rain
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi05b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi05b.lua
Scripts: campaign.lua, utils.lua, gdi05b.lua
MusicPlaylist:
StartingMusic: rain
MissionData:
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi05c/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi05c.lua
Scripts: campaign.lua, utils.lua, gdi05c.lua
MissionData:
Briefing: A GDI field base is under attack. They have fended off one attack but will not survive another.\n\nMove to the base, repair the structures and then launch a strike force to destroy the Nod base in the area.\n\nDestroy all Nod units and structures.
BackgroundVideo: podium.vqa
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi06/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi06.lua
Scripts: campaign.lua, utils.lua, gdi06.lua
MusicPlaylist:
BackgroundMusic: rain-ambient
StartingMusic: rain
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi07/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi07.lua
Scripts: campaign.lua, utils.lua, gdi07.lua
MissionData:
Briefing: Previous mission objective not complete.\nAirfield was to be targeted. \n\nNew objective: Build up a base and Destroy remaining Nod structures and units.\n\nReinforcements will be provided.
BriefingVideo: gdi7.vqa
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi08a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi08a.lua, gdi08a-AI.lua
Scripts: campaign.lua, utils.lua, gdi08a.lua, gdi08a-AI.lua
MusicPlaylist:
StartingMusic: march
VictoryMusic: gdi_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi08b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi08b.lua, gdi08b-AI.lua
Scripts: campaign.lua, utils.lua, gdi08b.lua, gdi08b-AI.lua
MusicPlaylist:
StartingMusic: march
VictoryMusic: gdi_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/gdi09/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, gdi09.lua, gdi09-AI.lua
Scripts: campaign.lua, utils.lua, gdi09.lua, gdi09-AI.lua
MusicPlaylist:
StartingMusic: march
VictoryMusic: gdi_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod01/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod01.lua
Scripts: campaign.lua, utils.lua, nod01.lua
MusicPlaylist:
StartingMusic: nomercy
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod02a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod02a.lua
Scripts: campaign.lua, utils.lua, nod02a.lua
MusicPlaylist:
StartingMusic: ind2
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod02b/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Player:

World:
LuaScript:
Scripts: campaign-global.lua, nod02b.lua
Scripts: campaign.lua, utils.lua, nod02b.lua
MusicPlaylist:
StartingMusic: ind2
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod03a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod03a.lua
Scripts: campaign.lua, utils.lua, nod03a.lua
MusicPlaylist:
StartingMusic: chrg226m
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod03b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod03b.lua
Scripts: campaign.lua, utils.lua, nod03b.lua
MusicPlaylist:
StartingMusic: chrg226m
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod04a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod04a.lua
Scripts: campaign.lua, utils.lua, nod04a.lua
MusicPlaylist:
StartingMusic: warfare
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod04b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod04b.lua
Scripts: campaign.lua, utils.lua, nod04b.lua
MusicPlaylist:
StartingMusic: valkyrie
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod05/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod05.lua
Scripts: campaign.lua, utils.lua, nod05.lua
MusicPlaylist:
StartingMusic: airstrik
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod06a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod06a.lua
Scripts: campaign.lua, utils.lua, nod06a.lua
MusicPlaylist:
StartingMusic: rout
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod06b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod06b.lua
Scripts: campaign.lua, utils.lua, nod06b.lua
MusicPlaylist:
StartingMusic: rout
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod06c/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod06c.lua
Scripts: campaign.lua, utils.lua, nod06c.lua
MusicPlaylist:
StartingMusic: rout
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod07a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod07a.lua, nod07a-AI.lua
Scripts: campaign.lua, utils.lua, nod07a.lua, nod07a-AI.lua
MusicPlaylist:
StartingMusic: justdoit
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod07b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod07b.lua, nod07b-AI.lua
Scripts: campaign.lua, utils.lua, nod07b.lua, nod07b-AI.lua
MusicPlaylist:
StartingMusic: justdoit
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod07c/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod07c.lua
Scripts: campaign.lua, utils.lua, nod07c.lua
MusicPlaylist:
StartingMusic: justdoit
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod08a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod08a.lua, nod08a-AI.lua
Scripts: campaign.lua, utils.lua, nod08a.lua, nod08a-AI.lua
MusicPlaylist:
StartingMusic: linefire
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod08b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod08b.lua, nod08b-AI.lua
Scripts: campaign.lua, utils.lua, nod08b.lua, nod08b-AI.lua
MusicPlaylist:
StartingMusic: linefire
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod09/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod09.lua, nod09-AI.lua
Scripts: campaign.lua, utils.lua, nod09.lua, nod09-AI.lua
MusicPlaylist:
StartingMusic: march
VictoryMusic: nod_win1
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod10a/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod10a.lua
Scripts: campaign.lua, utils.lua, nod10a.lua
MissionData:
Briefing: GDI is developing an orbital weapon. Our spies have told us of a large lake near the location of the R&D center.\n\nFind the base, and use the sniper to eliminate their scientist.
BackgroundVideo: kanepre.vqa
Expand Down
2 changes: 1 addition & 1 deletion mods/cnc/maps/nod10b/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
World:
LuaScript:
Scripts: campaign-global.lua, nod10b.lua
Scripts: campaign.lua, utils.lua, nod10b.lua
MissionData:
Briefing: GDI is developing a new, heavily armored tank. Our spies have located the GDI R&D base.\n\nUse your small strike force to locate and penetrate the center. Be sure to destroy the tanks in the base and the factory.
BackgroundVideo: kanepre.vqa
Expand Down
3 changes: 2 additions & 1 deletion mods/cnc/mod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Packages:
cnc|bits/jungle
cnc|bits/desert
cnc|bits/ss
cnc|bits/scripts
cnc|scripts
common|scripts
cnc|uibits

MapFolders:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
the License, or (at your option) any later version. For more
information, see COPYING.
]]
IdleHunt = function(actor)
if actor.HasProperty("Hunt") and not actor.IsDead then
Trigger.OnIdle(actor, actor.Hunt)
end
end

Difficulty = Map.LobbyOption("difficulty")

InitObjectives = function(player)
Trigger.OnObjectiveAdded(player, function(p, id)
Expand Down
14 changes: 14 additions & 0 deletions mods/common/scripts/utils.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--[[
Copyright 2007-2021 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.
]]

IdleHunt = function(actor)
if actor.HasProperty("Hunt") and not actor.IsDead then
Trigger.OnIdle(actor, actor.Hunt)
end
end
2 changes: 1 addition & 1 deletion mods/d2k/maps/atreides-01a/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Player:

World:
LuaScript:
Scripts: campaign-global.lua, atreides01a.lua
Scripts: campaign.lua, utils.lua, atreides01a.lua
MissionData:
Briefing: Harvest Spice from the Imperial Basin. Construct a Spice Refinery and defend it against the Harkonnen troops scattered throughout the basin. You have been assigned only limited offensive forces - use them wisely.\n\nYou will have to learn the subtleties of mining as you go, but remember to build Silos to store the Spice. When you run out of storage space you can not gather more Spice. Also, any building without adequate concrete foundation will need immediate repair and be vulnerable to erosive damage from the harsh environment. Your greatest adversary may be the elements.\n\nGood luck.\n
BriefingVideo: A_BR01_E.VQA
Expand Down
2 changes: 1 addition & 1 deletion mods/d2k/maps/atreides-01b/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Player:

World:
LuaScript:
Scripts: campaign-global.lua, atreides01b.lua
Scripts: campaign.lua, utils.lua, atreides01b.lua
MissionData:
Briefing: Harvest Spice from the Imperial Basin. Construct a Spice Refinery and defend it against the Harkonnen troops scattered throughout the basin. You have been assigned only limited offensive forces - use them wisely.\n\nYou will have to learn the subtleties of mining as you go, but remember to build Silos to store the Spice. When you run out of storage space you can not gather more Spice. Also, any building without adequate concrete foundation will need immediate repair and be vulnerable to erosive damage from the harsh environment. Your greatest adversary may be the elements.\n\nGood luck.\n
BriefingVideo: A_BR01_E.VQA
Expand Down
2 changes: 1 addition & 1 deletion mods/d2k/maps/atreides-02a/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Player:

World:
LuaScript:
Scripts: campaign-global.lua, atreides02a.lua, atreides02a-AI.lua
Scripts: campaign.lua, utils.lua, atreides02a.lua, atreides02a-AI.lua
MissionData:
Briefing: Infiltrate the Imperial Basin and build up our forces until they are strong enough to eradicate the local Harkonnen presence.\n\nThe Harkonnen are reinforcing their troops by air, so be on your guard. Use the Outpost's radar to detect attacks from unexpected quarters.\n\nBe careful when mining the Spice. Spice mounds grow out of the sand. While a vital source of Spice, Spice mounds can damage or destroy any unit that blunders into them.\n\nGood luck.\n
BriefingVideo: A_BR02_E.VQA
Expand Down
2 changes: 1 addition & 1 deletion mods/d2k/maps/atreides-02b/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Player:

World:
LuaScript:
Scripts: campaign-global.lua, atreides02b.lua, atreides02b-AI.lua
Scripts: campaign.lua, utils.lua, atreides02b.lua, atreides02b-AI.lua
MissionData:
Briefing: Infiltrate the Imperial Basin and build up our forces until they are strong enough to eradicate the local Harkonnen presence.\n\nThe Harkonnen are reinforcing their troops by air, so be on your guard. Use the Outpost's radar to detect attacks from unexpected quarters.\n\nBe careful when mining the Spice. Spice mounds grow out of the sand. While a vital source of Spice, Spice mounds can damage or destroy any unit that blunders into them.\n\nGood luck.\n
BriefingVideo: A_BR02_E.VQA
Expand Down
2 changes: 1 addition & 1 deletion mods/d2k/maps/atreides-03a/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Player:

World:
LuaScript:
Scripts: campaign-global.lua, atreides03a.lua, atreides03a-AI.lua
Scripts: campaign.lua, utils.lua, atreides03a.lua, atreides03a-AI.lua
MissionData:
Briefing: Bring the Atreides forces up to combat strength - quickly. Guard against surprise attacks and ensure Spice production.\n\nThe Ordos forces are light but numerous. To combat the Ordos, you have been granted license to produce Quads, which have a greater anti-vehicle capability than Trikes. Upgrade your Light Factories to allow production of these units.\n\nMeet any aggression with overwhelming force.\n\nGood luck.\n
BriefingVideo: A_BR03_E.VQA
Expand Down
2 changes: 1 addition & 1 deletion mods/d2k/maps/atreides-03b/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Player:

World:
LuaScript:
Scripts: campaign-global.lua, atreides03b.lua, atreides03b-AI.lua
Scripts: campaign.lua, utils.lua, atreides03b.lua, atreides03b-AI.lua
MissionData:
Briefing: Bring the Atreides forces up to combat strength - quickly. Guard against surprise attacks and ensure Spice production.\n\nThe Ordos forces are light but numerous. To combat the Ordos, you have been granted license to produce Quads, which have a greater anti-vehicle capability than Trikes. Upgrade your Light Factories to allow production of these units.\n\nMeet any aggression with overwhelming force.\n\nGood luck.\n
BriefingVideo: A_BR03_E.VQA
Expand Down
Loading

0 comments on commit 58b105f

Please sign in to comment.