/// <summary>
 /// Trueなら治る
 /// </summary>
 /// <param name="st"></param>
 /// <param name="turn"></param>
 /// <returns></returns>
 public static bool IsRecoverState(StateAbnormal st, int turn)
 {
     if (table[st].RecoverTurnStart > turn)
     {
         return(false);
     }
     if (CommonFunction.IsConvergenceRandom(turn - table[st].RecoverTurnStart, table[st].ContinueState, table[st].ConiinueReducePer))
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Пример #2
0
    public float GetAbnormalPrevent(StateAbnormal val, float preventP)
    {
        switch (OType)
        {
        //異常抵抗
        case OptionType.DefenceAbnormal:

            if ((AbnormalStateTarget & (int)val) != 0)
            {
                float prevent = CommonFloat * Plus;
                if (preventP < prevent)
                {
                    preventP = prevent;
                }
            }
            break;
        }
        return(preventP);
    }
Пример #3
0
    //状態異常抵抗値の反映
    public float GetAbnormalPrevent(StateAbnormal val)
    {
        float prevent = 0;

        switch (RType)
        {
        //耐性指輪による抵抗値の格納
        case RingType.AbnormalPrevent:

            if ((PreventAbnormal & (int)val) != 0)
            {
                prevent = 1;
            }
            break;

        //壮健
        case RingType.Health:
            prevent = 0.3f;
            break;
        }
        return(prevent);
    }
Пример #4
0
    public void TurnFInish(BaseCharacter target, ManageDungeon dun)
    {
        //ふたつの指輪だったら
        if (RType == RingType.TwoRing)
        {
            //毎ターンスコアを減額
            ScoreInformation.Info.AddScore(-100);

            //キャラが正常だったら状態異常をランダム付与
            if (target.CharacterAbnormalState == 0)
            {
                VoiceInformation.Voice.Play(PlayerInformation.Info.PType, VoiceInformation.Voice.PlayRandomDefence());
                SoundInformation.Sound.Play(SoundInformation.SoundType.Smoke);

                EffectSmoke.CreateObject(target).Play();

                StateAbnormal st = CommonFunction.GetRandomAbnormal();
                //switch (st)
                //{
                //    case StateAbnormal.Sleep:
                //        DisplayInformation.Info.AddMessage(
                //            string.Format(CommonConst.Message.AddSleep, target.DisplayNameInMessage));
                //        break;
                //    case StateAbnormal.Slow:
                //        DisplayInformation.Info.AddMessage(
                //            string.Format(CommonConst.Message.AddSlow, target.DisplayNameInMessage));
                //        break;
                //    case StateAbnormal.Dark:
                //        DisplayInformation.Info.AddMessage(
                //            string.Format(CommonConst.Message.AddDark, target.DisplayNameInMessage));
                //        break;
                //    case StateAbnormal.StiffShoulder:
                //        DisplayInformation.Info.AddMessage(
                //            string.Format(CommonConst.Message.AddShoulder, target.DisplayNameInMessage));
                //        break;
                //    default:
                //        DisplayInformation.Info.AddMessage(
                //            string.Format(CommonConst.Message.AddState, target.DisplayNameInMessage,
                //            CommonFunction.StateNames[st]));
                //        break;
                //}

                DisplayInformation.Info.AddMessage(
                    CommonFunction.GetAbnormalMessage(st, target));
                target.AddStateAbnormal(st);
            }
        }
        else if (RType == RingType.Unlucky)
        {
            if (CommonFunction.IsRandom(0.01f) == true)
            {
                //落とす対象を取得
                BaseItem[] targets = PlayerCharacter.ItemList.FindAll(i => i.IsEquip == false && i.IsDrive == false).ToArray();

                //対象があればランダムで落とす
                if (targets.Length > 0)
                {
                    //対象の中からランダムで一つ抽出
                    BaseItem tar = targets[UnityEngine.Random.Range(0, targets.Length)];

                    DisplayInformation.Info.AddMessage(
                        string.Format(CommonConst.Message.ThrowOffItem,
                                      target.DisplayNameInMessage,
                                      tar.DisplayNameInMessage
                                      ));

                    //プレイヤーから持ち物削除
                    PlayerCharacter.RemoveItem(tar);

                    dun.PutItem(tar, this.CurrentPoint, this.CurrentPoint);

                    tar.ResetObjectPosition();
                }
            }
        }
    }