Skip to content

Commit

Permalink
Merge branch 'Development' into pr/ViralReaction/3355
Browse files Browse the repository at this point in the history
  • Loading branch information
N7Huntsman committed Aug 21, 2024
2 parents 2081ac0 + 4281cdf commit 930b1fd
Show file tree
Hide file tree
Showing 51 changed files with 2,555 additions and 341 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/duplicates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check Patch Duplicates
on:
pull_request:
branches: [ master, Development ]

# Restrict the permissions of the ephemeral GitHub token used by this workflow
permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for duplicate virtual file paths
run: |
python3 DupeFinder.py -c
8 changes: 3 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ jobs:
rm -rf AssemblyPublicizer
git clone https://github.com/CombatExtended-Continued/AssemblyPublicizer
mkdir -p Assemblies
mkdir -p AssembliesCore
mkdir -p AssembliesCompat
mkdir -p ${{ runner.temp }}/downloads
- name: build loader
- name: remove loader
run: |
TEMP=${{ runner.temp }}/ python Make.py --csproj Source/Loader/Loader.csproj --output Assemblies/0CombatExtendedLoader.dll --download-libs --all-libs
rm Assemblies/CombatExtendedLoader.dll
- name: build core
run: |
Expand All @@ -33,7 +31,7 @@ jobs:
- name: package
run: |
mkdir CombatExtended
cp -r Source/ Assemblies/ AssembliesCore/ AssembliesCompat/ About/ Defs/ Languages/ Patches/ Royalty/ Ideology/ Biotech/ Anomaly/ Sounds/ Textures/ ModPatches/ LoadFolders.xml README.md SupportedThirdPartyMods.md CombatExtended
cp -r Source/ Assemblies/ About/ Defs/ Languages/ Patches/ Royalty/ Ideology/ Biotech/ Anomaly/ Sounds/ Textures/ ModPatches/ LoadFolders.xml README.md SupportedThirdPartyMods.md CombatExtended
zip -9 -r build.zip CombatExtended
- name: Upload to DO
run: |
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ jobs:
wget https://raw.githubusercontent.com/CombatExtended-Continued/CombatExtended/Development/Make.py -O Make.py
wget https://raw.githubusercontent.com/CombatExtended-Continued/CombatExtended/Development/BuildCompat.py -O BuildCompat.py
mkdir -p Assemblies
mkdir -p AssembliesCore
mkdir -p AssembliesCompat
mkdir -p ${{ runner.temp }}/downloads
rm -rf AssemblyPublicizer
git clone https://github.com/CombatExtended-Continued/AssemblyPublicizer
- name: build loader
- name: remove loader
run: |
TEMP=${{ runner.temp }}/ python Make.py --csproj Source/Loader/Loader.csproj --output Assemblies/0CombatExtendedLoader.dll --download-libs --all-libs
rm Assemblies/CombatExtendedLoader.dll
- name: build core
run: |
Expand All @@ -46,7 +44,7 @@ jobs:
- name: package
run: |
mkdir CombatExtended
cp -r Source/ Assemblies/ AssembliesCompat/ AssembliesCore/ About/ Defs/ Languages/ Patches/ Royalty/ Ideology/ Biotech/ Anomaly/ Sounds/ Textures/ ModPatches/ LoadFolders.xml README.md SupportedThirdPartyMods.md CombatExtended
cp -r Source/ Assemblies/ About/ Defs/ Languages/ Patches/ Royalty/ Ideology/ Biotech/ Anomaly/ Sounds/ Textures/ ModPatches/ LoadFolders.xml README.md SupportedThirdPartyMods.md CombatExtended
zip -9 -r build.zip CombatExtended
- name: Upload to DO
run: |
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ jobs:
rm -rf AssemblyPublicizer
git clone https://github.com/CombatExtended-Continued/AssemblyPublicizer
mkdir -p Assemblies
mkdir -p AssembliesCore
mkdir -p AssembliesCompat
mkdir -p ${{ runner.temp }}/downloads
- name: build loader
- name: remove loader
run: |
TEMP=${{ runner.temp }}/ python Make.py --csproj Source/Loader/Loader.csproj --output Assemblies/0CombatExtendedLoader.dll --download-libs --all-libs
rm Assemblies/CombatExtendedLoader.dll
- name: build core
run: |
TEMP=${{ runner.temp }}/ python Make.py --csproj Source/CombatExtended/CombatExtended.csproj --output Assemblies/CombatExtended.dll --download-libs --all-libs --publicizer $PWD/AssemblyPublicizer
Expand All @@ -32,7 +30,7 @@ jobs:
- name: package
run: |
mkdir CombatExtended
cp -r Assemblies/ AssembliesCore/ AssembliesCompat/ About/ Defs/ Languages/ Patches/ Royalty/ Ideology/ Biotech/ Anomaly/ Sounds/ Textures/ ModPatches/ LoadFolders.xml README.md SupportedThirdPartyMods.md CombatExtended
cp -r Assemblies/ About/ Defs/ Languages/ Patches/ Royalty/ Ideology/ Biotech/ Anomaly/ Sounds/ Textures/ ModPatches/ LoadFolders.xml README.md SupportedThirdPartyMods.md CombatExtended
zip -9 -r CombatExtended.zip CombatExtended
- name: Upload Package
id: upload-package
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ UnityEngine.dll


