Exemple #1
0
        public void setSmoke()
        {
            if (this.count <= 5)
            {
                this.count = 5;
            }
            this._listPS  = new List <ParticleSystem>();
            this._listPos = new List <Vector3>();
            for (int i = 0; i < this.count; i++)
            {
                this._listPS.Add(this.Instantiate());
            }
            Vector3 position = base.get_transform().get_position();
            float   fMin     = this.randMinPos.x + (this.randMaxPos.x - this.randMinPos.x) * 0.8f;
            float   fMin2    = this.randMinPos.x + (this.randMaxPos.x - this.randMinPos.x) * 0.5f;
            float   fMin3    = this.randMinPos.y + (this.randMaxPos.y - this.randMinPos.y) * 0.8f;
            float   fMin4    = this.randMinPos.y + (this.randMaxPos.y - this.randMinPos.y) * 0.5f;

            this._listPos.Add(new Vector3(position.x, position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z + this.randMaxPos.z));
            this._listPos.Add(new Vector3(position.x + XorRandom.GetFLim(fMin, this.randMaxPos.x), position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z + XorRandom.GetFLim(fMin4, this.randMaxPos.y)));
            this._listPos.Add(new Vector3(position.x - XorRandom.GetFLim(fMin, this.randMaxPos.x), position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z + XorRandom.GetFLim(fMin4, this.randMaxPos.y)));
            this._listPos.Add(new Vector3(position.x + XorRandom.GetFLim(fMin2, this.randMaxPos.x), position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z - XorRandom.GetFLim(fMin3, this.randMaxPos.y)));
            this._listPos.Add(new Vector3(position.x - XorRandom.GetFLim(fMin2, this.randMaxPos.x), position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z - XorRandom.GetFLim(fMin3, this.randMaxPos.y)));
            float[] array  = new float[2];
            float[] array2 = new float[2];
            for (int j = 0; j < this.count - 5; j++)
            {
                array[0]  = XorRandom.GetFLim(this.randMinPos.x, this.randMaxPos.x);
                array[1]  = XorRandom.GetFLim(this.randMaxPos.x * -1f, this.randMinPos.x * -1f);
                array2[0] = XorRandom.GetFLim(this.randMinPos.z, this.randMaxPos.z);
                array2[1] = XorRandom.GetFLim(this.randMaxPos.z * -1f, this.randMinPos.z * -1f);
                this._listPos.Add(new Vector3(position.x + array[XorRandom.GetILim(0, 1)], position.y + XorRandom.GetFLim(this.randMinPos.y, this.randMaxPos.y), position.z + array2[XorRandom.GetILim(0, 1)]));
            }
        }
Exemple #2
0
        public void setSmoke()
        {
            if (count <= 5)
            {
                count = 5;
            }
            _listPS  = new List <ParticleSystem>();
            _listPos = new List <Vector3>();
            for (int i = 0; i < count; i++)
            {
                _listPS.Add(Instantiate());
            }
            Vector3 position = base.transform.position;
            float   fMin     = randMinPos.x + (randMaxPos.x - randMinPos.x) * 0.8f;
            float   fMin2    = randMinPos.x + (randMaxPos.x - randMinPos.x) * 0.5f;
            float   fMin3    = randMinPos.y + (randMaxPos.y - randMinPos.y) * 0.8f;
            float   fMin4    = randMinPos.y + (randMaxPos.y - randMinPos.y) * 0.5f;

            _listPos.Add(new Vector3(position.x, position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z + randMaxPos.z));
            _listPos.Add(new Vector3(position.x + XorRandom.GetFLim(fMin, randMaxPos.x), position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z + XorRandom.GetFLim(fMin4, randMaxPos.y)));
            _listPos.Add(new Vector3(position.x - XorRandom.GetFLim(fMin, randMaxPos.x), position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z + XorRandom.GetFLim(fMin4, randMaxPos.y)));
            _listPos.Add(new Vector3(position.x + XorRandom.GetFLim(fMin2, randMaxPos.x), position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z - XorRandom.GetFLim(fMin3, randMaxPos.y)));
            _listPos.Add(new Vector3(position.x - XorRandom.GetFLim(fMin2, randMaxPos.x), position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z - XorRandom.GetFLim(fMin3, randMaxPos.y)));
            float[] array  = new float[2];
            float[] array2 = new float[2];
            for (int j = 0; j < count - 5; j++)
            {
                array[0]  = XorRandom.GetFLim(randMinPos.x, randMaxPos.x);
                array[1]  = XorRandom.GetFLim(randMaxPos.x * -1f, randMinPos.x * -1f);
                array2[0] = XorRandom.GetFLim(randMinPos.z, randMaxPos.z);
                array2[1] = XorRandom.GetFLim(randMaxPos.z * -1f, randMinPos.z * -1f);
                _listPos.Add(new Vector3(position.x + array[XorRandom.GetILim(0, 1)], position.y + XorRandom.GetFLim(randMinPos.y, randMaxPos.y), position.z + array2[XorRandom.GetILim(0, 1)]));
            }
        }
