Skip to content

Commit

Permalink
Release v2.10.4 - Stable
Browse files Browse the repository at this point in the history
  • Loading branch information
welles authored Sep 12, 2022
2 parents d782430 + 5bd7a4d commit b048719
Show file tree
Hide file tree
Showing 37 changed files with 152 additions and 106 deletions.
2 changes: 2 additions & 0 deletions .github/resources/depotdownloader.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
regex:bin\/Win64_Shipping_Client\/[^\/]+\.dll
regex:Modules\/[A-Za-z]+\/bin\/Win64_Shipping_Client\/[^\/]+\.dll
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
name: Release
name: Build (Depots)

on:
push:
branches: [ stable, beta ]
workflow_dispatch:

jobs:
build:
name: Build & Release
name: Build & Release (Depots)
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 3.1.x
source-url: https://nuget.pkg.github.com/BUTR/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

- name: Build BannerlordCheats
run: dotnet build BannerlordCheats.csproj --configuration Release -p:GameFolder="$PWD\game"
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
uses: actions/checkout@master

- name: Get Versions
id: versions
Expand All @@ -38,7 +22,7 @@ jobs:
Write-Host "::set-output name=mod_version::$ModVersion"
Write-Host "ModVersion: ""$ModVersion"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$GameVersion = Get-Content .\Directory.Build.props | Select-String -Pattern "<GameVersion>([\d.]+)<\/GameVersion>" | % { $($_.Matches.Groups[1]).Value }
$GameVersion = Get-Content .\Directory.Build.props | Select-String -Pattern "<GameVersion>(e[\d.]+)<\/GameVersion>" | % { $($_.Matches.Groups[1]).Value }
Write-Host "::set-output name=game_version::$GameVersion"
Write-Host "GameVersion: ""$GameVersion"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -59,30 +43,67 @@ jobs:
Write-Host "::set-output name=prerelease::$Prerelease"
Write-Host "Prerelease: ""$Prerelease"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$ZipName = "BannerlordCheats_v$($ModVersion)_for_$($GameBranch)_e$($GameVersion)"
$ZipName = "BannerlordCheats_v$($ModVersion)_for_$($GameBranch)_$($GameVersion)"
Write-Host "::set-output name=zip_name::$ZipName"
Write-Host "ZipName: ""$ZipName"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$TagName = "v$ModVersion$RepoBranch"
Write-Host "::set-output name=tag_name::$TagName"
Write-Host "TagName: ""$TagName"""
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
$ReleaseTitle = "Release v$($ModVersion) for $($GameBranch) e$($GameVersion)"
$ReleaseTitle = "Release v$($ModVersion) for $($GameBranch) $($GameVersion)"
Write-Host "::set-output name=release_title::$ReleaseTitle"
Write-Host "ReleaseTitle: ""$ReleaseTitle"""
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 6.0.x
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

- name: Download DepotDownloader 2.4.7
uses: i3h/download-release-asset@v1.3.2
with:
owner: SteamRE
repo: DepotDownloader
tag: DepotDownloader_2.4.7
file: depotdownloader-2.4.7.zip

- name: Extract DepotDownloader 2.4.7
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: depotdownloader-2.4.7.zip
pathTarget: depotdownloader

- name: Download Game Binaries
run: >-
foreach ($depot in @(261551, 261552)) {
dotnet depotdownloader/DepotDownloader.dll -app 261550 -depot $depot -beta ${{steps.versions.outputs.game_version}} -username ${{secrets.STEAM_USERNAME}} -password ${{secrets.STEAM_PASSWORD}} -os windows -osarch 64 -filelist ./.github/resources/depotdownloader.txt -dir bannerlord;
}
shell: pwsh

- name: Build BannerlordCheats
run: dotnet build BannerlordCheats.csproj --configuration Release -p:GameFolder="${{github.workspace}}\bannerlord" -p:UseNuGetAssemblies="False"
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

