diff --git a/README.md b/README.md index 744dde72..8a656fa0 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ The forest theme was designed by [edermunizz](https://edermunizz.itch.io/free-pi The turtle animations were designed by enkeefe using [Pixelart](https://www.pixilart.com/draw). +The horse animations were adapted by [Chris Kent](https://github.com/thechriskent) from assets by [Onfe](https://onfe.itch.io/horse-sprite-with-rider-asset-pack). + ## Thank you Thanks to all the [contributors](https://github.com/tonybaloney/vscode-pets/graphs/contributors) to this project. diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index 9073fff3..628767ba 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -9,6 +9,7 @@ "Cancelled Spawning Pet": "Cancelled Spawning Pet", "A Pet Playground has been created. You can now use the \"Spawn Additional Pet\" Command to add more pets.": "A Pet Playground has been created. You can now use the \"Spawn Additional Pet\" Command to add more pets.", "A Pet Playground has been created. You can now use the \"Remove All Pets\" Command to remove all pets.": "A Pet Playground has been created. You can now use the \"Remove All Pets\" Command to remove all pets.", + "black": "Black", "brown": "Brown", "lightbrown": "Light Brown", @@ -18,6 +19,18 @@ "purple": "Purple", "red": "Red", "white": "White", + "orange": "Orange", + "blue": "Blue", + "akita": "Akita", + "socks black": "Black (Socks)", + "socks brown": "Brown (Socks)", + "socks beige": "Beige (Socks)", + "paint black": "Black (Paint)", + "paint brown": "Brown (Paint)", + "paint beige": "Beige (Paint)", + "magical": "Magical", + "warrior": "Warrior", + "cat": "Cat", "clippy": "Clippy", "cockatiel": "Cockatiel", @@ -29,5 +42,6 @@ "rubber-duck": "Rubber Duck", "snake": "Snake", "totoro": "Totoro", - "zappy": "Zappy" + "zappy": "Zappy", + "horse": "Horse" } diff --git a/media/horse/black_idle_8fps.gif b/media/horse/black_idle_8fps.gif new file mode 100644 index 00000000..2c0e8889 Binary files /dev/null and b/media/horse/black_idle_8fps.gif differ diff --git a/media/horse/black_run_8fps.gif b/media/horse/black_run_8fps.gif new file mode 100644 index 00000000..3dce3532 Binary files /dev/null and b/media/horse/black_run_8fps.gif differ diff --git a/media/horse/black_stand_8fps.gif b/media/horse/black_stand_8fps.gif new file mode 100644 index 00000000..a6a4c975 Binary files /dev/null and b/media/horse/black_stand_8fps.gif differ diff --git a/media/horse/black_swipe_8fps.gif b/media/horse/black_swipe_8fps.gif new file mode 100644 index 00000000..a8bf5d47 Binary files /dev/null and b/media/horse/black_swipe_8fps.gif differ diff --git a/media/horse/black_walk_8fps.gif b/media/horse/black_walk_8fps.gif new file mode 100644 index 00000000..57e3e50e Binary files /dev/null and b/media/horse/black_walk_8fps.gif differ diff --git a/media/horse/black_walk_fast_8fps.gif b/media/horse/black_walk_fast_8fps.gif new file mode 100644 index 00000000..23f59a14 Binary files /dev/null and b/media/horse/black_walk_fast_8fps.gif differ diff --git a/media/horse/black_with_ball_8fps.gif b/media/horse/black_with_ball_8fps.gif new file mode 100644 index 00000000..862128f1 Binary files /dev/null and b/media/horse/black_with_ball_8fps.gif differ diff --git a/media/horse/brown_idle_8fps.gif b/media/horse/brown_idle_8fps.gif new file mode 100644 index 00000000..a353a8ef Binary files /dev/null and b/media/horse/brown_idle_8fps.gif differ diff --git a/media/horse/brown_run_8fps.gif b/media/horse/brown_run_8fps.gif new file mode 100644 index 00000000..f00d27f5 Binary files /dev/null and b/media/horse/brown_run_8fps.gif differ diff --git a/media/horse/brown_stand_8fps.gif b/media/horse/brown_stand_8fps.gif new file mode 100644 index 00000000..a68cabd7 Binary files /dev/null and b/media/horse/brown_stand_8fps.gif differ diff --git a/media/horse/brown_swipe_8fps.gif b/media/horse/brown_swipe_8fps.gif new file mode 100644 index 00000000..bb7f511c Binary files /dev/null and b/media/horse/brown_swipe_8fps.gif differ diff --git a/media/horse/brown_walk_8fps.gif b/media/horse/brown_walk_8fps.gif new file mode 100644 index 00000000..4924d46b Binary files /dev/null and b/media/horse/brown_walk_8fps.gif differ diff --git a/media/horse/brown_walk_fast_8fps.gif b/media/horse/brown_walk_fast_8fps.gif new file mode 100644 index 00000000..aa111c8a Binary files /dev/null and b/media/horse/brown_walk_fast_8fps.gif differ diff --git a/media/horse/brown_with_ball_8fps.gif b/media/horse/brown_with_ball_8fps.gif new file mode 100644 index 00000000..0e262110 Binary files /dev/null and b/media/horse/brown_with_ball_8fps.gif differ diff --git a/media/horse/magical_idle_8fps.gif b/media/horse/magical_idle_8fps.gif new file mode 100644 index 00000000..7a1b786a Binary files /dev/null and b/media/horse/magical_idle_8fps.gif differ diff --git a/media/horse/magical_run_8fps.gif b/media/horse/magical_run_8fps.gif new file mode 100644 index 00000000..5ac799ec Binary files /dev/null and b/media/horse/magical_run_8fps.gif differ diff --git a/media/horse/magical_stand_8fps.gif b/media/horse/magical_stand_8fps.gif new file mode 100644 index 00000000..021264a0 Binary files /dev/null and b/media/horse/magical_stand_8fps.gif differ diff --git a/media/horse/magical_swipe_8fps.gif b/media/horse/magical_swipe_8fps.gif new file mode 100644 index 00000000..762551e2 Binary files /dev/null and b/media/horse/magical_swipe_8fps.gif differ diff --git a/media/horse/magical_walk_8fps.gif b/media/horse/magical_walk_8fps.gif new file mode 100644 index 00000000..d7e29efd Binary files /dev/null and b/media/horse/magical_walk_8fps.gif differ diff --git a/media/horse/magical_walk_fast_8fps.gif b/media/horse/magical_walk_fast_8fps.gif new file mode 100644 index 00000000..39844e1b Binary files /dev/null and b/media/horse/magical_walk_fast_8fps.gif differ diff --git a/media/horse/magical_with_ball_8fps.gif b/media/horse/magical_with_ball_8fps.gif new file mode 100644 index 00000000..1007eca4 Binary files /dev/null and b/media/horse/magical_with_ball_8fps.gif differ diff --git a/media/horse/paint_beige_idle_8fps.gif b/media/horse/paint_beige_idle_8fps.gif new file mode 100644 index 00000000..047086d1 Binary files /dev/null and b/media/horse/paint_beige_idle_8fps.gif differ diff --git a/media/horse/paint_beige_run_8fps.gif b/media/horse/paint_beige_run_8fps.gif new file mode 100644 index 00000000..ecbf93a3 Binary files /dev/null and b/media/horse/paint_beige_run_8fps.gif differ diff --git a/media/horse/paint_beige_stand_8fps.gif b/media/horse/paint_beige_stand_8fps.gif new file mode 100644 index 00000000..469db430 Binary files /dev/null and b/media/horse/paint_beige_stand_8fps.gif differ diff --git a/media/horse/paint_beige_swipe_8fps.gif b/media/horse/paint_beige_swipe_8fps.gif new file mode 100644 index 00000000..c46a859c Binary files /dev/null and b/media/horse/paint_beige_swipe_8fps.gif differ diff --git a/media/horse/paint_beige_walk_8fps.gif b/media/horse/paint_beige_walk_8fps.gif new file mode 100644 index 00000000..d6c9312e Binary files /dev/null and b/media/horse/paint_beige_walk_8fps.gif differ diff --git a/media/horse/paint_beige_walk_fast_8fps.gif b/media/horse/paint_beige_walk_fast_8fps.gif new file mode 100644 index 00000000..5d63e7a8 Binary files /dev/null and b/media/horse/paint_beige_walk_fast_8fps.gif differ diff --git a/media/horse/paint_beige_with_ball_8fps.gif b/media/horse/paint_beige_with_ball_8fps.gif new file mode 100644 index 00000000..a11d0605 Binary files /dev/null and b/media/horse/paint_beige_with_ball_8fps.gif differ diff --git a/media/horse/paint_black_idle_8fps.gif b/media/horse/paint_black_idle_8fps.gif new file mode 100644 index 00000000..9d5d01af Binary files /dev/null and b/media/horse/paint_black_idle_8fps.gif differ diff --git a/media/horse/paint_black_run_8fps.gif b/media/horse/paint_black_run_8fps.gif new file mode 100644 index 00000000..1a2e7a7e Binary files /dev/null and b/media/horse/paint_black_run_8fps.gif differ diff --git a/media/horse/paint_black_stand_8fps.gif b/media/horse/paint_black_stand_8fps.gif new file mode 100644 index 00000000..8ee8180b Binary files /dev/null and b/media/horse/paint_black_stand_8fps.gif differ diff --git a/media/horse/paint_black_swipe_8fps.gif b/media/horse/paint_black_swipe_8fps.gif new file mode 100644 index 00000000..5ec1c430 Binary files /dev/null and b/media/horse/paint_black_swipe_8fps.gif differ diff --git a/media/horse/paint_black_walk_8fps.gif b/media/horse/paint_black_walk_8fps.gif new file mode 100644 index 00000000..df49e0e4 Binary files /dev/null and b/media/horse/paint_black_walk_8fps.gif differ diff --git a/media/horse/paint_black_walk_fast_8fps.gif b/media/horse/paint_black_walk_fast_8fps.gif new file mode 100644 index 00000000..175df3cc Binary files /dev/null and b/media/horse/paint_black_walk_fast_8fps.gif differ diff --git a/media/horse/paint_black_with_ball_8fps.gif b/media/horse/paint_black_with_ball_8fps.gif new file mode 100644 index 00000000..4988aafe Binary files /dev/null and b/media/horse/paint_black_with_ball_8fps.gif differ diff --git a/media/horse/paint_brown_idle_8fps.gif b/media/horse/paint_brown_idle_8fps.gif new file mode 100644 index 00000000..bbf9f45e Binary files /dev/null and b/media/horse/paint_brown_idle_8fps.gif differ diff --git a/media/horse/paint_brown_run_8fps.gif b/media/horse/paint_brown_run_8fps.gif new file mode 100644 index 00000000..2d5f4109 Binary files /dev/null and b/media/horse/paint_brown_run_8fps.gif differ diff --git a/media/horse/paint_brown_stand_8fps.gif b/media/horse/paint_brown_stand_8fps.gif new file mode 100644 index 00000000..4f15f185 Binary files /dev/null and b/media/horse/paint_brown_stand_8fps.gif differ diff --git a/media/horse/paint_brown_swipe_8fps.gif b/media/horse/paint_brown_swipe_8fps.gif new file mode 100644 index 00000000..dc39c4f0 Binary files /dev/null and b/media/horse/paint_brown_swipe_8fps.gif differ diff --git a/media/horse/paint_brown_walk_8fps.gif b/media/horse/paint_brown_walk_8fps.gif new file mode 100644 index 00000000..84ed1f2c Binary files /dev/null and b/media/horse/paint_brown_walk_8fps.gif differ diff --git a/media/horse/paint_brown_walk_fast_8fps.gif b/media/horse/paint_brown_walk_fast_8fps.gif new file mode 100644 index 00000000..fc98572e Binary files /dev/null and b/media/horse/paint_brown_walk_fast_8fps.gif differ diff --git a/media/horse/paint_brown_with_ball_8fps.gif b/media/horse/paint_brown_with_ball_8fps.gif new file mode 100644 index 00000000..544d88cf Binary files /dev/null and b/media/horse/paint_brown_with_ball_8fps.gif differ diff --git a/media/horse/socks_beige_idle_8fps.gif b/media/horse/socks_beige_idle_8fps.gif new file mode 100644 index 00000000..008f1ea7 Binary files /dev/null and b/media/horse/socks_beige_idle_8fps.gif differ diff --git a/media/horse/socks_beige_run_8fps.gif b/media/horse/socks_beige_run_8fps.gif new file mode 100644 index 00000000..a16c470b Binary files /dev/null and b/media/horse/socks_beige_run_8fps.gif differ diff --git a/media/horse/socks_beige_stand_8fps.gif b/media/horse/socks_beige_stand_8fps.gif new file mode 100644 index 00000000..f1325552 Binary files /dev/null and b/media/horse/socks_beige_stand_8fps.gif differ diff --git a/media/horse/socks_beige_swipe_8fps.gif b/media/horse/socks_beige_swipe_8fps.gif new file mode 100644 index 00000000..b91e124f Binary files /dev/null and b/media/horse/socks_beige_swipe_8fps.gif differ diff --git a/media/horse/socks_beige_walk_8fps.gif b/media/horse/socks_beige_walk_8fps.gif new file mode 100644 index 00000000..723aa9e6 Binary files /dev/null and b/media/horse/socks_beige_walk_8fps.gif differ diff --git a/media/horse/socks_beige_walk_fast_8fps.gif b/media/horse/socks_beige_walk_fast_8fps.gif new file mode 100644 index 00000000..1418bf65 Binary files /dev/null and b/media/horse/socks_beige_walk_fast_8fps.gif differ diff --git a/media/horse/socks_beige_with_ball_8fps.gif b/media/horse/socks_beige_with_ball_8fps.gif new file mode 100644 index 00000000..e75ebb64 Binary files /dev/null and b/media/horse/socks_beige_with_ball_8fps.gif differ diff --git a/media/horse/socks_black_idle_8fps.gif b/media/horse/socks_black_idle_8fps.gif new file mode 100644 index 00000000..911af756 Binary files /dev/null and b/media/horse/socks_black_idle_8fps.gif differ diff --git a/media/horse/socks_black_run_8fps.gif b/media/horse/socks_black_run_8fps.gif new file mode 100644 index 00000000..f401e015 Binary files /dev/null and b/media/horse/socks_black_run_8fps.gif differ diff --git a/media/horse/socks_black_stand_8fps.gif b/media/horse/socks_black_stand_8fps.gif new file mode 100644 index 00000000..7ff25446 Binary files /dev/null and b/media/horse/socks_black_stand_8fps.gif differ diff --git a/media/horse/socks_black_swipe_8fps.gif b/media/horse/socks_black_swipe_8fps.gif new file mode 100644 index 00000000..d50883f7 Binary files /dev/null and b/media/horse/socks_black_swipe_8fps.gif differ diff --git a/media/horse/socks_black_walk_8fps.gif b/media/horse/socks_black_walk_8fps.gif new file mode 100644 index 00000000..80724056 Binary files /dev/null and b/media/horse/socks_black_walk_8fps.gif differ diff --git a/media/horse/socks_black_walk_fast_8fps.gif b/media/horse/socks_black_walk_fast_8fps.gif new file mode 100644 index 00000000..6f09cc26 Binary files /dev/null and b/media/horse/socks_black_walk_fast_8fps.gif differ diff --git a/media/horse/socks_black_with_ball_8fps.gif b/media/horse/socks_black_with_ball_8fps.gif new file mode 100644 index 00000000..7832e723 Binary files /dev/null and b/media/horse/socks_black_with_ball_8fps.gif differ diff --git a/media/horse/socks_brown_idle_8fps.gif b/media/horse/socks_brown_idle_8fps.gif new file mode 100644 index 00000000..ea073acf Binary files /dev/null and b/media/horse/socks_brown_idle_8fps.gif differ diff --git a/media/horse/socks_brown_run_8fps.gif b/media/horse/socks_brown_run_8fps.gif new file mode 100644 index 00000000..bece8cb2 Binary files /dev/null and b/media/horse/socks_brown_run_8fps.gif differ diff --git a/media/horse/socks_brown_stand_8fps.gif b/media/horse/socks_brown_stand_8fps.gif new file mode 100644 index 00000000..907db389 Binary files /dev/null and b/media/horse/socks_brown_stand_8fps.gif differ diff --git a/media/horse/socks_brown_swipe_8fps.gif b/media/horse/socks_brown_swipe_8fps.gif new file mode 100644 index 00000000..a8b1c7bf Binary files /dev/null and b/media/horse/socks_brown_swipe_8fps.gif differ diff --git a/media/horse/socks_brown_walk_8fps.gif b/media/horse/socks_brown_walk_8fps.gif new file mode 100644 index 00000000..eb83f4f5 Binary files /dev/null and b/media/horse/socks_brown_walk_8fps.gif differ diff --git a/media/horse/socks_brown_walk_fast_8fps.gif b/media/horse/socks_brown_walk_fast_8fps.gif new file mode 100644 index 00000000..6ec57796 Binary files /dev/null and b/media/horse/socks_brown_walk_fast_8fps.gif differ diff --git a/media/horse/socks_brown_with_ball_8fps.gif b/media/horse/socks_brown_with_ball_8fps.gif new file mode 100644 index 00000000..e11e3223 Binary files /dev/null and b/media/horse/socks_brown_with_ball_8fps.gif differ diff --git a/media/horse/warrior_idle_8fps.gif b/media/horse/warrior_idle_8fps.gif new file mode 100644 index 00000000..8e1263a0 Binary files /dev/null and b/media/horse/warrior_idle_8fps.gif differ diff --git a/media/horse/warrior_run_8fps.gif b/media/horse/warrior_run_8fps.gif new file mode 100644 index 00000000..0210784e Binary files /dev/null and b/media/horse/warrior_run_8fps.gif differ diff --git a/media/horse/warrior_stand_8fps.gif b/media/horse/warrior_stand_8fps.gif new file mode 100644 index 00000000..4a0b097b Binary files /dev/null and b/media/horse/warrior_stand_8fps.gif differ diff --git a/media/horse/warrior_swipe_8fps.gif b/media/horse/warrior_swipe_8fps.gif new file mode 100644 index 00000000..4b43c7a3 Binary files /dev/null and b/media/horse/warrior_swipe_8fps.gif differ diff --git a/media/horse/warrior_walk_8fps.gif b/media/horse/warrior_walk_8fps.gif new file mode 100644 index 00000000..70283aea Binary files /dev/null and b/media/horse/warrior_walk_8fps.gif differ diff --git a/media/horse/warrior_walk_fast_8fps.gif b/media/horse/warrior_walk_fast_8fps.gif new file mode 100644 index 00000000..fb3af57f Binary files /dev/null and b/media/horse/warrior_walk_fast_8fps.gif differ diff --git a/media/horse/warrior_with_ball_8fps.gif b/media/horse/warrior_with_ball_8fps.gif new file mode 100644 index 00000000..c3288805 Binary files /dev/null and b/media/horse/warrior_with_ball_8fps.gif differ diff --git a/media/horse/white_idle_8fps.gif b/media/horse/white_idle_8fps.gif new file mode 100644 index 00000000..16eba804 Binary files /dev/null and b/media/horse/white_idle_8fps.gif differ diff --git a/media/horse/white_run_8fps.gif b/media/horse/white_run_8fps.gif new file mode 100644 index 00000000..7d6bc469 Binary files /dev/null and b/media/horse/white_run_8fps.gif differ diff --git a/media/horse/white_stand_8fps.gif b/media/horse/white_stand_8fps.gif new file mode 100644 index 00000000..bbc3d45c Binary files /dev/null and b/media/horse/white_stand_8fps.gif differ diff --git a/media/horse/white_swipe_8fps.gif b/media/horse/white_swipe_8fps.gif new file mode 100644 index 00000000..506805d8 Binary files /dev/null and b/media/horse/white_swipe_8fps.gif differ diff --git a/media/horse/white_walk_8fps.gif b/media/horse/white_walk_8fps.gif new file mode 100644 index 00000000..89e47879 Binary files /dev/null and b/media/horse/white_walk_8fps.gif differ diff --git a/media/horse/white_walk_fast_8fps.gif b/media/horse/white_walk_fast_8fps.gif new file mode 100644 index 00000000..d8b87d5c Binary files /dev/null and b/media/horse/white_walk_fast_8fps.gif differ diff --git a/media/horse/white_with_ball_8fps.gif b/media/horse/white_with_ball_8fps.gif new file mode 100644 index 00000000..041a336d Binary files /dev/null and b/media/horse/white_with_ball_8fps.gif differ diff --git a/media/pets.css b/media/pets.css index 93d2cca2..6bc7d4c9 100644 --- a/media/pets.css +++ b/media/pets.css @@ -145,7 +145,7 @@ img.pet { margin: 0px auto; border: 2px solid #333; border-radius: 10px; - padding: 10px; + padding: 10px 0; } .bubble-nano { diff --git a/package.json b/package.json index 59a7893c..17e0ad22 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "dog", "pets", "clippy", - "rubber duck" + "rubber duck", + "horse" ], "license": "MIT", "icon": "icon.png", @@ -160,7 +161,15 @@ "red", "white", "orange", - "akita" + "akita", + "socks black", + "socks beige", + "socks brown", + "paint beige", + "paint black", + "paint brown", + "magical", + "warrior" ], "default": "brown", "description": "Pet color", @@ -176,6 +185,7 @@ "cockatiel", "dog", "fox", + "horse", "mod", "rat", "rocky", diff --git a/src/common/names.ts b/src/common/names.ts index b6a096a4..1aca5112 100644 --- a/src/common/names.ts +++ b/src/common/names.ts @@ -13,6 +13,7 @@ import { TOTORO_NAMES } from '../panel/pets/totoro'; import { ZAPPY_NAMES } from '../panel/pets/zappy'; import { RAT_NAMES } from '../panel/pets/rat'; import { TURTLE_NAMES } from '../panel/pets/turtle'; +import { HORSE_NAMES } from '../panel/pets/horse'; import { PetType } from './types'; export function randomName(type: PetType): string { @@ -34,6 +35,7 @@ export function randomName(type: PetType): string { [PetType.cockatiel]: COCKATIEL_NAMES, [PetType.rat]: RAT_NAMES, [PetType.turtle]: TURTLE_NAMES, + [PetType.horse]: HORSE_NAMES, } as Record> )[type] ?? CAT_NAMES; diff --git a/src/common/types.ts b/src/common/types.ts index 90e0e568..3e86188f 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -10,6 +10,14 @@ export const enum PetColor { white = 'white', orange = 'orange', akita = 'akita', + socksblack = 'socks black', + socksbeige = 'socks beige', + socksbrown = 'socks brown', + paintbeige = 'paint beige', + paintblack = 'paint black', + paintbrown = 'paint brown', + magical = 'magical', + warrior = 'warrior', null = 'null', } @@ -21,6 +29,7 @@ export const enum PetType { crab = 'crab', dog = 'dog', fox = 'fox', + horse = 'horse', mod = 'mod', rat = 'rat', rocky = 'rocky', @@ -84,6 +93,7 @@ export const ALL_PETS = [ PetType.crab, PetType.dog, PetType.fox, + PetType.horse, PetType.mod, PetType.rat, PetType.rocky, @@ -105,6 +115,14 @@ export const ALL_COLORS = [ PetColor.white, PetColor.orange, PetColor.akita, + PetColor.socksblack, + PetColor.socksbeige, + PetColor.socksbrown, + PetColor.paintbeige, + PetColor.paintblack, + PetColor.paintbrown, + PetColor.magical, + PetColor.warrior, PetColor.null, ]; export const ALL_SCALES = [ diff --git a/src/panel/pets.ts b/src/panel/pets.ts index 7ce43072..d5a9ab7b 100644 --- a/src/panel/pets.ts +++ b/src/panel/pets.ts @@ -6,14 +6,15 @@ import { Cockatiel } from './pets/cockatiel'; import { Crab } from './pets/crab'; import { Dog } from './pets/dog'; import { Fox } from './pets/fox'; +import { Horse } from './pets/horse'; import { Mod } from './pets/mod'; +import { Rat } from './pets/rat'; import { Rocky } from './pets/rocky'; import { RubberDuck } from './pets/rubberduck'; import { Snake } from './pets/snake'; import { Totoro } from './pets/totoro'; -import { Zappy } from './pets/zappy'; -import { Rat } from './pets/rat'; import { Turtle } from './pets/turtle'; +import { Zappy } from './pets/zappy'; import { IPetType } from './states'; export class PetElement { @@ -204,6 +205,8 @@ export function createPet( return new Rat(...standardPetArguments, PetSpeed.normal); case PetType.turtle: return new Turtle(...standardPetArguments, PetSpeed.verySlow); + case PetType.horse: + return new Horse(...standardPetArguments, PetSpeed.normal); default: throw new InvalidPetException("Pet type doesn't exist"); } @@ -241,6 +244,8 @@ export function availableColors(petType: PetType): PetColor[] { return Rat.possibleColors; case PetType.turtle: return Turtle.possibleColors; + case PetType.horse: + return Horse.possibleColors; default: throw new InvalidPetException("Pet type doesn't exist"); } diff --git a/src/panel/pets/horse.ts b/src/panel/pets/horse.ts new file mode 100644 index 00000000..75e59e04 --- /dev/null +++ b/src/panel/pets/horse.ts @@ -0,0 +1,255 @@ +import { PetColor, PetSize } from '../../common/types'; +import { BasePetType } from '../basepettype'; +import { States, resolveState } from '../states'; + +const getRandomElement = (array: T[]): T => { + const randomIndex = Math.floor(Math.random() * array.length); + return array[randomIndex]; +}; + +export class Horse extends BasePetType { + constructor( + spriteElement: HTMLImageElement, + collisionElement: HTMLDivElement, + speechElement: HTMLDivElement, + size: PetSize, + left: number, + bottom: number, + petRoot: string, + floor: number, + name: string, + speed: number, + ) { + // Replace spaces with underscores + // Keeps file names consistent + const petRootClean = petRoot.replace(' ', '_'); + super( + spriteElement, + collisionElement, + speechElement, + size, + left, + bottom, + petRootClean, + floor, + name, + speed, + ); + } + label = 'horse'; + static possibleColors = [ + PetColor.brown, + PetColor.white, + PetColor.black, + PetColor.socksbeige, + PetColor.socksblack, + PetColor.socksbrown, + PetColor.paintbeige, + PetColor.paintblack, + PetColor.paintbrown, + PetColor.magical, + PetColor.warrior, + ]; + sequence = { + startingState: States.standRight, + sequenceStates: [ + { + state: States.sitIdle, + // Only on first adding the horse + possibleNextStates: [States.walkRight], + }, + { + state: States.standRight, + // Can start walking either direction (twice as likely to keep going right), or just keep on eating + possibleNextStates: [ + States.walkRight, + States.walkRight, + States.walkLeft, + States.standRight, + ], + }, + { + state: States.standLeft, + // Can start walking either direction (twice as likely to keep going left), or just keep on eating + possibleNextStates: [ + States.walkRight, + States.walkLeft, + States.walkLeft, + States.standLeft, + ], + }, + { + state: States.walkRight, + // Can switch directions, start running the same direction, or start eating (more likely) + possibleNextStates: [ + States.walkLeft, + States.runRight, + States.runLeft, + States.standRight, + States.standRight, + States.standRight, + ], + }, + { + state: States.runRight, + // Can switch directions or slow down to a walk (twice as likely) + possibleNextStates: [ + States.walkRight, + States.walkRight, + States.runLeft, + ], + }, + { + state: States.walkLeft, + // Can switch directions, start running the same direciton, or start eating (more likely) + possibleNextStates: [ + States.walkRight, + States.runLeft, + States.runRight, + States.standLeft, + States.standLeft, + States.standLeft, + ], + }, + { + state: States.runLeft, + // Can switch directions or slow down to a walk (twice as likely) + possibleNextStates: [ + States.walkLeft, + States.walkLeft, + States.runRight, + ], + }, + { + state: States.chase, + // After the chase, the horse has the ball! + possibleNextStates: [States.idleWithBall], + }, + { + state: States.idleWithBall, + // Can go back to running or have a bite to eat + possibleNextStates: [ + States.runRight, + States.runLeft, + States.standRight, + States.standLeft, + ], + }, + ], + }; + get emoji(): string { + if (this.petRoot.endsWith('magical')) { + return '๐Ÿฆ„'; + } + if (this.name.toLowerCase() === 'beau') { + return '๐Ÿคก'; + } + if (this.petRoot.endsWith('warrior')) { + return getRandomElement(['๐Ÿ—ก๏ธ', '๐Ÿช“', '๐Ÿ”ช', '๐Ÿ’ฃ', '๐Ÿงจ']); + } + return '๐Ÿด'; + } + get hello(): string { + let response = Math.random() > 0.5 ? `Neigh!` : `Neigh?`; + switch (this.name.toLowerCase()) { + case 'artax': + response = 'Swamps of Sadness? No thanks!'; + break; + case 'hugo': + response = "I'm the world's laziest horse!"; + break; + case 'james baxter': + response = 'James Baxter! James... Baxter!'; + break; + case 'jimison': + response = 'Son of Jimmy!'; + break; + case 'mister ed': + case 'mr. ed': + response = 'Hello, Wilbur!'; + break; + case 'mr. horse': + response = "No sir, I don't like it."; + break; + case 'pony soprano': + case 'tony the pony': + response = 'Fuggedaboutit!'; + break; + case 'vigo horsenberg': + case 'tiny horse jr.': + case 'ol jethro': + response = 'To battle!'; + break; + case 'shadowfax': + response = 'I am Shadowfax, lord of all horses!'; + break; + case 'silver': + response = 'Hi ho, Silver!'; + break; + } + if (this.petRoot.endsWith('warrior')) { + response = response.toUpperCase(); + } + if (this.petRoot.endsWith('magical')) { + return `๐ŸŒˆ ${response} โœจ`; + } + if (this.name.toLowerCase() === 'warner') { + return `๐Ÿ’œ ${response} ๐Ÿงก`; + } + return response; + } + + swipe() { + if (this.currentStateEnum === States.swipe) { + return; + } + this.holdState = this.currentState; + this.holdStateEnum = this.currentStateEnum; + this.currentStateEnum = States.swipe; + this.currentState = resolveState(this.currentStateEnum, this); + this.showSpeechBubble('Neigh!'); + } +} + +export const HORSE_NAMES: ReadonlyArray = [ + 'Tiny Horse jr.', + 'Mister Ed', + 'Tony the Pony', + 'Vigo Horsenberg', + 'Ol Jetrho', + 'Pony Soprano', + 'Hugo', + 'Jimison', + 'Copper', + 'Lightning', + 'Pilgrim', + 'Thunder', + 'Buddy', + 'Rusty', + 'Smokey', + 'Tennessee Stud', + 'Duke', + 'Tumbleweed', + 'Buster', + 'Scout', + 'Champ', + 'Whiskey', + 'Henry', + 'Artax', // Neverending Story + 'Silver', // Lone Ranger + 'Trigger', // Roy Rogers + 'Shadowfax', // Lord of the Rings + 'Mr Horse', // Ren & Stimpy + 'Beau', // Famous clown horse + 'Bullseye', // Toy Story + 'Tornado', // Zorro + 'Boxer', // Animal Farm + 'Clover', // Animal Farm + 'Warner', // Purple/Orange race horse + 'Binky', // Discworld + 'Porkpie', // Percy Jackson + 'James Baxter', // Adventure Time + 'Buttercup', // Toy Story + 'Maximus', // Tangled + 'Seabiscuit', // Famous race horse +]; diff --git a/src/panel/states.ts b/src/panel/states.ts index ac7c827b..2e7547ab 100644 --- a/src/panel/states.ts +++ b/src/panel/states.ts @@ -76,6 +76,8 @@ export const enum States { idleWithBall = 'idle-with-ball', chase = 'chase', chaseFriend = 'chase-friend', + standRight = 'stand-right', + standLeft = 'stand-left', } export enum FrameResult { @@ -138,6 +140,10 @@ export function resolveState(state: string, pet: IPetType): IState { return new IdleWithBallState(pet); case States.chaseFriend: return new ChaseFriendState(pet); + case States.standRight: + return new StandRightState(pet); + case States.standLeft: + return new StandLeftState(pet); } return new SitIdleState(pet); } @@ -399,3 +405,17 @@ export class JumpDownLeftState implements IState { return FrameResult.stateContinue; } } + +export class StandRightState extends AbstractStaticState { + label = States.standRight; + spriteLabel = 'stand'; + horizontalDirection = HorizontalDirection.right; + holdTime = 60; +} + +export class StandLeftState extends AbstractStaticState { + label = States.standRight; + spriteLabel = 'stand'; + horizontalDirection = HorizontalDirection.left; + holdTime = 60; +} diff --git a/src/test/gifs.ts b/src/test/gifs.ts index 7f8b2087..af7962a6 100644 --- a/src/test/gifs.ts +++ b/src/test/gifs.ts @@ -93,6 +93,30 @@ const pets: { [key: string]: { colors: string[]; states: string[] } } = { colors: ['green', 'orange'], states: ['idle', 'run', 'walk', 'lie', 'with_ball'], }, + horse: { + colors: [ + 'brown', + 'white', + 'black', + 'socks_beige', + 'socks_black', + 'socks_brown', + 'paint_beige', + 'paint_black', + 'paint_brown', + 'magical', + 'warrior', + ], + states: [ + 'idle', + 'run', + 'swipe', + 'walk', + 'walk_fast', + 'with_ball', + 'stand', + ], + }, }; function checkGifFilenames(folder: string) { @@ -108,7 +132,10 @@ function checkGifFilenames(folder: string) { const filename = `${color}_${state}_8fps.gif`; const filePath = `${folder}/${pet}/${filename}`; if (!fs.existsSync(filePath)) { - console.error(`File "${filePath}" does not exist.`); + // \x1b[31m is the ANSI escape code for red, and \x1b[0m resets the color back to the terminal's default. + console.error( + `\x1b[31mFile "${filePath}" does not exist.\x1b[0m`, + ); return false; } else { console.log(`File "${filePath}" exists.`);