Exemple #1
0
        public void LoadDeployable(CharacterMaster playerMaster)
        {
            switch (name)
            {
            case "BeetleGuardAllyBody": {
                var beetleMaster = GameObject.Instantiate(MasterCatalog.FindMasterPrefab("BeetleGuardAllyMaster")).GetComponent <CharacterMaster>();
                NetworkServer.Spawn(beetleMaster.gameObject);
                var beetleBody = beetleMaster.SpawnBody(BodyCatalog.FindBodyPrefab("BeetleGuardAllyBody"), transform.position.GetVector3(), transform.rotation.GetQuaternion());
                var inventory  = beetleMaster.inventory;

                inventory.GiveItem(ItemIndex.BoostDamage, 30);
                inventory.GiveItem(ItemIndex.BoostHp, 10);

                playerMaster.AddDeployable(beetleBody.GetComponent <Deployable>(), DeployableSlot.BeetleGuardAlly);

                beetleMaster.teamIndex = TeamIndex.Player;
                break;
            }

            case "EngiTurretMaster": {
                var turretMaster = GameObject.Instantiate(MasterCatalog.FindMasterPrefab("EngiTurretMaster")).GetComponent <CharacterMaster>();
                NetworkServer.Spawn(turretMaster.gameObject);
                var inventory = turretMaster.inventory;

                inventory.CopyItemsFrom(playerMaster.inventory);
                inventory.ResetItem(ItemIndex.WardOnLevel);
                inventory.ResetItem(ItemIndex.BeetleGland);
                inventory.ResetItem(ItemIndex.CrippleWardOnLevel);

                var deployable = turretMaster.gameObject.AddComponent <Deployable>();
                deployable.onUndeploy = new UnityEngine.Events.UnityEvent();
                deployable.onUndeploy.AddListener(new UnityEngine.Events.UnityAction(turretMaster.TrueKill));
                playerMaster.AddDeployable(deployable, DeployableSlot.EngiTurret);

                var turretBody = turretMaster.SpawnBody(BodyCatalog.FindBodyPrefab("EngiTurretBody"), transform.position.GetVector3(), transform.rotation.GetQuaternion());
                Debug.Log(transform.position.GetVector3());
                turretMaster.transform.position = transform.position.GetVector3();
                turretMaster.teamIndex          = TeamIndex.Player;
                SavedGames.instance.StartCoroutine(WaitForStart(turretBody));
                break;
            }
            }
        }
Exemple #2
0
        // Token: 0x06001E6D RID: 7789 RVA: 0x00083284 File Offset: 0x00081484
        private void DeployToOwner()
        {
            GameObject owner = base.GetComponent <ProjectileController>().owner;

            if (owner)
            {
                CharacterBody component = owner.GetComponent <CharacterBody>();
                if (component)
                {
                    CharacterMaster master = component.master;
                    if (master)
                    {
                        master.AddDeployable(base.GetComponent <Deployable>(), this.deployableSlot);
                    }
                }
            }
        }
        // Token: 0x0600313F RID: 12607 RVA: 0x000D4124 File Offset: 0x000D2324
        public override void OnEnter()
        {
            base.OnEnter();
            ProjectileController component = base.GetComponent <ProjectileController>();

            this.projectileStickOnImpact = base.GetComponent <ProjectileStickOnImpact>();
            if (NetworkServer.active && component.owner)
            {
                CharacterBody component2 = component.owner.GetComponent <CharacterBody>();
                if (component2)
                {
                    CharacterMaster master = component2.master;
                    if (master)
                    {
                        master.AddDeployable(base.GetComponent <Deployable>(), DeployableSlot.EngiBubbleShield);
                    }
                }
            }
        }
Exemple #4
0
        private void UnlockingMage_onOpened(Interactor obj)
        {
            GameObject mageMasterPrefab = MasterCatalog.FindMasterPrefab("MageMonsterMaster");
            GameObject mageBodyPrefab   = mageMasterPrefab.GetComponent <CharacterMaster>().bodyPrefab;

            GameObject      mageMasterGameObject = UnityEngine.Object.Instantiate(mageMasterPrefab, gameObject.transform.position, Quaternion.identity);
            GameObject      mageBodyGameObject   = UnityEngine.Object.Instantiate(mageBodyPrefab, gameObject.transform.position, Quaternion.identity);
            CharacterMaster mageCharacterMaster  = mageBodyGameObject.GetComponent <CharacterMaster>();

            mageCharacterMaster.bodyPrefab = mageBodyGameObject;
            AIOwnership mageAIOwnership = mageBodyGameObject.GetComponent <AIOwnership>();

            CharacterMaster playerMaster = obj.gameObject.GetComponent <CharacterBody>().master;
            BaseAI          mageBaseAI   = gameObject.GetComponent <BaseAI>();

            if (mageCharacterMaster)
            {
                mageCharacterMaster.inventory.GiveItem(ItemIndex.BoostDamage, 10);
                mageCharacterMaster.inventory.GiveItem(ItemIndex.BoostHp, 10);
                GameObject bodyObject = playerMaster.GetBodyObject();
                if (bodyObject)
                {
                    Deployable component4 = mageBodyGameObject.GetComponent <Deployable>();
                    if (!component4)
                    {
                        component4 = mageBodyGameObject.AddComponent <Deployable>();
                    }
                    playerMaster.AddDeployable(component4, DeployableSlot.ParentAlly);
                }
            }
            if (mageAIOwnership)
            {
                mageAIOwnership.ownerMaster = obj.gameObject.GetComponent <CharacterBody>().master;
            }
            if (mageBaseAI)
            {
                mageBaseAI.leader.gameObject = base.gameObject;
            }

            NetworkServer.Spawn(mageBodyGameObject);
            mageCharacterMaster.SpawnBody(mageBodyGameObject, gameObject.transform.position, Quaternion.identity);
        }