Рет қаралды 326
This script looks for four types of mogus "tall" facing right, "tall facing left", "short facing right", and "short facing left"
In order to find these, it checks each pixel group against a filter, an example filter is:
(5,5,0,0,0),
(5,0,2,2,2),
(0,2,2,1,1),
(0,2,2,2,2),
(0,3,2,3,2),
(5,0,2,0,2)
0 is background, 1 is visor, 2 is body, 3 isn't checked (can be body or background) and 5 is not checked (but different from 3 rendering purposes)
This filter is used with certain rules, some of which have leniency and can result in "defects", although certain rules are absolute
Absolute rules include
- visor pixels must all be the same color
- main body color must not be visor color
- main body must not be part of another mogus
Rules that have leniency and can result in defects include the following
- background must not contain the body color (results in background defect)
* background can contain body color if it is part of another mogus without defect to allow for chains
- body must not contain other colors than the main one (results in mogus defect)
- body defects must be less than 2 and background defects less than 2 in order to be counted
We check for the larger mogi first, because with the 3s in that upper filter we could find a smol mogus inside of a big one, and then the big one wouldn't count as big