DayZ 1.24
Loading...
Searching...
No Matches
Achievements Class Reference

Private Member Functions

void Achievements ()
 
void ~Achievements ()
 

Static Private Member Functions

static proto EAchievementError SendEventAction (EAchievementActionId action_id)
 
static proto EAchievementError SendEventKill (EAchievementTargetId target_id, EAchievementRankId rank_id, EAchievementRangeId range_id, EAchievementHitId hit_id, float distance)
 
static void OnActionEat ()
 
static void OnActionDrink ()
 
static void OnEquippedFullGear ()
 
static void OnCookedSteak ()
 
static void OnActionIgniteMatchbox ()
 
static void OnActionIgniteRoadflare ()
 
static void OnActionIgniteDrill ()
 
static void OnActionShave ()
 
static void OnActionGutDeer ()
 
static void OnActionMedsSurvivor ()
 
static void OnActionHandcuff ()
 
static void OnPlayerKilled (EntityAI victim, EntityAI killer, EntityAI source, bool is_headshot)
 
static void CheckError (EAchievementError error)
 

Detailed Description

Definition at line 51 of file AchievementsXbox.c.

Constructor & Destructor Documentation

◆ Achievements()

void Achievements::Achievements ( )
private

◆ ~Achievements()

void Achievements::~Achievements ( )
private

Member Function Documentation

◆ CheckError()

static void Achievements::CheckError ( EAchievementError error)
inlinestaticprivate

Definition at line 187 of file AchievementsXbox.c.

188 {
189 if (error != EAchievementError.ERR_OK)
190 Print("Achievements: Cannot send achievement event. Error ID: " + error);
191 }
EAchievementError
proto void Print(void var)
Prints content of variable to console/log.

References Print().

Referenced by OnActionDrink(), OnActionEat(), OnActionGutDeer(), OnActionHandcuff(), OnActionIgniteDrill(), OnActionIgniteMatchbox(), OnActionIgniteRoadflare(), OnActionMedsSurvivor(), OnActionShave(), OnCookedSteak(), OnEquippedFullGear(), and OnPlayerKilled().

◆ OnActionDrink()

static void Achievements::OnActionDrink ( )
inlinestaticprivate

Definition at line 70 of file AchievementsXbox.c.

71 {
73 }
EAchievementActionId
static void CheckError(EAchievementError error)
static proto EAchievementError SendEventAction(EAchievementActionId action_id)

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::OnActionDrink().

◆ OnActionEat()

static void Achievements::OnActionEat ( )
inlinestaticprivate

Definition at line 62 of file AchievementsXbox.c.

63 {
65 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::OnActionEat().

◆ OnActionGutDeer()

static void Achievements::OnActionGutDeer ( )
inlinestaticprivate

Definition at line 126 of file AchievementsXbox.c.

127 {
129 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::OnActionFinishedGutDeer().

◆ OnActionHandcuff()

static void Achievements::OnActionHandcuff ( )
inlinestaticprivate

Definition at line 142 of file AchievementsXbox.c.

143 {
144 CheckError(SendEventAction(EAchievementActionId.ACTION_HANDCUFF_SURVIVOR));
145 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::OnActionRestrain().

◆ OnActionIgniteDrill()

static void Achievements::OnActionIgniteDrill ( )
inlinestaticprivate

Definition at line 110 of file AchievementsXbox.c.

111 {
112 CheckError(SendEventAction(EAchievementActionId.ACTION_IGNITE_FIRE_HAND_DRILL));
113 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::Event_OnPlayerIgnitedFireplace().

◆ OnActionIgniteMatchbox()

static void Achievements::OnActionIgniteMatchbox ( )
inlinestaticprivate

Definition at line 94 of file AchievementsXbox.c.

95 {
96 CheckError(SendEventAction(EAchievementActionId.ACTION_IGNITE_FIRE_MATCHBOX));
97 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::Event_OnPlayerIgnitedFireplace().

◆ OnActionIgniteRoadflare()

static void Achievements::OnActionIgniteRoadflare ( )
inlinestaticprivate

Definition at line 102 of file AchievementsXbox.c.

103 {
104 CheckError(SendEventAction(EAchievementActionId.ACTION_IGNITE_FIRE_ROAD_FLARE));
105 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::Event_OnPlayerIgnitedFireplace().

◆ OnActionMedsSurvivor()

static void Achievements::OnActionMedsSurvivor ( )
inlinestaticprivate

Definition at line 134 of file AchievementsXbox.c.

135 {
136 CheckError(SendEventAction(EAchievementActionId.ACTION_APPLY_MEDS_ON_SURVIVOR));
137 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::OnActionBandageTarget().

◆ OnActionShave()

static void Achievements::OnActionShave ( )
inlinestaticprivate

Definition at line 118 of file AchievementsXbox.c.

119 {
121 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::OnActionFinishedShaveSelf().

◆ OnCookedSteak()

static void Achievements::OnCookedSteak ( )
inlinestaticprivate

Definition at line 86 of file AchievementsXbox.c.

87 {
89 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::OnActionCookedSteak().

◆ OnEquippedFullGear()

static void Achievements::OnEquippedFullGear ( )
inlinestaticprivate

Definition at line 78 of file AchievementsXbox.c.

79 {
81 }

References CheckError(), and SendEventAction().

Referenced by AnalyticsManagerClient::OnItemAttachedAtPlayer().

◆ OnPlayerKilled()

static void Achievements::OnPlayerKilled ( EntityAI victim,
EntityAI killer,
EntityAI source,
bool is_headshot )
inlinestaticprivate

Definition at line 150 of file AchievementsXbox.c.

151 {
156 float distance = 0;
157
158 if (victim.IsZombie())
159 {
160 target_id = EAchievementTargetId.TARGET_INFECTED;
161 target_rank_id = EAchievementRankId.RANK_INFECTED;
162
163 if (victim.IsZombieMilitary())
164 target_rank_id = EAchievementRankId.RANK_INFECTED_SOLDIER;
165 }
166
167 if (source)
168 {
169 if (source.IsMeleeWeapon())
170 range_id = EAchievementRangeId.RANGE_MELEE;
171 else if (source.IsWeapon() && killer)
172 {
173 range_id = EAchievementRangeId.RANGE_RANGED;
174 distance = vector.Distance(killer.GetPosition(), victim.GetPosition());
175
176 if (is_headshot)
177 hit_id = EAchievementHitId.HIT_HEADSHOT;
178 }
179 }
180
182 }
EAchievementRangeId
EAchievementHitId
EAchievementTargetId
EAchievementRankId
static proto EAchievementError SendEventKill(EAchievementTargetId target_id, EAchievementRankId rank_id, EAchievementRangeId range_id, EAchievementHitId hit_id, float distance)
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

References CheckError(), vector::Distance(), and SendEventKill().

Referenced by AnalyticsManagerClient::Event_OnEntityKilled().

◆ SendEventAction()

◆ SendEventKill()

static proto EAchievementError Achievements::SendEventKill ( EAchievementTargetId target_id,
EAchievementRankId rank_id,
EAchievementRangeId range_id,
EAchievementHitId hit_id,
float distance )
staticprivate

Referenced by OnPlayerKilled().


The documentation for this class was generated from the following file: