MCPcopy Create free account
hub / github.com/NianBroken/Firework_Simulator / crysanthemumShell

Function crysanthemumShell

js/script.js:588–612  ·  view source on GitHub ↗
(size = 1)

Source from the content-addressed store, hash-verified

586
587// 唯一的 shell 类型
588const crysanthemumShell = (size = 1) => {
589 const glitter = Math.random() < 0.25;
590 const singleColor = Math.random() < 0.72;
591 const color = singleColor ? randomColor({ limitWhite: true }) : [randomColor(), randomColor({ notSame: true })];
592 const pistil = singleColor && Math.random() < 0.42;
593 const pistilColor = pistil && makePistilColor(color);
594 const secondColor = singleColor && (Math.random() < 0.2 || color === COLOR.White) ? pistilColor || randomColor({ notColor: color, limitWhite: true }) : null;
595 const streamers = !pistil && color !== COLOR.White && Math.random() < 0.42;
596 let starDensity = glitter ? 1.1 : 1.25;
597 if (isLowQuality) starDensity *= 0.8;
598 if (isHighQuality) starDensity = 1.2;
599 return {
600 shellSize: size,
601 spreadSize: 300 + size * 100,
602 starLife: 900 + size * 200,
603 starDensity,
604 color,
605 secondColor,
606 glitter: glitter ? "light" : "",
607 glitterColor: whiteOrGold(),
608 pistil,
609 pistilColor,
610 streamers,
611 };
612};
613
614const ghostShell = (size = 1) => {
615 // Extend crysanthemum shell

Callers 2

ghostShellFunction · 0.85
startSequenceFunction · 0.85

Calls 3

randomColorFunction · 0.85
makePistilColorFunction · 0.85
whiteOrGoldFunction · 0.85

Tested by

no test coverage detected