Beispiel #1
0
    public void Show(DataUnitParam _dataChara, MasterCharaParam _masterChara, List <MasterCardParam> _master_card_list, List <MasterCharaCardParam> _chara_card_list, List <MasterCardSymbolParam> _symbol_list)
    {
        m_imgIcon.sprite    = SpriteManager.Instance.Get(string.Format(Defines.STR_FORMAT_FACEICON, _masterChara.chara_id));
        m_txtCharaName.text = _masterChara.name;
        m_txtHP.text        = _dataChara.hp_max.ToString();
        m_txtSTR.text       = _dataChara.str.ToString();
        m_txtMAG.text       = _dataChara.magic.ToString();
        m_txtHEAL.text      = _dataChara.heal.ToString();
        m_txtFood.text      = _dataChara.food.ToString();

        m_barTension.SetValueCurrent(_dataChara.tension);

        Card[] arr = m_goCardRoot.GetComponentsInChildren <Card>();
        foreach (Card c in arr)
        {
            GameObject.Destroy(c.gameObject);
        }

        foreach (MasterCharaCardParam p in _chara_card_list.FindAll(p => p.chara_id == _masterChara.chara_id))
        {
            //Debug.Log(p.card_id);
            Card c = PrefabManager.Instance.MakeScript <Card>(m_prefCard, m_goCardRoot);

            DataCardParam data_card = new DataCardParam();

            data_card.Copy(_master_card_list.Find(a => a.card_id == p.card_id), _masterChara.chara_id, 0);
            c.Initialize(data_card, _symbol_list);
        }
    }
Beispiel #2
0
        public override void OnEnter()
        {
            base.OnEnter();

            DataCharaParam   data_chara   = DataManager.Instance.dataChara.list.Find(p => p.status == DataChara.STATUS.USING.ToString());
            MasterCharaParam master_chara = DataManager.Instance.masterChara.list.Find(p => p.chara_id == data_chara.chara_id);

            armorMain.m_imgChara.sprite = armorMain.m_spriteAtlasChara.GetSprite(master_chara.GetIconName());

            armorMain.icon_armor_list.Clear();
            armorMain.m_prefArmorIcon.SetActive(false);
            MonoBehaviourEx.DeleteObjects <IconArmor>(armorMain.m_goRootLeft);
            MonoBehaviourEx.DeleteObjects <IconArmor>(armorMain.m_goRootRight);

            for (int i = 0; i < 4; i++)
            {
                IconArmor script = PrefabManager.Instance.MakeScript <IconArmor>(armorMain.m_prefArmorIcon, armorMain.m_goRootLeft);
                armorMain.icon_armor_list.Add(script);
            }
            for (int i = 0; i < 4; i++)
            {
                IconArmor script = PrefabManager.Instance.MakeScript <IconArmor>(armorMain.m_prefArmorIcon, armorMain.m_goRootRight);
                armorMain.icon_armor_list.Add(script);
            }

            for (int i = 0; i < MasterArmor.ArmorPositionArr.Length; i++)
            {
                DataArmorParam data = DataManager.Instance.dataArmor.list.Find(p => p.position == MasterArmor.ArmorPositionArr[i]);

                armorMain.icon_armor_list[i].Initialize(data, DataManager.Instance.masterArmor.list);
            }
            position.Value = "helmet";
            Finish();
        }
Beispiel #3
0
    public void Initialize()
    {
        DataCharaParam   data_chara   = DataManager.Instance.dataChara.list.Find(p => p.status == DataChara.STATUS.USING.ToString());
        MasterCharaParam master_chara = DataManager.Instance.masterChara.list.Find(p => p.chara_id == data_chara.chara_id);

        m_imgChara.sprite = m_spriteAtlas.GetSprite(master_chara.GetIconName());

        int position = 1;

        foreach (IconSkill icon in m_iconSkillList)
        {
            DataSkillParam data = DataManager.Instance.dataSkill.list.Find(p => p.position == position);
            if (data == null)
            {
                data = new DataSkillParam(0, position);
            }
            MasterSkillParam master = DataManager.Instance.masterSkill.list.Find(p => p.skill_id == data.skill_id);
            icon.Initialize(data, master);
            position += 1;
        }

        DataPotionParam   data_potion   = DataManager.Instance.dataPotion.list.Find(p => p.is_use == true);
        MasterPotionParam master_potion = DataManager.Instance.masterPotion.list.Find(p => p.potion_id == data_potion.potion_id);

        //Debug.Log(data_potion.potion_id);
        //Debug.Log(master_potion.potion_id);
        m_iconPotion.Initialize(data_potion, master_potion);
    }
