Пример #1
0
 public static void Postfix(SimGameState __instance)
 {
     if (BiggerDrops.settings.allowUpgrades)
     {
         DropManager.UpdateCULances();
     }
 }
Пример #2
0
 void Awake()
 {
     if (DropManagerInstance == null)
     {
         DropManagerInstance = gameObject.GetComponent <DropManager>();
     }
 }
Пример #3
0
        public void Load()
        {
            Start();
            log.InfoFormat("ShipWeapon Load() [dy]");

            var character   = GetComponent <CharacterObject>();
            var dropManager = DropManager.Get(nebulaObject.world.Resource());
            var player      = GetComponent <MmoActor>();

            var  app      = nebulaObject.mmoWorld().application;
            bool isNew    = false;
            var  dbWeapon = WeaponDatabase.instance(app).LoadWeapon(player.GetComponent <PlayerCharacterObject>().characterId, resource as Res, out isNew);


            if (isNew)
            {
                GenerateNewWeapon(dropManager);
                string characterID = GetComponent <PlayerCharacterObject>().characterId;
                WeaponDatabase.instance(app).SaveWeapon(characterID, new ShipWeaponSave {
                    characterID = characterID, weaponObject = weaponObject.GetInfo()
                });
            }
            else
            {
                weaponObject = new WeaponObject(dbWeapon.weaponObject);
            }
        }
Пример #4
0
        private static void UpdateWaves()
        {
            if (enemies.Count == 0)
            {
                waveNumber++;
                for (int i = 0; i < rand.Next(3, 3 + waveNumber); i++)
                {
                    NewShip();
                }
                DropManager.EndOfWaveDrop();
            }

            if (bombShipCooldown <= 0)
            {
                int bombShipCount = 0;
                for (int i = 0; i < enemies.Count; i++)
                {
                    if (enemies[i] is Bombship)
                    {
                        bombShipCount++;
                    }
                }
                if (bombShipCount < 4)
                {
                    NewBombShip();
                    bombShipCooldown = rand.Next(3, 10);
                }
            }
            else
            {
                bombShipCooldown -= GameManager.DeltaTime;
            }
        }
Пример #5
0
        protected override void GenerateModule(DropManager dropManager, ShipModelSlotType slotType)
        {
            //base.GenerateModule(dropManager, slotType);

            bool success = false;

            if (m_Data != null)
            {
                if (m_Data.moduleList.ContainsKey(slotType))
                {
                    ModuleGenList gen;
                    if (m_Data.moduleList.TryGetValue(slotType, out gen))
                    {
                        ShipModule prevModule;
                        ShipModule module = new ShipModule(gen);
                        shipModel.SetModule(module, out prevModule);
                        success = true;
                        s_Log.InfoFormat("Special Ship {0} generate success".Magenta(), slotType);
                    }
                }
                else
                {
                    s_Log.InfoFormat("Special Ship data module list invalid".Magenta());
                }
            }
            else
            {
                s_Log.Info("Special Ship data is null".Magenta());
            }
            if (!success)
            {
                base.GenerateModule(dropManager, slotType);
            }
        }
Пример #6
0
    void Start()
    {
        dropMgr = FindObjectOfType <DropManager> ();


        root = new GameObject("StairRoot");


        stairs = new List <GameObject> ();
        int totalSteps = centralStepOffset * 2;

        for (int i = 0; i < totalSteps; i++)
        {
            AddStair(i);
//			if (dropMgr.enabled) {
//				if (i > centralStepOffset-1 && i < totalSteps-1) {
//					//dropMgr.SetStair (stairs [i].transform);
//					dropMgr.SpawnRandom (stairs [i].transform.position + Vector3.up * bounds.y / 2f, i - (centralStepOffset-1));
//				}
//			}
        }
        for (int i = 1; i < centralStepOffset; i++)
        {
            dropMgr.SpawnRandom(i);
        }
        //Spawn Lock
        if (FMC_GameDataController.instance != null && !FMC_GameDataController.instance.subscriptionIsActive())
        {
            dropMgr.SpawnForced(PickableItem.Type.LOCK, 6, 6);
        }

        //Setcoinorigin ();
        dropMgr.Reattach(root);
    }
 // Update is called once per frame
 void Update()
 {
     if (Vector3.Distance(player.transform.position, transform.position) < chestRange)
     {
         keyText.SetActive(true);
         if (Input.GetKeyDown(KeyCode.E))
         {
             if (chestOpen == false)
             {
                 animator.SetTrigger("Open");
                 Debug.Log("trying to open");
                 chestOpen = true;
                 if (!opened)
                 {
                     Vector3 dropPosition = transform.position + transform.forward.normalized * -1;
                     DropManager.MakeDrop(dropPosition, chestLevel, true);
                 }
                 opened = true;
             }
             else
             {
                 animator.SetTrigger("Close");
                 Debug.Log("trying to close");
                 chestOpen = false;
             }
         }
     }
     else
     {
         keyText.SetActive(false);
     }
 }
