20 Commits

Author SHA1 Message Date
Yue-bin
c3f48b9fde chore(workflow): another try
Some checks failed
Publish Release / build (push) Failing after 3m54s
2026-06-11 01:56:00 +08:00
Yue-bin
7c203f130a chore(workflow): 配置华为云和腾讯云NuGet镜像以提升包恢复速度
Some checks failed
Publish Release / build (push) Failing after 4m16s
# 华为云和腾讯云的 NuGet 镜像配置
- 替换原有的网络诊断步骤为NuGet镜像配置
- 添加华为云和腾讯云的NuGet源到nuget.config文件
- 修改dotnet restore命令使用配置文件而非直接指定源地址
2026-06-10 17:41:36 +08:00
Yue-bin
3d82f43bfe chore(ci): 添加网络诊断步骤以排查NuGet恢复问题
Some checks failed
Publish Release / build (push) Has been cancelled
添加了网络诊断步骤,包括DNS测试、curl连接测试和代理环境检查,
以便更好地排查NuGet包恢复时的网络连接问题。
2026-06-10 17:35:53 +08:00
cf2c581716 chore(ci): 使用华为镜像
Some checks failed
Publish Release / build (push) Failing after 3m54s
2026-06-10 17:18:45 +08:00
Yue-bin
b428f58a68 chore(xhighws): 升级版本号到1.0.0
Some checks failed
Publish Release / build (push) Failing after 4m19s
将项目版本从0.0.1升级到1.0.0,标志着XHighWeaponSpawn插件的正式发布版本。
2026-06-10 00:41:34 +08:00
Yue-bin
0e0c0e8412 docs(README): 更新插件文档信息
- 将插件名称从 stick.plugins.tmpl 更新为 stick.plugins.xhighws
- 修改插件描述,明确说明功能为嫌high刷枪频率不够快的问题
- 更新功能列表,详细说明新增xhigh和max两档更高刷枪频率
- 版本号从v0.0.1更新至v1.0.0,表示功能已完成可用
2026-06-10 00:40:01 +08:00
Yue-bin
9139433175 🐞 fix(button): 持久化后不能被正确读取 2026-06-09 20:46:57 +08:00
Yue-bin
05aac8ff04 fix(Plugin): 移除网络选项补丁并修正映射
移除了 PatchSendOptionsOverNetwork 的 Harmony 补丁,
同时修正了 XHIGH 和 MAX 武器配置的映射
2026-06-09 20:24:10 +08:00
Yue-bin
0c5b3fd3ec refactor(Patches): 移除PatchSendOptionsOverNetwork补丁文件
这个没用
2026-06-09 20:23:50 +08:00
Yue-bin
d5af94a0ec fix(Patches): 修复SendOptionsOverNetwork补丁的目标类型
将补丁的目标从OptionsButton更正为OptionsHolder,以确保选项网络发送功能能够正确应用补丁并正常工作。
2026-06-09 20:10:57 +08:00
Yue-bin
01352a878f fix(PatchGetOptionsData): 修复OptionsButton类型引用错误
将补丁的目标从OptionsButton更正为OptionsHolder,
以确保能够正确拦截GetOptionsData方法调用。
2026-06-09 20:07:43 +08:00
Yue-bin
10cd3daf79 feat(Plugin): 添加新的和谐补丁功能
新增Apply2StartMatch、ApplyExtraWS、PatchGetOptionsData和
PatchSendOptionsOverNetwork四个补丁类,扩展了武器生成插件的功能,
提升了游戏匹配和选项数据处理的能力。
2026-06-09 20:05:30 +08:00
Yue-bin
90cfd7e764 feat(Patches): 添加选项数据获取和网络同步补丁
- 实现 PatchGetOptionsData 补丁类,用于获取选项数据并转换为原始武器选项格式
- 实现 PatchSendOptionsOverNetwork 补丁类,用于在多人游戏中同步选项数据
- 修复武器spawn选项在网络传输中的兼容性问题
2026-06-09 19:56:42 +08:00
Yue-bin
2269ae5b51 feat(Patches): 添加武器生成频率调节补丁
新增Apply2StartMatch补丁类,通过Harmony库Hook到GameManager.StartMatch方法,
实现根据不同选项动态调整武器生成频率的功能。支持6种武器生成模式:
无、低、正常、高、超高、最大,每种模式对应不同的随机生成时间间隔,
并考虑额外武器生成时间加成。
2026-06-09 19:44:14 +08:00
Yue-bin
499f4e68ba feat(weapon-spawn): 添加高武器生成频率补丁
实现一个新的 Harmony 补丁 ApplyExtraWS,用于增强游戏中的武器生成机制。
该补丁通过修改 GameManager 的 SpawnRandomWeapon 方法来实现不同的武器生成频率选项,
包括 NONE、LOW、NORMAL、HIGH、XHIGH 和 MAX 六种模式。补丁还处理了多人游戏
中的网络同步问题,并优化了武器生成位置和缩放逻辑。使用 do-while 循环替代
递归调用以提高性能,并确保在适当的地图类型中正确生成武器。
2026-06-09 19:34:10 +08:00
Yue-bin
afc70118eb refactor(Patches): 优化武器掉落选项补丁实现
移除对静态字段的依赖,改用局部变量访问currentIndex,
减少不必要的反射调用以提升性能并简化代码结构。

