Exemple #1
0
    public override void equipItemStatus()
    {
        equipDic = ItemManager.Instance.DIC_EQUIP;
        ItemInstance tempItemIns;

        if (equipDic.Count >= 1)
        {
            equipDic.TryGetValue(eSlotType.SLOT_1, out tempItemIns);
            SELF_CHARACTER.CHARACTER_STATUS.AddStatusData("ITEM1", tempItemIns.ITEM_INFO.STATUS);
        }

        if (equipDic.Count == 2)
        {
            equipDic.TryGetValue(eSlotType.SLOT_2, out tempItemIns);
            SELF_CHARACTER.CHARACTER_STATUS.AddStatusData("ITEM2", tempItemIns.ITEM_INFO.STATUS);
        }

        BaseBoard board = BoardManager.Instance.GetBoardData(this,
                                                             eBoardType.BOARD_HP);

        if (board != null)
        {
            board.SetData(ConstValue.SetData_HP,
                          GetStatusData(eStatusData.MAX_HP),
                          SELF_CHARACTER.CURRENT_HP);
        }

        //// Board 초기화
        board = null;
    }
Exemple #2
0
    IEnumerator Healing()
    {
        while (curBuff.Contains(eBuffType.HEAL.ToString()))
        {
            BuffTemplateData buffEffect = BuffManager.Instance.Get(curBuff);
            int muchOfHeal = (int)(buffEffect.HEAL * 0.01 * SelfCharacter.CHARACTER_STATUS.GetStatusData(eStatusData.MAX_HP));
            SelfCharacter.IncreaseCurrentHP(muchOfHeal);


            BaseBoard board = BoardManager.Instance.GetBoardData(this, eBoardType.BOARD_HP);
            if (board != null)
            {
                board.SetData(ConstValue.SetData_HP,
                              GetStatusData(eStatusData.MAX_HP),
                              SelfCharacter.CURRENT_HP);
            }

            //// Board 초기화
            board = null;

            yield return(new WaitForSeconds(1f));
        }

        isHealing = false;
    }
Exemple #3
0
    protected void Awake()
    {
        //건희
        //GameObject aiObject = new GameObject();
        //aiObject.name = "NormalAI";
        //ai = aiObject.AddComponent<NormalAI>(); // AI가 많아지면 해당 항목을 스위치문으로 세분화해서 작성가능함.
        //aiObject.transform.SetParent(SelfTransform);// AI타겟을 자신으로 설정함.

        //// 없으면 동작  X
        //ai.Target = this;

        GameCharacter gameCharacter =
            CharacterManager.Instance.AddCharacter(TemplateKey);

        gameCharacter.TargetComponenet = this;
        SelfCharacter = gameCharacter;

        for (int i = 0;
             i < gameCharacter.CHARACTER_TEMPLATE.LIST_SKILL.Count;
             i++)
        {
            SkillData data =
                SkillManager.Instance.GetSkillData(
                    gameCharacter.CHARACTER_TEMPLATE.LIST_SKILL[i]);

            if (data == null)
            {
                Debug.LogError(
                    gameCharacter.CHARACTER_TEMPLATE.LIST_SKILL[i]
                    + " 스킬 키를 찾을수 없습니다.");
            }
            else
            {
                gameCharacter.AddSkill(data);
            }
        }


        if (bEnableBoard)               //UI(board)
        {
            BaseBoard board = BoardManager.Instance.AddBoard(
                this, eBoardType.BOARD_HP);
            BaseBoard statusBoard = BoardManager.Instance.AddBoard(
                this, eBoardType.BOARD_STATUS);

            if (IsPlayer == true)
            {
                board.IS_PLAYER = true;
            }

            board.SetData(ConstValue.SetData_HP,
                          GetStatusData(eStatusData.MAX_HP),
                          SelfCharacter.CURRENT_HP);
            statusBoard.SetData(ConstValue.SetData_Status,
                                eStateType.STATE_NONE);
        }

        ActorManager.Instance.AddActor(this);        //Actor가 생성된 이후에 처리
    }