Exemple #3
0
        private ShipModel GetTargetShip(DeckModel model)
        {
            List <ShipModel> list = (from x in model.GetShips()
                                     where !x.IsEscaped()
                                     select x).ToList();

            return(list[XorRandom.GetILim(0, list.Count - 1)]);
        }
Exemple #4
0
 private void CalcOneAttackDamage()
 {
     for (int i = 0; i < oneAttackDamage.Length - 1; i++)
     {
         oneAttackDamage[i] = XorRandom.GetILim(0, (int)((float)_nHPDifFmNow2End * 0.5f));
         _nHPDifFmNow2End  -= oneAttackDamage[i];
     }
     oneAttackDamage[oneAttackDamage.Length - 1] = _nHPDifFmNow2End;
 }
Exemple #5
0
 private void CalcOneAttackDamage()
 {
     for (int i = 0; i < this.oneAttackDamage.Length - 1; i++)
     {
         this.oneAttackDamage[i] = XorRandom.GetILim(0, (int)((float)this._nHPDifFmNow2End * 0.5f));
         this._nHPDifFmNow2End  -= this.oneAttackDamage[i];
     }
     this.oneAttackDamage[this.oneAttackDamage.Length - 1] = this._nHPDifFmNow2End;
 }
Exemple #6
0
        protected void ProcessEachIconConsumingAnimation(GameObject iconObj)
        {
            Animation component = iconObj.GetComponent <Animation>();

            component.Play("SupplyIconEnd");
            UISprite component2 = ((Component)iconObj.transform.FindChild("IconObject/Icon")).GetComponent <UISprite>();

            GameObjectExtensionMethods.RotatoTo(rot: (new Vector3[2]
            {
                new Vector3(0f, 0f, XorRandom.GetILim(180, 270)),
                new Vector3(0f, 0f, XorRandom.GetILim(-270, -180))
            })[XorRandom.GetILim(0, 1)], obj: component2.transform.gameObject, time: 1f, callback: null);
        }
        protected void ProcessEachIconConsumingAnimation(GameObject iconObj)
        {
            Animation component = iconObj.GetComponent <Animation>();

            component.Play("SupplyIconEnd");
            UISprite component2 = iconObj.get_transform().FindChild("IconObject/Icon").GetComponent <UISprite>();

            Vector3[] array = new Vector3[]
            {
                new Vector3(0f, 0f, (float)XorRandom.GetILim(180, 270)),
                new Vector3(0f, 0f, (float)XorRandom.GetILim(-270, -180))
            };
            component2.get_transform().get_gameObject().RotatoTo(array[XorRandom.GetILim(0, 1)], 1f, null);
        }
Exemple #8
0
        private void animationFinished()
        {
            _anim.Stop();
            int iLim = XorRandom.GetILim(1, 2);

            if (iLim == 1)
            {
                _anim.Play("AlbumChara_In1");
            }
            else
            {
                _anim.Play("AlbumChara_In2");
            }
        }
