Lashtw commited on
Commit
26717c2
·
verified ·
1 Parent(s): c7aa405

Upload 2 files

Browse files
Files changed (2) hide show
  1. function.html +45 -20
  2. sequence.html +1 -0
function.html CHANGED
@@ -817,7 +817,7 @@
817
  html = `
818
  <h2 class="text-2xl md:text-3xl font-bold text-cyan-400 mb-4">核心運作法則確認</h2>
819
  <div class="text-center bg-slate-800/80 p-6 rounded-xl border border-cyan-500/30 mb-8">
820
- <div class="font-tech text-3xl md:text-6xl mb-6">
821
  <span class="text-cyan-400">y</span> = 2<span class="text-amber-400">x</span> + 3
822
  </div>
823
  <p class="text-slate-300 text-lg md:text-xl leading-relaxed font-bold">
@@ -1262,7 +1262,7 @@
1262
  </div>
1263
  </div>
1264
 
1265
- <p class="text-slate-400 italic mb-12 text-3xl max-w-4xl whitespace-nowrap">
1266
  「這就是科學家與工程師的超能力:觀察數據 <span class="text-white">→</span> 找出規則 <span class="text-white">→</span> 預測未來。」
1267
  </p>
1268
 
@@ -1511,9 +1511,17 @@
1511
  playSound('success');
1512
  // Auto verification visual
1513
  if (window.keypad) keypad.close();
1514
- addPoint(10, 35);
 
 
1515
  updateUI("預測正確!投入 10 顆晶石,電力確實為 35!<br><span class='text-amber-400 text-base'>(確認點連成一線...)</span>");
1516
 
 
 
 
 
 
 
1517
  // Disable button
1518
  const btn = document.querySelector('#dialogue-box button');
1519
  if (btn) {
@@ -1523,7 +1531,7 @@
1523
  }
1524
 
1525
  // Add guide text to look at the graph
1526
- const inputContainer = document.querySelector('#test-input-verify')?.parentElement?.parentElement;
1527
  if (inputContainer) {
1528
  const guide = document.createElement('div');
1529
  guide.className = "text-center text-green-400 font-bold mt-2 text-xl animate-pulse";
@@ -1722,16 +1730,21 @@
1722
 
1723
  if (type === 'PERFECT') {
1724
  rhythmState.energy = Math.min(100, rhythmState.energy + 10);
1725
- rhythmState.score += 500; // Efficiency Bonus
 
 
1726
  rhythmState.combo++;
1727
- spawnFloatingText("PERFECT! +10%", '#fbbf24'); // Gold
1728
  playSound('hit_perfect');
1729
  playSound('hit_perfect');
1730
  } else {
1731
- rhythmState.energy = Math.min(100, rhythmState.energy + 5);
1732
- rhythmState.score += 50; // User Request: 50 points for GOOD
 
 
 
1733
  rhythmState.combo++;
1734
- spawnFloatingText("GOOD +5%", '#22d3ee'); // Blue
1735
  playSound('hit_good');
1736
  }
1737
 
@@ -1760,19 +1773,21 @@
1760
  }
1761
 
1762
 
1763
- function addPoint(x, y) {
1764
  if (!collectedPoints.find(p => p.x === x)) {
1765
- collectedPoints.push({ x, y });
1766
  // Spawn particle effect
1767
- for (let i = 0; i < 10; i++) {
1768
- particles.push({
1769
- x: width / 2,
1770
- y: height / 2,
1771
- vx: (Math.random() - 0.5) * 10,
1772
- vy: (Math.random() - 0.5) * 10,
1773
- life: 1.0,
1774
- color: '#fbbf24'
1775
- });
 
 
1776
  }
1777
  }
1778
  }
@@ -2028,6 +2043,16 @@
2028
  ctx.strokeStyle = '#fff';
2029
  ctx.stroke();
2030
 
 
 
 
 
 
 
 
 
 
 
2031
  // Color coded coordinates: (x, y)
2032
  ctx.font = 'bold 24px Orbitron'; // Point Numbers Increased
2033
  const textY = py - 24; // Position higher up for larger font
 
817
  html = `
818
  <h2 class="text-2xl md:text-3xl font-bold text-cyan-400 mb-4">核心運作法則確認</h2>
819
  <div class="text-center bg-slate-800/80 p-6 rounded-xl border border-cyan-500/30 mb-8">
820
+ <div class="font-tech text-2xl md:text-4xl mb-6">
821
  <span class="text-cyan-400">y</span> = 2<span class="text-amber-400">x</span> + 3
822
  </div>
823
  <p class="text-slate-300 text-lg md:text-xl leading-relaxed font-bold">
 
1262
  </div>
1263
  </div>
1264
 
