From 0da12d5fa7ca95ce435c2746e5970cf1ce0eff76 Mon Sep 17 00:00:00 2001 From: Tanisha Date: Sat, 26 Oct 2024 00:46:23 +0530 Subject: [PATCH 1/2] added bedroom_plant interaction --- .../bedroom_plant.interaction.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/interactions/map_campus_house_1/bedroom_plant.interaction.js diff --git a/src/interactions/map_campus_house_1/bedroom_plant.interaction.js b/src/interactions/map_campus_house_1/bedroom_plant.interaction.js new file mode 100644 index 00000000..7d1964e7 --- /dev/null +++ b/src/interactions/map_campus_house_1/bedroom_plant.interaction.js @@ -0,0 +1,14 @@ +import { displayDialogue } from '../../utils'; +import { updateEnergyState } from '../../utils/energyUpdate'; +import { getRandomTip } from '../../utils/randomTip'; + +export const bedroomPlantInteractions = (player, k, map) => { + player.onCollide('bedroom_plant', () => { + displayDialogue({ + k, + player, + text: ["Here's a tip for caring for your plants:", getRandomTip()], + }); + updateEnergyState(player.state, player.state.energy + 3); + }); +}; From 7f51549ee2a7cddd804b04692b5ec4b78feffdf4 Mon Sep 17 00:00:00 2001 From: Tanisha Date: Sat, 26 Oct 2024 00:55:18 +0530 Subject: [PATCH 2/2] imported bedroomPlantInteractions in index.js --- src/interactions/map_campus_house_1/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/interactions/map_campus_house_1/index.js b/src/interactions/map_campus_house_1/index.js index 850b51ad..4885fa45 100644 --- a/src/interactions/map_campus_house_1/index.js +++ b/src/interactions/map_campus_house_1/index.js @@ -7,6 +7,7 @@ import { kitchenFridgeInteractions } from './kitchenFridge.interaction'; import { bedroomShelfInteractions } from './bedroomShelf.interaction'; import { livingRoomCouchInteractions } from './livingRoomCouch.interaction'; import { bedroomTableInteractions } from './bedroom_table.interaction'; +import { bedroomPlantInteractions } from './bedroom_plant.interaction'; const interactions = [ // Add more interactions here @@ -19,6 +20,7 @@ const interactions = [ bedroomShelfInteractions, livingRoomCouchInteractions, bedroomTableInteractions, + bedroomPlantInteractions, ]; export default interactions;