noita-tools icon indicating copy to clipboard operation
noita-tools copied to clipboard

Suggestion - show a string of success/fail for perk duplication violations

Open necauqua opened this issue 8 months ago • 2 comments

In scripts/magic/null_room/check.lua, the "coin flip" for if you get permanently polymorphed/cessated if you're in a parallel world is entirely seed-dependent:

local in_parallel_worlds = true
local par_x, par_y = GetParallelWorldPosition( pos_x, pos_y )
if( par_x == 0 and par_y == 0 ) then in_parallel_worlds = false end

-- 50% chance of perma polymorph in parallel worlds
if( in_parallel_worlds ) then

	local par_poly_violations = tonumber(GlobalsGetValue("PARALLEL_POLYMORPH_VIOLATIONS", "0"))
	SetRandomSeed( 64687, par_poly_violations )
	-- 50% chance of perma polymorph
	if( Random( 1, 100 ) <= 50 ) then
		permapolymorph_entity( entity_id )
		message = "$logdesc_gods_are_very_angry"
		steve_file = "data/entities/animals/sheep.xml"
	end

	par_poly_violations = par_poly_violations + 1
	GlobalsSetValue( "PARALLEL_POLYMORPH_VIOLATIONS", tostring( par_poly_violations ) )
end

I've actually looked through all seeds and found one with 33 consecutive successes - 302690999 (unverified, could've hit an edge case in my noita rng impl?. but statistically 33 consecutive coinflips over 2^32 seeds does check out).

It seems that it would be trivial to show this information in noitool, as a list of success/failure, or maybe with a counter (for how many times you did it) or something.

necauqua avatar Mar 24 '25 18:03 necauqua

That's awesome! I'm not actively developing Noitool, but still maintaining it.

Is that something that you can implement? I'll happily do a code review and merge the thing. (Reach out if you need any assistance!)

TwoAbove avatar Mar 25 '25 02:03 TwoAbove

Yeah I'm interested, but it might be a while as I'm allocating all of my (not that large currently sadly) free time budget into hopefully finally launching twitch plays noita 🙃

necauqua avatar Apr 01 '25 23:04 necauqua