Exemple #9
0
        private void compWaitAnimation()
        {
            int iLim = XorRandom.GetILim(1, 100);

            _anim.Stop();
            if (iLim >= 75)
            {
                _anim.Play("AlbumChara_Wait3");
            }
            else
            {
                _anim.Play("AlbumChara_Wait2");
            }
        }
        private void compWaitAnimation()
        {
            int iLim = XorRandom.GetILim(1, 100);

            _anim.Stop();
            if (iLim >= 75)
            {
                _anim.Play("miniCharacter_wait1");
            }
            else
            {
                _anim.Play("miniCharacter_wait2");
            }
        }
        private void _createExplosion()
        {
            _listBombCritical = new List <bool>();
            _listExplosion    = new List <ParticleSystem>();
            _listMiss         = new List <ParticleSystem>();
            Vector3 position5 = default(Vector3);

            for (int i = 0; i < _defenders.Count; i++)
            {
                DamageModel attackDamage = _clsShelling.GetAttackDamage(_defenders[i].TmpId);
                int         key          = (!attackDamage.GetProtectEffect()) ? _defenders[i].Index : _defenders[i].Index;
                if (attackDamage.GetHitState() != 0)
                {
                    _isAttack = true;
                    ParticleSystem val = (!((UnityEngine.Object)BattleTaskManager.GetParticleFile().explosionAerial == null)) ? UnityEngine.Object.Instantiate <ParticleSystem>(BattleTaskManager.GetParticleFile().explosionAerial) : BattleTaskManager.GetParticleFile().explosionAerial;
                    ((Component)val).SetActive(isActive: true);
                    ((Component)val).transform.parent = BattleTaskManager.GetBattleField().transform;
                    Transform transform = ((Component)val).transform;
                    Vector3   position  = _eBattleship[key].transform.position;
                    float     x         = position.x;
                    Vector3   position2 = _eBattleship[key].transform.position;
                    transform.position = new Vector3(x, 3f, position2.z);
                    _listExplosion.Add(val);
                    _listBombCritical.Add((attackDamage.GetHitState() == BattleHitStatus.Clitical) ? true : false);
                }
                else
                {
                    int       iLim  = XorRandom.GetILim(0, 2);
                    Vector3[] array = new Vector3[3]
                    {
                        new Vector3(5f, 0f, -5f),
                        new Vector3(-3f, 0f, 5f),
                        new Vector3(4f, 0f, -7f)
                    };
                    Vector3 position3 = _eBattleship[key].transform.position;
                    float   x2        = position3.x + array[iLim].x;
                    Vector3 position4 = _eBattleship[key].transform.position;
                    position5 = new Vector3(x2, 0f, position4.z + array[iLim].z);
                    ParticleSystem val2 = (!((UnityEngine.Object)BattleTaskManager.GetParticleFile().splashMiss == null)) ? UnityEngine.Object.Instantiate <ParticleSystem>(BattleTaskManager.GetParticleFile().splashMiss) : BattleTaskManager.GetParticleFile().splashMiss;
                    ((Component)val2).SetActive(isActive: true);
                    ((Component)val2).transform.parent   = BattleTaskManager.GetBattleField().transform;
                    ((Component)val2).transform.position = position5;
                    val2.Stop();
                    _listMiss.Add(val2);
                }
            }
        }
Exemple #12
0
        private void onMiniCharacterEL()
        {
            if (!this.isControl)
            {
                return;
            }
            this.isControl = false;
            this._anim.Stop();
            int iLim = XorRandom.GetILim(1, 100);

            if (iLim >= 85)
            {
                int iLim2 = XorRandom.GetILim(1, 5);
                if (iLim >= 3)
                {
                    this._anim.Play("AlbumChara_Up1");
                }
                else
                {
                    this._anim.Play("AlbumChara_Up2");
                }
            }
            else
            {
                int iLim3 = XorRandom.GetILim(1, 100);
                if (iLim >= 50)
                {
                    this._anim.Play("AlbumChara_Normal1");
                }
                else if (iLim >= 20)
                {
                    this._anim.Play("AlbumChara_Normal2");
                }
                else
                {
                    this._anim.Play("AlbumChara_Normal3");
                }
            }
        }
 private void _createExplosion()
 {
     this._listBombCritical = new List <bool>();
     this._listExplosion    = new List <ParticleSystem>();
     this._listMiss         = new List <ParticleSystem>();
     for (int i = 0; i < this._defenders.get_Count(); i++)
     {
         DamageModel attackDamage = this._clsShelling.GetAttackDamage(this._defenders.get_Item(i).TmpId);
         int         num          = (!attackDamage.GetProtectEffect()) ? this._defenders.get_Item(i).Index : this._defenders.get_Item(i).Index;
         if (attackDamage.GetHitState() != BattleHitStatus.Miss)
         {
             this._isAttack = true;
             ParticleSystem particleSystem = (!(BattleTaskManager.GetParticleFile().explosionAerial == null)) ? Object.Instantiate <ParticleSystem>(BattleTaskManager.GetParticleFile().explosionAerial) : BattleTaskManager.GetParticleFile().explosionAerial;
             particleSystem.SetActive(true);
             particleSystem.get_transform().set_parent(BattleTaskManager.GetBattleField().get_transform());
             particleSystem.get_transform().set_position(new Vector3(this._eBattleship.get_Item(num).get_transform().get_position().x, 3f, this._eBattleship.get_Item(num).get_transform().get_position().z));
             this._listExplosion.Add(particleSystem);
             this._listBombCritical.Add(attackDamage.GetHitState() == BattleHitStatus.Clitical);
         }
         else
         {
             int       iLim  = XorRandom.GetILim(0, 2);
             Vector3[] array = new Vector3[]
             {
                 new Vector3(5f, 0f, -5f),
                 new Vector3(-3f, 0f, 5f),
                 new Vector3(4f, 0f, -7f)
             };
             Vector3        position        = new Vector3(this._eBattleship.get_Item(num).get_transform().get_position().x + array[iLim].x, 0f, this._eBattleship.get_Item(num).get_transform().get_position().z + array[iLim].z);
             ParticleSystem particleSystem2 = (!(BattleTaskManager.GetParticleFile().splashMiss == null)) ? Object.Instantiate <ParticleSystem>(BattleTaskManager.GetParticleFile().splashMiss) : BattleTaskManager.GetParticleFile().splashMiss;
             particleSystem2.SetActive(true);
             particleSystem2.get_transform().set_parent(BattleTaskManager.GetBattleField().get_transform());
             particleSystem2.get_transform().set_position(position);
             particleSystem2.Stop();
             this._listMiss.Add(particleSystem2);
         }
     }
 }