Beispiel #4
0
        public override void OnEnter()
        {
            base.OnEnter();

            // いったん自動リセット
            chara.m_charaBody.transform.localPosition = Vector3.zero;

            chara.is_goal = false;
            chara.m_dataUnitParam.BuildPlayer();

            DataWeaponParam my_weapon = DataManager.Instance.dataWeapon.list.Find(p => p.equip != 0);

            chara.m_masterWeaponParam = DataManager.Instance.masterWeapon.list.Find(p => p.weapon_id == my_weapon.weapon_id);
            Debug.Log(chara.m_masterWeaponParam.weapon_type);
            DataCharaParam   data_chara   = DataManager.Instance.dataChara.list.Find(p => p.status == DataChara.STATUS.USING.ToString());
            MasterCharaParam master_chara = DataManager.Instance.masterChara.list.Find(p => p.chara_id == data_chara.chara_id);

            chara.m_overrideSprite.overrideTexture = TextureManager.Instance.Get(master_chara.texture_name);

            chara.m_imgHpBar.transform.localScale = Vector3.one;
            chara.m_txtHp.text = string.Format("{0}/{1}", chara.m_dataUnitParam.hp, chara.m_dataUnitParam.hp_max);

            //chara.m_hpBar.SetValueMax(chara.m_dataUnitParam.hp_max);
            //chara.m_hpBar.SetValueCurrent(chara.m_dataUnitParam.hp);
            Finish();
        }
Beispiel #5
0
    public void AddTension(int _iCharaId, int _iAdd, List <MasterCharaParam> _master_chara_list)
    {
        DataUnitParam    unit_chara   = list.Find(p => p.chara_id == _iCharaId && p.unit == "chara");
        DataUnitParam    unit_tension = list.Find(p => p.chara_id == _iCharaId && p.unit == "assist" && p.assist_type == "tension");
        MasterCharaParam master_chara = _master_chara_list.Find(p => p.chara_id == _iCharaId);

        if (unit_chara == null)
        {
            Debug.LogError("unit_chara");
        }
        else if (unit_tension == null)
        {
            Debug.LogError("unit_tension");
        }
        else if (master_chara == null)
        {
            Debug.LogError("master_chara");
        }

        unit_chara.tension += _iAdd;
        if (100 < unit_chara.tension)
        {
            unit_chara.tension = 100;
        }
        else if (unit_chara.tension < 0)
        {
            unit_chara.tension = 0;
        }
        if (unit_tension != null)
        {
            unit_chara.RemoveAssist(unit_tension);
        }
        unit_tension.BuildTension(master_chara, unit_chara.tension);
        unit_chara.BuildAssist(unit_tension);
    }
Beispiel #6
0
    public void Initialize(DataUnitParam _data, MasterCharaParam _masterCharaParam)
    {
        unit_param = _data;

        master_chara      = _masterCharaParam;
        m_imgChara.sprite = SpriteManager.Instance.Get(string.Format("chara{0:000}01_00_faceicon", master_chara.chara_id));

        Refresh();
    }
Beispiel #7
0
    public void CopyParams(MasterCharaParam _master)
    {
        hp_max = _master.hp_max;
        hp     = hp_max;

        str   = _master.str;
        magic = _master.magic;
        heal  = _master.heal;
        luck  = _master.luck;
    }
Beispiel #8
0
    public void Initialize(MasterCharaParam _master)
    {
        m_txtName.text = _master.name;
        m_masterChara  = _master;

        m_imgIcon.sprite = SpriteManager.Instance.Get(string.Format("chara{0:000}01_00_faceicon", _master.chara_id));

        m_btn.onClick.RemoveAllListeners();
        m_btn.onClick.AddListener(() =>
        {
            OnClickIcon.Invoke(this);
        });
    }
Beispiel #9
0
    public void Initialize(DataCharaParam _param)
    {
        m_dataCharaParam = _param;
        MasterCharaParam masterCharaParam = DataManager.Instance.masterChara.Get(m_dataCharaParam.chara_id);

        m_txtName.text = masterCharaParam.name;

        gameObject.GetComponent <Button>().onClick.AddListener(() =>
        {
            DataManager.Instance.selectedDataCharaParam = m_dataCharaParam;
            UIAssistant.main.ShowPage("2_1_1status_detail");
        });
    }
