DayZ 1.24
Loading...
Searching...
No Matches
BloodTypes Class Reference
Collaboration diagram for BloodTypes:
[legend]

Static Private Member Functions

static int GenerateBloodType ()
 
static bool MatchBloodCompatibility (int bloodtypetarget, int bloodtype)
 
static string GetBloodTypeName (int bloodtype, out string type, out bool positive)
 

Static Private Attributes

static const int NUM_OF_BLOOD_TYPES = 8
 

Detailed Description

Definition at line 1 of file BloodType.c.

Member Function Documentation

◆ GenerateBloodType()

static int BloodTypes::GenerateBloodType ( )
inlinestaticprivate

Definition at line 6 of file BloodType.c.

7 {
9 int probability[NUM_OF_BLOOD_TYPES] = {42, 10, 25, 5, 9, 3, 2, 2};
10
11 int probability_sum = 0;
12
13 for (int i = 0; i < NUM_OF_BLOOD_TYPES; i++)
15
16 //TIMERDEPRECATED - randomized blodtype for new character
18
19 int tmp = 0;
20 int index;
21
22 for (i = 0; i < NUM_OF_BLOOD_TYPES; i++)
23 {
24 tmp += probability[i];
25
27 {
28 index = i;
29 break;
30 }
31 }
32
33 return types[index];
34 }
static const int NUM_OF_BLOOD_TYPES
Definition BloodType.c:3
Definition EnMath.c:7
const int LIQUID_BLOOD_AB_P
Definition constants.c:500
const int LIQUID_BLOOD_0_P
Definition constants.c:494
const int LIQUID_BLOOD_B_P
Definition constants.c:498
const int LIQUID_BLOOD_A_N
Definition constants.c:497
const int LIQUID_BLOOD_0_N
Definition constants.c:495
const int LIQUID_BLOOD_B_N
Definition constants.c:499
const int LIQUID_BLOOD_A_P
Definition constants.c:496
const int LIQUID_BLOOD_AB_N
Definition constants.c:501
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].

References LIQUID_BLOOD_0_N, LIQUID_BLOOD_0_P, LIQUID_BLOOD_A_N, LIQUID_BLOOD_A_P, LIQUID_BLOOD_AB_N, LIQUID_BLOOD_AB_P, LIQUID_BLOOD_B_N, LIQUID_BLOOD_B_P, NUM_OF_BLOOD_TYPES, and Math::RandomInt().

Referenced by PlayerStatsPCO_Base::Init().

◆ GetBloodTypeName()

static string BloodTypes::GetBloodTypeName ( int bloodtype,
out string type,
out bool positive )
inlinestaticprivate

Definition at line 82 of file BloodType.c.

83 {
84 string bloodTypeName;
85 switch (bloodtype)
86 {
88 bloodTypeName = "0+";
89 type = "0";
90 positive = true;
91 break;
92
94 bloodTypeName = "0-";
95 type = "0";
96 positive = false;
97 break;
98
100 bloodTypeName = "A+";
101 type = "A";
102 positive = true;
103 break;
104
105 case LIQUID_BLOOD_A_N:
106 bloodTypeName = "A-";
107 type = "A";
108 positive = false;
109 break;
110
111 case LIQUID_BLOOD_B_P:
112 bloodTypeName = "B+";
113 type = "B";
114 positive = true;
115 break;
116
117 case LIQUID_BLOOD_B_N:
118 bloodTypeName = "B-";
119 type = "B";
120 positive = false;
121 break;
122
124 bloodTypeName = "AB+";
125 type = "AB";
126 positive = true;
127 break;
128
130 bloodTypeName = "AB-";
131 type = "AB";
132 positive = false;
133 break;
134
135 default:
136 bloodTypeName = "";
137 break;
138 }
139
140 return bloodTypeName;
141 }

References LIQUID_BLOOD_0_N, LIQUID_BLOOD_0_P, LIQUID_BLOOD_A_N, LIQUID_BLOOD_A_P, LIQUID_BLOOD_AB_N, LIQUID_BLOOD_AB_P, LIQUID_BLOOD_B_N, and LIQUID_BLOOD_B_P.

Referenced by RecipeBase::Do(), ActionTestBloodTarget::OnFinishProgressClient(), Hud::UpdateBloodName(), UIScriptedMenu::UpdateItemInfoLiquidType(), and HudDebugWinBase::UpdateValues().

◆ MatchBloodCompatibility()

static bool BloodTypes::MatchBloodCompatibility ( int bloodtypetarget,
int bloodtype )
inlinestaticprivate

Definition at line 36 of file BloodType.c.

37 {
38 bool result = false;
39 switch (bloodtype)
40 {
43 break;
44
47 break;
48
51 break;
52
55 break;
56
59 break;
60
63 break;
64
67 break;
68
71 break;
72
73 default:
74 Debug.Log("Incorrect blood type");
75 break;
76 }
77 if (result)
78 return true;
79 else
80 return false;
81 }
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133

References LIQUID_BLOOD_0_N, LIQUID_BLOOD_0_P, LIQUID_BLOOD_A_N, LIQUID_BLOOD_A_P, LIQUID_BLOOD_AB_N, LIQUID_BLOOD_AB_P, LIQUID_BLOOD_B_N, LIQUID_BLOOD_B_P, and Debug::Log().

Referenced by CAContinuousQuantityBloodTransfer::CalcAndSetQuantity(), ActionGiveBloodSelf::OnEndServer(), and ActionGiveBloodTarget::OnEndServer().

Member Data Documentation

◆ NUM_OF_BLOOD_TYPES

const int BloodTypes::NUM_OF_BLOOD_TYPES = 8
staticprivate

Definition at line 3 of file BloodType.c.

Referenced by GenerateBloodType().


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