Пример #1
0
    private void Setup()
    {
        sysScr   = GetComponent <SystemScript>();
        gridPos  = sysScr.GridPos;
        playerID = gridPos.Z;

        ship    = LevelManager.Instance.Ships[playerID].GetComponent <ShipScript>();
        pwrMngr = ship.GetComponent <ShipPowerMngr>();

        hScr = sysScr.GetOriginObj().GetComponent <HealthScript>();

        pwrMngr.PowerSetup(systemType, powerReq);


        originMedBayScr = GetOriginMedBay();
        if (this == originMedBayScr)
        {
            isOrigin = true;
        }

        //originEngScr.fullPwrReq += powerReq;

        if (isOrigin)
        {
            pwrMngr.AddToSysScrList(systemType, sysScr);

            StartCoroutine(HealRoutine());
        }
    }
Пример #2
0
    private void Setup()
    {
        sysScr   = GetComponent <SystemScript>();
        gridPos  = sysScr.GridPos;
        playerID = gridPos.Z;

        ship    = LevelManager.Instance.Ships[playerID].GetComponent <ShipScript>();
        pwrMngr = ship.GetComponent <ShipPowerMngr>();

        hScr = sysScr.GetOriginObj().GetComponent <HealthScript>();

        //ship.IncreaseEvasionChance (componentCapacity);

        pwrMngr.PowerSetup(systemType, powerReq);

        originTeleporterScr = GetOriginTelScr();
        if (this == originTeleporterScr)
        {
            isOrigin = true;
        }

        originTeleporterScr.fullPwrReq += powerReq;

        if (isOrigin)
        {
            pwrMngr.AddToSysScrList(systemType, sysScr);
        }

        RoomScript _room = transform.parent.parent.GetChild(0).GetChild(0).GetComponent <RoomScript>();

        room = _room.GetOriginObj().GetComponent <RoomScript>();
    }
Пример #3
0
    private void RpcSyncPowerstate(Vector3 _pos, bool _isPowered)
    {
        Point      _point = VectorToPoint(_pos);
        TileScript _tile  = LevelManager.Instance.Tiles [_point];

        SystemScript _sysScr = _tile.GetSystem();

        _sysScr.ReceivePowerUpdate(_isPowered);


        /*
         * //weapons
         * if (_type == 1) {
         *      //WeaponScript _weapon = LevelManager.Instance.Tiles [_point].transform.GetChild (0).GetComponent <WeaponScript> ();
         *      WeaponScript _weapon = _tile.transform.GetChild (0).GetComponent <WeaponScript> ();
         *      //should perhaps be done by function
         *      //_weapon.IsPowered = _isPowered;
         *      _weapon.FirePower (_isPowered);
         *
         * //engines and other systems? //-> interface!
         * } else if (_type == 2) {
         *      EngineScript _engine = _tile.transform.GetChild (1).GetChild (0).GetComponent <EngineScript> ();
         *      _engine.SyncedPower (_isPowered);
         * }
         */
    }
Пример #4
0
 public void AddToSysScrList(int _sysType, SystemScript _sysScr)
 {
     if (_sysType == 0)
     {
         //Debug.Log("reactor added to list");
         reactorList.Add(_sysScr);
     }
     else if (_sysType == 1)
     {
         shieldList.Add(_sysScr);
     }
     else if (_sysType == 2)
     {
         weaponSysList.Add(_sysScr);
     }
     else if (_sysType == 3)
     {
         engineList.Add(_sysScr);
     }
     else if (_sysType == 4)
     {
         medbayList.Add(_sysScr);
     }
     else if (_sysType == 5)
     {
         teleporterList.Add(_sysScr);
     }
 }
Пример #5
0
//	public void UnloadAssets () {
//		Resources.UnloadUnusedAssets ();
//	}

    public void ShowDetail()
    {
//		int id = SelectingCard.ID;
//		CardData cd = DataManager.Instance.box.Find (x => x.ID == id);
        CardParam cp = GetBoxCardParam(SelectingCard.ID);

        detailScript.Show(cp);
        if (cp.Count >= SystemScript.needPoint(cp))
        {
            //強化可能
            boxObjs.LevelUpText.text = "<color=#00ff00>レベルアップ</color>";
        }
        else
        {
            //強化不可
            boxObjs.LevelUpText.text = "<color=#cccccc>レベルアップ</color>";
        }
        boxObjs.LevelUpText.text += string.Format("\n<size=18>{0}/{1}</size>", cp.Count, SystemScript.needPoint(cp));

        //無効化
        if (!DataManager.Instance.LVSystem)
        {
            boxObjs.LevelUpText.text = "";
        }
    }
Пример #6
0
 //to all
 public void ReceivePowerUpdate(bool _isPowered)
 {
     if (isOrigin)
     {
         if (isPowered)
         {
             SystemScript _sysScr = sysScr.GetOriginObj().GetComponent <SystemScript> ();
             _sysScr.UpdatePowerState(false);
         }
         else
         {
             if (!hScr.IsFullyDamaged)
             {
                 if (pwrMngr.EnoughPower(fullPwrReq))
                 {
                     //try power up
                     SystemScript _sysScr = sysScr.GetOriginObj().GetComponent <SystemScript> ();
                     _sysScr.UpdatePowerState(true);
                 }
                 else
                 {
                     Debug.LogError("not enough power");
                 }
             }
         }
     }
     else
     {
         weaponSysScr.ReceivePowerUpdate(_isPowered);
     }
 }
Пример #7
0
    /// <summary>
    /// マッチング成功時
    /// </summary>
    void OnMatched()
    {
        //データ送信
        if (alert != null)
        {
            alert.OpenClose(false);
        }
        Reconnectend = false;
        int    uid   = DataManager.Instance.uid;
        string uname = DataManager.Instance.PlayerName;

        roomName = PhotonNetwork.room.Name;
        if (PhotonNetwork.isMasterClient)
        {
            Initiative = Random.Range(0, 2);            //0だったらマスタークライアントが先攻
            Seed       = Random.Range(0, 999999999);
            PhotonNetwork.room.IsOpen = false;
        }
        myDeck = SystemScript.ShuffleCP(SystemScript.cdTocp(DataManager.Deck.GetDeckData()));
        string deckjson = JsonMapper.ToJson(myDeck);

        photonView.RPC("RPC_StartDatas", PhotonTargets.OthersBuffered, uid, uname, Initiative, Seed, deckjson);

        //対戦できるかチェック
        CanBattle();
    }
Пример #8
0
    //to all
    public void ReceivePowerUpdate(bool _isPowered)
    {
        if (isOrigin)
        {
            if (isPowered)
            {
                //tryPowerDown
                if (pwrMngr.EnoughPower(fullCapacity))
                {
                    //Debug.Log ("canPowerDown");
                    SystemScript _sysScr = sysScr.GetOriginObj().GetComponent <SystemScript> ();
                    _sysScr.UpdatePowerState(false);                      //(_isPowered);
                }
                else
                {
                    //shut down random system & call ReceivePowerUpdate again

                    //Debug.LogError ("cant shut down! initiating emergency shutdown");
                    ShutDownRandomSystem(_isPowered);
                }
            }
            else
            {
                if (!hScr.IsFullyDamaged)
                {
                    SystemScript _sysScr = sysScr.GetOriginObj().GetComponent <SystemScript> ();
                    _sysScr.UpdatePowerState(true);                      //(_isPowered);
                }
            }
        }
        else
        {
            originReactorScr.ReceivePowerUpdate(_isPowered);
        }
    }
Пример #9
0
    //private SystemScript systemScr;



    void Start()
    {
        sysScr  = gameObject.GetComponent <SystemScript> ();
        gridPos = sysScr.GridPos;

        GameObject _ship = transform.parent.parent.parent.parent.gameObject;

        pwrMngr          = _ship.GetComponent <ShipPowerMngr> ();
        hScr             = gameObject.GetComponent <HealthScript> ();
        originReactorScr = GetOriginReactor();

        originReactorScr.fullCapacity += componentCapacity;
        if (this == originReactorScr)
        {
            isOrigin = true;
        }

        //ReactorSetup ();

        //if !inEditor
        if (CasheScript.Instance.GameMode != 0)
        {
            pwrMngr.PowerSetup(systemType, componentCapacity);

            if (isOrigin)
            {
                pwrMngr.AddToSysScrList(systemType, sysScr);
            }
        }
    }