1265
+ <p class="text-slate-400 italic mb-12 text-2xl max-w-3xl whitespace-nowrap">
1266
  「這就是科學家與工程師的超能力:觀察數據 <span class="text-white">→</span> 找出規則 <span class="text-white">→</span> 預測未來。」
1267
  </p>
1268
 
 
1511
  playSound('success');
1512
  // Auto verification visual
1513
  if (window.keypad) keypad.close();
1514
+ // Add point without particles, but with blink
1515
+ addPoint(10, 35, false, true);
1516
+
1517
  updateUI("預測正確!投入 10 顆晶石,電力確實為 35!<br><span class='text-amber-400 text-base'>(確認點連成一線...)</span>");
1518
 
1519
+ // RESTORE INPUT VALUE because updateUI cleared it
1520
+ setTimeout(() => {
1521
+ const input = document.getElementById('ans-input');
1522
+ if (input) input.value = "35";
1523
+ }, 50);
1524
+
1525
  // Disable button
1526
  const btn = document.querySelector('#dialogue-box button');
1527
  if (btn) {
 
1531
  }
1532
 
1533
  // Add guide text to look at the graph
1534
+ const inputContainer = document.getElementById('ans-input')?.parentElement?.parentElement; // Adjusted selector
1535
  if (inputContainer) {
1536
  const guide = document.createElement('div');
1537
  guide.className = "text-center text-green-400 font-bold mt-2 text-xl animate-pulse";
 
1730
 
1731
  if (type === 'PERFECT') {
1732
  rhythmState.energy = Math.min(100, rhythmState.energy + 10);
1733
+ // Combo Bonus: +30 per combo
1734
+ const bonus = rhythmState.combo * 30;
1735
+ rhythmState.score += (500 + bonus);
1736
  rhythmState.combo++;
1737
+ spawnFloatingText(`PERFECT! +${500 + bonus}`, '#fbbf24'); // Gold
1738
  playSound('hit_perfect');
1739
  playSound('hit_perfect');
1740
  } else {
1741
+ // Fix: Good also gives 10 energy to prevent "extending game" exploit
1742
+ rhythmState.energy = Math.min(100, rhythmState.energy + 10);
1743
+ // Combo Bonus: +10 per combo
1744
+ const bonus = rhythmState.combo * 10;
1745
+ rhythmState.score += (50 + bonus);
1746
  rhythmState.combo++;
1747
+ spawnFloatingText(`GOOD +${50 + bonus}`, '#22d3ee'); // Blue
1748
  playSound('hit_good');
1749
  }
1750
 
 
1773
  }
1774
 
1775
 
1776
+ function addPoint(x, y, spawnParticles = true, blink = false) {
1777
  if (!collectedPoints.find(p => p.x === x)) {
1778
+ collectedPoints.push({ x, y, blink });
1779
  // Spawn particle effect
1780
+ if (spawnParticles) {
1781
+ for (let i = 0; i < 10; i++) {
1782
+ particles.push({
1783
+ x: width / 2,
1784
+ y: height / 2,
1785
+ vx: (Math.random() - 0.5) * 10,
1786
+ vy: (Math.random() - 0.5) * 10,
1787
+ life: 1.0,
1788
+ color: '#fbbf24'
1789
+ });
1790
+ }
1791
  }
1792
  }
1793
  }
 
2043
  ctx.strokeStyle = '#fff';
2044
  ctx.stroke();
2045
 
2046
+ // Blinking Effect (Requested)
2047
+ if (p.blink) {
2048
+ const alpha = 0.5 + 0.5 * Math.sin(Date.now() / 150);
2049
+ ctx.beginPath();
2050
+ ctx.arc(px, py, 12 + 4 * Math.sin(Date.now() / 150), 0, Math.PI * 2);
2051
+ ctx.strokeStyle = `rgba(34, 211, 238, ${alpha})`; // Cyan pulsing ring
2052
+ ctx.lineWidth = 3;
2053
+ ctx.stroke();
2054
+ }
2055
+
2056
  // Color coded coordinates: (x, y)
2057
  ctx.font = 'bold 24px Orbitron'; // Point Numbers Increased
2058
  const textY = py - 24; // Position higher up for larger font
sequence.html CHANGED
@@ -2771,6 +2771,7 @@
2771
  }
2772
 
2773
  function finishRitualAndBuild() {
 
2774
  gameState = STATE.CLIMBING;
2775
  isMagicStairsBuilt = true; // IMPORTANT: Disable gravity zone
2776
  document.getElementById('screen-ritual').classList.add('hidden');
 
2771
  }
2772
 
2773
  function finishRitualAndBuild() {
2774
+ if (window.keypad) keypad.close(); // Auto-close keypad
2775
  gameState = STATE.CLIMBING;
2776
  isMagicStairsBuilt = true; // IMPORTANT: Disable gravity zone
2777
  document.getElementById('screen-ritual').classList.add('hidden');