Beispiel #1
0
    public long _damage;        //누적 데미지

    public void OnSet(int code) //기본 정보 세팅
    {
        _data_code = code;

        _team_data = GameData.Instance._playerData._team[_data_code];
        for (var i = 0; i < _team_data._member.Count; i++)
        {
            if (_team_data._member[i] < 0)
            {
                continue;
            }

            for (var j = 0; j < GameData.Instance._unitMN._unit_data.Count; j++)
            {
                if (GameData.Instance._unitMN._unit_data[j]._unit_index == _team_data._member[i])
                {
                    _member[i] = GameData.Instance._unitMN._unit_data[j];
                    _member[i].OnTeamIn(_data_code, i);
                }
            }
        }
        _lv  = _team_data._lv;
        _map = _team_data._map;

        _stage  = _team_data._stage;
        _round  = _team_data._round;
        _status = _team_data._status;

        OnStatusSetting();
    }
Beispiel #2
0
    public void OnTeamOut(int slot, UnitData member) //팀 배치 해제
    {
        _team_data = GameData.Instance._playerData._team[_data_code];
        _team_data._member[slot] = -1;
        GameData.Instance._playerData._team[_data_code] = _team_data;

        _member[slot].OnTeamOut();
        _member[slot] = null;
    }
Beispiel #3
0
    public void OnTeamIn(int slot, UnitData member) //팀 배치
    {
        _team_data = GameData.Instance._playerData._team[_data_code];
        _team_data._member[slot] = member._data_index;
        GameData.Instance._playerData._team[_data_code] = _team_data;

        _member[slot] = member;
        _member[slot].OnTeamIn(_data_code, slot);
    }
Beispiel #4
0
    public void OnStage(bool next)
    {
        bool next_stage = false;

        _team_data = GameData.Instance._playerData._team[_data_code];

        if (next)
        {
            _round += 1;

            if (_round > 5)
            {
                _round  = 1;
                _stage += 1;
                _map    = Random.Range(1, GameData.Instance._monsterDataIndex.Count + 1);

                if (_stage % 10 <= 0)
                {
                    _lv           += 1;
                    _team_data._lv = _lv;
                }

                next_stage = true;
            }
        }
        else
        {
            _round = 1;
        }

        _team_data._map   = _map;
        _team_data._stage = _stage;
        _team_data._round = _round;

        GameData.Instance._playerData._team[_data_code] = _team_data;

        OnStageInfo();

        if (next_stage)
        {
            _battle.OnWinNext();
        }
        else
        {
            _battle.OnWin();
        }
    }
Beispiel #5
0
    public void OnTeamStatus(int code)//원정대 상태(0 : 원정 대기 / 1 : 원정중 / 2 : 회복중)
    {
        if (code == 1)
        {
            _damage = 0;
        }

        _status            = code;
        _team_data         = GameData.Instance._playerData._team[_data_code];
        _team_data._status = code;
        GameData.Instance._playerData._team[_data_code] = _team_data;

        if (GameData.Instance._expeditionMN._team_now == _data_code)
        {
            GameData.Instance._expeditionMN.OnTeamStatusText(code);//팀 상태
        }
    }
Beispiel #6
0
    public void Initialize(float moveSpeed, int damage, GameData.Team team, GameData.ShotType shotType, Transform shooter = null)
    {
        this.moveSpeed = moveSpeed;
        this.damage = damage;
        this.team = team;
        this.shotType = shotType;

        if(shooter != null)
        {
            this.shooter = shooter;
        }

        if(speedIndic != null)
        {
            if(this.shotType == GameData.ShotType.Charged)
            {
                speedIndic.Play();
                this.damage = 150;
            }
        }
    }
Beispiel #7
0
 //
 // Use this for initialization
 void Start()
 {
     currentHp = INITIALHP;
     if (isTutorialLevel) {
         currentHp = 1;
     }
     team = GameData.Team.Player;
     controller = GetComponent<TwinStickController>();
     gameController = Camera.main.GetComponent<GameController>();
     affectHealthIndicator();
     //
 }