mirror of
https://github.com/chase-manning/pokemon-js.git
synced 2025-09-22 22:57:14 +00:00
🚀 add chase quest 3
This commit is contained in:
parent
191a41c647
commit
feef51a19b
1 changed files with 42 additions and 0 deletions
|
@ -10,6 +10,7 @@ import {
|
|||
healPokemon,
|
||||
selectCompletedQuests,
|
||||
selectInventory,
|
||||
selectPokemon,
|
||||
selectPos,
|
||||
setPos,
|
||||
takeMoney,
|
||||
|
@ -39,6 +40,7 @@ const useQuests = () => {
|
|||
const completedQuests = useSelector(selectCompletedQuests);
|
||||
const pos = useSelector(selectPos);
|
||||
const inventory = useSelector(selectInventory);
|
||||
const pokemon = useSelector(selectPokemon);
|
||||
|
||||
const isComplete = (questId: string) => {
|
||||
return completedQuests.includes(questId);
|
||||
|
@ -48,6 +50,10 @@ const useQuests = () => {
|
|||
return inventory.some((inventoryItem) => inventoryItem.item === item);
|
||||
};
|
||||
|
||||
const hasPokemon = (id: number) => {
|
||||
return pokemon.some((pokemon) => pokemon.id === id);
|
||||
};
|
||||
|
||||
const quests: QuestType[] = [
|
||||
// Pewter City
|
||||
{
|
||||
|
@ -241,6 +247,42 @@ const useQuests = () => {
|
|||
dispatch(consumeItem(ItemType.PokeBall));
|
||||
},
|
||||
},
|
||||
{
|
||||
trigger: "talk",
|
||||
map: MapId.PalletTownHouseB,
|
||||
positions: {
|
||||
1: [4],
|
||||
},
|
||||
active: () => !isComplete("chase-3") && hasPokemon(25),
|
||||
text: [
|
||||
"Lien!!!",
|
||||
"Welcome back!",
|
||||
"I've missed you! I've missed you!",
|
||||
"You are looking beautiful today!",
|
||||
"I'm so happy to see you!",
|
||||
"How is your adventure going?",
|
||||
"Have you caught a Pikachu yet?",
|
||||
"You have!?",
|
||||
"Yay!",
|
||||
"Can I see it?",
|
||||
"It's so cute!",
|
||||
"I love it!",
|
||||
"Thank you so much!",
|
||||
"You can keep it!",
|
||||
"I just wanted to see one!",
|
||||
"To thank you, I have a gift for you!",
|
||||
"Lien received ULTRA BALL",
|
||||
"If you continue through Weavers Fields",
|
||||
"You can walk to Shoreditch",
|
||||
"There is a gym there!",
|
||||
"Try to beat the gym leader!",
|
||||
"I'll be waiting for you here!",
|
||||
],
|
||||
action: () => {
|
||||
dispatch(completeQuest("chase-3"));
|
||||
dispatch(addInventory({ item: ItemType.UltraBall, amount: 1 }));
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
return quests;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue