Пример #1
0
 private void Start()
 {
     this.ragDollSetup   = base.transform.GetComponent <clsragdollify>();
     this.ai             = base.GetComponent <mutantAI>();
     this.weaponCollider = base.GetComponentInChildren <enemyWeaponMelee>().gameObject.GetComponent <CapsuleCollider>();
     this.pushBody       = base.transform.parent.GetComponent <pushRigidBody>();
 }
Пример #2
0
 // is called by several threads to reset/update their aggression
 public static int GetAggression(mutantAI myAI, int myAggression)
 {
     // aggression store
     if (aggressionStore.ContainsKey(AiName(myAI)))
     {
         rwLock.EnterReadLock();
         int storeAggression = (int)aggressionStore[AiName(myAI)];
         rwLock.ExitReadLock();
         if (debugAggression)
         {
             ModAPI.Log.Write(AiName(myAI) + " loaded this aggression: " + storeAggression);
         }
         return(storeAggression);
     }
     else
     {
         rwLock.EnterWriteLock();
         aggressionStore[AiName(myAI)] = startAggression;
         rwLock.ExitWriteLock();
         if (debugAggression)
         {
             ModAPI.Log.Write(AiName(myAI) + " saved this new aggression: " + startAggression);
         }
         return(startAggression);
     }
 }
Пример #3
0
 // distinguish between ai and return as string
 private static string AiName(mutantAI myMutantAi)
 {
     if (myMutantAi.femaleSkinny || myMutantAi.maleSkinny)
     {
         return("skinny");
     }
     else if (myMutantAi.skinned)
     {
         return("skinned");
     }
     else if (myMutantAi.painted)
     {
         return("painted");
     }
     else if (myMutantAi.pale)
     {
         return("pale");
     }
     else if (myMutantAi.creepy || myMutantAi.creepy_baby || myMutantAi.creepy_boss || myMutantAi.creepy_fat || myMutantAi.creepy_male)
     {
         return("creepy");
     }
     else
     {
         return("regular");
     }
 }
Пример #4
0
 private void doStart()
 {
     this.feetAudio     = base.transform.FindChild("feetAudioGo").gameObject;
     this.waterDetect   = base.transform.parent.GetComponent <mutantWaterDetect>();
     this.animator      = base.gameObject.GetComponent <Animator>();
     this.setup         = base.GetComponent <mutantScriptSetup>();
     this.ai            = base.GetComponent <mutantAI>();
     this.ai_net        = base.GetComponent <mutantAI_net>();
     this.followers     = base.transform.root.GetComponent <mutantFollowerFunctions>();
     this.oneshotEvents = new List <FMODCommon.OneshotEventInfo>();
     this.loopingEvents = new List <FMODCommon.LoopingEventInfo>();
     base.InvokeRepeating("cleanupOneshotEvents", 1f, 1f);
     this.idleTimeoutEnd = 0f;
     this.idleStateHash  = Animator.StringToHash("Base Layer.idle01");
     this.inIdleState    = false;
     if (this.Remote)
     {
         return;
     }
     if (!this.eventPosition)
     {
         this.eventPosition = base.gameObject;
     }
     if (this.parryChecker)
     {
         this.parryChecker.SetActive(false);
     }
     this.actor = UnityEngine.Random.Range(0, 2);
     this.mainWeaponCollider = this.setup.mainWeapon.GetComponent <BoxCollider>();
     this.defaultWeaponRange = this.mainWeaponCollider.size.z;
     this.defaultWeaponPos   = this.mainWeaponCollider.center.z;
 }
Пример #5
0
 private void doAwake()
 {
     this.enemyHitMask = 36841472;
     this.rootTr       = base.transform.root;
     if (!this.netPrefab)
     {
         this.setup = base.transform.root.GetComponentInChildren <mutantScriptSetup>();
         this.ai    = base.transform.root.GetComponentInChildren <mutantAI>();
     }
     if (this.netPrefab)
     {
         this.ai_net = base.transform.root.GetComponentInChildren <mutantAI_net>();
     }
     this.animator  = base.transform.root.GetComponentInChildren <Animator>();
     this.events    = base.transform.root.GetComponentInChildren <enemyAnimEvents>();
     this.blockHash = Animator.StringToHash("block");
     FMODCommon.PreloadEvents(new string[]
     {
         this.weaponHitEvent,
         this.parryEvent,
         this.blockEvent,
         this.shellBlockEvent
     });
     this.hasPreloaded = true;
 }
Пример #6
0
 private void Awake()
 {
     this.bloodPropertyBlock = new MaterialPropertyBlock();
     this.skinRenderer       = this.MyBody.GetComponent <SkinnedMeshRenderer>();
     this.ai    = base.GetComponent <mutantAI>();
     this.setup = base.GetComponent <mutantScriptSetup>();
     if (this.MyBodyParts.Length > 0)
     {
         this.bodyParentGo = this.MyBodyParts[0].transform.parent.gameObject;
     }
     if (this.MySkinnyParts.Length > 0)
     {
         this.skinnyParentGo = this.MySkinnyParts[0].transform.parent.gameObject;
     }
     if (!this.female)
     {
         this.MaterialLookup.Add(this.FireManMat.name, this.FireManMat);
         this.MaterialLookup.Add(this.DynamiteMat.name, this.DynamiteMat);
         this.MaterialLookup.Add(this.paleMat.name, this.paleMat);
         this.MaterialLookup.Add(this.cannibalMat.name, this.cannibalMat);
         this.MaterialLookup.Add(this.skinnyMat.name, this.skinnyMat);
         Material[] array = this.material;
         for (int i = 0; i < array.Length; i++)
         {
             Material material = array[i];
             if (!this.MaterialLookup.ContainsKey(material.name))
             {
                 this.MaterialLookup.Add(material.name, material);
             }
         }
     }
 }
Пример #7
0
 private void doStart()
 {
     this.setup      = base.GetComponent <mutantScriptSetup>();
     this.animator   = base.GetComponent <Animator>();
     this.controller = base.transform.parent.GetComponent <CharacterController>();
     this.thisTr     = base.transform;
     this.rootTr     = base.transform.parent;
     this.ai         = base.GetComponent <mutantAI>();
     this.walkHash   = Animator.StringToHash("walk");
     this.idleHash   = Animator.StringToHash("idle");
     this.attackHash = Animator.StringToHash("attack");
     this.chargeHash = Animator.StringToHash("charge");
     if (!this.setup.ai.creepy_fat)
     {
         this.fsmMoving = this.setup.pmMotor.FsmVariables.GetFsmBool("movingBool");
     }
     this.fsmInCaveBool = this.setup.pmCombat.FsmVariables.GetFsmBool("inCaveBool");
     if (this.setup.pmCombat)
     {
         this.fsmAttackingStructure = this.setup.pmCombat.FsmVariables.GetFsmBool("attackStructure");
     }
     this.checkWallDelay = Time.time + 5f;
     this.layer          = 26;
     this.layerMask      = 1 << this.layer;
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashIdle").Value   = Animator.StringToHash("idle");
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashWalk").Value   = Animator.StringToHash("walk");
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashAttack").Value = Animator.StringToHash("attack");
     this.enableAnim = true;
 }
Пример #8
0
 private void doAwake()
 {
     this.enemyHitMask = 36841472;
     this.rootTr = base.transform.root;
     if (!this.netPrefab)
     {
         this.setup = base.transform.root.GetComponentInChildren<mutantScriptSetup>();
         this.ai = base.transform.root.GetComponentInChildren<mutantAI>();
     }
     if (this.netPrefab)
     {
         this.ai_net = base.transform.root.GetComponentInChildren<mutantAI_net>();
     }
     this.animator = base.transform.root.GetComponentInChildren<Animator>();
     this.events = base.transform.root.GetComponentInChildren<enemyAnimEvents>();
     this.blockHash = Animator.StringToHash("block");
     FMODCommon.PreloadEvents(new string[]
     {
         this.weaponHitEvent,
         this.parryEvent,
         this.blockEvent,
         this.shellBlockEvent
     });
     this.hasPreloaded = true;
 }
 private void Awake()
 {
     this.sceneInfo       = Scene.SceneTracker;
     this.setup           = base.GetComponent <mutantScriptSetup>();
     this.ai              = base.GetComponent <mutantAI>();
     this.searchFunctions = base.GetComponent <mutantSearchFunctions>();
     this.tr              = base.transform;
 }
Пример #10
0
 private void Awake()
 {
     this.setup      = base.GetComponent <mutantScriptSetup>();
     this.events     = base.GetComponent <creepyAnimEvents>();
     this.animator   = base.GetComponent <Animator>();
     this.controller = base.transform.parent.GetComponent <CharacterController>();
     this.thisTr     = base.transform;
     this.rootTr     = base.transform.parent;
     this.ai         = base.GetComponent <mutantAI>();
 }
Пример #11
0
 public void TriggerSync(mutantAI ai)
 {
     if (BoltNetwork.isRunning && this.entity.IsOwner())
     {
         int num = 0;
         if (this.creepy = ai.creepy)
         {
             num |= 32;
         }
         if (this.creepy_baby = ai.creepy_baby)
         {
             num |= 128;
         }
         if (this.creepy_male = ai.creepy_male)
         {
             num |= 64;
         }
         if (this.creepy_fat = ai.creepy_fat)
         {
             num |= 1024;
         }
         if (this.female = ai.female)
         {
             num |= 16;
         }
         if (this.femaleSkinny = ai.femaleSkinny)
         {
             num |= 4;
         }
         if (this.fireman = ai.fireman)
         {
             num |= 256;
         }
         if (this.leader = ai.leader)
         {
             num |= 1;
         }
         if (this.male = ai.male)
         {
             num |= 8;
         }
         if (this.maleSkinny = ai.maleSkinny)
         {
             num |= 2;
         }
         if (this.pale = ai.pale)
         {
             num |= 512;
         }
         if (base.state.ai_mask != num)
         {
             base.state.ai_mask = num;
         }
     }
 }
Пример #12
0
 private void Start()
 {
     this.setup      = base.GetComponentInChildren <mutantScriptSetup>();
     this.spawnSetup = base.transform.root.GetComponent <mutantTypeSetup>();
     this.ai         = base.GetComponentInChildren <mutantAI>();
     this.search     = base.GetComponentInChildren <mutantSearchFunctions>();
     this.animator   = base.GetComponentInChildren <Animator>();
     if (this.dragPoint)
     {
         this.dragPointInit = this.dragPoint.transform.localPosition;
     }
     this.mutantControl = Scene.MutantControler;
     this.health        = base.GetComponentInChildren <EnemyHealth>();
     this.fsmDeathBool  = this.setup.pmCombat.FsmVariables.GetFsmBool("deathBool");
 }
Пример #13
0
 private void doStart()
 {
     this.setup         = base.GetComponent <mutantScriptSetup>();
     this.animator      = base.GetComponent <Animator>();
     this.controller    = base.transform.parent.GetComponent <CharacterController>();
     this.thisTr        = base.transform;
     this.rootTr        = base.transform.parent;
     this.ai            = base.GetComponent <mutantAI>();
     this.fsmInCaveBool = this.setup.pmCombat.FsmVariables.GetFsmBool("inCaveBool");
     this.layer         = 26;
     this.layerMask     = 1 << this.layer;
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashIdle").Value   = Animator.StringToHash("idle");
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashWalk").Value   = Animator.StringToHash("walk");
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashAttack").Value = Animator.StringToHash("attack");
     base.Invoke("callChangeIdle", (float)UnityEngine.Random.Range(0, 2));
 }
Пример #14
0
 private void Awake()
 {
     this.ragDollSetup    = base.GetComponent <clsragdollify>();
     this.setup           = base.GetComponent <mutantScriptSetup>();
     this.typeSetup       = base.transform.parent.GetComponent <mutantTypeSetup>();
     this.ai              = base.GetComponent <mutantAI>();
     this.familyFunctions = base.transform.parent.GetComponent <mutantFamilyFunctions>();
     this.targetSwitcher  = base.GetComponentInChildren <mutantTargetSwitching>();
     if (!this.ai.creepy)
     {
         this.animator = base.GetComponent <Animator>();
     }
     else
     {
         this.animator = base.GetComponentInChildren <Animator>();
     }
     this.MP = base.gameObject.GetComponent <mutantPropManager>();
     this.bloodPropertyBlock = new MaterialPropertyBlock();
 }