Beispiel #10
0
    public void Initialize(DataUnitParam _unit, MasterCharaParam _master)
    {
        dataUnit    = _unit;
        masterChara = _master;

        m_imgFaceicon.sprite = SpriteManager.Instance.Get(string.Format(Defines.STR_FORMAT_FACEICON, masterChara.chara_id));
        m_txtName.text       = masterChara.name;
        m_txtLevel.text      = string.Format("Lv{0}", _unit.level);
        m_txtHP.text         = dataUnit.hp_max.ToString();
        m_txtStr.text        = dataUnit.str.ToString();
        m_txtMagic.text      = dataUnit.magic.ToString();
        m_txtHeal.text       = dataUnit.heal.ToString();
        m_txtFood.text       = dataUnit.food.ToString();
    }
Beispiel #11
0
    public void Initialize(MasterCharaParam _master, DataCharaParam _data)
    {
        m_imgIcon.sprite = m_spriteAtlas.GetSprite(_master.GetIconName());
        // 塗る
        //Debug.Log(m_spriteAtlas.GetSprite("kuso"));
        m_masterCharaParam = _master;
        m_dataCharaParam   = _data;

        m_btn.onClick.RemoveAllListeners();
        m_btn.onClick.AddListener(() =>
        {
            OnClickIcon.Invoke(m_masterCharaParam.chara_id);
        });
    }
Beispiel #12
0
        protected void RefreshParty()
        {
            MasterCharaParam left = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == (
                                                                                       DataManagerGame.Instance.dataUnit.list.Find(a => a.unit == "chara" && a.position == "left").chara_id
                                                                                       ));
            MasterCharaParam right = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == (
                                                                                        DataManagerGame.Instance.dataUnit.list.Find(a => a.unit == "chara" && a.position == "right").chara_id
                                                                                        ));
            MasterCharaParam back = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == (
                                                                                       DataManagerGame.Instance.dataUnit.list.Find(a => a.unit == "chara" && a.position == "back").chara_id
                                                                                       ));

            panel.m_partyHolder.Initialize(left, right, back);
        }
Beispiel #13
0
    public void Initialize(MasterItemParam _master)
    {
        m_master = _master;

        if (m_imgItemIcon != null)
        {
            m_imgItemIcon.sprite = SpriteManager.Instance.Get(_master.sprite_name);
        }
        m_txtName.text = _master.name;

        string strOutline = "";

        if (_master.situation == "field")
        {
            strOutline = string.Format("{0}\n\n<color=red>このアイテムはフィールドでのみ使用可能です</color>", _master.outline);
        }
        else if (_master.situation == "battle")
        {
            strOutline = string.Format("{0}\n\n<color=red>このアイテムは戦闘中でのみ使用可能です</color>", _master.outline);
        }
        else if (_master.situation == "none")
        {
            strOutline = string.Format("{0}\n\n<color=red>このアイテムはここでは使用できません</color>", _master.outline);
        }
        else
        {
            strOutline = _master.outline;
        }
        m_txtOutline.text = strOutline;

        if (m_master.range == 1)
        {
            m_partyHolder.gameObject.SetActive(true);
            MasterCharaParam left = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == (
                                                                                       DataManagerGame.Instance.dataUnit.list.Find(a => a.unit == "chara" && a.position == "left").chara_id
                                                                                       ));
            MasterCharaParam right = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == (
                                                                                        DataManagerGame.Instance.dataUnit.list.Find(a => a.unit == "chara" && a.position == "right").chara_id
                                                                                        ));
            MasterCharaParam back = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == (
                                                                                       DataManagerGame.Instance.dataUnit.list.Find(a => a.unit == "chara" && a.position == "back").chara_id
                                                                                       ));
            m_partyHolder.Initialize(left, right, back);
        }
        else
        {
            m_partyHolder.gameObject.SetActive(false);
        }
    }
