示例#1
0
    void NetworkManager.NetworkMessageEventListenrer.ReceiveNetworkMessage(NetworkManager.MessageEvent e)
    {
        if (e.msgType.Equals(NetworkManager.HP_UPDATE))
        {
            // 데미지 입은것이 들어옴
            if (e.targetName.Equals(m_name) && !GameManager.Instance().PLAYER.USER_NAME.Equals(e.user))
            {
                if (m_damageCoolTime)
                {
                    return;
                }
                m_damageCoolTime = true;
                GameManager.Instance().SetCurrentEnemy(this);

                base.Damage((int)e.msg.GetField(NetworkManager.HP_UPDATE).i);
                if (m_hp <= 0)
                {
                    MapManager.Instance().AddObject(GamePath.EFFECT, transform.position);
                    NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_name, "Monster"));
                    NetworkManager.Instance().RemoveNetworkOrderMessageEventListener(this);
                    GameObject.Destroy(gameObject);
                    return;
                }

                m_damageCoolTime = true;
                if (!IsInvoking("DamageEffect"))
                {
                    InvokeRepeating("DamageEffect", 0.1f, 0.1f);
                }
            }
        }
    }
示例#2
0
    void NetworkManager.NetworkMessageEventListenrer.ReceiveNetworkMessage(NetworkManager.MessageEvent e)
    {
        if (e.msgType.Equals(NetworkManager.HP_UPDATE))
        {
            // 데미지 입은것이 들어옴
            if (e.targetName.Equals(m_name) &&
                !GameManager.Instance().PLAYER.USER_NAME.Equals(e.user))
            {
                GameManager.Instance().SetCurrentEnemy(this);
                base.Damage((int)e.msg.GetField(NetworkManager.HP_UPDATE).i);
                if (m_hp <= 0)
                {
                    MapManager.Instance().AddObject(GamePath.EFFECT, transform.position);

                    if (!m_tutorial)
                    {
                        NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_name, "Monster"));
                        NetworkManager.Instance().RemoveNetworkOrderMessageEventListener(this);
                    }
                    else
                    {
                        m_tutoRobo.TutoKillMonster();
                    }

                    GameObject.Destroy(gameObject);
                }
            }
        }
    }
示例#3
0
    public override void Damage(int damage)
    {
        base.Damage(damage);

        if (!m_tutorial)
        {
            NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonHPUdate(m_name, m_hp));
        }

        if (m_hp <= 0)
        {
            MapManager.Instance().AddObject(GamePath.EFFECT, transform.position);

            if (!m_tutorial)
            {
                NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_name, "Monster"));
                NetworkManager.Instance().RemoveNetworkOrderMessageEventListener(this);
            }
            else
            {
                m_tutoRobo.TutoKillMonster();
            }

            GameObject.Destroy(gameObject);
        }
    }
示例#4
0
 public override void Damage(int damage)
 {
     base.Damage(damage);
     if (m_hp <= 0)
     {
         MapManager.Instance().AddObject(GamePath.EFFECT, transform.position);
         NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_name, "Monster"));
         GameObject.Destroy(gameObject);
         return;
     }
     NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonHPUdate(m_name, m_hp));
 }
示例#5
0
    void Update()
    {
        if (m_hp <= 0)
        {
            MapManager.Instance().AddObject(GamePath.EFFECT, transform.position);
            NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_name, "Monster"));
            GameObject.Destroy(gameObject);
            return;
        }
        if (Input.GetKeyUp(KeyCode.I))
        {
            GameManager.Instance().SetCurrentEnemy(this);

            Damage(20);
        }
        if (m_pattern != null)
        {
            m_pattern.Update(gameObject);
        }

        // 체력이 30% 이하로 떨어지면
        if (m_hp <= m_fullHp * GameSetting.BOSS1_PATTERN_D_HP_CONDITION)
        {
            // 광폭화 모드가 아니라면 광폭화 모드다 !!!!
            if (!(m_pattern is Boss2PatternD))
            {
                m_tail.gameObject.SetActive(false);
                m_pattern = new Boss2PatternD(m_skeletonAnimation, ANI_MOVE, null, m_name);
            }
        }
        else
        {
            if (!PatternA_AbleCheck())
            {
                if (!PatternB_AbleCheck())
                {
                    m_attackableTick = 0.0f;
                    m_patternATick   = 0.0f;
                    m_patternBTick   = 0.0f;
                    m_patternCTick   = 0.0f;
                }
            }
        }

        // Move
        Move();
        // 쿨타임 중이면 아~~무것도 안함
        if (CoolTime())
        {
            return;
        }
        SetCoolTime(Attack());
    }
