Skip to content

Commit

Permalink
加个恩义锁定。
Browse files Browse the repository at this point in the history
  • Loading branch information
linkaixiang4883 committed Oct 19, 2022
1 parent 7e04835 commit dd0122f
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 3 deletions.
8 changes: 7 additions & 1 deletion LKXMods.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LKXModsWarehouseAndBag", "L
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LKXModsGongFaGridCostBackend", "LKXModsGongFaGridCostBackend\LKXModsGongFaGridCostBackend.csproj", "{CFD3673E-129C-46B5-8658-DEE6364BF6D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{2467E55D-9EF1-4328-B21A-8D214BFC183B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{2467E55D-9EF1-4328-B21A-8D214BFC183B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary2", "ClassLibrary2\ClassLibrary2.csproj", "{DC7A7D28-D1B6-4268-8931-05EBC1D9E632}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LKXModsEnYi", "LKXModsEnYi\LKXModsEnYi.csproj", "{011274C7-7F5B-46B0-ACC1-9FC11C3621C4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -39,6 +41,10 @@ Global
{DC7A7D28-D1B6-4268-8931-05EBC1D9E632}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC7A7D28-D1B6-4268-8931-05EBC1D9E632}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC7A7D28-D1B6-4268-8931-05EBC1D9E632}.Release|Any CPU.Build.0 = Release|Any CPU
{011274C7-7F5B-46B0-ACC1-9FC11C3621C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{011274C7-7F5B-46B0-ACC1-9FC11C3621C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{011274C7-7F5B-46B0-ACC1-9FC11C3621C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{011274C7-7F5B-46B0-ACC1-9FC11C3621C4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
22 changes: 22 additions & 0 deletions LKXModsEnYi/LKXModsEnYi.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Reference Include="0Harmony">
<HintPath>E:\SteamLibrary\steamapps\common\The Scroll Of Taiwu\The Scroll of Taiwu_Data\Managed\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GameData">
<HintPath>E:\SteamLibrary\steamapps\common\The Scroll Of Taiwu\Backend\GameData.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="TaiwuModdingLib">
<HintPath>E:\SteamLibrary\steamapps\common\The Scroll Of Taiwu\The Scroll of Taiwu_Data\Managed\TaiwuModdingLib.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>

</Project>
83 changes: 83 additions & 0 deletions LKXModsEnYi/Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using HarmonyLib;
using TaiwuModdingLib.Core.Plugin;
using Config;
using System.Collections.Generic;
using GameData.Utilities;
using GameData.Domains;
using GameData.Domains.Combat;
using GameData.Domains.CombatSkill;
using System;
using GameData.Common;
using GameData.Domains.Character;
using GameData.Domains.Map;

namespace LKXModsEnYi
{
[PluginConfig("LKXModsEnYi", "LKX", "0.1.0")]
public class Run : TaiwuRemakePlugin
{
private Harmony harmony;

private static short _fulongAreaTemplateId = 29;
private static short _ranshanAreaTemplateId = 22;

public override void Dispose()
{
if (harmony != null)
{
harmony.UnpatchSelf();
harmony = null;
}
}

public override void Initialize()
{
harmony = Harmony.CreateAndPatchAll(typeof(Run));
}

private static bool enableRanShan;
private static bool enableFuLong;
public override void OnModSettingUpdate()
{
DomainManager.Mod.GetSetting(ModIdStr, "enableRanShan", ref enableRanShan);
DomainManager.Mod.GetSetting(ModIdStr, "enableFuLong", ref enableFuLong);
}

public override void OnLoadedArchiveData()
{
base.OnLoadedArchiveData();

/*List<short> mapAreaKeys = Config.MapArea.Instance.GetAllKeys();
foreach (short areaKey in mapAreaKeys)
{
MapAreaItem item = Config.MapArea.Instance[areaKey];
AdaptableLog.Info(item.Name + ":" + item.TemplateId);
}
AdaptableLog.Error("成功加载存档");*/
}

/// <summary>
/// patch功法修改
/// </summary>
/// <param name="__instance"></param>
/// <param name="__result"></param>
[HarmonyPrefix, HarmonyPatch(typeof(GameData.Domains.Map.MapDomain), "ChangeSpiritualDebt")]
public static void MapDomain_ChangeSpiritualDebt_Patch(GameData.Domains.Map.MapDomain __instance, DataContext context, short areaId, ref short spiritualDebt)
{
MapAreaData areaData = __instance.GetElement_Areas(areaId);
//AdaptableLog.Info("spiritualDebt:" + spiritualDebt);
if (_fulongAreaTemplateId > 0 && enableFuLong && areaData.GetTemplateId() == _fulongAreaTemplateId)
{
//AdaptableLog.Info("设置赤明岛100%恩义。");
spiritualDebt = 1000;
}
if(_ranshanAreaTemplateId > 0 && enableRanShan && areaData.GetTemplateId() == _ranshanAreaTemplateId)
{
//AdaptableLog.Info("设置然山100%恩义。");
spiritualDebt = 1000;
}
}

}
}
2 changes: 1 addition & 1 deletion LKXModsGongFaGridCost/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace LKXModsGongFaGridCost
{
[PluginConfig("LKXModsGongFaGridCost", "LKX", "0.2.3")]
[PluginConfig("LKXModsGongFaGridCost", "LKX", "0.11.0")]
public class Run : TaiwuRemakePlugin
{
private Harmony harmony;
Expand Down
2 changes: 1 addition & 1 deletion LKXModsGongFaGridCostBackend/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace LKXModsGongFaGridCostBackend
{
[PluginConfig("LKXModsGongFaGridCostBackend", "LKX", "0.2.3")]
[PluginConfig("LKXModsGongFaGridCostBackend", "LKX", "0.11.0")]
public class Run : TaiwuRemakePlugin
{
private Harmony harmony;
Expand Down

0 comments on commit dd0122f

Please sign in to comment.