예제 #1
0
    void Open()
    {
        string text      = "";
        string narration = "";

        if (!mimic)
        {
            text      = _result[0]._treasure._items[0]._name + " 획득\n" + _result[0]._treasure.gold + " 골드 획득";
            narration = DataPool._current._ScriptionDic["FindTresure"]
                        [Random.Range(0, DataPool._current._ScriptionDic["FindTresure"].Count)];
            _gm.StartNarration(narration);
            _gm.SetEnd();
            _cardScript.CardEnd(text);
        }
        else
        {
            narration = DataPool._current._ScriptionDic["Mimic"]
                        [Random.Range(0, DataPool._current._ScriptionDic["Mimic"].Count)];
            _gm.StartNarration(narration);
            text = "응 미믹";
            ObjectInfo enemy = (ObjectInfo)DataPool._current._eventObjDic["Mimic"][0].Clone();
            _player.ObjShake();
            _player.Damaged(CaculateScript.MonsterAttack(enemy));
            _gm.SetPlayerHPOnUI();
            _cardScript.ChangeMonster(enemy);
        }
        _cardScript.SetFrontDesc(text);
        _cardScript.ReFlip();
    }
예제 #2
0
    void Attack()
    {
        if (Random.Range(0.1f, 100f) <= _result[0]._frequency)
        {
            //성공
            string text = "그대는 " + _enemyInfo._name + "에게 " + _result[0]._success + "의 데미지를 입혔다.";
            _enemyInfo._health -= _result[0]._success;
            string narration;
            if (_enemyInfo._health < 0)
            {
                //적 처치
                EnemyDown();
                text     += "\n" + "적이 쓰러졌다.";
                narration = DataPool._current._ScriptionDic["MonsterDown"]
                            [Random.Range(0, DataPool._current._ScriptionDic["MonsterDown"].Count)];
                _cardScript.CardEnd(ResultMessage());
                //_card.SendMessage("CardEnd");

                _enemyObjCtrl.CloseObject();
                _gm.SetEnd();
            }
            else
            {
                narration = DataPool._current._ScriptionDic["PlayerAttack"]
                            [Random.Range(0, DataPool._current._ScriptionDic["PlayerAttack"].Count)];

                //적 생존
            }
            _cardScript.SetFrontDesc(text);
            //_card.SendMessage("SetFrontDesc", text);
            //_cardScript.CardShake();
            _enemyObjCtrl.ObjShake();
            _gm.StartNarration(narration);
        }
        else
        {
            //실패
            if (Random.Range(0.1f, 100f) <= 70)
            {
                //적의 공격 성공

                _cardScript.SetFrontDesc(_enemyInfo._name + "(는/이) 그대에게 3의 데미지를 입혔다.");
                _gm.StartNarration(DataPool._current._ScriptionDic["MonsterAttack"]
                                   [Random.Range(0, DataPool._current._ScriptionDic["MonsterAttack"].Count)]);
                _player.Damaged(CaculateScript.MonsterAttack(_enemyInfo));
                _player.ObjShake();
                _gm.SetPlayerHPOnUI();
            }
            else
            {
                //적의 공격 실패
                _cardScript.SetFrontDesc("서로 회피하였다.");
                //_card.SendMessage("SetFrontDesc", "서로 회피하였다.");
                _gm.StartNarration(DataPool._current._ScriptionDic["Miss"]
                                   [Random.Range(0, DataPool._current._ScriptionDic["Miss"].Count)]);
            }
        }
        _cardScript.ReFlip();
        //_card.SendMessage("ReFlip");
        _eventCount++;
    }