Пример #10
0
    public void PlaceObj(int _index, Point _gridPos, GameObject _originObj)
    {
        originObj = _originObj;
        originSys = originObj.GetComponent <SystemScript> ();

        if (originObj == gameObject)
        {
            isOrigin        = true;
            pwrIndicatorSpr = powerIndicator.GetComponent <SpriteRenderer> ();
        }

        if (this.gameObject == originObj)
        {
            //string _string = (objStr + ",1," + gridPos.X.ToString () + "," + gridPos.Y.ToString ());
            saveStr = (objStr + ",1," + _gridPos.X.ToString() + "," + _gridPos.Y.ToString());
            LevelManager.Instance.parameterList.Add(saveStr);
        }

        //gridPos = _gridPos;
        gridPos = new Point(_gridPos.X + Mathf.RoundToInt(nextPos.x * 2), _gridPos.Y + Mathf.RoundToInt(nextPos.y), _gridPos.Z);


        subSysSlot.SetActive(hasSubSysSlot);


        tile = LevelManager.Instance.Tiles [gridPos];
        hScr = gameObject.GetComponent <HealthScript> ();


        transform.position = tile.transform.position;
        //Quaternion.identity = tile.Quaternion.identity;

        transform.SetParent(tile.transform.GetChild(1));

        //Debug.Log ("yaya");

        DoBool();

        GameManager.Instance.Buy();

        //subSysSlot.SetActive (hasSubSysSlot);

        if (!last)
        {
            //creates next component of obj

            //combinig nextPos with point to get the true next gridPos
            //Point _point = new Point (_gridPos.X + Mathf.RoundToInt (nextPos.x * 2), _gridPos.Y + Mathf.RoundToInt (nextPos.y), _gridPos.Z);
            //TileScript _tile = LevelManager.Instance.Tiles [_point];

            thisNextObj = (GameObject)Instantiate(nextObj);
            thisNextSys = thisNextObj.GetComponent <SystemScript> ();

            IPlacable _placable = thisNextObj.GetComponent <IPlacable> ();
            _placable.PlaceObj(_index, gridPos, originObj);

            hScr.NextHScr = thisNextObj.GetComponent <HealthScript> ();
        }
    }
Пример #11
0
    private void Setup()
    {
        sysScr  = GetComponent <SystemScript>();
        gridPos = sysScr.GridPos;

        //needs more info...
        //ship = LevelManager.Instance.Ships [playerID].GetComponent <ShipScript> ();
        GameObject _ship = transform.parent.parent.parent.parent.gameObject;

        //ShipScript _shipScr = _ship.GetComponent <ShipScript> ();
        pwrMngr = _ship.GetComponent <ShipPowerMngr> ();
        hScr    = sysScr.GetOriginObj().GetComponent <HealthScript> ();

        //Debug.LogError (_ship.transform.childCount);

        if (_ship.transform.childCount < 7)
        {
            //if (_ship.transform.GetChild (7) == null) {
            //Debug.LogError ("shield stuff called");

            GameObject _shield = (GameObject)Instantiate(shield, _ship.transform);
            shield = _shield;

            shieldScr = shield.GetComponent <ShieldScript> ();
            shieldScr.Setup(gridPos.Z);

            /*
             * GameObject _field = _ship.transform.GetChild (1).gameObject;
             *
             * shield.transform.position = _field.transform.position;
             * shield.transform.localScale = (_field.transform.localScale * 16 / 1920);
             * //float _scale = (Screen.width / shield.GetComponent <SpriteRenderer> ().bounds.size.x);
             * float _scale0 = (_field.transform.localScale.x * 16 / 1920);
             * float _scale1 = (_field.transform.localScale.y * 16 / 1080);
             * //shield.transform.localScale = new Vector3 (_scale, _scale, _scale);
             *
             * shield.transform.localScale = new Vector3 (_scale0, _scale1);
             */
        }
        else
        {
            //Debug.LogError ("no shield stuff called");

            shield    = _ship.transform.GetChild(6).gameObject;
            shieldScr = shield.GetComponent <ShieldScript> ();
        }

        //IncreaseShieldCapacity (shieldBoost);
        pwrMngr.PowerSetup(systemType, powerReq);

        originShldSys             = GetOriginShielSystem();
        originShldSys.fullPwrReq += powerReq;

        if (this == originShldSys)
        {
            isOrigin = true;
            pwrMngr.AddToSysScrList(systemType, sysScr);
        }
    }
Пример #12
0
    public SystemScript GetSystem()
    {
        //ISystem _iSys = transform.GetChild (1).GetChild (0).GetComponent <ISystem> ();
        //return _iSys;
        SystemScript _sysScr = transform.GetChild(1).GetChild(0).GetComponent <SystemScript> ();

        return(_sysScr);
    }
