forked from Cookies_Github_mirror/AquaDX
[RF] AquaMai configuration refactor (#82)
更新了配置文件格式,原有的配置文件将被自动无缝迁移,详情请见新的配置文件中的注释(例外:`SlideJudgeTweak` 不再默认启用) 旧配置文件将被重命名备份,如果更新到此版本遇到 Bug 请联系我们 Updated configuration file schema. The old config file will be migrated automatically and seamlessly. See the comments in the new configuration file for details. (Except for `SlideJudgeTweak` is no longer enabled by default) Your old configuration file will be renamed as a backup. If you encounter any bug with this version, please contact us.
This commit is contained in:
90
AquaMai/AquaMai.Mods/GameSystem/Unlock.cs
Normal file
90
AquaMai/AquaMai.Mods/GameSystem/Unlock.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using AquaMai.Config.Attributes;
|
||||
using AquaMai.Core.Attributes;
|
||||
using MAI2System;
|
||||
using Manager;
|
||||
using Manager.MaiStudio;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace AquaMai.Mods.GameSystem;
|
||||
|
||||
[ConfigSection(
|
||||
en: "Unlock normally locked (including normally non-unlockable) game content.",
|
||||
zh: "解锁原本锁定(包括正常途径无法解锁)的游戏内容")]
|
||||
public class Unlock
|
||||
{
|
||||
[ConfigEntry(
|
||||
en: "Unlock maps that are not in this version.",
|
||||
zh: "解锁游戏里所有的区域,包括非当前版本的(并不会帮你跑完)")]
|
||||
private static readonly bool maps = true;
|
||||
|
||||
[EnableIf(nameof(maps))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(MapData), "get_OpenEventId")]
|
||||
public static bool get_OpenEventId(ref StringID __result)
|
||||
{
|
||||
// For any map, return the event ID 1 to unlock it
|
||||
var id = new Manager.MaiStudio.Serialize.StringID
|
||||
{
|
||||
id = 1,
|
||||
str = "無期限常時解放"
|
||||
};
|
||||
|
||||
var sid = new StringID();
|
||||
sid.Init(id);
|
||||
|
||||
__result = sid;
|
||||
return false;
|
||||
}
|
||||
|
||||
[ConfigEntry(
|
||||
en: "Unlock normally event-only tickets.",
|
||||
zh: "解锁游戏里所有可能的跑图券")]
|
||||
private static readonly bool tickets = true;
|
||||
|
||||
[EnableIf(nameof(tickets))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TicketData), "get_ticketEvent")]
|
||||
public static bool get_ticketEvent(ref StringID __result)
|
||||
{
|
||||
// For any ticket, return the event ID 1 to unlock it
|
||||
var id = new Manager.MaiStudio.Serialize.StringID
|
||||
{
|
||||
id = 1,
|
||||
str = "無期限常時解放"
|
||||
};
|
||||
|
||||
var sid = new StringID();
|
||||
sid.Init(id);
|
||||
|
||||
__result = sid;
|
||||
return false;
|
||||
}
|
||||
|
||||
[EnableIf(nameof(tickets))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TicketData), "get_maxCount")]
|
||||
public static bool get_maxCount(ref int __result)
|
||||
{
|
||||
// Modify the maxTicketNum to 0
|
||||
// this is because TicketManager.GetTicketData adds the ticket to the list if either
|
||||
// the player owns at least one ticket or the maxTicketNum = 0
|
||||
__result = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
[ConfigEntry(
|
||||
en: "Unlock Utage without the need of DXRating 10000.",
|
||||
zh: "不需要万分也可以进宴会场")]
|
||||
private static readonly bool utage = true;
|
||||
|
||||
[EnableIf(nameof(utage))]
|
||||
[EnableGameVersion(24000)]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GameManager), "CanUnlockUtageTotalJudgement")]
|
||||
public static bool CanUnlockUtageTotalJudgement(out ConstParameter.ResultOfUnlockUtageJudgement result1P, out ConstParameter.ResultOfUnlockUtageJudgement result2P)
|
||||
{
|
||||
result1P = ConstParameter.ResultOfUnlockUtageJudgement.Unlocked;
|
||||
result2P = ConstParameter.ResultOfUnlockUtageJudgement.Unlocked;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user