diff --git a/.vscode/settings.json b/.vscode/settings.json index 30bf8c2d..50fe347f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "out": true // set this to false to include "out" folder in search results }, // Turn off tsc task auto detection since we have the necessary tasks as npm scripts - "typescript.tsc.autoDetect": "off" + "typescript.tsc.autoDetect": "off", + "nuxt.isNuxtApp": false } \ No newline at end of file diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 323d5d8c..e487001a 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -31,7 +31,7 @@ Set a default color, size, pet type, position, and theme when you open a Pet Pan * Pet Color: black, brown, green, yellow, gray, purple, red, white * Pet Size: nano, medium, large -* Pet Type: cat, crab, clippy, cockatiel, dog, mod, rocky, rubber duck, snake, totoro, zappy +* Pet Type: cat, chicken, crab, clippy, cockatiel, dog, mod, rocky, rubber duck, snake, totoro, zappy .. image:: _static/screenshot-2.gif :alt: Usage screenshot diff --git a/media/main-bundle.js b/media/main-bundle.js index bb46e680..2b3e7525 100644 --- a/media/main-bundle.js +++ b/media/main-bundle.js @@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.randomName = void 0; const cat_1 = __webpack_require__(/*! ../panel/pets/cat */ "./src/panel/pets/cat.ts"); +const chicken_1 = __webpack_require__(/*! ../panel/pets/chicken */ "./src/panel/pets/chicken.ts"); const clippy_1 = __webpack_require__(/*! ../panel/pets/clippy */ "./src/panel/pets/clippy.ts"); const cockatiel_1 = __webpack_require__(/*! ../panel/pets/cockatiel */ "./src/panel/pets/cockatiel.ts"); const crab_1 = __webpack_require__(/*! ../panel/pets/crab */ "./src/panel/pets/crab.ts"); @@ -25,6 +26,7 @@ const zappy_1 = __webpack_require__(/*! ../panel/pets/zappy */ "./src/panel/pets function randomName(type) { const collection = { ["cat" /* PetType.cat */]: cat_1.CAT_NAMES, + ["chicken" /* PetType.chicken */]: chicken_1.CHICKEN_NAMES, ["dog" /* PetType.dog */]: dog_1.DOG_NAMES, ["crab" /* PetType.crab */]: crab_1.CRAB_NAMES, ["clippy" /* PetType.clippy */]: clippy_1.CLIPPY_NAMES, @@ -785,6 +787,7 @@ window.addEventListener('resize', function () { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.normalizeColor = exports.availableColors = exports.createPet = exports.InvalidPetException = exports.PetCollection = exports.PetElement = void 0; const cat_1 = __webpack_require__(/*! ./pets/cat */ "./src/panel/pets/cat.ts"); +const chicken_1 = __webpack_require__(/*! ./pets/chicken */ "./src/panel/pets/chicken.ts"); const clippy_1 = __webpack_require__(/*! ./pets/clippy */ "./src/panel/pets/clippy.ts"); const cockatiel_1 = __webpack_require__(/*! ./pets/cockatiel */ "./src/panel/pets/cockatiel.ts"); const crab_1 = __webpack_require__(/*! ./pets/crab */ "./src/panel/pets/crab.ts"); @@ -898,6 +901,8 @@ function createPet(petType, el, collision, speech, size, left, bottom, petRoot, switch (petType) { case "cat" /* PetType.cat */: return new cat_1.Cat(...standardPetArguments, 3 /* PetSpeed.normal */); + case "chicken" /* PetType.chicken */: + return new chicken_1.Chicken(...standardPetArguments, 3 /* PetSpeed.normal */); case "dog" /* PetType.dog */: return new dog_1.Dog(...standardPetArguments, 3 /* PetSpeed.normal */); case "crab" /* PetType.crab */: @@ -927,6 +932,8 @@ function availableColors(petType) { switch (petType) { case "cat" /* PetType.cat */: return cat_1.Cat.possibleColors; + case "chicken" /* PetType.chicken */: + return chicken_1.Chicken.possibleColors; case "dog" /* PetType.dog */: return dog_1.Dog.possibleColors; case "crab" /* PetType.crab */: @@ -1184,6 +1191,102 @@ exports.CAT_NAMES = [ ]; +/***/ }), + +/***/ "./src/panel/pets/chicken.ts": +/*!***********************************!*\ + !*** ./src/panel/pets/chicken.ts ***! + \***********************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CHICKEN_NAMES = exports.Chicken = void 0; +const basepettype_1 = __webpack_require__(/*! ../basepettype */ "./src/panel/basepettype.ts"); +class Chicken extends basepettype_1.BasePetType { + label = 'chicken'; + static possibleColors = [ + "white" /* PetColor.white */, + ]; + sequence = { + startingState: "sit-idle" /* States.sitIdle */, + sequenceStates: [ + { + state: "sit-idle" /* States.sitIdle */, + possibleNextStates: ["walk-right" /* States.walkRight */, "run-right" /* States.runRight */, "swipe" /* States.swipe */,], + }, + { + state: "walk-right" /* States.walkRight */, + possibleNextStates: ["walk-left" /* States.walkLeft */, "run-left" /* States.runLeft */], + }, + { + state: "run-right" /* States.runRight */, + possibleNextStates: ["walk-left" /* States.walkLeft */, "run-left" /* States.runLeft */], + }, + { + state: "walk-left" /* States.walkLeft */, + possibleNextStates: ["sit-idle" /* States.sitIdle */], + }, + { + state: "run-left" /* States.runLeft */, + possibleNextStates: ["sit-idle" /* States.sitIdle */], + }, + { + state: "chase" /* States.chase */, + possibleNextStates: ["idle-with-ball" /* States.idleWithBall */], + }, + { + state: "swipe" /* States.swipe */, + possibleNextStates: ["sit-idle" /* States.sitIdle */], + }, + { + state: "idle-with-ball" /* States.idleWithBall */, + possibleNextStates: [ + "walk-right" /* States.walkRight */, + "walk-left" /* States.walkLeft */, + "run-left" /* States.runLeft */, + "run-right" /* States.runRight */, + "swipe" /* States.swipe */, + ], + }, + ], + }; + get emoji() { + return '🐔'; + } + get hello() { + return ` Puk Puk Pukaaak - just let me lay my leg. 🥚`; + } +} +exports.Chicken = Chicken; +exports.CHICKEN_NAMES = [ + 'Hen Solo', + 'Cluck Vader', + 'Obi Wan Henobi', + 'Albert Eggstein', + 'Abrahen Lincoln', + 'Cluck Norris', + 'Sir Clucks-A-Lot', + 'Frank-hen-stein', + 'Richard', + 'Dixi', + 'Nugget', + 'Bella', + 'Cotton', + 'Pip', + 'Lucky', + 'Polly', + 'Mirabel', + 'Elsa', + 'Bon-Bon', + 'Ruby', + 'Rosie', + 'Teriyaki', + 'Penguin', + 'Sybil', +]; + + /***/ }), /***/ "./src/panel/pets/clippy.ts": diff --git a/package.json b/package.json index 8238d2be..5415f630 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "keywords": [ "pet", "cat", + "chicken", "dog", "pets", "clippy", @@ -166,6 +167,7 @@ "type": "string", "enum": [ "cat", + "chicken", "crab", "clippy", "cockatiel", diff --git a/src/common/names.ts b/src/common/names.ts index 5b0aaab5..f4587305 100644 --- a/src/common/names.ts +++ b/src/common/names.ts @@ -1,4 +1,5 @@ import { CAT_NAMES } from '../panel/pets/cat'; +import { CHICKEN_NAMES } from '../panel/pets/chicken'; import { CLIPPY_NAMES } from '../panel/pets/clippy'; import { COCKATIEL_NAMES } from '../panel/pets/cockatiel'; import { CRAB_NAMES } from '../panel/pets/crab'; @@ -16,6 +17,7 @@ export function randomName(type: PetType): string { ( { [PetType.cat]: CAT_NAMES, + [PetType.chicken]: CHICKEN_NAMES, [PetType.dog]: DOG_NAMES, [PetType.crab]: CRAB_NAMES, [PetType.clippy]: CLIPPY_NAMES, diff --git a/src/common/types.ts b/src/common/types.ts index 5f0a0b38..1e154c85 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -12,6 +12,7 @@ export const enum PetColor { export const enum PetType { cat = 'cat', + chicken = 'chicken', clippy = 'clippy', cockatiel = 'cockatiel', crab = 'crab', @@ -70,6 +71,7 @@ export class WebviewMessage { export const ALL_PETS = [ PetType.cat, + PetType.chicken, PetType.clippy, PetType.cockatiel, PetType.crab, diff --git a/src/panel/pets.ts b/src/panel/pets.ts index 75028e97..30a83109 100644 --- a/src/panel/pets.ts +++ b/src/panel/pets.ts @@ -1,5 +1,6 @@ import { PetColor, PetSize, PetSpeed, PetType } from '../common/types'; import { Cat } from './pets/cat'; +import { Chicken } from './pets/chicken'; import { Clippy } from './pets/clippy'; import { Cockatiel } from './pets/cockatiel'; import { Crab } from './pets/crab'; @@ -172,6 +173,8 @@ export function createPet( switch (petType) { case PetType.cat: return new Cat(...standardPetArguments, PetSpeed.normal); + case PetType.chicken: + return new Chicken(...standardPetArguments, PetSpeed.normal); case PetType.dog: return new Dog(...standardPetArguments, PetSpeed.normal); case PetType.crab: @@ -201,6 +204,8 @@ export function availableColors(petType: PetType): PetColor[] { switch (petType) { case PetType.cat: return Cat.possibleColors; + case PetType.chicken: + return Chicken.possibleColors; case PetType.dog: return Dog.possibleColors; case PetType.crab: diff --git a/src/panel/pets/chicken.ts b/src/panel/pets/chicken.ts new file mode 100644 index 00000000..94fdda10 --- /dev/null +++ b/src/panel/pets/chicken.ts @@ -0,0 +1,88 @@ +import { PetColor } from '../../common/types'; +import { BasePetType } from '../basepettype'; +import { States } from '../states'; + +export class Chicken extends BasePetType { + label = 'chicken'; + static possibleColors = [PetColor.white]; + sequence = { + startingState: States.sitIdle, + sequenceStates: [ + { + state: States.sitIdle, + possibleNextStates: [ + States.walkRight, + States.runRight, + States.swipe, + ], + }, + { + state: States.walkRight, + possibleNextStates: [States.walkLeft, States.runLeft], + }, + { + state: States.runRight, + possibleNextStates: [States.walkLeft, States.runLeft], + }, + { + state: States.walkLeft, + possibleNextStates: [States.sitIdle], + }, + { + state: States.runLeft, + possibleNextStates: [States.sitIdle], + }, + { + state: States.chase, + possibleNextStates: [States.idleWithBall], + }, + { + state: States.swipe, + possibleNextStates: [States.sitIdle], + }, + { + state: States.idleWithBall, + possibleNextStates: [ + States.walkRight, + States.walkLeft, + States.runLeft, + States.runRight, + States.swipe, + ], + }, + ], + }; + get emoji(): string { + return '🐔'; + } + get hello(): string { + return ` Puk Puk Pukaaak - just let me lay my leg. 🥚`; + } +} + +export const CHICKEN_NAMES: ReadonlyArray = [ + 'Hen Solo', + 'Cluck Vader', + 'Obi Wan Henobi', + 'Albert Eggstein', + 'Abrahen Lincoln', + 'Cluck Norris', + 'Sir Clucks-A-Lot', + 'Frank-hen-stein', + 'Richard', + 'Dixi', + 'Nugget', + 'Bella', + 'Cotton', + 'Pip', + 'Lucky', + 'Polly', + 'Mirabel', + 'Elsa', + 'Bon-Bon', + 'Ruby', + 'Rosie', + 'Teriyaki', + 'Penguin', + 'Sybil', +];