zero-to-mastery/ZTM-Quest

💼 Implement Job Application Logic

开放

#212 创建于 2025年10月3日

 (6 条评论) (0 个反应) (1 位负责人)JavaScript (132 个派生)auto 404
enhancementhacktoberfest

仓库指标

星标
 (39 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.

贡献者指南