Module:MOS: Difference between revisions

Ganaram inukshuk (talk | contribs)
m mode_from_mos() goes by bright generators going up
Ganaram inukshuk (talk | contribs)
m Realized mode code wasn't by bright gens going up; changed to bright gens going down (based on some of frostburn's own code)
Line 173: Line 173:


-- Given a mos, return a mode based on how it's ranked by modal brightness.
-- Given a mos, return a mode based on how it's ranked by modal brightness.
-- Brightness counts down from the maximum number of generators going up (one
-- Ordering here is based on the number of bright gens going DOWN: 0 is the
-- less from the period step count), so p-1 is the brightest mode, p-2 the
-- brightest mode, 1 is 2nd brightest, etc...
-- second brightest, ... , and 0 the darkest mode.
function p.mode_from_mos(mos, bright_gens_going_down)
function p.mode_from_mos(mos, bright_gens_going_up)
return p.rotate_mode(p.brightest_mode(mos), bright_gens_going_down * p.bright_gen_step_count(mos))
return p.rotate_mode(p.brightest_mode(mos), -bright_gens_going_up * p.dark_gen_step_count(mos))
end
end