Пример #13
0
    /// <summary>
    /// ランクマッチ用
    /// </summary>
    void CreateRandomRoom()
    {
        RoomOptions roomOptions = new RoomOptions();

        roomOptions.MaxPlayers = 2;        //部屋の最大人数
        roomOptions.IsOpen     = true;     //入室許可する
        roomOptions.IsVisible  = true;     //ロビーから見えるようにする
        PhotonNetwork.CreateRoom("rank:" + SystemScript.GeneratePassword(10), roomOptions, null);
        alert = AlertView.Make(1, "オンライン対戦", "対戦相手を探しています...", new string[] { }, gameObject, 1);
    }
Пример #14
0
    // Start is called before the first frame update
    void Start()
    {
        sc = this.GetComponent <SystemScript>();

        cam     = transform.Find("Main Camera").gameObject;
        shot_sc = cam.GetComponent <ShotCursor>();

        rig = this.GetComponent <Rigidbody>();

        result_text = GameObject.FindGameObjectWithTag("ResultText").GetComponent <Text>();
    }
Пример #15
0
    public void BoxRefresh()
    {
        //ボックス取得
        var cds = DataManager.Instance.box;

        //そーと
        SortedBox = new List <CardParam> ();
        for (int i = 0; i < cds.Count; i++)
        {
            CardParam param = new CardParam();
            param.Set(cds [i]);
            SortedBox.Add(param);
        }
        Sort(SortedBox);

        //絞り込み
        SortedBox = CardRefine(SortedBox, new List <int>(), boxObjs.RoleRefine);

//		//Node破壊
//		foreach ( Transform n in boxObjs.ScrollContent )
//		{
//			GameObject.Destroy(n.gameObject);
//		}
//		//Node生成
//		for (int i = 0; i < SortedBox.Count; i++ ){
//			CardNodeScript node = Instantiate (cardNode);
//			node.name = i + "";
//			node.Delegate = gameObject;
//			node.transform.SetParent (boxObjs.ScrollContent);
//			node.transform.localScale = Vector3.one;
//			node.transform.localPosition = Vector3.zero;
//			CardData cd = new CardData ().Set (SortedBox [i]);
//			//色変更
//			if(DataManager.Deck.ContainCard(useDeck,cd.uid)){
//				node.Refresh (cd, true);
//			} else {
//				node.Refresh (cd,false);
//			}
//
//		}
        //デッキ取得
        SortedDeck = SystemScript.cdTocp(DataManager.Deck.GetDeckData(useDeck));
        //絞り込み
        SortedDeck = CardRefine(SortedDeck, new List <int>(), -1);
        //データ表示 & カードデータ生成
        boxObjs.Info.text = "デッキ枚数 [" +
                            SortedDeck.Count + " / 30]\n■タップで詳細を見る";

        itemCtrls [1].cards    = SortedBox;
        itemCtrls [1].DeckMode = DeckMode;
        infinitys [1].show();
    }
Пример #16
0
    //public List <CouchCrewScript> AggressorList { get {  } }


    private void Start()
    {
        health      = maxHealth;
        sprRenderer = gameObject.GetComponent <SpriteRenderer> ();
        //room = transform.parent.parent.GetChild (0).GetChild (0).GetComponent <RoomScript> ().GetRoomOrigin ();

        //tile = transform.parent.parent.GetComponent <TileScript> ();

        int _type = 1000;

        if (isRoom)
        {
            _type = 0;
        }
        else if (isSys)
        {
            _type = 1;
        }
        else if (isSubSys)
        {
            //Debug.LogError ("added subSys");
            _type = 2;
        }
        else if (isCrew)
        {
            _type = 3;
        }

        if (_type != 1000)
        {
            objType = _type;
            //tile.HScrDict.Add (objType, this);
        }
        else
        {
            Debug.LogError("no type set: isRoom: " + isRoom);
        }

        //originPlac = gameObject.GetComponent <IPlacable> ();
        //originHScr = originPlac.GetGameObj ().GetComponent <HealthScript> ();
        originHScr = gameObject.GetComponent <IPlacable> ().GetOriginObj().GetComponent <HealthScript> ();

        if (isSys)
        {
            sys = gameObject.GetComponent <SystemScript> ();
        }

        //now only called if needed...
        //tile = transform.parent.parent.GetComponent<TileScript>();
    }
