JavaScript must be enabled to play.
Browser lacks capabilities required to play.
Upgrade or switch to another browser.
Loading…
<<nobr>> <h1><div class="gametitle"><img src="https://i.imgur.com/30UEn7N.png" class="home-icon"><span class="big-letter">C</span>ritter<span class="big-letter">N</span>est<img src="https://i.imgur.com/30UEn7N.png" class="home-icon1"></div></h1> <p1><strong>Breed adorable critters, explore fishing spots, and build your cozy haven!</strong> Unlock achievements, discover rare species, and watch your collection grow.</p1> <div class="two-columns"> <div class="left-column"><strong><p2>Locations</p2></strong> <div class="tagline">//Click an icon to travel...//</div> <center><div class="map-container"> <img src="https://i.imgur.com/vCFeQDQ.png" usemap="#image-map"> <map name="image-map"> <area target="" alt="The Lake" title="The Lake" href="javascript:void(0)" onclick="SugarCube.Engine.play('TheLake')" coords="233,165,233,194,270,194,270,182,259,182,259,165" shape="poly"> <area target="" alt="Marketplace" title="Marketplace" href="javascript:void(0)" onclick="SugarCube.Engine.play('SellCreatures')" coords="13,88,45,119" shape="rect"> <area target="" alt="Critter Corner" title="Critter Corner" href="javascript:void(0)" onclick="SugarCube.Engine.play('Shop')" coords="85,55,98,44,113,54,113,79,85,79" shape="poly"> <area target="" alt="Nursery" title="Nursery" href="javascript:void(0)" onclick="SugarCube.Engine.play('ViewBabies')" coords="201,69,201,86,233,87,234,54,210,54,210,68" shape="poly"> <area target="" alt="Home" title="Home" href="javascript:void(0)" onclick="SugarCube.Engine.play('Home')" coords="228,25,244,11,255,13,261,26,261,44,228,45" shape="poly"> <area target="" alt="Breeding Farm" title="Breeding Farm" href="javascript:void(0)" onclick="SugarCube.Engine.play('Breeding')" coords="266,66,266,45,282,31,298,44,298,66" shape="poly"> <area target="" alt="Hatchery" title="Hatchery" href="javascript:void(0)" onclick="SugarCube.Engine.play('ViewEggs')" coords="265,84,283,78,299,85,297,102,283,105,265,96" shape="poly"> <area target="" alt="Graveyard" title="Graveyard" href="javascript:void(0)" onclick="SugarCube.Engine.play('Memorial')" coords="209,98,221,88,233,98,234,124,209,124" shape="poly"> <area target="" alt="Clinic" title="Clinic" href="javascript:void(0)" onclick="SugarCube.Engine.play('VetClinic')" coords="83,97,100,89,116,98,116,122,83,123" shape="poly"> </map> </div> </center> <p2>At Home</p2> <div class="location-links"> <div class="location-column"> ➼<img src="https://i.imgur.com/Tv1IlhR.png" class="location-icon"><<link "Kitchen" "Kitchen">><</link>> <br> ➼<img src="https://i.imgur.com/OBvyX7q.png" class="location-icon"><<link "Pantry" "FeedCreature">><</link>> <br> ➼<img src="https://i.imgur.com/uODqOMH.png" class="location-icon"><<link "Bathroom" "CareCreature">><</link>> <br> <<if $freelancingAttempts <= 0>> ➼<img src="https://i.imgur.com/c1sxiNm.png" class="location-icon"><<link "Freelancing" "Composition">><</link>> <<else>> ➼Freelancing <</if>> <br> ➼<img src="https://i.imgur.com/ttY1SO0.png" class="location-icon"><<link "Inventory" "Inventory">><</link>> <br> ➼<img src="https://i.imgur.com/Zu90o1D.png" class="location-icon"><<link "Trophies" "Achievements">><</link>> </div></div> <div class="endday-link"> <<link "End Day?" "EndDay">> <<set $currentDay += 1>> <<set $isRainy = (random(1, 100) <= 15)>> <<set $fishingAttempts to 0>> <<set $freelancingAttempts to 0>> <</link>> </div> </div> <div class="right-column"><p2><strong>Your Critters </strong><<link "[View]" "ViewAdults">><</link>></p2> <br> <div class="tagline">//Click the name to view profile//</div> <<set _displayCreatures to $playerCreatures.filter(function(c) { return c.stage !== "egg"; })>> <<for _i = 0; _i < Math.min(2, _displayCreatures.length); _i++>> <<capture _i>> <<set _template to setup.creatureTemplates[_displayCreatures[_i].name]>> <<set _size to _displayCreatures[_i].displayTraits.size>> <<set _color to _displayCreatures[_i].displayTraits.color>> <<if _displayCreatures[_i].stage === "baby">> <!-- BABY DISPLAY --> <div class="creature-display"> <<set _babySpriteSheet to _template.avatars.babySpriteSheets[_size]>> <<set _col to _template.babySpriteColumns[_color]>> <<if _size === "large">> <<set _xPos to _col * -180>> <<set _dimensions to "180px">> <<elseif _size === "medium">> <<set _xPos to _col * -120>> <<set _dimensions to "120px">> <<else>> <<set _xPos to _col * -60>> <<set _dimensions to "60px">> <</if>> <div class="creature-layers" @style="'width: ' + _dimensions + '; height: ' + _dimensions + ';'"> <div class="creature-sprite-pattern" @style="'background-image: url(' + _babySpriteSheet + '); background-position: ' + _xPos + 'px 0px; width: ' + _dimensions + '; height: ' + _dimensions + ';'"> </div> </div> </div> <<else>> <!-- ADULT DISPLAY (your existing code) --> <div class="creature-display-case"> <div class="creature-display"> <<set _pattern to _displayCreatures[_i].displayTraits.pattern>> <<set _spriteSheet to _template.avatars.patternSpriteSheets[_size]>> <<set _colorPattern to _color + "_" + _pattern>> <<set _col to _template.spriteColumns[_colorPattern]>> <<if _size === "large">> <<set _xPos to _col * -240>> <<set _dimensions to "240px">> <<elseif _size === "medium">> <<set _xPos to _col * -160>> <<set _dimensions to "160px">> <<else>> <<set _xPos to _col * -80>> <<set _dimensions to "80px">> <</if>> <div class="creature-layers" @style="'width: ' + _dimensions + '; height: ' + _dimensions + ';'"> <div class="creature-sprite-pattern" @style="'background-image: url(' + _spriteSheet + '); background-position: ' + _xPos + 'px 0px; width: ' + _dimensions + '; height: ' + _dimensions + ';'"> </div> </div> </div> </div> <</if>> <br> <div class="creature-links"> <<if ndef _displayCreatures[_i].petName>><<link _displayCreatures[_i].name "ViewCreature">> <<set $currentCreature = _i>> <</link>><<else>><<link _displayCreatures[_i].petName "ViewCreature">> <<set $currentCreature = _i>> <</link>><</if>> <<if _displayCreatures[_i].gender === "Male">>♂️<<else>>♀️<</if>><br><br> </div> <</capture>> <</for>> </div></div> <</nobr>>
<<set setup.creatureTemplates = { "Caervira": { name: "Caervira", type: "Forest", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/wvDkNgW.png", medium: "https://i.imgur.com/3qv3s5h.png", large: "https://i.imgur.com/QCzTAQz.png" }, babySpriteSheets: { small: "https://i.imgur.com/gh5YEjh.png", medium: "https://i.imgur.com/B6WO2bm.png", large: "https://i.imgur.com/KVeSUKe.png" } }, spriteColumns: { brown_solid: 0, brown_stripes: 1, brown_spots: 2, beige_solid: 3, beige_stripes: 4, beige_spots: 5, tan_solid: 6, tan_stripes: 7, tan_spots: 8, black_solid: 9, black_stripes: 10, black_spots: 11, white_solid: 12, white_stripes: 13, white_spots: 14 }, babySpriteColumns: { brown: 0, beige: 1, tan: 2, black: 3, white: 4 }, rarity: "Common", flavorText: "Gentle and curious, Caevira wander forest trails collecting small treasures. They’re friendly companions who bond quickly with patient breeders.", careCur: 80, careMax: 100, affectionCur: 30, affectionMax: 100, fertility: 50, possibleColors: ["brown", "tan", "black", "beige", "white"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["brown", "tan", "beige", "white", "black"], patternDominance: ["solid", "stripes", "spots"] }, "Urcanis": { name: "Urcanis", type: "Mountain", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/JttuQas.png", medium: "https://i.imgur.com/UQstNXA.png", large: "https://i.imgur.com/YnnqXBx.png" }, babySpriteSheets: { small: "https://i.imgur.com/FnCrBGB.png", medium: "https://i.imgur.com/WMbtazX.png", large: "https://i.imgur.com/58TqFc7.png" } }, spriteColumns: { brown_solid: 0, brown_stripes: 1, brown_spots: 2, beige_solid: 3, beige_stripes: 4, beige_spots: 5, tan_solid: 6, tan_stripes: 7, tan_spots: 8, black_solid: 9, black_stripes: 10, black_spots: 11, white_solid: 12, white_stripes: 13, white_spots: 14 }, babySpriteColumns: { brown: 0, beige: 1, tan: 2, black: 3, white: 4 }, rarity: "Common", flavorText: "A sturdy critter with a mellow spirit, Urcanis enjoy lounging on warm rocks. They’re dependable helpers who adapt easily to any home.", careCur: 80, careMax: 100, affectionMax: 100, affectionCur: 30, fertility: 50, possibleColors: ["brown", "tan", "black", "beige", "white"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["brown", "black", "tan", "beige", "white"], patternDominance: ["solid", "spots", "stripes"] }, "Capranis": { name: "Capranis", type: "Mountain", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/U8wcsUo.png", medium: "https://i.imgur.com/Ln7hPfI.png", large: "https://i.imgur.com/T30BjQg.png" }, babySpriteSheets: { small: "https://i.imgur.com/HyIXg75.png", medium: "https://i.imgur.com/8Hpdcr4.png", large: "https://i.imgur.com/B89XrQj.png" } }, spriteColumns: { red_solid: 0, red_stripes: 1, red_spots: 2, orange_solid: 3, orange_stripes: 4, orange_spots: 5, brown_solid: 6, brown_stripes: 7, brown_spots: 8, tan_solid: 9, tan_stripes: 10, tan_spots: 11, black_solid: 12, black_stripes: 13, black_spots: 14 }, babySpriteColumns: { red: 0, orange: 1, brown: 2, tan: 3, black: 4 }, rarity: "Uncommon", flavorText: "Playful and sure-footed, Capranis love bounding across rugged terrain. Their upbeat nature makes them a favorite among new collectors.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["brown", "tan", "black", "red", "orange"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["red", "orange", "brown", "tan", "black"], patternDominance: ["stripes", "spots", "solid"] }, "Chiroden": { name: "Chiroden", type: "Mountain", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/pXyIPn2.png", medium: "https://i.imgur.com/0Q5kLpv.png", large: "https://i.imgur.com/gR61i0L.png" }, babySpriteSheets: { small: "https://i.imgur.com/iHaVdPi.png", medium: "https://i.imgur.com/0j7plmx.png", large: "https://i.imgur.com/bId55oj.png" } }, spriteColumns: { purple_solid: 0, purple_stripes: 1, purple_spots: 2, blue_solid: 3, blue_stripes: 4, blue_spots: 5, black_solid: 6, black_stripes: 7, black_spots: 8, brown_solid: 9, brown_stripes: 10, brown_spots: 11, white_solid: 12, white_stripes: 13, white_spots: 14 }, babySpriteColumns: { purple: 0, blue: 1, black: 2, brown: 3, white: 4 }, rarity: "Common", flavorText: "Quiet and clever, Chiroden prefer cozy caves and twilight skies. Despite their shyness, they form strong connections with kind caretakers.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["brown", "blue", "black", "purple", "white"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["purple", "blue", "black", "brown", "white"], patternDominance: ["solid", "spots", "stripes"] }, "Cetium": { name: "Cetium", type: "Aether", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/nwh4OXR.png", medium: "https://i.imgur.com/oHdgrol.png", large: "https://i.imgur.com/Y6FSOI8.png" }, babySpriteSheets: { small: "https://i.imgur.com/oa2dKac.png", medium: "https://i.imgur.com/8byD2yR.png", large: "https://i.imgur.com/LYTYp35.png" } }, spriteColumns: { darkpurple_solid: 0, darkpurple_starry: 1, darkpurple_spots: 2, purple_solid: 3, purple_starry: 4, purple_spots: 5, black_solid: 6, black_starry: 7, black_spots: 8, pink_solid: 9, pink_starry: 10, pink_spots: 11, white_solid: 12, white_starry: 13, white_spots: 14 }, babySpriteColumns: { darkpurple: 0, purple: 1, black: 2, pink: 3, white: 4 }, rarity: "Rare", flavorText: "Mysterious and serene, Cetium drift gracefully through open spaces as if guided by unseen winds. They’re said to bring clarity and calm to any nest.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["purple", "darkpurple", "black", "pink", "white"], possiblePatterns: ["solid", "starry", "spots"], possibleSizes: ["small", "medium", "large"], colorDominance: ["darkpurple", "purple", "black", "pink", "white"], patternDominance: ["starry", "spots", "solid"] }, "Zerdasus": { name: "Zerdasus", type: "Desert", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/9qC5O0g.png", medium: "https://i.imgur.com/A2cwNJp.png", large: "https://i.imgur.com/Zp5jRyF.png" }, babySpriteSheets: { small: "https://i.imgur.com/4Ofupg7.png", medium: "https://i.imgur.com/nj8kM5p.png", large: "https://i.imgur.com/cOkloBM.png" } }, spriteColumns: { orangeblack_solid: 0, orangeblack_stripes: 1, orangeblack_spots: 2, orange_solid: 3, orange_stripes: 4, orange_spots: 5, black_solid: 6, black_stripes: 7, black_spots: 8, blackwhite_solid: 9, blackwhite_stripes: 10, blackwhite_spots: 11, whiteblack_solid: 12, whiteblack_stripes: 13, whiteblack_spots: 14 }, babySpriteColumns: { orangeblack: 0, orange: 1, black: 2, blackwhite: 3, whiteblack: 4 }, rarity: "Uncommon", flavorText: "Energetic and alert, Zerdasus thrive under the hot sun and enjoy exploring hidden dunes. They learn tricks quickly and love showing off.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["orange", "blackwhite", "black", "orangeblack", "whiteblack"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["orangeblack", "orange", "black", "blackwhite", "whiteblack"], patternDominance: ["stripes", "spots", "solid"] }, "Dipothio": { name: "Dipothio", type: "Desert", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/cWVb31C.png", medium: "https://i.imgur.com/QBFtEbY.png", large: "https://i.imgur.com/rZrTHcM.png" }, babySpriteSheets: { small: "https://i.imgur.com/ccx5aGX.png", medium: "https://i.imgur.com/iebpKkm.png", large: "https://i.imgur.com/GEP2tFG.png" } }, spriteColumns: { brown_solid: 0, brown_stripes: 1, brown_spots: 2, beige_solid: 3, beige_stripes: 4, beige_spots: 5, tan_solid: 6, tan_stripes: 7, tan_spots: 8, black_solid: 9, black_stripes: 10, black_spots: 11, white_solid: 12, white_stripes: 13, white_spots: 14 }, babySpriteColumns: { brown: 0, beige: 1, tan: 2, black: 3, white: 4 }, rarity: "Uncommon", flavorText: "A patient burrow-dweller, Dipothio spends much of its time resting in cool sands. Once befriended, it becomes a loyal and steady partner.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["brown", "tan", "black", "beige", "white"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["brown", "tan", "beige", "black", "white"], patternDominance: ["solid", "spots", "stripes"] }, "Amphorea": { name: "Amphorea", type: "River", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/d78zjoD.png", medium: "https://i.imgur.com/TQHC7CE.png", large: "https://i.imgur.com/AO6dVOL.png" }, babySpriteSheets: { small: "https://i.imgur.com/8nY07ko.png", medium: "https://i.imgur.com/uYNOhzC.png", large: "https://i.imgur.com/355AMLq.png" } }, spriteColumns: { lightpurple_solid: 0, lightpurple_stripes: 1, lightpurple_spots: 2, purple_solid: 3, purple_stripes: 4, purple_spots: 5, blue_solid: 6, blue_stripes: 7, blue_spots: 8, darkpurple_solid: 9, darkpurple_stripes: 10, darkpurple_spots: 11, darkblue_solid: 12, darkblue_stripes: 13, darkblue_spots: 14 }, babySpriteColumns: { lightpurple: 0, purple: 1, blue: 2, darkpurple: 3, darkblue: 4 }, rarity: "Uncommon", flavorText: "Amphorea adore splashing through streams and collecting smooth stones. They’re gentle souls who get along with almost every other critter.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["purple", "blue", "darkblue", "darkpurple", "lightpurple"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["lightpurple", "purple", "blue", "darkpurple", "darkblue"], patternDominance: ["spots", "solid", "stripes"] }, "Tiadylus": { name: "Tiadylus", type: "Jungle", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/hNrdaE8.png", medium: "https://i.imgur.com/E1JffAw.png", large: "https://i.imgur.com/2cmKbfZ.png" }, babySpriteSheets: { small: "https://i.imgur.com/RzJ0X3N.png", medium: "https://i.imgur.com/TYQ9ZGQ.png", large: "https://i.imgur.com/91SSYc5.png" } }, spriteColumns: { orange_solid: 0, orange_stripes: 1, orange_spots: 2, brown_solid: 3, brown_stripes: 4, brown_spots: 5, tan_solid: 6, tan_stripes: 7, tan_spots: 8, black_solid: 9, black_stripes: 10, black_spots: 11, white_solid: 12, white_stripes: 13, white_spots: 14 }, babySpriteColumns: { orange: 0, brown: 1, tan: 2, black: 3, white: 4 }, rarity: "Uncommon", flavorText: "Stealthy and observant, Tiadylus move silently through dense foliage. They appreciate calm environments and reward attentive keepers with deep trust.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["brown", "tan", "black", "orange", "white"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["orange", "brown", "tan", "black", "white"], patternDominance: ["stripes", "spots", "solid"] }, "Falciphus": { name: "Falciphus", type: "Volcano", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/qLRFY3g.png", medium: "https://i.imgur.com/1n13rxB.png", large: "https://i.imgur.com/kFGxIDL.png" }, babySpriteSheets: { small: "https://i.imgur.com/IZBEduB.png", medium: "https://i.imgur.com/AcOjhr9.png", large: "https://i.imgur.com/IMCI9Pz.png" } }, spriteColumns: { gray_solid: 0, gray_stripes: 1, gray_spots: 2, black_solid: 3, black_stripes: 4, black_spots: 5, brown_solid: 6, brown_stripes: 7, brown_spots: 8, white_solid: 9, white_stripes: 10, white_spots: 11, silver_solid: 12, silver_stripes: 13, silver_spots: 14 }, babySpriteColumns: { gray: 0, black: 1, brown: 2, white: 3, silver: 4 }, rarity: "Rare", flavorText: "Bold and spirited, Falciphus thrive near heat and challenge. Their fierce determination makes them exceptional partners for experienced breeders.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["brown", "gray", "black", "silver", "white"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["gray", "black", "brown", "white", "silver"], patternDominance: ["solid", "stripes", "spots"] }, "Noctulo": { name: "Noctulo", type: "Forest", staminaCur: 3, staminaMax: 3, avatars: { patternSpriteSheets: { small: "https://i.imgur.com/ilGfHkH.png", medium: "https://i.imgur.com/RcDSo3C.png", large: "https://i.imgur.com/YaHc35S.png", }, babySpriteSheets: { small: "https://i.imgur.com/t51Svky.png", medium: "https://i.imgur.com/xyqqnsu.png", large: "https://i.imgur.com/01krpv7.png" } }, spriteColumns: { tan_solid: 0, tan_stripes: 1, tan_spots: 2, beige_solid: 3, beige_stripes: 4, beige_spots: 5, brown_solid: 6, brown_stripes: 7, brown_spots: 8, white_solid: 9, white_stripes: 10, white_spots: 11, black_solid: 12, black_stripes: 13, black_spots: 14 }, babySpriteColumns: { tan: 0, beige: 1, brown: 2, white: 3, black: 4 }, rarity: "Common", flavorText: "Noctulo are lively dusk-dwellers who enjoy fluttering between treetops. They’re playful companions that brighten any woodland outing.", careMax: 100, affectionMax: 100, careCur: 80, affectionCur: 30, fertility: 50, possibleColors: ["brown", "tan", "black", "beige", "white"], possiblePatterns: ["solid", "spots", "stripes"], possibleSizes: ["small", "medium", "large"], colorDominance: ["tan", "beige", "brown", "white", "black"], patternDominance: ["stripes", "solid", "spots"] } }>> <<set $playerCreatures to []>> <<set $deadCreatures to []>> <<set $currentDay = 1>> <<set $isRainy = false>> <<set $fishingAttempts = 0>> <<set $vetServiceComplete = "">> <<set $money = 1000>> <<set $maxEggSlots to 6>> <<set $eggSlotUpgradeCost to 200>> <<set $creaturesForSale to []>> <<set $pendingSales to []>> <<set $currentCreature = null>> <<set $escapedCreatures to []>> <<set $requests = []>> <<set $completedRequests = { simple: 0, medium: 0, complex: 0 }>> <<set $requestsUnlocked = { simple: true, medium: false, complex: false }>> <<set $lastRequestRefreshDay = 0>> <<set _randomCreature1 to Object.values(setup.creatureTemplates).filter(function(c) { return c.rarity === "Common"; }).random()>> <<set $creature1 = clone(_randomCreature1)>> <<set $creature1.id = random(100000, 999999)>> <<set $creature1.gender = either("Male", "Female")>> <<set $creature1.genes = { color: [_randomCreature1.possibleColors.random(), _randomCreature1.possibleColors.random()], pattern: [_randomCreature1.possiblePatterns.random(), _randomCreature1.possiblePatterns.random()], size: [_randomCreature1.possibleSizes.random(), _randomCreature1.possibleSizes.random()] }>> <<set $creature1.displayTraits = { color: getDisplayedTrait($creature1.genes.color[0], $creature1.genes.color[1], _randomCreature1.colorDominance), pattern: getDisplayedTrait($creature1.genes.pattern[0], $creature1.genes.pattern[1], _randomCreature1.patternDominance), size: getBlendedSize($creature1.genes.size[0], $creature1.genes.size[1], _randomCreature1.possibleSizes) }>> <<if $creature1.displayTraits.size === "large">> <<set $creature1.hungerCur = 120>> <<set $creature1.hungerMax = 120>> <<elseif $creature1.displayTraits.size === "medium">> <<set $creature1.hungerCur = 100>> <<set $creature1.hungerMax = 100>> <<else>> <<set $creature1.hungerCur = 80>> <<set $creature1.hungerMax = 80>> <</if>> <<set $creature1.stage to "adult">> <<set $creature1.age to 5>> <<set $creature1.hadSurgery = false>> <<set $creature1.geneticTestingDone = false>> <<set $creature1.generation to 1>> <<set $creature1.fedCount to 0>> <<set $creature1.lastFedDay to $currentDay>> <<set $creature1.caredCount to 0>> <<set $creature1.lastCaredDay to $currentDay>> <<set $creature1.fertilityOffset to random(0, 19)>> <<set $creature1.lastFertileDay to 0>> <<run $playerCreatures.push($creature1)>> <<set _randomCreature2 to Object.values(setup.creatureTemplates).filter(function(c) { return c.rarity === "Common" && c.name !== _randomCreature1.name; }).random()>> <<set $creature2 = clone(_randomCreature2)>> <<set $creature2.id = random(100000, 999999)>> <<set $creature2.gender = either("Male", "Female")>> <<set $creature2.genes = { color: [_randomCreature2.possibleColors.random(), _randomCreature2.possibleColors.random()], pattern: [_randomCreature2.possiblePatterns.random(), _randomCreature2.possiblePatterns.random()], size: [_randomCreature2.possibleSizes.random(), _randomCreature2.possibleSizes.random()] }>> <<set $creature2.displayTraits = { color: getDisplayedTrait($creature2.genes.color[0], $creature2.genes.color[1], _randomCreature2.colorDominance), pattern: getDisplayedTrait($creature2.genes.pattern[0], $creature2.genes.pattern[1], _randomCreature2.patternDominance), size: getBlendedSize($creature2.genes.size[0], $creature2.genes.size[1], _randomCreature2.possibleSizes) }>> <<if $creature2.displayTraits.size === "large">> <<set $creature2.hungerCur = 120>> <<set $creature2.hungerMax = 120>> <<elseif $creature2.displayTraits.size === "medium">> <<set $creature2.hungerCur = 100>> <<set $creature2.hungerMax = 100>> <<else>> <<set $creature2.hungerCur = 80>> <<set $creature2.hungerMax = 80>> <</if>> <<set $creature2.stage to "adult">> <<set $creature2.age to 5>> <<set $creature2.hadSurgery = false>> <<set $creature2.geneticTestingDone = false>> <<set $creature2.generation to 1>> <<set $creature2.fedCount to 0>> <<set $creature2.lastFedDay to $currentDay>> <<set $creature2.caredCount to 0>> <<set $creature2.lastCaredDay to $currentDay>> <<set $creature2.fertilityOffset to random(0, 19)>> <<set $creature2.lastFertileDay to 0>> <<run $playerCreatures.push($creature2)>> <<set setup.typeBackgrounds = { "Forest": "https://i.imgur.com/l71nP47.png", "Mountain": "https://i.imgur.com/IVG7p2r.png", "Aether": "https://i.imgur.com/CwL6Z10.png", "Desert": "https://i.imgur.com/t4RBZ12.png", "River": "https://i.imgur.com/py0HA0y.png", "Jungle": "https://i.imgur.com/eZ4BKzj.png", "Volcano": "https://i.imgur.com/32mLz2B.jpeg" }>> <<set $shopCategory = "All">> <<set setup.items = { /* CREATURES */ "Caervira": { id: "Caervira", name: "Caervira", category: "Creatures", basePrice: 300, monsterType: "Forest", image: "https://i.imgur.com/gu2TnJf.png", description: "A Forest-type creature.", rarity: "Common", isConsumable: false, requiresMonster: false }, "Noctulo": { id: "Noctulo", name: "Noctulo", category: "Creatures", basePrice: 400, monsterType: "Forest", image: "https://i.imgur.com/vJg8tuA.png", description: "A Forest-type creature.", rarity: "Common", isConsumable: false, requiresMonster: false }, "Urcanis": { id: "Urcanis", name: "Urcanis", category: "Creatures", basePrice: 300, monsterType: "Mountain", image: "https://i.imgur.com/njtr0AK.png", description: "A Mountain-type creature.", rarity: "Common", isConsumable: false, requiresMonster: false }, "Capranis": { id: "Capranis", name: "Capranis", category: "Creatures", basePrice: 400, monsterType: "Mountain", image: "https://i.imgur.com/UVCuzO7.png", description: "A Mountain-type monster.", rarity: "Uncommon", isConsumable: false, requiresMonster: false }, "Chiroden": { id: "Chiroden", name: "Chiroden", category: "Creatures", basePrice: 400, monsterType: "Mountain", image: "https://i.imgur.com/j9mgLds.png", description: "A Mountain-type creature.", rarity: "Common", isConsumable: false, requiresMonster: false }, "Amphorea": { id: "Amphorea", name: "Amphorea", category: "Creatures", basePrice: 500, monsterType: "River", image: "https://i.imgur.com/XcSWIGH.png", description: "A flowing River-type creature.", rarity: "Uncommon", isConsumable: false, requiresMonster: false }, "Dipothio": { id: "Dipothio", name: "Dipothio", category: "Creatures", basePrice: 600, monsterType: "Desert", image: "https://i.imgur.com/s4KCFbw.png", description: "A jumpy Desert-type creature.", rarity: "Uncommon", isConsumable: false, requiresMonster: false }, "Zerdasus": { id: "Zerdasus", name: "Zerdasus", category: "Creatures", basePrice: 700, monsterType: "Desert", image: "https://i.imgur.com/MdyK1d4.png", description: "A fierce Desert-type creature.", rarity: "Uncommon", isConsumable: false, requiresMonster: false }, "Tiadylus": { id: "Tiadylus", name: "Tiadylus", category: "Creatures", basePrice: 800, monsterType: "Jungle", image: "https://i.imgur.com/SLJvRY0.png", description: "A wild Jungle-type creature.", rarity: "Uncommon", isConsumable: false, requiresMonster: false }, "Falciphus": { id: "Falciphus", name: "Falciphus", category: "Creatures", basePrice: 900, monsterType: "Volcano", image: "https://i.imgur.com/hplfB08.png", description: "A wild creature from the Volcanic regions.", rarity: "Rare", isConsumable: false, requiresMonster: false }, "Cetium": { id: "Cetium", name: "Cetium", category: "Creatures", basePrice: 1000, monsterType: "Aether", image: "https://i.imgur.com/9R1wmwh.png", description: "A mystical Aether-type creature.", rarity: "Rare", isConsumable: false, requiresMonster: false }, /* MEDICINE */ "CarePotion": { id: "CarePotion", name: "Care Potion", category: "Consumables", basePrice: 40, image: "https://i.imgur.com/Danc2bM.png", description: "A beverage-type medicine for restoring 20 care points.", rarity: "Common", isConsumable: true, requiresMonster: true }, "EnergyDrink": { id: "EnergyDrink", name: "Energy Drink", category: "Consumables", basePrice: 60, image: "https://i.imgur.com/hUsByXM.png", description: "A beverage for raising energy levels. Restores 30 Physical Energy Points to a creature.", rarity: "Common", isConsumable: true, requiresMonster: true }, /* FOOD */ "CreatureChow": { id: "CreatureChow", name: "Creature Chow", category: "Consumables", basePrice: 20, image: "https://i.imgur.com/vbQR804.png", description: "Basic nutritious food for creatures.", rarity: "Common", isConsumable: false, requiresMonster: false }, /* ITEMS */ "ScrollFertility": { id: "ScrollFertility", name: "Scroll of Fertility", category: "Items", basePrice: 100, image: "https://i.imgur.com/mWbF7UO.png", description: "An ancient scroll that grants fertility to a creature. Increases fertility by 25% for one day.", rarity: "Common", isConsumable: true, requiresMonster: true }, /* ACCESSORIES */ "BowHeadband": { id: "BowHeadband", name: "Bow Headband", category: "Accessories", basePrice: 150, image: "https://via.placeholder.com/150/e91e63/ffffff?text=Bow", description: "A cute headband with a decorative bow. Increases affection gain by 10% when worn.", rarity: "Common", isConsumable: false, requiresMonster: true, isAccessory: true }, /* INGREDIENTS */ "CookingOil": { id: "CookingOil", name: "Cooking Oil", category: "Ingredients", basePrice: 10, image: "https://i.imgur.com/O6GHV5T.png", description: "", rarity: "Common", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Herbs": { id: "Herbs", name: "Herbs", category: "Ingredients", basePrice: 10, image: "https://i.imgur.com/QEiQ9VM.png", description: "", rarity: "Common", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Berries": { id: "Berries", name: "Berries", category: "Ingredients", basePrice: 10, image: "https://i.imgur.com/QRTqK6k.png", description: "", rarity: "Common", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Flour": { id: "Flour", name: "Flour", category: "Ingredients", basePrice: 10, image: "https://i.imgur.com/8NRXksc.png", description: "", rarity: "Common", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Sugar": { id: "Sugar", name: "Sugar", category: "Ingredients", basePrice: 10, image: "https://i.imgur.com/RcfFLB3.png", description: "", rarity: "Common", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Tomatoes": { id: "Tomatoes", name: "Tomatoes", category: "Ingredients", basePrice: 15, image: "https://i.imgur.com/GVaobZY.png", description: "", rarity: "Uncommon", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Onions": { id: "Onions", name: "Onions", category: "Ingredients", basePrice: 15, image: "https://i.imgur.com/OzoqVn5.png", description: "", rarity: "Uncommon", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Rice": { id: "Rice", name: "Rice", category: "Ingredients", basePrice: 15, image: "https://i.imgur.com/JgQxOBk.png", description: "", rarity: "Uncommon", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Pasta": { id: "Pasta", name: "Pasta", category: "Ingredients", basePrice: 15, image: "https://i.imgur.com/AxyU3FN.png", description: "", rarity: "Uncommon", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Coconut": { id: "Coconut", name: "Coconut", category: "Ingredients", basePrice: 25, image: "https://i.imgur.com/4edSX7o.png", description: "", rarity: "Rare", isConsumable: false, requiresMonster: false, isAccessory: false, }, "PickledVeggies": { id: "PickledVeggies", name: "Pickled Vegetables", category: "Ingredients", basePrice: 25, image: "https://i.imgur.com/Iq2obyU.png", description: "", rarity: "Rare", isConsumable: false, requiresMonster: false, isAccessory: false, }, "Saffron": { id: "Saffron", name: "Saffron", category: "Ingredients", basePrice: 25, image: "https://i.imgur.com/qgXonoi.png", description: "", rarity: "Rare", isConsumable: false, requiresMonster: false, isAccessory: false, }, /* FISH (no shop purchase) */ "YellowPerch": { id: "YellowPerch", name: "Yellow Perch", image: "https://i.imgur.com/L0Ja1ae.png", description: "A small schooling fish prized for its sweet, delicate flavor.", rarity: "Common", category: "Fish", isConsumable: false, requiresMonster: false, isAccessory: false }, "LargemouthBass": { id: "LargemouthBass", name: "Largemouth Bass", image: "https://i.imgur.com/PzZxJ5x.png", description: "An aggressive predator that ambushes prey from cover.", category: "Fish", rarity: "Common", isConsumable: false, requiresMonster: false, isAccessory: false }, "Pike": { id: "Pike", name: "Pike", image: "https://i.imgur.com/ptsd4Y8.png", description: "A fierce ambush hunter known for explosive strikes.", category: "Fish", rarity: "Common", isConsumable: false, requiresMonster: false, isAccessory: false, }, "RainbowTrout": { id: "RainbowTrout", name: "Rainbow Trout", image: "https://i.imgur.com/4XIjQhb.png", description: "A colorful, acrobatic fish that puts up a spirited fight.", category: "Fish", rarity: "Common", isConsumable: false, requiresMonster: false, isAccessory: false, }, "LakeTrout": { id: "LakeTrout", name: "Lake Trout", image: "https://i.imgur.com/yH4mZBf.png", description: "A deep-dwelling coldwater predator that grows to impressive sizes.", category: "Fish", rarity: "Uncommon", isConsumable: false, requiresMonster: false, isAccessory: false }, "BullTrout": { id: "BullTrout", name: "Bull Trout", image: "https://i.imgur.com/SzKhYRn.png", description: "An uncommon char species that inhabits pristine, icy waters.", category: "Fish", rarity: "Uncommon", isConsumable: false, requiresMonster: false, isAccessory: false }, "Muskellunge": { id: "Muskellunge", name: "Muskellunge", image: "https://i.imgur.com/LV8qXaR.png", description: "The apex predator known as the \"fish of 10,000 casts.\"", category: "Fish", rarity: "Uncommon", isConsumable: false, requiresMonster: false, isAccessory: false }, "Sturgeon": { id: "Sturgeon", name: "Sturgeon", image: "https://i.imgur.com/uWP3Zpp.png", description: "An ancient bottom-feeder that can live for decades and reach massive sizes.", category: "Fish", rarity: "Rare", isConsumable: false, requiresMonster: false, isAccessory: false }, "Sheefish": { id: "Sheefish", name: "Sheefish", image: "https://i.imgur.com/ma31AO2.png", description: "A powerful fighter prized for its strength and excellent flavor.", category: "Fish", rarity: "Rare", isConsumable: false, requiresMonster: false, isAccessory: false }, "FishingRod": { id: "FishingRod", name: "Basic Fishing Rod", category: "Fishing", basePrice: 300, image: "https://i.imgur.com/Nz0angj.png", description: "A basic fishing rod. Unlocks fishing at the lake.", rarity: "Common", isConsumable: false, isAccessory: false }, "Lantern": { id: "Lantern", name: "Lantern", category: "Fishing", basePrice: 250, image: "https://i.imgur.com/wZ33WBh.png", description: "A lantern for lighting the dark. Unlocks fishing at night.", rarity: "Common", isConsumable: false, isAccessory: false }, "WormBait": { id: "WormBait", name: "Worm Bait", category: "Fishing", basePrice: 25, image: "https://i.imgur.com/Z7iQbYS.png", description: "Earth worms used as bait for fishing.", rarity: "Common", isConsumable: false, isAccessory: false }, "GrilledFish": { id: "GrilledFish", name: "Grilled Fish", category: "Meals", description: "Classic grilled fish.", image: "https://i.imgur.com/WEQqkOg.png", requiredIngredients: ["CookingOil"], requiresAnyFish: true, rarity: "Common", isConsumable: false, isAccessory: false }, "FishSticks": { id: "FishSticks", name: "Fish Sticks", category: "Meals", description: "Yummy fish sticks!", image: "https://i.imgur.com/VTS4kw0.png", requiredIngredients: ["CookingOil", "Flour"], requiresAnyFish: true, rarity: "Common", isConsumable: false, isAccessory: false }, "BakedFish": { id: "BakedFish", name: "Baked Fish", category: "Meals", description: "Baked fish with tomatoes and herbs.", ingredientList: "Cooking Oil, Tomatoes, Herbs, Any Fish,", image: "https://i.imgur.com/sbwmNfP.png", requiredIngredients: ["CookingOil", "Tomatoes", "Herbs"], requiresAnyFish: true, rarity: "Common", isConsumable: false, isAccessory: false }, "BakedTrout": { id: "BakedTrout", name: "Baked Lake Trout", category: "Meals", description: "Baked trout on a bed of onions.", image: "https://i.imgur.com/REOzlqe.png", requiredIngredients: ["LakeTrout", "CookingOil", "Onion"], requiresAnyFish: false, rarity: "Uncommon", isConsumable: false, isAccessory: false }, "SmokedTrout": { id: "SmokedTrout", name: "Smoked Bull Trout", category: "Meals", description: "Smoked trout cured with oil and sugar.", image: "https://i.imgur.com/ZshV6MB.png", requiredIngredients: ["BullTrout", "CookingOil", "Sugar"], requiresAnyFish: false, rarity: "Uncommon", isConsumable: false, isAccessory: false } }>> /* Player inventory */ <<if !$inventory>> <<set $inventory = { CarePotion: 2, EnergyDrink: 0, CreatureChow: 4, ScrollFertility: 0, BowHeadband: 0, CookingOil: 0, Herbs: 0, Berries: 0, Flour: 0, Sugar: 0, Tomatoes: 0, Onions: 0, Rice: 0, Pasta: 0, Coconut: 0, PickledVeggies: 0, Saffron: 0, FishingRod: 0, WormBait: 0, Lantern: 0, YellowPerch: 0, LargemouthBass: 0, Pike: 0, RainbowTrout: 0, LakeTrout: 0, BullTrout: 0, Muskellunge: 0, Sturgeon: 0, Sheefish: 0, GrilledFish: 0, FishSticks: 0, BakedFish: 0, BakedTrout: 0, SmokedTrout: 0 }>> <</if>> <<set setup.creatureFoods = ["CreatureChow", "GrilledFish", "FishSticks", "BakedFish", "BakedTrout", "SmokedTrout"]>> /* Featured item (changes daily) */ <<set $featuredItemId = either("CarePotion", "EnergyDrink", "CreatureChow", "ScrollFertility", "BowHeadband", "CookingOil", "Herbs", "Berries", "Flour", "Sugar", "Tomatoes", "Onions", "Rice", "Pasta", "Coconut", "PickledVeggies", "Saffron")>> <<set $achievements to { firstBreeding: { id: "firstBreeding", name: "First Steps", description: "Successfully breed your first pair of creatures", hint: "Try breeding two adult creatures together", unlocked: false, rewards: { money: 100 } }, firstOldDeath: { id: "firstOldDeath", name: "All creatures go to heaven", description: "Have a creature die from old age", hint: "It's a waiting game", unlocked: false, rewards: { money: 200 } }, tenEggs: { id: "tenEggs", name: "Egg Collector", description: "Produce 10 eggs total", hint: "Keep breeding creatures", unlocked: false, progress: 0, goal: 10, rewards: { money: 250 } }, firstSell: { id: "firstSell", name: "Nothing Gold Can Stay", description: "Sell your first creature", hint: "Too many creatures, not enough money?", unlocked: false, rewards: { money: 150 } }, firstRequest: { id: "firstRequest", name: "Budding Breeder", description: "Fulfill your first request", hint: "Find the Request Board", unlocked: false, rewards: { money: 200 } }, tenRequests: { id: "tenRequests", name: "Amateur Breeder", description: "Fulfill ten requests", hint: "Keep fulfilling requests", unlocked: false, progress: 0, goal: 10, rewards: { money: 300 } }, firstRare: { id: "firstRare", name: "Rare Find", description: "Hatch or acquire a Rare creature", hint: "Rare creatures are harder to find...", unlocked: false, rewards: { money: 500 } } }>> <<set $totalAchievementsUnlocked to 0>> <<set $achievementQueue to []>> /* For displaying achievement notifications */ <<set $freelancingAttempts to 0>> <<set $photosCompleted to 0>> <<set $photosMoney to 0>> <<set $products to [ { name: "Artisan Coffee Mug", correct: "detail", reason: "Handcrafted items need close-ups to show texture and craftsmanship" }, { name: "Luxury Perfume Bottle", correct: "detail", reason: "High-end fragrance bottles require detail shots to showcase premium materials" }, { name: "Vintage Leather Jacket", correct: "context", reason: "Clothing needs full product shots to show fit and style" }, { name: "Gourmet Pizza", correct: "lifestyle", reason: "Food looks most appealing in lifestyle shots showing it ready to eat" }, { name: "Yoga Mat", correct: "context", reason: "Exercise equipment needs full shots to show size and proportions" }, { name: "Wedding Ring Set", correct: "detail", reason: "Jewelry requires macro detail shots to show sparkle and craftsmanship" }, { name: "Smartphone Case", correct: "context", reason: "Phone accessories need full context to show how they fit the device" }, { name: "Artisan Soap Bar", correct: "flatlay", reason: "Bath products work well in styled flat lay compositions" }, { name: "Fresh Salad Bowl", correct: "lifestyle", reason: "Fresh food looks best in natural eating contexts" }, { name: "Designer Sunglasses", correct: "detail", reason: "Luxury accessories need detail shots to highlight premium features" }, { name: "Hiking Boots", correct: "context", reason: "Footwear needs full product shots to show design and build quality" }, { name: "Scented Candle", correct: "flatlay", reason: "Home decor items work beautifully in styled flat lay arrangements" }, { name: "Craft Beer Bottle", correct: "context", reason: "Beverages need full shots to show label design and bottle shape" }, { name: "Handmade Necklace", correct: "detail", reason: "Handcrafted jewelry requires close-ups to show intricate details" }, { name: "Gourmet Burger", correct: "lifestyle", reason: "Food photography works best showing the item ready to be enjoyed" } ]>> <<set setup.typeEmojis = { "Forest": "🌲", "Mountain": "🏔️", "Desert": "🏜️", "River": "💧", "Jungle": "🌴", "Volcano": "🌋", "Aether": "✨" }>>
<<nobr>> <<widget "breedCreatures">> <<set _parent1 to $args[0]>> <<set _parent2 to $args[1]>> /* Check fertility status of both parents */ <<set _parent1Fertile to isCreatureFertile(_parent1, $currentDay)>> <<set _parent2Fertile to isCreatureFertile(_parent2, $currentDay)>> /* Determine breeding success and egg count based on fertility */ <<if _parent1Fertile && _parent2Fertile>> /* Both fertile - best outcome */ <<set _breedingSuccess to true>> <<set _numEggs to random(1, 4)>> <<elseif _parent1Fertile || _parent2Fertile>> /* One fertile - medium outcome */ <<set _breedingSuccess to random(1, 100) <= 75>> <<set _numEggs to _breedingSuccess ? random(1, 3) : 0>> <<else>> /* Neither fertile - worst outcome */ <<set _breedingSuccess to random(1, 100) <= 50>> <<set _numEggs to _breedingSuccess ? random(1, 2) : 0>> <</if>> <<set _currentEggs to setup.countEggs()>> <<set _availableSlots to $maxEggSlots - _currentEggs>> <<set _numEggs to Math.min(_numEggs, _availableSlots)>> <<set $lastBreedingResults to []>> <<set $breedingSuccessful to _breedingSuccess>> <<set $bothParentsFertile to (_parent1Fertile && _parent2Fertile)>> <<set $oneParentFertile to ((_parent1Fertile || _parent2Fertile) && !(_parent1Fertile && _parent2Fertile))>> <<if _breedingSuccess>> <<for _e to 0; _e < _numEggs; _e++>> /* Choose species based on rarity weights */ <<set _template1 to setup.creatureTemplates[_parent1.name]>> <<set _template2 to setup.creatureTemplates[_parent2.name]>> <<set _weight1 to setup.rarityWeights[_template1.rarity]>> <<set _weight2 to setup.rarityWeights[_template2.rarity]>> <<set _totalWeight to _weight1 + _weight2>> <<set _roll to random(1, _totalWeight)>> <<if _roll <= _weight1>> <<set _chosenSpecies to _parent1.name>> <<set _chosenTemplate to _template1>> <<else>> <<set _chosenSpecies to _parent2.name>> <<set _chosenTemplate to _template2>> <</if>> /* Inherit genes from parents */ <<set _colorGene1 = either(_parent1.genes.color[0], _parent1.genes.color[1])>> <<set _colorGene2 = either(_parent2.genes.color[0], _parent2.genes.color[1])>> <<set _patternGene1 = either(_parent1.genes.pattern[0], _parent1.genes.pattern[1])>> <<set _patternGene2 = either(_parent2.genes.pattern[0], _parent2.genes.pattern[1])>> <<set _sizeGene1 = either(_parent1.genes.size[0], _parent1.genes.size[1])>> <<set _sizeGene2 = either(_parent2.genes.size[0], _parent2.genes.size[1])>> /* Store original genes for mutation tracking */ <<set _origColor1 = _colorGene1>> <<set _origColor2 = _colorGene2>> <<set _origPattern1 = _patternGene1>> <<set _origPattern2 = _patternGene2>> <<set _origSize1 = _sizeGene1>> <<set _origSize2 = _sizeGene2>> /* Apply mutations */ <<set _colorGene1 = applyMutation(_colorGene1, _chosenTemplate, "color")>> <<set _colorGene2 = applyMutation(_colorGene2, _chosenTemplate, "color")>> <<set _patternGene1 = applyMutation(_patternGene1, _chosenTemplate, "pattern")>> <<set _patternGene2 = applyMutation(_patternGene2, _chosenTemplate, "pattern")>> <<set _sizeGene1 = applyMutation(_sizeGene1, _chosenTemplate, "size")>> <<set _sizeGene2 = applyMutation(_sizeGene2, _chosenTemplate, "size")>> /* Track which traits mutated */ <<set _mutated = []>> <<if _colorGene1 !== _origColor1 || _colorGene2 !== _origColor2>> <<run _mutated.push("color")>> <</if>> <<if _patternGene1 !== _origPattern1 || _patternGene2 !== _origPattern2>> <<run _mutated.push("pattern")>> <</if>> <<if _sizeGene1 !== _origSize1 || _sizeGene2 !== _origSize2>> <<run _mutated.push("size")>> <</if>> /* Calculate displayed traits */ <<set _displayColor to getDisplayedTrait(_colorGene1, _colorGene2, _chosenTemplate.colorDominance)>> <<set _displayPattern to getDisplayedTrait(_patternGene1, _patternGene2, _chosenTemplate.patternDominance)>> <<set _displaySize to getBlendedSize(_sizeGene1, _sizeGene2, _chosenTemplate.possibleSizes)>> /* Create egg */ <<set _newEgg to { speciesName: _chosenSpecies, name: _chosenSpecies, id: random(100000, 999999), gender: either("Male", "Female"), age: 0, stage: "egg", hatchDay: $currentDay + random(1, 3), generation: Math.max(_parent1.generation, _parent2.generation) + 1, parents: { motherId: _parent1.gender === "Female" ? _parent1.id : _parent2.id, fatherId: _parent1.gender === "Male" ? _parent1.id : _parent2.id, motherName: _parent1.gender === "Female" ? (_parent1.petName || _parent1.name) : (_parent2.petName || _parent2.name), fatherName: _parent1.gender === "Male" ? (_parent1.petName || _parent1.name) : (_parent2.petName || _parent2.name) }, genes: { color: [_colorGene1, _colorGene2], pattern: [_patternGene1, _patternGene2], size: [_sizeGene1, _sizeGene2] }, displayTraits: { color: _displayColor, pattern: _displayPattern, size: _displaySize }, careCur: 50, careMax: 100, affectionCur: 60, affectionMax: 100, staminaCur: 3, staminaMax: 3, type: _chosenTemplate.type, rarity: _chosenTemplate.rarity, fertilityOffset: $currentDay, lastFertileDay: 0 }>> <<if _newEgg.displayTraits.size === "large">> <<set _newEgg.hungerCur = 120>> <<set _newEgg.hungerMax = 120>> <<elseif _newEgg.displayTraits.size === "medium">> <<set _newEgg.hungerCur = 100>> <<set _newEgg.hungerMax = 100>> <<else>> <<set _newEgg.hungerCur = 80>> <<set _newEgg.hungerMax = 80>> <</if>> <<set _newEgg.geneticTestingDone = false>> <<set _newEgg.flavorText to _chosenTemplate.flavorText>> <<set _newEgg.mutations = _mutated>> <<run $playerCreatures.push(_newEgg)>> <<run $lastBreedingResults.push(_newEgg)>> <</for>> <</if>> <</widget>> <<widget "checkDailyLimit">> <<set _creature to $args[0]>> <<set _actionType to $args[1]>> <<set _maxLimit to $args[2]>> /* Determine which counters to check based on action type */ <<if _actionType is "feed">> <<set _countProperty to "fedCount">> <<set _dayProperty to "lastFedDay">> <<elseif _actionType is "care">> <<set _countProperty to "caredCount">> <<set _dayProperty to "lastCaredDay">> <</if>> /* Check if it's a new day and reset if needed */ <<if _creature[_dayProperty] < $currentDay>> <<set _creature[_countProperty] to 0>> <<set _creature[_dayProperty] to $currentDay>> <</if>> /* Check if limit reached */ <<if _creature[_countProperty] >= _maxLimit>> <<set _limitReached to true>> <<else>> <<set _limitReached to false>> <</if>> <</widget>> <<widget "creatureName">> <<set _creature to $args[0]>> <<if _creature.petName>> <<print _creature.petName>> <<else>> <<print _creature.name>> <</if>> <</widget>> <<widget "staminaRegen">> <<for _i to 0; _i < $playerCreatures.length; _i++>> <<set _template to setup.creatureTemplates[$playerCreatures[_i].name]>> <<if _template.rarity === "Common" && $currentDay % 5 is 0>> <<set $playerCreatures[_i].stamina to Math.min($playerCreatures[_i].staminaMax, $playerCreatures[_i].stamina + 1)>> <<elseif _template.rarity === "Uncommon" && $currentDay % 8 is 0>> <<set $playerCreatures[_i].stamina to Math.min($playerCreatures[_i].staminaMax, $playerCreatures[_i].stamina + 1)>> <<elseif _template.rarity === "Rare" && $currentDay % 12 is 0>> <<set $playerCreatures[_i].stamina to Math.min($playerCreatures[_i].staminaMax, $playerCreatures[_i].stamina + 1)>> <</if>> <</for>> <</widget>> <<widget "hungerDrain">> <<for _i to 0; _i < $playerCreatures.length; _i++>> <<if $playerCreatures[_i].stage !== "egg">> <<capture _i>> <<set _template to setup.creatureTemplates[$playerCreatures[_i].name]>> <<if _template.rarity === "Common">> <<set $playerCreatures[_i].hungerCur to Math.max(-20, Math.min($playerCreatures[_i].hungerMax, $playerCreatures[_i].hungerCur - 15))>> <<elseif _template.rarity === "Uncommon">> <<set $playerCreatures[_i].hungerCur to Math.max(-20, Math.min($playerCreatures[_i].hungerMax, $playerCreatures[_i].hungerCur - 12))>> <<elseif _template.rarity === "Rare">> <<set $playerCreatures[_i].hungerCur to Math.max(-20, Math.min($playerCreatures[_i].hungerMax, $playerCreatures[_i].hungerCur - 10))>> <</if>> <</capture>> <</if>> <</for>> <</widget>> <<widget "careDrain">> <<set _neglectedCreatures to []>> <<for _i to 0; _i < $playerCreatures.length; _i++>> <<if $playerCreatures[_i].stage !== "egg">> <<capture _i>> <<set _template to setup.creatureTemplates[$playerCreatures[_i].name]>> <<set $playerCreatures[_i].careCur to Math.max(-20, Math.min($playerCreatures[_i].careMax, $playerCreatures[_i].careCur - 15))>> <!-- If care is 0 or below, decrease affection by 10% --> <<if $playerCreatures[_i].careCur <= 0>> <<set _affectionLoss to Math.ceil($playerCreatures[_i].affectionCur * 0.10)>> <<set $playerCreatures[_i].affectionCur to Math.max(-20, $playerCreatures[_i].affectionCur - _affectionLoss)>> <<run _neglectedCreatures.push($playerCreatures[_i])>> <</if>> <</capture>> <</if>> <</for>> <!-- Display neglect warnings --> <<if _neglectedCreatures.length > 0>> <div class="death-notification"> <h3>😢 Creatures Are Neglected!</h3> <<for _n to 0; _n < _neglectedCreatures.length; _n++>> <<set _neglected to _neglectedCreatures[_n]>> <p><strong><<creatureName _neglected>></strong> is being neglected and losing affection. They may run away if this continues!</p> <</for>> </div> <</if>> <</widget>> <<widget "showAchievements">> <span id="achievement-wrapper"> <<if $achievementQueue.length > 0>> <<set _achievement to $achievementQueue[0]>> <div class="achievement-modal"> <div class="achievement-content"> <h2>🏆 Achievement Unlocked!</h2> <h3>_achievement.name</h3> <p>_achievement.description</p> <<if _achievement.rewards>> <div class="achievement-rewards"> <strong>Rewards:</strong><br> <<if _achievement.rewards.money>> +_achievement.rewards.money coins<br> <</if>> <<if _achievement.rewards.eggSlots>> +_achievement.rewards.eggSlots egg slots<br> <</if>> </div> <</if>> <<link "Continue">> <<run $achievementQueue.shift()>> <<replace "#achievement-wrapper">><</replace>> <</link>> </div> </div> <</if>> </span> <</widget>> <<widget "generateRequest">> <<set _difficulty = $args[0]>> <<set _newRequest = { id: random(100000, 999999), difficulty: _difficulty, createdDay: $currentDay, expiresDay: 0 }>> /* Set expiration based on difficulty */ <<if _difficulty === "simple">> <<set _newRequest.expiresDay = $currentDay + 7>> <<elseif _difficulty === "medium">> <<set _newRequest.expiresDay = $currentDay + 14>> <<else>> <<set _newRequest.expiresDay = $currentDay + 21>> <</if>> /* Get available creature types that aren't already in active requests */ <<set _usedSpecies = $requests.map(function(r) { return r.species; })>> <<set _availableSpecies = Object.keys(setup.creatureTemplates).filter(function(species) { return !_usedSpecies.includes(species); })>> <<if _availableSpecies.length === 0>> <<set _availableSpecies = Object.keys(setup.creatureTemplates)>> <</if>> <<set _species = _availableSpecies.random()>> <<set _template = setup.creatureTemplates[_species]>> <<set _newRequest.species = _species>> <<set _newRequest.rarity = _template.rarity>> /* Generate requirements based on difficulty */ <<if _difficulty === "simple">> /* Simple: 1-2 trait requirements, Common rarity only */ <<set _newRequest.rarity = "Common">> <<set _commonSpecies = _availableSpecies.filter(function(s) { return setup.creatureTemplates[s].rarity === "Common"; })>> <<if _commonSpecies.length > 0>> <<set _species = _commonSpecies.random()>> <<set _template = setup.creatureTemplates[_species]>> <<set _newRequest.species = _species>> <</if>> <<set _traitCount = 1>> <<set _possibleTraits = ["color", "size"]>> <<set _selectedTraits = _possibleTraits.slice(0, _traitCount)>> <<set _newRequest.requiredTraits = {}>> <<for _i, _trait range _selectedTraits>> <<if _trait === "color">> <<set _newRequest.requiredTraits.color = _template.possibleColors.random()>> <<elseif _trait === "size">> <<set _newRequest.requiredTraits.size = _template.possibleSizes.random()>> <</if>> <</for>> <<set _newRequest.reward = random(80, 120)>> <<elseif _difficulty === "medium">> /* Medium: 2-3 traits, Common or Uncommon */ <<set _allowedRarities = ["Common", "Uncommon"]>> <<set _mediumSpecies = _availableSpecies.filter(function(s) { return _allowedRarities.includes(setup.creatureTemplates[s].rarity); })>> <<if _mediumSpecies.length > 0>> <<set _species = _mediumSpecies.random()>> <<set _template = setup.creatureTemplates[_species]>> <<set _newRequest.species = _species>> <<set _newRequest.rarity = _template.rarity>> <</if>> <<set _traitCount = either(1, 2)>> <<set _possibleTraits = ["color", "size", "pattern"]>> <<set _selectedTraits = []>> <<for _i = 0; _i < _traitCount; _i++>> <<set _available = _possibleTraits.filter(function(t) { return !_selectedTraits.includes(t); })>> <<set _selectedTraits.push(_available.random())>> <</for>> <<set _newRequest.requiredTraits = {}>> <<for _i, _trait range _selectedTraits>> <<if _trait === "color">> <<set _newRequest.requiredTraits.color = _template.possibleColors.random()>> <<elseif _trait === "size">> <<set _newRequest.requiredTraits.size = _template.possibleSizes.random()>> <<elseif _trait === "pattern">> <<set _newRequest.requiredTraits.pattern = _template.possiblePatterns.random()>> <</if>> <</for>> <<set _newRequest.reward = random(150, 200)>> <<else>> /* Complex: All 3 traits, any rarity */ <<set _newRequest.requiredTraits = { color: _template.possibleColors.random(), size: _template.possibleSizes.random(), pattern: _template.possiblePatterns.random() }>> <<set _newRequest.reward = random(230, 270)>> <</if>> <<run $requests.push(_newRequest)>> <</widget>> <<widget "checkExpiredRequests">> <<set _expiredIndexes = []>> <<for _i = 0; _i < $requests.length; _i++>> <<if $requests[_i].expiresDay <= $currentDay>> <<run _expiredIndexes.push(_i)>> <</if>> <</for>> /* Remove expired requests (from end to start to avoid index issues) */ <<for _i = _expiredIndexes.length - 1; _i >= 0; _i-->> <<run $requests.deleteAt(_expiredIndexes[_i])>> <</for>> <</widget>> <<widget "fillRequestSlots">> <<checkExpiredRequests>> /* Only add ONE new request if we're below the max of 5 */ <<if $requests.length < 5>> <<if $requestsUnlocked.complex && either(true, false)>> <<generateRequest "complex">> <<elseif $requestsUnlocked.medium && either(true, false, false)>> <<generateRequest "medium">> <<else>> <<generateRequest "simple">> <</if>> <</if>> <</widget>> <<widget "checkCreatureMatch">> <<set _creature = $args[0]>> <<set _request = $args[1]>> <<set _matches = true>> /* Check species */ <<if _creature.name !== _request.species>> <<set _matches = false>> <</if>> /* Check stage (must be adult) */ <<if _creature.stage !== "adult">> <<set _matches = false>> <</if>> /* Check required traits */ <<if _matches && _request.requiredTraits.color>> <<if _creature.displayTraits.color !== _request.requiredTraits.color>> <<set _matches = false>> <</if>> <</if>> <<if _matches && _request.requiredTraits.size>> <<if _creature.displayTraits.size !== _request.requiredTraits.size>> <<set _matches = false>> <</if>> <</if>> <<if _matches && _request.requiredTraits.pattern>> <<if _creature.displayTraits.pattern !== _request.requiredTraits.pattern>> <<set _matches = false>> <</if>> <</if>> <<set _matchResult = _matches>> <</widget>> <<widget "starvationCheck">> <<set _starvingCreatures to []>> <<set _starvationDeaths to []>> <!-- Check each creature for starvation --> <<for _i to 0; _i < $playerCreatures.length; _i++>> <<if $playerCreatures[_i].stage !== "egg">> <<capture _i>> <<set _creature to $playerCreatures[_i]>> <!-- Creature is currently starving --> <<if _creature.hungerCur <= 0>> <!-- First day of starvation - set warning day --> <<if !_creature.starvationWarningDay>> <<set $playerCreatures[_i].starvationWarningDay to $currentDay>> <<run _starvingCreatures.push(_creature)>> <<else>> <!-- Check if 2 days have passed since warning --> <<set _daysSinceWarning to $currentDay - _creature.starvationWarningDay>> <<if _daysSinceWarning >= 2>> <!-- Creature dies from starvation --> <<set _deadCreature to clone($playerCreatures[_i])>> <<set _deadCreature.deathDay to $currentDay>> <<set _deadCreature.deathCause to "starvation">> <<run _starvationDeaths.push(_deadCreature)>> <<run $deadCreatures.push(_deadCreature)>> <<run $playerCreatures.splice(_i, 1)>> <<set _i -= 1>> <<else>> <!-- Still starving but hasn't been 2 days yet --> <<run _starvingCreatures.push(_creature)>> <</if>> <</if>> <<else>> <!-- Creature is no longer starving - reset warning --> <<if _creature.starvationWarningDay>> <<set $playerCreatures[_i].starvationWarningDay to null>> <</if>> <</if>> <</capture>> <</if>> <</for>> <!-- Apply affection drain if ANY creature is starving --> <<if hasStarvingCreatures()>> <<for _j to 0; _j < $playerCreatures.length; _j++>> <<if $playerCreatures[_j].stage !== "egg">> <<set _affectionLoss to Math.ceil($playerCreatures[_j].affectionCur * 0.08)>> <<set $playerCreatures[_j].affectionCur to Math.max(0, $playerCreatures[_j].affectionCur - _affectionLoss)>> <</if>> <</for>> <</if>> <!-- Display starvation warnings --> <<if _starvingCreatures.length > 0>> <div class="death-notification"> <h3>⚠️ Starvation Warning!</h3> <<for _s to 0; _s < _starvingCreatures.length; _s++>> <<set _starving to _starvingCreatures[_s]>> <<set _daysSinceWarning to $currentDay - _starving.starvationWarningDay>> <<if _daysSinceWarning === 0>> <p><strong><<creatureName _starving>></strong> is starving! Feed them immediately or they will die in 2 days.</p> <<elseif _daysSinceWarning === 1>> <p><strong class="critical"><<creatureName _starving>></strong> is still starving! They will die tomorrow if not fed!</p> <</if>> <</for>> <<if hasStarvingCreatures()>> <p class="warning-text">All creatures are losing 3% affection daily due to starvation stress.</p> <</if>> </div> <</if>> <!-- Display starvation deaths --> <<if _starvationDeaths.length > 0>> <div class="death-notification"> <h3>💀 Creatures Died from Starvation</h3> <<for _d to 0; _d < _starvationDeaths.length; _d++>> <<set _dead to _starvationDeaths[_d]>> <p>Your <strong><<creatureName _dead>></strong> has died from starvation at age _dead.age days. They deserved better care.</p> <</for>> </div> <</if>> <</widget>> <<widget "escapeCheck">> <<set _escapedCreatures to []>> <<set _returnedCreatures to []>> <<set _lostForeverCreatures to []>> <!-- Check for escapes from current creatures --> <<for _i to 0; _i < $playerCreatures.length; _i++>> <<if checkCreatureEscape($playerCreatures[_i])>> <<set _escaped to clone($playerCreatures[_i])>> <<set _escaped.escapeDay to $currentDay>> <<run _escapedCreatures.push(_escaped)>> <<run $escapedCreatures.push(_escaped)>> <<run $playerCreatures.splice(_i, 1)>> <<set _i -= 1>> <</if>> <</for>> <!-- Check if any escaped creatures return or are lost forever --> <<if $escapedCreatures && $escapedCreatures.length > 0>> <<for _j to 0; _j < $escapedCreatures.length; _j++>> <<set _daysGone to $currentDay - $escapedCreatures[_j].escapeDay>> <!-- Creature is lost forever after 28 days --> <<if _daysGone > 28>> <<set _lostForever to clone($escapedCreatures[_j])>> <<run _lostForeverCreatures.push(_lostForever)>> <<run $escapedCreatures.splice(_j, 1)>> <<set _j -= 1>> <<elseif checkCreatureReturn($escapedCreatures[_j], $currentDay)>> <<set _returned to clone($escapedCreatures[_j])>> <<set _returned.escapeDay to null>> <<run _returnedCreatures.push(_returned)>> <<run $playerCreatures.push(_returned)>> <<run $escapedCreatures.splice(_j, 1)>> <<set _j -= 1>> <</if>> <</for>> <</if>> <!-- Display escape notifications --> <<if _escapedCreatures.length > 0>> <div class="death-notification"> <h3>🏃 Creatures Ran Away!</h3> <<for _e to 0; _e < _escapedCreatures.length; _e++>> <<set _escaped to _escapedCreatures[_e]>> <p><strong><<creatureName _escaped>></strong> has run away due to poor care. They may return within the next 28 days if you're lucky...</p> <</for>> </div> <</if>> <!-- Display return notifications --> <<if _returnedCreatures.length > 0>> <div class="hatch-notification"> <h3>🎉 A Creature Returned!</h3> <<for _r to 0; _r < _returnedCreatures.length; _r++>> <<set _returned to _returnedCreatures[_r]>> <p><strong><<creatureName _returned>></strong> has come back home! Give them better care this time.</p> <</for>> </div> <</if>> <!-- Display lost forever notifications --> <<if _lostForeverCreatures.length > 0>> <div class="death-notification"> <h3>💔 Creatures Lost Forever</h3> <<for _l to 0; _l < _lostForeverCreatures.length; _l++>> <<set _lost to _lostForeverCreatures[_l]>> <p><strong><<creatureName _lost>></strong> has been gone for too long. They're not coming back.</p> <</for>> </div> <</if>> <</widget>> <<widget "affectionBonus">> <<set _happyCreatures to []>> <<for _i to 0; _i < $playerCreatures.length; _i++>> <<if $playerCreatures[_i].stage !== "egg">> <<capture _i>> <!-- Check if both hunger and care are at max --> <<if $playerCreatures[_i].hungerCur >= $playerCreatures[_i].hungerMax && $playerCreatures[_i].careCur >= $playerCreatures[_i].careMax>> <<set $playerCreatures[_i].affectionCur to Math.min($playerCreatures[_i].affectionMax, $playerCreatures[_i].affectionCur + 5)>> <<run _happyCreatures.push($playerCreatures[_i])>> <</if>> <</capture>> <</if>> <</for>> <!-- Optional: Display happiness notification --> <<if _happyCreatures.length > 0>> <div class="hatch-notification"> <h3>💖 Creatures Are Happy!</h3> <<for _h to 0; _h < _happyCreatures.length; _h++>> <<set _happy to _happyCreatures[_h]>> <p><strong><<creatureName _happy>></strong> is well-fed and cared for. Their affection increased!</p> <</for>> </div> <</if>> <</widget>> <</nobr>>
<<nobr>> <h1>Day $currentDay Begins</h1> <p>A new day begins...</p> <br> <<link "Continue">> <<goto "Home">> <</link>> <</nobr>>