Пример #15
0
 private void Start()
 {
     this.animator         = base.GetComponent <Animator>();
     this.controller       = base.transform.parent.GetComponent <CharacterController>();
     this.events           = base.GetComponent <enemyAnimEvents>();
     this.thisTr           = base.transform;
     this.rootTr           = base.transform.parent;
     this.ai               = base.gameObject.GetComponent <mutantAI>();
     this.setup            = base.GetComponent <mutantScriptSetup>();
     this.hashId           = base.GetComponent <mutantMaleHashId>();
     this.target           = LocalPlayer.Transform;
     this.jumpingHash      = Animator.StringToHash("jumping");
     this.jumpFallHash     = Animator.StringToHash("jumpFall");
     this.inTrapHash       = Animator.StringToHash("inTrap");
     this.runTrapHash      = Animator.StringToHash("runTrap");
     this.controllerRadius = this.controller.radius;
     if (this.setup.pmBrain)
     {
         this.fsmPlayerDist       = this.setup.pmBrain.FsmVariables.GetFsmFloat("playerDist");
         this.fsmDoControllerBool = this.setup.pmBrain.FsmVariables.GetFsmBool("enableControllerBool");
         this.fsmEnableGravity    = this.setup.pmBrain.FsmVariables.GetFsmBool("enableGravityBool");
         this.fsmTargetSeen       = this.setup.pmBrain.FsmVariables.GetFsmBool("targetSeenBool");
     }
     if (this.setup.pmSleep)
     {
         this.fsmInCaveBool = this.setup.pmSleep.FsmVariables.GetFsmBool("inCaveBool");
         this.fsmNoMoveBool = this.setup.pmSleep.FsmVariables.GetFsmBool("noMoveBool");
     }
     if (this.setup.pmCombat)
     {
         this.fsmDeathBool = this.setup.pmCombat.FsmVariables.GetFsmBool("deathBool");
     }
     this.layerMask = 101851136;
     base.Invoke("initAnimator", 0.5f);
     if (BoltNetwork.isRunning)
     {
         this.setup.pmCombat.FsmVariables.GetFsmBool("boltIsActive").Value = true;
     }
     else
     {
         this.setup.pmCombat.FsmVariables.GetFsmBool("boltIsActive").Value = false;
     }
 }
Пример #16
0
 private void Awake()
 {
     this.animator    = base.transform.GetComponentInChildren <Animator>();
     this.getParams   = base.GetComponent <getAnimatorParams>();
     this.setup       = base.transform.GetComponentInChildren <mutantScriptSetup>();
     this.ai          = base.transform.GetComponentInChildren <mutantAI>();
     this.props       = base.transform.GetComponentInChildren <mutantPropManager>();
     this.propsFemale = base.transform.GetComponentInChildren <setupBodyVariation>();
     this.health      = base.transform.GetComponentInChildren <EnemyHealth>();
     this.followSetup = base.transform.GetComponent <mutantFollowerFunctions>();
     this.dayCycle    = base.transform.GetComponentInChildren <mutantDayCycle>();
     this.controlGo   = Scene.MutantControler.gameObject;
     if (this.controlGo)
     {
         this.mutantControl = Scene.MutantControler;
     }
     this.spawnManager = this.controlGo.GetComponent <mutantSpawnManager>();
     this.stats        = base.transform.GetComponent <targetStats>();
     this.waterLayer   = LayerMask.NameToLayer("Water");
 }
Пример #17
0
 public static void IncreaseAggression(mutantAI myAI)
 {
     if (aggressionStore.ContainsKey(AiName(myAI)))
     {
         rwLock.EnterReadLock();
         int storeAggression = (int)aggressionStore[AiName(myAI)];
         rwLock.ExitReadLock();
         if (storeAggression < maximumAggression)
         {
             storeAggression += aggressionIncrease;
             if (storeAggression > maximumAggression)
             {
                 storeAggression = maximumAggression;
             }
             rwLock.EnterWriteLock();
             aggressionStore[AiName(myAI)] = storeAggression;
             rwLock.ExitWriteLock();
             if (debugAggressionIncrease)
             {
                 ModAPI.Log.Write(AiName(myAI) + " saved this higher aggression: " + storeAggression);
             }
         }
     }
 }
Пример #18
0
 private void Respawn()
 {
     UnityEngine.Debug.Log("LocalPlayer -> Respawn");
     if (LocalPlayer.Stats.Dead)
     {
         LocalPlayer.GameObject.SendMessage("NotInACave");
         PlayerInventory inventory = LocalPlayer.Inventory;
         string          name      = LocalPlayer.Entity.GetState <IPlayerState>().name;
         LocalPlayer.Inventory.HideAllEquiped(false);
         LocalPlayer.Inventory.enabled = false;
         if (Scene.SceneTracker.allPlayers.Contains(LocalPlayer.GameObject))
         {
             Scene.SceneTracker.allPlayers.Remove(LocalPlayer.GameObject);
         }
         if (Scene.SceneTracker.allPlayerEntities.Contains(LocalPlayer.Entity))
         {
             Scene.SceneTracker.allPlayerEntities.Remove(LocalPlayer.Entity);
         }
         BoltNetwork.Detach(LocalPlayer.Entity);
         GameObject gameObject = LocalPlayer.GameObject;
         BoltEntity entity     = LocalPlayer.Entity;
         gameObject.name = "player Corpse - " + name;
         gameObject.tag  = "Untagged";
         LocalPlayer.MainCamTr.parent      = LocalPlayer.Transform;
         LocalPlayer.Inventory.CurrentView = PlayerInventory.PlayerViews.Loot;
         for (int i = gameObject.transform.childCount - 1; i >= 0; i--)
         {
             Transform child = gameObject.transform.GetChild(i);
             UnityEngine.Object.Destroy(child.gameObject);
         }
         Component[] components = gameObject.GetComponents(typeof(MonoBehaviour));
         Component[] array      = components;
         for (int j = 0; j < array.Length; j++)
         {
             Component component = array[j];
             if (!(component is BoltEntity))
             {
                 UnityEngine.Object.DestroyImmediate(component);
             }
         }
         Transform  transform   = base.transform;
         GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate(Prefabs.Instance.PlayerPrefab, transform.position, transform.rotation);
         gameObject2.transform.localEulerAngles = new Vector3(0f, gameObject2.transform.localEulerAngles.y, 0f);
         gameObject2.name = Prefabs.Instance.PlayerPrefab.name;
         LocalPlayer.FpCharacter.UnLockView();
         LocalPlayer.CamFollowHead.enableMouseControl(false);
         LocalPlayer.MainCamTr.localEulerAngles = Vector3.zero;
         LocalPlayer.MainRotator.enabled        = true;
         LocalPlayer.CamRotator.enabled         = true;
         LocalPlayer.Stats.Health   = 28f;
         LocalPlayer.Stats.Energy   = 100f;
         LocalPlayer.Stats.Fullness = 0.35f;
         LocalPlayer.Stats.Thirst   = 0.35f;
         LocalPlayer.Stats.Invoke("CheckArmsStart", 2f);
         LocalPlayer.Stats.Invoke("PlayWakeMusic", 0.5f);
         Scene.RainFollowGO.GetComponent <SmoothTransformConstraint>().target = LocalPlayer.Transform;
         gameObject2.SetActive(true);
         CoopUtils.AttachLocalPlayer(gameObject2, name);
         Scene.SceneTracker.allPlayers.Add(LocalPlayer.GameObject);
         LocalPlayer.GreebleRoot.SetActive(true);
         StealItemTrigger stealItemTrigger = (StealItemTrigger)UnityEngine.Object.Instantiate(Prefabs.Instance.DeadBackpackPrefab, gameObject.transform.position, gameObject.transform.rotation);
         stealItemTrigger._entity          = entity;
         stealItemTrigger.transform.parent = gameObject.transform;
         gameObject.AddComponent <DeathMPTut>();
         ItemStorage cis = gameObject.AddComponent <ItemStorage>();
         for (int k = 0; k < inventory._possessedItems.Count; k++)
         {
             InventoryItem inventoryItem = inventory._possessedItems[k];
             if (!LocalPlayer.Inventory.Owns(inventoryItem._itemId))
             {
                 this.AddItemToStorage(inventoryItem._itemId, inventoryItem._amount, inventoryItem._maxAmountBonus, cis);
             }
         }
         for (int l = 0; l < inventory.EquipmentSlots.Length; l++)
         {
             InventoryItemView inventoryItemView = inventory.EquipmentSlots[l];
             if (inventoryItemView && inventoryItemView._itemId > 0)
             {
                 this.AddItemToStorage(inventoryItemView._itemId, 1, 0, cis);
             }
         }
         animalAI[] array2 = UnityEngine.Object.FindObjectsOfType <animalAI>();
         animalAI[] array3 = array2;
         for (int m = 0; m < array3.Length; m++)
         {
             animalAI animalAI = array3[m];
             animalAI.SendMessage("updatePlayerTargets");
         }
         mutantAI[] array4 = UnityEngine.Object.FindObjectsOfType <mutantAI>();
         mutantAI[] array5 = array4;
         for (int n = 0; n < array5.Length; n++)
         {
             mutantAI mutantAI = array5[n];
             mutantAI.SendMessage("updatePlayerTargets");
         }
         Fish[] array6 = UnityEngine.Object.FindObjectsOfType <Fish>();
         Fish[] array7 = array6;
         for (int num = 0; num < array7.Length; num++)
         {
             Fish fish = array7[num];
             fish.SendMessage("updatePlayerTargets");
         }
         mutantScriptSetup[] array8 = UnityEngine.Object.FindObjectsOfType <mutantScriptSetup>();
         mutantScriptSetup[] array9 = array8;
         for (int num2 = 0; num2 < array9.Length; num2++)
         {
             mutantScriptSetup mutantScriptSetup = array9[num2];
             mutantScriptSetup.setupPlayer();
             mutantScriptSetup.search.refreshCurrentTarget();
         }
         Terrain.activeTerrain.GetComponent <Collider>().enabled = true;
         Scene.Clock.IsNotCave();
     }
     PlayerRespawnMP.Cancel();
 }
