fix: trading, machine rewards and claw prizes from the owner's list

- a completed trade no longer plays the failure sound over the success one
- a sign over players who are trading, seen by everyone in the room
- every item added to a trade list is shown; lists keep up to 200 items
- the drink, popcorn and cotton candy machines always hand over what they
  made (the game sent nothing when it was like the last one it gave), the
  smoothie machine even when the game it is was not noted down, and the
  server takes a game's message for a moment after it is left
- claw machine, Phantom Invasion and Sky High prizes are the game's own
  items only: a custom item could be missing from the winner's game
This commit is contained in:
Burrowdev committed 2026-10-23 21:29:49 +03:00
1 parent 22fb7f0fa5
commit 6c273554d7
12 files changed
+2791 -11

No files matched your search

+13 -3
View File
@@ -6,6 +6,7 @@ const defpacks = require("./defpacks.js");
const buddyGames = require("./buddygames.js");
const masterpieces = require("./masterpieces.js");
const dens = require("./dens.js");
const customItems = require("./customitems.js");
const limits = require("./limits.js");
const {activeAvatar, addClothing, sendClothingAdded} = require("./player.js");
@@ -42,6 +43,7 @@ const {activeAvatar, addClothing, sendClothingAdded} = require("./player.js");
const games = new Map(require("./games.json").map(game => [game.id, game]));
const GAME_AFTERGLOW_MS = 15000; // how long a game's room id is still taken after leaving it (leave)
const IN_ROOM = 0;
const MAX_GEMS_PER_AWARD = 5000;
const MAX_MASTERY_PER_AWARD = 100;
@@ -234,6 +236,10 @@ module.exports = ({tell, leaveRoom, findOnline, blocks, watchers}) => {
return;
}
session.game = null;
// an in-room game may say it is done just before it hands over what it
// made (the Juice Bar's smoothie, the Cocoa Hut's drink: an attachment,
// lib/world.js pubMsg), labelled with the game's room
session.lastGame = {roomId: game.roomId, until: Date.now() + GAME_AFTERGLOW_MS};
if (session.bubbleOffOwed) {
bubbleOff(session);
}
@@ -408,8 +414,12 @@ module.exports = ({tell, leaveRoom, findOnline, blocks, watchers}) => {
// den items a claw machine can drop: the plushies, of the machine's own
// animal when it is named for one ("The Wolf Claw").
let plushies = null;
// the game's own den items only: a custom item (and a player's own, which
// is nobody else's to win) may be missing from the winner's game, whose
// prize popup then threw (DenItem.initShopItem) and left the game frozen.
const gameOwnDenItemIds = () => defpacks.denItemIds().filter(id => id < customItems.FIRST_ID);
const clawPrizes = game => {
plushies = plushies || defpacks.denItemIds().filter(id => /plush/i.test(defpacks.denItemDef(id).abbrName));
plushies = plushies || gameOwnDenItemIds().filter(id => /plush/i.test(defpacks.denItemDef(id).abbrName));
const item = defpacks.denItemIds().map(id => defpacks.denItemDef(id)).find(def => Number(def.gameDefId) === game.id);
const animal = item ? /^ArcCraneGame(.+)$/.exec(item.abbrName) : null;
const own = animal ? plushies.filter(id => defpacks.denItemDef(id).abbrName.toLowerCase().includes(animal[1].toLowerCase())) : [];
@@ -420,7 +430,7 @@ module.exports = ({tell, leaveRoom, findOnline, blocks, watchers}) => {
// machines aside.
let phantomItems = null;
const invasionPrizes = () => {
phantomItems = phantomItems || defpacks.denItemIds().filter(id => /phantom/i.test(defpacks.denItemDef(id).abbrName)
phantomItems = phantomItems || gameOwnDenItemIds().filter(id => /phantom/i.test(defpacks.denItemDef(id).abbrName)
&& !/^Arc/.test(defpacks.denItemDef(id).abbrName) && defpacks.string(defpacks.denItemDef(id).nameStrId));
return phantomItems.length ? phantomItems : defpacks.denItemIds().slice(0, 1);
};
@@ -550,7 +560,7 @@ module.exports = ({tell, leaveRoom, findOnline, blocks, watchers}) => {
WindRider: {
go() {},
gw(session, game, params, reply) {
const ids = defpacks.clothingIds();
const ids = defpacks.clothingIds().filter(id => id < customItems.FIRST_ID);
const def = Math.random() < SKY_HIGH_PRIZE_CHANCE ? defpacks.itemDef(ids[Math.floor(Math.random() * ids.length)]) : null;
session.gamePrize = def ? {def: Number(def.id), color: Number(String(def.colors).split(",")[0])} : null;
reply("gw", def ? "1" : "0", def ? def.id : 0, 0, def ? session.gamePrize.color : 0);
+14 -4
View File
@@ -15,7 +15,7 @@ const TYPE_CLOTHING = 0;
const TYPE_DEN_ITEM = 1;
const TYPE_PET = 3;
const MAX_TRADE_ITEMS = 50;
const MAX_TRADE_ITEMS = 200; // on a trade list (the game sets no end to it; past this the rest were dropped)
const MAX_PETS = 1000; // as in lib/pets.js
// "ti" request steps (first parameter from the client)
@@ -46,7 +46,7 @@ const TRADES_KEPT = 50; // per account, for its page
const MAX_WAITING_OFFERS = 50; // offers left on one account
const MAX_OFFERS_MADE = 20; // by one account, still waiting
module.exports = ({findOnline, blocks}) => {
module.exports = ({findOnline, blocks, showTrading}) => {
// TradeManager.onTradeListReceived: [username, clothingCount, (defId,
// invIdx, color)..., denItemCount, (defId, invIdx, version, approved,
// imageId, creatorDbId, creatorUuid)..., petCount, (speciesId, invIdx,
@@ -138,6 +138,8 @@ module.exports = ({findOnline, blocks}) => {
const other = trade.requester === session ? trade.owner : trade.requester;
trade.requester.trade = trade.owner.trade = null;
other.sendXt("ti", -1, status, session.account.username, USERNAME_SHOWN);
showTrading(session);
showTrading(other);
};
// moves one entry between accounts. it gets a fresh inventory id, and
@@ -209,6 +211,8 @@ module.exports = ({findOnline, blocks}) => {
return;
}
session.trade = owner.trade = {requester: session, owner, wantedType, wanted, offered, accepted: false, confirmed: new Set()};
showTrading(session);
showTrading(owner);
// TradeManager.displayTradeRequested: [0, requesterName, moderatedFlag,
// wantedCode, wantedInvIdx, clothingCount, denCount, petCount, ...items]
const ofType = type => offered.filter(item => item.type === type);
@@ -251,6 +255,8 @@ module.exports = ({findOnline, blocks}) => {
}
const {requester, owner, wantedType, wanted, offered} = trade;
requester.trade = owner.trade = null;
showTrading(requester);
showTrading(owner);
// either side may have recycled or re-traded something while deciding.
const stillThere = collectionOf(owner.account, wantedType).includes(wanted)
&& offered.every(item => collectionOf(requester.account, item.type).includes(item.entry))
@@ -312,8 +318,12 @@ module.exports = ({findOnline, blocks}) => {
sendTradeList(session, account);
},
// ["1"/"0"]: busy flag while the trade window is open; nothing to answer.
tb() {},
// ["1"/"0"]: busy flag while the trade window is open; nothing to
// answer. it shows as the trading sign (lib/world.js showTrading).
tb(session, roomId, [busy]) {
session.tradeBusy = busy === "1";
showTrading(session);
},
ti(session, roomId, params) {
switch (params[0]) {
+30 -1
View File
@@ -794,6 +794,10 @@ const handlers = {
other.sendXt("au", session.room.id, 1, session.id, count, ...coords, teleport);
}
}
// a trade going on when they came in: the sign over them again
if (firstUpdate) {
showTrading(session);
}
},
// GenericListXtCommManager.handleNewData: [listId, entryType, 4 unused
@@ -1343,8 +1347,25 @@ const staffMove = (whoName, toName) => {
return {ok: true, room: shown};
};
// trading: a sign over the animal of a player in a trade, or with the trade
// window open, in everyone else's game (the patched AvatarWorldView.
// setTrading): "xtr" [.., .., sfsId, 1 | 0], told as it changes, and to
// whoever comes into the room (enterRoom).
const isTrading = session => Boolean(session.trade || session.tradeBusy);
const showTrading = session => {
const on = isTrading(session) && Boolean(session.room);
if (Boolean(session.tradingShown) === on) {
return;
}
session.tradingShown = on;
for (const other of watchers(session)) {
other.sendXt("xtr", -1, session.id, on ? 1 : 0);
}
};
const context = {
others: watchers,
showTrading,
watchers,
findOnline,
findBySfsId,
@@ -1398,6 +1419,9 @@ const leaveRoom = session => {
session.room = null;
session.pos = null;
delete session.activeAction;
// the sign goes with the animal; it comes back in the next room if the
// trade goes on there (showTrading)
session.tradingShown = false;
minigames.roomLeft(session);
for (const other of room.sessions) {
// AvatarManager.avatarRemoveResponse
@@ -1607,6 +1631,9 @@ const enterRoom = (session, name, base, displayName, shardId, props = {}) => {
for (const other of others(session)) {
if (other.pos && sees(session, other)) {
sendAvatarCreate(session, other);
if (other.tradingShown) {
session.sendXt("xtr", -1, other.id, 1);
}
}
}
return room;
@@ -1837,7 +1864,9 @@ module.exports = {
// embedded SWF labels outgoing user messages with the minigame's
// temporary sub-room id. Accept that id as well so its attachment
// reward can make the normal round trip back to the avatar.
if (session.room && (session.room.id === msg.roomId || (session.game && session.game.roomId === Number(msg.roomId)))) {
const fromGame = (session.game && session.game.roomId === Number(msg.roomId))
|| (session.lastGame && session.lastGame.roomId === Number(msg.roomId) && Date.now() < session.lastGame.until);
if (session.room && (session.room.id === msg.roomId || fromGame)) {
// at most text, type and one extra field, and no essays.
const fields = decodeEntities(msg.cdata("txt") || "").split("%").slice(0, 3);
if (fields[0].length > config.maxChatLength || (fields[2] || "").length > MAX_CHAT_EXTRA) {
+11
View File
@@ -1533,6 +1533,17 @@ package
}
}
// "xtr": [.., .., sfsId, 1 | 0]: another player trading, or not
// (lib/world.js showTrading).
public static function onTrading(param1:Object) : void
{
var _loc2_:AvatarWorldView = AvatarManager.avatarViewList != null ? AvatarManager.avatarViewList[int(param1[2])] as AvatarWorldView : null;
if(_loc2_ != null)
{
_loc2_.setTrading(String(param1[3]) == "1");
}
}
// "xyn": [.., .., id, text]. A yes-or-no box; the answer goes back as
// "xyn" [id, 1 | 0].
public static function askYesNo(param1:Object) : void
+9
View File
@@ -2212,6 +2212,15 @@ package gui
if(!DenAndClothesItemSelect.moreToCome)
{
openCloseTradeWindow();
// the list drawn again with all of it: each item added went into
// an empty window of the list, and with many picked at once
// there were too few of those, so the rest were not shown
if(_itemTradeWindows && avEditor.tradeBtnUp.visible)
{
_itemTradeWindows.destroy();
_itemTradeWindows = null;
createItemWindows(_currTradesArray,avEditor.itemBlock);
}
}
}
+47
View File
@@ -241,6 +241,8 @@ package avatar
private var _typing:Sprite;
private var _tradingSign:Sprite;
private var _typingDots:Array;
private var _typingTimer:Timer;
@@ -681,6 +683,8 @@ package avatar
}
_typing = null;
_typingDots = null;
setTrading(false);
_tradingSign = null;
removeChild(_namebar);
if(_secondaryEmot && _chatLayer.contains(_secondaryEmot))
{
@@ -1140,6 +1144,49 @@ package avatar
}
}
// trading (lib/world.js showTrading): a round sign with two arrows by
// the head, for as long as the trade goes on. a child of the animal's
// own, so it goes where the animal goes.
public function setTrading(param1:Boolean) : void
{
var _loc2_:Point = null;
if(!param1)
{
if(_tradingSign && _tradingSign.parent)
{
_tradingSign.parent.removeChild(_tradingSign);
}
return;
}
if(_tradingSign == null)
{
_tradingSign = new Sprite();
_tradingSign.mouseEnabled = false;
_tradingSign.mouseChildren = false;
_tradingSign.graphics.lineStyle(2,0x7F6744);
_tradingSign.graphics.beginFill(0xFFF2C4);
_tradingSign.graphics.drawCircle(0,0,12);
_tradingSign.graphics.endFill();
// an arrow to the right over one to the left
_tradingSign.graphics.lineStyle(2,0x4FA52F,1,false,"normal","round","round");
_tradingSign.graphics.moveTo(-6,-3);
_tradingSign.graphics.lineTo(6,-3);
_tradingSign.graphics.moveTo(3,-6);
_tradingSign.graphics.lineTo(6,-3);
_tradingSign.graphics.lineTo(3,0);
_tradingSign.graphics.lineStyle(2,0xD4482A,1,false,"normal","round","round");
_tradingSign.graphics.moveTo(6,4);
_tradingSign.graphics.lineTo(-6,4);
_tradingSign.graphics.moveTo(-3,1);
_tradingSign.graphics.lineTo(-6,4);
_tradingSign.graphics.lineTo(-3,7);
}
_loc2_ = _avatar ? AvatarUtility.getAvatarChatOffset(_avatar.avTypeId) : new Point(0,-80);
_tradingSign.x = _loc2_.x + 26;
_tradingSign.y = _loc2_.y + 16;
addChild(_tradingSign);
}
private function hideTyping() : void
{
if(_typingTimer)
+551
View File
@@ -0,0 +1,551 @@
package game.microSmoothie
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.utils.getTimer;
import game.GameBase;
import game.IMinigame;
import game.MinigameManager;
import game.SoundManager;
import gskinner.motion.GTween;
public class MicroSmoothie extends GameBase implements IMinigame
{
private static const MAX_VELOCITY_X:Number = 900;
private static const MAX_VELOCITY_Y:Number = 250;
private static const ACCELERATION_X:Number = 2500;
private static const ACCELERATION_Y:Number = 450;
private static const BRAKE_X:Number = 4000;
private static const BRAKE_Y:Number = 800;
private static const REQUIRED_FRUITS:int = 10;
public var _fruitTypesColor:Array;
public var _fruitTypes:Array;
public var myId:uint;
public var _pIDs:Array;
public var _dbIDs:Array;
private var _sceneLoaded:Boolean;
private var _bInit:Boolean;
public var _layerBack:Sprite;
public var _layerFront:Sprite;
public var _layerFruits:Sprite;
public var _layerCupFront:Sprite;
private var _lastTime:int;
private var _frameTime:Number;
private var _gameTime:Number;
private var _cupFront:Object;
private var _cupBack:Object;
private var _cupFrontMax:Object;
private var _cupBackMax:Object;
private var _fruitMachine:Object;
private var _ready:Object;
private var _congrats:Object;
private var _fruitStart:Object;
public var _leftArrowDown:Boolean;
public var _rightArrowDown:Boolean;
public var _downArrowDown:Boolean;
public var _upArrowDown:Boolean;
public var _nextFruitTimer:Number;
public var _congratsTimer:Number;
public var _velocityX:Number;
public var _fruitCaught:int;
public var _smoothieType:int;
private var _dismissDialogTimer:Number;
public var _soundMan:SoundManager;
public var _fruitStartSounds:Array;
private var _audio:Array = ["slushy_fruit_passby.mp3","slushy_fruit_passby2.mp3","slushy_correct_fruit.mp3","slushy_wrong_fruit.mp3","MG_popup_youWon.mp3"];
private var _soundNameFruitStart1:String = _audio[0];
private var _soundNameFruitStart2:String = _audio[1];
private var _soundNameCorrect:String = _audio[2];
private var _soundNameWrong:String = _audio[3];
private var _soundNamePlayerWins:String = _audio[4];
public function MicroSmoothie()
{
super();
_fruitTypesColor = new Array("purple","orange","red","yellow");
_fruitTypes = new Array("grapes","orange","strawberry","banana");
init();
}
private function loadSounds() : void
{
_fruitStartSounds = [];
_soundMan.addSoundByName(_audioByName[_soundNameFruitStart1],_soundNameFruitStart1,0.5);
_soundMan.addSoundByName(_audioByName[_soundNameFruitStart2],_soundNameFruitStart2,0.5);
_fruitStartSounds = new Array(_soundNameFruitStart1,_soundNameFruitStart2);
_soundMan.addSoundByName(_audioByName[_soundNameCorrect],_soundNameCorrect,0.8);
_soundMan.addSoundByName(_audioByName[_soundNameWrong],_soundNameWrong,0.8);
_soundMan.addSoundByName(_audioByName[_soundNamePlayerWins],_soundNamePlayerWins,0.35);
}
private function keyHandleUp(param1:KeyboardEvent) : void
{
switch(int(param1.keyCode) - 37)
{
case 0:
_leftArrowDown = false;
break;
case 1:
_upArrowDown = false;
break;
case 2:
_rightArrowDown = false;
break;
case 3:
_downArrowDown = false;
}
}
private function keyHandleDown(param1:KeyboardEvent) : void
{
switch(int(param1.keyCode) - 37)
{
case 0:
_leftArrowDown = true;
break;
case 1:
_upArrowDown = true;
break;
case 2:
_rightArrowDown = true;
break;
case 3:
_downArrowDown = true;
}
}
public function start(param1:uint, param2:Array) : void
{
myId = param1;
_pIDs = param2;
init();
}
public function end(param1:Array) : void
{
releaseBase();
stage.removeEventListener("keyUp",keyHandleUp);
stage.removeEventListener("keyDown",keyHandleDown);
stage.removeEventListener("enterFrame",heartbeat);
stage.removeEventListener("click",mouseClickHandler);
resetGame();
_bInit = false;
removeLayer(_layerBack);
removeLayer(_layerFront);
removeLayer(_layerFruits);
removeLayer(_layerCupFront);
removeLayer(_guiLayer);
_layerBack = null;
_layerFront = null;
_layerFruits = null;
_layerCupFront = null;
_guiLayer = null;
MinigameManager.leave();
}
private function init() : void
{
if(!_bInit)
{
_layerBack = new Sprite();
_layerFront = new Sprite();
_layerFruits = new Sprite();
_layerCupFront = new Sprite();
_layerBack.mouseEnabled = false;
_layerFront.mouseEnabled = false;
_layerFruits.mouseEnabled = false;
_layerCupFront.mouseEnabled = false;
_guiLayer = new Sprite();
addChild(_layerBack);
addChild(_layerFruits);
addChild(_layerFront);
addChild(_layerCupFront);
addChild(_guiLayer);
loadScene("SmoothieAssets/room_main.xroom",_audio);
_bInit = true;
}
else
{
startGame();
}
}
override protected function sceneLoaded(param1:Event) : void
{
var _loc3_:int = 0;
var _loc4_:Object = null;
var _loc2_:* = null;
_soundMan = new SoundManager(this);
loadSounds();
_loc4_ = _scene.getLayer("closeButton");
addBtn("CloseButton",_loc4_.x,_loc4_.y,onCloseButton);
_cupFront = _scene.getLayer("cupFront");
_cupBack = _scene.getLayer("cupBack");
_cupFrontMax = _scene.getLayer("cupFrontMax");
_cupBackMax = _scene.getLayer("cupBackMax");
_fruitMachine = _scene.getLayer("smoothieGame");
_layerBack.addChild(_scene.getLayer("smoothieBackground").loader);
_layerBack.addChild(_cupBack.loader);
_layerFruits.addChild(_fruitMachine.loader);
_layerCupFront.addChild(_cupFront.loader);
_congrats = _scene.getLayer("smoothieSuccess");
_leftArrowDown = false;
_rightArrowDown = false;
_downArrowDown = false;
_upArrowDown = false;
stage.addEventListener("keyUp",keyHandleUp);
stage.addEventListener("keyDown",keyHandleDown);
_sceneLoaded = true;
stage.addEventListener("enterFrame",heartbeat,false,0,true);
stage.addEventListener("click",mouseClickHandler);
startGame();
super.sceneLoaded(param1);
}
public function message(param1:Array) : void
{
var _loc3_:int = 0;
var _loc2_:int = 0;
if(param1[0] != "ml")
{
if(param1[0] == "ms")
{
_dbIDs = [];
_loc2_ = 0;
while(_loc2_ < _pIDs.length)
{
_dbIDs[_loc2_] = param1[_loc2_ + 1];
_loc2_++;
}
}
else if(param1[0] == "mm")
{
}
}
}
public function heartbeat(param1:Event) : void
{
var _loc3_:int = 0;
var _loc7_:* = null;
var _loc6_:Point = null;
var _loc5_:int = 0;
var _loc2_:int = 0;
var _loc4_:int = 0;
if(_sceneLoaded)
{
_frameTime = (getTimer() - _lastTime) / 1000;
if(_frameTime > 0.5)
{
_frameTime = 0.5;
}
_lastTime = getTimer();
if(_sceneLoaded)
{
_gameTime += _frameTime;
if(_fruitCaught < 10)
{
if(_dismissDialogTimer > 0)
{
_dismissDialogTimer -= _frameTime;
if(_dismissDialogTimer <= 0)
{
hideDlg();
_nextFruitTimer = 1.5;
}
}
else if(_nextFruitTimer >= 0)
{
_loc6_ = localToGlobal(new Point(_cupBack.loader.x,_cupBack.loader.y));
_loc5_ = int(_fruitMachine.loader.content.detectCollision(_loc6_.x,_loc6_.y,_cupBack.width,_cupBack.height + 75));
if(_loc5_ >= 0)
{
if(_loc5_ == _smoothieType)
{
_soundMan.playByName(_soundNameCorrect);
_fruitCaught += 2;
updateFruitMeter();
if(_fruitCaught >= 10)
{
new GTween(_fruitMachine.loader,0.5,{"alpha":0});
_guiLayer.addChild(_congrats.loader);
_congrats.loader.content.Ready_Text.gotoAndPlay("on");
if(_closeBtn)
{
_closeBtn.visible = false;
}
// the adventure's own smoothie machine (91) counts
// towards it; any other gives a smoothie, even when
// the game it is was not noted down (-1), where
// before it gave nothing
if(MinigameManager.minigameInfoCache && MinigameManager.minigameInfoCache.currMinigameId == 91)
{
MinigameManager.handleQuestMiniGameComplete(1);
}
else
{
MinigameManager.msg(["_a",2,_fruitTypesColor[_smoothieType]]);
}
_congratsTimer = 3;
_soundMan.playByName(_soundNamePlayerWins);
}
}
else
{
_soundMan.playByName(_soundNameWrong);
_cupFront.loader.content.loseSlush();
_fruitCaught -= 2;
if(_fruitCaught < 0)
{
_fruitCaught = 0;
}
updateFruitMeter();
}
}
_nextFruitTimer -= _frameTime;
if(_nextFruitTimer <= 0)
{
_loc2_ = Math.random() * 6;
if(_loc2_ >= 3)
{
_loc2_ = _smoothieType;
}
else if(_smoothieType == _loc2_)
{
_loc2_ = 3;
}
_nextFruitTimer = 0.5 + Math.random() * 0.5;
_fruitMachine.loader.content.createFruit(_loc2_);
_loc4_ = Math.random() * _fruitStartSounds.length;
_soundMan.playByName(_fruitStartSounds[_loc4_]);
}
_cupBack.loader.x = stage.mouseX - _cupFront.width / 2;
_cupFront.loader.x = stage.mouseX - _cupFront.width / 2;
if(_cupFront.loader.x < _cupFront.x)
{
_cupBack.loader.x = _cupBack.x;
_cupFront.loader.x = _cupFront.x;
}
else if(_cupFront.loader.x > _cupFrontMax.x)
{
_cupBack.loader.x = _cupBackMax.x;
_cupFront.loader.x = _cupFrontMax.x;
}
}
}
else
{
_congratsTimer -= _frameTime;
if(_congratsTimer <= 0)
{
end(null);
}
}
}
}
}
public function updateFruitMeter() : void
{
var _loc1_:int = 2;
if(_fruitCaught > 0)
{
_loc1_ = Math.max(3,_fruitCaught / 10 * 15 + 1);
if(_loc1_ > 16)
{
_loc1_ = 16;
}
}
_cupFront.loader.content.gotoAndStop(_loc1_);
}
public function updateControls() : void
{
if(stage.mouseX < _cupFront.loader.x + _cupFront.width / 5)
{
_velocityX -= 2500 * _frameTime;
if(_velocityX < -900)
{
_velocityX = -900;
}
}
else if(stage.mouseX > _cupFront.loader.x + 4 * _cupFront.width / 5)
{
_velocityX += 2500 * _frameTime;
if(_velocityX > 900)
{
_velocityX = 900;
}
}
else if(_velocityX > 0)
{
_velocityX -= 4000 * _frameTime;
if(_velocityX < 0)
{
_velocityX = 0;
}
}
else if(_velocityX < 0)
{
_velocityX += 4000 * _frameTime;
if(_velocityX > 0)
{
_velocityX = 0;
}
}
}
public function startGame() : void
{
var _loc2_:int = 0;
var _loc4_:* = null;
var _loc3_:Number = NaN;
var _loc1_:MovieClip = null;
_gameTime = 0;
_lastTime = getTimer();
_frameTime = 0;
_nextFruitTimer = -1;
_dismissDialogTimer = 0;
_fruitCaught = 0;
_velocityX = 0;
if(_sceneLoaded)
{
_loc3_ = (_cupFrontMax.x - _cupFront.x) / 2;
_cupFront.loader.x = _cupFront.x + _loc3_;
_cupBack.loader.x = _cupBack.x + _loc3_;
_cupFront.loader.content.gotoAndStop(2);
_loc1_ = showDlg("popup_flavor",[{
"name":"button_strawberry",
"f":onFlavorStrawberry
},{
"name":"button_orange",
"f":onFlavorOrange
},{
"name":"button_banana",
"f":onFlavorBanana
},{
"name":"button_grape",
"f":onFlavorGrape
}]);
_loc1_.x = 455;
_loc1_.y = 225;
}
}
public function resetGame() : void
{
var _loc1_:int = 0;
}
private function mouseClickHandler(param1:MouseEvent) : void
{
if(_sceneLoaded)
{
}
}
public function onCloseButton() : void
{
end(null);
}
public function onStart() : void
{
hideDlg();
if(_ready && _ready.loader.parent)
{
_ready.loader.parent.removeChild(_ready.loader);
}
_nextFruitTimer = 3;
}
public function selectFlavor(param1:int) : void
{
_smoothieType = param1;
_cupFront.loader.content.slush.gotoAndStop(_fruitTypesColor[_smoothieType]);
hideDlg();
var _loc2_:MovieClip = showDlg("popup_fillcup",[]);
_loc2_.x = 455;
_loc2_.y = 300;
_loc2_.gotoAndStop(_fruitTypes[_smoothieType]);
_dismissDialogTimer = 3;
addChild(_scene.getLayer("pickedFruit").loader);
}
public function onFlavorStrawberry() : void
{
_scene.getLayer("pickedFruit").loader.content.gotoAndStop("icon_strawberry");
selectFlavor(2);
}
public function onFlavorBanana() : void
{
_scene.getLayer("pickedFruit").loader.content.gotoAndStop("icon_banana");
selectFlavor(3);
}
public function onFlavorOrange() : void
{
_scene.getLayer("pickedFruit").loader.content.gotoAndStop("icon_orange");
selectFlavor(1);
}
public function onFlavorGrape() : void
{
_scene.getLayer("pickedFruit").loader.content.gotoAndStop("icon_grape");
selectFlavor(0);
}
}
}
File diff suppressed because it is too large. Load diff
+8 -3
View File
@@ -878,7 +878,9 @@ package gui
_loc32_.dispatchEvent(new AvatarEvent("OnAvatarChanged"));
}
GuiManager.showHudAvt();
closeRequestSentPopup();
// the "waiting" window goes quietly: the trade went through, and
// its failure sound played over the success one
closeRequestSentPopup(false);
}
else
{
@@ -2308,11 +2310,14 @@ package gui
}
}
private static function closeRequestSentPopup() : void
private static function closeRequestSentPopup(param1:Boolean = true) : void
{
if(_requestSentPopup && _requestSentPopup.visible)
{
AJAudio.playTradeFailedSound();
if(param1)
{
AJAudio.playTradeFailedSound();
}
DarkenManager.unDarken(_requestSentPopup);
if(_requestSentPopup.parent == _guiLayer)
{
+5
View File
@@ -135,6 +135,11 @@ package
AJClient.onMentions(param1.obj);
return;
}
if(param1.obj[0] == "xtr")
{
AJClient.onTrading(param1.obj);
return;
}
if(param1.obj[0] == "xty")
{
AJClient.onTyping(param1.obj);
BIN
View File
Binary file not shown.
+2
View File
@@ -96,6 +96,8 @@ set -- \
avatar.AvatarUtility AvatarUtility.as \
item.Item Item.as \
loader.DenItemHelper DenItemHelper.as \
game.MinigameManager MinigameManager.as \
game.microSmoothie.MicroSmoothie MicroSmoothie.as \
room.DenItemHolder ../tools/decompiled/room/DenItemHolder.as
# not in the game: added before the replace (game.ArtStudioKit is Strawberry
# Jam's, shared by its two art studio painters; gui.SitForwardAction is the