-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
328 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
SoD_BaseMod/src/asm/Extensions/MissionManager_Extensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using HarmonyLib; | ||
|
||
namespace SoD_BaseMod.Extensions { | ||
[HarmonyPatch(declaringType: typeof(MissionManager))] | ||
public static class MissionManager_Extensions { | ||
[HarmonyReversePatch, | ||
HarmonyPatch(methodName: "GetUserMissionStaticEventHandler", argumentTypes: new[] { | ||
typeof(WsServiceType), typeof(WsServiceEvent), typeof(float), typeof(object), typeof(object) | ||
})] | ||
public static void GetUserMissionStaticEventHandler(this MissionManager __instance, | ||
WsServiceType inType, WsServiceEvent inEvent, float inProgress, object inObject, object inUserData) { | ||
/* dummy content */ | ||
throw new NotImplementedException("Stub called, reverse patch has not been applied!"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using HarmonyLib; | ||
using SoD_BaseMod.console; | ||
|
||
namespace SoD_BaseMod { | ||
[HarmonyPatch(declaringType: typeof(WorldEventScoutAttack))] | ||
public static class WorldEventScoutAttackPatches { | ||
[HarmonyPostfix, HarmonyPatch(methodName: "PopulateScore", argumentTypes: new[] { typeof(string[]), typeof(bool) })] | ||
private static void PopulateScore_Postfix(WorldEventScoutAttack __instance, string[] playersData, bool eventWon) { | ||
WorldEventManager.WorldEventAchievementRewardInfo[] rewardInfo = new Traverse(__instance) | ||
.Field("mCurrentRewardInfo") | ||
.GetValue<WorldEventManager.WorldEventAchievementRewardInfo[]>(); | ||
if (rewardInfo == null) { | ||
BTConsole.WriteLine("rewardInfo was null!"); | ||
return; | ||
} | ||
|
||
BTConsole.WriteLine($" Found {rewardInfo.Length} rewardInfos"); | ||
foreach (WorldEventManager.WorldEventAchievementRewardInfo info in rewardInfo) { | ||
if (info == null) { | ||
BTConsole.WriteLine("info was null!"); | ||
continue; | ||
} | ||
BTConsole.WriteLine( | ||
" " | ||
+ "_RewardNameText = " + info._RewardNameText + " | " | ||
+ "_RewardTier = " + info._RewardTier + " | " | ||
+ "_AchievementID = " + info._AchievementID + " | " | ||
+ "_AdRewardAchievementID = " + info._AdRewardAchievementID | ||
); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.