Skip to content

Commit 5bab4d3

Browse files
authored
Level satış hedefleri ürün adedi bazlı: hamburger, patates, kola
1 parent eb60215 commit 5bab4d3

1 file changed

Lines changed: 34 additions & 13 deletions

File tree

‎index.html‎

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
#introOv ul,#endOv ul{list-style:none;padding:0;margin:10px 0;text-align:left;font-weight:700}
150150
#introOv li,#endOv li{display:flex;justify-content:space-between;gap:10px;padding:4px 2px;border-bottom:1px dashed #ead9bb}
151151
#introOv li::before{content:'•';color:#e2463b;margin-right:2px}
152+
#introOv li.need{color:#a0603a;font-size:13px;border-bottom:0}#introOv li.need::before{content:'!';color:#c98a00}
152153
#introOv .rule{background:#2d1f14;color:#ffd34d;border-radius:10px;padding:6px 10px;font-weight:800;margin-top:6px}
153154
.bigstars{font-size:54px;letter-spacing:6px;margin:6px 0;color:#e3d3b3}
154155
.bigstars span{display:inline-block;transform:scale(0);transition:transform .35s cubic-bezier(.3,1.6,.5,1)}
@@ -1256,20 +1257,27 @@ <h2>Duraklatıldı</h2>
12561257
// Her levelde: bu levelde kazanılacak para (earn), teslim edilecek sipariş (sales) ve kaçabilecek en fazla müşteri (lostMax).
12571258
// Süre 5 dakika; hedefler bitince level kazanılır, süre biterse ya da kaçan müşteri sınırı aşılırsa kaybedilir.
12581259
const LEVELS = [
1259-
{ id: 'C1', name: 'Açılış günü', goals: [{ t: 'earn', n: 600 }, { t: 'sales', n: 15 }], lostMax: 8, stars: [1100, 1300] },
1260-
{ id: 'C2', name: 'İlk müdavimler', goals: [{ t: 'earn', n: 1800 }, { t: 'sales', n: 45 }], lostMax: 8, stars: [2600, 3050] },
1261-
{ id: 'C3', name: 'Ekip kuruyoruz', goals: [{ t: 'earn', n: 2600 }, { t: 'sales', n: 55 }], lostMax: 7, stars: [3050, 3600] },
1262-
{ id: 'C4', name: 'Masalar doluyor', goals: [{ t: 'earn', n: 3000 }, { t: 'sales', n: 70 }], lostMax: 6, stars: [3750, 4400] },
1263-
{ id: 'C5', name: 'Öğle telaşı', goals: [{ t: 'earn', n: 3600 }, { t: 'sales', n: 85 }], lostMax: 5, stars: [3900, 4600] },
1264-
{ id: 'C6', name: 'Patates kokusu', goals: [{ t: 'earn', n: 4000 }, { t: 'sales', n: 90 }], lostMax: 5, stars: [4650, 5450] },
1265-
{ id: 'C7', name: 'Soğuk kola', goals: [{ t: 'earn', n: 5000 }, { t: 'sales', n: 100 }], lostMax: 4, stars: [5850, 6900] },
1266-
{ id: 'C8', name: 'Büyük salon', goals: [{ t: 'earn', n: 6000 }, { t: 'sales', n: 110 }], lostMax: 3, stars: [6550, 7700] },
1267-
{ id: 'C9', name: 'Hız ustaları', goals: [{ t: 'earn', n: 7000 }, { t: 'sales', n: 125 }], lostMax: 3, stars: [7350, 8650] },
1268-
{ id: 'C10', name: 'Efsane gün', goals: [{ t: 'earn', n: 8000 }, { t: 'sales', n: 140 }], lostMax: 2, stars: [8550, 10050] }
1260+
{ id: 'C1', name: 'Açılış günü', goals: [{ t: 'earn', n: 600 }, { t: 'sell', item: 'burger', n: 10 }], lostMax: 8, stars: [1100, 1300] },
1261+
{ id: 'C2', name: 'İlk müdavimler', goals: [{ t: 'earn', n: 1800 }, { t: 'sell', item: 'burger', n: 25 }], lostMax: 8, stars: [2700, 3200] },
1262+
{ id: 'C3', name: 'Patates zamanı', goals: [{ t: 'earn', n: 2600 }, { t: 'sell', item: 'burger', n: 35 }, { t: 'sell', item: 'fries', n: 10 }], lostMax: 7, stars: [3600, 4250] },
1263+
{ id: 'C4', name: 'Ekip kuruyoruz', goals: [{ t: 'earn', n: 3000 }, { t: 'sell', item: 'burger', n: 45 }, { t: 'sell', item: 'fries', n: 20 }], lostMax: 6, stars: [3350, 3950] },
1264+
{ id: 'C5', name: 'Soğuk kola', goals: [{ t: 'earn', n: 3600 }, { t: 'sell', item: 'burger', n: 55 }, { t: 'sell', item: 'fries', n: 25 }, { t: 'sell', item: 'cola', n: 10 }], lostMax: 5, stars: [4250, 5000] },
1265+
{ id: 'C6', name: 'Öğle telaşı', goals: [{ t: 'earn', n: 4000 }, { t: 'sell', item: 'burger', n: 60 }, { t: 'sell', item: 'fries', n: 30 }, { t: 'sell', item: 'cola', n: 15 }], lostMax: 5, stars: [5550, 6500] },
1266+
{ id: 'C7', name: 'Masalar doluyor', goals: [{ t: 'earn', n: 5000 }, { t: 'sell', item: 'burger', n: 70 }, { t: 'sell', item: 'fries', n: 35 }, { t: 'sell', item: 'cola', n: 25 }], lostMax: 4, stars: [6300, 7450] },
1267+
{ id: 'C8', name: 'Büyük salon', goals: [{ t: 'earn', n: 6000 }, { t: 'sell', item: 'burger', n: 80 }, { t: 'sell', item: 'fries', n: 45 }, { t: 'sell', item: 'cola', n: 30 }], lostMax: 3, stars: [6700, 7850] },
1268+
{ id: 'C9', name: 'Hız ustaları', goals: [{ t: 'earn', n: 7000 }, { t: 'sell', item: 'burger', n: 90 }, { t: 'sell', item: 'fries', n: 50 }, { t: 'sell', item: 'cola', n: 35 }], lostMax: 3, stars: [7500, 8800] },
1269+
{ id: 'C10', name: 'Efsane gün', goals: [{ t: 'earn', n: 8000 }, { t: 'sell', item: 'burger', n: 100 }, { t: 'sell', item: 'fries', n: 60 }, { t: 'sell', item: 'cola', n: 45 }], lostMax: 2, stars: [8900, 10450] }
12691270
];
12701271
const LEVEL_BY_ID = Object.fromEntries(LEVELS.map(l => [l.id, l]));
12711272
const ITEM_NAMES = { burger: 'hamburger', fries: 'patates', cola: 'kola' };
12721273
const BUY_TEXT = { shop_01: 'Dükkânı aç', grill_01: 'Izgarayı kur', waiter_01: 'Servis elemanı al', cook_01: 'Aşçı al', garcon: 'Garson al', fryer: 'Patates makinesi kur', fridge: 'Kola dolabı kur', expansion_01: 'Restoranı genişlet', grill_02: 'İkinci ızgarayı kur', cook_02: 'İkinci aşçıyı al', queue_02: 'Bekleme alanını büyüt' };
1274+
// Bir ürünü satabilmek için eksik yatırımlar (önce alınması gerekenler başta)
1275+
const ITEM_UNLOCK = { fries: 'fryer', cola: 'fridge' };
1276+
function missingFor(s, item) {
1277+
const out = [], walk = id => { if (done(s, id) || out.includes(id)) return; const u = UNLOCK_BY_ID[id]; if (!u) return; for (const p of (u.pre || [])) walk(p); out.push(id); };
1278+
if (ITEM_UNLOCK[item]) walk(ITEM_UNLOCK[item]);
1279+
return out;
1280+
}
12731281
const fmtN = n => String(Math.round(n)).replace(/\B(?=(\d{3})+(?!\d))/g, '.');
12741282
function goalInfo(s, g) {
12751283
const lv = s.lv || { sales: 0, earned: 0, fast: 0, maxCombo: 0, sold: emptyInv() };
@@ -1434,7 +1442,7 @@ <h2>Duraklatıldı</h2>
14341442
createGame, serialize, step, getTask, zoneState, getLayout, applyLayout, resetActors, DEFAULT_LAYOUT,
14351443
setDefaults, fryTime, testSave, setRole, moveRole, roleCounts, fryerCap, bufferCap, queueCap, carryCap, cookTime, staffSpeed, hypeBoost, costOf, lvl, maxLevel, maxed, done, prereqsMet,
14361444
front, onPad, inZone, needs, waitingDiners, invTotal,
1437-
obstacles, LEVELS, LEVEL_BY_ID, levelSave, carrySave, lostIn, goalInfo, levelScore, starsFor,
1445+
obstacles, LEVELS, LEVEL_BY_ID, levelSave, carrySave, lostIn, missingFor, goalInfo, levelScore, starsFor,
14381446
ITEMS, colaCap, colaTime, menuItems, severance, canFire, fireStaff, staffCounts, had, priceOf
14391447
};
14401448
if (typeof module !== 'undefined' && module.exports) module.exports = api; else root.Game = api;
@@ -2055,7 +2063,8 @@ <h2>Duraklatıldı</h2>
20552063
$('inTitle').textContent = `Level ${levelLabel(L)} · ${L.name}`;
20562064
$('inRule').innerHTML = `<div class="rule">${K ? `En fazla ${K} müşteri kaçabilir; ${K + 1}. müşteri kaçarsa level biter.` : 'Hiç müşteri kaçmamalı: biri bile kızıp giderse level biter.'}</div>`
20572065
+ (replay ? `<p class="thr">Bu leveli tekrar oynuyorsun: levelin başındaki restoranla başlarsın.${nx && (prog.stars[nx.id] || 0) >= 1 ? ' Sonraki levellerdeki restoranın değişmez.' : ''}</p>` : (prevLevel(L) ? '<p class="thr">Restoranın önceki levelden olduğu gibi devam ediyor.</p>' : ''));
2058-
$('inGoals').innerHTML = L.goals.map(g => `<li><span>${G.goalInfo(tmp, g).text}</span></li>`).join('') + `<li><span>Süre</span><b>${mins} dakika</b></li><li><span>Kaçabilecek müşteri</span><b>en fazla ${K}</b></li><li><span>Başlangıç parası</span><b>${fmt(tmp.wallet)} ₺</b></li>`;
2066+
$('inGoals').innerHTML = L.goals.map(g => `<li><span>${G.goalInfo(tmp, g).text}</span></li>`).join('') + `<li><span>Süre</span><b>${mins} dakika</b></li><li><span>Kaçabilecek müşteri</span><b>en fazla ${K}</b></li><li><span>Başlangıç parası</span><b>${fmt(tmp.wallet)} ₺</b></li>`
2067+
+ needList(tmp, L).map(n => `<li class="need"><span>${ITEM_TR[n.item][0].toLocaleUpperCase('tr-TR') + ITEM_TR[n.item].slice(1)} için alman gerekenler: ${n.ids.map(id => G.UNLOCK_BY_ID[id].name).join(' → ')}</span></li>`).join('');
20592068
$('inThr').textContent = `Hedefleri bitir: ★ · ${fmt(L.stars[0])} puan: ★★ · ${fmt(L.stars[1])} puan: ★★★` + (prog.best[id] ? ` · En iyin: ${fmt(prog.best[id])}` : '');
20602069
$('introOv').hidden = false;
20612070
}
@@ -2104,6 +2113,18 @@ <h2>Duraklatıldı</h2>
21042113
$('goalsHead').onclick = toggleGoals;
21052114
$('goalsHead').addEventListener('keydown', e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggleGoals(); } });
21062115
applyGoalsMin();
2116+
// Hedefteki ürün henüz satılamıyorsa (fritöz/kola dolabı yoksa) ne alınması gerektiğini söyle
2117+
const ITEM_TR = { burger: 'hamburger', fries: 'patates', cola: 'kola' };
2118+
function needList(s, L) {
2119+
const out = [];
2120+
for (const g of L.goals) if (g.t === 'sell') { const m = G.missingFor(s, g.item); if (m.length) out.push({ item: g.item, ids: m }); }
2121+
return out;
2122+
}
2123+
function needHint(s, L) {
2124+
const n = needList(s, L)[0]; if (!n) return '';
2125+
const u = G.UNLOCK_BY_ID[n.ids[0]];
2126+
return `İpucu: ${ITEM_TR[n.item]} satmak için ${n.ids.length > 1 ? 'önce ' : ''}${u.name} al (${fmt(G.costOf(s, u))} ₺)` + (n.ids.length > 1 ? `, sonra ${n.ids.slice(1).map(id => G.UNLOCK_BY_ID[id].name).join(', ')}` : '');
2127+
}
21072128
const mmss = sec => { sec = Math.max(0, Math.ceil(sec)); return Math.floor(sec / 60) + ':' + String(sec % 60).padStart(2, '0'); };
21082129
function newGame() { if (TEST_MODE) { restartTest(); return; } clearSave(); location.hash = ''; resetWorld(); }
21092130
$('pRetry').onclick = () => { if (S.lv) { togglePause(false); openIntro(S.lv.id); } };
@@ -2394,7 +2415,7 @@ <h2>Duraklatıldı</h2>
23942415
if (bar.dataset.id !== L.id) { bar.dataset.id = L.id; bar.innerHTML = `<i></i><s data-s="★★" style="left:${(L.stars[0] / max * 100).toFixed(1)}%"></s><s data-s="★★★" style="left:${(L.stars[1] / max * 100).toFixed(1)}%"></s>`; bar.dataset.max = max; }
23952416
bar.querySelector('i').style.width = Math.min(100, sc / +bar.dataset.max * 100).toFixed(1) + '%';
23962417
$('scoreTxt').textContent = `Şimdi bitirsen ${fmt(sc)} puan`;
2397-
$('hint').textContent = task && task.key !== 'done' ? 'İpucu: ' + task.text : '';
2418+
$('hint').textContent = needHint(S, L) || (task && task.key !== 'done' ? 'İpucu: ' + task.text : '');
23982419
}
23992420
// Kasada biriken para ve kombo
24002421
const pc = $('pileChip'); pc.hidden = !G.done(S, 'grill_01');

0 commit comments

Comments
 (0)