blob: 5f8b215e3ca5a0666575d89ed99edd90c424c254 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include "stdafx.h"
#include "..\..\Minecraft.h"
#include "..\..\LocalPlayer.h"
#include "..\..\StatsCounter.h"
#include "..\..\..\Minecraft.World\net.minecraft.stats.h"
#include "StatTask.h"
StatTask::StatTask(Tutorial *tutorial, int descriptionId, bool enablePreCompletion, Stat *stat, int variance /*= 1*/)
: TutorialTask( tutorial, descriptionId, enablePreCompletion, NULL )
{
this->stat = stat;
Minecraft *minecraft = Minecraft::GetInstance();
targetValue = minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue( stat ) + variance;
}
bool StatTask::isCompleted()
{
if( bIsCompleted )
return true;
Minecraft *minecraft = Minecraft::GetInstance();
bIsCompleted = minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue( stat ) >= (unsigned int)targetValue;
return bIsCompleted;
}
|