Skip to content

Commit f4dd1b1

Browse files
authored
Merge pull request #104 from kiccer/test
[update] 增加单独设置下蹲系数
2 parents bf511b1 + b9c21f4 commit f4dd1b1

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/test/
2+
.history

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
### 安装教程
2929
* **以管理员身份**启动罗技驱动
3030
- 请确保你下载的驱动与你的操作系统是匹配的
31-
- 目前暂不支持 `GHUB` 新驱动 (等Star ≥ 300,我会下载新版本去研究一下)
31+
- 目前暂不支持 `GHUB` 新驱动 ~~(等Star ≥ 300,我会下载新版本去研究一下)~~
3232
* 开启 **自动游戏检测**
3333
- 这样做的好处是,可以避免脚本意外干扰正常操作
3434
- 尽量不要锁定配置,因为锁定后你的脚本无时无刻都是运行的,可能会干扰你的鼠标正常使用
@@ -104,6 +104,7 @@
104104

105105
### 其他设置(非必要)
106106
* 所有枪械单独设置系数 `ratio`
107+
* 所有枪械单独设置下蹲系数系数 `ctrlmodeRatio`
107108
* [扩展开发教程:增加一把新的枪械/修改一把枪械的数据](https://github.com/kiccer/Soldier76/issues/24)
108109
* [扩展开发教程:设置自定义瞄准判断条件](https://github.com/kiccer/Soldier76/issues/52)
109110

Soldier76.lua

+15-1
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ pubg["M16A4"] = function ()
290290

291291
return pubg.execOptions({
292292
ratio = 1,
293+
ctrlmodeRatio = 0.8,
293294
interval = 108,
294295
ballistic = {
295296
{1, 0},
@@ -310,6 +311,7 @@ pubg["SCAR-L"] = function ()
310311

311312
return pubg.execOptions({
312313
ratio = 1,
314+
ctrlmodeRatio = 0.8,
313315
interval = 96,
314316
ballistic = {
315317
{1, 0},
@@ -329,6 +331,7 @@ pubg["Beryl M762"] = function ()
329331

330332
return pubg.execOptions({
331333
ratio = 1,
334+
ctrlmodeRatio = 0.8,
332335
interval = 86,
333336
ballistic = {
334337
{1, 0},
@@ -351,6 +354,7 @@ pubg["Tommy Gun"] = function ()
351354

352355
return pubg.execOptions({
353356
ratio = 1,
357+
ctrlmodeRatio = 0.8,
354358
interval = 84,
355359
ballistic = {
356360
{1, 0},
@@ -367,6 +371,7 @@ pubg["G36C"] = function ()
367371

368372
return pubg.execOptions({
369373
ratio = 1,
374+
ctrlmodeRatio = 0.8,
370375
interval = 80,
371376
ballistic = {
372377
{1, 0},
@@ -385,6 +390,7 @@ pubg["Vector"] = function ()
385390

386391
return pubg.execOptions({
387392
ratio = 1,
393+
ctrlmodeRatio = 0.8,
388394
interval = 55,
389395
ballistic = {
390396
{1, 0},
@@ -402,6 +408,7 @@ pubg["Micro UZI"] = function ()
402408

403409
return pubg.execOptions({
404410
ratio = 1,
411+
ctrlmodeRatio = 0.8,
405412
interval = 46,
406413
ballistic = {
407414
{1, 0},
@@ -420,6 +427,7 @@ pubg["UMP45"] = function ()
420427

421428
return pubg.execOptions({
422429
ratio = 1,
430+
ctrlmodeRatio = 0.8,
423431
interval = 94,
424432
ballistic = {
425433
{1, 0},
@@ -436,6 +444,7 @@ pubg["AKM"] = function ()
436444

437445
return pubg.execOptions({
438446
ratio = 1,
447+
ctrlmodeRatio = 0.8,
439448
interval = 99,
440449
ballistic = {
441450
{1, 0},
@@ -455,6 +464,7 @@ pubg["M416"] = function ()
455464

456465
return pubg.execOptions({
457466
ratio = 1,
467+
ctrlmodeRatio = 0.8,
458468
interval = 85,
459469
ballistic = {
460470
{1, 0},
@@ -476,6 +486,7 @@ pubg["QBZ"] = function ()
476486

477487
return pubg.execOptions({
478488
ratio = 1,
489+
ctrlmodeRatio = 0.8,
479490
interval = 87,
480491
ballistic = {
481492
{1, 0},
@@ -495,6 +506,7 @@ pubg["DP-28"] = function ()
495506

496507
return pubg.execOptions({
497508
ratio = 1,
509+
ctrlmodeRatio = 0.8,
498510
interval = 100,
499511
ballistic = {
500512
{1, 0},
@@ -566,6 +578,7 @@ function pubg.execOptions (options)
566578
amount = #ballisticConfig2, -- Number of bullets
567579
interval = options.interval, -- Time of each bullet
568580
ballistic = ballisticConfig2, -- ballistic data
581+
ctrlmodeRatio = options.ctrlmodeRatio, -- Individual recoil coefficient for each gun when squatting
569582
}
570583

571584
end
@@ -590,6 +603,7 @@ function pubg.init ()
590603
gunCount = gunCount + 1 -- Accumulative number of firearms configuration files
591604
pubg.gun[type][gunCount] = gunName -- Adding available firearms to the Arsenal
592605
pubg.gunOptions[type][gunCount] = pubg[gunName]() -- Get firearms data and add it to the configuration library
606+
593607
-- 单独设置连发
594608
pubg.gunOptions[type][gunCount].autoContinuousFiring = ({ 0, 0, 1 })[
595609
math.max(1, math.min(gunState + 1, 3))
@@ -673,7 +687,7 @@ function pubg.getRealY (options, y)
673687
end
674688

675689
if userInfo.aimingSettings == "ctrlmode" and IsModifierPressed("lctrl") then
676-
realY = realY * 0.8
690+
realY = realY * options.ctrlmodeRatio
677691
end
678692

679693
return realY

0 commit comments

Comments
 (0)