Пример #19
0
 private void Start()
 {
     this.ai = base.transform.GetComponentInParent<mutantAI>();
 }
Пример #20
0
 private void Awake()
 {
     this.setup = base.GetComponent<mutantScriptSetup>();
     this.events = base.GetComponent<creepyAnimEvents>();
     this.animator = base.GetComponent<Animator>();
     this.controller = base.transform.parent.GetComponent<CharacterController>();
     this.thisTr = base.transform;
     this.rootTr = base.transform.parent;
     this.ai = base.GetComponent<mutantAI>();
 }
Пример #21
0
 private void Awake()
 {
     this.ragDollSetup = base.GetComponent<clsragdollify>();
     this.setup = base.GetComponent<mutantScriptSetup>();
     this.typeSetup = base.transform.parent.GetComponent<mutantTypeSetup>();
     this.ai = base.GetComponent<mutantAI>();
     this.familyFunctions = base.transform.parent.GetComponent<mutantFamilyFunctions>();
     this.targetSwitcher = base.GetComponentInChildren<mutantTargetSwitching>();
     if (!this.ai.creepy)
     {
         this.animator = base.GetComponent<Animator>();
     }
     else
     {
         this.animator = base.GetComponentInChildren<Animator>();
     }
     this.MP = base.gameObject.GetComponent<mutantPropManager>();
     this.bloodPropertyBlock = new MaterialPropertyBlock();
 }
Пример #22
0
 private void Awake()
 {
     this.props     = base.GetComponent <mutantPropManager>();
     this.aiManager = base.GetComponent <mutantAiManager>();
     this.ai        = base.GetComponent <mutantAI>();
 }
