Exemple #1
0
    /// <summary>
    /// 自軍ターンに選択された時、移動可能距離を表示する
    /// 200725 直接Main_MapをManagerから呼ばず、PlayerModelから呼んで移動距離、座標を渡す
    /// </summary>
    public void HighlightMovableCells()
    {
        //210226 スキル、ステータスアップの移動力増加計算
        StatusCalculator statusCalculator = new StatusCalculator();

        moveAmount = statusCalculator.calcMove(unit);

        map.HighlightMovableCells(x, z, moveAmount, unit.equipWeapon, CalculationMode.PLAYER_MOVE);
    }
Exemple #2
0
    //ステータス表示(敵)
    public void updateText(Enemy enemy)
    {
        //職業補正を取得
        JobStatusDto jobStatusDto = enemy.job.statusDto;

        //名前、レベル、職業、移動力
        this.name.text  = enemy.name;
        this.race.text  = enemy.race.GetStringValue();
        this.lvNum.text = enemy.lv.ToString();
        this.job.text   = enemy.job.jobName.ToString();
        this.exp.text   = "-";  //敵に経験値やレベルアップは存在しない
        this.move.text  = enemy.job.move.ToString();

        //210226移動力計算と文字の色変更
        StatusCalculator statusCalculator = new StatusCalculator();

        int move = statusCalculator.calcMove(enemy);

        this.move.text = move.ToString();

        //経験値ゲージ
        this.expGauge.maxValue = 100;
        this.expGauge.value    = 0; //敵に経験値やレベルアップは存在しない

        //ステータス ユニット基礎値と職業補正の合算を表示する
        int hp   = enemy.maxhp + jobStatusDto.jobHp;
        int latk = enemy.latk + jobStatusDto.jobLatk;
        int catk = enemy.catk + jobStatusDto.jobCatk;
        int agi  = enemy.agi + jobStatusDto.jobAgi;
        int dex  = enemy.dex + jobStatusDto.jobDex;
        int luk  = enemy.luk + jobStatusDto.jobLuk;
        int ldef = enemy.ldef + jobStatusDto.jobLdef;
        int cdef = enemy.cdef + jobStatusDto.jobCdef;

        //キャラの画像を取得
        if (enemy.isBoss)
        {
            statusImage.enabled     = true;
            this.statusImage.sprite = Resources.Load <Sprite>("Image/Charactors/" + enemy.pathName + "/status");
        }
        else
        {
            statusImage.enabled = false;
        }

        //武器レベルを反映
        this.shotLevel.text   = enemy.shotLevel.GetStringValue();
        this.laserLevel.text  = enemy.laserLevel.GetStringValue();
        this.strikeLevel.text = enemy.strikeLevel.GetStringValue();
        this.healLevel.text   = enemy.healLevel.GetStringValue();

        //敵に技能経験値は存在しないので、ゲージ自体非表示
        shotGaugeFrame.SetActive(false);
        laserGaugeFrame.SetActive(false);
        strikeGaugeFrame.SetActive(false);
        healGaugeFrame.SetActive(false);

        if (move != enemy.job.move)
        {
            //バフが掛かってたら色変更
            this.move.color = highLightColor;
        }
        else
        {
            this.move.color = Color.white;
        }


        //210218 武器、装飾品による増加分を反映する スキルのバフもいずれ実装
        StatusDto normalStatus = new StatusDto(hp, latk, catk, agi, dex, ldef, cdef, luk);

        //武器、装飾品、スキルのバフ反映 最大値を上回らないようにして返される
        bool isberserk = false;

        if (enemy.hp != statusCalculator.CalcHpBuff(hp, enemy.job.skills) && enemy.job.skills.Contains(Skill.狂化))
        {
            isberserk = true;
        }
        StatusDto buffedStatus = statusCalculator.GetBuffedStatus(normalStatus, enemy.name, enemy.equipWeapon, enemy.equipAccessory, enemy.job.skills, isberserk);

        GetStatus(normalStatus, buffedStatus);
    }
