geodeincubator.swf
The Geode Incubator / Reliquary window lets players place eggs or reliquaries into one of three slots, apply Karma-based buff influences, and watch a hatching/opening reveal animation. It is opened from the Geode world's incubator or reliquary crafting stations.
Document/main class: GeodeIncubator (extends _kiwi.Core.UIComponent)
SWF-specific classes: 3 (GeodeIncubator, IncubationSlot, Equipped) + 4 GeodeIncubator_fla timeline classes + ~15 skin/asset wrappers
Main class: GeodeIncubator
GeodeIncubator orchestrates the three-slot incubator window. On construction it registers frame scripts (frames 1 and 11, both stop()), registers a drag-drop callback via SlotDragDropHelper.registerDropCallback, announces itself to the engine with ExternalInterface.call("OnConfigured", ROTATION_SPEED), and then registers eight ExternalInterface callbacks. In non-Iggy preview mode it populates slots with dummy data. Console mode initialises currentSelection to slot0 and makes it visually selected.
Public / internal methods
setIncubatorType(mode : int) : void— switches betweenMODE_EGG (0)andMODE_RELIQUARY (1), propagatingcurrentModeto all threeIncubationSlotinstances and updating the window title with$prefabs_placeable_crafting_incubator_item_name("Egg Incubator") or$prefabs_placeable_crafting_reliquary_item_name("Reliquary Revealer"). One screen serves both placeables; only the title and a few strings change.updateSlot(slotIdx, eggTex, petTex, timeRemaining, maxTime, locked) : void— times are in seconds (setTimeformatstimeRemaining * 1000ms). The engine resends this several times a second with a whole number of seconds. CallsIncubationSlot.setTime, sets textures and locked state. If a slot becomes empty (timeRemaining <= 0andmaxTime > 0) and the current console selection is aBaseButton, it auto-moves selection to that slot.setRewardText(slotIdx, text) : void— setsIncubationSlot.text(the top-label string). The reward text is built from$Incubator_GotReward("You got {0} {1}!"), so it spans two lines.setInfluencer(slotIdx, buffed) : void— marks that one slot as influenced: shows/hidesbuffedAnimationon a slot and enables/disablesbuffButton0; togglesslotframe to1(active) or2(inactive).setInfluenceInfo(buffIdx, iconPath, count, name, description) : void— describes one influence item for every slot at once (the first argument is the buff index, not a slot); updates the staticbuffInfoarray and refreshes all three slots' buff-button icons, counts, and enabled states.activateSelection() : void— console confirm: if selection is aBaseButton, firesonBuffSelected; otherwise enters the slot to trigger buff buttons, OK button, oronSlotClicked.cancel() : void— console back: if in a buff-button, returns selection to the parent slot; otherwise callsExternalInterface.call("OnRequestClose").moveSelection(dx, dy) : void— console D-pad: moves between slots (horizontal) or between buff buttons within a slot.
Key fields
slot0,slot1,slot2 : IncubationSlot— the three incubation slots.winTitleTextField : TextField— window title, set to a translate key bysetIncubatorType.currentMode : int—MODE_EGGorMODE_RELIQUARY; shared down to each slot.currentSelection : MovieClip— the currently focused element (a slot or buff button); itsselectedStatechild is toggled visible.NUM_SLOTS : Number = 3— iteration constant.ROTATION_SPEED : Number = 0.1308996938995747— radian/frame rotation speed reported to the engine on init (≈ 7.5°/frame).static buffInfo : Array— two-element array[{name, description}, {name, description}]holding the current influence tooltip data; read byIncubationSlot.onShowBuffTooltip.__id0_ : WindowHeaderSmall— the window's header bar (set disabled with empty title via component inspector).
Frame scripts / timeline
- Frame 1 (
frame1):stop(); frame labelPC. Placesslot0–slot2,winTitleTextField, the header and an unnamedWindowCloseButton. - Frame 11 (
frame11):stop(); frame labelConsole. Replaces the close button withbuttonLegendand re-places the frame art asframeMC.
Runtime dependencies & integration
ExternalInterface.call("OnConfigured", rotationSpeed)— sent on init so the engine can synchronise the 3-D egg spin speed.ExternalInterface.addCallback("setIncubatorType", …)— switches MODE_EGG / MODE_RELIQUARY.ExternalInterface.addCallback("updateSlot", …)— drives slot content and progress.ExternalInterface.addCallback("setRewardText", …)— sets the reward label on a slot.ExternalInterface.addCallback("setInfluencer", …)— marks a slot as currently buffed.ExternalInterface.addCallback("setInfluenceInfo", …)— pushes buff-button icon/count data.ExternalInterface.addCallback("activateSelection", …)— console confirm.ExternalInterface.addCallback("cancel", …)— console back / close.ExternalInterface.addCallback("moveSelection", …)— console D-pad.ExternalInterface.call("OnRequestClose")— fired when cancel pressed at top level.ExternalInterface.call("OnDroppedIntoSlot", slotIdx, itemId, itemExtra)— fired by drag-drop handler.IncubationSlotalso sendsOnSlotClicked(slotId),OnBuffClicked(slotId, buffIdx),OnResetSlot(slotId)(the OK button) andOnAnimationChanged(slotId, speed). The last drives the incubator model's spin in the world: 2 when a ready slot is clicked, ramped 2 → 100 over two seconds during the reveal, then back to 1.SlotDragDropHelper.registerDropCallback(onDrop)— wires item drag from inventory into incubator slots.
Other game-specific classes
IncubationSlot(extendsUIComponent, embedsassets.swf#symbol180) — the central game-logic class for each slot. Manages egg/petObjectPreviewtextures, a progress bar (progressBar.karmaMask.scaleX), top-label text with auto-shrink viaKiwiTextUtil.resizeFont, two buff buttons (buffButton0/1), an OK reset button, and anopenAnimation1/2reveal sequence. Key behaviors:setTime(timeRemaining, maxTime)— fills progress bar, detects "ready" state, shows open animations, posts soundPlay_ui_incubator_ready_to_hatchviaExternalInterface.call("POST_SOUND_EVENT", …).set eggTexture/set petTexture— onpetTexturearriving non-empty whileopenAnimation1is visible, triggers the fullIggyTween-based reveal sequence: egg brightens → speed ramps (ExternalInterface.call("OnAnimationChanged", slotId, speed)) → cross-fade egg→pet → fade animations out → show OK button.set locked— toggles button labels$Store_Locked,$Incubator_AddEgg,$Incubator_AddReliquary.- Buff buttons fire
ExternalInterface.call("OnBuffClicked", slotId, buffIdx)and show/hide tooltips viaExternalInterface.call("UIComponent.OnShowTooltip", …)/UIComponent.OnHideTooltip. - Pulse animation (
IggyTweenloop onglowPulse) active in RELIQUARY mode while egg is loaded. - IggyTween used extensively:
pulseAnimation,animation1–animation3,accelerate. - Translate keys:
$Incubator_ReadyToHatch,$Incubator_ReadyToOpen,$Store_Locked,$Incubator_AddEgg,$Incubator_AddReliquary,$OK.
GeodeIncubator_fla timeline symbols
equipped_50(embedsassets.swf#symbol18) — two-frame stop MovieClip (equipped indicator).icon_MC_7— icon MovieClip (no additional AS logic beyond base MovieClip).ButtonLegend_34(embedsassets.swf#symbol204) — console button-legend bar with four directional button refs (btnNorth/South/East/Westof typesbtn_console_*) and matching text fields; 5-frame timeline for different legend states.slotFrameLarge_48— large slot frame graphic (no logic).
Asset wrappers (no logic)
~15 classes: SlotBackground, SlotBackgroundLocked, SlotFrameHigh, SlotFrameMedium, SlotFrameNormal, slot_large, art, dummy, Equipped, Default_Button, btnGreen, btnGreenIcon_small, btnArrowLeft/Right/First/Last, AddUnlockButton, PreviewContainer, buff_slot, buff_slot_new, meter_karma, btn_console_north/south/east/west, btn_XBOne_A/B/X/Y — pure graphic symbols or trivial wrappers with no game logic.
Notable logic
- Rotation speed constant:
ROTATION_SPEED = Math.PI/24 ≈ 0.1309rad/frame is reported to the engine immediately on init as the incubator model's spin rate. - Reveal tween chain:
IncubationSlotexecutes a four-stageIggyTweensequence (egg brightness → speed acceleration → cross-fade → normalise) whenpetTextureis set while open animations are playing. Sound cues (Play_ui_incubator_common/Play_ui_incubator_uncommon) distinguish buffed vs unbuffed hatches. - Buff info static cache:
GeodeIncubator.buffInfois a static array shared across all slots soIncubationSlot.onShowBuffTooltipcan look up names/descriptions without holding a reference to the parent. - Progress bar:
IncubationSlot.setTimescalesprogressBar.karmaMask.scaleXproportionally totimeRemaining / maxTime(0 → 1).