Пример #23
0
 private void doAwake()
 {
     if (this.disableAiForDebug)
     {
         this.disableForDebug();
     }
     this.allFSM = base.gameObject.GetComponents<PlayMakerFSM>();
     PlayMakerFSM[] array = this.allFSM;
     for (int i = 0; i < array.Length; i++)
     {
         PlayMakerFSM playMakerFSM = array[i];
         if (playMakerFSM.FsmName == "action_combatFSM")
         {
             this.pmCombat = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "action_inTreeFSM")
         {
             this.pmTree = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "global_visionFSM")
         {
             this.pmVision = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "action_searchFSM")
         {
             this.pmSearch = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "action_stalkingFSM")
         {
             this.pmStalk = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "global_motorFSM")
         {
             this.pmMotor = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "action_sleepingFSM")
         {
             this.pmSleep = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "global_brainFSM")
         {
             this.pmBrain = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "global_alertManagerFSM")
         {
             this.pmAlert = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "action_encounterFSM")
         {
             this.pmEncounter = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "global_targetManagerFSM")
         {
             this.pmTargetManager = playMakerFSM;
         }
     }
     this.thisGo = base.gameObject;
     this.rootTr = base.transform.root.transform;
     this.rotateTr = base.transform;
     this.familyFunctions = base.transform.parent.GetComponent<mutantFamilyFunctions>();
     this.animator = base.GetComponent<Animator>();
     this.ai = base.GetComponent<mutantAI>();
     this.aiManager = base.GetComponent<mutantAiManager>();
     this.typeSetup = base.transform.parent.GetComponent<mutantTypeSetup>();
     this.health = base.GetComponent<EnemyHealth>();
     this.dayCycle = base.GetComponentInChildren<mutantDayCycle>();
     this.enemyEvents = base.transform.GetComponent<enemyAnimEvents>();
     this.controller = base.transform.root.GetComponent<CharacterController>();
     this.hashs = base.transform.GetComponent<mutantMaleHashId>();
     this.propManager = base.transform.GetComponent<mutantPropManager>();
     this.bodyVariation = base.transform.GetComponentInChildren<setupBodyVariation>();
     this.collisionDetect = base.transform.GetComponentInChildren<mutantCollisionDetect>();
     this.hitReceiver = base.transform.GetComponentInChildren<mutantHitReceiver>();
     this.animControl = base.transform.GetComponentInChildren<mutantAnimatorControl>();
     if (!this.disableAiForDebug)
     {
         this.sceneInfo = Scene.SceneTracker;
     }
     this.search = base.GetComponent<mutantSearchFunctions>();
     this.worldSearch = base.transform.parent.GetComponent<mutantWorldSearchFunctions>();
     this.mutantStats = base.transform.parent.GetComponent<targetStats>();
     Transform[] componentsInChildren = base.transform.parent.GetComponentsInChildren<Transform>();
     Transform[] array2 = componentsInChildren;
     for (int j = 0; j < array2.Length; j++)
     {
         Transform transform = array2[j];
         if (transform.name == "char_Head")
         {
             this.headJoint = transform.gameObject;
         }
         if (transform.name == "char_LeftHandWeapon")
         {
             this.charLeftWeaponGo = transform.gameObject;
         }
         if (transform.name == "currentWaypoint")
         {
             this.currentWaypoint = transform.gameObject;
         }
         if (transform.name == "lastPlayerSighting")
         {
             this.lastSighting = transform.gameObject;
         }
         if (transform.name == "tempLookat")
         {
             this.lookatTr = transform;
         }
         if (transform.name == "char_club_mesh1")
         {
             this.weapon = transform.gameObject;
         }
         if (transform.name == "FireStick")
         {
             this.fireWeapon = transform.gameObject;
         }
         if (transform.name == "char_RightHand")
         {
             this.clawsWeapon = transform.gameObject;
         }
         if (transform.name == "weaponLeftGO")
         {
             this.leftWeapon = transform.gameObject;
         }
         if (transform.name == "weaponLeftGO1")
         {
             this.leftWeapon1 = transform.gameObject;
         }
         if (transform.name == "weaponRightGO")
         {
             this.rightWeapon = transform.gameObject;
         }
         if (transform.name == "mainHitTrigger")
         {
             this.mainWeapon = transform.gameObject;
         }
         if (transform.name == "fireBomb")
         {
             this.fireBombGo = transform.gameObject;
         }
         if (transform.name == "dragPointGo")
         {
             this.familyFunctions.dragPoint = transform.gameObject;
         }
         if (transform.name == "bodyCollision")
         {
             if (this.pmCombat)
             {
                 this.pmCombat.FsmVariables.GetFsmGameObject("bodyCollisionGo").Value = transform.gameObject;
             }
             this.bodyCollisionCollider = transform.GetComponent<CapsuleCollider>();
         }
         if (transform.name == "char_LeftFoot")
         {
             this.leftFoot = transform;
         }
         if (transform.name == "headCollision")
         {
             this.headColliderGo = transform.gameObject;
         }
     }
 }
Пример #24
0
    private IEnumerator SetTypeRoutine()
    {
        yield return(null);

        mutantTypeSetup typeSetup = base.GetComponent <mutantTypeSetup>();

        if (typeSetup)
        {
            mutantAI ai2 = typeSetup.setup.ai;
            if (ai2.skinned)
            {
                this.Type = EnemyType.skinMaskMale;
            }
            else if (ai2.maleSkinny)
            {
                this.Type = ((!ai2.pale) ? EnemyType.skinnyMale : EnemyType.skinnyMalePale);
            }
            else if (ai2.femaleSkinny)
            {
                this.Type = ((!ai2.pale) ? EnemyType.skinnyFemale : EnemyType.skinnyFemalePale);
            }
            else if (ai2.male)
            {
                this.Type = ((!ai2.pale) ? EnemyType.regularMale : EnemyType.paleMale);
            }
            else if (ai2.female)
            {
                this.Type = ((!ai2.pale) ? EnemyType.regularFemale : EnemyType.paleFemale);
            }
            else if (ai2.creepy_male)
            {
                this.Type = ((!ai2.pale) ? EnemyType.creepyArmsy : EnemyType.creepyArmsy);
            }
            else if (ai2.creepy_fat)
            {
                this.Type = EnemyType.creepyFat;
            }
            else if (ai2.creepy_baby)
            {
                this.Type = EnemyType.creepyBaby;
            }
            else if (ai2.creepy)
            {
                this.Type = ((!ai2.pale) ? EnemyType.creepySpiderLady : EnemyType.blueCreepySpiderLady);
            }
        }
        else
        {
            BoltEntity   entity = base.GetComponent <BoltEntity>();
            mutantAI_net ai     = base.GetComponentInChildren <mutantAI_net>();
            IMutantState state  = entity.GetState <IMutantState>();
            while (!entity.isAttached || state.ai_mask == 0)
            {
                yield return(null);
            }
            if (ai)
            {
                if (ai.skinned)
                {
                    this.Type = EnemyType.skinMaskMale;
                }
                else if (ai.maleSkinny)
                {
                    this.Type = ((!ai.pale) ? EnemyType.skinnyMale : EnemyType.skinnyMalePale);
                }
                else if (ai.femaleSkinny)
                {
                    this.Type = ((!ai.pale) ? EnemyType.skinnyFemale : EnemyType.skinnyFemalePale);
                }
                else if (ai.male)
                {
                    this.Type = ((!ai.pale) ? EnemyType.regularMale : EnemyType.paleMale);
                }
                else if (ai.female)
                {
                    this.Type = ((!ai.pale) ? EnemyType.regularFemale : EnemyType.paleFemale);
                }
                else if (ai.creepy_male)
                {
                    this.Type = ((!ai.pale) ? EnemyType.creepyArmsy : EnemyType.creepyArmsy);
                }
                else if (ai.creepy_fat)
                {
                    this.Type = EnemyType.creepyFat;
                }
                else if (ai.creepy_baby)
                {
                    this.Type = EnemyType.creepyBaby;
                }
                else if (ai.creepy)
                {
                    this.Type = ((!ai.pale) ? EnemyType.creepySpiderLady : EnemyType.blueCreepySpiderLady);
                }
            }
        }
        yield break;
    }
Пример #25
0
 private void Start()
 {
     this.ai = base.transform.GetComponentInParent <mutantAI>();
 }