Пример #8
0
    protected virtual void OnBattleLose()
    {
        MainWindow mainWindow = FindObjectOfType <MainWindow>();

        if (mainWindow != null)
        {
            mainWindow.gameObject.SetActive(false);
        }
        if (!_hero.Alive)
        {
            if (_hero.GetRoleInfo().Level < 3)
            {
                ResetGameCtrl.Instance.ResetGame(false);
            }
            else
            {
                DropManager.DropWhenHeroDie();
            }
            GameModel.Instance.DieTime++;

#if !DISABLESTEAMWORKS
            SteamAchievementMgr.Instance.AchievementAboutNumChanged();
#endif
        }

        GlobalEventLocator.Instance.dispatch(new GameEvent(GameEvent.BATTLE_FAILED));
        GameObject faildPanel = (GameObject)Instantiate(Resources.Load("Prefabs/BattleResult/FailedPanel"), GameObject.Find("MainCanvas").transform);
    }
Пример #9
0
 public static void Postfix(SimGameState __instance)
 {
     if (BiggerDrops.settings.allowUpgrades)
     {
         DropManager.setCompanyStats(__instance.CompanyStats);
     }
 }
Пример #10
0
        private void Startup()
        {
            if (!mInitialized)
            {
                mInitialized = true;
                mEnergy      = RequireComponent <ShipEnergyBlock>();

                mRace = RequireComponent <RaceableObject>();
                mShip = GetComponent <BaseShip>();

                var character   = GetComponent <CharacterObject>();
                var dropManager = DropManager.Get(nebulaObject.world.Resource());

                var player = GetComponent <MmoActor>();
                if (player != null)
                {
                }
                else
                {
                    InitializeAsBot();
                }

                mPlayer = GetComponent <MmoActor>();

                //log.Info("ShipWeapon.Start() completed");
            }
        }
Пример #11
0
 public virtual void Death()
 {
     isDead = true;
     DropManager.Drop(gameObject, chanceToDrop);
     SpawnManager.ChangeNumEnemies(-1);
     ScoreManager.ChangeScore(score);
     Destroy(gameObject, 0.5f);
 }
Пример #12
0
        public static void Initialize()
        {
            leftBound  = Config.MapGeneration["leftBound"].IntValue;
            rightBound = Config.MapGeneration["rightBound"].IntValue;

            assets = new Dictionary <string, Texture2D>();

            player = new Player();

            WaveManager.Init();

            MakeRectanglesForButtons();

            playButton         = new Button(buttonRectangles["play"], "Play");
            pauseButton        = new Button(buttonRectangles["pause"], "Pause");
            exitButton         = new Button(buttonRectangles["exit"], "Exit");
            menuButton         = new Button(buttonRectangles["menu"], "MainMenu");
            resumeButton       = new Button(buttonRectangles["resume"], "Resume");
            backButton         = new Button(buttonRectangles["back"], "Back");
            optionsButton      = new Button(buttonRectangles["options"], "Options");
            replayButton       = new Button(buttonRectangles["play"], "Replay");
            reloadConfigButton = new Button(buttonRectangles["reload"], "Reload");

            resolutionButtons = new Dictionary <string, Button>()
            {
                {
                    "fullscreen", new Button(new Rectangle(100, height / 2 - 100, 100, 50), "FullScreen")
                },
                {
                    "1920x1080", new Button(new Rectangle(100, height / 2 - 50, 100, 50), "1920x1080")
                },
                {
                    "1600x900", new Button(new Rectangle(100, height / 2, 100, 50), "1600x900")
                },
                {
                    "1280x720", new Button(new Rectangle(100, height / 2 + 50, 100, 50), "1280x720")
                }
            };

            resolutions = new Dictionary <string, Point>()
            {
                {
                    "1920x1080", new Point(1920, 1080)
                },
                {
                    "1600x900", new Point(1600, 900)
                },
                {
                    "1280x720", new Point(1280, 720)
                }
            };

            platforms = GenerateRandomMap();

            DropManager.Initialize();

            Game1.camera.Zoom = Helper.MapValue(width, 1280, 1920, 0.9f, 1.2f);
        }
