DayZ 1.24
Loading...
Searching...
No Matches
AchievementsXbox.c
Go to the documentation of this file.
9
15
22
29
35
50
52{
53 private void Achievements();
54 private void ~Achievements();
55
58
59 //===================================
60 // OnActionEat
61 //===================================
62 static void OnActionEat()
63 {
65 }
66
67 //===================================
68 // OnActionDrink
69 //===================================
70 static void OnActionDrink()
71 {
73 }
74
75 //===================================
76 // OnEquipdFullGear
77 //===================================
78 static void OnEquippedFullGear()
79 {
81 }
82
83 //===================================
84 // OnCookedSteak
85 //===================================
86 static void OnCookedSteak()
87 {
89 }
90
91 //===================================
92 // OnActionIgniteMatchbox
93 //===================================
95 {
96 CheckError(SendEventAction(EAchievementActionId.ACTION_IGNITE_FIRE_MATCHBOX));
97 }
98
99 //===================================
100 // OnActionIgniteRoadflare
101 //===================================
103 {
104 CheckError(SendEventAction(EAchievementActionId.ACTION_IGNITE_FIRE_ROAD_FLARE));
105 }
106
107 //===================================
108 // OnActionIgniteDrill
109 //===================================
111 {
112 CheckError(SendEventAction(EAchievementActionId.ACTION_IGNITE_FIRE_HAND_DRILL));
113 }
114
115 //===================================
116 // OnActionShave
117 //===================================
118 static void OnActionShave()
119 {
121 }
122
123 //===================================
124 // OnActionGutDeer
125 //===================================
126 static void OnActionGutDeer()
127 {
129 }
130
131 //===================================
132 // OnActionMedsSurvivor
133 //===================================
135 {
136 CheckError(SendEventAction(EAchievementActionId.ACTION_APPLY_MEDS_ON_SURVIVOR));
137 }
138
139 //===================================
140 // OnActionHandcuff
141 //===================================
142 static void OnActionHandcuff()
143 {
144 CheckError(SendEventAction(EAchievementActionId.ACTION_HANDCUFF_SURVIVOR));
145 }
146
147 //===================================
148 // OnPlayerKilled
149 //===================================
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 }
183
184 //-----------------------------------
185 // CheckError
186 //-----------------------------------
187 private static void CheckError(EAchievementError error)
188 {
189 if (error != EAchievementError.ERR_OK)
190 Print("Achievements: Cannot send achievement event. Error ID: " + error);
191 }
192};
193
EAchievementError
@ ERR_NOT_FOUND
@ ERR_NOT_IMPLEMENTED
@ ERR_UNKNOWN
@ ERR_BAD_DATA
@ ERR_OK
EAchievementRangeId
@ RANGE_MELEE
@ RANGE_RANGED
@ RANGE_OTHER
EAchievementActionId
@ ACTION_EAT
@ ACTION_IGNITE_FIRE_HAND_DRILL
@ ACTION_IGNITE_FIRE_MATCHBOX
@ ACTION_GUT_DEER
@ ACTION_DRINK
@ ACTION_SHAVE
@ ACTION_HANDCUFF_SURVIVOR
@ ACTION_COOK_STEAK
@ ACTION_EQUIP_GEAR
@ ACTION_IGNITE_FIRE_ROAD_FLARE
@ ACTION_APPLY_MEDS_ON_SURVIVOR
EAchievementHitId
@ HIT_OTHER
@ HIT_HEADSHOT
EAchievementTargetId
@ TARGET_INFECTED
@ TARGET_SURVIVOR
Achievements AchievementsXbox
EAchievementRankId
@ RANK_SURVIVOR
must be TARGET_SURVIVOR
@ RANK_INFECTED
must be TARGET_INFECTED
@ RANK_INFECTED_SOLDIER
must be TARGET_INFECTED
static void OnActionIgniteRoadflare()
static void OnCookedSteak()
static void OnActionDrink()
static void OnActionIgniteMatchbox()
static proto EAchievementError SendEventKill(EAchievementTargetId target_id, EAchievementRankId rank_id, EAchievementRangeId range_id, EAchievementHitId hit_id, float distance)
static void OnActionIgniteDrill()
static void OnActionHandcuff()
static void OnActionMedsSurvivor()
static void OnActionEat()
static void OnEquippedFullGear()
void ~Achievements()
static void OnActionGutDeer()
static void OnActionShave()
static void CheckError(EAchievementError error)
static void OnPlayerKilled(EntityAI victim, EntityAI killer, EntityAI source, bool is_headshot)
static proto EAchievementError SendEventAction(EAchievementActionId action_id)
void Achievements()
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto void Print(void var)
Prints content of variable to console/log.