private void Awake()
 {
     this.tr    = base.transform;
     this.info  = Scene.SceneTracker;
     this.ai    = base.gameObject.GetComponent <animalAI>();
     this.spawn = base.GetComponent <animalSpawnFunctions>();
 }
示例#2
0
 private void Awake()
 {
     this.avoidScript = base.transform.GetComponentInChildren <animalAvoidance1>();
     this.sceneInfo   = Scene.SceneTracker;
     if (this.parentSetup)
     {
         this.avatar = base.GetComponentInChildren <Animator>();
     }
     else
     {
         this.avatar = base.GetComponent <Animator>();
     }
     this.spawnFunctions  = base.GetComponent <animalSpawnFunctions>();
     this.rootTr          = base.transform;
     this.Tr              = this.avatar.transform;
     this.deadZone       *= 0.0174532924f;
     this.searchFunctions = base.transform.GetComponent <animalSearchFunctions>();
     this.seeker          = base.GetComponent <Seeker>();
     this.layerMask2      = 33556480;
     PlayMakerFSM[] components = base.gameObject.GetComponents <PlayMakerFSM>();
     PlayMakerFSM[] array      = components;
     for (int i = 0; i < array.Length; i++)
     {
         PlayMakerFSM playMakerFSM = array[i];
         if (playMakerFSM.FsmName == "aiBaseFSM")
         {
             this.playMaker = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "moveFSM")
         {
             this.pmMove = playMakerFSM;
         }
     }
 }
示例#3
0
    public Transform metgoragdoll(Vector3 varpvelocity = default(Vector3))
    {
        Transform transform = UnityEngine.Object.Instantiate(this.vargamragdoll, base.transform.position, base.transform.rotation) as Transform;

        transform.localScale = base.transform.localScale;
        this.metcopytransforms(base.transform, transform, varpvelocity * 1f);
        if (this.doCreepySkin)
        {
            transform.gameObject.SendMessage("setSkin", this.health.MySkin.sharedMaterial, SendMessageOptions.DontRequireReceiver);
            this.health.MySkin.GetPropertyBlock(this.bloodPropertyBlock);
            transform.gameObject.SendMessage("setSkinDamageProperty", this.bloodPropertyBlock, SendMessageOptions.DontRequireReceiver);
            if (BoltNetwork.isServer)
            {
                IMutantState         state = base.transform.parent.GetComponent <BoltEntity>().GetState <IMutantState>();
                CoopMutantDummyToken coopMutantDummyToken = new CoopMutantDummyToken();
                coopMutantDummyToken.Scale       = base.transform.localScale;
                coopMutantDummyToken.skinDamage1 = this.bloodPropertyBlock.GetFloat("_Damage1");
                coopMutantDummyToken.skinDamage2 = this.bloodPropertyBlock.GetFloat("_Damage2");
                coopMutantDummyToken.skinDamage3 = this.bloodPropertyBlock.GetFloat("_Damage3");
                coopMutantDummyToken.skinDamage4 = this.bloodPropertyBlock.GetFloat("_Damage4");
                mutantTypeSetup component = base.transform.parent.GetComponent <mutantTypeSetup>();
                if (component)
                {
                    coopMutantDummyToken.storedRagDollName = component.storedRagDollName;
                }
                BoltNetwork.Attach(transform.gameObject, coopMutantDummyToken);
            }
        }
        if (this.animal)
        {
            animalSpawnFunctions component2 = base.transform.root.GetComponent <animalSpawnFunctions>();
            if (component2)
            {
                transform.gameObject.SendMessage("setSkin", component2.meshRenderer.sharedMaterial, SendMessageOptions.DontRequireReceiver);
            }
        }
        if (this.bird)
        {
            lb_Bird component3 = base.transform.GetComponent <lb_Bird>();
            transform.gameObject.SendMessage("setSkin", component3.skin.sharedMaterial, SendMessageOptions.DontRequireReceiver);
        }
        if (this.fish)
        {
            transform.gameObject.SendMessage("doSkinSetup", this.fishScript.fishTypeInt, SendMessageOptions.DontRequireReceiver);
        }
        if (this.burning)
        {
            transform.gameObject.SendMessage("enableFire", SendMessageOptions.DontRequireReceiver);
        }
        if (this.alreadyBurnt)
        {
            transform.gameObject.SendMessage("enableBurntSkin", SendMessageOptions.DontRequireReceiver);
        }
        this.burning      = false;
        this.alreadyBurnt = false;
        return(transform);
    }
示例#4
0
 private void Awake()
 {
     this.ai             = base.GetComponent <animalAI>();
     this.spawnFunctions = base.GetComponent <animalSpawnFunctions>();
     this.scene          = Scene.SceneTracker;
     this.MP             = base.gameObject.GetComponent <mutantPropManager>();
     this.animator       = base.GetComponentInChildren <Animator>();
     this.startHealth    = this.Health;
 }