.idea/
__pycache__
ModPatches/*/Assemblies/
File renamed without changes.
Binary file removed Assemblies/0CombatExtendedLoader.dll
Binary file not shown.
Binary file added Assemblies/CombatExtendedLoader.dll
Binary file not shown.
15 changes: 14 additions & 1 deletion BuildCompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from subprocess import Popen
import re
import sys
from xml.dom.minidom import parse as XMLOpen

tm = '-m' in sys.argv

Expand Down Expand Up @@ -37,8 +38,20 @@ def system(*cmd):
if tm and name not in sys.argv: continue
csproj = csproj.replace('\\', '/').split('/')
csproj = FilePath("Source").descendant(csproj)
print(f"Building {name}")
output = FilePath("AssembliesCompat").child(name+".dll")
with XMLOpen(csproj.path) as cpath:
op = cpath.getElementsByTagName("OutputPath")
if op:
op = op[0].firstChild.data
if 'ModPatches' in op:
op = op.rsplit("..\\ModPatches", 1)[-1].replace('\\', '/').split('/')
if op:
od = FilePath("ModPatches").descendant(op)
if not od.exists():
od.makedirs()
output = od.child(name+".dll")

print(f"Building {name}")
system("python3", "Make.py", "--csproj", csproj.path, "--output", output.path, DOWNLOAD_LIBS, "--all-libs", "--publicizer", PUBLICIZER, "--", "-r:Assemblies/CombatExtended.dll")

for t in tasks:
Expand Down
50 changes: 50 additions & 0 deletions DupeFinder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from xml.dom.minidom import parse as XMLOpen
from twisted.python.filepath import FilePath
import sys
err = "-c" not in sys.argv

used = {}
mods = set()
ContentRoot = FilePath(".")
ec = 0

def process(node):
global ec
mod = c.getAttribute("IfModActive")
if not mod:
mod = "CETeam.CombatExtended"
dp = c.firstChild.data.replace(''', "'")
if (mod, dp) in mods:
ec += 1
msg = f"Mod {mod} is listed in LoadFolders.xml twice, both pointing to {c.firstChild.data}"
if err:
raise RuntimeError(msg)
else:
print(msg)
mods.add((mod, dp))
root = FilePath("./" + dp)
if not ContentRoot in root.parents():
return
for fd in root.walk():
if fd.isdir():
continue
if not fd.basename().endswith(".xml"):
continue
relative = tuple(fd.segmentsFrom(root))
if relative in used:
msg = f"""Relative paths collision found: {str.join("/", fd.segmentsFrom(ContentRoot))} overrides {str.join("/", used[relative].segmentsFrom(ContentRoot))}"""
if err:
raise RuntimeError(msg)
else:
ec += 1
print(msg)
used[relative] = fd

with XMLOpen("LoadFolders.xml") as x:
v1_5 = x.getElementsByTagName("v1.5")
for n in v1_5:
for c in n.getElementsByTagName("li"):
process(c)


raise SystemExit(ec)
8 changes: 6 additions & 2 deletions LoadFolders.xml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@
<li IfModActive="Rah.RBSE">ModPatches/RBSE</li>
<li IfModActive="RH.DOOM">ModPatches/RH2 DOOM</li>
<li IfModActive="RH2.Faction.Bounty.Hunters">ModPatches/RH2 Faction - Bounty Hunters</li>
<li IfModActive="RH2.Faction.Gruppa.Krovi">ModPatches/RH2 Faction - Gruppa Krovi</li>
<li IfModActive="RH2.Faction.Task.Force.141">ModPatches/RH2 Faction - Task Force 141</li>
<li IfModActive="RH2.Faction.Rangers">ModPatches/RH2 Faction - The Rangers</li>
<li IfModActive="RH2.Faction.Utilitarian">ModPatches/RH2 Faction - Utilitarian</li>
Expand Down Expand Up @@ -447,7 +448,6 @@
<li IfModActive="CP.RimmuNation.Security">ModPatches/Rimmu-Nation - Security</li>
<li IfModActive="CP.RimmuNation.Weapons">ModPatches/Rimmu-Nation - Weapons</li>
<li IfModActive="Rimsenal.Spacer">ModPatches/Rimsenal - Spacer Faction Pack</li>
<li IfModActive="Rimsenal.Spacer">ModPatches/Rimsenal - Spacer Faction Pack</li>
<li IfModActive="rimsenal.core">ModPatches/Rimsenal Core</li>
<li IfModActive="rimsenal.EVP">ModPatches/Rimsenal Enhanced Vanilla</li>
<li IfModActive="Bonible.rimsenalfactions">ModPatches/Rimsenal Factions</li>
Expand Down Expand Up @@ -556,6 +556,7 @@
<li IfModActive="vanillaracesexpanded.highmate">ModPatches/Vanilla Races Expanded - Highmate</li>
<li IfModActive="vanillaracesexpanded.hussar">ModPatches/Vanilla Races Expanded - Hussar</li>
<li IfModActive="vanillaracesexpanded.insector">ModPatches/Vanilla Races Expanded - Insector</li>
<li IfModActive="vanillaracesexpanded.lycanthrope">ModPatches/Vanilla Races Expanded - Lycanthrope</li>
<li IfModActive="vanillaracesexpanded.phytokin">ModPatches/Vanilla Races Expanded - Phytokin</li>
<li IfModActive="vanillaracesexpanded.sanguophage">ModPatches/Vanilla Races Expanded - Sanguophage</li>
<li IfModActive="vanillaracesexpanded.saurid">ModPatches/Vanilla Races Expanded - Saurid</li>
Expand Down Expand Up @@ -609,5 +610,8 @@
<li IfModActive="pphhyy.ExpandedMechsScyther">ModPatches/pphhyy Expanded Scythers</li>
<li IfModActive="pphhyy.SanguinaryAnimals">ModPatches/pphhyy Sanguinary Animals</li>
<li IfModActive="pphhyy.LightlessEmpyrean">ModPatches/pphhyy's Lightless Empyrean</li>
<li IfModActive="SmashPhil.VehicleFramework">ModPatches/VehicleFramework</li>
<li IfModActive="rwmt.Multiplayer">ModPatches/Multiplayer</li>
<li IfModActive="smashphil.neceros.srtsexpanded">ModPatches/SRTS</li>
</v1.5>
</loadFolders>
</loadFolders>
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PUBLICIZER := /tmp/AssemblyPublicizer


all: Assemblies/0CombatExtendedLoader.dll Assemblies/CombatExtended.dll CompatAssemblies AssembliesCompat $(PUBLICIZER)
all: Assemblies/CombatExtended.dll CompatAssemblies AssembliesCompat $(PUBLICIZER)

$(PUBLICIZER):
git clone https://github.com/CombatExtended-Continued/AssemblyPublicizer --depth=1 $(PUBLICIZER)
Expand All @@ -12,10 +12,10 @@ $(PUBLICIZER):
AssembliesCompat: $(PUBLICIZER)
mkdir -p AssembliesCompat

Assemblies/0CombatExtendedLoader.dll: Source/Loader/Loader.csproj $(wildcard Source/Loader/Loader/*.cs) $(PUBLICIZER)
python3 Make.py --csproj Source/Loader/Loader.csproj --output Assemblies/0CombatExtendedLoader.dll --reference /tmp/rwreference --all-libs $(DOWNLOAD_LIBS)
Assemblies/CombatExtendedLoader.dll: Source/Loader/Loader.csproj $(wildcard Source/Loader/Loader/*.cs) $(PUBLICIZER)
python3 Make.py --csproj Source/Loader/Loader.csproj --output Assemblies/CombatExtendedLoader.dll --reference /tmp/rwreference --all-libs $(DOWNLOAD_LIBS)

Assemblies/CombatExtended.dll: Assemblies/0CombatExtendedLoader.dll Source/CombatExtended/CombatExtended.csproj $(wildcard Source/CombatExtended/*/*.cs) $(wildcard Source/CombatExtended/*/*/*.cs) $(PUBLICIZER)
Assemblies/CombatExtended.dll: Source/CombatExtended/CombatExtended.csproj $(wildcard Source/CombatExtended/*/*.cs) $(wildcard Source/CombatExtended/*/*/*.cs) $(PUBLICIZER)
python3 Make.py --csproj Source/CombatExtended/CombatExtended.csproj --output Assemblies/CombatExtended.dll --reference /tmp/rwreference --all-libs $(DOWNLOAD_LIBS) --publicizer $(PUBLICIZER)


Expand Down
94 changes: 94 additions & 0 deletions ModPatches/RH2 Faction - Gruppa Krovi/Defs/Ammo_Gruppa_Krovi.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>

<!--Ammo for Tesla Coil-->
<CombatExtended.AmmoSetDef>
<defName>AmmoSet_RNTeslaCharge</defName>
<label>tesla coil power cell</label>
<ammoTypes>
<Ammo_PlasmaCellHeavy>Bullet_CE_RNBullet_Tesla_Charge</Ammo_PlasmaCellHeavy>
</ammoTypes>
</CombatExtended.AmmoSetDef>

<ThingDef ParentName="BaseExplosiveBullet">
<defName>Bullet_CE_RNBullet_Tesla_Charge</defName>
<label>Tesla Charge</label>
<graphicData>
<texPath>Things/Projectile/Tesla_Arc</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>TransparentPostLight</shaderType>
<drawSize>4</drawSize>
</graphicData>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
<damageDef>Electrical</damageDef>
<explosionRadius>2.0</explosionRadius>
<speed>25</speed>
<flyOverhead>false</flyOverhead>
<soundHitThickRoof>Artillery_HitThickRoof</soundHitThickRoof>
<soundExplode>RN_Tesla_Explode</soundExplode>
<damageAmountBase>93</damageAmountBase>
<stoppingPower>3.2</stoppingPower>
<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
<screenShakeFactor>0</screenShakeFactor>
<armorPenetrationSharp>0</armorPenetrationSharp>
<armorPenetrationBlunt>0</armorPenetrationBlunt>
</projectile>
<comps>
<li Class="CompProperties_ThrownFleckEmitter">
<fleck>Smoke</fleck>
<offsetMin>(-0.3,0,0.35)</offsetMin>
<offsetMax>(0.3,0,0.35)</offsetMax>
<emissionInterval>90</emissionInterval>
<scale>1~1.1</scale>
<colorA>(0,235,31,255)</colorA>
<colorB>(0,235,31,255)</colorB>
</li>
</comps>
</ThingDef>


<!--Ammo for Red Star Plasma Cannon-->
<CombatExtended.AmmoSetDef>
<defName>AmmoSet_RNPlasmaCharge</defName>
<label>plasma cannon power cell</label>
<ammoTypes>
<Ammo_PlasmaCellHeavy>Bullet_CE_RNBullet_RedStar_Plasma</Ammo_PlasmaCellHeavy>
</ammoTypes>
</CombatExtended.AmmoSetDef>

<ThingDef ParentName="BaseExplosiveBullet">
<defName>Bullet_CE_RNBullet_RedStar_Plasma</defName>
<label>Plasma Bolt</label>
<graphicData>
<texPath>Things/Projectile/RedStar_Plasma</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>TransparentPostLight</shaderType>
<drawSize>4</drawSize>
</graphicData>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
<damageDef>RN2_RedStarBomb</damageDef>
<explosionRadius>1.95</explosionRadius>
<speed>30</speed>
<flyOverhead>false</flyOverhead>
<soundHitThickRoof>Artillery_HitThickRoof</soundHitThickRoof>
<soundExplode>RN_RedStar_Explode</soundExplode>
<damageAmountBase>76</damageAmountBase>
<stoppingPower>3</stoppingPower>
<screenShakeFactor>0</screenShakeFactor>
<armorPenetrationSharp>0</armorPenetrationSharp>
<armorPenetrationBlunt>0</armorPenetrationBlunt>
</projectile>
<comps>
<li Class="CompProperties_ThrownFleckEmitter">
<fleck>Smoke</fleck>
<offsetMin>(-0.3,0,0.35)</offsetMin>
<offsetMax>(0.3,0,0.35)</offsetMax>
<emissionInterval>90</emissionInterval>
<scale>1~1.1</scale>
<colorA>(0,235,31,255)</colorA>
<colorB>(0,235,31,255)</colorB>
</li>
</comps>
</ThingDef>

</Defs>
Loading

0 comments on commit 930b1fd

Please sign in to comment.