Example #1
0
    //0 なし1=ハード 2=ソフト 3=ライン
    float[] GetTotal(int rod, int current, int itemType, bool isSoftData)
    {
        //TotalLureParams_Tittles,飛距離;感度;適合サイズ;フッキング;強度,Distance;Fish Size;Stock;Foocking;Strength

        Debug.Log("GetTotal " + rod + " " + current + " " + itemType);

        float[] vals = new float[5] {
            0.0f, 0.0f, 0.0f, 0.0f, 0.0f
        };
        //総計して1.0に持ってく
        if (DataManger.Instance.GAMEDATA.tackleSlots[rod].lineNum == -1)
        {
            if (itemType == 3 && current != -1)
            {
            }
            else
            {
                Debug.Log("ラインを装備していない return");
                return(vals);
            }
        }
        if (DataManger.Instance.GAMEDATA.tackleSlots[rod].lureNum == -1)
        {
            if (itemType <= 2 && current != -1)
            {
            }
            else
            {
                Debug.Log("ルアーを装備していない return");
                return(vals);
            }
        }
        bool isSoft = isSoftData;

        int line = DataManger.Instance.GAMEDATA.tackleSlots[rod].lineNum;

        if (itemType == 3 && current != -1 && line != current)
        {
            Debug.LogError("ラインオーバーライド");
            line = current;
        }
        int lure = DataManger.Instance.GAMEDATA.tackleSlots[rod].lureNum;

        if (itemType < 3 && current != -1 && lure != current)
        {
            Debug.LogError("ルアーオーバーライド");
            lure = current;
        }
        int rigNum = 0;



        if (isSoft)
        {
            rigNum = equipSoft.GetEquippedRigID(lure);
        }

        if (lure == -1 || line == -1 || rigNum == -1)
        {
            Debug.LogError("やばいやつ");
            return(vals);
        }

        float aishou = 1.0f;

        aishou += GetAishouLure(rod, lure, isSoft);
        Debug.Log("相性 ルアーとライン " + aishou.ToString("F2"));
        aishou += GetAishouLine(rod, line);
        Debug.Log("相性 ロッドとライン " + aishou.ToString("F2"));

        //飛距離 重いルアーほど飛ぶ 軽いラインほど飛ぶ ロッドの性能もあるがベイトは飛ばない  (60:30:10)
        if (!isSoft)
        {
            vals[0] = PSGameUtils.WariaiVals(new float[] { Constants.LureDatas.graph_2[lure], Constants.LineDatas.graph_2[line], Constants.RodsDatas.graph_2[rod] }, new int[] { 60, 30, 10 });
        }
        else
        {
            //ソフトはリグ込みで出す
            vals[0] = PSGameUtils.WariaiVals(new float[] { Constants.SoftLureDatas.graph_2[lure] + Constants.RigDatas.graph_2[rigNum], Constants.LineDatas.graph_2[line], Constants.RodsDatas.graph_2[rod] }, new int[] { 60, 30, 10 });
        }


        //感度 ラインの感度 ロッドの感度(60:40)
        if (!isSoft)
        {
            vals[1] = PSGameUtils.WariaiVals(new float[] { Constants.LineDatas.graph_5[line], Constants.RodsDatas.graph_5[rod] }, new int[] { 60, 40 });
        }
        else
        {
            //ソフトはリグ込みで出す
            vals[1] = PSGameUtils.WariaiVals(new float[] { Constants.LineDatas.graph_5[line], Constants.RodsDatas.graph_5[rod] }, new int[] { 60, 40 });
        }

        //サイズ(サイズに対する難易度を決定する)  ライン強度 ロッド強度 (70:30) ルアーのサイズは最低を決める
        if (!isSoft)
        {
            vals[2] = PSGameUtils.WariaiVals(new float[] { Constants.LineDatas.graph_3[line], Constants.RodsDatas.graph_3[rod] }, new int[] { 70, 30 });
        }
        else
        {
            //ソフトはリグ込みで出す
            vals[2] = PSGameUtils.WariaiVals(new float[] { Constants.LineDatas.graph_3[line], Constants.RodsDatas.graph_3[rod] }, new int[] { 70, 30 });
        }

        //フッキング  ロッド性能 ルアーのフック性能 ライン性能 (20:30:50) ルアーのサイズは最低を決める
        if (!isSoft)
        {
            vals[3] = PSGameUtils.WariaiVals(new float[] { Constants.LineDatas.graph_4[line], Constants.LureDatas.graph_4[lure], Constants.RodsDatas.graph_4[rod] }, new int[] { 50, 30, 20 });
        }
        else
        {
            //ソフトはリグ込みで出す
            vals[3] = PSGameUtils.WariaiVals(new float[] { Constants.LineDatas.graph_4[line], Constants.RigDatas.graph_4[rigNum], Constants.RodsDatas.graph_4[rod] }, new int[] { 50, 30, 20 });
        }

        //強度 強いほど切れない 引いてこれる ロッド ライン(20:80)
        if (!isSoft)
        {
            vals[4] = PSGameUtils.WariaiVals(new float[] { Constants.LineDatas.graph_3[line], Constants.RodsDatas.graph_3[rod] }, new int[] { 20, 80 });
        }
        else
        {
            //ソフトはリグ込みで出すs
            vals[4] = PSGameUtils.WariaiVals(new float[] { Constants.LineDatas.graph_3[line], Constants.RodsDatas.graph_3[rod] }, new int[] { 20, 80 });
        }

        Debug.Log(" " + vals[0] + " " + vals[1] + " " + vals[2] + " " + vals[3] + " " + vals[4]);

        //飛距離;感度;適合サイズ;フッキング;強度
        vals[0] = vals[0] * aishou;
        vals[1] = vals[1] * aishou;
        vals[2] = vals[2] * aishou;
        vals[3] = vals[3] * aishou;
        vals[4] = vals[4] * aishou;

        Debug.LogError("飛距離" + vals[0] + " 感度" + vals[1] + " 適合サイズ" + vals[2] + " フッキング" + vals[3] + " 強度" + vals[4]);

        return(vals);
    }