Exemplo n.º 1
0
    /// <summary>
    /// 210216 仲間を回復する値を求める 効果量のみ求めるので内容が少ない
    /// </summary>
    public HealParameterDTO CalculateHealParameter(Unit unit, Weapon healRod, Unit targetUnit)
    {
        HealParameterDTO healParameterDTO = new HealParameterDTO();

        JobStatusDto jobstatusDto = unit.job.statusDto;
        int          unitMaxHp    = unit.maxhp + jobstatusDto.jobHp;
        int          unitLatk     = unit.latk + jobstatusDto.jobLatk;

        //必要な値はHPと遠攻 不要な値は使用しないでバフを受ける
        StatusDto        buffedStatus     = new StatusDto(unitMaxHp, unitLatk, 0, 0, 0, 0, 0, 0);
        StatusCalculator statusCalculator = new StatusCalculator();

        //武器、装飾品、スキルのバフ反映 最大値を上回らないようにして返される
        buffedStatus = statusCalculator.GetBuffedStatus(buffedStatus, unit.name, unit.equipWeapon, unit.equipAccessory, unit.job.skills, false);
        unitMaxHp    = buffedStatus.hp;
        unitLatk     = buffedStatus.latk;


        //戦闘にも使用するので本クラスに値を設定しておく
        healAmount = unitLatk + healRod.attack;

        //210226 スキル「癒し手」
        if (unit.job.skills.Contains(Skill.癒し手))
        {
            healAmount += 10;
        }

        //表示用DTO
        healParameterDTO.unitName  = unit.name;
        healParameterDTO.unitHp    = unit.hp;
        healParameterDTO.unitMaxHp = unitMaxHp;

        //Attackと表記してしまっているが回復量
        healParameterDTO.healAmount      = healAmount;
        healParameterDTO.unitHealRodName = healRod.name;

        //回復対象のステータスも設定する
        JobStatusDto TargetjobstatusDto = targetUnit.job.statusDto;

        healParameterDTO.targetName  = targetUnit.name;
        healParameterDTO.targetHp    = targetUnit.hp;
        healParameterDTO.targetMaxHp = statusCalculator.CalcHpBuff(targetUnit.maxhp + TargetjobstatusDto.jobHp, targetUnit.job.skills);



        return(healParameterDTO);
    }
Exemplo n.º 2
0
    /// <summary>
    /// 210216 回復をされる側のUI制御
    /// </summary>
    public void UpdateHealTargetText(HealParameterDTO healParameterDTO)
    {
        //HPのみ表示して後は使わないので「-」を表示
        healTargetNameText.text = healParameterDTO.targetName;
        weaponText.text         = "-";

        hpText.text           = string.Format("{0}", healParameterDTO.targetHp);
        attackText.text       = "-";
        hitRateText.text      = "-";
        criticalRateText.text = "-";

        hpSlider.maxValue = healParameterDTO.targetMaxHp;
        hpSlider.value    = healParameterDTO.targetHp;

        //相性や追撃は非表示にする
        chase.SetActive(false);
        advantage.SetActive(false);
        disadvantage.SetActive(false);
    }
Exemplo n.º 3
0
    /// <summary>
    /// 戦闘後の後処理 ここまで
    /// </summary>

    /// <summary>
    /// 戦闘開始前のUI制御系メソッド
    /// </summary>
    //210216仲間を回復する前のUI表示
    public void MapOpenHealView(Unit unit, PlayerModel selectedUnit)
    {
        //回復に使用する数値の計算を実施してUIに表示 必殺率、命中率、相手の攻撃力等が存在しない版
        HealParameterDTO healParameterDTO = battleCalculator.CalculateHealParameter(unit, unit.equipHealRod, selectedUnit.unit);

        battleView.GetComponent <BattleView>().HealUpdateText(healParameterDTO);

        //戦闘UI表示
        battleView.SetActive(true);

        //本クラスに戦闘するプレイヤーと敵を設定
        this.unit       = unit;
        healTargetModel = selectedUnit;

        battleConfirmWindow.GetComponent <BattleConfirmWindow>().UpdateConfirmtext("回復して良いですか?", false);
        battleConfirmWindow.SetActive(true);
        EventSystem.current.SetSelectedGameObject(null);
        EventSystem.current.SetSelectedGameObject(battleConfirmWindow.transform.Find("ButtonLayout/StartButton").gameObject);
    }
Exemplo n.º 4
0
    /// <summary>
    /// 210216 回復をする側のUI制御
    /// </summary>
    public void UpdateHealText(HealParameterDTO healParameterDTO)
    {
        //プレイヤー 名前と杖の名前を表示
        nameText.text   = healParameterDTO.unitName;
        weaponText.text = healParameterDTO.unitHealRodName;

        //回復するキャラのHP
        hpText.text = string.Format("{0}", healParameterDTO.unitHp);

        //回復量
        attackText.text       = healParameterDTO.healAmount.ToString();
        hitRateText.text      = "-";
        criticalRateText.text = "-";
        attackText.color      = Color.black;//210523 前の攻撃が特効の場合は、UIの文字色が赤くなっている場合が有る

        hpSlider.maxValue = healParameterDTO.unitMaxHp;
        hpSlider.value    = healParameterDTO.unitHp;

        //相性や追撃は非表示にする
        chase.SetActive(false);
        advantage.SetActive(false);
        disadvantage.SetActive(false);
    }
Exemplo n.º 5
0
 //回復版のウィンドウ更新 事前にSetHealModeを呼ぶこと
 public void HealUpdateText(HealParameterDTO healParameterDTO)
 {
     SetHealMode();
     unitStatusWindow.UpdateHealText(healParameterDTO);
     enemyStatusWindow.UpdateHealTargetText(healParameterDTO);
 }