示例#6
0
 public override float Attack()
 {
     //여기서 생성명령
     if (AttackAbleCheck())
     {
         NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_name, "Monster"));
         GameObject.Destroy(gameObject);
         MapManager.Instance().PentrationMonsterCreate();
     }
     else
     {
         return(10.0f);
     }
     return(10.0f);
 }
 protected void DeleteBullet()
 {
     CancelInvoke();
     MapManager.Instance().AddObject(GamePath.EFFECT, transform.position)
     .GetComponent <EFFECT>().NETWORKING = true;
     if (m_curTarget == BULLET_TARGET.PLAYER)
     {
         NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_bulletName, "myTeam_bullet"));
     }
     else if (m_curTarget == BULLET_TARGET.ENEMY)
     {
         NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_bulletName, "boss1_bullet"));
     }
     BulletManager.Instance().RemoveBullet(this);
 }
示例#8
0
    public override void Damage(int damage)
    {
        base.Damage(damage);

        if (m_hp <= 0)
        {
            //CameraManager.Instance().MoveCamera(null , 10.0f , CameraManager.CAMERA_PLACE.STAGE1);
            GameObject obj = MapManager.Instance().AddObject(GamePath.EFFECT, transform.position);
            obj.transform.position = transform.position;
            NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder("Monster", m_name));
            GameObject.Destroy(gameObject);

            m_pattern = null;
        }
        //  this.transform.GetChild(3).GetComponent<TextMesh>().text = "BOSS hp : " + m_hp + "/100";
        //  NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonHPUdate(m_name , m_hp));
    }
示例#9
0
    public override void Damage(int damage)
    {
        if (m_damageCoolTime)
        {
            return;
        }
        m_hp -= damage;
        if (m_hp <= 0)
        {
            MapManager.Instance().AddObject(GamePath.EFFECT, transform.position);
            NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_name, "Monster"));
            NetworkManager.Instance().RemoveNetworkOrderMessageEventListener(this);
            GameObject.Destroy(gameObject);
            return;
        }

        m_damageCoolTime = true;
        InvokeRepeating("DamageEffect", 0.1f, 0.1f);
        NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonHPUdate(m_name, m_hp));
    }
示例#10
0
    void Update()
    {
        //if (!NetworkObjectCheck())
        //    return;

        if (m_hp <= 0)
        {
            MapManager.Instance().AddObject(GamePath.EFFECT, transform.position);
            NetworkManager.Instance().SendOrderMessage(JSONMessageTool.ToJsonRemoveOrder(m_name, "Monster"));
            return;
        }
        if (Input.GetKeyUp(KeyCode.I))
        {
            GameManager.Instance().SetCurrentEnemy(this);

            Damage(20);
        }


        // 방향설정
        Vector3 p = GameManager.Instance().ROBO.transform.position - transform.position;

        p.Normalize();
        m_angle = (Mathf.Atan2(p.x, p.y) * Mathf.Rad2Deg);
        m_angle = -m_angle - 85.0f;
        transform.eulerAngles = new Vector3(0, 0, m_angle);

        Vector2 p2 = new Vector2(transform.position.x - 10.0f, transform.position.y);

        Debug.DrawLine(transform.position, p2, Color.red);


        if (m_pattern != null)
        {
            m_pattern.Update(gameObject);
        }

        // 체력이 30% 이하로 떨어지면
        if (m_hp <= m_fullHp * GameSetting.BOSS1_PATTERN_D_HP_CONDITION)
        {
            // 광폭화 모드가 아니라면 광폭화 모드다 !!!!
            if (!(m_pattern is PatternD))
            {
                m_pattern = new PatternD(m_skeletonAnimation, ANI_CD_MOVE, null, m_name);
            }
        }
        else
        {
            if (!AttackAbleCheck())
            {
                if (!PatternA_AbleCheck())
                {
                    if (!PatternB_AbleCheck())
                    {
                        if (!PatternC_AbleCheck())
                        {
                            m_attackableTick = 0.0f;
                            m_patternATick   = 0.0f;
                            m_patternBTick   = 0.0f;
                            m_patternCTick   = 0.0f;
                        }
                    }
                }
            }
        }
        // Move
        Move();
        // 쿨타임 중이면 아~~무것도 안함
        if (CoolTime())
        {
            return;
        }

        SetCoolTime(Attack());
    }