This commit is contained in:
lubiana 2025-07-12 15:58:21 +02:00
parent 1bef97490d
commit a4626ada30
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
2 changed files with 14 additions and 15 deletions

View file

@ -34,7 +34,7 @@ const Card: React.FC<CardProps> = ({ card, setCard, setMoney, setGubblePoints })
className={`w-16 h-16 flex items-center justify-center rounded-lg border-2 text-2xl font-bold transition
${field.scratched ? (field.won ? 'bg-green-200 border-green-500 text-green-700' : 'bg-gray-200 border-gray-400 text-gray-500') : 'bg-yellow-100 border-yellow-400 text-yellow-700 hover:bg-yellow-200'}`}
disabled={field.scratched}
onClick={() => {
onMouseMove={() => {
if (field.scratched) return;
if (Math.random() < (card.tier?.gubblePointChance ?? 0)) {
setGubblePoints((g) => g + 1);
@ -43,9 +43,9 @@ const Card: React.FC<CardProps> = ({ card, setCard, setMoney, setGubblePoints })
// Determine win amount
let won = null;
if (card.winningNumbers.includes(field.value)) {
if (idx < 2) won = Math.floor((card.tier?.buyPrice ?? 0) * 0.5);
else if (idx < 4) won = Math.floor((card.tier?.buyPrice ?? 0) * 0.8);
else won = Math.floor((card.tier?.buyPrice ?? 0) * 1.2);
if (idx < 2) won = Math.ceil((card.tier?.buyPrice ?? 0) * 0.5);
else if (idx < 4) won = Math.ceil((card.tier?.buyPrice ?? 0) * 0.8);
else won = Math.ceil((card.tier?.buyPrice ?? 0) * 1.2);
}
setCard((prev) => {
if (!prev) return prev;