Beispiel #14
0
    public int Initialize(int _iStageId)
    {
        int iRetRequestFood          = 0;
        MasterStageParam masterStage = DMCamp.Instance.masterStage.list.Find(p => p.stage_id == _iStageId);

        m_txtStageName.text    = masterStage.stage_name;
        m_imgStageThumb.sprite = SpriteManager.Instance.Get(masterStage.thumb);
        m_txtStageOutline.text = masterStage.outline;

        m_txtTotalWave.text     = string.Format("Wave:{0}", masterStage.total_wave);
        m_txtTotalCorridor.text = string.Format("約{0}回廊", masterStage.total_length);

        m_txtStageMissionText[0].text = "クリア済み";
        m_txtStageMissionText[1].text = string.Format("リロード{0}回以内", masterStage.challenge_reload);
        m_txtStageMissionText[2].text = string.Format("カードプレイ{0}以内", masterStage.challenge_play);

        List <DataUnitParam> party_members = DMCamp.Instance.dataUnitCamp.list.FindAll(p => p.unit == "chara" && p.position != "none");
        int iPartyCost = 0;

        foreach (DataUnitParam unit in party_members)
        {
            MasterCharaParam master_chara = DMCamp.Instance.masterChara.list.Find(p => p.chara_id == unit.chara_id);
            iPartyCost += master_chara.food;
        }
        m_txtFoodParty.text = iPartyCost.ToString();
        m_txtFoodStage.text = masterStage.food_rate.ToString();
        iRetRequestFood     = iPartyCost * masterStage.food_rate;
        m_txtFoodTotal.text = iRetRequestFood.ToString();

        DataStageParam data_stage = DMCamp.Instance.dataStage.list.Find(p => p.stage_id == _iStageId);

        if (data_stage != null)
        {
            m_imgStageMissionStar[0].color = 0 < data_stage.clear_count ? Color.yellow : Color.white;
            m_imgStageMissionStar[1].color = data_stage.best_reload <= masterStage.challenge_reload ? Color.yellow : Color.white;
            m_imgStageMissionStar[2].color = data_stage.best_play <= masterStage.challenge_play ? Color.yellow : Color.white;
        }
        else
        {
            for (int i = 0; i < m_imgStageMissionStar.Count; i++)
            {
                m_imgStageMissionStar[i].color = Color.white;
            }
        }

        return(iRetRequestFood);
    }
Beispiel #15
0
    public void party_initialize()
    {
        // 最低レベルは1
        chara_level = Mathf.Max(1, chara_level);

        List <DataUnitParam> party_members = DMCamp.Instance.dataUnitCamp.list.FindAll(p => p.unit == "chara" && p.position != "none");

        dataUnit.list.Clear();

        MasterCharaParam master_left  = DMCamp.Instance.masterChara.list.Find(p => p.chara_id == left_chara_id);
        MasterCharaParam master_right = DMCamp.Instance.masterChara.list.Find(p => p.chara_id == right_chara_id);
        MasterCharaParam master_back  = DMCamp.Instance.masterChara.list.Find(p => p.chara_id == back_chara_id);

        dataUnit.list.Add(DataUnit.MakeUnit(master_left, chara_level, "left", 60));
        dataUnit.list.Add(DataUnit.MakeUnit(master_right, chara_level, "right", 60));
        dataUnit.list.Add(DataUnit.MakeUnit(master_back, chara_level, "back", 60));
    }
Beispiel #16
0
    protected override void panelStart()
    {
        base.panelStart();

        m_dataCharaParam = DataManager.Instance.selectedDataCharaParam;

        m_bannerCharaName.Initialize(m_dataCharaParam);

        m_masterCharaParam = DataManager.Instance.masterChara.Get(m_dataCharaParam.chara_id);
        Debug.LogError(m_masterCharaParam.filename);
        m_imgChara.sprite = SpriteManager.Instance.LoadSprite(m_masterCharaParam.filename);

        float width = CanvasSize.Instance.canvasHeight * 640.0f / 1136.0f;

        m_imgChara.rectTransform.sizeDelta = new Vector2(width, 0);

        AdsManager.Instance.ShowBanner(false);
    }
Beispiel #17
0
    public static DataUnitParam MakeUnit(MasterCharaParam _base, int _iLevel, string _strPosition, int _iTension)
    {
        DataUnitParam ret = _base.BuildLevel(_iLevel, _iTension);

        ret.chara_id = _base.chara_id;
        ret.unit     = _base.unit;

        //ret.hp = _base.hp_max;
        //ret.hp_max = _base.hp_max;

        //ret.tension = _iTension;
        ret.position = _strPosition;

        //ret.str = _base.str;
        //ret.magic = _base.magic;
        //ret.heal = _base.heal;

        return(ret);
    }
