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

Function startSequence

js/script.js:1067–1107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1065let currentFinaleCount = 0;
1066//随机生成一个烟花序列
1067function startSequence() {
1068 if (isFirstSeq) {
1069 isFirstSeq = false;
1070 if (IS_HEADER) {
1071 return seqTwoRandom();
1072 } else {
1073 const shell = new Shell(crysanthemumShell(shellSizeSelector()));
1074 shell.launch(0.5, 0.5);
1075 return 2400;
1076 }
1077 }
1078
1079 if (finaleSelector()) {
1080 seqRandomFastShell();
1081 if (currentFinaleCount < finaleCount) {
1082 currentFinaleCount++;
1083 return 170;
1084 } else {
1085 currentFinaleCount = 0;
1086 return 6000;
1087 }
1088 }
1089
1090 const rand = Math.random();
1091
1092 if (rand < 0.08 && Date.now() - seqSmallBarrage.lastCalled > seqSmallBarrage.cooldown) {
1093 return seqSmallBarrage();
1094 }
1095
1096 if (rand < 0.1) {
1097 return seqPyramid();
1098 }
1099
1100 if (rand < 0.6 && !IS_HEADER) {
1101 return seqRandomShell();
1102 } else if (rand < 0.8) {
1103 return seqTwoRandom();
1104 } else if (rand < 1) {
1105 return seqTriple();
1106 }
1107}
1108
1109let activePointerCount = 0;
1110let isUpdatingSpeed = false;

Callers 1

updateGlobalsFunction · 0.85

Calls 10

launchMethod · 0.95
seqTwoRandomFunction · 0.85
crysanthemumShellFunction · 0.85
shellSizeSelectorFunction · 0.85
finaleSelectorFunction · 0.85
seqRandomFastShellFunction · 0.85
seqSmallBarrageFunction · 0.85
seqPyramidFunction · 0.85
seqRandomShellFunction · 0.85
seqTripleFunction · 0.85

Tested by

no test coverage detected