@@ -56,29 +56,34 @@ userInfo = {
56
56
end ,
57
57
},
58
58
59
- -- 支持的枪械,排列顺序即是配置顺序,可以自行调整。启用设置:0 - 不启用 | 1 - 启用 | 2 - 启用并开启连发功能
60
- -- The arrangement order is the configuration order, which can be adjusted by yourself.
61
- -- 0 - Disable | 1 - Enable | 2 - Enable and turn on the auto fire function
59
+ -- 支持的枪械,排列顺序即是配置顺序,可以自行调整。
60
+ -- 模式:0 - 不启用 | 1 - 启用 | 2 - 开启连点
61
+ -- 系数:枪械自身系数,基于 ADS 进行调整 (ADS为全局系数,此处为自身系数)
62
+ -- 下蹲系数:下蹲时的系数,基于 ADS 和 自身系数
62
63
canUse = {
63
64
[" .45" ] = {
64
- { " UMP45" , 1 }, -- 基础镜 + 扩容,Bizon (基础镜即可),Vector (补偿 + 基础镜 + 扩容) | Reddot + Mag,Bizon (Reddot),Vector (Komp + Reddot + Mag)
65
- { " Tommy Gun" , 1 }, -- 扩容 | Mag
65
+ -- 枪械 模式 系数 下蹲系数
66
+ { " UMP45" , 1 , 1 , 0.8 }, -- 基础镜 + 扩容,Bizon (基础镜即可),Vector (补偿 + 基础镜 + 扩容) | Reddot + Mag,Bizon (Reddot),Vector (Komp + Reddot + Mag)
67
+ { " Tommy Gun" , 1 , 1 , 0.8 }, -- 扩容 | Mag
66
68
},
69
+ -- 枪械 模式 系数 下蹲系数
67
70
[" 9mm" ] = {
68
- { " Vector" , 1 }, -- 基础镜 + 扩容 | Reddot + Mag
69
- { " Micro UZI" , 1 }, -- 扩容 | Mag
71
+ { " Vector" , 1 , 1 , 0.8 }, -- 基础镜 + 扩容 | Reddot + Mag
72
+ { " Micro UZI" , 1 , 1 , 0.8 }, -- 扩容 | Mag
70
73
},
71
74
[" 5.56" ] = {
72
- { " M416" , 1 }, -- 补偿 + 基础镜 + 直角 + 枪托 + 扩容 | Komp + Reddot + Triangular grip + Gunstock + Mag
73
- { " SCAR-L" , 1 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
74
- { " QBZ" , 1 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
75
- { " G36C" , 1 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
76
- { " M16A4" , 2 }, -- 补偿 + 基础镜 + 枪托 + 扩容 | Komp + Reddot + Gunstock + Mag
75
+ -- 枪械 模式 系数 下蹲系数
76
+ { " M416" , 1 , 1 , 0.8 }, -- 补偿 + 基础镜 + 直角 + 枪托 + 扩容 | Komp + Reddot + Triangular grip + Gunstock + Mag
77
+ { " SCAR-L" , 1 , 1 , 0.8 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
78
+ { " QBZ" , 1 , 1 , 0.8 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
79
+ { " G36C" , 1 , 1 , 0.8 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
80
+ { " M16A4" , 2 , 1 , 0.8 }, -- 补偿 + 基础镜 + 枪托 + 扩容 | Komp + Reddot + Gunstock + Mag
77
81
},
78
82
[" 7.62" ] = {
79
- { " AKM" , 1 }, -- 补偿 + 基础镜 + 扩容 | Komp + Reddot + Mag
80
- { " Beryl M762" , 1 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
81
- { " DP-28" , 1 }, -- 基础镜 | Reddot
83
+ -- 枪械 模式 系数 下蹲系数
84
+ { " AKM" , 1 , 1 , 0.8 }, -- 补偿 + 基础镜 + 扩容 | Komp + Reddot + Mag
85
+ { " Beryl M762" , 1 , 1 , 0.8 }, -- 补偿 + 基础镜 + 直角 + 扩容 | Komp + Reddot + Triangular grip + Mag
86
+ { " DP-28" , 1 , 1 , 0.8 }, -- 基础镜 | Reddot
82
87
},
83
88
},
84
89
@@ -286,11 +291,9 @@ function pubg.isAimingState (mode)
286
291
return switch [mode ]()
287
292
end
288
293
289
- pubg [" M16A4" ] = function ()
294
+ pubg [" M16A4" ] = function (gunName )
290
295
291
- return pubg .execOptions ({
292
- ratio = 1 ,
293
- ctrlmodeRatio = 0.8 ,
296
+ return pubg .execOptions (gunName , {
294
297
interval = 108 ,
295
298
ballistic = {
296
299
{1 , 0 },
@@ -307,11 +310,9 @@ pubg["M16A4"] = function ()
307
310
308
311
end
309
312
310
- pubg [" SCAR-L" ] = function ()
313
+ pubg [" SCAR-L" ] = function (gunName )
311
314
312
- return pubg .execOptions ({
313
- ratio = 1 ,
314
- ctrlmodeRatio = 0.8 ,
315
+ return pubg .execOptions (gunName , {
315
316
interval = 96 ,
316
317
ballistic = {
317
318
{1 , 0 },
@@ -327,11 +328,9 @@ pubg["SCAR-L"] = function ()
327
328
328
329
end
329
330
330
- pubg [" Beryl M762" ] = function ()
331
+ pubg [" Beryl M762" ] = function (gunName )
331
332
332
- return pubg .execOptions ({
333
- ratio = 1 ,
334
- ctrlmodeRatio = 0.8 ,
333
+ return pubg .execOptions (gunName , {
335
334
interval = 86 ,
336
335
ballistic = {
337
336
{1 , 0 },
@@ -350,11 +349,9 @@ pubg["Beryl M762"] = function ()
350
349
351
350
end
352
351
353
- pubg [" Tommy Gun" ] = function ()
352
+ pubg [" Tommy Gun" ] = function (gunName )
354
353
355
- return pubg .execOptions ({
356
- ratio = 1 ,
357
- ctrlmodeRatio = 0.8 ,
354
+ return pubg .execOptions (gunName , {
358
355
interval = 84 ,
359
356
ballistic = {
360
357
{1 , 0 },
@@ -367,11 +364,9 @@ pubg["Tommy Gun"] = function ()
367
364
368
365
end
369
366
370
- pubg [" G36C" ] = function ()
367
+ pubg [" G36C" ] = function (gunName )
371
368
372
- return pubg .execOptions ({
373
- ratio = 1 ,
374
- ctrlmodeRatio = 0.8 ,
369
+ return pubg .execOptions (gunName , {
375
370
interval = 80 ,
376
371
ballistic = {
377
372
{1 , 0 },
@@ -386,11 +381,9 @@ pubg["G36C"] = function ()
386
381
387
382
end
388
383
389
- pubg [" Vector" ] = function ()
384
+ pubg [" Vector" ] = function (gunName )
390
385
391
- return pubg .execOptions ({
392
- ratio = 1 ,
393
- ctrlmodeRatio = 0.8 ,
386
+ return pubg .execOptions (gunName , {
394
387
interval = 55 ,
395
388
ballistic = {
396
389
{1 , 0 },
@@ -404,11 +397,9 @@ pubg["Vector"] = function ()
404
397
405
398
end
406
399
407
- pubg [" Micro UZI" ] = function ()
400
+ pubg [" Micro UZI" ] = function (gunName )
408
401
409
- return pubg .execOptions ({
410
- ratio = 1 ,
411
- ctrlmodeRatio = 0.8 ,
402
+ return pubg .execOptions (gunName , {
412
403
interval = 46 ,
413
404
ballistic = {
414
405
{1 , 0 },
@@ -423,11 +414,9 @@ pubg["Micro UZI"] = function ()
423
414
424
415
end
425
416
426
- pubg [" UMP45" ] = function ()
417
+ pubg [" UMP45" ] = function (gunName )
427
418
428
- return pubg .execOptions ({
429
- ratio = 1 ,
430
- ctrlmodeRatio = 0.8 ,
419
+ return pubg .execOptions (gunName , {
431
420
interval = 94 ,
432
421
ballistic = {
433
422
{1 , 0 },
@@ -440,11 +429,9 @@ pubg["UMP45"] = function ()
440
429
441
430
end
442
431
443
- pubg [" AKM" ] = function ()
432
+ pubg [" AKM" ] = function (gunName )
444
433
445
- return pubg .execOptions ({
446
- ratio = 1 ,
447
- ctrlmodeRatio = 0.8 ,
434
+ return pubg .execOptions (gunName , {
448
435
interval = 99 ,
449
436
ballistic = {
450
437
{1 , 0 },
@@ -460,11 +447,9 @@ pubg["AKM"] = function ()
460
447
461
448
end
462
449
463
- pubg [" M416" ] = function ()
450
+ pubg [" M416" ] = function (gunName )
464
451
465
- return pubg .execOptions ({
466
- ratio = 1 ,
467
- ctrlmodeRatio = 0.8 ,
452
+ return pubg .execOptions (gunName , {
468
453
interval = 85 ,
469
454
ballistic = {
470
455
{1 , 0 },
@@ -482,11 +467,9 @@ pubg["M416"] = function ()
482
467
483
468
end
484
469
485
- pubg [" QBZ" ] = function ()
470
+ pubg [" QBZ" ] = function (gunName )
486
471
487
- return pubg .execOptions ({
488
- ratio = 1 ,
489
- ctrlmodeRatio = 0.8 ,
472
+ return pubg .execOptions (gunName , {
490
473
interval = 87 ,
491
474
ballistic = {
492
475
{1 , 0 },
@@ -502,11 +485,9 @@ pubg["QBZ"] = function ()
502
485
503
486
end
504
487
505
- pubg [" DP-28" ] = function ()
488
+ pubg [" DP-28" ] = function (gunName )
506
489
507
- return pubg .execOptions ({
508
- ratio = 1 ,
509
- ctrlmodeRatio = 0.8 ,
490
+ return pubg .execOptions (gunName , {
510
491
interval = 100 ,
511
492
ballistic = {
512
493
{1 , 0 },
@@ -520,8 +501,23 @@ pubg["DP-28"] = function ()
520
501
521
502
end
522
503
504
+ -- [[通过枪械名查找在 canuse 中的项]]
505
+ function pubg .canUseFindByGunName (gunName )
506
+ local forList = { " .45" , " 9mm" , " 5.56" , " 7.62" }
507
+
508
+ for i = 1 , # forList do
509
+ local bulletType = forList [i ]
510
+ for j = 1 , # userInfo .canUse [bulletType ] do
511
+ local item = userInfo .canUse [bulletType ][j ]
512
+ if item [1 ] == gunName then
513
+ return item
514
+ end
515
+ end
516
+ end
517
+ end
518
+
523
519
--[[ FormatFactory ]]
524
- function pubg .execOptions (options )
520
+ function pubg .execOptions (gunName , options )
525
521
526
522
--[[
527
523
@@ -542,6 +538,8 @@ function pubg.execOptions (options)
542
538
543
539
]]
544
540
541
+ local gunInfo = pubg .canUseFindByGunName (gunName )
542
+
545
543
-- Temporary container
546
544
local ballisticConfig1 = {}
547
545
-- Temporary container (v3.0)
@@ -555,7 +553,8 @@ function pubg.execOptions (options)
555
553
end
556
554
for j = 1 , nextCount do
557
555
ballisticConfig1 [ballisticIndex ] =
558
- options .ballistic [i ][2 ] * pubg .generalSensitivityRatio * options .ratio
556
+ -- options.ballistic[i][2] * pubg.generalSensitivityRatio * options.ratio
557
+ options .ballistic [i ][2 ] * pubg .generalSensitivityRatio * gunInfo [3 ]
559
558
ballisticIndex = ballisticIndex + 1
560
559
end
561
560
end
@@ -578,7 +577,7 @@ function pubg.execOptions (options)
578
577
amount = # ballisticConfig2 , -- Number of bullets
579
578
interval = options .interval , -- Time of each bullet
580
579
ballistic = ballisticConfig2 , -- ballistic data
581
- ctrlmodeRatio = options . ctrlmodeRatio , -- Individual recoil coefficient for each gun when squatting
580
+ ctrlmodeRatio = gunInfo [ 4 ] , -- Individual recoil coefficient for each gun when squatting
582
581
}
583
582
584
583
end
@@ -602,7 +601,7 @@ function pubg.init ()
602
601
-- one series
603
602
gunCount = gunCount + 1 -- Accumulative number of firearms configuration files
604
603
pubg .gun [type ][gunCount ] = gunName -- Adding available firearms to the Arsenal
605
- pubg .gunOptions [type ][gunCount ] = pubg [gunName ]() -- Get firearms data and add it to the configuration library
604
+ pubg .gunOptions [type ][gunCount ] = pubg [gunName ](gunName ) -- Get firearms data and add it to the configuration library
606
605
607
606
-- 单独设置连发
608
607
pubg .gunOptions [type ][gunCount ].autoContinuousFiring = ({ 0 , 0 , 1 })[
@@ -1020,7 +1019,7 @@ end
1020
1019
function pubg .outputLogGunSwitchTable ()
1021
1020
local forList = { " .45" , " 9mm" , " 5.56" , " 7.62" }
1022
1021
local allCount = 0
1023
- local resStr = " canUse_i\t series_i\t Series\t Gun Name\n\n "
1022
+ local resStr = " canUse_i\t series_i\t Series\t ratio \t ctrl ratio \t Gun Name\n\n "
1024
1023
1025
1024
for i = 1 , # forList do
1026
1025
local type = forList [i ]
@@ -1032,7 +1031,7 @@ function pubg.outputLogGunSwitchTable ()
1032
1031
local tag = gunName == pubg .gun [pubg .bulletType ][pubg .gunIndex ] and " => " or " "
1033
1032
gunCount = gunCount + 1
1034
1033
allCount = allCount + 1
1035
- resStr = table.concat ({ resStr , tag , allCount , " \t " , tag , gunCount , " \t " , tag , type , " \t " , tag , gunName , " \n " })
1034
+ resStr = table.concat ({ resStr , tag , allCount , " \t " , tag , gunCount , " \t " , tag , type , " \t " , tag , userInfo . canUse [ type ][ j ][ 3 ], " \t " , tag , userInfo . canUse [ type ][ j ][ 4 ], " \t " , tag , gunName , " \n " })
1036
1035
end
1037
1036
end
1038
1037
0 commit comments