示例#1
0
        public override void OnEnter()
        {
            base.OnEnter();

            if (item_type_sub.Value == "hp")
            {
                if (chara_id.Value == 0)
                {
                    foreach (DataUnitParam unit in DataManagerGame.Instance.dataUnit.list.FindAll(p => p.unit == "chara"))
                    {
                        unit.HpHeal(param.Value);
                    }
                }
                else
                {
                    DataUnitParam unit = DataManagerGame.Instance.dataUnit.list.Find(p => p.unit == "chara" && p.chara_id == chara_id.Value);
                    unit.HpHeal(param.Value);
                }
                GameMain.Instance.battleMain.HpRefresh();
                GameMain.Instance.CharaRefresh();
            }
            else if (item_type_sub.Value == "mp")
            {
                DataManagerGame.Instance.MpHeal(param.Value);
            }
            else if (item_type_sub.Value == "tension")
            {
                if (chara_id.Value == 0)
                {
                    foreach (DataUnitParam unit in DataManagerGame.Instance.dataUnit.list.FindAll(p => p.unit == "chara"))
                    {
                        DataManagerGame.Instance.dataUnit.AddTension(unit.chara_id, param.Value, DataManagerGame.Instance.masterChara.list);
                    }
                }
                else
                {
                    DataUnitParam unit = DataManagerGame.Instance.dataUnit.list.Find(p => p.unit == "chara" && p.chara_id == chara_id.Value);
                    DataManagerGame.Instance.dataUnit.AddTension(unit.chara_id, param.Value, DataManagerGame.Instance.masterChara.list);
                }
                GameMain.Instance.CharaRefresh();
            }
            else
            {
                Debug.LogError(item_type_sub.Value);
            }

            Finish();
        }
示例#2
0
        private IEnumerator HealEffectAppear(BattleIcon arg0)
        {
            // この微妙なずらし作業がしたかっただけ
            yield return(new WaitForSeconds(0.5f));

            int iHeal  = 12;
            int iSwing = UtilRand.GetRand(5) - 2;

            if (is_player.Value)
            {
                DataUnitParam unit_chara = DataManagerGame.Instance.dataUnit.list.Find(p => p.chara_id == select_chara_id.Value && p.unit == "chara");
                iHeal = unit_chara.heal + iSwing;
            }
            else
            {
                DataUnitParam unit_enemy = DataManagerGame.Instance.dataUnit.list.Find(p => p.unit == "enemy");
                iHeal = unit_enemy.heal + iSwing;
            }
            //Debug.Log(iDamage);

            battleMain.Heal(is_player.Value, iHeal, OnHealFinished);

            // プレイヤー側の攻撃
            if (arg0.is_left)
            {
                DataUnitParam unit_chara = DataManagerGame.Instance.dataUnit.list.Find(p => p.chara_id == select_chara_id.Value && p.unit == "chara");
                unit_chara.HpHeal(iHeal);
                GameMain.Instance.CharaRefresh();
            }
            else
            {
                DataUnitParam unit_enemy = DataManagerGame.Instance.dataUnit.list.Find(p => p.unit == "enemy");
                unit_enemy.HpHeal(iHeal);
            }
            battleMain.HpRefresh();
        }