Beispiel #18
0
    public void MakeInitialData(List <MasterCharaParam> _masterList)
    {
        MasterCharaParam left  = _masterList.Find(p => p.chara_id == 1);
        MasterCharaParam right = _masterList.Find(p => p.chara_id == 3);
        MasterCharaParam back  = _masterList.Find(p => p.chara_id == 2);

        DataUnitParam data_left = left.BuildLevel(1, 60);

        data_left.position = "left";
        DataUnitParam data_right = right.BuildLevel(1, 60);

        data_right.position = "right";
        DataUnitParam data_back = back.BuildLevel(1, 60);

        data_back.position = "back";

        list.Add(data_left);
        list.Add(data_right);
        list.Add(data_back);
    }
Beispiel #19
0
        private void create_enemy(int _enemy_chara_id)
        {
            simulator.dataUnit.list.RemoveAll(p => p.unit == "enemy");
            MasterCharaParam master_enemy = simulator.masterChara.list.Find(p => p.chara_id == _enemy_chara_id);
            DataUnitParam    enemy        = DataUnit.MakeUnit(master_enemy, 1, "enemy", 60);

            simulator.dataUnit.list.Add(enemy);

            //Debug.LogError(_enemy_chara_id);

            simulator.dataCardEnemy.list.Clear();
            int iSerial = 1;

            foreach (MasterCharaCardParam cc in simulator.masterCharaCard.list.FindAll(p => p.chara_id == _enemy_chara_id))
            {
                DataCardParam   add         = new DataCardParam();
                MasterCardParam master_card = simulator.masterCard.list.Find(p => p.card_id == cc.card_id);
                add.Copy(master_card, _enemy_chara_id, iSerial);
                simulator.dataCardEnemy.list.Add(add);
                iSerial += 1;
            }
        }
Beispiel #20
0
    public void BuildTension(MasterCharaParam _base, int _iTension)
    {
        chara_id    = _base.chara_id;
        unit        = "assist";
        assist_type = "tension";
        assist_name = "テンション";

        hp     = 0;
        hp_max = 0;

        tension = _iTension;

        // テンションは60が基準
        float fSwing = (_iTension - 60) * 0.005f;

        str   = (int)(_base.str * fSwing);
        magic = (int)(_base.magic * fSwing);
        heal  = (int)(_base.heal * fSwing);

        turn = -1;              // 永続
        return;
    }
Beispiel #21
0
    public void Show()
    {
        Card[] arr = m_goContentRoot.GetComponentsInChildren <Card>();
        foreach (Card banner in arr)
        {
            Destroy(banner.gameObject);
        }

        List <DataCardParam> card_list       = new List <DataCardParam>();
        List <DataUnitParam> unit_param_list = DataManagerGame.Instance.dataUnit.list.FindAll(p => p.unit == "enemy");

        if (unit_param_list.Count != 1)
        {
            Debug.LogError("multi enemy");
        }

        foreach (DataUnitParam unit in unit_param_list)
        {
            MasterCharaParam master_chara = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == unit.chara_id);
            m_txtName.text = master_chara.name;

            m_txtStr.text   = unit.str.ToString();
            m_txtMagic.text = unit.magic.ToString();
            m_txtHeal.text  = unit.heal.ToString();

            foreach (DataCardParam c in GameMain.Instance.battleMain.dataCardEnemy.list.FindAll(p => p.chara_id == unit.chara_id))
            {
                card_list.Add(c);
            }
        }

        foreach (DataCardParam card_param in card_list)
        {
            Card script = PrefabManager.Instance.MakeScript <Card>(m_prefCard, m_goContentRoot);
            script.Initialize(card_param, DataManagerGame.Instance.masterCardSymbol.list);
            script.ShowStatus();
        }
        gameObject.SetActive(true);
    }
Beispiel #22
0
        public override void OnEnter()
        {
            base.OnEnter();

            MasterCharaParam master    = DataManager.Instance.masterChara.list.Find(p => p.chara_id == chara_id.Value);
            DataCharaParam   add_chara = new DataCharaParam();

            if (DataManager.Instance.UseGem(master.price))
            {
                add_chara.chara_id = chara_id.Value;
                add_chara.status   = DataChara.STATUS.IDLE.ToString();
                DataManager.Instance.dataChara.list.Add(add_chara);
            }

            foreach (IconCharaList icon in charaMain.icon_chara_list)
            {
                icon.SetData(add_chara);
            }

            DataManager.Instance.dataChara.Save();
            DataManager.Instance.user_data.Save();
            Finish();
        }