Пример #17
0
    public void OnClick()
    {
        GameObject obj = GameObject.FindGameObjectWithTag("Ground");

        GameObject   pl = GameObject.Find("Player");
        SystemScript sc = pl.GetComponent <SystemScript>();

        sc.GenerateTarget();

        PlayerController plc = pl.GetComponent <PlayerController>();

        plc.sccore = 0;

        obj.gameObject.SetActive(false);
    }
Пример #18
0
    public bool JsonImport(string path, string name)
    {
        string FilePath = path + "/" + name + ".json";

        if (!File.Exists(FilePath))
        {
            return(false);
        }

        SystemScript ss = JsonIO.JsonImport <SystemScript>(path, name);

        SpriteList    = ss?.SpriteList;
        MapChipPrefab = ss?.MapChipPrefab;
        return(true);
    }
Пример #19
0
    public void Show(CardParam cp)
    {
        NameAndGroup.text = cp.Name + string.Format(":LV.{0}", cp.LV);
        if (cp.Groups.Count > 0)
        {
            NameAndGroup.text += "\n<size=18>" + SystemScript.GetGroup(cp.Groups) + "</size>";
        }
        Param.text = System.String.Format
                         ("{0}\n役割:{1}\nコスト:{2}\nパワー:{3}"
                         , new string[] { SystemScript.GetReality(cp.Rea, true), SystemScript.GetRole(cp.Role), cp.Cost.ToString(), cp.Power.ToString() });

        SkillText.text = SystemScript.GetSkillsText(cp, SystemScript.ShowType.DETAIL, true);
        CardImg.gameObject.SetActive(true);
        CardImg.Set(cp);
    }
Пример #20
0
        public static void LevelUp(int id)
        {
            var      boxDat = DataManager.Instance.box;
            int      cdnum  = boxDat.FindIndex(x => x.ID == id);
            CardData cd     = boxDat [cdnum];

            int useCount = SystemScript.needPoint(new CardParam().Set(cd));

            if (useCount <= cd.Count)
            {
                cd.Count -= useCount;
                cd.LV++;
            }
            DataManager.Instance.box [cdnum] = cd;
        }
Пример #21
0
    public void LvUpNotify()
    {
        //無効化
        if (!DataManager.Instance.LVSystem)
        {
            return;
        }

        CardParam cp = GetBoxCardParam(SelectingCard.ID);

        if (cp.Count >= SystemScript.needPoint(cp))
        {
            AlertView.Make(0, "強化", string.Format(cp.Name + "\nLV.{0} → LV.{1}", cp.LV, cp.LV + 1), new string[] { "OK", "Camcel" }, gameObject, 1);
        }
//		AlertView.Make (0,"強化","カードを強化しますか",new string[]{"OK"}, gameObject,2);
    }
Пример #22
0
 //マッチング開始
 public void Matching(BattleMode mode, string roomKeyword)
 {
     if (netMode == NetMode.NODE)
     {
         //node
         List <CardParam> deck = SystemScript.cdTocp(DataManager.Deck.GetDeckData(DataManager.Instance.UseDeck));
         deck = SystemScript.ShuffleCP(deck);
         Manager ["/pvp"].Emit("toLobby", new object[] { JsonMapper.ToJson(deck) });
     }
     else
     {
         //pun
         battleMode            = mode;
         punButtle.roomKeyword = roomKeyword;
         punButtle.Matching(mode, roomKeyword);
     }
 }
Пример #23
0
    public void ToTestMatch(int num)
    {
        ChangeScene(2);
        StartCoroutine(DataManager.Instance.BGMFade(2, FadeWait));
        int useDeck = DataManager.Instance.UseDeck;

        if (num == 5)
        {
            battleScript.BattleStartOffline(new int[] { 50, 50 }, new int[] { 10, 200 }
                                            , SystemScript.cdTocp(DataManager.Deck.GetDeckData(useDeck)), SystemScript.GetEnemyDeck(num));
        }
        else
        {
            battleScript.BattleStartOffline(new int[] { 50, 50 }, new int[] { 10, 10 }
                                            , SystemScript.cdTocp(DataManager.Deck.GetDeckData(useDeck)), SystemScript.GetEnemyDeck(num));
        }
    }