Exemple #4
0
    private void OnTriggerEnter(Collider other)
    {
        switch (TrapType)
        {
        case 0:
        {
            if (other.tag == "Player")
            {
                if (!other.gameObject.GetComponent <Player>().IS_INVUL)
                {
                    Vector3 moveDir = other.transform.position - gameObject.transform.position;
                    other.gameObject.GetComponent <Player>().Stun();
                    ComboSystem.COMBO_GAGE       -= 0.2f;
                    other.transform.localPosition = Vector3.zero;
                    Destroy(this.gameObject);
                }
            }
        }
        break;

        case 1:
            if (other.tag == "Player")
            {
                Vector3 moveDir = other.transform.position - gameObject.transform.position;
                other.gameObject.GetComponent <Player>().Stun();
                if (!other.gameObject.GetComponent <Player>().IS_INVUL)
                {
                    //other.GetComponent<Actor>().SELF_CHARACTER.IncreaseCurrentHP(-500.0);
                    GameManager.Instance.PLAYER_ACTOR.SELF_CHARACTER.IncreaseCurrentHP(-20.0);
                    BaseBoard board = BoardManager.Instance.GetBoardData(other.GetComponent <Actor>(),
                                                                         eBoardType.BOARD_HP);
                    if (board != null)
                    {
                        board.SetData(ConstValue.SetData_HP,
                                      other.GetComponent <Actor>().GetStatusData(eStatusData.MAX_HP),
                                      other.GetComponent <Actor>().SELF_CHARACTER.CURRENT_HP);
                    }

                    //재인이형
                    //// Board 초기화
                    board = null;

                    if (other.transform.localRotation != null)
                    {
                        BloodManager.Instance.CreateBloodParticle(gameObject, other.transform.position, other.transform.localRotation);
                    }
                    else
                    {
                        BloodManager.Instance.CreateBloodParticle(gameObject, other.transform.position);
                    }
                }
            }
            break;

        default:
            break;
        }
        //((Player)(GameManager.Instance.PlayerActor)).sturn();
    }
Exemple #5
0
    protected void Awake()
    {
        GameObjects gameObjects =
            ObjectManager.Instance.AddObject(TemplateKey);

        gameObjects.TargetComponenet = this;
        SelfObject = gameObjects;


        if (bEnableBoard)        //UI(boar)
        {
            BaseBoard board = BoardManager.Instance.AddBoard(
                this, eBoardType.BOARD_OBJ_HP);

            board.SetData(ConstValue.SetData_HP,
                          GetStatusData(eStatusData.MAX_HP),
                          SelfObject.CURRENT_HP);
        }

        InterObjectManager.Instance.AddObject(this);        //Actor가 생성된 이후에 처리
    }
Exemple #6
0
    //!!
    //private void OnTriggerEnter(Collider other)
    //{
    //	if (other.gameObject.tag == "Enemy")
    //	{
    //		Enemy TargetEnemy =  other.gameObject.GetComponent<Enemy>();
    //		ThrowEvent(ConstValue.ActorData_SetTarget, TargetEnemy);

    //		//스킬이 생성될 때 타켓을 정해주는데, throw이벤트로 타겟을 정해주는 것은 그 후임.
    //		SkillManager.Instance.makeSkill.TARGET = SkillManager.Instance.makeSkill.OWNER.GetData(ConstValue.ActorData_GetTarget) as BaseObject;
    //		//Destroy(other.gameObject);
    //	}
    //}



    //private void OnCollisionEnter(Collision collision)
    //{
    //	if(collision.gameObject.tag=="Enemy")
    //	{
    //		Target.ThrowEvent(ConstValue.ActorData_SetTarget,	collision.gameObject);
    //		Destroy(collision.gameObject);
    //	}
    //}

    public override void basicStatusUp(eStatusData type)
    {
        switch (type)
        {
        case eStatusData.MAX_HP:
            HPStatus++;
            SELF_CHARACTER.CHARACTER_STATUS.AddStatusData(type.ToString(), BasicStatusManager.Instance.Get(type.ToString(), HPStatus).STATUS);

            BaseBoard board = BoardManager.Instance.GetBoardData(this, eBoardType.BOARD_HP);
            if (board != null)
            {
                board.SetData(ConstValue.SetData_HP,
                              GetStatusData(eStatusData.MAX_HP),
                              SELF_CHARACTER.CURRENT_HP);
            }

            //// Board 초기화
            board = null;

            break;

        case eStatusData.ATTACK:
            APStatus++;
            SELF_CHARACTER.CHARACTER_STATUS.AddStatusData(type.ToString(), BasicStatusManager.Instance.Get(type.ToString(), APStatus).STATUS);

            break;

        case eStatusData.DEFENCE:
            DPStatus++;
            SELF_CHARACTER.CHARACTER_STATUS.AddStatusData(type.ToString(), BasicStatusManager.Instance.Get(type.ToString(), DPStatus).STATUS);
            break;

        default:
            break;
        }

        Debug.Log("스테이터스 업! -> " + type.ToString() + "이" + SELF_CHARACTER.CHARACTER_STATUS.GetStatusData(type));
    }
