Ejemplo n.º 1
0
    protected IEnumerator AdjustCrowdControl_CO(CROWD_CONTROL_TYPE type, float adjustTime)
    {
        float timer   = 0.0f;
        int   type_id = 0;

        switch (type)
        {
        case CROWD_CONTROL_TYPE.SLOW:
            type_id = 0;
            break;

        case CROWD_CONTROL_TYPE.ROOT:
            type_id = 1;
            break;

        case CROWD_CONTROL_TYPE.STUN:
            type_id = 2;
            break;

        default:
            break;
        }


        if ((cc_state & type) == type)
        {
            cc_CrsCount[type_id]++;
        }
        else
        {
            cc_CrsCount[type_id] = 0;
        }

        while (true)
        {
            timer += Time.deltaTime;
            if (timer > adjustTime)
            {
                break;
            }

            cc_state |= type;

            AdjustCC(true, type);

            yield return(null);
        }

        if (cc_CrsCount[type_id] == 0)
        {
            AdjustCC(false, type);
            cc_state &= (~type);
        }
        else
        {
            cc_CrsCount[type_id]--;
        }

        yield break;
    }
Ejemplo n.º 2
0
    private void AdjustCC(bool bCheck, CROWD_CONTROL_TYPE type)
    {
        if ((cc_state & CROWD_CONTROL_TYPE.SLOW) == CROWD_CONTROL_TYPE.SLOW)
        {
            creep_anim.SetBool("cc_Slow", bCheck);
            speedFactor = bCheck ? 0.5f : 1.0f;
            creep_anim.SetFloat("SpeedFactor", speedFactor);
        }

        if ((cc_state & CROWD_CONTROL_TYPE.ROOT) == CROWD_CONTROL_TYPE.ROOT)
        {
            creep_anim.SetBool("cc_Root", bCheck);
            creep_anim.SetBool("isMovable", !bCheck);
        }

        if ((cc_state & CROWD_CONTROL_TYPE.STUN) == CROWD_CONTROL_TYPE.STUN)
        {
            creep_anim.SetBool("cc_Stun", bCheck);
            creep_anim.SetBool("isMovable", !bCheck);

            if (bCheck)
            {
                creep_anim.PlayInFixedTime("Get_hit", 0, 0.1f);
                creep_anim.StopPlayback();
            }
        }
    }
Ejemplo n.º 3
0
    public void GetHit(float Damage, CROWD_CONTROL_TYPE cctype, float adjustTime)//cc기도 추가.
    {
        GetHit(Damage);


        AdjustCrowdControl = AdjustCrowdControl_CO(cctype, adjustTime);
        StartCoroutine(AdjustCrowdControl);
    }
Ejemplo n.º 4
0
    public void GetHit(GameObject WhoAttack, float Damage, CROWD_CONTROL_TYPE cctype, float adjustTime)//cc기도 추가.
    {
        GetHit(Damage, cctype, adjustTime);

        Vector3 rot = new Vector3(WhoAttack.transform.position.x, this.transform.position.y, WhoAttack.transform.position.z);

        WhoAttack.transform.position = rot;

        this.transform.LookAt(WhoAttack.transform);
    }
Ejemplo n.º 5
0
    protected void CreepsStart()
    {
        isChasing   = false;
        layerMask   = 1;
        layerMask <<= 11;
        isDead      = false;
        attackTimer = attackSpeed;
        speedFactor = 1.0f;
        cc_state    = CROWD_CONTROL_TYPE.NONE;

        cc_CrsCount = new int[GameManager.CC_COUNT];
        cc_CrsCount.Initialize();
    }
Ejemplo n.º 6
0
    void ShowCreepBar()
    {
        int index = 0;

        foreach (var tempCreep in getCreepList())
        {
            if (tempCreep.GetComponent <ACreeps>().IsDead())
            {
                NewCreepBarList[index].SetActive(false);
            }
            else
            {
                Vector3 viewportPt = cam.WorldToViewportPoint(tempCreep.transform.position + new Vector3(0.0f, 3.0f, 0.0f));
                if (viewportPt.x > 0.0f && viewportPt.y > 0.0f && viewportPt.x < 1.0f && viewportPt.y < 1.0f)
                {
                    NewCreepBarList[index].SetActive(true);
                    NewCreepBarList[index].transform.position = cam.ViewportToScreenPoint(viewportPt);

                    CROWD_CONTROL_TYPE ctype = tempCreep.GetComponent <ACreeps>().GetCCType();

                    int emptyStartIndex = 0;
                    int cc_Icon_Index   = cc_icons.Length - 1;
                    int maxval          = (int)CROWD_CONTROL_TYPE.MAX_VAL;

                    for (int k = 0; k < creepCCBarImgs[index].Length;)
                    {
                        if (maxval == (int)CROWD_CONTROL_TYPE.NONE)
                        {
                            for (int h = emptyStartIndex; h < creepCCBarImgs[index].Length; h++)
                            {
                                creepCCBarImgs[index][h].sprite = cc_icons[0];
                            }
                            break;
                        }

                        if (((CROWD_CONTROL_TYPE)maxval & ctype) == (CROWD_CONTROL_TYPE)maxval)
                        {
                            creepCCBarImgs[index][k].sprite = cc_icons[cc_Icon_Index];
                            k++;
                            emptyStartIndex = k;
                        }

                        cc_Icon_Index--;
                        maxval >>= 1;
                    }
                }
                else
                {
                    NewCreepBarList[index].SetActive(false);
                }

                creepBarImgs[index].fillAmount = tempCreep.GetComponent <ACreeps>().GetHPRatio();
            }

            index++;
        }
        //for (int i = 0; i < NewCreepBarList.Count; i++)
        //{
        //    if (CreepList[i] != null && CreepList[i].GetComponent<ACreeps>().IsDead())
        //    {

        //        continue;
        //    }

        //    Vector3 viewportPt = cam.WorldToViewportPoint(CreepList[i].transform.position + new Vector3(0.0f, 3.0f, 0.0f));

        //    if (viewportPt.x > 0.0f && viewportPt.y > 0.0f && viewportPt.x < 1.0f && viewportPt.y < 1.0f)
        //    {
        //        CreepBarList[i].SetActive(true);
        //        CreepBarList[i].transform.position = cam.ViewportToScreenPoint(viewportPt);
        //    }
        //    else
        //    {
        //        CreepBarList[i].SetActive(false);
        //    }

        //    CreepBarImgList[i].fillAmount = CreepList[i].GetComponent<ACreeps>().GetHPRatio();
        //}
    }