Пример #26
0
        public void OnEnemyKilledMod(object o)
        {
            EnemyHealth hp = (EnemyHealth)o;

            if (hp != null)
            {
                mutantAI ai = hp.gameObject.GetComponent <mutantAI>();
                if (ai != null)
                {
                    if (hp.Health <= 0)
                    {
                        /*
                         * if (ai.male)
                         * {
                         *  if (ai.pale)
                         *  {
                         *      if (ai.skinned)
                         *      {
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.SkinnedMale,-1,Quests.HeldWeapon);
                         *
                         *      }
                         *      else
                         *      {
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.PaleMale, -1, Quests.HeldWeapon);
                         *
                         *      }
                         *  }
                         *  else if (ai.painted)
                         *  {
                         *      if (ai.fireman)
                         *      {
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.PaintedFirethrower, -1, Quests.HeldWeapon);
                         *
                         *      }
                         *      else if (ai.leader)
                         *      {
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.PaintedLeader, -1, Quests.HeldWeapon);
                         *
                         *      }
                         *      else
                         *      {
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.PaintedMale, -1, Quests.HeldWeapon);
                         *      }
                         *  }
                         *  else
                         *  {
                         *      if (ai.leader)
                         *      {
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.TribalMaleLeader, -1, Quests.HeldWeapon);
                         *
                         *      }
                         *      else
                         *      {
                         *
                         *
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.TribalMale, -1, Quests.HeldWeapon);
                         *      }
                         *  }
                         *
                         * }
                         * if (ai.creepy)
                         * {
                         *  if (ai.pale)
                         *  {
                         *      Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.PaleVirgina, -1, Quests.HeldWeapon);
                         *
                         *  }
                         *  else
                         *  {
                         *      Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.Virgina, -1, Quests.HeldWeapon);
                         *
                         *  }
                         * }
                         * if (ai.creepy_male)
                         * {
                         *  if (ai.pale)
                         *  {
                         *      Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.PaleArmsy, -1, Quests.HeldWeapon);
                         *
                         *  }
                         *  else
                         *  {
                         *      Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.Armsy, -1, Quests.HeldWeapon);
                         *
                         *  }
                         * }
                         * if (ai.creepy_baby)
                         * {
                         *  Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.Baby, -1, Quests.HeldWeapon);
                         *
                         * }
                         * if (ai.creepy_boss)
                         * {
                         *  Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.EndBoss, -1, Quests.HeldWeapon);
                         *
                         * }
                         * if (ai.creepy_fat)
                         * {
                         *  Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.Cowman, -1, Quests.HeldWeapon);
                         *
                         * }
                         * if (ai.maleSkinny)
                         * {
                         *  if (ai.pale)
                         *  {
                         *      if (ai.skinned)
                         *      {
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.SkinnedSkinny, -1, Quests.HeldWeapon);
                         *
                         *      }
                         *      else
                         *      {
                         *          Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.SkinnyPale, -1, Quests.HeldWeapon);
                         *
                         *      }
                         *  }
                         *  else
                         *  {
                         *      Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.SkinnyMale, -1, Quests.HeldWeapon);
                         *
                         *  }
                         * }
                         * if (ai.female)
                         * {
                         *  if (ai.painted)
                         *  {
                         *      Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.PaintedFemale, -1, Quests.HeldWeapon);
                         *
                         *  }
                         *  else
                         *  {
                         *      Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.TribalFemale, -1, Quests.HeldWeapon);
                         *
                         *  }
                         * }
                         * if (ai.femaleSkinny)
                         * {
                         *  Quests.UpdateActiveQuests(QuestObjective.Type.Kill, 1, QuestObjective.Enemy.SkinnyFemale, -1, Quests.HeldWeapon);
                         *
                         * }
                         */
                        int xppoints = 10;
                        if (ai.creepy_boss)
                        {
                            xppoints = 25000;
                        }
                        if (ai.leader)
                        {
                            xppoints += 200;
                        }
                        if (ai.female)
                        {
                            xppoints += 80;
                        }
                        if (ai.femaleSkinny)
                        {
                            if (ai.female)
                            {
                                xppoints = 70;
                            }
                            else
                            {
                                xppoints += 60;
                            }
                        }
                        if (ai.male)
                        {
                            xppoints += 75;
                        }
                        if (ai.creepy_male)
                        {
                            xppoints += 3000;
                            if (ai.pale)
                            {
                                xppoints += 1000;
                            }
                        }
                        if (ai.maleSkinny)
                        {
                            if (ai.male)
                            {
                                xppoints = 70;
                            }
                            else
                            {
                                xppoints += 60;
                            }
                        }

                        if (ai.creepy_fat)
                        {
                            xppoints += 3300;
                        }
                        if (ai.fireman)
                        {
                            xppoints += 150;
                        }
                        if (ai.fireman_dynamite)
                        {
                            xppoints += 200;
                        }
                        if (ai.pale)
                        {
                            xppoints += 400;
                        }
                        if (ai.painted)
                        {
                            xppoints += 350;
                        }
                        if (ai.skinned)
                        {
                            xppoints += 500;
                        }
                        if (ai.creepy)
                        {
                            xppoints += 2800;
                            if (ai.pale)
                            {
                                xppoints += 1700;
                            }
                        }
                        if (ai.creepy_baby)
                        {
                            xppoints = 80;
                        }
                        float r = UnityEngine.Random.Range(0.75f, 2f);
                        xppoints = Mathf.RoundToInt(r * xppoints);

                        Vector3 pos             = ai.transform.position;
                        int     count           = TheForest.Utils.Scene.SceneTracker.allPlayers.Count(go => (go.transform.position - pos).sqrMagnitude < 250 * 250);
                        bool    giveLocalPlayer = false;

                        if ((LocalPlayer.Transform.position - pos).sqrMagnitude < 250 * 250)
                        {
                            giveLocalPlayer = true;
                            count++;
                        }


                        if (count == 0)
                        {
                            return;
                        }

                        xppoints = Mathf.RoundToInt((float)xppoints / (count));


                        if (giveLocalPlayer)
                        {
                            UpgradePointsMod.instance.AddXP(xppoints, true);
                        }

                        Network.NetworkManager.SendExpCommand(xppoints, pos, true);
                    }
                }
            }
        }
