Implement monster-specific kill achievements. Release Build 8532.
This commit is contained in:
parent
e3f79e6965
commit
3840b28468
@ -3892,3 +3892,7 @@ void AiL::ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHan
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
rcode LoadResource(Renderable&renderable,std::string_view imgPath,bool filter=false,bool clamp=true);
|
||||||
void UpdateMonsters();
|
void UpdateMonsters();
|
||||||
void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle);
|
void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle);
|
||||||
|
const float GetEncounterDuration()const;
|
||||||
|
|
||||||
struct TileGroupData{
|
struct TileGroupData{
|
||||||
vi2d tilePos;
|
vi2d tilePos;
|
||||||
|
@ -48,6 +48,9 @@ All rights reserved.
|
|||||||
#include "ItemDrop.h"
|
#include "ItemDrop.h"
|
||||||
#include "SoundEffect.h"
|
#include "SoundEffect.h"
|
||||||
#include "Unlock.h"
|
#include "Unlock.h"
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
|
#include <isteamuserstats.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
INCLUDE_ANIMATION_DATA
|
INCLUDE_ANIMATION_DATA
|
||||||
INCLUDE_MONSTER_DATA
|
INCLUDE_MONSTER_DATA
|
||||||
@ -726,6 +729,25 @@ void Monster::OnDeath(){
|
|||||||
|
|
||||||
Unlock::IncreaseKillCount();
|
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){
|
if(hasStrategyDeathFunction){
|
||||||
GameEvent::AddEvent(std::make_unique<MonsterStrategyGameEvent>(strategyDeathFunc,*this,MONSTER_DATA[name].GetAIStrategy()));
|
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_MAJOR 1
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 8530
|
#define VERSION_BUILD 8532
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #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
|
Slime King
|
||||||
{
|
{
|
||||||
API Name = "SLIME_KING"
|
API Name = "SLIME_KING"
|
||||||
|
Monster Name = "Slime King"
|
||||||
}
|
}
|
||||||
Slime King Destroyer
|
Slime King Destroyer
|
||||||
{
|
{
|
||||||
API Name = "SLIME_KING_DESTROYER"
|
API Name = "SLIME_KING_DESTROYER"
|
||||||
Time Limit = 60s
|
Time Limit = 60s
|
||||||
|
Monster Name = "Slime King"
|
||||||
}
|
}
|
||||||
Ursule
|
Ursule
|
||||||
{
|
{
|
||||||
API Name = "URSULE"
|
API Name = "URSULE"
|
||||||
|
Monster Name = "Ursule, Mother of Bears"
|
||||||
}
|
}
|
||||||
Ursule Destroyer
|
Ursule Destroyer
|
||||||
{
|
{
|
||||||
API Name = "URSULE_DESTROYER"
|
API Name = "URSULE_DESTROYER"
|
||||||
Time Limit = 60s
|
Time Limit = 60s
|
||||||
|
Monster Name = "Ursule, Mother of Bears"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Class Unlocks
|
Class Unlocks
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user