Basic Stats

25-10-2022

In Devas, there are 4 basic stats:

  1. Health
  2. Stamina
  3. Hunger
  4. Mana

Health


Last updated:    24-10-2022

  1. Mechanics
  2. Scoreboard Variables
  3. HP Calculation
  4. Recovery
  5. Fall Damage




  1. Mechanics

    Health is one of the 4 basic stats of a player.
    It indicates how much Health Points a player has, which is shown by the red bar on top of the hotbar.

    The minimum amount of HP is 1,
    and when the player has an HP ≤ 0, the player will die.


    The player has a Base Health of 100,
    This variable can be tuned in stats:init/settings.

    scoreboard players set Base_Health Stats.Settings 100





  2. Scoreboard Variables

    The scoreboard variables associated with Health are the following:

    PS.Health    (Total Health)
    PS.Health_HI (Held Item Bonus)
    PS.Health_SB (Skill Bonus)
    PS.Health_AB (Arena Bonus)
    PS.Health_SM (Skill Multiplier)
    PS.Health_AM (Arena Multiplier)

    # Please note that SM, AM are in percentage values.



    CurrentHealth (Health Left)
    ExtraHealth   (Absorption Health)


    Evaluation:

    PS.Health = Stats.Settings[Base_Health]
    PS.Health += PS.Health_HI
    PS.Health += PS.Health_SB
    PS.Health += PS.Health_AB

    PS.Health *= PS.Health_SM / 100
    PS.Health *= PS.Health_AM / 100

    Source Code:





  3. HP Calculation

    The Current Player HP is calculated by 2 substats:

    1. CurrentHealth (Abbreviated as HP)
    2. ExtraHealth

    CurrentHealth is the current player health, ExtraHealth is the absorption health for the players (a.k.a. golden hearts in vanilla Minecraft).

    When the HP of a player is lower than their Max HP, ExtraHealth will be transferred over to CurrentHealth.


    Evaluation Formula:

    stats:health/extra_health

    if ExtraHealth > 0 and CurrentHealth < PS.Health:
        CurrentHealth += ExtraHealth
        ExtraHealth = CurrentHealth - PS.Health
        if ExtraHealth < 0:
            ExtraHealth = 0
        CurrentHealth -= ExtraHealth





  4. Recovery

    The natural regeneration stat of the player is called Recovery.

    Every 20 ticks (1 second),  players will lose 10 Hunger points and gain X% HP,


    where  \(X = 20 - \frac{400000}{\hbox{PS.Recovery}  +  20000}\)


    If the player is currently in combat, X will be divided by 2.

    For natural regeneration to occur, the player must have at least 4000 Stamina and 100 Hunger.



    The Base Recovery of a player is 2500.
    This variable can be tuned in stats:init/settings

    scoreboard players set Base_Recovery Stats.Settings 2500


    Evaluation Formula:

    stats:health/natural_regeneration

    Quick Note: This formula caps at X = 20, as

    \[\scriptsize X = \lim_{\hbox{PS.Recovery} \to \infty}(20 - \frac{400000}{\hbox{PS.Recovery}  +  20000}) = 20\]

    Therefore, maximum HP the player can regen is 20% per second.





  5. Fall Damage

    Fall Damage deals PERCENTAGE damage to the player.

    When player falls and takes damage, damage is calculated through the following formula:


    \(\hbox{Fall Damage \%} =\frac{\hbox{FallDistance}  -  30}{2} \times \frac{100}{\hbox{PS.Earth} - \hbox{Base\_Earth\_Def} + 100} \times \frac{1}{100}\)


    If the player experiences fatal fall damage, the player will endure the fall with 1 HP, and receive Slowness and Blindness 6 for 5 seconds.


    Evaluation Formula:

    stats:health/fall_damage

Stamina


