Shield durability: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>Leoetlino
(Created page with "Shields lose durability points every time damage is taken and blocked and also during shield surfing. == Attack blocking == The logic is as follows<ref>{{addr|a=0x71002F0844|...")
 
(Marked this version for translation)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Shields lose durability points every time damage is taken and blocked and also during shield surfing.
<languages/>


== Attack blocking ==
<translate>
 
<!--T:1-->
Shields lose durability points every time an attack is blocked and during shield surfing.
 
== Attack blocking == <!--T:2-->
 
<!--T:3-->
The logic is as follows<ref>{{addr|a=0x71002F0844|ver=nx-1.5.0}}</ref>:
The logic is as follows<ref>{{addr|a=0x71002F0844|ver=nx-1.5.0}}</ref>:


<!--T:4-->
<source lang="cpp">
<source lang="cpp">
float damageRatio = GlobalParameter::sInstance->globalParam->shieldDamageRatio.value();
float damageRatio = GlobalParameter::sInstance->globalParam->shieldDamageRatio.value();
Line 11: Line 19:
else
else
   minDamage = param->minDmg;
   minDamage = param->minDmg;
weapon->takeDamage(min(damage, minDamage));
weapon->takeDamage(max(damage, minDamage));
</source>
</source>


<!--T:5-->
* <code>damageRatio</code> is loaded from [[GlobalParameter]] ("ShieldDamageRatio" in the "Global" section).
* <code>damageRatio</code> is loaded from [[GlobalParameter]] ("ShieldDamageRatio" in the "Global" section).
* <code>attackPower</code> is the power of the attack that is being blocked by the shield.
* <code>attackPower</code> is the power of the attack that is being blocked by the shield.
Line 19: Line 28:
* <code>additionalGuardPower</code> is the Shield Guard Up bonus value (if any).
* <code>additionalGuardPower</code> is the Shield Guard Up bonus value (if any).


<!--T:6-->
minDmg appears to be 1 in most cases.
minDmg appears to be 1 in most cases.


<!--T:7-->
In 1.6.0, ShieldDamageRatio is 0.2, meaning a shield takes a minimum of 1 damage point (in most cases), and 1 damage point for every 5 points of difference between the attack power and the guard power. <ref>https://github.com/leoetlino/botw/blob/v1.6.0/Actor/GeneralParamList/GlobalParameter.gparamlist.yml#L28</ref>
In 1.6.0, ShieldDamageRatio is 0.2, meaning a shield takes a minimum of 1 damage point (in most cases), and 1 damage point for every 5 points of difference between the attack power and the guard power. <ref>https://github.com/leoetlino/botw/blob/v1.6.0/Actor/GeneralParamList/GlobalParameter.gparamlist.yml#L28</ref>


== Shield surfing ==
== Shield surfing == <!--T:8-->
The shield surf damage logic is available here: https://gist.github.com/leoetlino/34a2ce6273f7cfcbbabceda24d19aa5d


Here is a gist of the logic:
<!--T:9-->
Here is a gist of the logic<ref>{{addr|a=0x71002CEAF4|ver=nx-1.5.0}}: https://gist.github.com/leoetlino/34a2ce6273f7cfcbbabceda24d19aa5d</ref>:


<!--T:10-->
* Whenever Link is shield surfing, a timer (which is tied to the shield) is incremented.
* Whenever Link is shield surfing, a timer (which is tied to the shield) is incremented.
* If Link is surfing on a "no shield damage floor", '''or''' if the L2 norm of his velocity is lower than 0.03, then the shield takes no damage.
* If Link is surfing on a "no shield damage floor", '''or''' if the L2 norm of his velocity is lower than 0.03, then the shield takes no damage.
* Otherwise, every time the timer reaches ShieldRideBaseFrame (as configured in [[GlobalParameter]]), the shield takes <code>RideBreakRatio * ShieldRideHitBaseDamage * Damage</code> and the timer is reset.
* Otherwise, every time the timer reaches ShieldRideBaseFrame (as configured in [[GlobalParameter]]), the shield takes <code>RideBreakRatio * ShieldRideHitBaseDamage * Damage</code> and the timer is reset.


<!--T:11-->
In 1.6.0:
In 1.6.0:


* RideBreakRatio is 1.0 for the majority of shields, and 0.2 for the Ancient Shield, which means that the latter takes shield surfing damage at a 20% rate compared to most other shields.  
<!--T:12-->
* RideBreakRatio is 1.0 for the majority of shields, and 0.2 for the Ancient Shield, which means that the latter takes shield surfing damage at a 20% rate compared to most other shields.  Refer to this [https://docs.google.com/spreadsheets/u/0/d/1qhh_TLCF_1vMdpPY0QHbhYhN-eUIyh6R3Povo-gziMg/pubhtml spreadsheet] for more information on shield stats, including the hidden RideBreakRatio.


<!--T:13-->
* ShieldRideBaseFrame is 120<ref>https://github.com/leoetlino/botw/blob/v1.6.0/Actor/GeneralParamList/GlobalParameter.gparamlist.yml#L26</ref> and ShieldRideHitBaseDamage is 1<ref>https://github.com/leoetlino/botw/blob/v1.6.0/Actor/GeneralParamList/GlobalParameter.gparamlist.yml#L27</ref>. This means that shield surfing costs <code>RideBreakRatio * 1</code> durability points every 4 seconds.
* ShieldRideBaseFrame is 120<ref>https://github.com/leoetlino/botw/blob/v1.6.0/Actor/GeneralParamList/GlobalParameter.gparamlist.yml#L26</ref> and ShieldRideHitBaseDamage is 1<ref>https://github.com/leoetlino/botw/blob/v1.6.0/Actor/GeneralParamList/GlobalParameter.gparamlist.yml#L27</ref>. This means that shield surfing costs <code>RideBreakRatio * 1</code> durability points every 4 seconds.


[[Category:Game mechanics]]
<!--T:14-->
* This damage is also applied when you start surfing.
 
<!--T:15-->
Since the timer is tied to the shield instance, switching to another shield will reset the timer and doing so lets the player avoid taking any surf damage.
 
</translate>
 
== References ==
 
<references/>
 
[[Category:Game mechanics{{#translation:}}]]

Latest revision as of 03:41, 30 May 2020

Other languages:


Shields lose durability points every time an attack is blocked and during shield surfing.

Attack blocking

The logic is as follows[1]:

float damageRatio = GlobalParameter::sInstance->globalParam->shieldDamageRatio.value();
int damage = damageRatio * (param->attackPower - guardPower - additionalGuardPower);
if (param->forceOnlyOneDamage)
  minDamage = 1;
else
  minDamage = param->minDmg;
weapon->takeDamage(max(damage, minDamage));
  • damageRatio is loaded from GlobalParameter ("ShieldDamageRatio" in the "Global" section).
  • attackPower is the power of the attack that is being blocked by the shield.
  • guardPower is the base Guard Power of the shield. It is loaded from the shield's bgparamlist ("GuardPower" in the "WeaponCommon" section).
  • additionalGuardPower is the Shield Guard Up bonus value (if any).

minDmg appears to be 1 in most cases.

In 1.6.0, ShieldDamageRatio is 0.2, meaning a shield takes a minimum of 1 damage point (in most cases), and 1 damage point for every 5 points of difference between the attack power and the guard power. [2]

Shield surfing

Here is a gist of the logic[3]:

  • Whenever Link is shield surfing, a timer (which is tied to the shield) is incremented.
  • If Link is surfing on a "no shield damage floor", or if the L2 norm of his velocity is lower than 0.03, then the shield takes no damage.
  • Otherwise, every time the timer reaches ShieldRideBaseFrame (as configured in GlobalParameter), the shield takes RideBreakRatio * ShieldRideHitBaseDamage * Damage and the timer is reset.

In 1.6.0:

  • RideBreakRatio is 1.0 for the majority of shields, and 0.2 for the Ancient Shield, which means that the latter takes shield surfing damage at a 20% rate compared to most other shields. Refer to this spreadsheet for more information on shield stats, including the hidden RideBreakRatio.
  • ShieldRideBaseFrame is 120[4] and ShieldRideHitBaseDamage is 1[5]. This means that shield surfing costs RideBreakRatio * 1 durability points every 4 seconds.
  • This damage is also applied when you start surfing.

Since the timer is tied to the shield instance, switching to another shield will reset the timer and doing so lets the player avoid taking any surf damage.


References