Пример #27
0
 private void Start()
 {
     this.setup                            = base.transform.GetComponent <mutantScriptSetup>();
     this.ai                               = base.GetComponent <mutantAI>();
     this.searchFunctions                  = base.GetComponent <mutantSearchFunctions>();
     this.animator                         = base.transform.GetComponent <Animator>();
     this.fsmRunAwayAfterAttack            = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunAwayAfterAttack");
     this.fsmfollowUpAfterAttack           = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmFollowUpAfterAttack");
     this.fsmClimbTreeAfterAttack          = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmClimbTreeAfterAttack");
     this.fsmRunHideAfterAttack            = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunHideAfterAttack");
     this.fsmToStalkAfterAttack            = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmToStalkAfterAttack");
     this.fsmRunTowardsFlank               = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunTowardsFlank");
     this.fsmRunTowardsScream              = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunTowardsScream");
     this.fsmRunTowardsAttack              = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunTowardsAttack");
     this.fsmScreamRunTowards              = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmScreamRunTowards");
     this.fsmLeaderCallFollowers           = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmLeaderCallFollowers");
     this.fsmAttack                        = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmAttack");
     this.fsmStepLeft                      = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStepLeft");
     this.fsmStepRight                     = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStepRight");
     this.fsmScream                        = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmScream");
     this.fsmTreeAttack                    = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmTreeAttack");
     this.fsmTreeClimb                     = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmTreeClimb");
     this.fsmBackAway                      = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmBackAway");
     this.fsmDisengage                     = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmDisengage");
     this.fsmAwayReturn                    = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmAwayReturn");
     this.fsmAwayScream                    = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmAwayScream");
     this.fsmAwayFlank                     = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmAwayFlank");
     this.fsmAwayToRock                    = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmAwayToRock");
     this.fsmAwayToBurn                    = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmAwayToBurn");
     this.fsmToStructure                   = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmToStructure");
     this.fsmRunAwayDist                   = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunAwayDist");
     this.fsmRunForwardStopDist            = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunForwardStopDist");
     this.fsmRunTowardPlayerDist           = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunTowardPlayerDist");
     this.fsmAttackChance                  = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmAttackChance");
     this.fsmRunAwayChance                 = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunAwayChance");
     this.fsmSneakForward                  = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmSneakForward");
     this.fsmSneakBack                     = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmSneakBack");
     this.fsmRunBack                       = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunBack");
     this.fsmRunForwardToTree              = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunForwardToTree");
     this.fsmRunForward                    = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmRunForward");
     this.fsmStalkToTree                   = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStalkToTree");
     this.fsmStalkToFlank                  = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStalkToFlank");
     this.fsmStalkRunTowards               = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStalkRunTowards");
     this.fsmStalkLeaveArea                = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStalkLeaveArea");
     this.fsmStalkToSneakForward           = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStalkToSneakForward");
     this.fsmStalkToRock                   = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStalkToRock");
     this.fsmStalkToAmbush                 = this.setup.pmCombat.FsmVariables.GetFsmFloat("fsmStalkToAmbush");
     this.fsmFindPointNearPlayer           = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmFindPointNearPlayer");
     this.fsmFindRandomPoint               = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmFindRandomPoint");
     this.fsmRandomSearchRange             = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmRandomSearchRange");
     this.fsmFindWayPoint                  = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmFindWayPoint");
     this.fsmFindStructure                 = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmFindStructure");
     this.fsmFindPlaneCrash                = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmFindPlaneCrash");
     this.fsmDaysToSearchPlane             = this.setup.pmSearch.FsmVariables.GetFsmInt("fsmDaysToSearchPlane");
     this.fsmFindPlayerRangedPoint         = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmFindPlayerRangedPoint");
     this.fsmSearchToWalk                  = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchToWalk");
     this.fsmSearchToRun                   = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchToRun");
     this.FsmSearchWaitMin                 = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchWaitMin");
     this.FsmSearchWaitMax                 = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchWaitMax");
     this.fsmSearchRangedValue             = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchRangedValue");
     this.fsmSearchToEncounter             = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchToEncounter");
     this.fsmSearchToCall                  = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchToCall");
     this.fsmSearchToPlaceArt              = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchToPlaceArt");
     this.fsmSearchToSearch                = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchToSearch");
     this.fsmSearchToSleep                 = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchToSleep");
     this.fsmSearchToStructure             = this.setup.pmSearch.FsmVariables.GetFsmFloat("fsmSearchToStructure");
     this.fsmWayPointArriveDist            = this.setup.pmSearch.FsmVariables.GetFsmFloat("waypointArriveDist");
     this.searchFunctions.cautiousReset    = 24f;
     this.searchFunctions.searchReset      = 30f;
     this.searchFunctions.playerAwareReset = 30f;
     this.setDefaultCombat();
     this.setDefaultStalking();
     this.setDefaultSearching();
 }
Пример #28
0
 private void doStart()
 {
     this.setup = base.GetComponent<mutantScriptSetup>();
     this.animator = base.GetComponent<Animator>();
     this.controller = base.transform.parent.GetComponent<CharacterController>();
     this.thisTr = base.transform;
     this.rootTr = base.transform.parent;
     this.ai = base.GetComponent<mutantAI>();
     this.walkHash = Animator.StringToHash("walk");
     this.idleHash = Animator.StringToHash("idle");
     this.attackHash = Animator.StringToHash("attack");
     this.chargeHash = Animator.StringToHash("charge");
     if (!this.setup.ai.creepy_fat)
     {
         this.fsmMoving = this.setup.pmMotor.FsmVariables.GetFsmBool("movingBool");
     }
     this.fsmInCaveBool = this.setup.pmCombat.FsmVariables.GetFsmBool("inCaveBool");
     if (this.setup.pmCombat)
     {
         this.fsmAttackingStructure = this.setup.pmCombat.FsmVariables.GetFsmBool("attackStructure");
     }
     this.checkWallDelay = Time.time + 5f;
     this.layer = 26;
     this.layerMask = 1 << this.layer;
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashIdle").Value = Animator.StringToHash("idle");
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashWalk").Value = Animator.StringToHash("walk");
     this.setup.pmCombat.FsmVariables.GetFsmInt("HashAttack").Value = Animator.StringToHash("attack");
     this.enableAnim = true;
 }
