# 生命再生

 此页面的（部分）内容需要被翻译。你可以帮助我们来翻译此页面

1. 玩家的最大生命值：最大生命值越高，生命再生速度越快。
2. 移动状态：如果玩家为站定状态，则生命再生速度比移动时高2.5倍。
3. 持续时间：再生时间越久，再生速度也会越快，持续60秒（游戏内的一小时）后，再生速度不再随时间提升。
4. BuffDebuff：下文会详细概括，但要注意的是，状态效果并不对回复速度造成直接影响，而仅处于函数的中间部分。

## 细节

$\text{regeneration}_{\text{health}} = \frac{1}{2} * \Biggl[ \biggl( \underbrace{ \Bigl( \frac{\text{health}_{\text{max}}}{400}*0.85+0.15 \Bigr) * \text{time} }_{\text{regen}} + \underbrace{ \text{buff} }_{\text{buffs}} \biggr) * \underbrace{ \text{move} * \text{expert} }_{\text{special}} \Biggr]$

1. 自然回复(regen)部分包含：
• 最大生命值(health_max)
• 时间(time)：“从上次受伤到现在的时间”的相关变量。
• 时间(time)在函数中，从0开始，每过5秒增加1，30秒后，每过10秒增加1，最大提至9（0≤time≤9）(闪亮石允许这个值最大提升至38). 这意味着在受伤后最初的5秒钟内，这个值一直为零。
2. 状态效果(buffs)部分包含：
• 状态效果(buffs)：玩家身上所有Buff和Debuff的再生效果相加（没影响的除外），少数状态效果不影响buffs变量，而影响其他变量，这里暂且不提。状态效果对生命回复的影响较为简单，只有加减关系。
3. 特殊(specials)部分包含：
• 移动状态(move)：移动时取0.5，站定时取1.25。
• 专家模式(expert)：普通模式取1，专家模式取0.5。

### 注意事项

• 状态效果可以帮助玩家削短生命再生的延时。
• 对于初始玩家，受伤后持续站立12秒，会开始回复生命值（专家模式为17秒），保持移动则为17秒（专家模式为32秒）。

## 技术性说明

• 再生时间Regeneration Time (RT)：玩家进入再生状态的时间。通常情况下，该值每游戏刻会增加1，上限为3600。玩家受伤时该值会重置为零（停止再生）。
• 再生率再生率(R):每嘀嗒再生的生命值(1点R等于0.5点生命值/秒)。这增加了持续时间越长(玩家不受伤害的时间越长)。

(原文:再生率Regeneration Rate (R): Hit Points (HP) regenerated per tick (1 point of R is equal to 0.5 HP/s). This increases the longer the RT (the longer the player has been avoiding damage).)

• 再生计数器Regeneration Counter（RC）：每游戏时刻增加R，变为120或以上，或-120或以下，将减少或增加120，玩家将获得或失去1点生命值。

The Regeneration Rate (R) determines how fast the RC changes. R is normally 0 or positive, but could be negative if the player is inflicted with any life-draining debuffs, like Poisoned.)

## = 计算

• 如果RT<=1800，则每300 RT增加eRT+1。
• 如果RT>1800，每600 RT增加eRT+1。

(原文:First, The RT is converted to an Effective Regeneration Time ('eRT).

If RT <= 1800, each 300 RT boosts eRT +1.
If RT > 1800, each 600 RT boosts eRT +1.)


RT 0~299 300~599 600~899 900~1199 1200~1499 1500~1799 1800~2399 2400~2999 3000~3599 3600
eRT 0 1 2 3 4 5 6 7 8 9

• 如果玩家静止不动，R将乘以1.25。
• 如果玩家正在移动，它将乘以0.5。

In addition, if the player is in Expert mode and does not have a Well Fed buff, R will be additionally multiplied by 0.5.)

## 物品与增益

R也受到其他物品和buff的影响。 注：尽管溺水类似于生命吸取减益，但它只重置RT，不影响RC和R。它直接降低生命值。(原文:R is also affected by other items and buffs.

Note: Despite drowning being similar to life-draining debuffs, it only resets the RT and does not affect the RC and R. It directly reduces Hit Points instead.)

### 增益

RT +1 per tick

RT +5 per tick (and 1 per 2 additional mobs affected)

R +1

R +2

R +10 for each buff level (30 at the third level)

### 生命再生减益