BREAKING CHANGE: 移除了Plugin类中的公共静态字段currentIndex和WSButton
2026-06-09 19:06:54 +08:00
Yue-bin
fffffad6a3 feat: 转换模板与便捷属性 2026-06-09 18:46:59 +08:00
Yue-bin
ffb978885e feat(Patches): 更新武器生成选项配置
移除调试日志并优化武器生成速度选项的配置方式,
将原来的数组扩展逻辑替换为直接赋值预定义数组,
新增 XHIGH 和 MAX 两个选项以提供更多武器生成速度选择。
2026-06-09 18:24:06 +08:00
Yue-bin
1385832981 feat: 添加武器生成速度选项扩展功能
新增AddWSOptions补丁类,为武器生成速度选项添加"XHigh"和"Max"两个新选项,
使玩家可以选择更高的武器生成频率。同时移除原有的踢出屏蔽功能和大厅信息显示功能,
简化插件核心逻辑并重命名插件为XHighWeaponSpawn。
2026-06-09 18:08:00 +08:00
Yue-bin
c628478eec 🎉 init: 实例化模板 2026-06-09 18:07:41 +08:00
10 changed files with 243 additions and 111 deletions

View File

@@ -18,9 +18,11 @@ jobs:
uses: http://MonBianG.lan:3000/action/setup-dotnet@v4.3.0
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
env:
DOTNET_RESTORE_SOURCES: "https://repo.huaweicloud.com/repository/nuget/v3/index.json"
- name: Build
run: dotnet build --no-restore --configuration Release

View File

@@ -219,7 +219,7 @@ If you develop a new program, and you want it to be of the greatest possible use
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
stick.plugins.tmpl
stick.plugins.xhighws
Copyright (C) 2026 Stick_Mods
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

32
Patches/AddWSOptions.cs Normal file
View File