Пример #24
0
    public void Refresh(CardParam _param, bool _DeckMode)
    {
//		DeckInCount = DataManager.Deck.GetCard(DataManager.Instance.UseDeck,_param.Atr,_param.ID).Count;
//		BoxCount = DataManager.Box.GetCard(_param.Atr,_param.ID).Count;

        //名前+種族
        string Title = System.String.Format
                           ("LV.{0} {1} ", new string[] { _param.LV.ToString(), _param.Name.ToString() });

        if (_param.Groups.Count > 0)
        {
            Title += "\n<size=25>" + SystemScript.GetGroup(_param.Groups) + "</size>";
        }
        Name.text = Title;

        //パラメータ

        Param.text = System.String.Format
                         ("{0}\n役割:{1}\nコスト:{2}\nパワー:{3}"
                         , new string[] { SystemScript.GetReality(_param.Rea, true), SystemScript.GetRole(_param.Role), _param.Cost.ToString(), _param.Power.ToString() });
        //
        Skill.text = SystemScript.GetSkillsText(_param, SystemScript.ShowType.DETAIL, true);

        //LVUP関連
//		LvUpText.text = System.String.Format ("LV.{0}→LV.{1}\n{2} / {3}枚",new string[]{_param.LV.ToString(),(_param.LV+1).ToString(),BoxCount.ToString(),999.ToString()});
        LvUpText.text = "強化";
        //イメージ変更
        CardImage.Set(_param);
        CardBigImage.Set(_param);

        //ボタン変更
        for (int i = 0; i < Buttons.Length; i++)
        {
            GameObject btn = Buttons [i];
            if (i == DeckInCount)
            {
                btn.GetComponent <ShadowMove> ().Move(true, false);
            }
            else
            {
                btn.GetComponent <ShadowMove> ().Move(false, false);
            }
        }
//		Param.text = _param.
    }
Пример #25
0
    public void ToCPUArenaBattle(XLS_ArenaData.Param param, int difficulty)
    {
        ChangeScene(2);
//		param.
//		battleScript.gameObject.SetActive (true);
        StartCoroutine(DataManager.Instance.BGMFade(2, FadeWait));
        int useDeck = DataManager.Instance.UseDeck;

        battleScript.BattleStartOffline(new int[] { 40, param.HP[difficulty] }, new int[] { 10, 10 }
                                        , SystemScript.cdTocp(DataManager.Deck.GetDeckData(useDeck)), SystemScript.GetEnemyDeck(param.deck));
//		if (_num == 0) {
//		}
//		if (_num == 1) {
////			battleScript.BattleStartOffline (new int[]{ 40, 40 }, new int[]{ 10, 10 }
////				,SystemScript.cdTocp( DataManager.Deck.GetDeckData (useDeck)), SystemScript.GetEnemyDeck (0));
//			battleScript.BattleStartOffline (new int[]{ 40, 40 }, new int[]{ 10, 10 }
//				,SystemScript.cdTocp( DataManager.Deck.GetDeckData (useDeck)),SystemScript.cdTocp( DataManager.Deck.GetDeckData (useDeck)));
//		}
    }
Пример #26
0
    public static string GetSkillsText(CardParam _cp, ShowType _showType, bool _newLine, int _skillNum = -1)
    {
        List <string> skillsText   = _cp.SkillTexts;
        List <string> skillsScript = _cp.SkillScript;
        List <int>    Effects      = _cp.Effect;
        List <int>    EffectsValue = _cp.EffectValue;
        int           lv           = _cp.LV;
        string        SkillStr     = "";

        for (int i = 0; i < Effects.Count; i++)
        {
            string text = SystemScript.GetEffectText(Effects[i], EffectsValue[i], _showType, _newLine, i == _skillNum);
            if (text != null)
            {
                if (SkillStr != "")               //かいぎょう
                {
                    SkillStr += "\n";
                }
                SkillStr += text;                //追加
            }
        }

        for (int i = 0; i < skillsText.Count; i++)
        {
            string text = SystemScript.GetSkillText(skillsText[i], lv, _showType, _newLine, i == _skillNum);
            if (text != null)
            {
                if (SkillStr != "")               //かいぎょう
                {
                    SkillStr += "\n";
                }
                SkillStr += text;                //追加
                if (skillsScript [i] == "")
                {
                    SkillStr += "<color=#ff0000>(未実装)</color>";
                }
            }
        }
        return(SkillStr);
    }
