コード例 #1
0
 public bool checkingDefaultAttackRange(Monster attacker, Monster target, IVector3 targetPosition, float offset = 0.0f)
 {
     if (attacker.isPlayerSide == false)
     {
         if (isShortType)
         {
             return(VectorUtil.DistanceXZ(targetPosition, attacker.cTransformPosition) <= (IFloat)(attacker.stat.atkRange + target.damageRange + offset + attacker.damageRange));                                // hitrange
         }
         else
         {
             return(Xfloat.lessEqualThan(attacker.cTransformPosition.x - attacker.stat.atkRange - offset - attacker.damageRange, targetPosition.x + target.hitObject.lineRight));
         }
     }
     else
     {
         if (isShortType)
         {
             return(Xfloat.lessEqualThan(VectorUtil.DistanceXZ(targetPosition, attacker.cTransformPosition), attacker.stat.atkRange + target.damageRange + offset + attacker.damageRange));                                 // hitrange
         }
         else
         {
             return(Xfloat.greatEqualThan(attacker.cTransformPosition.x + attacker.stat.atkRange + offset + attacker.damageRange, target.hitObject.lineLeft + targetPosition.x));
         }
     }
 }
コード例 #2
0
    public bool checkGameClearArrive(int attr = -1, Monster mon = null)
    {
        if (GameManager.me.isPlaying == false)
        {
            return(false);
        }

        if (attr == ClearChecker.CHECK_TIME)
        {
            updateDistance();
            if (Xfloat.greatEqualThan((GameManager.me.player.cTransformPosition.x + StageManager.ARRIVE_DISTANCE_BUFFER).AsFloat(), nowRound.targetPos.Get()))
            {
                nowPlayingGameResult = Result.Type.Clear;
                GameManager.me.mapManager.clearRound();
                GameManager.me.uiManager.uiPlay.lbRoundLeftNum.text = "0m";
                return(true);
            }
        }

        return(false);
    }
コード例 #3
0
    public bool checkClear(int attr)
    {
        updateDistance();

        if (GameManager.me.isPlaying == false)
        {
            return(false);
        }

        switch (waveType)
        {
        case RoundData.MODE_TYPE.SNIPING:

            if (nowRound.targetHpPer >= 0)
            {
                if (StageManager.instance.heroMonster[nowRound.targetIndex].hpPer * 100.0f <= nowRound.targetHpPer)
                {
                    GameManager.me.mapManager.clearRound();
                    return(true);
                }
            }
            else if (StageManager.instance.heroMonster[nowRound.targetIndex].hp <= 0)
            {
                GameManager.me.mapManager.clearRound();
                return(false);
            }

            if (attr == ClearChecker.CHECK_AFTER_DELETE)
            {
                if (StageManager.instance.heroMonster[nowRound.targetIndex].isEnabled == false)
                {
                    GameManager.me.mapManager.clearRound();
                }
            }

            break;

        case RoundData.MODE_TYPE.ARRIVE:

            if (attr == ClearChecker.CHECK_TIME)
            {
                //updateDistance();
                if (Xfloat.greatEqualThan((GameManager.me.player.cTransformPosition.x + StageManager.ARRIVE_DISTANCE_BUFFER).AsFloat(), nowRound.targetPos.Get()))
                {
                    GameManager.me.mapManager.clearRound();
                    GameManager.me.uiManager.uiPlay.lbRoundLeftNum.text = "0m";
                    return(true);
                }
            }


            break;

        case RoundData.MODE_TYPE.KILLEMALL:

            if (attr == ClearChecker.CHECK_AFTER_DELETE)
            {
                if ((GameManager.me.mapManager.bossNum + GameManager.me.mapManager.monUnitNum) == 0)
                {
                    GameManager.me.mapManager.clearRound();
                }
            }

            break;
        }

        return(false);
    }