Implement monster-specific kill achievements. Release Build 8532.
This commit is contained in:
parent
e3f79e6965
commit
3840b28468
@ -3891,4 +3891,8 @@ void AiL::ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHan
|
||||
SteamInput()->ActivateActionSet(Input::steamControllers[i],actionSetHandle);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const float AiL::GetEncounterDuration()const{
|
||||
return encounterDuration;
|
||||
}
|
@ -316,6 +316,7 @@ public:
|
||||
rcode LoadResource(Renderable&renderable,std::string_view imgPath,bool filter=false,bool clamp=true);
|
||||
void UpdateMonsters();
|
||||
void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle);
|
||||
const float GetEncounterDuration()const;
|
||||
|
||||
struct TileGroupData{
|
||||
vi2d tilePos;
|
||||
|
@ -48,6 +48,9 @@ All rights reserved.
|
||||
#include "ItemDrop.h"
|
||||
#include "SoundEffect.h"
|
||||
#include "Unlock.h"
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#include <isteamuserstats.h>
|
||||
#endif
|
||||
|
||||
INCLUDE_ANIMATION_DATA
|
||||
INCLUDE_MONSTER_DATA
|
||||
@ -726,6 +729,25 @@ void Monster::OnDeath(){
|
||||
|
||||
Unlock::IncreaseKillCount();
|
||||
|
||||
if(SteamUserStats()){
|
||||
for(auto&[key,size]:DATA.GetProperty("Achievement.Kill Unlocks")){
|
||||
//Monster-specific achievement unlocks.
|
||||
datafile&unlock=DATA.GetProperty(std::format("Achievement.Kill Unlocks.{}",key));
|
||||
if(unlock.HasProperty("Monster Name")){
|
||||
if(unlock["Monster Name"].GetString()!=GetName())continue;
|
||||
if(unlock.HasProperty("Time Limit")&&isBoss){
|
||||
if(game->GetEncounterDuration()<=unlock["Time Limit"].GetReal()){
|
||||
SteamUserStats()->SetAchievement(unlock["API Name"].GetString().c_str());
|
||||
SteamUserStats()->StoreStats();
|
||||
}
|
||||
}else{
|
||||
SteamUserStats()->SetAchievement(unlock["API Name"].GetString().c_str());
|
||||
SteamUserStats()->StoreStats();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(hasStrategyDeathFunction){
|
||||
GameEvent::AddEvent(std::make_unique<MonsterStrategyGameEvent>(strategyDeathFunc,*this,MONSTER_DATA[name].GetAIStrategy()));
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 8530
|
||||
#define VERSION_BUILD 8532
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -40,24 +40,29 @@ Achievement
|
||||
|
||||
##################################
|
||||
|
||||
|
||||
# For other Kill Encounter achievements, if they have a Monster Name the game looks for the name when a monster is killed and if it matches, you get awarded that achievement.
|
||||
# If a Time Limit is included, the encounter must be a boss encounter and
|
||||
Slime King
|
||||
{
|
||||
API Name = "SLIME_KING"
|
||||
Monster Name = "Slime King"
|
||||
}
|
||||
Slime King Destroyer
|
||||
{
|
||||
API Name = "SLIME_KING_DESTROYER"
|
||||
Time Limit = 60s
|
||||
Monster Name = "Slime King"
|
||||
}
|
||||
Ursule
|
||||
{
|
||||
API Name = "URSULE"
|
||||
Monster Name = "Ursule, Mother of Bears"
|
||||
}
|
||||
Ursule Destroyer
|
||||
{
|
||||
API Name = "URSULE_DESTROYER"
|
||||
Time Limit = 60s
|
||||
Monster Name = "Ursule, Mother of Bears"
|
||||
}
|
||||
}
|
||||
Class Unlocks
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user