@@ -0,0 +1,32 @@
using HarmonyLib;
using TMPro;
using UnityEngine;
namespace stick.plugins.xhighws.Patches;
[HarmonyPatch(typeof(OptionsButton), "Start")]
class AddWSOptions
{
static void Postfix(OptionsButton __instance, ref int ___currentIndex, ref TextMeshProUGUI ___text)
{
// Debug.Log("parent: " + __instance.transform.parent.name);
if (__instance.transform.parent.name == "weaponSpawns")
{
__instance.values = [
"NONE",
"LOW",
"NORMAL",
"HIGH",
"XHIGH",
"MAX"
];
// 再读一遍防止clamp到旧的范围
if (PlayerPrefs.HasKey(__instance.transform.parent.name))
{
___currentIndex = PlayerPrefs.GetInt(__instance.transform.parent.name);
}
___currentIndex = Mathf.Clamp(___currentIndex, 0, __instance.values.Length - 1);
___text.text = __instance.values[___currentIndex];
}
}
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using HarmonyLib;
using UnityEngine;
namespace stick.plugins.xhighws.Patches;
[HarmonyPatch(typeof(GameManager), "StartMatch")]
class Apply2StartMatch
{
static void Postfix(
ref float ___randomWeaponCounter,
float ___extraSpawnWeaponTime
)
{
switch (OptionsHolder.weaponsSpawn)
{
case 0: // NONE
break;
case 1: // LOW
___randomWeaponCounter = UnityEngine.Random.Range(4f, 8f);
break;
case 2: // NORMAL
___randomWeaponCounter = UnityEngine.Random.Range(2f, 4f);
break;
case 3: // HIGH
___randomWeaponCounter = UnityEngine.Random.Range(0.5f, 1f);
break;
case 4: // XHIGH
___randomWeaponCounter = 0.3f;
break;
case 5: // MAX
___randomWeaponCounter = 0f;
break;
}
___randomWeaponCounter += ___extraSpawnWeaponTime;
}
}

94
Patches/ApplyExtraWS.cs Normal file
View File

@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using HarmonyLib;
using UnityEngine;
namespace stick.plugins.xhighws.Patches;
[HarmonyPatch(typeof(GameManager), "SpawnRandomWeapon")]
class ApplyExtraWS
{
static bool Prefix(
bool ___dontSpawnItems,
ref float ___randomWeaponCounter,
float ___extraSpawnWeaponTime,
ref bool ___spawnedLastWeaponOnLeftSide,
WeaponSelectionHandler ___m_WeaponSelectionHandler,
MapWrapper ___lastMapNumber,
MultiplayerManager ___mNetworkManager,
List<Rigidbody> ___mSpawnedWeapons
)
{
if (___dontSpawnItems)
{
return false;
}
if (MatchmakingHandler.IsNetworkMatch && !MultiplayerManager.IsServer)
{
return false;
}
// 用 do-while 替代递归
do
{
switch (OptionsHolder.weaponsSpawn)
{
case 0: // NONE
return false;
case 1: // LOW
___randomWeaponCounter = UnityEngine.Random.Range(8f, 12f);
break;
case 2: // NORMAL
___randomWeaponCounter = UnityEngine.Random.Range(5f, 8f);
break;
case 3: // HIGH
___randomWeaponCounter = UnityEngine.Random.Range(3f, 5f);
break;
case 4: // XHIGH
___randomWeaponCounter = UnityEngine.Random.Range(1f, 3f);
break;
case 5: // MAX
___randomWeaponCounter = UnityEngine.Random.Range(0.5f, 1f);
break;
}
___randomWeaponCounter += ___extraSpawnWeaponTime;
float spawnRange = UnityEngine.Random.Range(0f, 8f);
if (___spawnedLastWeaponOnLeftSide)
{
spawnRange *= -1f;
}
___spawnedLastWeaponOnLeftSide = !___spawnedLastWeaponOnLeftSide;
float scaleMultipler = 11f;
if (GameManager.Instance)
{
scaleMultipler *= GameManager.Instance.LastAppliedScale;
}
Vector3 spawnPos = Vector3.up * scaleMultipler + Vector3.forward * spawnRange;
GameObject gameObject;
int randomWeaponIndex = ___m_WeaponSelectionHandler.GetRandomWeaponIndex(true, out gameObject);
if (randomWeaponIndex < 0)
{
return false;
}
bool shouldSpawnWeaponInCurMap = false;
if (___lastMapNumber.MapType == 0)
{
int mapId = BitConverter.ToInt32(___lastMapNumber.MapData, 0);
shouldSpawnWeaponInCurMap = mapId >= 104 && mapId <= 124;
}
if (MatchmakingHandler.IsNetworkMatch)
{
___mNetworkManager.SpawnWeapon(randomWeaponIndex, spawnPos, shouldSpawnWeaponInCurMap);
}
else
{
GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(gameObject, spawnPos, Quaternion.identity);
if (shouldSpawnWeaponInCurMap)
{
gameObject2.GetComponent<WeaponPickUp>().ChangeToPresent();
}
___mSpawnedWeapons.Add(gameObject2.GetComponent<Rigidbody>());
}
} while (UnityEngine.Random.value > 0.9f);
return false;
}
}

View File

@@ -1,13 +0,0 @@
using HarmonyLib;
using UnityEngine;
[HarmonyPatch(typeof(MultiplayerManager), "OnKicked")]
class IgnoreKick
{
public static bool Prefix(ref byte[] data)
{
MultiplayerManager.KickResponse kickResponse = (MultiplayerManager.KickResponse)data[0];
Debug.LogWarning("Received Kick Message, the reason is: " + kickResponse.ToString());
return false;
}
}

View File

@@ -0,0 +1,27 @@
using System.IO;
using HarmonyLib;
using UnityEngine;
namespace stick.plugins.xhighws.Patches;
[HarmonyPatch(typeof(OptionsHolder), "GetOptionsData")]
class PatchGetOptionsData
{
static bool Prefix(ref byte[] __result)
{
byte[] array = new byte[4];
using (MemoryStream memoryStream = new MemoryStream(array))
{
using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream))
{
binaryWriter.Write((byte)OptionsHolder.maps);
binaryWriter.Write((byte)PlayerPrefs.GetInt("HP"));
binaryWriter.Write((byte)OptionsHolder.regen);
// Convert to ori options
binaryWriter.Write((byte)XHighWeaponSpawn.ToOriWSOptions[OptionsHolder.weaponsSpawn]);
}
}
__result = array;
return false;
}
}

