示例#1
0
 void ChangingNormalMode()
 {
     npcMode        = NpcMode.Normal;
     detectionRange = firstDetectionRange;
     movePower      = firstMovePower;
     EquipWeapon(Common.WeaponType.no);
 }
示例#2
0
    void ChangeNpcMode()
    {
        DistanceChecking();
        if (isNeutrality)
        {
            return;
        }
        if (npcMode != NpcMode.Event)
        {
            if (target.activeSelf)
            {
                if (distanceBetweenTarget > detectionRange)
                {
                    npcMode        = NpcMode.Normal;
                    detectionRange = firstDetectionRange;
                    movePower      = firstMovePower;
                    EquipWeapon(Common.WeaponType.no);
                }
                else
                {
                    if (npcMode == NpcMode.Normal)
                    {
                        detectionRange = attackDetectionRange;
                        movePower      = attackMovePower;
                        if (initChats.Count > 0)
                        {
                            Common.Chat(initChats[UnityEngine.Random.Range(0, initChats.Count)], transform);
                        }
                        EquipWeapon(Weapons[0]);
                        Common.hitTargetName = this.Name;
                        npcMode = NpcMode.Attack;

                        StartCoroutine("FocusingTarget");
                    }
                }
            }
            else
            {
                npcMode        = NpcMode.Normal;
                detectionRange = firstDetectionRange;
                movePower      = firstMovePower;
                EquipWeapon(Common.WeaponType.no);
            }
        }
    }
示例#3
0
 void ChangingAttackMode()
 {
     if (npcMode == NpcMode.Normal)
     {
         detectionRange = attackDetectionRange;
         movePower      = attackMovePower;
         RedirectCharacter();
         if (initChats.Count > 0)
         {
             Common.Chat(initChats[UnityEngine.Random.Range(0, initChats.Count)], transform);
         }
         if (Weapons.Length > 1)
         {
             EquipWeapon(Weapons[0]);
         }
         npcMode = NpcMode.Attack;
     }
 }
示例#4
0
    void Start()
    {
        this.name           = Name;
        maxHp               = hp;
        firstPos            = this.transform.position;
        firstMovePower      = movePower;
        attackMovePower     = firstMovePower * 1.5f;
        firstDetectionRange = detectionRange;
        animator            = GetComponent <Animator>();
        faceAnimator        = GetComponentInChildren <faceOff>().GetFaceAnimator();
        rigid               = GetComponent <Rigidbody2D>();
        npcMode             = NpcMode.Normal;
        attackPoint.GetComponent <SpriteRenderer>().enabled = false;
        InitSpriteLayer();

        if (!target)
        {
            target = Common.HERO();
        }

        SetAttackAnimation();
        EquipWeapon(NpcWeapon);
        OpenHpUI();
    }
示例#5
0
 void Start()
 {
     Mode = NpcMode.Attack;
 }