Esempio n. 1
0
 //EffectMappingが呼ばれるたびにフィールド変数の値を更新する
 private void FieldUpdate()
 {
     //ゲーム全体に関して
     mapPosition.ObjectInformation(ref obstaclemap, ref charamap);
     turn           = battleMapManager.turn;
     encampmentflag = battleMapManager.flagproperties;
     pencam         = 0;
     eencam         = 0;
     for (int i = 0; i < encampmentnum; i++)
     {
         if (encampmentflag[i, 2] == 0)
         {
             pencam++;
         }
         else
         {
             eencam++;
         }
     }
     //敵に関して
     enemyx           = enemyStatus.posX;
     enemyy           = enemyStatus.posY;
     enemyatk         = enemyStatus.attack;
     enemydef         = enemyStatus.defense;
     enemyhp          = enemyStatus.hp;
     enemyhpmax       = enemyStatus.maxhp;
     eLongRangeAttack = enemyStatus.farAttacker;
     enemyJob         = enemyStatus.actionKind;
     eprotectionposx  = enemyStatus.saveX;
     eprotectionposy  = enemyStatus.saveY;
     //味方に関して                                                                ←{# 死亡判定に気を付けつつ #}
     for (int i = 0; i < 4; i++)
     {
         if (player[i] != null)
         {
             pPosx[i]  = playerStatus[i].posX;
             pPosy[i]  = playerStatus[i].posY;
             pAtk[i]   = playerStatus[i].attack;
             pDef[i]   = playerStatus[i].defense;
             pHp[i]    = playerStatus[i].hp;
             pHpmax[i] = playerStatus[i].maxhp;
             for (int ti = 0; ti <= turn; ti++)
             {
                 pAct[i, ti] = playerStatus[i].actionLevel[ti];
             }
         }
         else
         {
             pPosx[i] = 0;
             pPosy[i] = 0;
             pHp[i]   = 0;
         }
     }
     //結果用変数、配列に関して
     battlechoice  = 0;
     battlecommand = 0;
     effectmap     = new float[maprange[0], maprange[1]];
     destination   = new int[2];
     attackpos     = new int[2];
 }
    //onMouseObject,mousePosの更新
    public void mouseUpdate()
    {
        Vector3 mouseWorldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition);

        mousePos[0] = (int)((mouseWorldPoint.x - intercept[0]) / side);
        mousePos[1] = (int)((mouseWorldPoint.y * (-1) - intercept[1]) / side);
        if (mousePos[0] >= 0 && mousePos[0] < maprange[0] && mousePos[1] >= 0 && mousePos[1] < maprange[1])
        {
            mapPosition.ObjectInformation(ref obstaclemap, ref charamap);
            //   Debug.Log("onMouseObject");
            if (charamap[mousePos[0], mousePos[1]] != null)
            {
                onMouseObject = charamap[mousePos[0], mousePos[1]];
            }
            else
            {
                onMouseObject = GameObject.FindGameObjectWithTag("null");
            }
        }
        else
        {
            onMouseObject = GameObject.FindGameObjectWithTag("null");
        }
    }