예제 #1
0
    //パッケージ化入力
    public bool InputNewAttribute(Material material)
    {
        float propotion = 1;

        if (capacity >= maxCapacity)
        {
            return(false);
        }
        if (material.capacity + capacity >= maxCapacity)
        {
            propotion = (maxCapacity - capacity) / material.capacity;//もし上限を超えたら
        }

        InputRestraint(material.ReferThisType(), material.damage * propotion);
        capacity += material.capacity;
        if (capacity > maxCapacity)
        {
            capacity = maxCapacity;
        }

        best = FindMax();
        SetColor();

        return(true);
    }
예제 #2
0
    TwoNum FindMax()
    {
        float  max  = 0;
        TwoNum mark = new TwoNum();

        for (int i = 0; i < (int)Type.type_amount; i++)
        {
            if (status[i] > max)
            {
                max    = status[i];
                mark.a = i;
            }
        }
        max = 0;
        for (int i = 0; i < (int)Type.type_amount; i++)
        {
            if (i == mark.a)
            {
                continue;
            }
            if (status[i] > max)
            {
                max    = status[i];
                mark.b = i;
            }
        }

        return(mark);
    }
예제 #3
0
 public TypeOfMagic()
 {
     for (int i = 0; i < (int)Type.type_amount; i++)
     {
         status[i] = 0f;
     }
     capacity    = 0;
     crBox       = new ColorBox();
     best        = new TwoNum();
     targetColor = crBox.GetThis((int)Type.noneType, 1f);
 }
예제 #4
0
    public TypeOfMagic(int thisType, float Damage, int capacity)
    {
        for (int i = 0; i < (int)Type.type_amount; i++)
        {
            status[i] = 0f;
        }
        capacity    = 0;
        crBox       = new ColorBox();
        best        = new TwoNum();
        targetColor = crBox.GetThis((int)Type.noneType, 1f);

        status[thisType] += Damage;
        capacity         += capacity;

        best = FindMax();
    }