Exemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
            Upgradeable player = other.GetComponent <Upgradeable>();

            switch (effect)
            {
            case effects.mainGunUpgrade:
                player.MainGunUpgrade();
                break;

            case effects.auxillaryGunUprade:
                player.AuxillaryGunUpgrade();
                break;

            case effects.barrageUpgrade:
                player.BarrageUpgrade();
                break;

            case effects.heal:
                player.Heal();
                break;

            default:
                break;
            }

            Destroy(gameObject);
        }
    }
Exemplo n.º 2
0
    private void Start()
    {
        spawnMaster              = GetComponent <SpawnerMaster>();
        spawnMaster.OnWaveEnd   += OnWaveEnd;
        spawnMaster.OnWaveStart += OnWaveStart;

        unit = GameObject.FindGameObjectWithTag("Player").GetComponent <Upgradeable>();
    }
Exemplo n.º 3
0
    public void Subscribe(Upgradeable upgradeable)
    {
        clients.Add(upgradeable);

        foreach (var record in records)
        {
            upgradeable.RecordAdded(record);
        }
    }
Exemplo n.º 4
0
 public static bool SkillExpPatch_SkillData2(ref Upgradeable __instance, int count)
 {
     if (__instance is SkillData)
     {
         if (__instance.Level > 9 && __instance.MaxLevel < skillMaxLevel.Value)
         {
             __instance.MaxLevel = skillMaxLevel.Value;
         }
     }
     return(true);
 }
Exemplo n.º 5
0
    // Start is called before the first frame update
    void Start()
    {
        if (GameOverScreen)
        {
            return;
        }

        _playerAttack = FindObjectOfType <PlayerAttack>();
        _upgradeable  = Upgradeable.GetComponent <Upgradeable>();
        // SpriteImage.sprite = _upgradeable.GetSprite();
        _playerWallet = Player.GetComponent <PlayerWallet>();
        _fadeToBlack  = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <Animator>();
    }
Exemplo n.º 6
0
    public void btn_continue()
    {
        Upgradeable unit = GameObject.FindGameObjectWithTag("Player").GetComponent <Upgradeable>();

        // PlayerPrefs.SetFloat(Utility.key_PlayerHealth, unit.GetPlayerHealth());
        PlayerPrefs.SetInt(Utility.key_MainGunlevel, unit.GetMainGunCurrentLevel());
        PlayerPrefs.SetInt(Utility.key_AuxillaryGunLevel, unit.GetAuxillaryGunCurrentLevel());
        PlayerPrefs.SetInt(Utility.key_Barragelevel, unit.GetBarrageCurrentLevel());
        PlayerPrefs.SetInt(Utility.key_CurrentLevel, PlayerPrefs.GetInt(Utility.key_CurrentLevel, 1) + 1);
        PlayerPrefs.SetInt(Utility.key_RetryCount, 0);
        PlayerPrefs.Save();

        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }
Exemplo n.º 7
0
 public static bool ExpPatch2(ref Upgradeable __instance, ref int count)
 {
     if (__instance.GetType() == typeof(Character))
     {
         Character c = __instance as Character;
         if (fixNpcExpWaste.Value && c.SkillTree.CurrentSkillTree == null)
         {
             // 没有修炼秘籍,加回全部经验
             count = (int)(count / (1.0f - Game.PlayData.SkillExpDistributionRate));
         }
         cacheCharacterLevel = c.Level;
     }
     return(true);    // 继续执行提升等级
 }
Exemplo n.º 8
0
            public SendShipUpgradeableTask(Ship ship, Upgradeable destination, int amount)
            {
                var destination_levels = Definitions.UpgrDef.Items.Item.First(n => n.DefId == destination.DefId).Levels
                                         .Level.FirstOrDefault(n => n.Id == destination.Level);

                this.Time = (uint)TimeUtils.GetEpochTime();
                this.CustomObjects.Add("inst_id", ship.InstId);
                this.CustomObjects.Add("dest_id", destination.DefId);
                this.CustomObjects.Add("dest_amount", destination_levels.Amount);
                this.CustomObjects.Add(
                    "dest_material_koef",
                    destination_levels.MaterialKoef != 0 ? destination_levels.MaterialKoef : 1);
                this.CustomObjects.Add("dest_sailors", destination_levels.Sailors);
                this.CustomObjects.Add("amount", amount == 0 ? ship.Capacity() : amount);
                this.CustomObjects.Add("player_level", Core.GlobalData.Level);
            }
Exemplo n.º 9
0
        public void BeforeTest()
        {
            UnitTestUtils.LoadOfflineData();
            mTestModel = new ViewModel();

            UpgradeData testUpgradeData = new UpgradeData();

            testUpgradeData.MaxLevel           = 50;
            testUpgradeData.PropertyName       = "Level";
            testUpgradeData.ResourcesToUpgrade = new Dictionary <string, int>()
            {
                { "Gold", 1000 }
            };

            mUpgrade = new Upgradeable();
            mUpgrade.SetPropertyToUpgrade(mTestModel, testUpgradeData);
        }
Exemplo n.º 10
0
 public static void ExpPatch3(ref Upgradeable __instance, ref int count)
 {
     if (__instance.GetType() == typeof(Character))
     {
         Character c = __instance as Character;
         if (c.Level != cacheCharacterLevel && (fixInTeamExp.Value || !Game.Teammates.Contains(c.Id)))
         {
             // 队伍没有,或者在队成长开启
             int            num3           = c.Level - cacheCharacterLevel;
             NpcGrowingItem npcGrowingItem = Game.Data.Get <NpcGrowingItem>(c.Id);
             if (npcGrowingItem != null)
             {
                 int num4 = (Game.PlayData.Difficulty == GameDifficulty.Master) ? 2 : 1;
                 foreach (KeyValuePair <CharacterProperty, int> keyValuePair in npcGrowingItem.Property)
                 {
                     if (keyValuePair.Value > 0)
                     {
                         c.AddProperty(keyValuePair.Key, keyValuePair.Value * num3 * num4, false);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 11
0
 public void Unsubscribe(Upgradeable upgradeable)
 {
     clients.Remove(upgradeable);
 }