• 野性咬减益:基数R乘以0.5
• 出血减益:保持R重置为0，所以基数R保持在0。

### 生命流失减益

• 中毒:-4
• 着火了！:-8
• 毒液，被诅咒的地狱，霜冻:-12
• 燃烧:-60
• 窒息:-40。
• 通电:-8(静止时)，或-32(移动时)。
• 舌头:-100只在专家模式。

Poisoned: -4
On Fire!: -8
Venom, Cursed Inferno,
Frostburn: -12
Burning: -60
Suffocation: -40.
Electrified: -8 (when standing still), or -32 (when moving).
The Tongue: -100 only in Expert Mode.


Note: If you are under the debuff of Burning or Suffocation, instead of losing 1 health when RC reaches -120, you'll always lose 5 health when RC reaches -600.)

### 蜂蜜

R <= -4 R 提高 6
-4 < R <= 0 R 变为 2
R > 0 R 提高 2
• 这意味着蜂蜜可以降低生命流失的速度。
• 蜂蜜还能使每次增加的RT+2（RT增加速度是原来的3倍）。

(原文:Which means Honey reduces the rate of any life-draining debuff.

Honey additionally boosts RT +2 per tick (RT increase is 3x as fast).)


### 闪亮石

• R=（600/400*0.85+0.15）*38*1.25*0.75*1.1+4=63
• 每格额外增加RC+1=每秒额外回复32点生命值。(:原文If the player is using items or not standing still, it will reset the multipliers of the Feral Bite debuff and Expert Mode to 0.75 from 0.5. Both of them only reduce the regeneration speed by 25% instead of the previous 50%. It will also multiply base R x1.1.

If the player is not using any items and almost standing still (it allows small amounts of movement), the following effects are applied in addition to those above:

1. If the player has any life-draining debuffs so that R is less than 0, R is reduced by half (if you also have Honey buff, then it increases R by 4 first(but no more than 0), then, R is reduced by half, finally, the Honey buff additionally increase R by 2.).
2. R +4.
3. RT +4 per tick.
4. If 90 < RT < 1800, RT is reset to 1800.
5. When RT > 3000, it will remove the RT cap, and every 300 RT above 3000 will boost eRT +1 (this part is capped at 30, so it will give an eRT maxed at 38 instead of the previous 9).
6. Finally, if R > 0, RC is boosted +1 per tick.

So, if the player is at 600 max HP, with the Shiny Stone and standing still, in Expert mode, without Well Fed:

R = (600 / 400 * 0.85 + 0.15) * 38 * 1.25 * 0.75 * 1.1 + 4 = 63
RC is additionally boosted +1 per tick
= 32 Hit Points per second regeneration rate.)


### 一个更复杂的例子

Assume the player is having Venom, On Fire!, Regeneration and Honey buff, equipping Shiny Stone and Charm of Myth, Standing next to a Heart Lantern, and standing still.

It would work in the step shown below:

1. The Regeneration buff and Charm of Myth increase the R by 4 and 1 respectively, so, R=5.
2. The life-draining debuffs cancel the effect above and set R to 0.
3. The Venom and On Fire! reduce R by 12 and 8 respectively, so, R=-20.
4. As the R<0, the Honey buff increased the R by 4, so, R=-16.
5. As the R is still less than 0, the Shiny Stone reduces it by half, so, R=-8.
6. Then the Honey, Shiny Stone and Heart Lantern increase R by 2, 4 and 2 respectively, so, R=0.
7. As player have life-draining debuffs, the RT will remain 0, so player would not get any natural health regeneration.
8. As R is not more than 0, the Shiny Stone won't provide the RC +1 per tick bonus.

So, player has R=0, and will neither gain or lose health.

Then, if player place a Campfire nearby, it will give R +1 boost and give player a 0.5 HP/s regeneration rate; in addition, as R>0, the Shiny Stone will now provide the RC +1 per tick bonus, which means an additional 0.5 HP/s regeneration rate. So, player will have a 1 HP/s regeneration rate.

However, if player is have Rapid Healing buff (which gives the RC +6 per tick effect and does not affect R) instead of the Campfire, the Shiny Stone won't provide the RC +1 per tick bonus. So player will finally get a 3 HP/s regeneration rate.)

## 参考

1. 代码储存于(PC版本1.3.0.8)Player.cs中的UpdateLifeRegen()