Exemple #7
0
    //메소드가 사용되어야 하는 상황을 구분짓기 위해 두개를 나눔.
    public override void ThrowEvent(string keyData, params object[] datas)
    {
        if (keyData == ConstValue.EventKey_Hit)
        {
            if (OBJECT_STATE == eBaseObjectState.STATE_DIE)
            {
                return;
            }
            // 공격 주체의 케릭터
            GameCharacter casterCharacter
                = datas[0] as GameCharacter;
            SkillTemplate skillTemplate =
                datas[1] as SkillTemplate;

            casterCharacter.CHARACTER_STATUS.AddStatusData("SKILL",
                                                           skillTemplate.STATUS_DATA);

            //0625 교준, 버프에 관련된 구문이 없다 = 오브젝트들은 버프의 영향을 받지 않게 만들었다.

            //데미지 수치를 랜덤값으로 만들면 더 좋다. 규칙을 정한것이지 구조가 아님. 다른곳에서도 처리 가능함.
            double attackDamage =
                casterCharacter
                .CHARACTER_STATUS
                .GetStatusData(eStatusData.ATTACK);
            // SelfCharacter.CHARACTER_STATUS.GetStatusData(eStatusData.DEFFENCE);

            casterCharacter.CHARACTER_STATUS.RemoveStatusData("SKILL");

            SelfObject.IncreaseCurrentHP(-attackDamage);

            if (SelfObject.TargetComponenet.OBJECT_STATE == eBaseObjectState.STATE_DIE)
            {
                Break();
            }


            // HPBoard
            BaseBoard board = BoardManager.Instance.GetBoardData(this,
                                                                 eBoardType.BOARD_HP);
            if (board != null)
            {
                board.SetData(ConstValue.SetData_HP,
                              GetStatusData(eStatusData.MAX_HP),
                              SelfObject.CURRENT_HP);
            }


            // Board 초기화
            board = null;

            //// DamageBoard
            //board = BoardManager.Instance.AddBoard(this, eBoardType.BOARD_DAMAGE);
            //if (board != null)
            //	board.SetData(ConstValue.SetData_Damage, attackDamage);

            //건희
            //// 피격 에니메이션
            //AI.ANIMATOR.SetInteger("Hit", 1);
        }

        else if (keyData == ConstValue.ActorData_SetTarget)
        {
            TargetObject = datas[0] as BaseObject;
        }
        else
        {
            base.ThrowEvent(keyData, datas);
        }
    }
