STEAM 组
Payday 2 Mechanics PD2mech
STEAM 组
Payday 2 Mechanics PD2mech
10
游戏中
79
在线
成立于
2015 年 9 月 27 日
所有讨论 > 综合讨论 > 主题详情
Ludor Experiens 2016 年 10 月 20 日 上午 6:03
Drill restarter chance
Did some digging in the lua code and found that the chance for an autorepair is evaluated every time the drill is upgraded as "Drill:set_skill_upgrades(upgrades)" should be called every time that happens.

First this happens:
local auto_repair_level_1 = upgrades.auto_repair_level_1 or 0
local auto_repair_level_2 = upgrades.auto_repair_level_2 or 0
local current_auto_repair_level_1 = self._skill_upgrades.auto_repair_level_1 or 0
local current_auto_repair_level_2 = self._skill_upgrades.auto_repair_level_2 or 0

Further down this happens if one of the local variables above is greater than 0

upgrades.auto_repair_level_1 = current_auto_repair_level_1
upgrades.auto_repair_level_2 = current_auto_repair_level_2
local drill_autorepair_chance = 0

if auto_repair_level_1 > current_auto_repair_level_1 then
current_auto_repair_level_1 = auto_repair_level_1
upgrades.auto_repair_level_1 = auto_repair_level_1
end

if auto_repair_level_2 > current_auto_repair_level_2 then
current_auto_repair_level_2 = auto_repair_level_2
upgrades.auto_repair_level_2 = auto_repair_level_2
end

if current_auto_repair_level_1 > 0 then
drill_autorepair_chance = drill_autorepair_chance + tweak_data.upgrades.values.player.drill_autorepair_2[1]
end

if current_auto_repair_level_2 > 0 then
drill_autorepair_chance = drill_autorepair_chance + tweak_data.upgrades.values.player.drill_autorepair_1[1]
end

if Network:is_server() and drill_autorepair_chance > math.random() then
self:set_autorepair(true)
end

So what I get out of it is that if a drill has already upgraded autorepair1 and/or autorepair2, the autorepair chance is evaluated once again if another upgrade happens. And it can only become an autorepair drill not the other way around.

Therefore the way to have the best chance for an autorestarter should be if the drill gets upgraded by players who have the skills in this order:
1. Kickstarter Basic(+20%; 0.2 restart chance so far)
2. Hardware Expert Ace (+10%; 0.2 + 0.8*0.3 = 0.44 restart chance so far)
3. Drill Sawgeant Basic (+0%; 0.2 + 0.8*0.3 + 0.8*0.7*0.3 = 0.608 restart chance so far)
4. Drill Sawgeant Ace (+0%; 0.2 + 0.8*0.3 + 0.8*0.7*0.3 + 0.8*0.7*0.7*0.3 = 0.7256 restart chance)

So it is possible to have a chance of 73% that a drill restarts if you upgrade in that order with 4 players. Usefullness is questionable as it takes around 33 seconds to perform that action for every drill.

Confirmations and counters are welcome.
最后由 Ludor Experiens 编辑于; 2016 年 10 月 20 日 上午 6:09
< >
正在显示第 1 - 7 条,共 7 条留言
Frankelstner 2016 年 10 月 20 日 上午 10:34 
function Drill:set_autorepair(state) if self._skill_upgrades.auto_repair_level_1 and self._skill_upgrades.auto_repair_level_1 > 0 or self._skill_upgrades.auto_repair_level_2 and 0 < self._skill_upgrades.auto_repair_level_2 then return end
The chance is evaluated, but it has no effect when the icon appears on the drill display.

Is this intended? Well, both you and me (a long time ago) initially thought that it would be evaluated each time. I bet the devs don't even realize that. Though removing that block would apply the chance on each (manual) repair.

Though not documented (or is it?), you can write code and /code in brackets to make code blocks.
最后由 Frankelstner 编辑于; 2016 年 10 月 20 日 上午 10:40
Ludor Experiens 2016 年 10 月 20 日 上午 10:44 
Guess I didn't dig deep enough. Thanks for the clarification.
Frankelstner 2016 年 10 月 20 日 上午 10:54 
IIRC I missed that part as well in the code, but I wanted to be sure about the info (as anywhere in the guide): I added some log function calls to see in real time which lines were actually executed. Then I placed a drill with 0% chance and a fake skill level of basic, and upgraded it with a 100% chance and a fake skill level of aced. And that's how I noticed that part; it really looks like some unsuspicious sanity check.
Ludor Experiens 2016 年 10 月 20 日 上午 11:32 
One thing for the guide that at least misled a friend of mine: You only talk about 10% restart chance and 30%. But 20% is also possible. This led my friend to believe that Kickstarter Basic overrides Hardware Expert Ace and makes it a waste of points when you can get drill sawgeant basic for less in order to climb to Kickstarter.
blinya 2016 年 11 月 14 日 上午 10:05 
By default, without skills, theres 20% chance for autorestart drill?
Then with Hardware Expert Ace this chance downgrades to 10%?
And with Kickstarter Basic goes up to 30%?
Ludor Experiens 2016 年 11 月 14 日 下午 1:52 
@blinya

Not really.
Hardware Expert Ace (shortened to HEA): +10%
Kickstarter Basic (shortened to KB): +20%

So there are 4 possibiliteis:

No HEA, no KB: 0%
HEA, no KB: 10%
No HEA, KB: 20%
HEA,KB: 30%
最后由 Ludor Experiens 编辑于; 2016 年 11 月 14 日 下午 1:54
blinya 2016 年 11 月 15 日 上午 6:05 
Thank you.
I love to create silly questions.
< >
正在显示第 1 - 7 条,共 7 条留言
每页显示数: 1530 50

所有讨论 > 综合讨论 > 主题详情