Пример #13
0
 static void Postfix(SGCmdCenterLanceConfigBG __instance)
 {
     if (CustomUnitsAPI.Detected() == false)
     {
         BiggerDrops.baysAlreadyAdded = 0;
         __instance.LC.UpdateSlotsCount(DropManager.DefaultMechSlots +
                                        DropManager.AdditionalMechSlots());
     }
 }
Пример #14
0
    public void Drop(DropManager.TYPEOFDROP t)
    {
        drop = new DropManager(this, t);
        drop.setupDrop();
        timeOnDrop    = 0;
        onGroundFired = false;

        Game.OnDrop();
    }
Пример #15
0
    private void Awake()
    {
        if (Instance != null)
        {
            Destroy(gameObject);
        }

        Instance = this;
    }
Пример #16
0
 private void Start()
 {
     isAlive          = true;
     currentHitPoints = hitPoints;
     rb          = GetComponent <Rigidbody>();
     pooler      = EnemyPooler.Instance;
     player      = FindObjectOfType <PlayerController>();
     dropManager = DropManager.Instance;
 }
Пример #17
0
    private void Start()
    {
        _player      = FindObjectOfType <Player>();
        _inventoryUI = InventoryUI.Instance;
        _dropManager = DropManager.Instance;

        _equip = _menu.transform.GetChild(0).GetComponent <Button>();
        _use   = _menu.transform.GetChild(1).GetComponent <Button>();
    }
Пример #18
0
        private void GenerateScheme(DropManager dropManager, int lootLevel, Workshop lootWorkshop, Difficulty d, ConcurrentDictionary <string, ServerInventoryItem> newObjects, float remapWeight)
        {
            var moduleTemplate            = resource.ModuleTemplates.RandomModule(lootWorkshop, CommonUtils.RandomEnumValue <ShipModelSlotType>());
            var schemeDropper             = dropManager.GetSchemeDropper(lootWorkshop, lootLevel, remapWeight);
            IInventoryObject schemeObject = schemeDropper.Drop() as IInventoryObject;

            newObjects.TryAdd(schemeObject.Id, new ServerInventoryItem(schemeObject, 1));
            //log.InfoFormat("scheme of level = {0} generated", schemeObject.Level);
        }
Пример #19
0
    // Use this for initialization
    void Start()
    {
        jump  = FindObjectOfType <GameController> ();
        chara = FindObjectOfType <CharacterScript>();
        stair = FindObjectOfType <StairController>();
        drop  = FindObjectOfType <DropManager> ();
        input = FindObjectOfType <InputManager> ();

        cheatPanel.SetActive(false);
    }
 public RoomTreeViewDragDropManager(TreeView treeView)
 {
     TreeViewDataProvider <ItemsControl, TreeViewItem> treeViewDataProvider = new TreeViewDataProvider <ItemsControl, TreeViewItem>("TreeViewItemObject");
     // Data Consumer
     RoomTreeViewDataConsumer <ItemsControl, TreeViewItem> treeViewDataConsumer = new RoomTreeViewDataConsumer <ItemsControl, TreeViewItem>(new string[] { "TreeViewItemObject" });
     // Drag Managers
     DragManager dragHelperTreeView0 = new DragManager(treeView, treeViewDataProvider);
     // Drop Managers
     DropManager dropHelperTreeView0 = new DropManager(treeView, new IDataConsumer[] { treeViewDataConsumer, });
 }
Пример #21
0
 internal void HpChanged()
 {
     OnHpChanged?.Invoke(this);
     Debug.WriteLine($"{Name} hp changed to {Level.Hp}");
     if (Level.Hp <= 0)
     {
         DropManager.DropAndSpawn(LastHitCharacter);
         Destroy();
     }
 }
Пример #22
0
    private void DropItem()
    {
        int itemId = DropManager.GetDrop(m_DropCategory);

        if (itemId == Consts.NULL_ITEM_ID)
        {
            return;
        }
        DropManager.DropItem(itemId, transform.position);
    }
Пример #23
0
 void Awake()
 {
     if (Instancia == null)
     {
         Instancia = this;
     }
     else if (Instancia != this)
     {
         Destroy(Instancia);
     }
 }
Пример #24
0
 // Use this for initialization
 void Start()
 {
     if (control == null)
     {
         control = this;
     }
     else if (control != this)
     {
         Destroy(gameObject);
     }
 }
Пример #25
0
        private static void Reset()
        {
            platforms = GenerateRandomMap();

            DropManager.Initialize();

            SetTextures();

            player.Reset();
            WaveManager.Init();
        }