Exemple #14
0
        public void StopRoll(Power iPower)
        {
            SoundUtils.PlaySE(SEFIleInfos.SE_031);
            switch (iPower)
            {
            case Power.Low:
                _uiBase.transform.LTRotateAroundLocal(Vector3.back, targetCompassPoint - nowCompassPoint + (float)(360 * XorRandom.GetILim(2, 3)) - 90f, 2f).setEase(LeanTweenType.easeOutQuad).setOnComplete((Action) delegate
                {
                    Dlg.Call(ref _actOnStopCompass);
                });
                break;

            case Power.High:
                _uiBase.transform.LTRotateAroundLocal(Vector3.back, targetCompassPoint - nowCompassPoint + (float)(360 * XorRandom.GetILim(3, 4)) - 90f, 2f).setEase(LeanTweenType.easeOutElastic).setOnComplete((Action) delegate
                {
                    Dlg.Call(ref _actOnStopCompass);
                });
                break;
            }
        }
Exemple #15
0
 public void StopRoll(UICompass.Power iPower)
 {
     SoundUtils.PlaySE(SEFIleInfos.SE_031);
     if (iPower != UICompass.Power.Low)
     {
         if (iPower == UICompass.Power.High)
         {
             this._uiBase.get_transform().LTRotateAroundLocal(Vector3.get_back(), this.targetCompassPoint - this.nowCompassPoint + (float)(360 * XorRandom.GetILim(3, 4)) - 90f, 2f).setEase(LeanTweenType.easeOutElastic).setOnComplete(delegate
             {
                 Dlg.Call(ref this._actOnStopCompass);
             });
         }
     }
     else
     {
         this._uiBase.get_transform().LTRotateAroundLocal(Vector3.get_back(), this.targetCompassPoint - this.nowCompassPoint + (float)(360 * XorRandom.GetILim(2, 3)) - 90f, 2f).setEase(LeanTweenType.easeOutQuad).setOnComplete(delegate
         {
             Dlg.Call(ref this._actOnStopCompass);
         });
     }
 }
Exemple #16
0
 public static void PlaySupportingFireVoice(ShipModel_Battle model)
 {
     PlayShipVoice(model, XorRandom.GetILim(16, 18));
 }
        private void LoadedNormalData()
        {
            SingletonMonoBehaviour <SoundManager> .Instance.PlayVoice(Resources.Load("Sounds/Voice/kc9999/" + string.Format("{0:D2}", XorRandom.GetILim(206, 211))) as AudioClip, 0);

            DebugUtils.SLog("戦略マップへ進みます。");
            SingletonMonoBehaviour <AppInformation> .Instance.NextLoadType  = AppInformation.LoadType.Ship;
            SingletonMonoBehaviour <AppInformation> .Instance.NextLoadScene = Generics.Scene.Strategy;
            Application.LoadLevel(Generics.Scene.LoadingScene.ToString());
        }
 private void OnStartupAllFinished()
 {
     SingletonMonoBehaviour <FadeCamera> .Instance.FadeOut(1f, delegate
     {
         StartupTaskManager.GetStartupHeader().transform.localScaleZero();
         StartupData data = StartupTaskManager.GetData();
         App.CreateSaveDataNInitialize(data.AdmiralName, data.PartnerShipID, data.Difficlty, data.isInherit);
         SingletonMonoBehaviour <SoundManager> .Instance.PlayVoice(Resources.Load("Sounds/Voice/kc9999/" + $"{XorRandom.GetILim(206, 211):D2}") as AudioClip, 0);
         GameObject.Find("BG Panel").transform.localScale                = Vector3.zero;
         GameObject.Find("StartupTaskManager").transform.localScale      = Vector3.zero;
         SingletonMonoBehaviour <AppInformation> .Instance.NextLoadType  = AppInformation.LoadType.Ship;
         SingletonMonoBehaviour <AppInformation> .Instance.NextLoadScene = Generics.Scene.Strategy;
         SingletonMonoBehaviour <FadeCamera> .Instance.isDrawNowLoading  = false;
         Application.LoadLevel(Generics.Scene.LoadingScene.ToString());
     });
 }