zero-to-mastery/ZTM-Quest

馃捈 Implement Job Application Logic

Open

#212 opened on Oct 3, 2025

聽(6 comments)聽(0 reactions)聽(1 assignee)JavaScript聽(132 forks)auto 404
enhancementhacktoberfest

Repository metrics

Stars
聽(39 stars)
PR merge metrics
聽(PR metrics pending)

Description

This task implements the core game logic for the player to apply for and potentially receive a job within the map_company_interior. This feature is essential for the main character to earn money and advance in the game.

Objectives

  1. Identify Job NPC: Designate one specific NPC (e.g., a manager or receptionist) within the company interior map to initiate the job application process.
  2. Dialogue and Interaction:
    • Set up a conditional dialogue tree when the player interacts with the Job NPC.
    • The dialogue should offer the player the option to "Apply for a Job."
  3. Application Process Logic:
    • Implement a success/failure chance for the job application. This can be a simple random roll initially, or based on hidden player stats (if applicable).
    • If successful, update the player's status (e.g., hasJob = true).
    • If failed, provide a brief feedback message (e.g., "We'll call you," or "Try again later").
  4. Recurring Job Dialogue: Once the player has the job, the NPC's dialogue should change to reflect the new status (e.g., "Welcome back to work," or options to view pay/tasks).
  5. Data Storage: Ensure the new job status is correctly saved and loaded with the player's game data.

Technical Notes

  • This logic will likely reside in a new function within a jobHandler.js file or integrated into the existing questHandler.js if the job is treated as a persistent quest/status.
  • Dialogue/UI: Utilize the existing dialog components (which were updated in the previous task) to handle the job application flow and results.

Dependencies:

  • This task requires the map_company_interior to be completed and accessible.
  • Assumes the basic player state management (saving/loading stats) is functional.

Contributor guide