Esempio n. 1
0
    /// <summary>
    /// Calculates the player's total resistance using a base human resistance value,
    /// their health and the items the performer is wearing or holding.
    /// </summary>
    /// <param name="player">The player to calculate shock resistance with</param>
    /// <param name="voltage">The potential difference across the player</param>
    /// <returns>float resistance</returns>
    private float GetPlayerShockResistance(GameObject player, float voltage)
    {
        // Assume the player is a human
        float                 resistance   = GetHumanHandFeetResistance(voltage);
        PlayerScript          playerScript = player.GetComponent <PlayerScript>();
        LivingHealthBehaviour playerLHB    = player.GetComponent <LivingHealthBehaviour>();

        // Give the player extra/less electrical resistance based on what they're holding/wearing
        resistance += GetItemResistance(playerScript.ItemStorage.GetNamedItemSlot(NamedSlot.hands));
        resistance += GetItemResistance(playerScript.ItemStorage.GetNamedItemSlot(NamedSlot.feet));
        if (playerScript.ItemStorage.GetActiveHandSlot().Item != null)
        {
            resistance -= 300;
        }

        // Broken skin reduces electrical resistance - arbitrarily chosen at 4 to 1.
        resistance -= 4 * playerLHB.GetTotalBruteDamage();

        // Make sure the player doesn't get ridiculous conductivity.
        if (resistance < 100)
        {
            resistance = 100;
        }
        return(resistance);
    }
Esempio n. 2
0
 public void UpdateRecord(LivingHealthBehaviour mob, PlayerScript playerScript)
 {
     mobID             = mob.mobID;
     mind              = playerScript.mind;
     name              = playerScript.playerName;
     characterSettings = playerScript.characterSettings;
     oxyDmg            = mob.bloodSystem.oxygenDamage;
     burnDmg           = mob.GetTotalBurnDamage();
     toxinDmg          = 0;
     bruteDmg          = mob.GetTotalBruteDamage();
     uniqueIdentifier  = "35562Eb18150514630991";
 }