@@ -14,7 +14,7 @@ import type {
1414 LobsterPetPaletteId ,
1515 LobsterPetPersonalityId ,
1616} from "./lobster-pet-contract.ts" ;
17- import { lobsterPaletteName } from "./lobster-pet-lore.ts" ;
17+ import { lobsterPaletteName , lobsterRandomName } from "./lobster-pet-lore.ts" ;
1818import { moonPhaseFraction } from "./lobster-pet-moon.ts" ;
1919import {
2020 ACCESSORY_SPRITES ,
@@ -35,6 +35,7 @@ import {
3535 MECHA_PLATES ,
3636 NEBULA_STARS ,
3737 OILSLICK_SHEEN ,
38+ PALETTE_OVERLAYS ,
3839 PASSER_SPRITES ,
3940 PASSER_TITLES ,
4041 PATTERNED_PALETTES ,
@@ -74,26 +75,39 @@ const PALETTES: Array<[LobsterPetPalette, number]> = [
7475 [ { id : "oilslick" , shell : "#15171d" , claw : "#23262e" } , 2 ] ,
7576 [ { id : "aurora" , shell : "#dce6f0" , claw : "#e9f0f7" } , 2 ] ,
7677 [ { id : "nebula" , shell : "#34255c" , claw : "#4a3a7d" } , 2 ] ,
78+ [ { id : "banana" , shell : "#f7e27d" , claw : "#f3d55b" } , 2 ] ,
7779 // CSS custom properties are the palette color contract, so accent vars stay
7880 // intact through every look renderer rather than being parsed as hex values.
7981 [ { id : "mood" , shell : "var(--accent, #7f77dd)" , claw : "var(--accent-hover, #9a93e8)" } , 1.5 ] ,
82+ [ { id : "bee" , shell : "#f4c531" , claw : "#2b2b23" } , 1.5 ] ,
83+ [ { id : "rubberduck" , shell : "#ffd93b" , claw : "#ffb03b" } , 1.5 ] ,
8084 [ { id : "clawtron" , shell : "#8d99a6" , claw : "#a2aeba" } , 1 ] ,
8185 [ { id : "selene" , shell : "#c9ced8" , claw : "#d8dde5" } , 1 ] ,
8286 [ { id : "geode" , shell : "#6b6474" , claw : "#7d7588" } , 1 ] ,
8387 [ { id : "ghost" , shell : "#dce8f2" , claw : "#ecf3fa" } , 1 ] ,
8488 [ { id : "glass" , shell : "#cfe4f4" , claw : "#e0eef8" } , 1 ] ,
8589 [ { id : "split" , shell : "#ff4f40" , claw : "#ff775f" } , 1 ] ,
90+ [ { id : "sourdough" , shell : "#d9a662" , claw : "#e6bc82" } , 1 ] ,
91+ [ { id : "zombie" , shell : "#9db08a" , claw : "#86a17a" } , 1 ] ,
92+ [ { id : "plush" , shell : "#e8967a" , claw : "#f2b09a" } , 1 ] ,
8693 // Pastel pink/blue iridescence, after the famous Maine catches.
8794 [ { id : "cottoncandy" , shell : "#f6a8c9" , claw : "#a5c6f0" } , 0.8 ] ,
95+ [ { id : "disco" , shell : "#b8c4d8" , claw : "#cbd5e6" } , 0.8 ] ,
8896 [ { id : "pixel" , shell : "#d84c3e" , claw : "#ef8f6a" } , 0.7 ] ,
8997 [ { id : "blueprint" , shell : "#123a66" , claw : "#123a66" } , 0.7 ] ,
9098 [ { id : "phosphor" , shell : "#0d2415" , claw : "#0f2b19" } , 0.7 ] ,
9199 [ { id : "heisenbug" , shell : "#262a33" , claw : "#343945" } , 0.6 ] ,
100+ // CSS values, rather than parsed colors, are the palette contract. Like
101+ // mood's var() colors, translucent rgba() values must pass through intact.
102+ [ { id : "invisible" , shell : "rgba(127,140,160,0.07)" , claw : "rgba(127,140,160,0.07)" } , 0.55 ] ,
92103 // The grail: homage to the classic OpenClaw logo (big raised claw, smirk,
93104 // angry brows, white sticker outline). ~0.5% of sessions.
94105 [ { id : "retro" , shell : "#e8262c" , claw : "#f04a3e" } , 0.5 ] ,
106+ [ { id : "goldenretro" , shell : "#e8b422" , claw : "#f6cf5a" } , 0.1 ] ,
95107] ;
96108
109+ const RETRO_GEOMETRY_PALETTES : ReadonlySet < LobsterPetPaletteId > = new Set ( [ "retro" , "goldenretro" ] ) ;
110+
97111// Catalog order for collection UIs (Lobsterdex): common to grail.
98112export const LOBSTER_PET_PALETTES : readonly LobsterPetPalette [ ] = PALETTES . map (
99113 ( [ palette ] ) => palette ,
@@ -195,40 +209,9 @@ const LOBSTER_PET_CLAW_MULS: Record<LobsterPetClawSize, number> = {
195209 mighty : 1.18 ,
196210} ;
197211
198- // Seeded pet names; rare palettes carry signature names. Shown via the
199- // sprite's native title tooltip, so no i18n surface.
200- const PET_NAMES = [
201- "Pinchy" ,
202- "Barnaby" ,
203- "Thermidor" ,
204- "Clawdette" ,
205- "Sheldon" ,
206- "Scuttles" ,
207- "Bisque" ,
208- "Crusty" ,
209- "Snips" ,
210- "Bubbles" ,
211- "Clawdia" ,
212- "Ferdinand" ,
213- "Maple" ,
214- "Pearl" ,
215- "Biscuit" ,
216- "Captain" ,
217- "Ziggy" ,
218- "Noodle" ,
219- "Waffles" ,
220- "Pippin" ,
221- "Squirt" ,
222- "Chip" ,
223- "Clementine" ,
224- "Moss" ,
225- ] as const ;
226-
227212export function lobsterPetName ( look : LobsterPetLook , seed : number ) : string {
228213 const signatureName = lobsterPaletteName ( look . palette . id ) ;
229- return signatureName !== look . palette . id
230- ? signatureName
231- : expectDefined ( PET_NAMES [ ( seed >>> 3 ) % PET_NAMES . length ] , "lobster pet name catalog entry" ) ;
214+ return signatureName !== look . palette . id ? signatureName : lobsterRandomName ( seed ) ;
232215}
233216
234217// A stranger wears a different palette than the resident pet.
@@ -319,7 +302,12 @@ export function createLobsterPetLook(seed: number, now: Date = new Date()): Lobs
319302 } ;
320303 // The LED rides the perky antenna tip. Keep the original antenna roll above
321304 // so adding Clawtron does not shift any later seeded trait.
322- const preparedLook = palette . id === "clawtron" ? { ...look , antennae : "perky" as const } : look ;
305+ let preparedLook = palette . id === "clawtron" ? { ...look , antennae : "perky" as const } : look ;
306+ // The undead do not do perky. Preserve the antenna roll above so later
307+ // seeded traits stay aligned, then enforce the identity at the end.
308+ if ( palette . id === "zombie" ) {
309+ preparedLook = { ...look , antennae : "droopy" } ;
310+ }
323311 if ( isLobsterAnniversary ( now ) ) {
324312 // Birthday dress code: everyone is the classic logo, party hats on.
325313 const retro = PALETTES . find ( ( [ entry ] ) => entry . id === "retro" ) ?. [ 0 ] ;
@@ -342,6 +330,7 @@ export function renderLobsterSvg(
342330 } = { } ,
343331) {
344332 const isPixel = look . palette . id === "pixel" ;
333+ const hasRetroGeometry = RETRO_GEOMETRY_PALETTES . has ( look . palette . id ) ;
345334 const openEyeStyle = options . shell || options . sleeping ? "display:none" : "" ;
346335 const closedEyeStyle =
347336 options . shell || options . sleeping ? "opacity:1" : options . standalone ? "display:none" : "" ;
@@ -358,13 +347,13 @@ export function renderLobsterSvg(
358347 isPixel
359348 ? PIXEL_LOBSTER ( openEyeStyle , closedEyeStyle )
360349 : svg `
361- ${ look . palette . id === "retro" ? RETRO_ANTENNAE : ANTENNAE_SPRITES [ look . antennae ] }
350+ ${ hasRetroGeometry ? RETRO_ANTENNAE : ANTENNAE_SPRITES [ look . antennae ] }
362351 ${ look . tailFan ? TAIL_FAN : nothing }
363352 < g class ="lob-claw lob-claw--l ">
364353 < path d ="M20 42 C5 37 0 47 5 57 C10 67 20 62 25 52 C28 45 25 42 20 42 Z " fill ="var(--lob-claw) " />
365354 </ g >
366355 ${
367- look . palette . id === "retro"
356+ hasRetroGeometry
368357 ? nothing
369358 : svg `< g class ="lob-claw lob-claw--r "> < path d ="M100 42 C115 37 120 47 115 57 C110 67 100 62 95 52 C92 45 95 42 100 42 Z " fill ="var(--lob-claw) " /> </ g > `
370359 }
@@ -383,8 +372,9 @@ export function renderLobsterSvg(
383372 ${ look . palette . id === "blueprint" ? BLUEPRINT_MARKS : nothing }
384373 ${ look . palette . id === "clawtron" ? MECHA_PLATES : nothing }
385374 ${ look . palette . id === "selene" ? SELENE_MOON ( selenePhase ) : nothing }
375+ ${ PALETTE_OVERLAYS [ look . palette . id ] ?? nothing }
386376 ${ look . freckles && ! PATTERNED_PALETTES . has ( look . palette . id ) ? FRECKLE_SPOTS : nothing }
387- < ellipse cx ="48 " cy ="28 " rx ="20 " ry ="11 " fill ="#ffffff " opacity ="0.1 " />
377+ ${ look . palette . id === "invisible" ? nothing : svg ` < ellipse cx ="48 " cy ="28 " rx ="20 " ry ="11 " fill ="#ffffff " opacity ="0.1 " /> ` }
388378 < g class ="lob-eye-open " style =${ openEyeStyle } >
389379 < circle cx ="45 " cy ="32 " r ="5.5 " fill ="#0a1014 " />
390380 < circle cx ="75 " cy ="32 " r ="5.5 " fill ="#0a1014 " />
@@ -402,18 +392,18 @@ export function renderLobsterSvg(
402392 `
403393 }
404394 ${
405- look . palette . id === "retro"
395+ hasRetroGeometry
406396 ? svg `
407397 ${ RETRO_FACE }
408398 < g class ="lob-claw lob-claw--r "> ${ RETRO_MEGA_CLAW } </ g >
409399 `
410400 : nothing
411401 }
412- ${ options . grumpy && look . palette . id !== "retro" ? GRUMPY_FACE : nothing }
402+ ${ options . grumpy && ! hasRetroGeometry ? GRUMPY_FACE : nothing }
413403 ${ look . accessory === "none" || options . shell ? nothing : ACCESSORY_SPRITES [ look . accessory ] }
414404 ${
415405 // The retro grail's mega claw owns the same shoulder; it moves light.
416- options . bindle && look . palette . id !== "retro" ? BINDLE : nothing
406+ options . bindle && ! hasRetroGeometry ? BINDLE : nothing
417407 }
418408 ${ options . sailorCap && ! options . shell && ! HEADWEAR . has ( look . accessory ) ? SAILOR_CAP : nothing }
419409 </ g >
0 commit comments