Skip to content

Commit

Permalink
Merge pull request #104 from kiccer/test
Browse files Browse the repository at this point in the history
[update] 增加单独设置下蹲系数
  • Loading branch information
kiccer authored Aug 22, 2020
2 parents bf511b1 + b9c21f4 commit f4dd1b1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/test/
.history
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
### 安装教程
* **以管理员身份**启动罗技驱动
- 请确保你下载的驱动与你的操作系统是匹配的
- 目前暂不支持 `GHUB` 新驱动 (等Star ≥ 300,我会下载新版本去研究一下)
- 目前暂不支持 `GHUB` 新驱动 ~~(等Star ≥ 300,我会下载新版本去研究一下)~~
* 开启 **自动游戏检测**
- 这样做的好处是,可以避免脚本意外干扰正常操作
- 尽量不要锁定配置,因为锁定后你的脚本无时无刻都是运行的,可能会干扰你的鼠标正常使用
Expand Down Expand Up @@ -104,6 +104,7 @@

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

Expand Down
16 changes: 15 additions & 1 deletion Soldier76.lua
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ pubg["M16A4"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 108,
ballistic = {
{1, 0},
Expand All @@ -310,6 +311,7 @@ pubg["SCAR-L"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 96,
ballistic = {
{1, 0},
Expand All @@ -329,6 +331,7 @@ pubg["Beryl M762"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 86,
ballistic = {
{1, 0},
Expand All @@ -351,6 +354,7 @@ pubg["Tommy Gun"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 84,
ballistic = {
{1, 0},
Expand All @@ -367,6 +371,7 @@ pubg["G36C"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 80,
ballistic = {
{1, 0},
Expand All @@ -385,6 +390,7 @@ pubg["Vector"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 55,
ballistic = {
{1, 0},
Expand All @@ -402,6 +408,7 @@ pubg["Micro UZI"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 46,
ballistic = {
{1, 0},
Expand All @@ -420,6 +427,7 @@ pubg["UMP45"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 94,
ballistic = {
{1, 0},
Expand All @@ -436,6 +444,7 @@ pubg["AKM"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 99,
ballistic = {
{1, 0},
Expand All @@ -455,6 +464,7 @@ pubg["M416"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 85,
ballistic = {
{1, 0},
Expand All @@ -476,6 +486,7 @@ pubg["QBZ"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 87,
ballistic = {
{1, 0},
Expand All @@ -495,6 +506,7 @@ pubg["DP-28"] = function ()

return pubg.execOptions({
ratio = 1,
ctrlmodeRatio = 0.8,
interval = 100,
ballistic = {
{1, 0},
Expand Down Expand Up @@ -566,6 +578,7 @@ function pubg.execOptions (options)
amount = #ballisticConfig2, -- Number of bullets
interval = options.interval, -- Time of each bullet
ballistic = ballisticConfig2, -- ballistic data
ctrlmodeRatio = options.ctrlmodeRatio, -- Individual recoil coefficient for each gun when squatting
}

end
Expand All @@ -590,6 +603,7 @@ function pubg.init ()
gunCount = gunCount + 1 -- Accumulative number of firearms configuration files
pubg.gun[type][gunCount] = gunName -- Adding available firearms to the Arsenal
pubg.gunOptions[type][gunCount] = pubg[gunName]() -- Get firearms data and add it to the configuration library

-- 单独设置连发
pubg.gunOptions[type][gunCount].autoContinuousFiring = ({ 0, 0, 1 })[
math.max(1, math.min(gunState + 1, 3))
Expand Down Expand Up @@ -673,7 +687,7 @@ function pubg.getRealY (options, y)
end

if userInfo.aimingSettings == "ctrlmode" and IsModifierPressed("lctrl") then
realY = realY * 0.8
realY = realY * options.ctrlmodeRatio
end

return realY
Expand Down

0 comments on commit f4dd1b1

Please sign in to comment.