Beispiel #23
0
    public void Initialize(MasterCharaParam _left, MasterCharaParam _right, MasterCharaParam _back)
    {
        left.Initialize(_left);
        right.Initialize(_right);
        back.Initialize(_back);

        left.OnClickIcon.RemoveAllListeners();
        right.OnClickIcon.RemoveAllListeners();
        back.OnClickIcon.RemoveAllListeners();

        left.OnClickIcon.AddListener((CharaIcon _icon) =>
        {
            OnClickIcon.Invoke(_icon);
        });
        right.OnClickIcon.AddListener((CharaIcon _icon) =>
        {
            OnClickIcon.Invoke(_icon);
        });
        back.OnClickIcon.AddListener((CharaIcon _icon) =>
        {
            OnClickIcon.Invoke(_icon);
        });
    }
Beispiel #24
0
        public override void OnEnter()
        {
            base.OnEnter();

            foreach (IconCharaList icon in charaMain.icon_chara_list)
            {
                icon.Select(chara_id.Value);
            }

            MasterCharaParam master = DataManager.Instance.masterChara.list.Find(p => p.chara_id == chara_id.Value);

            DataCharaParam data = DataManager.Instance.dataChara.list.Find(p => p.chara_id == chara_id.Value);

            if (data == null)
            {
                charaMain.m_txtBtnSet.text      = "<color=red>未購入</color>";
                charaMain.m_txtBtnBuy.text      = "購入";
                charaMain.m_txtBtnPrice.text    = master.price.ToString();
                charaMain.m_btnSet.interactable = false;
                charaMain.m_btnBuy.interactable = true;
                charaMain.m_goGemLessCover.SetActive(DataManager.Instance.GetGem() < master.price);
            }
            else
            {
                charaMain.m_txtBtnSet.text      = "<color=black>セットする</color>";
                charaMain.m_txtBtnBuy.text      = "購入済";
                charaMain.m_txtBtnPrice.text    = master.price.ToString();
                charaMain.m_btnSet.interactable = true;
                charaMain.m_btnBuy.interactable = false;
                charaMain.m_goGemLessCover.SetActive(false);
            }



            Finish();
        }
Beispiel #25
0
    public void Initialize(DataUnitParam _unit, MasterCharaParam _master_chara, List <DataUnitParam> _unit_list)
    {
        m_iCharaid = _unit.chara_id;
        m_btn.onClick.RemoveAllListeners();
        m_btn.onClick.AddListener(() =>
        {
            OnClick.Invoke(m_iCharaid);
        });

        //List<DataUnitParam> assist_list = _unit_list.FindAll(p => p.chara_id == _unit.chara_id && (p.unit == "assist" || p.unit == "tension" || p.unit == "bb"));

        m_imgFaceIcon.sprite = SpriteManager.Instance.Get(string.Format(Defines.STR_FORMAT_FACEICON, _master_chara.chara_id));


        m_barTension.SetValueCurrent(_unit.tension);

        int iHPMax  = _unit.hp_max;
        int iAttack = _unit.str;
        int iMagic  = _unit.magic;
        int iHeal   = _unit.heal;

        /*
         * foreach( DataUnitParam assist in assist_list)
         * {
         *      iHPMax += assist.hp_max;
         *      iAttack += assist.str;
         *      iMagic += assist.magic;
         *      iHeal += assist.heal;
         * }
         */

        m_barHp.SetValueMax(iHPMax);
        m_barHp.SetValueCurrent(_unit.hp);

        m_txtAttack.text = iAttack.ToString();
        m_txtMagic.text  = iMagic.ToString();
        m_txtHeal.text   = iHeal.ToString();

        /*
         * if(assist_list.Count <= 3)
         * {
         *      m_AssistIconList[3].gameObject.SetActive(false);
         * }
         *
         * foreach( AssistIcon icon in m_AssistIconList)
         * {
         *      icon.Show("なし", Color.white);
         * }
         *
         * for( int i = 0; i< assist_list.Count; i++)
         * {
         *      if( 0 < assist_list[i].str)
         *      {
         *              m_AssistIconList[i].Show(string.Format("物+{0}", assist_list[i].str), Color.red);
         *      }
         *      else if( 0 < assist_list[i].magic)
         *      {
         *              m_AssistIconList[i].Show(string.Format("魔+{0}", assist_list[i].magic), Color.blue);
         *      }
         *      else if( 0 < assist_list[i].heal)
         *      {
         *              m_AssistIconList[i].Show(string.Format("癒+{0}", assist_list[i].heal), Color.green);
         *      }
         * }
         */
    }