Пример #29
0
 private void Start()
 {
     this.animator = base.GetComponent<Animator>();
     this.controller = base.transform.parent.GetComponent<CharacterController>();
     this.events = base.GetComponent<enemyAnimEvents>();
     this.thisTr = base.transform;
     this.rootTr = base.transform.parent;
     this.ai = base.gameObject.GetComponent<mutantAI>();
     this.setup = base.GetComponent<mutantScriptSetup>();
     this.hashId = base.GetComponent<mutantMaleHashId>();
     this.target = LocalPlayer.Transform;
     this.jumpingHash = Animator.StringToHash("jumping");
     this.jumpFallHash = Animator.StringToHash("jumpFall");
     this.inTrapHash = Animator.StringToHash("inTrap");
     this.runTrapHash = Animator.StringToHash("runTrap");
     this.controllerRadius = this.controller.radius;
     if (this.setup.pmBrain)
     {
         this.fsmPlayerDist = this.setup.pmBrain.FsmVariables.GetFsmFloat("playerDist");
         this.fsmDoControllerBool = this.setup.pmBrain.FsmVariables.GetFsmBool("enableControllerBool");
         this.fsmEnableGravity = this.setup.pmBrain.FsmVariables.GetFsmBool("enableGravityBool");
         this.fsmTargetSeen = this.setup.pmBrain.FsmVariables.GetFsmBool("targetSeenBool");
     }
     if (this.setup.pmSleep)
     {
         this.fsmInCaveBool = this.setup.pmSleep.FsmVariables.GetFsmBool("inCaveBool");
         this.fsmNoMoveBool = this.setup.pmSleep.FsmVariables.GetFsmBool("noMoveBool");
     }
     if (this.setup.pmCombat)
     {
         this.fsmDeathBool = this.setup.pmCombat.FsmVariables.GetFsmBool("deathBool");
     }
     this.layerMask = 101851136;
     base.Invoke("initAnimator", 0.5f);
     if (BoltNetwork.isRunning)
     {
         this.setup.pmCombat.FsmVariables.GetFsmBool("boltIsActive").Value = true;
     }
     else
     {
         this.setup.pmCombat.FsmVariables.GetFsmBool("boltIsActive").Value = false;
     }
 }
Пример #30
0
 private void doAwake()
 {
     if (this.disableAiForDebug)
     {
         this.disableForDebug();
     }
     this.allFSM = base.gameObject.GetComponents <PlayMakerFSM>();
     PlayMakerFSM[] array = this.allFSM;
     for (int i = 0; i < array.Length; i++)
     {
         PlayMakerFSM playMakerFSM = array[i];
         if (playMakerFSM.FsmName == "action_combatFSM")
         {
             this.pmCombat = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "action_inTreeFSM")
         {
             this.pmTree = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "global_visionFSM")
         {
             this.pmVision = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "action_searchFSM")
         {
             this.pmSearch = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "action_stalkingFSM")
         {
             this.pmStalk = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "global_motorFSM")
         {
             this.pmMotor = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "action_sleepingFSM")
         {
             this.pmSleep = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "global_brainFSM")
         {
             this.pmBrain = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "global_alertManagerFSM")
         {
             this.pmAlert = playMakerFSM;
         }
         if (playMakerFSM.FsmName == "action_encounterFSM")
         {
             this.pmEncounter = playMakerFSM;
             this.actionFSM.Add(playMakerFSM);
         }
         if (playMakerFSM.FsmName == "global_targetManagerFSM")
         {
             this.pmTargetManager = playMakerFSM;
         }
     }
     this.thisGo          = base.gameObject;
     this.rootTr          = base.transform.root.transform;
     this.rotateTr        = base.transform;
     this.familyFunctions = base.transform.parent.GetComponent <mutantFamilyFunctions>();
     this.animator        = base.GetComponent <Animator>();
     this.ai              = base.GetComponent <mutantAI>();
     this.aiManager       = base.GetComponent <mutantAiManager>();
     this.typeSetup       = base.transform.parent.GetComponent <mutantTypeSetup>();
     this.health          = base.GetComponent <EnemyHealth>();
     this.dayCycle        = base.GetComponentInChildren <mutantDayCycle>();
     this.enemyEvents     = base.transform.GetComponent <enemyAnimEvents>();
     this.controller      = base.transform.root.GetComponent <CharacterController>();
     this.hashs           = base.transform.GetComponent <mutantMaleHashId>();
     this.propManager     = base.transform.GetComponent <mutantPropManager>();
     this.bodyVariation   = base.transform.GetComponentInChildren <setupBodyVariation>();
     this.collisionDetect = base.transform.GetComponentInChildren <mutantCollisionDetect>();
     this.hitReceiver     = base.transform.GetComponentInChildren <mutantHitReceiver>();
     this.animControl     = base.transform.GetComponentInChildren <mutantAnimatorControl>();
     if (!this.disableAiForDebug)
     {
         this.sceneInfo = Scene.SceneTracker;
     }
     this.search      = base.GetComponent <mutantSearchFunctions>();
     this.worldSearch = base.transform.parent.GetComponent <mutantWorldSearchFunctions>();
     this.mutantStats = base.transform.parent.GetComponent <targetStats>();
     Transform[] componentsInChildren = base.transform.parent.GetComponentsInChildren <Transform>();
     Transform[] array2 = componentsInChildren;
     for (int j = 0; j < array2.Length; j++)
     {
         Transform transform = array2[j];
         if (transform.name == "char_Head")
         {
             this.headJoint = transform.gameObject;
         }
         if (transform.name == "char_LeftHandWeapon")
         {
             this.charLeftWeaponGo = transform.gameObject;
         }
         if (transform.name == "currentWaypoint")
         {
             this.currentWaypoint = transform.gameObject;
         }
         if (transform.name == "lastPlayerSighting")
         {
             this.lastSighting = transform.gameObject;
         }
         if (transform.name == "tempLookat")
         {
             this.lookatTr = transform;
         }
         if (transform.name == "char_club_mesh1")
         {
             this.weapon = transform.gameObject;
         }
         if (transform.name == "FireStick")
         {
             this.fireWeapon = transform.gameObject;
         }
         if (transform.name == "char_RightHand")
         {
             this.clawsWeapon = transform.gameObject;
         }
         if (transform.name == "weaponLeftGO")
         {
             this.leftWeapon = transform.gameObject;
         }
         if (transform.name == "weaponLeftGO1")
         {
             this.leftWeapon1 = transform.gameObject;
         }
         if (transform.name == "weaponRightGO")
         {
             this.rightWeapon = transform.gameObject;
         }
         if (transform.name == "mainHitTrigger")
         {
             this.mainWeapon = transform.gameObject;
         }
         if (transform.name == "fireBomb")
         {
             this.fireBombGo = transform.gameObject;
         }
         if (transform.name == "dragPointGo")
         {
             this.familyFunctions.dragPoint = transform.gameObject;
         }
         if (transform.name == "bodyCollision")
         {
             if (this.pmCombat)
             {
                 this.pmCombat.FsmVariables.GetFsmGameObject("bodyCollisionGo").Value = transform.gameObject;
             }
             this.bodyCollisionCollider = transform.GetComponent <CapsuleCollider>();
         }
         if (transform.name == "char_LeftFoot")
         {
             this.leftFoot = transform;
         }
         if (transform.name == "headCollision")
         {
             this.headColliderGo = transform.gameObject;
         }
     }
 }