Implemented Model Pickup and Reputation achievements (#413)

* Implemented Model Pickup and Reputation achievements

* Moved mission progression to placement

* Changed name to place
This commit is contained in:
David Markowitz 2022-02-05 04:08:40 -08:00 committed by GitHub
parent 77459af1d3
commit 933cdee414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View File

@ -388,6 +388,9 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
EntityManager::Instance()->GetZoneControlEntity()->OnZonePropertyModelPlaced(entity); EntityManager::Instance()->GetZoneControlEntity()->OnZonePropertyModelPlaced(entity);
}); });
// Progress place model missions
auto missionComponent = entity->GetComponent<MissionComponent>();
if (missionComponent != nullptr) missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_PLACE_MODEL, 0);
} }
void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason) void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason)

View File

@ -516,7 +516,8 @@ void Mission::YieldRewards() {
} }
if (info->reward_reputation > 0) { if (info->reward_reputation > 0) {
// TODO: In case of reputation, write code // TODO: Track reputation in the character and database.
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_EARN_REPUTATION, 0, 0L, "", info->reward_reputation);
} }
if (info->reward_maxhealth > 0) { if (info->reward_maxhealth > 0) {

View File

@ -460,6 +460,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
case MissionTaskType::MISSION_TASK_TYPE_SMASH: case MissionTaskType::MISSION_TASK_TYPE_SMASH:
case MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION: case MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION:
case MissionTaskType::MISSION_TASK_TYPE_PLAYER_FLAG: case MissionTaskType::MISSION_TASK_TYPE_PLAYER_FLAG:
case MissionTaskType::MISSION_TASK_TYPE_EARN_REPUTATION:
{ {
if (!InAllTargets(value)) break; if (!InAllTargets(value)) break;
@ -467,7 +468,11 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break; break;
} }
case MissionTaskType::MISSION_TASK_TYPE_PLACE_MODEL:
{
AddProgress(count);
break;
}
default: default:
Game::logger->Log("MissionTask", "Invalid mission task type (%i)!\n", static_cast<int>(type)); Game::logger->Log("MissionTask", "Invalid mission task type (%i)!\n", static_cast<int>(type));
return; return;

View File

@ -16,9 +16,11 @@ enum class MissionTaskType : int {
MISSION_TASK_TYPE_MINIGAME = 14, //!< A task for doing something in a minigame MISSION_TASK_TYPE_MINIGAME = 14, //!< A task for doing something in a minigame
MISSION_TASK_TYPE_NON_MISSION_INTERACTION = 15, //!< A task for interacting with a non-mission MISSION_TASK_TYPE_NON_MISSION_INTERACTION = 15, //!< A task for interacting with a non-mission
MISSION_TASK_TYPE_MISSION_COMPLETE = 16, //!< A task for completing a mission MISSION_TASK_TYPE_MISSION_COMPLETE = 16, //!< A task for completing a mission
MISSION_TASK_TYPE_EARN_REPUTATION = 17, //!< A task for earning reputation
MISSION_TASK_TYPE_POWERUP = 21, //!< A task for collecting a powerup MISSION_TASK_TYPE_POWERUP = 21, //!< A task for collecting a powerup
MISSION_TASK_TYPE_PET_TAMING = 22, //!< A task for taming a pet MISSION_TASK_TYPE_PET_TAMING = 22, //!< A task for taming a pet
MISSION_TASK_TYPE_RACING = 23, //!< A task for racing MISSION_TASK_TYPE_RACING = 23, //!< A task for racing
MISSION_TASK_TYPE_PLAYER_FLAG = 24, //!< A task for setting a player flag MISSION_TASK_TYPE_PLAYER_FLAG = 24, //!< A task for setting a player flag
MISSION_TASK_TYPE_PLACE_MODEL = 25, //!< A task for picking up a model
MISSION_TASK_TYPE_VISIT_PROPERTY = 30 //!< A task for visiting a property MISSION_TASK_TYPE_VISIT_PROPERTY = 30 //!< A task for visiting a property
}; };