Beispiel #26
0
 public void SetTargetLevel(int _iLevelupNum, DataUnitParam _now, MasterCharaParam _master)
 {
     m_iUpLevel = _iLevelupNum;
     levelup.Initialize(_master.BuildLevel(_now.level + m_iUpLevel, _now.tension), _master);
 }
Beispiel #27
0
 public void Initialize(DataUnitParam _now, MasterCharaParam _master)
 {
     gameObject.SetActive(true);
     now.Initialize(_now, _master);
 }
Beispiel #28
0
        public override void OnEnter()
        {
            base.OnEnter();

            battleMain.Opening();

            battleMain.m_animChara.Play("idle");
            battleMain.m_animEnemy.Play("idle");


            if (battleMain.player_card != null)
            {
                GameObject.Destroy(battleMain.player_card.gameObject);
                battleMain.player_card = null;
            }
            if (battleMain.enemy_card != null)
            {
                GameObject.Destroy(battleMain.enemy_card.gameObject);
                battleMain.enemy_card = null;
            }
            battleMain.dataCardEnemy.list.Clear();

            BattleIcon[] arr = battleMain.m_goBattleChara.GetComponentsInChildren <BattleIcon>();
            foreach (BattleIcon c in arr)
            {
                GameObject.Destroy(c.gameObject);
            }
            arr = battleMain.m_goBattleEnemy.GetComponentsInChildren <BattleIcon>();
            foreach (BattleIcon c in arr)
            {
                GameObject.Destroy(c.gameObject);
            }

            // 敵のデッキデータ
            //Debug.LogWarning(DataManagerGame.Instance.masterCharaCard.list.FindAll(p => p.chara_id == enemy_chara_id.Value).Count);


            MasterCharaParam master_enemy = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == enemy_chara_id.Value);

            battleMain.dataCardEnemy.SetSaveFilename(Defines.FILENAME_CARD_ENEMY);


            if (0 == DataManagerGame.Instance.gameData.ReadInt(Defines.KEY_GAME_BATTLE_ENEMY_ID))
            {
                // 敵は1体消して新規に追加
                DataManagerGame.Instance.dataUnit.list.RemoveAll(p => p.unit == "enemy");

                // 敵にこっそりテンションを入れるならここ
                DataUnitParam enemy = DataUnit.MakeUnit(master_enemy, 1, "enemy", 60);
                DataManagerGame.Instance.dataUnit.list.Add(enemy);

                DataManagerGame.Instance.gameData.WriteInt(Defines.KEY_GAME_BATTLE_ENEMY_ID, enemy_chara_id.Value);

                int iSerial = 1;
                foreach (MasterCharaCardParam cc in DataManagerGame.Instance.masterCharaCard.list.FindAll(p => p.chara_id == enemy_chara_id.Value))
                {
                    DataCardParam   add         = new DataCardParam();
                    MasterCardParam master_card = DataManagerGame.Instance.masterCard.list.Find(p => p.card_id == cc.card_id);
                    add.Copy(master_card, enemy_chara_id.Value, iSerial);
                    battleMain.dataCardEnemy.list.Add(add);
                    iSerial += 1;
                }
            }
            else
            {
                Debug.Log("battle resume");
                enemy_chara_id.Value = DataManagerGame.Instance.gameData.ReadInt(Defines.KEY_GAME_BATTLE_ENEMY_ID);
                master_enemy         = DataManagerGame.Instance.masterChara.list.Find(p => p.chara_id == enemy_chara_id.Value);

                battleMain.dataCardEnemy.LoadMulti();
            }


            battleMain.m_sprEnemy.sprite = SpriteManager.Instance.Get(master_enemy.sprite_name);
            battleMain.HpRefresh();


            battleMain.OnOpeningEnd.AddListener(() =>
            {
                battleMain.OnOpeningEnd.RemoveAllListeners();
                if (is_boss.Value)
                {
                    BGMControl.Instance.Play(Defines.BGM_NAME_BOSS);
                }
                else
                {
                    BGMControl.Instance.Play(Defines.BGM_NAME_BATTLE);
                }
                Finish();
            });
        }