游戏数据基础/en

==Doctor's Level==
Suppose x is the doctor's level, and y is the upper limit of sanity. Then x and y have the following functional relationship:
\(y = \begin{cases}
2x + 80 ( 0 < x \leqslant 5 ) \\
x + 85 ( 5 < x \leqslant 35 ) \\
trunc( x / 5 + 113 ) ( 35 < x \leqslant 85 ) \\
130 ( 85 < x \leqslant 100 ) \\
trunc( x / 4 + 105.75) ( 100 < x \leqslant 120 ) \\
\end{cases}\)
Suppose x is the doctor's level, and z is the exp required for upgrading. Then x and z have the following functional relationship:
\(z = \begin{cases}
500 ( 0 < x \leqslant 1 ) \\
800 ( 1 < x \leqslant 2 ) \\
80x + 1000 ( 2 < x \leqslant 28 ) \\
100x + 160 ( 28 < x \leqslant 34 ) \\
300x - 6300 ( 34 < x \leqslant 50 ) \\
500x - 16500 ( 50 < x \leqslant 65 ) \\
1000x - 49000 ( 65 < x \leqslant 101 ) \\
2000x - 150000 ( 101 < x \leqslant 110 ) \\
3000x - 260000 ( 110 < x \leqslant 120 ) \\
\end{cases}\)
==Operator Trust==
==Operator Level==
===XP Values Corresponding to Level===
===Maximum Level Corresponding to Rarity/Promotion Stage===
==Operator Traits==
Under normal circumstances:
*Sniper operators that deal have a splash radius of 1 tile. 
*Caster operators that deal have a splash radius of 1.1 tiles.
*Caster operators that deal that bounces between enemies have a bounce radius of 1.5 tiles.
==XP Values of XP Records==
XP Record type	Experience given
 	200
 	400
 	1000
 	2000
==LMD Needed for elite promotion ==
 	★6 	★5 	★4 	★3 	★2	★1
