aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bluebey-studio/src/gacha.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/bluebey-studio/src/gacha.js')
-rw-r--r--public/bluebey-studio/src/gacha.js25
1 files changed, 19 insertions, 6 deletions
diff --git a/public/bluebey-studio/src/gacha.js b/public/bluebey-studio/src/gacha.js
index d689fa5..c44f80f 100644
--- a/public/bluebey-studio/src/gacha.js
+++ b/public/bluebey-studio/src/gacha.js
@@ -237,6 +237,8 @@ function rollEyes(random, spec) {
const [openMin, openMax] = spec.open;
let leftOpen = round2(rand(random, openMin, openMax));
let rightOpen = round2(clamp(leftOpen + rand(random, -0.06, 0.06), 0, 1));
+ let leftShape = 'open';
+ let rightShape = 'open';
let leftClosed = 'line';
let rightClosed = 'line';
let leftLines = 1;
@@ -245,28 +247,37 @@ function rollEyes(random, spec) {
if (spec.wink) {
const side = chance(random, 0.5) ? 'left' : 'right';
const lines = pick(random, [2, 3]);
+ // A shut eye is the artwork with the lids open now; the lid height is its own
+ // slider, so `open` is 1 and the shape says which line it is.
if (side === 'left') {
- leftOpen = 0;
+ leftOpen = 1;
leftLines = lines;
+ leftShape = `line${lines}`;
} else {
- rightOpen = 0;
+ rightOpen = 1;
rightLines = lines;
+ rightShape = `line${lines}`;
}
} else if (spec.shutBoth && chance(random, spec.shutBoth.chance)) {
- leftOpen = 0;
- rightOpen = 0;
+ leftOpen = 1;
+ rightOpen = 1;
leftClosed = spec.shutBoth.closed;
rightClosed = spec.shutBoth.closed;
leftLines = spec.shutBoth.closedLines;
rightLines = spec.shutBoth.closedLines;
+ const shape = spec.shutBoth.closed === 'line'
+ ? `line${spec.shutBoth.closedLines}`
+ : spec.shutBoth.closed;
+ leftShape = shape;
+ rightShape = shape;
}
const lookX = round2(rand(random, spec.lookX[0], spec.lookX[1]));
const lookY = round2(rand(random, spec.lookY[0], spec.lookY[1]));
return {
- left: { open: leftOpen, lookX, lookY, closed: leftClosed, closedLines: leftLines, irisShape: 'circle' },
- right: { open: rightOpen, lookX, lookY, closed: rightClosed, closedLines: rightLines, irisShape: 'circle' },
+ left: { shape: leftShape, open: leftOpen, lookX, lookY, closed: leftClosed, closedLines: leftLines, irisShape: 'circle' },
+ right: { shape: rightShape, open: rightOpen, lookX, lookY, closed: rightClosed, closedLines: rightLines, irisShape: 'circle' },
irisScale: round2(rand(random, spec.irisScale[0], spec.irisScale[1])),
lookMax: round2(rand(random, spec.lookMax[0], spec.lookMax[1])),
highlight: true,
@@ -330,6 +341,8 @@ export function randomFace(random) {
if (mood.heart && eyes.left.open >= 0.9 && eyes.right.open >= 0.9) {
eyes.left.irisShape = 'heart';
eyes.right.irisShape = 'heart';
+ eyes.left.shape = 'heart';
+ eyes.right.shape = 'heart';
eyes.heartScale = round2(rand(random, 0.9, 1.15));
eyes.heartColor = '#e0344f';
eyes.highlight = false;