Exemple #8
0
    //메소드가 사용되어야 하는 상황을 구분짓기 위해 두개를 나눔.
    public override void ThrowEvent(string keyData, params object[] datas)
    {
        if (keyData == ConstValue.EventKey_Hit)
        {
            if (OBJECT_STATE == eBaseObjectState.STATE_DIE)
            {
                return;
            }

            if (IS_SUPERARMOR)
            {
                IS_SUPERARMOR = false;
            }

            // 공격 주체의 케릭터
            GameCharacter casterCharacter
                = datas[0] as GameCharacter;
            SkillTemplate skillTemplate =
                datas[1] as SkillTemplate;

            //0625 교준, 현재의 buff를 받기 위함.
            string curBuff = datas[2] as string;

            //0626 교준, 여기에 공격 방향도 받아야 할듯? -> 피의 방향을 위해
            //Vector3 damagedPos = (Vector3)datas[3];
            Quaternion attackDir = (Quaternion)datas[3];

            if (curBuff != eBuffType.NONE.ToString())
            {
                BuffTemplateData buffEffect = BuffManager.Instance.Get(curBuff);
                casterCharacter.CHARACTER_STATUS.AddStatusData("BUFF", buffEffect.STATUS_DATA);
            }



            casterCharacter.CHARACTER_STATUS.AddStatusData("SKILL",
                                                           skillTemplate.STATUS_DATA);
            //데미지 수치를 랜덤값으로 만들면 더 좋다. 규칙을 정한것이지 구조가 아님. 다른곳에서도 처리 가능함.
            double attackDamage = casterCharacter.CHARACTER_STATUS.GetStatusData(eStatusData.ATTACK) - SelfCharacter.CHARACTER_STATUS.GetStatusData(eStatusData.DEFENCE);

            if (attackDamage < 0)
            {
                attackDamage = 0;
            }

            // SelfCharacter.CHARACTER_STATUS.GetStatusData(eStatusData.DEFFENCE);



            casterCharacter.CHARACTER_STATUS.RemoveStatusData("SKILL");


            if (curBuff != eBuffType.NONE.ToString())
            {
                casterCharacter.CHARACTER_STATUS.RemoveStatusData("BUFF");
            }
            //은기 완전 무적상태 추가
            if (IS_INVUL == false)
            {
                if (IS_SUPERARMOR == false)
                {
                    //은기 6.29 콤보게이지 관련 추가(양 조절)
                    if (GameManager.Instance.PLAYER_ACTOR.GetComponent <Player>().ComboSkillSet.COMBO_GAGE < 1)
                    {
                        GameManager.Instance.PLAYER_ACTOR.GetComponent <Player>().ComboSkillSet.COMBO_GAGE      += 0.3f;
                        GameManager.Instance.PLAYER_ACTOR.GetComponent <Player>().ComboSkillSet.POWER_DOWN_STATE = false;
                    }

                    SelfCharacter.IncreaseCurrentHP(-attackDamage);
                }
                Vector3 damagedPos = gameObject.transform.localPosition;

                if (attackDir != null)
                {
                    BloodManager.Instance.CreateBloodParticle(gameObject, damagedPos, attackDir);
                }
                else
                {
                    BloodManager.Instance.CreateBloodParticle(gameObject, damagedPos);
                }
            }
            //재인이형
            // HPBoard
            BaseBoard board = BoardManager.Instance.GetBoardData(this,
                                                                 eBoardType.BOARD_HP);
            if (board != null)
            {
                board.SetData(ConstValue.SetData_HP,
                              GetStatusData(eStatusData.MAX_HP),
                              SelfCharacter.CURRENT_HP);
            }

            //재인이형
            //// Board 초기화
            board = null;

            //// DamageBoard
            //board = BoardManager.Instance.AddBoard(this, eBoardType.BOARD_DAMAGE);
            //if (board != null)
            //	board.SetData(ConstValue.SetData_Damage, attackDamage);

            //건희
            //// 피격 에니메이션
            //AI.ANIMATOR.SetInteger("Hit", 1);
        }
        else if (keyData == ConstValue.EventKey_SelectSkill)
        {
            int       index = (int)datas[0];
            SkillData data  = SelfCharacter.GetSkillByIndex(index);
            SelfCharacter.SELECT_SKILL = data;
        }
        else if (keyData == ConstValue.ActorData_SetTarget)
        {
            TargetObject = datas[0] as BaseObject;
        }
        else if (keyData == ConstValue.EventKey_SelectState)
        {
            if (this.tag != "Player")
            {
                BaseBoard board = BoardManager.Instance.GetBoardData(this,
                                                                     eBoardType.BOARD_STATUS);
                if (board != null)
                {
                    board.SetData(ConstValue.SetData_Status,
                                  (eStateType)datas[0],
                                  (BaseObject)datas[1]);
                }
            }
        }
        else
        {
            base.ThrowEvent(keyData, datas);
        }
    }