예제 #1
0
    // Use this for initialization
    void Start()
    {
        lifepointsscript = lifepointObj.GetComponent <LifePoints> ();

        audioManager = AudioManager.instance;
        if (audioManager == null)
        {
            Debug.LogError("Attention, le AudioManager n'a pas été trouvé dans la scène.");
        }
    }
예제 #2
0
 public void AddBytes(List <byte> bytes)
 {
     Immortal.AddByte(bytes);
     FreezeAnimates.AddByte(bytes);
     AutoPlaceItems.AddByte(bytes);
     AutoOpenConnections.AddByte(bytes);
     EnableConfigList.AddByte(bytes);
     LifePoints.AddBytes(bytes);
     LampPoints.AddIntBytes(bytes);
     MaxInventory.AddIntBytes(bytes);
 }
예제 #3
0
 void Start()
 {
     pos          = Camera.main.ViewportToWorldPoint(new Vector3(0f, 0f, 60f));
     lifePoints   = GetComponent <LifePoints>();
     myRigidbody  = GetComponent <Rigidbody>();
     cameraShaker = FindObjectOfType <CameraShaker>();
     if (!tutorial)
     {
         GetNewTargetPos();
         CheckRotation();
     }
 }
예제 #4
0
 void Start()
 {
     pos            = Camera.main.ViewportToWorldPoint(new Vector3(0f, 0f, 60f));
     lifePoints     = GetComponent <LifePoints>();
     circleCollider = GetComponent <CircleCollider2D>();
     myRigidbody    = GetComponent <Rigidbody2D>();
     cameraShaker   = FindObjectOfType <CameraShaker>();
     particle       = Instantiate(particle, transform.position, Quaternion.identity, transform);
     if (!tutorial)
     {
         GetNewTargetPos();
     }
 }
예제 #5
0
 public void Heal(float heal)
 {
     if (!MaxLife())
     {
         LifePoints lf = LifePoints.First(x => x.LifePoint + heal <= 1f);
         if (lf != null)
         {
             lf.LifePoint += heal;
             return;
         }
         lf = LifePoints.First(x => x.LifePoint != 1f);
         if (lf != null)
         {
             lf.LifePoint = 1f;
             return;
         }
     }
 }
예제 #6
0
 void OnLifePointsChanged()
 {
     GameUI.currentUI.LifePointsText.text = LifePoints.ToString();
 }
예제 #7
0
파일: NPC.cs 프로젝트: cvogt/AlbLib
        public override int GetHashCode()
        {
            int hashCode = 0;

            unchecked {
                if (unknown != null)
                {
                    hashCode += 1000000007 * unknown.GetHashCode();
                }
                hashCode += 1000000009 * Type.GetHashCode();
                hashCode += 1000000021 * Gender.GetHashCode();
                hashCode += 1000000033 * Race.GetHashCode();
                hashCode += 1000000087 * Class.GetHashCode();
                hashCode += 1000000093 * Magic.GetHashCode();
                hashCode += 1000000097 * Level.GetHashCode();
                hashCode += 1000000103 * Language.GetHashCode();
                hashCode += 1000000123 * Appearance.GetHashCode();
                hashCode += 1000000181 * Face.GetHashCode();
                hashCode += 1000000207 * InventoryPicture.GetHashCode();
                hashCode += 1000000223 * ActionPoints.GetHashCode();
                hashCode += 1000000241 * DialogueOptions.GetHashCode();
                hashCode += 1000000271 * ResponseOptions.GetHashCode();
                hashCode += 1000000289 * TrainingPoints.GetHashCode();
                hashCode += 1000000297 * Gold.GetHashCode();
                hashCode += 1000000321 * Rations.GetHashCode();
                hashCode += 1000000349 * Conditions.GetHashCode();
                hashCode += 1000000363 * Strength.GetHashCode();
                hashCode += 1000000403 * Intelligence.GetHashCode();
                hashCode += 1000000409 * Dexterity.GetHashCode();
                hashCode += 1000000411 * Speed.GetHashCode();
                hashCode += 1000000427 * Stamina.GetHashCode();
                hashCode += 1000000433 * Luck.GetHashCode();
                hashCode += 1000000439 * MagicResistance.GetHashCode();
                hashCode += 1000000447 * MagicTallent.GetHashCode();
                hashCode += 1000000453 * CloseRangeCombat.GetHashCode();
                hashCode += 1000000459 * LongRangeCombat.GetHashCode();
                hashCode += 1000000483 * CriticalHit.GetHashCode();
                hashCode += 1000000513 * Lockpicking.GetHashCode();
                hashCode += 1000000531 * LifePoints.GetHashCode();
                hashCode += 1000000579 * SpellPoints.GetHashCode();
                hashCode += 1000000007 * Age.GetHashCode();
                hashCode += 1000000009 * BaseProtection.GetHashCode();
                hashCode += 1000000021 * Protection.GetHashCode();
                hashCode += 1000000033 * BaseDamage.GetHashCode();
                hashCode += 1000000087 * Damage.GetHashCode();
                hashCode += 1000000093 * Experience.GetHashCode();
                if (Spells != null)
                {
                    hashCode += 1000000097 * Spells.GetHashCode();
                }
                if (Name != null)
                {
                    hashCode += 1000000103 * Name.GetHashCode();
                }
                if (SpellStrengths != null)
                {
                    hashCode += 1000000123 * SpellStrengths.GetHashCode();
                }
            }
            return(hashCode);
        }
예제 #8
0
 private void Awake()
 {
     _life = FindObjectOfType <LifePoints>();
 }