Last updated:    25-10-2022

  1. Mechanics
  2. Scoreboard Variables
  3. Stamina Calculation
  4. SRecovery / SRegenSpd
  5. Stamina Lost




  1. Mechanics

    Stamina is one of the 4 basic stats of a player.
    It indicates how much Stamina a player has, which is shown by the yellow bar on top of the hotbar.


    The minimum amount of Stamina is 1.

    When the player has too little stamina, they will receive debuffs, such as slowness and weakness.

    CurrentStamina ≤ 3000 => Slowness 0.
    CurrentStamina ≤ 2000 => Slowness 3.
    CurrentStamina ≤ 1000 => Slowness + Weakness 255.


    The player has a Base Stamina of 10000,
    This variable can be tuned in stats:init/settings.

    scoreboard players set Base_Stamina Stats.Settings 10000





  2. Scoreboard Variables

    The scoreboard variables associated with Stamina are the following:

    PS.Stamina    (Total Stamina)
    PS.Stamina_HI (Held Item Bonus)
    PS.Stamina_SB (Skill Bonus)
    PS.Stamina_AB (Arena Bonus)
    PS.Stamina_SM (Skill Multiplier)
    PS.Stamina_AM (Arena Multiplier)

    # Please note that SM, AM are in percentage values.



    CurrentStamina (Stamina Left)
    ExtraStamina   (Absorption Stamina)


    Evaluation:

    PS.Stamina = Stats.Settings[Base_Stamina]
    PS.Stamina += PS.Stamina_HI
    PS.Stamina += PS.Stamina_SB
    PS.Stamina += PS.Stamina_AB

    PS.Stamina *= PS.Stamina_SM / 100
    PS.Stamina *= PS.Stamina_AM / 100

    Source Code:





  3. Stamina Calculation

    The Current Player Stamina is calculated by 2 substats:

    1. CurrentStamina
    2. ExtraStamina

    CurrentStamina is the current player stamina, ExtraStamina is the absorption stamina for the players (similar to ExtraHealth, but for stamina).

    When the HP of a player is lower than their Max HP, ExtraStamina will be transferred over to CurrentStamina.


    Evaluation Formula:

    stats:stamina/extra_stamina

    if ExtraStamina > 0 and CurrentStamina < PS.Stamina:
        CurrentStamina += ExtraStamina
        ExtraStamina = CurrentStamina - PS.Stamina
        if ExtraStamina < 0:
            ExtraStamina = 0
        CurrentStamina -= ExtraStamina





  4. SRecovery / SRegenSpd

    Every 2 ticks (0.1 second), if stamina is not full, hunger will be converted to stamina.


    \( \Delta\hbox{ Stamina} = \frac{\hbox{CurrentHunger}}{\hbox{PS.Hunger}} \times \frac{\hbox{PS.RegenSpd}}{100} \)

    \( \Delta\hbox{ Hunger} = - (\frac{\hbox{CurrentHunger}}{\hbox{PS.Hunger}} \times \frac{10}{PS.SRecovery} + 1) \)


    If the player has less than 2000 CurrentOxygen, the Stamina-Hunger conversion rate will be reduced by half.

    When the player is walking (not sprinting), Stamina-Hunger conversion rate will be reduced by half.

    This means, the Stamina regeneration speed depends on the Hunger percentage of the player.


    Evaluation Formula:

    stats:mana_stamina_hunger/regen_stamina



    The Base SRecovery and SRegenSpd of a player is 100 and 135 respectively.
    This variable can be tuned in stats:init/settings

    scoreboard players set Base_SRecovery Stats.Settings 100
    scoreboard players set Base_SRegenSpd Stats.Settings 135





  5. Stamina Lost

    Most ingame activity would cause lost in Stamina.


    Every tick, if the player is performing the following activities, they will lose a certain amount of stamina.

    • Sprinting: rng(\(\frac{5}{6}\)) \(\times  4\)
    • Walking: 1
    • Being in water: 1
    • Walking in water: 1
    • Swimming: 5
    • Riding Horse: 0.5
    • Jump: 20

    The amount of stamina lost is correlated to the PS.SLoseSpd stat. stats:mana_stamina_hunger/lose_stamina/main

    scoreboard players operation .temp Stats.temp *= @s PS.SLoseSpd
    scoreboard players operation .temp Stats.temp /= 100 Numbers

Hunger


Last updated:    25-10-2022

  1. Mechanics
  2. Scoreboard Variables
  3. Hunger Calculation
  4. Eating




  1. Mechanics

    Hunger is one of the 4 basic stats of a player.
    It indicates how much Hunger a player has, which is shown by the orange bar on top of the hotbar.


    The minimum amount of Hunger is 1.

    Hunger is used for Stamina Regeneration, and Health Regeneration.


    The player has a Base Hunger of 10000,
    This variable can be tuned in stats:init/settings.

    scoreboard players set Base_Hunger Stats.Settings 10000





  2. Scoreboard Variables

    The scoreboard variables associated with Hunger are the following:

    PS.Hunger    (Total Hunger)
    PS.Hunger_HI (Held Item Bonus)
    PS.Hunger_SB (Skill Bonus)
    PS.Hunger_AB (Arena Bonus)
    PS.Hunger_SM (Skill Multiplier)
    PS.Hunger_AM (Arena Multiplier)

    # Please note that SM, AM are in percentage values.



    CurrentHunger (Hunger Left)
    ExtraHunger   (Absorption Hunger)


    Evaluation:

    PS.Hunger = Stats.Settings[Base_Hunger]
    PS.Hunger += PS.Hunger_HI
    PS.Hunger += PS.Hunger_SB
    PS.Hunger += PS.Hunger_AB

    PS.Hunger *= PS.Hunger_SM / 100
    PS.Hunger *= PS.Hunger_AM / 100

    Source Code:





  3. Hunger Calculation

    Hunger is used in these two main ways:

    1. Natural Health Regeneration
    2. Stamina Regeneration


    The Current Player Hunger is calculated by 2 substats:

    1. CurrentHunger
    2. ExtraHunger

    CurrentHunger is the current player hunger, ExtraHunger is the absorption hunger for the players (similar to ExtraHealth, but for hunger).

    When the HP of a player is lower than their Max HP, ExtraHunger will be transferred over to CurrentHunger.


    Evaluation Formula:

    stats:hunger/extra_hunger

    if ExtraHunger > 0 and CurrentHunger < PS.Stamina:
        CurrentHunger += ExtraHunger
        ExtraHunger = CurrentHunger - PS.Stamina
        if ExtraHunger < 0:
            ExtraHunger = 0
        CurrentHunger -= ExtraHunger





  4. Eating

    See Food (Item) for more information on food and eating.