Пример #26
0
        private void GenerateWeapon(DropManager dropManager, int lootLevel, Workshop lootWorkshop, Difficulty d, ConcurrentDictionary <string, ServerInventoryItem> newObjects, float remapWeight)
        {
            ObjectColor color = resource.ColorRes.GenColor(ColoredObjectType.Weapon).color;

            WeaponDropper.WeaponDropParams weaponParams = new WeaponDropper.WeaponDropParams(resource, lootLevel, lootWorkshop, WeaponDamageType.damage, Difficulty.none);
            var weaponDropper             = dropManager.GetWeaponDropper(weaponParams, remapWeight);
            IInventoryObject weaponObject = weaponDropper.Drop() as IInventoryObject;

            newObjects.TryAdd(weaponObject.Id, new ServerInventoryItem(weaponObject, 1));
            //log.InfoFormat("weapon of level = {0} generated", weaponObject.Level);
        }
Пример #27
0
        //-----------------------------------------------------------------------------
        // Drop Lists Loading
        //-----------------------------------------------------------------------------

        public static void LoadDrops(DropManager dropManager, RewardManager rewardManager)
        {
            DropList dropsRupees = dropManager.CreateDropList("rupees");

            dropsRupees.AddDrop(3, rewardManager.GetReward("rupees_1"));
            dropsRupees.AddDrop(1, rewardManager.GetReward("rupees_5"));

            DropList dropsHearts = dropManager.CreateDropList("hearts");

            dropsHearts.AddDrop(4, rewardManager.GetReward("hearts_1"));
            dropsHearts.AddDrop(1, typeof(CollectibleFairy));

            DropList dropsSeeds = dropManager.CreateDropList("seeds");

            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_ember_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_scent_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_pegasus_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_gale_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_mystery_seeds_5"));

            DropList dropsAmmo = dropManager.CreateDropList("ammo");

            dropsAmmo.AddDrop(1, rewardManager.GetReward("ammo_bombs_5"));
            dropsAmmo.AddDrop(1, rewardManager.GetReward("ammo_arrows_5"));
            dropsAmmo.AddDrop(5, dropsSeeds);


            // Drops that are created by default for tiles.
            DropList dropsDefault = dropManager.CreateDropList("default", 1, 3);

            dropsDefault.AddDrop(50, dropsAmmo);
            dropsDefault.AddDrop(46, dropsRupees);
            dropsDefault.AddDrop(25, dropsHearts);

            // Drops that are created when a ground tile is dug up.
            DropList dropsDigRupees = new DropList();

            dropsDigRupees.AddDrop(25, dropsRupees);
            dropsDigRupees.AddDrop(1, rewardManager.GetReward("rupees_100"));
            DropList dropsDigMonsters = new DropList();

            dropsDigMonsters.AddDrop(5, typeof(MonsterBeetle));
            dropsDigMonsters.AddDrop(2, typeof(MonsterRope));
            DropList dropsDig = dropManager.CreateDropList("dig", 1, 4);

            dropsDig.AddDrop(46, dropsDigRupees);
            dropsDig.AddDrop(25, dropsHearts);
            dropsDig.AddDrop(7, dropsDigMonsters);

            //DropList dropsDig = dropManager.CreateDropList("dig", 1, 1);
            //dropsDig.AddDrop(1, typeof(MonsterRope));
            //dropsDig.AddDrop(1, typeof(MonsterBeetle));
            //dropsDig.AddDrop(1, typeof(MonsterLynel));
        }