Пример #27
0
    //to all
    public void ReceivePowerUpdate(bool _isPowered)
    {
        if (isOrigin)
        {
            if (isPowered)
            {
                SystemScript _sysScr = sysScr.GetOriginObj().GetComponent <SystemScript> ();
                _sysScr.UpdatePowerState(false);
            }
            else
            {
                if (!hScr.IsFullyDamaged)
                {
                    //Debug.Log ("req: " + powerReq);
                    //Debug.Log ("full req: " + originShldSys.fullPwrReq);

                    if (pwrMngr.EnoughPower(fullPwrReq))
                    {
                        //try power up
                        SystemScript _sysScr = sysScr.GetOriginObj().GetComponent <SystemScript> ();
                        _sysScr.UpdatePowerState(true);

                        //pwrMngr.PowerDistribution (systemType, powerReq, this);
                        //isPowered = true;
                    }
                    else
                    {
                        Debug.Log("not enough power");
                    }
                }
            }
        }
        else
        {
            originShldSys.ReceivePowerUpdate(_isPowered);
        }

        //SystemScript _sysScr = systemScr.GetOriginObj ().GetComponent <SystemScript> ();
        //_sysScr.UpdatePowerState (_isPowered);
    }
Пример #28
0
    //購入後処理
    public void OnBuy(List <object> cid, string errmsg)
    {
        //アラートを消す
        alert.OpenClose(false);

        if (cid == null || cid.Count == 0)
        {
            //エラー

            alert = AlertView.Make(-1, "エラー", errmsg, new string[] { "確認" }, gameObject, 1);
        }
        else
        {
            //成功

            //カード追加
            lcd = new List <CardData>();
            for (int i = 0; i < cid.Count; i++)
            {
                int id = toInt(cid [i]);
                DataManager.Box.AddCard(0, id, 1);
                lcd.Add(new CardData().Set(0, id, 1, 1));
            }
            //ポイント消費
            DataManager.ChangePoint(useType, -usePoint);
            DataManager.Instance.RefreshData();
            DataManager.Instance.Save();


            var           paramDatas = DataManager.Instance.xls_CardParam;
            List <string> datas      = new List <string>();
            for (int i = 0; i < lcd.Count; i++)
            {
                CardData cd    = lcd [i];
                var      param = DataManager.Instance.xls_CardParam.sheets [cd.Atr].list [cd.ID];
                datas.Add(SystemScript.GetReality(param.reality, true) + " " + param.name);
            }
            AlertView.Make(-1, "入手カード", "パックを購入しました", datas.ToArray(), gameObject, 1);
        }
    }
Пример #29
0
    public void OnRecieve(int _num, int _tag)
    {
        if (_num == -1)
        {
            return;
        }
        switch (_tag)
        {
        case 3:
        {
            SystemScript.OpenURL(CopyrightURL [_num]);
        }
        break;

        case 8:
        {
            DataManager.Instance.BattleSpeed = _num;
            DataManager.Instance.Save();
        }
        break;
        }
    }
Пример #30
0
    public void DeckRefresh()
    {
        //デッキ取得
        SortedDeck = SystemScript.cdTocp(DataManager.Deck.GetDeckData(useDeck));
        //そーと
        Sort(SortedDeck);
        //絞り込み
//		SortedDeck = CardRefine(SortedDeck,new List<int>(),-1);

        //データ表示 & カードデータ生成
        deckObjs.Info.text = "デッキ枚数 [" +
                             SortedDeck.Count + " / 30]\n■タップで詳細を見る";

        //Node破壊
//		foreach ( Transform n in deckObjs.ScrollContent )
//		{
//			GameObject.Destroy(n.gameObject);
//		}
//		List<CardParam> lcp = new List<CardParam>();
//		for (int i = 0; i < 30; i++ ){
//			lcp.AddRange (SortedDeck);
//		}
        itemCtrls [0].cards    = SortedDeck;
        itemCtrls [0].DeckMode = DeckMode;
        infinitys [0].show();

//		//Node生成
//		for (int i = 0; i < SortedDeck.Count; i++ ){
//			CardNodeScript node = Instantiate (cardNode);
//			node.name = i + "";
//			node.Delegate = gameObject;
//			node.transform.SetParent (deckObjs.ScrollContent);
//			node.transform.localScale = Vector3.one;
//			node.transform.localPosition = Vector3.zero;
//			CardData cd = new CardData ().Set (SortedDeck [i]);
//			node.Refresh (cd,false);
//
//		}
    }