114
Plugin.cs
View File

@@ -3,8 +3,10 @@ using BepInEx.Configuration;
using UnityEngine;
using Steamworks;
using HarmonyLib;
using System.Reflection;
using stick.plugins.xhighws.Patches;
namespace stick.plugins.tmpl;
namespace stick.plugins.xhighws;
/// <summary>
/// 玩家管理器插件主类
@@ -12,94 +14,44 @@ namespace stick.plugins.tmpl;
/// </summary>
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInProcess("StickFight.exe")]
public class Tmpl : BaseUnityPlugin
public class XHighWeaponSpawn : BaseUnityPlugin
{
#region
/// <summary>
/// 是否屏蔽来自其他玩家的踢出请求
/// </summary>
private static ConfigEntry<bool> _blockKicks;
/// <summary>
/// 大厅信息开关快捷键
/// </summary>
private static ConfigEntry<KeyCode> _lobbyInfoToggleKeyCode;
#endregion
#region
private void Awake()
{
InitializeConfiguration();
ApplyPatches();
}
private void Update()
{
HandleInput();
}
private void OnGUI()
{
if (PlayerManagerGUI.ShowLobbyInfo)
{
PlayerManagerGUI.DrawLobbyInfoGUI();
}
}
#endregion
#region
/// <summary>
/// 初始化配置项
/// </summary>
private void InitializeConfiguration()
{
_blockKicks = Config.Bind(
"General",
"BlockKicks",
true,
"是否屏蔽来自其他玩家的踢出请求"
);
_lobbyInfoToggleKeyCode = Config.Bind(
"LobbyInfo",
"ToggleKeyCode",
KeyCode.F2,
"Lobby信息开关快捷键"
);
}
/// <summary>
/// 应用Harmony补丁
/// </summary>
private void ApplyPatches()
{
if (_blockKicks.Value)
{
Harmony.CreateAndPatchAll(typeof(IgnoreKick));
}
Harmony.CreateAndPatchAll(typeof(AddWSOptions));
Harmony.CreateAndPatchAll(typeof(Apply2StartMatch));
Harmony.CreateAndPatchAll(typeof(ApplyExtraWS));
Harmony.CreateAndPatchAll(typeof(PatchGetOptionsData));
}
/// <summary>
/// 处理输入
/// </summary>
private void HandleInput()
{
if (Input.GetKeyDown(_lobbyInfoToggleKeyCode.Value))
{
ToggleLobbyInfoGUI();
}
}
#endregion
#region
#endregion
// oh fuck u landfall
/*
Convert maps
Ori,New,Name
2,0,NONE
3,1,LOW
0,2,NORMAL
1,3,HIGH
1,4,XHIGH
1,5,MAX
*/
public static int[] FromOriWSOptions = [
2, // NORMAL
3, // HIGH
0, // NONE
1, // LOW
];
public static int[] ToOriWSOptions = [
2, // NONE
3, // LOW
0, // NORMAL
1, // HIGH
1, // XHIGH
1, // MAX
];
}

View File

@@ -1,19 +1,13 @@
# stick.plugins.tmpl
# stick.plugins.xhighws
简要描述
嫌high刷枪频率刷的不够快
## 功能
* ablity1
* ablity2
* 添加xhigh和max两档更高的刷枪频率
## 更新日志
### v0.0.3
### v1.0.0
1. 修复了xxx问题
### v0.0.1
1. 新增xxx功能
2. 添加工作流
1. 能用了

View File

@@ -2,9 +2,9 @@
<PropertyGroup>
<TargetFramework>net35</TargetFramework>
<AssemblyName>stick.plugins.tmpl</AssemblyName>
<Product>Tmpl</Product>
<Version>0.0.1</Version>
<AssemblyName>stick.plugins.xhighws</AssemblyName>
<Product>XHighWeaponSpawn</Product>
<Version>1.0.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<RestoreAdditionalProjectSources>
@@ -12,7 +12,7 @@
https://nuget.bepinex.dev/v3/index.json;
https://nuget.samboy.dev/v3/index.json
</RestoreAdditionalProjectSources>
<RootNamespace>stick.plugins.playermanager</RootNamespace>
<RootNamespace>stick.plugins.xhighws</RootNamespace>
</PropertyGroup>
<ItemGroup>
@@ -46,4 +46,10 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="TextMeshPro-1.0.55.56.0b9">
<HintPath>lib\TextMeshPro-1.0.55.56.0b9.dll</HintPath>
</Reference>
</ItemGroup>
</Project>