en:rpd:sociologist_npc
Table of Contents
Sociologist NPC
Description
The Sociologist NPC is an NPC character in Remixed Dungeon who asks if the player wants to participate in a survey. This character is part of a gameplay feature that allows players to access survey content.
Location
- Found randomly in the dungeon levels
Interactions
- The NPC presents a dialogue asking the player if they'd like to participate in a survey
- If the player agrees, requests internet permission to download survey content
- If the player refuses, the NPC leaves the player alone
Java Class
- Java Class: SociologistNPC.java
- Base Class: ImmortalNPC.java
Behavior
- When approached, presents a dialogue with “Yes” and “No” options (WndOptions window)
- If the player selects “Yes”, requests internet permission and attempts to download survey.json from an external source
- If permission is granted, downloads survey content from a GitHub repository (https://github.com/NYRDS/pixel-dungeon-remix-survey/raw/master/survey.json)
- If the player selects “No”, the NPC says a message about internet being required for surveys
- The NPC implements DownloadStateListener.IDownloadComplete and InterstitialPoint interfaces to manage the download process
Implementation Details
The NPC is implemented as an ImmortalNPC that implements DownloadStateListener.IDownloadComplete and InterstitialPoint interfaces, allowing it to handle the download process and manage the UI during the download.
Code References
- Main Implementation: SociologistNPC.java
- ImmortalNPC Base: ImmortalNPC.java
- Survey File: Downloaded survey.json file is stored locally (SURVEY_JSON constant)
- Download Task: Uses DownloadTask to download from GitHub repository
- UI Windows: WndOptions for initial dialog, WndSurvey for survey display, DownloadProgressWindow for progress
- Interaction Method: interact() method handles the initial interaction with the player
String Resources
- SociologistNPC_Hi - “Hi! Do you want to participate in our survey?”
- SociologistNPC_DownloadError - Error message for download failures
- SociologistNPC_InternetRequired - “Internet is required for surveys”
- Wnd_Button_Yes and Wnd_Button_No - Yes/No button text
Related
- Immortal NPC - Base class for NPCs that don't die normally
- NPCs - Other non-player characters in the game
en/rpd/sociologist_npc.txt · Last modified: by 127.0.0.1