示例#5
0
    public Transform metgoragdoll(Vector3 varpvelocity = default(Vector3))
    {
        Transform transform = UnityEngine.Object.Instantiate <Transform>(this.vargamragdoll, base.transform.position, base.transform.rotation);

        if (!this.ignoreScale)
        {
            transform.localScale = base.transform.localScale;
        }
        this.metcopytransforms(base.transform, transform, varpvelocity * 1f);
        if (this.doCreepySkin && this.enemyHealth)
        {
            transform.gameObject.SendMessage("setSkin", this.enemyHealth.MySkin.sharedMaterial, SendMessageOptions.DontRequireReceiver);
            this.enemyHealth.MySkin.GetPropertyBlock(this.bloodPropertyBlock);
            transform.gameObject.SendMessage("setSkinDamageProperty", this.bloodPropertyBlock, SendMessageOptions.DontRequireReceiver);
            if (this.enemyHealth.Fire.Length > 0)
            {
                mutantTransferFire component = base.transform.parent.GetComponent <mutantTransferFire>();
                foreach (GameObject gameObject in this.enemyHealth.Fire)
                {
                    if (gameObject.activeSelf && component)
                    {
                        component.transferFireToTarget(gameObject, transform.gameObject);
                    }
                }
            }
            if (BoltNetwork.isServer)
            {
                BoltEntity component2 = base.transform.parent.GetComponent <BoltEntity>();
                if (component2)
                {
                    IMutantState         state = component2.GetState <IMutantState>();
                    CoopMutantDummyToken coopMutantDummyToken = new CoopMutantDummyToken();
                    coopMutantDummyToken.Scale       = base.transform.localScale;
                    coopMutantDummyToken.skinDamage1 = this.bloodPropertyBlock.GetFloat("_Damage1");
                    coopMutantDummyToken.skinDamage2 = this.bloodPropertyBlock.GetFloat("_Damage2");
                    coopMutantDummyToken.skinDamage3 = this.bloodPropertyBlock.GetFloat("_Damage3");
                    coopMutantDummyToken.skinDamage4 = this.bloodPropertyBlock.GetFloat("_Damage4");
                    coopMutantDummyToken.skinColor   = this.enemyHealth.MySkin.sharedMaterial.GetColor("_Color");
                    mutantTypeSetup component3 = base.transform.parent.GetComponent <mutantTypeSetup>();
                    if (component3)
                    {
                    }
                    BoltNetwork.Attach(transform.gameObject, coopMutantDummyToken);
                }
            }
        }
        if (this.animalHealth && this.animalHealth.mySkin)
        {
            this.animalHealth.mySkin.GetPropertyBlock(this.bloodPropertyBlock);
            float @float = this.bloodPropertyBlock.GetFloat("_Damage1");
            transform.gameObject.SendMessage("setSkinDamageProperty", this.bloodPropertyBlock, SendMessageOptions.DontRequireReceiver);
        }
        if (this.animalHealth && this.animalHealth.Fire)
        {
            mutantTransferFire component4;
            if (base.transform.parent)
            {
                component4 = base.transform.parent.GetComponent <mutantTransferFire>();
            }
            else
            {
                component4 = base.transform.GetComponent <mutantTransferFire>();
            }
            if (this.animalHealth.Fire.activeSelf && component4)
            {
                component4.transferFireToTarget(this.animalHealth.Fire, transform.gameObject);
            }
        }
        if (this.bat && this.burning)
        {
            transform.gameObject.SendMessage("enableFire", SendMessageOptions.DontRequireReceiver);
        }
        if (this.animal)
        {
            animalSpawnFunctions component5 = base.transform.root.GetComponent <animalSpawnFunctions>();
            if (component5)
            {
                transform.gameObject.SendMessage("setSkin", component5.meshRenderer.sharedMaterial, SendMessageOptions.DontRequireReceiver);
            }
            if (this.ca && this.ca.isSnow)
            {
                transform.gameObject.SendMessage("setupSnowRabbitTypeTrigger", SendMessageOptions.DontRequireReceiver);
            }
        }
        if (this.bird)
        {
            if (this.burning)
            {
                transform.gameObject.SendMessage("enableFire", SendMessageOptions.DontRequireReceiver);
            }
            lb_Bird component6 = base.transform.GetComponent <lb_Bird>();
            transform.gameObject.SendMessage("setSkin", component6.skin.sharedMaterial, SendMessageOptions.DontRequireReceiver);
        }
        if (this.fish)
        {
            transform.gameObject.SendMessage("doSkinSetup", this.fishScript.fishTypeInt, SendMessageOptions.DontRequireReceiver);
            transform.gameObject.SendMessage("setupFishType", this.fishScript.fishNatureGuideValue, SendMessageOptions.DontRequireReceiver);
        }
        if (this.alreadyBurnt)
        {
            transform.gameObject.SendMessage("enableBurntSkin", SendMessageOptions.DontRequireReceiver);
        }
        if (this.ast)
        {
            arrowStickToTarget component7 = transform.GetComponent <arrowStickToTarget>();
            if (component7)
            {
                int num = 0;
                foreach (KeyValuePair <Transform, int> keyValuePair in this.ast.stuckArrows)
                {
                    if (keyValuePair.Key)
                    {
                        component7.CreatureType(this.ast.IsAnimal, this.ast.IsBird, this.ast.IsFish);
                        int arrowType = 0;
                        if (num < this.ast.stuckArrowsTypeList.Count)
                        {
                            arrowType = this.ast.stuckArrowsTypeList[num];
                        }
                        component7.applyStuckArrowToDummy(keyValuePair.Key, keyValuePair.Key.localPosition, keyValuePair.Key.localRotation, keyValuePair.Value, arrowType);
                        num++;
                    }
                }
            }
        }
        this.burning      = false;
        this.alreadyBurnt = false;
        return(transform);
    }