-
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.
- Loading branch information
1 parent
7e04835
commit dd0122f
Showing
5 changed files
with
114 additions
and
3 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
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,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> |
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,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; | ||
} | ||
} | ||
|
||
} | ||
} |
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
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