- name: Package Mod Files
run: 7z a -tzip ${{steps.versions.outputs.zip_name}}.zip ./game/Modules/*
run: 7z a -tzip ../../${{steps.versions.outputs.zip_name}}.zip Cheats/
working-directory: ./bannerlord/Modules

- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{steps.versions.outputs.zip_name}}
path: ./game/Modules/*
path: ./${{steps.versions.outputs.zip_name}}.zip

- name: Create Release
uses: actions/create-release@v1
id: create_release
if: ${{ github.ref_name == 'stable' || github.ref_name == 'beta' }}
with:
tag_name: ${{steps.versions.outputs.tag_name}}
release_name: ${{steps.versions.outputs.release_title}}
Expand All @@ -92,8 +113,9 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Upload Release Asset
id: upload_release_asset
uses: actions/upload-release-asset@v1
id: upload_release_asset
if: ${{ github.ref_name == 'stable' || github.ref_name == 'beta' }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: ./${{steps.versions.outputs.zip_name}}.zip
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Build

on:
push:
branches: [ stable-develop, beta-develop ]
#push:
workflow_dispatch:

jobs:
build:
name: Build
name: Build & Release
runs-on: windows-latest

steps:
Expand Down Expand Up @@ -80,3 +79,27 @@ jobs:
with:
name: ${{steps.versions.outputs.zip_name}}
path: ./game/Modules/*

- name: Create Release
uses: actions/create-release@v1
id: create_release
if: ${{ github.ref_name == 'stable' || github.ref_name == 'beta' }}
with:
tag_name: ${{steps.versions.outputs.tag_name}}
release_name: ${{steps.versions.outputs.release_title}}
draft: false
prerelease: ${{steps.versions.outputs.prerelease}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
id: upload_release_asset
if: ${{ github.ref_name == 'stable' || github.ref_name == 'beta' }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: ./${{steps.versions.outputs.zip_name}}.zip
asset_name: ${{steps.versions.outputs.zip_name}}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
10 changes: 5 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<PropertyGroup>
<Version>2.10.3.0</Version>
<GameVersion>1.7.2.316284</GameVersion>
<Version>2.10.4.0</Version>
<GameVersion>e1.8.0</GameVersion>
<GameBranch>Stable</GameBranch>
<HarmonyVersion>2.2.1</HarmonyVersion>
<MCMVersion>4.7.3</MCMVersion>
<HarmonyVersion>2.2.2</HarmonyVersion>
<MCMVersion>4.7.7</MCMVersion>
<TargetFramework>net472</TargetFramework>
<LangVersion>8.0</LangVersion>
<GameFolder>C:\SteamCMD\apps\mb2b_stable</GameFolder>
<UseNuGetAssemblies>True</UseNuGetAssemblies>
<UseNuGetAssemblies>False</UseNuGetAssemblies>
</PropertyGroup>
</Project>
3 changes: 1 addition & 2 deletions Extensions/Message.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using TaleWorlds.Core;
using TaleWorlds.Library;
using TaleWorlds.Library;

namespace BannerlordCheats.Extensions
{
Expand Down
2 changes: 1 addition & 1 deletion Extensions/PartyExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.Party;

Expand Down
3 changes: 2 additions & 1 deletion Extensions/Reflection.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Reflection;
using TaleWorlds.CampaignSystem.ViewModelCollection;
using TaleWorlds.CampaignSystem.ViewModelCollection.Inventory;
using TaleWorlds.CampaignSystem.ViewModelCollection.Party;
using TaleWorlds.ScreenSystem;

namespace BannerlordCheats.Extensions
Expand Down
2 changes: 1 addition & 1 deletion Extensions/SiegeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public static class SiegeExtensions
{
public static bool IsPlayerSide(this ISiegeEventSide side)
{
return side?.SiegeParties?.Any(x => x.IsPlayerParty()) ?? false;
return side?.GetInvolvedPartiesForEventType()?.Any(x => x.IsPlayerParty()) ?? false;
}
}
}
2 changes: 1 addition & 1 deletion Patches/Army/ArmyCohesionLossPercentage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace BannerlordCheats.Patches.Army
{
[HarmonyPatch(typeof(ArmyObj), nameof(ArmyObj.CohesionChange), MethodType.Getter)]
[HarmonyPatch(typeof(ArmyObj), nameof(ArmyObj.DailyCohesionChange), MethodType.Getter)]
public static class ArmyCohesionLossPercentage
{
[UsedImplicitly]
Expand Down
5 changes: 4 additions & 1 deletion Patches/Army/ArmyFoodConsumptionPercentage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ public static class ArmyFoodConsumptionPercentage
{
[UsedImplicitly]
[HarmonyPostfix]
public static void CalculateDailyFoodConsumptionf(ref MobileParty party, ref bool includeDescription, ref ExplainedNumber __result)
public static void CalculateDailyFoodConsumptionf(
ref MobileParty party,
ref ExplainedNumber baseConsumption,
ref ExplainedNumber __result)
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion Patches/Army/FactionArmyCohesionLossPercentage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace BannerlordCheats.Patches.Army
{
[HarmonyPatch(typeof(ArmyObj), nameof(ArmyObj.CohesionChange), MethodType.Getter)]
[HarmonyPatch(typeof(ArmyObj), nameof(ArmyObj.DailyCohesionChange), MethodType.Getter)]
public static class FactionArmyCohesionLossPercentage
{
[UsedImplicitly]
Expand Down
10 changes: 5 additions & 5 deletions Patches/Combat/AlwaysKnockDown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
using BannerlordCheats.Settings;
using HarmonyLib;
using JetBrains.Annotations;
using SandBox.GameComponents;
using TaleWorlds.Core;
using TaleWorlds.MountAndBlade;

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(Mission), "DecideAgentKnockedByBlow")]
[HarmonyPatch(typeof(SandboxAgentApplyDamageModel), nameof(SandboxAgentApplyDamageModel.DecideAgentKnockedDownByBlow))]
public static class AlwaysKnockDown
{
[UsedImplicitly]
[HarmonyPostfix]
public static void DecideAgentKnockedByBlow(
ref Agent attacker,
ref Agent victim,
ref Agent attackerAgent,
ref Agent victimAgent,
ref AttackCollisionData collisionData,
ref WeaponComponentData attackerWeapon,
ref bool isInitialBlowShrugOff,
ref Blow blow)
{
try
{
if (attacker.IsPlayer()
if (attackerAgent.IsPlayer()
&& BannerlordCheatsSettings.Instance?.AlwaysKnockDown == true)
{
blow.BlowFlag &= ~BlowFlags.ShrugOff;
Expand Down
2 changes: 1 addition & 1 deletion Patches/Combat/CompanionDeathPercentage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(DefaultAgentDecideKilledOrUnconsciousModel), nameof(DefaultAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
[HarmonyPatch(typeof(SandboxAgentDecideKilledOrUnconsciousModel), nameof(SandboxAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
public static class CompanionDeathPercentage
{
[UsedImplicitly]
Expand Down
2 changes: 1 addition & 1 deletion Patches/Combat/EnemyLordCombatDeathChanceMultiplier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(DefaultAgentDecideKilledOrUnconsciousModel), nameof(DefaultAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
[HarmonyPatch(typeof(SandboxAgentDecideKilledOrUnconsciousModel), nameof(SandboxAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
public static class EnemyLordCombatDeathChanceMultiplier
{
[UsedImplicitly]
Expand Down
2 changes: 1 addition & 1 deletion Patches/Combat/EnemyLordCombatDeathPercentageBattle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(DefaultAgentDecideKilledOrUnconsciousModel), nameof(DefaultAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
[HarmonyPatch(typeof(SandboxAgentDecideKilledOrUnconsciousModel), nameof(SandboxAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
public static class EnemyLordCombatDeathPercentageBattle
{
[UsedImplicitly]
Expand Down
2 changes: 1 addition & 1 deletion Patches/Combat/EnemyOnlyKnockout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(DefaultAgentDecideKilledOrUnconsciousModel), nameof(DefaultAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
[HarmonyPatch(typeof(SandboxAgentDecideKilledOrUnconsciousModel), nameof(SandboxAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
public static class EnemyOnlyKnockout
{
[UsedImplicitly]
Expand Down
2 changes: 1 addition & 1 deletion Patches/Combat/FriendlyLordCombatDeathPercentageBattle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(DefaultAgentDecideKilledOrUnconsciousModel), nameof(DefaultAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
[HarmonyPatch(typeof(SandboxAgentDecideKilledOrUnconsciousModel), nameof(SandboxAgentDecideKilledOrUnconsciousModel.GetAgentStateProbability))]
public static class FriendlyLordCombatDeathPercentageBattle
{
[UsedImplicitly]
Expand Down
2 changes: 1 addition & 1 deletion Patches/Combat/InfiniteAmmo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void OnAgentShootMissile(
{
var missionWeapon = shooterAgent.Equipment[index];

if (missionWeapon.IsAnyConsumable(out _)
if (missionWeapon.IsAnyConsumable()
&& missionWeapon.Amount <= missionWeapon.ModifiedMaxAmount)
{
shooterAgent.SetWeaponAmountInSlot(index, missionWeapon.ModifiedMaxAmount, true);
Expand Down
6 changes: 3 additions & 3 deletions Patches/Combat/Invincible.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(Agent), nameof(Agent.Invulnerable), MethodType.Getter)]
[HarmonyPatch(typeof(Agent), nameof(Agent.CurrentMortalityState), MethodType.Getter)]
public static class Invincible
{
[UsedImplicitly]
[HarmonyPostfix]
public static void Invulnerable(ref Agent __instance, ref bool __result)
public static void Invulnerable(ref Agent __instance, ref Agent.MortalityState __result)
{
try
{
if (__instance.IsPlayer()
&& BannerlordCheatsSettings.Instance?.Invincible == true)
{
__result = true;
__result = Agent.MortalityState.Invulnerable;
}
}
catch (Exception e)
Expand Down
10 changes: 5 additions & 5 deletions Patches/Combat/NeverKnockedBackByAttacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
using BannerlordCheats.Settings;
using HarmonyLib;
using JetBrains.Annotations;
using SandBox.GameComponents;
using TaleWorlds.Core;
using TaleWorlds.MountAndBlade;

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(Mission), "DecideAgentKnockedByBlow")]
[HarmonyPatch(typeof(SandboxAgentApplyDamageModel), nameof(SandboxAgentApplyDamageModel.DecideAgentKnockedBackByBlow))]
public static class NeverKnockedBackByAttacks
{
[UsedImplicitly]
[HarmonyPostfix]
public static void DecideAgentKnockedByBlow(
ref Agent attacker,
ref Agent victim,
ref Agent attackerAgent,
ref Agent victimAgent,
ref AttackCollisionData collisionData,
ref WeaponComponentData attackerWeapon,
ref bool isInitialBlowShrugOff,
ref Blow blow)
{
try
{
if (victim.IsPlayer()
if (victimAgent.IsPlayer()
&& BannerlordCheatsSettings.Instance?.NeverKnockedBackByAttacks == true)
{
blow.BlowFlag &= ~BlowFlags.KnockDown;
Expand Down
Loading

0 comments on commit b048719

Please sign in to comment.