Example #1
0
 private void Start()
 {
     this.survivor = UnityEngine.Object.Instantiate <SurvivorHuman>(DataLoader.Instance.GetSurvivorPrefab(this.heroType), base.transform).GetComponent <SurvivorHuman>();
     this.survivor.transform.localPosition = new Vector3(0f, 0f, -2.5f);
     this.survivor.body.rotation           = new Quaternion(0f, 0.5f, 0f, 0f);
     this.survivor.enabled         = false;
     this.survivorCollider         = this.survivor.GetComponent <Collider>();
     this.survivorCollider.enabled = false;
 }
Example #2
0
 private void Start()
 {
     this.rigid        = base.GetComponent <Rigidbody>();
     this.cameraTarget = UnityEngine.Object.FindObjectOfType <CameraTarget>();
     this.survivor     = UnityEngine.Object.Instantiate <SurvivorHuman>(DataLoader.Instance.GetSurvivorPrefab(SpawnManager.instance.GetRandomSurvivorType()), this.survivorPlace).GetComponent <SurvivorHuman>();
     this.survivor.transform.localPosition = Vector3.zero;
     this.survivor.animator.SetBool("Rest", false);
     this.survivor.body.rotation        = new Quaternion();
     this.survivor.enabled              = false;
     this.survivorCollider              = this.survivor.GetComponent <Collider>();
     this.survivorCollider.enabled      = false;
     this.survivorRigidbody             = this.survivor.GetComponent <Rigidbody>();
     this.survivorRigidbody.isKinematic = true;
 }
    private SurvivorHuman FindTargetSurvivor()
    {
        SurvivorHuman human = null;

        foreach (SurvivorHuman human2 in GameManager.instance.survivors)
        {
            if (((human2 != this) && (Vector3.Distance(human2.transform.position, base.transform.position) <= this.healDistance)) && ((human == null) || (Vector3.Distance(human2.transform.position, base.transform.position) < Vector3.Distance(human.transform.position, base.transform.position))))
            {
                SurvivorHuman human3 = human2;
                if (human3.ReadyToHeal())
                {
                    base.targetRotation = human2.transform;
                    human = human3;
                }
            }
        }
        return(human);
    }
 private void DoIt()
 {
     if ((this.targetSurvivor == null) || !this.targetSurvivor.ReadyToHeal())
     {
         this.targetSurvivor = this.FindTargetSurvivor();
     }
     if ((this.targetSurvivor != null) && this.targetSurvivor.ReadyToHeal())
     {
         this.targetSurvivor.TakeDamage(-this.healValue);
         SoundManager.Instance.PlayHealSound();
         this.healFx.Play();
     }
     else
     {
         base.RotateForward();
     }
     base.Invoke("DoIt", this.healDelay);
 }
Example #5
0
    private SurvivorHuman FindTargetSurvivor()
    {
        SurvivorHuman human = null;

        foreach (SurvivorHuman human2 in GameManager.instance.survivors)
        {
            if ((((human2 != this) && (human2.heroType != SaveData.HeroData.HeroType.COOK)) && ((human2.heroType != SaveData.HeroData.HeroType.MEDIC) && (Vector3.Distance(human2.transform.position, base.transform.position) <= this.bafDistance))) && ((human == null) || (Vector3.Distance(human2.transform.position, base.transform.position) < Vector3.Distance(human.transform.position, base.transform.position))))
            {
                SurvivorHuman human3 = human2;
                if (!human3.isBaffed)
                {
                    base.targetRotation = human2.transform;
                    human = human3;
                }
            }
        }
        return(human);
    }
Example #6
0
 private void DoIt()
 {
     if ((this.targetSurvivor == null) || this.targetSurvivor.isBaffed)
     {
         this.targetSurvivor = this.FindTargetSurvivor();
     }
     if ((this.targetSurvivor != null) && !this.targetSurvivor.isBaffed)
     {
         this.targetSurvivor.TakeBaf(this.bafValue);
         this.bafferFx.Play();
         SoundManager.Instance.PlayBuffSound();
         base.Invoke("RotateForward", 0.5f);
     }
     else
     {
         base.RotateForward();
     }
     base.Invoke("DoIt", this.bafDelay);
 }