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
var currentPlayer = 'bigOE'; // 'bigOE' or 'littleOE'
var gamePhase = 'waiting'; // 'waiting', 'negotiating', 'inputting'
var money = storage.money || 1000;
var reputation = storage.reputation || 50;
var currentCustomer = null;
var currentAntique = null;
var negotiationRound = 0;
var maxNegotiationRounds = 3;
var customPriceInput = '';
// Antique types with base values
var antiqueTypes = [{
name: 'Vintage Vase',
baseValue: 150
}, {
name: 'Old Painting',
baseValue: 300
}, {
name: 'Antique Clock',
baseValue: 250
}, {
name: 'Jewelry Box',
baseValue: 180
}, {
name: 'Rare Book',
baseValue: 120
}, {
name: 'China Set',
baseValue: 220
}, {
name: 'Silver Candlestick',
baseValue: 160
}, {
name: 'Vintage Lamp',
baseValue: 140
}];
// 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, 1700));
var customerChar = null;
var antiqueDisplay = null;
// UI Text elements
var moneyText = game.addChild(new Text2('Money: $' + money, {
size: 60,
fill: 0xFFFFFF
}));
moneyText.x = 100;
moneyText.y = 200;
var reputationText = game.addChild(new Text2('Reputation: ' + reputation, {
size: 60,
fill: 0xFFFFFF
}));
reputationText.x = 100;
reputationText.y = 300;
var playerText = game.addChild(new Text2('Playing as: Big OE', {
size: 80,
fill: 0xFFD700
}));
playerText.anchor.set(0.5, 0);
playerText.x = 1024;
playerText.y = 400;
var infoText = game.addChild(new Text2('Waiting for customer...', {
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;
// Buttons
var acceptButton = game.addChild(new Button().init('Accept', 400, 2200, acceptDeal));
var rejectButton = game.addChild(new Button().init('Reject', 800, 2200, rejectDeal));
var bargainButton = game.addChild(new Button().init('Bargain', 1200, 2200, startBargaining));
var callPoliceButton = game.addChild(new Button().init('Call Police', 1600, 2200, callPolice));
// Number input buttons
var numberButtons = [];
var inputRow1Y = 2400;
var inputRow2Y = 2500;
var clearButton = game.addChild(new Button().init('Clear', 200, 2600, clearInput));
var submitButton = game.addChild(new Button().init('Submit', 600, 2600, submitCustomPrice));
// 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 updateCustomPriceDisplay() {
customPriceText.setText('Your offer: $' + 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;
submitButton.visible = true;
}
function hideInputUI() {
for (var i = 0; i < numberButtons.length; i++) {
numberButtons[i].visible = false;
}
clearButton.visible = false;
submitButton.visible = false;
}
function showNegotiationUI() {
acceptButton.visible = true;
rejectButton.visible = true;
bargainButton.visible = true;
if (currentPlayer === 'littleOE') {
callPoliceButton.visible = true;
} else {
callPoliceButton.visible = false;
}
}
function hideNegotiationUI() {
acceptButton.visible = false;
rejectButton.visible = false;
bargainButton.visible = false;
callPoliceButton.visible = false;
}
function spawnCustomer() {
if (customerChar) {
customerChar.destroy();
}
if (antiqueDisplay) {
antiqueDisplay.destroy();
}
customerChar = game.addChild(new Character().init('customer', 1024, 1200));
// 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;
gamePhase = 'negotiating';
negotiationRound = 0;
updateInfoDisplay();
showNegotiationUI();
}
function updateInfoDisplay() {
if (currentAntique) {
infoText.setText(currentAntique.itemName + ' - Customer wants: $' + currentAntique.customerPrice);
var suspiciousText = '';
if (currentPlayer === 'littleOE') {
if (currentAntique.isStolen) {
suspiciousText = '\nSomething seems suspicious...';
} else if (currentAntique.isCounterfeit) {
suspiciousText = '\nThis might be a fake...';
}
}
negotiationText.setText('Round ' + (negotiationRound + 1) + '/' + maxNegotiationRounds + suspiciousText);
}
}
function acceptDeal() {
if (gamePhase !== 'negotiating' || !currentAntique) return;
LK.getSound('accept').play();
var profit = currentAntique.baseValue - currentAntique.customerPrice;
if (currentAntique.isStolen) {
// Caught with stolen goods
money -= 200;
reputation -= 20;
infoText.setText('Police found stolen goods! Fine: $200');
} else if (currentAntique.isCounterfeit) {
// Bought counterfeit
money -= currentAntique.customerPrice;
reputation -= 5;
infoText.setText('You bought a counterfeit! Lost money and reputation');
} else {
// Legitimate deal
money -= currentAntique.customerPrice;
if (profit > 50) {
reputation += 2;
} else if (profit < 0) {
reputation -= 1;
}
infoText.setText('Deal accepted! Profit potential: $' + profit);
}
updateDisplays();
endTransaction();
}
function rejectDeal() {
if (gamePhase !== 'negotiating') return;
LK.getSound('reject').play();
infoText.setText('Deal rejected. Customer left.');
endTransaction();
}
function startBargaining() {
if (gamePhase !== 'negotiating') return;
LK.getSound('negotiate').play();
gamePhase = 'inputting';
infoText.setText('Enter your counter-offer:');
hideNegotiationUI();
showInputUI();
}
function processCustomOffer(offer) {
negotiationRound++;
var difference = Math.abs(offer - currentAntique.customerPrice);
var acceptance_threshold = currentAntique.customerPrice * 0.2;
if (difference <= acceptance_threshold) {
// Customer accepts
currentAntique.customerPrice = offer;
acceptDeal();
} else if (negotiationRound >= maxNegotiationRounds) {
// Max rounds reached
infoText.setText('Customer got tired of negotiating and left.');
endTransaction();
} else {
// Continue negotiating
var newPrice = Math.floor((currentAntique.customerPrice + offer) / 2);
currentAntique.customerPrice = newPrice;
updateInfoDisplay();
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('Good catch! Stolen goods reported. Reward: $100');
} else {
reputation -= 5;
infoText.setText('False alarm. Customer was offended.');
}
updateDisplays();
endTransaction();
}
function endTransaction() {
gamePhase = 'waiting';
hideNegotiationUI();
hideInputUI();
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 updateDisplays() {
moneyText.setText('Money: $' + money);
reputationText.setText('Reputation: ' + reputation);
playerText.setText('Playing as: ' + (currentPlayer === 'bigOE' ? 'Big OE' : 'Little OE'));
// Save progress
storage.money = money;
storage.reputation = reputation;
// Check game over conditions
if (money < 0) {
LK.showGameOver();
} else if (money > 5000 && reputation > 80) {
LK.showYouWin();
}
}
// 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
@@ -1,6 +1,429 @@
-/****
+/****
+* 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: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x2F4F4F
+});
+
+/****
+* Game Code
+****/
+// Game state variables
+var currentPlayer = 'bigOE'; // 'bigOE' or 'littleOE'
+var gamePhase = 'waiting'; // 'waiting', 'negotiating', 'inputting'
+var money = storage.money || 1000;
+var reputation = storage.reputation || 50;
+var currentCustomer = null;
+var currentAntique = null;
+var negotiationRound = 0;
+var maxNegotiationRounds = 3;
+var customPriceInput = '';
+// Antique types with base values
+var antiqueTypes = [{
+ name: 'Vintage Vase',
+ baseValue: 150
+}, {
+ name: 'Old Painting',
+ baseValue: 300
+}, {
+ name: 'Antique Clock',
+ baseValue: 250
+}, {
+ name: 'Jewelry Box',
+ baseValue: 180
+}, {
+ name: 'Rare Book',
+ baseValue: 120
+}, {
+ name: 'China Set',
+ baseValue: 220
+}, {
+ name: 'Silver Candlestick',
+ baseValue: 160
+}, {
+ name: 'Vintage Lamp',
+ baseValue: 140
+}];
+// 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, 1700));
+var customerChar = null;
+var antiqueDisplay = null;
+// UI Text elements
+var moneyText = game.addChild(new Text2('Money: $' + money, {
+ size: 60,
+ fill: 0xFFFFFF
+}));
+moneyText.x = 100;
+moneyText.y = 200;
+var reputationText = game.addChild(new Text2('Reputation: ' + reputation, {
+ size: 60,
+ fill: 0xFFFFFF
+}));
+reputationText.x = 100;
+reputationText.y = 300;
+var playerText = game.addChild(new Text2('Playing as: Big OE', {
+ size: 80,
+ fill: 0xFFD700
+}));
+playerText.anchor.set(0.5, 0);
+playerText.x = 1024;
+playerText.y = 400;
+var infoText = game.addChild(new Text2('Waiting for customer...', {
+ 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;
+// Buttons
+var acceptButton = game.addChild(new Button().init('Accept', 400, 2200, acceptDeal));
+var rejectButton = game.addChild(new Button().init('Reject', 800, 2200, rejectDeal));
+var bargainButton = game.addChild(new Button().init('Bargain', 1200, 2200, startBargaining));
+var callPoliceButton = game.addChild(new Button().init('Call Police', 1600, 2200, callPolice));
+// Number input buttons
+var numberButtons = [];
+var inputRow1Y = 2400;
+var inputRow2Y = 2500;
+var clearButton = game.addChild(new Button().init('Clear', 200, 2600, clearInput));
+var submitButton = game.addChild(new Button().init('Submit', 600, 2600, submitCustomPrice));
+// 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 updateCustomPriceDisplay() {
+ customPriceText.setText('Your offer: $' + 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;
+ submitButton.visible = true;
+}
+function hideInputUI() {
+ for (var i = 0; i < numberButtons.length; i++) {
+ numberButtons[i].visible = false;
+ }
+ clearButton.visible = false;
+ submitButton.visible = false;
+}
+function showNegotiationUI() {
+ acceptButton.visible = true;
+ rejectButton.visible = true;
+ bargainButton.visible = true;
+ if (currentPlayer === 'littleOE') {
+ callPoliceButton.visible = true;
+ } else {
+ callPoliceButton.visible = false;
+ }
+}
+function hideNegotiationUI() {
+ acceptButton.visible = false;
+ rejectButton.visible = false;
+ bargainButton.visible = false;
+ callPoliceButton.visible = false;
+}
+function spawnCustomer() {
+ if (customerChar) {
+ customerChar.destroy();
+ }
+ if (antiqueDisplay) {
+ antiqueDisplay.destroy();
+ }
+ customerChar = game.addChild(new Character().init('customer', 1024, 1200));
+ // 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;
+ gamePhase = 'negotiating';
+ negotiationRound = 0;
+ updateInfoDisplay();
+ showNegotiationUI();
+}
+function updateInfoDisplay() {
+ if (currentAntique) {
+ infoText.setText(currentAntique.itemName + ' - Customer wants: $' + currentAntique.customerPrice);
+ var suspiciousText = '';
+ if (currentPlayer === 'littleOE') {
+ if (currentAntique.isStolen) {
+ suspiciousText = '\nSomething seems suspicious...';
+ } else if (currentAntique.isCounterfeit) {
+ suspiciousText = '\nThis might be a fake...';
+ }
+ }
+ negotiationText.setText('Round ' + (negotiationRound + 1) + '/' + maxNegotiationRounds + suspiciousText);
+ }
+}
+function acceptDeal() {
+ if (gamePhase !== 'negotiating' || !currentAntique) return;
+ LK.getSound('accept').play();
+ var profit = currentAntique.baseValue - currentAntique.customerPrice;
+ if (currentAntique.isStolen) {
+ // Caught with stolen goods
+ money -= 200;
+ reputation -= 20;
+ infoText.setText('Police found stolen goods! Fine: $200');
+ } else if (currentAntique.isCounterfeit) {
+ // Bought counterfeit
+ money -= currentAntique.customerPrice;
+ reputation -= 5;
+ infoText.setText('You bought a counterfeit! Lost money and reputation');
+ } else {
+ // Legitimate deal
+ money -= currentAntique.customerPrice;
+ if (profit > 50) {
+ reputation += 2;
+ } else if (profit < 0) {
+ reputation -= 1;
+ }
+ infoText.setText('Deal accepted! Profit potential: $' + profit);
+ }
+ updateDisplays();
+ endTransaction();
+}
+function rejectDeal() {
+ if (gamePhase !== 'negotiating') return;
+ LK.getSound('reject').play();
+ infoText.setText('Deal rejected. Customer left.');
+ endTransaction();
+}
+function startBargaining() {
+ if (gamePhase !== 'negotiating') return;
+ LK.getSound('negotiate').play();
+ gamePhase = 'inputting';
+ infoText.setText('Enter your counter-offer:');
+ hideNegotiationUI();
+ showInputUI();
+}
+function processCustomOffer(offer) {
+ negotiationRound++;
+ var difference = Math.abs(offer - currentAntique.customerPrice);
+ var acceptance_threshold = currentAntique.customerPrice * 0.2;
+ if (difference <= acceptance_threshold) {
+ // Customer accepts
+ currentAntique.customerPrice = offer;
+ acceptDeal();
+ } else if (negotiationRound >= maxNegotiationRounds) {
+ // Max rounds reached
+ infoText.setText('Customer got tired of negotiating and left.');
+ endTransaction();
+ } else {
+ // Continue negotiating
+ var newPrice = Math.floor((currentAntique.customerPrice + offer) / 2);
+ currentAntique.customerPrice = newPrice;
+ updateInfoDisplay();
+ 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('Good catch! Stolen goods reported. Reward: $100');
+ } else {
+ reputation -= 5;
+ infoText.setText('False alarm. Customer was offended.');
+ }
+ updateDisplays();
+ endTransaction();
+}
+function endTransaction() {
+ gamePhase = 'waiting';
+ hideNegotiationUI();
+ hideInputUI();
+ 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 updateDisplays() {
+ moneyText.setText('Money: $' + money);
+ reputationText.setText('Reputation: ' + reputation);
+ playerText.setText('Playing as: ' + (currentPlayer === 'bigOE' ? 'Big OE' : 'Little OE'));
+ // Save progress
+ storage.money = money;
+ storage.reputation = reputation;
+ // Check game over conditions
+ if (money < 0) {
+ LK.showGameOver();
+ } else if (money > 5000 && reputation > 80) {
+ LK.showYouWin();
+ }
+}
+// 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;
+ }
+};
\ No newline at end of file