User prompt
envanter içinde yazılar daha belirgin olsun envanter yazısı kaldır envanter arka planı daha siyah daha koyu olsun
User prompt
müşteri yaptığım teklife karşı başka bir teklif yapabilsin yada reddete bilir yada kabul edebilir. sağ alttaki kutuya bastınca envanter çıksın küçük envanter yazısı kaldır pazarlık et kısmına hatalarımızı düzeltmek için bişeyler koy
User prompt
envanter kısmını bir kutucuk yap sağ en alta alınan ürünler orada gözüksün pazarlık et kısmını düzelt toplama çıkarma ve enter olsun
User prompt
oyunu baştan başlat
User prompt
büyük oe satış yapabilsin müşteriler ürün alsın envanter bölümü olsun
User prompt
oyunun bir sonu olmasın oyuncu ne kadar oynamak isterse
User prompt
çalıntı mal geldi bildirimi tam gözükmüyor bu bildirim küçük oenin hemen altında çıksın
User prompt
müşteri yazılan şeyi engeliyor onu düzelt aynı zamanda pazarlık et kısmını düzenle büyük oe satışta yapabilsin polis için yanlış alrm olunca 5 değil 2 itibar kes alım yapınca artı itibar verme
User prompt
tezgahın arkasına küçük oe
User prompt
küçük oe yi eski yerine koy
User prompt
küçük oe tezgahın biraz daha arkasına aynı zamanda biraz daha sağ tarafa geçsin
User prompt
küçük oe tezgahın arkasında olsun gün içinde yeteli müşteri geldikten sonra sonraki güne geç
User prompt
müşteri geride olsun biraz küçük oe 10 kare daha geride olsun pazarlık et bölümüne yanlış teklif olabileceği için çıkarma işlemi koy paramız 100 dolar olsun
User prompt
tur yazısını kaldır günlük gelicek müşteri sayısı itibara göre olsun itibar 10 dan başlasın pazarlık et boşluğuna çıkarma yapmak için buton ekle büyük oe küçük oe ve müşteri yazıları ekle 1000 dolar fazla 100 dolardan başla ürünlerin enderlikleri olsun müşteriler sözlü diyolaglar ekle mesela bu ürün için 55 dolar istiyorum gibi pazarlık yapsınlar küçük oe biraz daha arkada bulunsun
User prompt
oyunuda türkçe yap
Code edit (1 edits merged)
Please save this source code
User prompt
Antika Shop: Big OE & Little OE
Initial prompt
antika alım satımı yapan büyük OE ve onun oğlu küçük oe insanlar dükkana gelerek antikalar satmaya çalışır pazarlık edilebilmektedir bunun için pazarlık et kabul et reddet gibi alanlar yap pazarlık et bölümüne bir boşluk daha koyki rakam yazabilelim büyük oe hem alış hemde satış yapabilsinki işini büyütsün arada sırada çakma ürünler getirsin dükkana hemde arada sırada çalıntı ürünler gelsin dükkan küçük oe bunu farkedebilsin ve polis i arabilelim
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var AntiqueItem = Container.expand(function () {
var self = Container.call(this);
self.init = function (name, baseValue, isCounterfeit, isStolen) {
self.itemName = name;
self.baseValue = baseValue;
self.isCounterfeit = isCounterfeit || false;
self.isStolen = isStolen || false;
self.customerPrice = Math.floor(baseValue * (0.3 + Math.random() * 0.4));
var itemGraphics = self.attachAsset('antique', {
anchorX: 0.5,
anchorY: 0.5
});
if (self.isCounterfeit) {
itemGraphics.tint = 0xFF0000;
} else if (self.isStolen) {
itemGraphics.tint = 0x800080;
}
return self;
};
return self;
});
var Button = Container.expand(function () {
var self = Container.call(this);
self.init = function (text, x, y, callback) {
self.callback = callback;
var buttonBg = self.attachAsset('buttonBG', {
anchorX: 0.5,
anchorY: 0.5
});
self.buttonText = new Text2(text, {
size: 40,
fill: 0xFFFFFF
});
self.buttonText.anchor.set(0.5, 0.5);
self.addChild(self.buttonText);
self.x = x;
self.y = y;
return self;
};
self.down = function (x, y, obj) {
if (self.callback) {
self.callback();
}
};
return self;
});
var Character = Container.expand(function () {
var self = Container.call(this);
self.init = function (type, x, y) {
self.characterType = type;
var characterGraphics = self.attachAsset(type, {
anchorX: 0.5,
anchorY: 1.0
});
self.x = x;
self.y = y;
return self;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2F4F4F
});
/****
* Game Code
****/
// Game state variables - Reset to initial values
var currentPlayer = 'bigOE'; // 'bigOE' or 'littleOE'
var gamePhase = 'waiting'; // 'waiting', 'negotiating', 'inputting', 'selling'
var money = 100;
var reputation = 10;
var dailyCustomerCount = 0;
var maxDailyCustomers = Math.floor(reputation / 10) + 1;
var currentCustomer = null;
var currentAntique = null;
var negotiationRound = 0;
var maxNegotiationRounds = 3;
var customPriceInput = '';
var inventory = [];
var isSelling = false;
var sellingPrice = 0;
// Antique types with base values
var antiqueTypes = [{
name: 'Antika Vazo',
baseValue: 150,
rarity: 'yaygın'
}, {
name: 'Eski Tablo',
baseValue: 300,
rarity: 'nadir'
}, {
name: 'Antika Saat',
baseValue: 250,
rarity: 'orta'
}, {
name: 'Mücevher Kutusu',
baseValue: 180,
rarity: 'yaygın'
}, {
name: 'Nadir Kitap',
baseValue: 120,
rarity: 'yaygın'
}, {
name: 'Çini Takımı',
baseValue: 220,
rarity: 'orta'
}, {
name: 'Gümüş Şamdan',
baseValue: 160,
rarity: 'yaygın'
}, {
name: 'Antika Lamba',
baseValue: 140,
rarity: 'yaygın'
}, {
name: 'Antika Kılıç',
baseValue: 500,
rarity: 'çok nadir'
}, {
name: 'Roma Heykeli',
baseValue: 800,
rarity: 'efsanevi'
}];
// UI Elements
var shopBackground = game.attachAsset('shopBackground', {
x: 0,
y: 0
});
var counterTop = game.attachAsset('counterTop', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1800
});
// Characters
var bigOEChar = game.addChild(new Character().init('bigOE', 800, 1700));
var littleOEChar = game.addChild(new Character().init('littleOE', 1200, 1900));
var customerChar = null;
var antiqueDisplay = null;
// Character labels
var bigOELabel = game.addChild(new Text2('Büyük OE', {
size: 40,
fill: 0xFFFFFF
}));
bigOELabel.anchor.set(0.5, 0);
bigOELabel.x = 800;
bigOELabel.y = 1500;
var littleOELabel = game.addChild(new Text2('Küçük OE', {
size: 40,
fill: 0xFFFFFF
}));
littleOELabel.anchor.set(0.5, 0);
littleOELabel.x = 1200;
littleOELabel.y = 1700;
var customerLabel = game.addChild(new Text2('', {
size: 40,
fill: 0xFFFFFF
}));
customerLabel.anchor.set(0.5, 0);
customerLabel.x = 1024;
customerLabel.y = 1150;
// UI Text elements
var moneyText = game.addChild(new Text2('Para: $' + money, {
size: 60,
fill: 0xFFFFFF
}));
moneyText.x = 100;
moneyText.y = 200;
var reputationText = game.addChild(new Text2('İtibar: ' + reputation, {
size: 60,
fill: 0xFFFFFF
}));
reputationText.x = 100;
reputationText.y = 300;
var playerText = game.addChild(new Text2('Oynayan: Büyük OE', {
size: 80,
fill: 0xFFD700
}));
playerText.anchor.set(0.5, 0);
playerText.x = 1024;
playerText.y = 400;
var infoText = game.addChild(new Text2('Müşteri bekleniyor...', {
size: 50,
fill: 0xFFFFFF
}));
infoText.anchor.set(0.5, 0);
infoText.x = 1024;
infoText.y = 600;
var negotiationText = game.addChild(new Text2('', {
size: 45,
fill: 0xFFFF00
}));
negotiationText.anchor.set(0.5, 0);
negotiationText.x = 1024;
negotiationText.y = 800;
var customPriceText = game.addChild(new Text2('', {
size: 40,
fill: 0x00FF00
}));
customPriceText.anchor.set(0.5, 0);
customPriceText.x = 1024;
customPriceText.y = 1000;
var stolenGoodsNotification = game.addChild(new Text2('', {
size: 35,
fill: 0xFF0000
}));
stolenGoodsNotification.anchor.set(0.5, 0);
stolenGoodsNotification.x = 1200;
stolenGoodsNotification.y = 1950;
stolenGoodsNotification.visible = false;
// Inventory box in bottom right corner
var inventoryBox = game.attachAsset('customerArea', {
anchorX: 1.0,
anchorY: 1.0,
x: 2048,
y: 2732,
scaleX: 0.8,
scaleY: 0.6
});
inventoryBox.tint = 0x333333;
// Make inventory box clickable
inventoryBox.down = function (x, y, obj) {
showFullInventory();
};
var fullInventoryDisplay = game.addChild(new Text2('', {
size: 35,
fill: 0xFFFFFF
}));
fullInventoryDisplay.anchor.set(0.5, 0.5);
fullInventoryDisplay.x = 1024;
fullInventoryDisplay.y = 1366;
fullInventoryDisplay.visible = false;
var inventoryOverlay = game.attachAsset('shopBackground', {
x: 0,
y: 0,
alpha: 0.8
});
inventoryOverlay.tint = 0x000000;
inventoryOverlay.visible = false;
// Make overlay clickable to close inventory
inventoryOverlay.down = function (x, y, obj) {
hideFullInventory();
};
// Buttons
var acceptButton = game.addChild(new Button().init('Kabul Et', 400, 2200, acceptDeal));
var rejectButton = game.addChild(new Button().init('Reddet', 800, 2200, rejectDeal));
var bargainButton = game.addChild(new Button().init('Pazarlık Et', 1200, 2200, startBargaining));
var callPoliceButton = game.addChild(new Button().init('Polis Çağır', 1600, 2200, callPolice));
// Number input buttons
var numberButtons = [];
var inputRow1Y = 2400;
var inputRow2Y = 2500;
var clearButton = game.addChild(new Button().init('Temizle', 200, 2600, clearInput));
var subtractButton = game.addChild(new Button().init('-', 400, 2600, subtractFromInput));
var addButton = game.addChild(new Button().init('+', 600, 2600, addToInput));
var submitButton = game.addChild(new Button().init('Enter', 800, 2600, submitCustomPrice));
var sellButton = game.addChild(new Button().init('Sat', 1000, 2200, startSelling));
var inventoryButton = game.addChild(new Button().init('Envanter', 400, 2300, showInventory));
// Create number buttons 1-9 and 0
for (var i = 1; i <= 9; i++) {
var x = 200 + (i - 1) % 3 * 200;
var y = inputRow1Y + Math.floor((i - 1) / 3) * 100;
numberButtons.push(game.addChild(new Button().init(i.toString(), x, y, createNumberHandler(i.toString()))));
}
numberButtons.push(game.addChild(new Button().init('0', 400, inputRow2Y + 100, createNumberHandler('0'))));
// Hide UI initially
hideNegotiationUI();
hideInputUI();
function createNumberHandler(digit) {
return function () {
if (gamePhase === 'inputting' && customPriceInput.length < 5) {
customPriceInput += digit;
updateCustomPriceDisplay();
}
};
}
function clearInput() {
customPriceInput = '';
updateCustomPriceDisplay();
}
function subtractFromInput() {
if (customPriceInput.length > 0) {
customPriceInput = customPriceInput.slice(0, -1);
updateCustomPriceDisplay();
}
}
function addToInput() {
if (customPriceInput && parseInt(customPriceInput) > 0) {
var currentValue = parseInt(customPriceInput);
var newValue = currentValue + 10;
customPriceInput = newValue.toString();
updateCustomPriceDisplay();
}
}
function updateCustomPriceDisplay() {
customPriceText.setText('Teklifiniz: $' + customPriceInput);
}
function submitCustomPrice() {
if (customPriceInput && parseInt(customPriceInput) > 0) {
var offer = parseInt(customPriceInput);
processCustomOffer(offer);
customPriceInput = '';
updateCustomPriceDisplay();
hideInputUI();
gamePhase = 'negotiating';
}
}
function showInputUI() {
for (var i = 0; i < numberButtons.length; i++) {
numberButtons[i].visible = true;
}
clearButton.visible = true;
subtractButton.visible = true;
addButton.visible = true;
submitButton.visible = true;
}
function hideInputUI() {
for (var i = 0; i < numberButtons.length; i++) {
numberButtons[i].visible = false;
}
clearButton.visible = false;
subtractButton.visible = false;
addButton.visible = false;
submitButton.visible = false;
}
function showNegotiationUI() {
if (isSelling) {
acceptButton.visible = true;
rejectButton.visible = true;
bargainButton.visible = true;
callPoliceButton.visible = false;
sellButton.visible = false;
inventoryButton.visible = false;
} else {
acceptButton.visible = true;
rejectButton.visible = true;
bargainButton.visible = true;
if (currentPlayer === 'littleOE') {
callPoliceButton.visible = true;
} else {
callPoliceButton.visible = false;
}
if (currentPlayer === 'bigOE' && inventory.length > 0) {
sellButton.visible = true;
} else {
sellButton.visible = false;
}
inventoryButton.visible = true;
}
}
function hideNegotiationUI() {
acceptButton.visible = false;
rejectButton.visible = false;
bargainButton.visible = false;
callPoliceButton.visible = false;
sellButton.visible = false;
inventoryButton.visible = false;
}
function spawnCustomer() {
// Check daily customer limit
if (dailyCustomerCount >= maxDailyCustomers) {
infoText.setText('Bugün için yeterli müşteri geldi. Sonraki güne geçiliyor...');
// Progress to next day
LK.setTimeout(function () {
dailyCustomerCount = 0;
maxDailyCustomers = Math.floor(reputation / 10) + 1;
infoText.setText('Yeni gün başladı! Müşteri bekleniyor...');
LK.setTimeout(function () {
spawnCustomer();
}, 1000);
}, 2000);
return;
}
if (customerChar) {
customerChar.destroy();
}
if (antiqueDisplay) {
antiqueDisplay.destroy();
}
customerChar = game.addChild(new Character().init('customer', 1024, 1100));
customerLabel.setText('Müşteri');
// Create random antique
var antiqueType = antiqueTypes[Math.floor(Math.random() * antiqueTypes.length)];
var isCounterfeit = Math.random() < 0.15;
var isStolen = Math.random() < 0.1;
currentAntique = new AntiqueItem().init(antiqueType.name, antiqueType.baseValue, isCounterfeit, isStolen);
antiqueDisplay = game.addChild(currentAntique);
antiqueDisplay.x = 1024;
antiqueDisplay.y = 1400;
dailyCustomerCount++;
if (isSelling) {
gamePhase = 'selling';
updateSellingDisplay();
} else {
gamePhase = 'negotiating';
updateInfoDisplay();
}
negotiationRound = 0;
showNegotiationUI();
}
function updateInfoDisplay() {
if (currentAntique) {
var customerDialogues = ['Bu ' + currentAntique.itemName + ' için ' + currentAntique.customerPrice + ' dolar istiyorum.', 'Bu değerli ' + currentAntique.itemName + ' için ' + currentAntique.customerPrice + ' dolar verirsiniz?', 'Bu antika ' + currentAntique.itemName + ' için ' + currentAntique.customerPrice + ' dolar teklif ediyorum.', 'Bu güzel ' + currentAntique.itemName + ' için ' + currentAntique.customerPrice + ' dolar nasıl olur?'];
var randomDialogue = customerDialogues[Math.floor(Math.random() * customerDialogues.length)];
infoText.setText(randomDialogue + '\n(Enderlik: ' + antiqueTypes.find(function (a) {
return a.name === currentAntique.itemName;
}).rarity + ')');
// Handle stolen goods notification for Little OE
if (currentPlayer === 'littleOE') {
if (currentAntique.isStolen) {
stolenGoodsNotification.setText('Çalıntı mal geldi!');
stolenGoodsNotification.visible = true;
} else if (currentAntique.isCounterfeit) {
stolenGoodsNotification.setText('Bu sahte olabilir...');
stolenGoodsNotification.visible = true;
} else {
stolenGoodsNotification.visible = false;
}
} else {
stolenGoodsNotification.visible = false;
}
negotiationText.setText('');
}
}
function acceptDeal() {
if (gamePhase !== 'negotiating' && gamePhase !== 'selling' || !currentAntique) return;
LK.getSound('accept').play();
if (isSelling) {
// Big OE is selling from inventory
money += sellingPrice;
reputation += 2;
infoText.setText('Satış başarılı! +$' + sellingPrice);
} else {
// Buying items
var profit = currentAntique.baseValue - currentAntique.customerPrice;
if (currentAntique.isStolen) {
// Caught with stolen goods
money -= 200;
reputation -= 20;
infoText.setText('Polis çalıntı mal buldu! Ceza: $200');
} else if (currentAntique.isCounterfeit) {
// Bought counterfeit
money -= currentAntique.customerPrice;
reputation -= 5;
infoText.setText('Sahte ürün aldınız! Para ve itibar kaybettiniz');
} else {
// Legitimate deal - add to inventory
money -= currentAntique.customerPrice;
inventory.push({
name: currentAntique.itemName,
baseValue: currentAntique.baseValue,
buyPrice: currentAntique.customerPrice
});
updateInventoryDisplay();
if (profit < 0) {
reputation -= 1;
}
infoText.setText('Anlaşma kabul edildi! Envantere eklendi. Kar potansiyeli: $' + profit);
}
}
updateDisplays();
endTransaction();
}
function rejectDeal() {
if (gamePhase !== 'negotiating') return;
LK.getSound('reject').play();
infoText.setText('Anlaşma reddedildi. Müşteri ayrıldı.');
endTransaction();
}
function startBargaining() {
if (gamePhase !== 'negotiating' && gamePhase !== 'selling') return;
if (!currentAntique) {
infoText.setText('Hata: Pazarlık edilecek ürün bulunamadı.');
return;
}
LK.getSound('negotiate').play();
gamePhase = 'inputting';
if (isSelling) {
infoText.setText('Satış fiyatınızı girin:\n(Şu anki teklif: $' + sellingPrice + ')');
} else {
infoText.setText('Karşı teklifinizi girin:\n(Müşteri teklifi: $' + currentAntique.customerPrice + ')');
}
hideNegotiationUI();
showInputUI();
}
function processCustomOffer(offer) {
negotiationRound++;
var difference = Math.abs(offer - currentAntique.customerPrice);
var acceptance_threshold = currentAntique.customerPrice * 0.2;
var rejection_threshold = currentAntique.customerPrice * 0.6;
if (difference <= acceptance_threshold) {
// Customer accepts
LK.getSound('accept').play();
currentAntique.customerPrice = offer;
infoText.setText('Müşteri teklifinizi kabul etti!');
LK.setTimeout(function () {
acceptDeal();
}, 1500);
} else if (difference >= rejection_threshold || negotiationRound >= maxNegotiationRounds) {
// Customer rejects or max rounds reached
LK.getSound('reject').play();
infoText.setText('Müşteri teklifinizi reddetti ve ayrıldı.');
endTransaction();
} else {
// Customer makes counter-offer
LK.getSound('negotiate').play();
var newPrice;
if (offer > currentAntique.customerPrice) {
// Player offered more, customer slightly increases their offer
newPrice = Math.floor(currentAntique.customerPrice + (offer - currentAntique.customerPrice) * 0.3);
} else {
// Player offered less, customer slightly decreases their price
newPrice = Math.floor(currentAntique.customerPrice - (currentAntique.customerPrice - offer) * 0.4);
}
currentAntique.customerPrice = newPrice;
var counterOfferDialogues = ['Hayır, ' + newPrice + ' dolar son teklifim.', 'Bu çok az, ' + newPrice + ' dolar verebilirim.', 'O fiyata olmaz, ' + newPrice + ' dolar nasıl?', 'Biraz daha yüksek olsun, ' + newPrice + ' dolar son fiyatım.'];
var randomResponse = counterOfferDialogues[Math.floor(Math.random() * counterOfferDialogues.length)];
infoText.setText(randomResponse);
negotiationText.setText('Müşteri karşı teklif yaptı - Tur: ' + negotiationRound + '/' + maxNegotiationRounds);
showNegotiationUI();
}
}
function callPolice() {
if (gamePhase !== 'negotiating' || currentPlayer !== 'littleOE') return;
LK.getSound('police').play();
if (currentAntique.isStolen) {
reputation += 10;
money += 100; // Reward for good citizenship
infoText.setText('İyi yakaladın! Çalıntı mal bildirildi. Ödül: $100');
} else {
reputation -= 2;
infoText.setText('Yanlış alarm. Müşteri alındı.');
}
updateDisplays();
endTransaction();
}
function endTransaction() {
gamePhase = 'waiting';
isSelling = false;
sellingPrice = 0;
hideNegotiationUI();
hideInputUI();
stolenGoodsNotification.visible = false;
if (customerChar) {
tween(customerChar, {
alpha: 0
}, {
duration: 1000,
onFinish: function onFinish() {
customerChar.destroy();
customerChar = null;
}
});
}
if (antiqueDisplay) {
tween(antiqueDisplay, {
alpha: 0
}, {
duration: 1000,
onFinish: function onFinish() {
antiqueDisplay.destroy();
antiqueDisplay = null;
}
});
}
// Switch players
currentPlayer = currentPlayer === 'bigOE' ? 'littleOE' : 'bigOE';
updateDisplays();
// Schedule next customer
LK.setTimeout(function () {
if (gamePhase === 'waiting') {
spawnCustomer();
}
}, 2000);
}
function startSelling() {
if (currentPlayer !== 'bigOE' || inventory.length === 0) return;
// Pick random item from inventory
var randomIndex = Math.floor(Math.random() * inventory.length);
var itemToSell = inventory[randomIndex];
inventory.splice(randomIndex, 1);
updateInventoryDisplay();
// Create selling antique with markup
sellingPrice = Math.floor(itemToSell.baseValue * (0.7 + Math.random() * 0.6));
currentAntique = new AntiqueItem().init(itemToSell.name, itemToSell.baseValue, false, false);
antiqueDisplay = game.addChild(currentAntique);
antiqueDisplay.x = 1024;
antiqueDisplay.y = 1400;
isSelling = true;
gamePhase = 'selling';
updateSellingDisplay();
showNegotiationUI();
}
function showInventory() {
// Always update inventory display
updateInventoryDisplay();
}
function showFullInventory() {
if (inventory.length === 0) {
fullInventoryDisplay.setText('Envanter Boş\n\nHenüz hiç ürün yok.');
} else {
var inventoryList = 'ENVANTER (' + inventory.length + ' ürün)\n\n';
for (var i = 0; i < inventory.length; i++) {
var item = inventory[i];
var potentialProfit = item.baseValue - item.buyPrice;
inventoryList += i + 1 + '. ' + item.name + '\n';
inventoryList += ' Alış: $' + item.buyPrice + ' | Değer: $' + item.baseValue + '\n';
inventoryList += ' Kar Potansiyeli: $' + potentialProfit + '\n\n';
}
inventoryList += 'Envanter kutusuna tıklayarak kapat';
fullInventoryDisplay.setText(inventoryList);
}
inventoryOverlay.visible = true;
fullInventoryDisplay.visible = true;
}
function hideFullInventory() {
inventoryOverlay.visible = false;
fullInventoryDisplay.visible = false;
}
function updateInventoryDisplay() {
// Inventory display is now handled by clicking the inventory box
// This function is kept for compatibility but doesn't display text
}
function updateSellingDisplay() {
if (isSelling && currentAntique) {
var sellingDialogues = ['Bu ' + currentAntique.itemName + ' için ' + sellingPrice + ' dolar veriyorum.', 'Bu güzel ' + currentAntique.itemName + ' için ' + sellingPrice + ' dolar nasıl?', 'Bu değerli ' + currentAntique.itemName + ' için ' + sellingPrice + ' dolar teklif ediyorum.'];
var randomDialogue = sellingDialogues[Math.floor(Math.random() * sellingDialogues.length)];
infoText.setText(randomDialogue);
negotiationText.setText('Müşteri satın almak istiyor');
}
}
function updateDisplays() {
moneyText.setText('Para: $' + money);
reputationText.setText('İtibar: ' + reputation);
playerText.setText('Oynayan: ' + (currentPlayer === 'bigOE' ? 'Büyük OE' : 'Küçük OE'));
// Update daily customer limit based on reputation
maxDailyCustomers = Math.floor(reputation / 10) + 1;
// Clear saved progress to restart fresh
storage.money = 100;
storage.reputation = 10;
storage.inventory = [];
// Check game over conditions
if (money < 0) {
LK.showGameOver();
}
}
// Clear any existing elements before restart
if (customerChar) {
customerChar.destroy();
customerChar = null;
}
if (antiqueDisplay) {
antiqueDisplay.destroy();
antiqueDisplay = null;
}
// Reset UI states
hideNegotiationUI();
hideInputUI();
stolenGoodsNotification.visible = false;
// Update displays with reset values
updateDisplays();
// Start the game
LK.setTimeout(function () {
spawnCustomer();
}, 1000);
game.update = function () {
// Handle visual feedback for current player
if (currentPlayer === 'bigOE') {
bigOEChar.alpha = 1.0;
littleOEChar.alpha = 0.6;
} else {
bigOEChar.alpha = 0.6;
littleOEChar.alpha = 1.0;
}
// Update custom price display
if (gamePhase === 'inputting') {
customPriceText.visible = true;
} else {
customPriceText.visible = false;
}
}; ===================================================================
--- original.js
+++ change.js
@@ -231,16 +231,31 @@
scaleX: 0.8,
scaleY: 0.6
});
inventoryBox.tint = 0x333333;
-var inventoryText = game.addChild(new Text2('Envanter\n(Boş)', {
- size: 30,
+// Make inventory box clickable
+inventoryBox.down = function (x, y, obj) {
+ showFullInventory();
+};
+var fullInventoryDisplay = game.addChild(new Text2('', {
+ size: 35,
fill: 0xFFFFFF
}));
-inventoryText.anchor.set(1.0, 1.0);
-inventoryText.x = 2040;
-inventoryText.y = 2720;
-inventoryText.visible = true;
+fullInventoryDisplay.anchor.set(0.5, 0.5);
+fullInventoryDisplay.x = 1024;
+fullInventoryDisplay.y = 1366;
+fullInventoryDisplay.visible = false;
+var inventoryOverlay = game.attachAsset('shopBackground', {
+ x: 0,
+ y: 0,
+ alpha: 0.8
+});
+inventoryOverlay.tint = 0x000000;
+inventoryOverlay.visible = false;
+// Make overlay clickable to close inventory
+inventoryOverlay.down = function (x, y, obj) {
+ hideFullInventory();
+};
// Buttons
var acceptButton = game.addChild(new Button().init('Kabul Et', 400, 2200, acceptDeal));
var rejectButton = game.addChild(new Button().init('Reddet', 800, 2200, rejectDeal));
var bargainButton = game.addChild(new Button().init('Pazarlık Et', 1200, 2200, startBargaining));
@@ -353,9 +368,8 @@
bargainButton.visible = false;
callPoliceButton.visible = false;
sellButton.visible = false;
inventoryButton.visible = false;
- inventoryText.visible = false;
}
function spawnCustomer() {
// Check daily customer limit
if (dailyCustomerCount >= maxDailyCustomers) {
@@ -467,32 +481,57 @@
infoText.setText('Anlaşma reddedildi. Müşteri ayrıldı.');
endTransaction();
}
function startBargaining() {
- if (gamePhase !== 'negotiating') return;
+ if (gamePhase !== 'negotiating' && gamePhase !== 'selling') return;
+ if (!currentAntique) {
+ infoText.setText('Hata: Pazarlık edilecek ürün bulunamadı.');
+ return;
+ }
LK.getSound('negotiate').play();
gamePhase = 'inputting';
- infoText.setText('Karşı teklifinizi girin:');
+ if (isSelling) {
+ infoText.setText('Satış fiyatınızı girin:\n(Şu anki teklif: $' + sellingPrice + ')');
+ } else {
+ infoText.setText('Karşı teklifinizi girin:\n(Müşteri teklifi: $' + currentAntique.customerPrice + ')');
+ }
hideNegotiationUI();
showInputUI();
}
function processCustomOffer(offer) {
negotiationRound++;
var difference = Math.abs(offer - currentAntique.customerPrice);
var acceptance_threshold = currentAntique.customerPrice * 0.2;
+ var rejection_threshold = currentAntique.customerPrice * 0.6;
if (difference <= acceptance_threshold) {
// Customer accepts
+ LK.getSound('accept').play();
currentAntique.customerPrice = offer;
- acceptDeal();
- } else if (negotiationRound >= maxNegotiationRounds) {
- // Max rounds reached
- infoText.setText('Müşteri pazarlıktan yoruldu ve ayrıldı.');
+ infoText.setText('Müşteri teklifinizi kabul etti!');
+ LK.setTimeout(function () {
+ acceptDeal();
+ }, 1500);
+ } else if (difference >= rejection_threshold || negotiationRound >= maxNegotiationRounds) {
+ // Customer rejects or max rounds reached
+ LK.getSound('reject').play();
+ infoText.setText('Müşteri teklifinizi reddetti ve ayrıldı.');
endTransaction();
} else {
- // Continue negotiating
- var newPrice = Math.floor((currentAntique.customerPrice + offer) / 2);
+ // Customer makes counter-offer
+ LK.getSound('negotiate').play();
+ var newPrice;
+ if (offer > currentAntique.customerPrice) {
+ // Player offered more, customer slightly increases their offer
+ newPrice = Math.floor(currentAntique.customerPrice + (offer - currentAntique.customerPrice) * 0.3);
+ } else {
+ // Player offered less, customer slightly decreases their price
+ newPrice = Math.floor(currentAntique.customerPrice - (currentAntique.customerPrice - offer) * 0.4);
+ }
currentAntique.customerPrice = newPrice;
- updateInfoDisplay();
+ var counterOfferDialogues = ['Hayır, ' + newPrice + ' dolar son teklifim.', 'Bu çok az, ' + newPrice + ' dolar verebilirim.', 'O fiyata olmaz, ' + newPrice + ' dolar nasıl?', 'Biraz daha yüksek olsun, ' + newPrice + ' dolar son fiyatım.'];
+ var randomResponse = counterOfferDialogues[Math.floor(Math.random() * counterOfferDialogues.length)];
+ infoText.setText(randomResponse);
+ negotiationText.setText('Müşteri karşı teklif yaptı - Tur: ' + negotiationRound + '/' + maxNegotiationRounds);
showNegotiationUI();
}
}
function callPolice() {
@@ -569,22 +608,34 @@
function showInventory() {
// Always update inventory display
updateInventoryDisplay();
}
-function updateInventoryDisplay() {
+function showFullInventory() {
if (inventory.length === 0) {
- inventoryText.setText('Envanter\n(Boş)');
+ fullInventoryDisplay.setText('Envanter Boş\n\nHenüz hiç ürün yok.');
} else {
- var inventoryList = 'Envanter (' + inventory.length + '):\n';
- for (var i = 0; i < Math.min(inventory.length, 4); i++) {
- inventoryList += inventory[i].name + '\n';
+ var inventoryList = 'ENVANTER (' + inventory.length + ' ürün)\n\n';
+ for (var i = 0; i < inventory.length; i++) {
+ var item = inventory[i];
+ var potentialProfit = item.baseValue - item.buyPrice;
+ inventoryList += i + 1 + '. ' + item.name + '\n';
+ inventoryList += ' Alış: $' + item.buyPrice + ' | Değer: $' + item.baseValue + '\n';
+ inventoryList += ' Kar Potansiyeli: $' + potentialProfit + '\n\n';
}
- if (inventory.length > 4) {
- inventoryList += '... +' + (inventory.length - 4) + ' daha';
- }
- inventoryText.setText(inventoryList);
+ inventoryList += 'Envanter kutusuna tıklayarak kapat';
+ fullInventoryDisplay.setText(inventoryList);
}
+ inventoryOverlay.visible = true;
+ fullInventoryDisplay.visible = true;
}
+function hideFullInventory() {
+ inventoryOverlay.visible = false;
+ fullInventoryDisplay.visible = false;
+}
+function updateInventoryDisplay() {
+ // Inventory display is now handled by clicking the inventory box
+ // This function is kept for compatibility but doesn't display text
+}
function updateSellingDisplay() {
if (isSelling && currentAntique) {
var sellingDialogues = ['Bu ' + currentAntique.itemName + ' için ' + sellingPrice + ' dolar veriyorum.', 'Bu güzel ' + currentAntique.itemName + ' için ' + sellingPrice + ' dolar nasıl?', 'Bu değerli ' + currentAntique.itemName + ' için ' + sellingPrice + ' dolar teklif ediyorum.'];
var randomDialogue = sellingDialogues[Math.floor(Math.random() * sellingDialogues.length)];
@@ -619,9 +670,8 @@
// Reset UI states
hideNegotiationUI();
hideInputUI();
stolenGoodsNotification.visible = false;
-inventoryText.visible = false;
// Update displays with reset values
updateDisplays();
// Start the game
LK.setTimeout(function () {