0→1 	30,000 	20,000 	15,000	10,000	— 	—
1→2 	180,000	120,000	60,000	— 	— 	—
Total	210,000	140,000	75,000	10,000	— 	—
==Attributes==
All entities in battles in the game have their own attributes.
For more information and experiments on the attributes and corresponding basic formulas, this NGA thread,NGA：从源头解析单位数值运算方式与运算公式, could be helpful.
===Definitions of attributes===
====Definitions of basic attributes====
It is defined as the fundamental information, which usually would be the data directly taken from the gamedata on these attributes.
====Raw value====
It is defined as the value after calculations using attribute calculator and runes. You might refer to the actual details of attribute calculators and runes in the following subsections.
====Attributes Modifiers====
*fetchBaseValueFromSourceEntity
::This is the special case of modifiers. When it is applied, the corresponding attributes modifier(s) would be overwritten. 
::The entity using this modifier: Sora
Original modifier 	After overwriting	Values after overwriting
addition/final_addition	No changes 	Corresponding values of attributes from source entity + values from modifier
multiplier 	addition 	Corresponding values of attributes from source entity + values from modifier
final_scaler 	final_addition 	Corresponding values of attributes from source entity * correctedCheck out the explanation 2 on final_scalervalues from modifier
===Basic formulas on attributes===
*There are 4 different types of modifiers applying on attributes (numeric operations).
**addition: Add the number given to the basic attributes directly.
**multiplier: Multiply the results from addition by the number given.
**final_addition: Add the number given to the results after addition and multiplier.
**final_scaler: In lowest priority. That is, Multiply the results after addition, multiplier, and final_addition by the number given. 
*Layering of multiple modifiers: Except final_scaler (values from each modifier are multiplying with each other), the rest of the modifiers are adding to each other. Thus, if multiple modifiers are applied:
**The result from addition = addition A + addition B + ...
**The result from multiplier = multiplier A+ multiplier B + ...When the result is less than 0, it is automatically corrected to be 0
**The result from final_addition = final_addition A + final_addition B + ...
**The result from final_scaler= final_scaler A * final_scaler B * ...When any term is less than 0, it is automatically corrected to be the original value+1
*Final value: defined as the result after applying limitations from Gamedata Basis#Range of ValuesWhen the result is less than the corresponding lower bound of the value, the lower bound is taken as a result, and vice versa
**Final value = ((Raw value + result from addition) * (1 + result from multiplier) + result from final_addition) * result from final_scaler
===Attribute Calculator===
*Attribute calculator is only used for the first step of calculations on basic attributes values. The result is referred as basic status. 
*Attribute calculator is only used for operators. Other non-operator values would not invoke in these calculations (for example, traps). 
*Attribute calculator is based on elite phases, levels, potential level and trust value.
The detailed steps on the attribute calculator are:
:1.Based on the elite phases and levels, calculate the value for 2nd step 
:2.Get the trust level from the trust level table based on the current trust value. Then based on the pre-defined add-on values of this operator for the trust level, add that add-on value on the result from the 1st step, and use that as the input of the 3rd step. 
:3.Substitute the number from 2nd step to the basic formulas as the basic value, after corrections from potential level(usually it would be Addition), which is the basic value of the operator(shown as the attributes in the profile)
===Rune===
Rune is a general term for a special type of buff/debuff. It is usually used in extra data in the stages, such as buff/debuff in challenge mode and in contingency contract events.
Rune is based on predefined values to change the in-game data. It could be used to change the settings of the stage, properties of the stage, basic status of operators and enemies, and tiles in the stage.
Basic status used in calculations of runes are coming from the attributes calculator (of operators) or basic attributes of other units except for operators. The basic status in the following formulas are all referring to these values. 
Rune itself is not only used to calculate attributes, so its rules of calculations could not be fitted into the basic formulas of the attributes.
In rune calculations, there are 2 types of modifiers: addition and multiplication. The priority of addition is higher than multiplication. The detailed steps are listed as follows:
*When multiple modifiers in the same type are layering up each other, then the result would be：
**Rune addition = addition A + addition B+...
**Rune multiplication = multiplication A * multiplication B*...
*Thus, the result(termed as Raw values) based on the rune calculations is:
*Raw value(rune calculation applied) = (Basic status form attribute calculator + result from Rune Addition) * result in Rune Multiplication
===Examples===
<tabber>
Example 1 = 
Example 1 This is SilverAsh's 3rd skill, True Silver Slash
Since final_scaler has the lowest priority in modifiers, Silverash's Def would be calculated as 30% of the result after implementation of other attribute modifiers. Silverash's Atk would be influenced by following modifiers in lower or equal priorities, final_addition ,final_scaler and other modifiers announced as multiplier.
|-|
Example 2 =
Example 2 Tables listed are the 1st skill of Mousse and Waai Fu
Hence, assume enemy's atk is 1000, when Mousse's and Waai Fu's skills are in effect, the enemy's atk would be lowered to:
*1000 * (1 - 40%) * 60% = 360
At the same time, let's assume an impossible situation, when Mousse's and Waai Fu's skills are in effect on Silverash who also has True Silver Slash activated(and again, for convenience of calculation, assume atk of Silverash is 1000), his atk would be:
*1000 * (1 - 40% + 200%) * 60% = 1560
|-|
Example 3 =
Example 3 This is Sora's skill, Hymn of Battle.
Sora's skill could be described as an aura buff. The value associated with this aura buff is the value applied as final_scaler modifier. Assume her atk is 500, then the buffed value on the allies would be:
*500 * 100% = 500
At the same time, from the definition of status, the modifier of Sora's aura buff is fetchBaseValueFromSourceEntity. Thus, the buff value would be overwritten as final_addition modifier. Hence, when Silverash (as the same assumptions in example 2) is buffed with this aura, his atk would be:
*1000 + 500 = 1500
Let's assume one more situation, if True Silver Slash is activated(other assumptions are the same, where Silverash's atk is 1000), along with the buff from Sora's aura, and Silverash is debuffed by skill 1 of Mousse and Waai Fu at the same time, then his atk would be:
*(1000 * (1 - 40% + 200%) + 500) * 60% = 1860
</tabber>
==Basic Formula==
*All damage, buff, and debuff calculations should be viewed as calculations involving only attributes.
*The basic formula refers to formulas using attributes as the core variable to calculate the result.
*All of the formulas below have attribute variables bolded. The attribute variable’s value should be a calculated value based on the attribute calculation method listed in Fundamental Mechanisms and Algorithms#Attributes
*MAX function takes the largest of given values.Refer to MAX Function Implementation；CLAMP function takes min, max, or a value between min and max values.Refer to CLAMP Function Implementation。
===Scales===
The scale is a variable that can be affected by external factors, such as skills. Its initial value is set to 1.0.
====Attack Scale====
Note: Attack Scale itself isn't an attribute.
====Damage Scale====
Most damage amplification buffs belong to this type.
The damage scale will only work on the correct corresponding damage type.
Note: Damage Scale itself isn't an attribute.
====Heal Scale====
Note: Heal Scale itself isn't an attribute.
If there are multiple scales of the same type, the result is:
*Final Scale = Scale 1 * Scale 2 * ...
===Damage Formula===
====Physical Damage====
Basic Physical Damage = MAX(0.05 * Attack * Attack Scale, Attack * Attack Scale - (1 - Defense Ignore Percentage) * MAX(0, Target’s final Defense - flat Defense Ignore)
====Magical Damage====
Basic Magical Damage = MAX(0.05 * Attack * Attack Scale, 0.01 * Attack * Attack Scale * MAX(0, 100 - (1 - RES Ignore Percentage) * MAX(0, Target’s final RES - flat RES Ignore)
====Pure Damage====
Basic Pure Damage = Attack * Attack Scale
*Final Damage = Basic Damage * Damage Scale corresponding to the type of damage inflicted
====Healing====
Heal Amount = Attack * Heal Scale
※ Heal Amount is not affected by Damage Scale.
===攻速公式===
实际攻击间隔 = 理论攻击间隔/(CLAMP( 攻击速度,10虽然基本下限为10，但攻击速度属性被限制了下限为20。见游戏数据基础#数值范围, 600)/100) CLAMP函数在此处表示若攻击速度在10-600之间，则输出攻击速度 ，否则输出两端的极值，小于10则输出10，大于600则输出600。 
:其中攻击速度的基础值为100。
每秒攻击次数 = 1/实际攻击间隔
同时，如果不确定干员的理论攻击间隔，除了查询数据外，还可根据干员页面的攻速显示来确定攻击间隔区间。
描述 	区间
非常快 	＜0.8s
快 	0.8s-1.0s
中等 	1.0s-1.2s
较慢 	1.2s-1.6s
慢 	≥1.6s
===重量公式===
====力度对应表====
描述 	力度
微小力(稍微) 	-1
小力 	0
中力 	1
较大力 	2
大力 	3
=====推力=====
资料来源：NGA-hjhk258
*推力和重量和位移时间以及位移长度的关系如下表
力度减重量 	位移长度(格) 	位移时间(秒)
≤-3 	0 	0
-2 	0.102 	0.204
-1 	0.406 	0.408
0 	1.633 	0.816
1 	2.066 	0.918
2 	2.866 	1.082
3 	3.433 	1.184
*公式：位移=0.5*初速度^2/加速度，其中加速度的值为4.9
=====拉力=====
力度减重量 	拉力 	位移长度(格) 	位移时间(秒)
≤-3 	0.0 	0.0 	0.0
-2 	2.0 	0.03由于拉力小于摩擦力，敌人只会缓慢蠕动 	0.5
-1 	10.0	0.35倍初始距离初始距离0-4范围内近似成立 	max(0.65*sqrt(初始距离),1.0)初始距离0-4范围内近似成立，0.65*sqrt(初始距离)到1.0这段时间内缓慢蠕动
0 	40.0	必定拉至身前初始距离小于89 	
1 	42.0	必定拉至身前 	
2 	44.0	必定拉至身前 	
3 	46.0	必定拉至身前 	
===移速公式===
*标注为“停顿”的实际攻击效果为最终降低80%的移动速度。
*在没有明确标注持续时间的前提下，停顿效果默认持续0.8秒。
*移动速度计算公式请参阅属性基本公式，但无论如何，敌方单位的移动速度不会低于其下限0.1。
===闪避公式===
*闪避与其他抵消伤害类BUFF之间的叠加问题为概率学问题，按照触发技能或天赋中优先定义的行为节点来决定先后顺序。
闪避成功率=1-(1-)×(1-)×(1-n)
===Maintain Skill Status===
====Time Mode====
Skills that maintain skill status need to set a time mode to determine their attack interval during the said skill. Currently, the known time modes are:
*Follow attack speed
*Follow animation
*Special
Follow attack speed: the skill's attack interval is determined by attack speed and follows the normal attack interval.
Follow animation: the skill's attack interval is determined by a Spine animation cycle. Every time the Spine animation cycle for the skill is played, it deals its damage or effect.
Special: unknown.
====Differences====
Unlike normal skills, "maintain skill status" has the following properties:
: Immune to changes in attack speed (Frost, Frostnova, [Cold]'s attack speed reduction and Active Originium's attack speed buff has no effect);
: Hard crowd control such as [Stun] and frozen [Frozen] will end "maintain skill status" prematurely, causing it to enter SP recovery time.
===Aggro Formula===
Dafa Source：NGA-hjhk258
Aggro filtering in-game is divided into two parts: Weighted Calculation and Rule Ordering. Weighted Calculation is further divided into "postFilter Rules Calculation" and "Aggro Value Calculation".
*Calculate the Aggro value:
:Enemy Target's Aggro value = 1000 * Taunt level - Enemy distance to endpoint
:Allied Target's Aggro value = 10000 * Taunt level + Creation time (an absolute value, with units in seconds, bounded by [0, 10000])
*Substitute into postFilter Rules for secondary calculations and ordering:
postFilter Classification and Formulas Implemented In-Game	postFilter Classification and Formulas Implemented In-Game	postFilter Classification and Formulas Implemented In-Game 	postFilter Classification and Formulas Implemented In-Game 	postFilter Classification and Formulas Implemented In-Game
Number 	Name 	Explanation 	Typical User 	Weighted Calculation Formula
0 	ALL 	All 	Splash attacks 	Unknown
1 	DIST_TO_EXIT_ASC 	Distance to the endpoint, in ascending order 	None 	Distance to endpoint
2 	HP_RATIO_ASC 	Health ratio, in ascending order 	Absinthe Skill 1 	Health percentage
3 	HP_RATIO_NOT_FULL_ASC 	Health ratios of targets that are not at full health, in ascending order	All kinds of heals 	Health percentage
4 	HATRED_DES 	Aggro, in descending order 	Normal attacks 	Aggro Value's additive inverse
5 	HP_RATIO_NOT_FULL 	Only selects targets whose health is not full 	None 	None
6 	HATRED_DES_FLY_FIRST 	Prioritizes aerial targets, Aggro in descending order 	Adnachiel only; normal snipers does not use this 	Aggro value's additive inverse; non-aerial units have +1000000 weight
7 	HATRED_DES_RANGED_FIRST 	Prioritizes ranged units, Aggro in descending order 	None 	Aggro value's additive inverse; non-ranged units have +1000000 weight
8 	DEF_DES 	Defense, in descending order 	Steward, Ceobe Skill 2 	Defense value's additive inverse * 1000 - Aggro value
9 	DEF_ASC 	Defense, in ascending order 	Firewatch 	Defense value * 1000 - Aggro value
10 	DIST_TO_SOURCE_DES 	Distance to the source, in descending order 	Pull Operators 	Additive inverse of the distance to source squared
11 	DIST_TO_SOURCE_ASC 	Distance to the source, in ascending order 	Shaw 	Distance to source squared
12 	NOT_STUNNED_HATRED_DES 	Only selects targets that are not stunned; Aggro in descending order 	Sarkaz Casters' bind skill 	Additive inverse of Aggro
13 	DIRECTIONAL_DIST_TO_SOURCE_ASC 	Directional distance to the source, in ascending order 	FEater Skill 2 	Vector of the source to enemy's projection on source direction
14 	RANDOM 	Random 	Cutter Skill 1; Volcano and Spirit Burst does not belong to this category	Random
15 	HP_DES 	Health, in descending order 	W Skill 3 	Health's additive inverse * 1000 - Aggro value
16 	HP_ASC 	Health, in ascending order 	None 	Health * 1000 - Aggro value
17 	ATK_DES 	Attack, in descending order 	None 	Attack's additive inverse * 1000 - Aggro value
18 	ATK_ASC 	Attack, in ascending order 	None 	Attack * 1000 - Aggro value
19 	MAX_HP_DES 	Maximum health, in descending order 	Rat King's Singing Sands 	Max health's additive inverse * 1000 - Aggro value
20 	MAX_HP_ASC 	Maximum health, in ascending order 	Rat King's Sand Tomb 	Max health * 1000 - Aggro value
21 	FORWARD_FIRST_MANHATTAN_ASC 	Prioritizes frontal direction, Manhattan distance in ascending order 	Aak's Skill 2, 3 	1000 * Manhattan distance The distance in the North-South direction plus the distance in the East-West direction between two points; in other words, the absolute value of the difference between the abscissas + the distance between the ordinates. - Aggro Value; 1000 becomes 1000000 when not directly in front
22 	HATRED_DES_UNBLOCKED_FIRST 	Prioritizes unblocked targets, Aggro in descending order 	Ceobe Skill 1 	Aggro value's additive inverse; blocked units have +1000000 weight
23 	HP_NOT_FULL_RANDOM 	Random targets whose health is not full 	Purestream Skill 2 	Random
24 	HATRED_DES_INVISIBLE_FIRST 	Prioritizes invisible targets, Aggro in descending order 	Elysium Skill 2 	Aggro value's additive inverse; non-invisible units have +1000000 weight
25 	HATRED_DES_DIST_FARTHER_FIRST 	Prioritizes the furthest target, Aggro in descending order 	Patriot's javelin throw 	-1000000 * Distance - Aggro value
26 	HATRED_DES_DIST_NEARER_FIRST 	Prioritizes the nearest target, Aggro in descending order 	None 	1000000 * Distance - Aggro value
27 	MASS_DES 	Mass, in descending order 	Poca/Rosa 	Weight level's additive inverse * 1000 - Aggro level
28 	MASS_ASC 	Mass, in ascending order 	None 	Weight level * 1000 - Aggro level
29 	HATRED_DES_SLEEPING_FIRST 	Prioritize sleeping units, Aggro in descending order 	Blemishine 	Aggro value's additive inverse; Aggro value stay fixed on units with ID0 effect (Sleep) in AbnormalCombo, otherwise +1000000 weight
30 	HP_RATIO_ASC_CONTAINS_STATUS_RESISTABLE_BUFF_FIRST 	Prioritize low HP ratio units, Aggro in ascending order 	Whisperain 	Aggro value equals to remaining HP ratio, units without Resistable Buff +1000000 weight
: The calculated result is a 32-bit float variable, and the smallest value will be prioritized.
: Since the allied Aggro value without Taunt is equal to the creation time, and creation time is bounded within [0, 10000], therefore all allied units deployed after 10000s (≈2.78h) can be considered to be deployed at the same time. At this point, enemies will prioritize (what we consider to be) the first deployed units after 10000 seconds, unless an allied unit increases its own Taunt level.
* Next is Rule Ordering, or sometimes secondaryFilter. There are three types:
ID	Name  	Explanation
0 	FLY_FIRST 	Prioritize aerial units (all anti-air snipers)
1 	RANGED_APPLYWAY_FIRST	Prioritize ranged units (Adnachiel)
2 	SPECIFIED_FILTER_TAG 	Prioritize XXTag (tag needs to be filled in conjunction with the filterTag variable, such as Glaucus)
3 	SPECIFIED_BUFF 	Prioritize units with specified buff (distinguish by BuffKey)
==Range of Values==
==Abnormal Effects==
==Status Effects==
==Special Terrain==
==装置==
==Infrastructure==
===Training Room===
*Basic Training Time
Mastery stage	Time taken
⇨ 	08:00:00
⇨ 	16:00:00
⇨ 	24:00:00
*Acceleration of training speed from assigned operator
:If any operator that isn't in the Distracted state is assigned to the Training Room, a 5% increase in training speed will be given.
:Actual training time = Basic training time/(1 + 0.05 +increase in training speed due to assigned operator's Base Skill)
===Reception Room===
Source：NGA-botpig
*The final percentage increase in clue searching speed is the sum of the percentage increases listed in the below table.
*According to official notices, clue searching speed is affected by dormitory ambience, however the exact details are unknown.
Rarity of operator stationed	Addition to clue collection speed	Promotion stage of operator stationed	Addition to clue collection speed	Reception room level	Addition to clue collection speed
1 	5% 	0 	0% 	1 	7%
2 	5% 	0 	0% 	1 	7%
3 	5% 	1 	8% 	2 	14%
4 	7% 	1 	8% 	2 	14%
5 	9% 	2 	16% 	3 	25%
6 	10% 	2 	16% 	3 	25%
===Dormitory===
*Morale recovered/hour = 1.5 + 0.1 x Dorm level + 0.0004 x actual Dormitory Ambience