Mana


Last updated:    30-10-2022

  1. Mechanics
  2. Scoreboard Variables
  3. Obtaining Mana
  4. Mana Calculation




  1. Mechanics

    Mana is one of the 4 basic stats of a player.


    There are two types of Mana stats:

    • Base Mana
    • (Max) Mana

    Mana is the direct counterpart of Stamina

    It is shown by the light blue bar on top of the hotbar.


    Mana is used for magic-based abilities, while Stamina is for physical-based abilities.


    It is possible to convert Stamina into Mana, and Mana into Stamina.

    However, keep in mind that if your Current Mana is higher than your Base Mana stat, the excess Mana would convert itself into Stamina again.


    The player has a Default (Max) Mana of 10000, and a Default Base Mana of 0.
    Max Mana is equal to BaseMana * 2 + 5000 + other bonuses.

    This variable can be tuned in stats:init/settings.

    scoreboard players set Base_Mana Stats.Settings 10000
    scoreboard players set Base_BaseMana Stats.Settings 2500





  2. Scoreboard Variables

    The scoreboard variables associated with Mana are the following:

    PS.Mana    (Total Mana)
    PS.Mana_HI (Held Item Bonus)
    PS.Mana_SB (Skill Bonus)
    PS.Mana_AB (Arena Bonus)
    PS.Mana_SM (Skill Multiplier)
    PS.Mana_AM (Arena Multiplier)

    # Please note that SM, AM are in percentage values.



    CurrentMana (Mana Left)
    ExtraMana   (Absorption Mana)



    PS.BaseMana    (Total BaseMana)
    PS.BaseMana_HI (Held Item Bonus)
    PS.BaseMana_SB (Skill Bonus)
    PS.BaseMana_AB (Arena Bonus)
    PS.BaseMana_SM (Skill Multiplier)
    PS.BaseMana_AM (Arena Multiplier)


    Evaluation:

    PS.Mana = Stats.Settings[Base_Mana]
    PS.Mana -= Stats.Settings[Base_BaseMana] * 2
    PS.Mana += PS.Mana_HI
    PS.Mana += PS.Mana_SB
    PS.Mana += PS.Mana_AB

    PS.Mana *= PS.Mana_SM / 100
    PS.Mana *= PS.Mana_AM / 100

    PS.Mana += PS.BaseMana * 2

    PS.BaseMana = Stats.Settings[Base_BaseMana]
    PS.BaseMana += PS.BaseMana_HI
    PS.BaseMana += PS.BaseMana_SB
    PS.BaseMana += PS.BaseMana_AB

    PS.BaseMana *= PS.BaseMana_SM / 100
    PS.BaseMana *= PS.BaseMana_AM / 100
    if PS.BaseMana > PS.Mana:     PS.BaseMana = PS.Mana

    Source Code:





  3. Obtaining Mana

    There are a variety of methods to obtain Mana.

    1. Brute Force

    2. By crouching and looking downwards at the same time, you can convert your Stamina into Mana.

      This method of charging mana isn’t recommended as it is not practical during combat. However, it is still helpful if you need to setup simple spells, such as transportation or trap spells.

      When holding a wand, crouching would automatically activate this process.



    3. Base Mana

    4. Most magic items contain the Base Mana stat.
      This stat enables the user to have a particular amount of mana which is automatically recharged.



    5. Abilities

    6. Some abilities in the game allow the user to regenerate mana with or without the use of stamina. For instance, the <Mana Recovery Array> could help increase your Base Mana and grant extra Mana each second.





  4. Mana Calculation

    1. Brute Force
    2. For Brute force, the function ran each tick is stats:mana_stamina_hunger/charge_mana

      The amount of mana regenerated each tick, is equal to the number of ticks the player has sneaked for.

      \[\footnotesize{\hbox{Total Mana Regenerated for T ticks}} = \sum_{t=1}^{T}t\]

      Stamina and Mana is a one-to-one conversion.



    3. Base Mana
    4. For Brute force, the function ran each tick is stats:mana_stamina_hunger/recharge_mana

      Each tick, 1 Stamina is converted to 7 Mana.



    The Current Player Mana is calculated by 2 substats:

    1. CurrentMana
    2. ExtraMana

    CurrentMana is the current player mana, ExtraMana is the absorption mana for the players (similar to ExtraHealth, but for mana).

    When the HP of a player is lower than their Max HP, ExtraMana will be transferred over to CurrentMana.


    Evaluation Formula:

    stats:mana/extra_mana

    if ExtraMana > 0 and CurrentMana < PS.Stamina:
        CurrentMana += ExtraMana
        ExtraMana = CurrentMana - PS.Stamina
        if ExtraMana < 0:
            ExtraMana = 0
        CurrentMana -= ExtraMana