Пример #28
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Пример #29
0
        private void GenerateNewShipModel(DropManager dropManager)
        {
            if (StartModel == null)
            {
                SetStartModel(nebulaObject.Tag((byte)PlayerTags.Model) as Hashtable);
            }

            ShipModule prevModule = null;
            var        character  = GetComponent <CharacterObject>();

            Hashtable model = new Hashtable();

            foreach (DictionaryEntry entry in StartModel)
            {
                log.InfoFormat("start model {0} = {1}", entry.Key, entry.Value);
                model.Add(int.Parse(entry.Key.ToString()), entry.Value);
            }

            log.InfoFormat("Module: {0}", (string)model[(int)ShipModelSlotType.CB]);
            ModuleDropper.ModuleDropParams dpCB = new ModuleDropper.ModuleDropParams(nebulaObject.world.Resource(), (string)model[(int)ShipModelSlotType.CB],
                                                                                     character.level, Difficulty.none, this.GenerateStartModuleCraftMaterials(), ObjectColor.white, string.Empty);
            var module = dropManager.GetModuleDropper(dpCB).Drop() as ShipModule;

            SetModule(module, out prevModule);
            log.InfoFormat("Generate module with skill = {0}", module.Skill);

            log.InfoFormat("Module: {0}", (string)model[(int)ShipModelSlotType.CM]);
            ModuleDropper.ModuleDropParams dpCM = new ModuleDropper.ModuleDropParams(nebulaObject.world.Resource(), (string)model[(int)ShipModelSlotType.CM],
                                                                                     character.level, Difficulty.none, this.GenerateStartModuleCraftMaterials(), ObjectColor.white, string.Empty);
            module = dropManager.GetModuleDropper(dpCM).Drop() as ShipModule;
            SetModule(module, out prevModule);
            log.InfoFormat("Generate module with skill = {0}", module.Skill);

            log.InfoFormat("Module: {0}", (string)model[(int)ShipModelSlotType.DF]);
            ModuleDropper.ModuleDropParams dpDF = new ModuleDropper.ModuleDropParams(nebulaObject.world.Resource(), (string)model[(int)ShipModelSlotType.DF],
                                                                                     character.level, Difficulty.none, this.GenerateStartModuleCraftMaterials(), ObjectColor.white, string.Empty);
            module = dropManager.GetModuleDropper(dpDF).Drop() as ShipModule;
            SetModule(module, out prevModule);
            log.InfoFormat("Generate module with skill = {0}", module.Skill);

            log.InfoFormat("Module: {0}", (string)model[(int)ShipModelSlotType.DM]);
            ModuleDropper.ModuleDropParams dpDM = new ModuleDropper.ModuleDropParams(nebulaObject.world.Resource(), (string)model[(int)ShipModelSlotType.DM],
                                                                                     character.level, Difficulty.none, this.GenerateStartModuleCraftMaterials(), ObjectColor.white, string.Empty);
            module = dropManager.GetModuleDropper(dpDM).Drop() as ShipModule;
            SetModule(module, out prevModule);
            log.InfoFormat("Generate module with skill = {0}", module.Skill);

            log.InfoFormat("Module: {0}", (string)model[(int)ShipModelSlotType.ES]);
            ModuleDropper.ModuleDropParams dpES = new ModuleDropper.ModuleDropParams(nebulaObject.world.Resource(), (string)model[(int)ShipModelSlotType.ES],
                                                                                     character.level, Difficulty.none, this.GenerateStartModuleCraftMaterials(), ObjectColor.white, string.Empty);
            module = dropManager.GetModuleDropper(dpES).Drop() as ShipModule;
            SetModule(module, out prevModule);
            log.InfoFormat("Generate module with skill = {0}", module.Skill);
        }
Пример #30
0
    void Awake()
    {
        anim = GetComponent<Animator>();
        enemyAudio = GetComponent<AudioSource>();
        hitParticles = GetComponentInChildren<ParticleSystem>();
        capsuleCollider = GetComponent<CapsuleCollider>();
        killExperience = GetComponent<KillExperience>();
        dropManager = FindObjectOfType<DropManager>();

        currentHealth = startingHealth;
    }
Пример #31
0
    public virtual void Die()
    {
        //print (this + " died");
        playerXP.GetComponent <PlayerXP>().addXP(xp);
        GameObject instance = Instantiate(deathEmitter, transform.position, Quaternion.identity) as GameObject;

        instance.GetComponent <Renderer>().material = gameObject.GetComponent <Renderer> ().material;

        Destroy(instance, 1.5f);
        DropManager.MakeDrop(transform.position, xp, false);
        Destroy(gameObject);
    }
Пример #32
0
    // Use this for initialization
    void Start()
    {
        DropManager = GameObject.Find( "DropManager" ).GetComponent<DropManager>();

        Rigidbody2D = this.GetComponent<Rigidbody2D>();

        LinkLightEffect = transform.FindChild( "LinkLightEffect" ).gameObject.GetComponent<ParticleSystem>();
        LinkLightEffect.Stop();

        SpriteRenderer = this.gameObject.GetComponent<SpriteRenderer>();

        dropType = RandDropType();

        SpriteRenderer.sprite = sprites[(int)dropType];

        time_IsTouched = Time.time;
    }
Пример #33
0
 private void Awake()
 {
     instance = this;
 }
Пример #34
0
 void Awake()
 {
     Instance = this;
 }
Пример #35
0
    public void Drop(DropManager.TYPEOFDROP t)
    {
        drop = new DropManager(this, t);
        drop.setupDrop();
        timeOnDrop = 0;
        onGroundFired = false;

        Game.OnDrop();
    }