Fix warnings and code cleanup/fixes (#13570)
This commit is contained in:
@@ -11,8 +11,8 @@ namespace Content.Server.Contests
|
||||
/// A contest is figuring out, based on data in components on two entities,
|
||||
/// which one has an advantage in a situation. The advantage is expressed by a multiplier.
|
||||
/// 1 = No advantage to either party.
|
||||
/// >1 = Advantage to roller
|
||||
/// <1 = Advantage to target
|
||||
/// >1 = Advantage to roller
|
||||
/// <1 = Advantage to target
|
||||
/// Roller should be the entity with an advantage from being bigger/healthier/more skilled, etc.
|
||||
/// </summary>
|
||||
///
|
||||
@@ -39,7 +39,7 @@ namespace Content.Server.Contests
|
||||
/// After that, it runs the % towards crit through a converter that smooths out and makes
|
||||
/// the the ratios less severe.
|
||||
/// Returns the roller's adjusted damage value divided by the target's. Higher is better for the roller.
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public float DamageContest(EntityUid roller, EntityUid target, DamageableComponent? rollerDamage = null, DamageableComponent? targetDamage = null)
|
||||
{
|
||||
if (!Resolve(roller, ref rollerDamage, false) || !Resolve(target, ref targetDamage, false))
|
||||
@@ -85,7 +85,7 @@ namespace Content.Server.Contests
|
||||
/// Finds the % of each entity's stamina damage towards its stam crit threshold.
|
||||
/// It then runs the % towards the converter to smooth/soften it.
|
||||
/// Returns the roller's decimal % divided by the target's. Higher value is better for the roller.
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public float StaminaContest(EntityUid roller, EntityUid target, StaminaComponent? rollerStamina = null, StaminaComponent? targetStamina = null)
|
||||
{
|
||||
if (!Resolve(roller, ref rollerStamina, false) || !Resolve(target, ref targetStamina, false))
|
||||
@@ -101,7 +101,7 @@ namespace Content.Server.Contests
|
||||
/// This will compare the roller and target's damage, mass, and stamina. See the functions for what each one does.
|
||||
/// You can change the 'weighting' to make the tests weigh more or less than the other tests.
|
||||
/// Returns a weighted average of all 3 tests.
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public float OverallStrengthContest(EntityUid roller, EntityUid target, float damageWeight = 1f, float massWeight = 1f, float stamWeight = 1f)
|
||||
{
|
||||
var weightTotal = damageWeight + massWeight + stamWeight;
|
||||
|
||||
Reference in New Issue
Block a user