Exemple #3
0
    //テキスト更新
    //200719 職業のステータスを反映
    public void updateText(Unit unit)
    {
        //職業補正を取得
        JobStatusDto jobStatusDto = unit.job.statusDto;

        //名前、レベル、職業、移動力
        this.name.text  = unit.name;
        this.race.text  = unit.race.GetStringValue();
        this.lvNum.text = unit.lv.ToString();
        this.job.text   = unit.job.jobName.ToString();
        this.exp.text   = unit.exp.ToString();
        this.move.text  = unit.job.move.ToString();

        //210226移動力計算と文字の色変更
        StatusCalculator statusCalculator = new StatusCalculator();

        int move = statusCalculator.calcMove(unit);

        this.move.text = move.ToString();

        //経験値ゲージ
        this.expGauge.maxValue = 100;
        this.expGauge.value    = unit.exp;

        //ステータス ユニット基礎値と職業補正の合算を表示する
        int hp   = unit.maxhp + jobStatusDto.jobHp;
        int latk = unit.latk + jobStatusDto.jobLatk;
        int catk = unit.catk + jobStatusDto.jobCatk;
        int agi  = unit.agi + jobStatusDto.jobAgi;
        int dex  = unit.dex + jobStatusDto.jobDex;
        int luk  = unit.luk + jobStatusDto.jobLuk;
        int ldef = unit.ldef + jobStatusDto.jobLdef;
        int cdef = unit.cdef + jobStatusDto.jobCdef;

        //キャラの画像を取得
        statusImage.enabled     = true;
        this.statusImage.sprite = Resources.Load <Sprite>("Image/Charactors/" + unit.pathName + "/status");

        //武器レベルを反映
        this.shotLevel.text   = unit.shotLevel.GetStringValue();
        this.laserLevel.text  = unit.laserLevel.GetStringValue();
        this.strikeLevel.text = unit.strikeLevel.GetStringValue();
        this.healLevel.text   = unit.healLevel.GetStringValue();

        //210218 やっと技能経験値を表示するように設定した
        shotGauge.value   = unit.shotExp;
        laserGauge.value  = unit.laserExp;
        strikeGauge.value = unit.strikeExp;
        healGauge.value   = unit.healExp;

        //ゲージの必要経験値(maxValue)をスキルレベルより設定する
        shotGauge.maxValue   = unit.shotLevel.GetIntValue();
        laserGauge.maxValue  = unit.laserLevel.GetIntValue();
        strikeGauge.maxValue = unit.strikeLevel.GetIntValue();
        healGauge.maxValue   = unit.healLevel.GetIntValue();



        if (move != unit.job.move)
        {
            //バフが掛かってたら色変更
            this.move.color = highLightColor;
        }
        else
        {
            this.move.color = Color.white;
        }

        //スキルレベルがNONEかSの場合はゲージ自体を表示しない
        if (unit.shotLevel == SkillLevel.NONE || unit.shotLevel == SkillLevel.S)
        {
            shotGaugeFrame.SetActive(false);
        }
        else
        {
            shotGaugeFrame.SetActive(true);
        }
        if (unit.laserLevel == SkillLevel.NONE || unit.laserLevel == SkillLevel.S)
        {
            laserGaugeFrame.SetActive(false);
        }
        else
        {
            laserGaugeFrame.SetActive(true);
        }
        if (unit.strikeLevel == SkillLevel.NONE || unit.strikeLevel == SkillLevel.S)
        {
            strikeGaugeFrame.SetActive(false);
        }
        else
        {
            strikeGaugeFrame.SetActive(true);
        }
        if (unit.healLevel == SkillLevel.NONE || unit.healLevel == SkillLevel.S)
        {
            healGaugeFrame.SetActive(false);
        }
        else
        {
            healGaugeFrame.SetActive(true);
        }

        //210218 武器、装飾品による増加分を反映する スキルのバフもいずれ実装
        StatusDto normalStatus = new StatusDto(hp, latk, catk, agi, dex, ldef, cdef, luk);

        //武器、装飾品、スキルのバフ反映 最大値を上回らないようにして返される
        bool isberserk = false;

        if (unit.hp != statusCalculator.CalcHpBuff(hp, unit.job.skills) && unit.job.skills.Contains(Skill.狂化))
        {
            isberserk = true;
        }
        StatusDto buffedStatus = statusCalculator.GetBuffedStatus(normalStatus, unit.name, unit.equipWeapon, unit.equipAccessory, unit.job.skills, isberserk);

        GetStatus(normalStatus, buffedStatus);
    }