Exemple #1
0
 public override void Hit(Acter Target)                         //남을 때릴때
 {
     Target.HChacter.HeathDamage(haveCharacter.Attack);
     UIWarManager.SetAmountChange(Target.HChacter);
     UIWarManager.instance.ShowDamageText(Target.transform.position, haveCharacter.Attack);
     Target.StartHitEffect(navMeshObject.position);
 }
Exemple #2
0
    public Acter theThis;                  //自己

    //获得必要的数据
    public void makeState(NavMeshAgent theMoveControllerIn, Animator theAnimatorIn, Acter thisIn, Acter AimIn)
    {
        theMoveController = theMoveControllerIn;
        theAnimator       = theAnimatorIn;
        theAim            = AimIn;
        theThis           = thisIn;
    }
Exemple #3
0
 /// <summary>
 /// 所有的任务在这里统一检测击杀事件
 /// </summary>
 /// <param name="theAim">The aim.</param>
 private void OnKill(Acter theAim)
 {
     for (int i = 0; i < theMissions.Count; i++)
     {
         theMissions [i].OnPlayerKill(theAim);
     }
 }
Exemple #4
0
    // Update is called once per frame
    void Update()
    {
        //ポーズの時に止める
        if (Time.timeScale <= 0)
        {
            return;
        }
        if (hp.Hp <= 0)
        {
            return;
        }
        switch (act)
        {
        case Acter.Start:
            if (GameObject.FindGameObjectWithTag("Boss").GetComponent <BossFirstAction>().action == BossFirstAction.MoveAction.End)
            {
                act = Acter.Attack;
            }
            break;

        case Acter.Attack:
            if (Cnt == 480)
            {
                if (GetComponent <BossHp>().GetHp() >= GetComponent <BossHp>().GetMaxHp() / 6)
                {
                    for (int x = 0; x < 2; x++)
                    {
                        audioSource.PlayOneShot(BulletSE);
                        GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet3(transform.position, 1);
                    }
                }
                if (GetComponent <BossHp>().GetHp() < GetComponent <BossHp>().GetMaxHp() / 6 && GetComponent <BossHp>().GetHp() >= GetComponent <BossHp>().GetMaxHp() / 3)
                {
                    for (int x = 0; x < 4; x++)
                    {
                        audioSource.PlayOneShot(BulletSE);
                        GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet3(transform.position, 1);
                    }
                }
                if (GetComponent <BossHp>().GetHp() < GetComponent <BossHp>().GetMaxHp() / 3)
                {
                    for (int x = 0; x < 6; x++)
                    {
                        audioSource.PlayOneShot(BulletSE);
                        GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet3(transform.position, 1);
                    }
                }
                for (int x = 0; x < 3; x++)
                {
                    audioSource.PlayOneShot(BulletSE);
                    GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet4(transform.position, 1);
                }
                audioSource.PlayOneShot(BulletSE);
                GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet(transform.position, 1);
                Cnt = 0;
            }
            Cnt++;
            break;
        }
    }
Exemple #5
0
 // Start is called before the first frame update
 void Start()
 {
     hp          = gameObject.GetComponent <BossHp>();
     act         = Acter.Start;
     audioSource = GetComponent <AudioSource>();
     SECharge    = false;
 }
Exemple #6
0
 /// <summary>
 ///击杀方法包装
 /// </summary>
 /// <param name="aim">Aim.</param>
 public void OnKill(Acter aim)
 {
     if (KillEvent != null)
     {
         KillEvent(aim);
     }
 }
Exemple #7
0
    private void SearchAim()
    {
        if (theAim && theAim.isAlive && Vector3.Distance(theAim.transform.position, this.thePlayer.transform.position) < searchDistance)
        {
            this.thePlayer.theMoveController.MakeLookAt(theAim.transform);
        }
        else
        {
            Collider[] attackAims = Physics.OverlapSphere(this.thePlayer.transform.position, searchDistance);
            Acter      aAim       = null;
            float      distance   = 999f;
            for (int i = 0; i < attackAims.Length; i++)
            {
                Acter thePlayerGet = attackAims [i].GetComponent <Acter> ();
                if (!thePlayerGet || thePlayerGet == this.thePlayer || !thePlayerGet.isAlive)
                {
                    continue;
                }

                float distanceNew = Vector3.Distance(this.thePlayer.transform.position, attackAims [i].transform.position);
                if (distanceNew < distance)
                {
                    distance = distanceNew;
                    aAim     = thePlayerGet;
                }
            }
            if (aAim)
            {
                theAim = aAim;
                this.thePlayer.theMoveController.MakeLookAt(theAim.transform);
            }
        }
    }
Exemple #8
0
    void SkillParticleSet(Acter targetacter)
    {
        skillParticle temp = new skillParticle();

        temp.Particle = (GameObject)Instantiate(nowSkill.Particle, targetacter.transform);
        temp.Index    = nowSkill.SkillIndex;

        targetacter.SkillParticleSet(temp);
    }
Exemple #9
0
 // Start is called before the first frame update
 void Start()
 {
     hp = gameObject.GetComponent<BossHp>();
     act = Acter.Start;
     audioSource = GetComponent<AudioSource>();
     option = GameObject.Find("Option");
     optionscript = option.GetComponent<Option>();
     Cnt2 = 0;
     SECharge = false;
 }
Exemple #10
0
    void OnTriggerEnter(Collider collisioner)
    {
        Acter playeraim = collisioner.GetComponent <Acter> ();

        if (playeraim && this.thePlayer && playeraim != this.thePlayer)
        {
            //print ("触发攻击");
            this.thePlayer.OnAttack(playeraim, extraDamage);
        }
    }
Exemple #11
0
    void searchAIMs()    //不使用射线而是使用向量计算方法
    {
        searchTimer -= Time.deltaTime;
        if (searchTimer < 0)
        {
            searchTimer = searchTimerMax;

            theEMYGet  = SystemValues.searchAIMs(theViewAreaAngel, theSearchLength, this.theMoveController.transform);
            theMainEMY = getMainEMY();
        }
    }
 public override void OnPlayerKill(Acter aim)
 {
     if (aim.playerName == "骷髅魔兵")
     {
         CountUse++;
         missionInformation = "骷髅魔兵竟然出现在这里,实在蹊跷。先击溃这些魔兵再做查看。此任务需击杀5只骷髅魔兵方可完成。已击杀:" + CountUse + "/" + CountUseMax;
         if (checkMissionOver())
         {
             OnMissionOver();
         }
     }
 }
Exemple #13
0
    protected virtual void TargetSet(Acter _target)
    {
        if (_target == Target)
        {
            return;
        }

        if (_target.HChacter.Life == DeadorLive.LIVE)
        {
            Target = _target;
            TargetView();
        }
    }
Exemple #14
0
    /// <summary>
    /// 攻击的时候触发
    /// 触发方式可以是动画事件也可能是投掷武器
    /// 这个方式会计算额外的伤害
    /// </summary>
    /// <param name="aim">Aim.</param>
    public virtual void OnAttack(Acter aim, float extraDamage = 0f)
    {
        if (!aim.isAlive)
        {
            return;
        }

        aim.OnHpChange(-(this.attackDamage + extraDamage));
        if (aim.hpNow == 0)
        {
            OnKill(aim);
        }
    }
Exemple #15
0
 //找到的目标很多,排序找到最终的目标
 private Acter getMainEMY()
 {
     //Debug.Log ("first check count = "+ theEMYGet.Count);
     for (int i = 0; i < theEMYGet.Count; i++)
     {
         Acter thePlayer = theEMYGet [i].GetComponent <Acter> ();
         if (!theEMYGet [i].tag.Equals("AI") && thePlayer && thePlayer.isAlive)
         {
             return(thePlayer);
         }
     }
     return(null);
 }
Exemple #16
0
    public override void OnAttack(Acter aim, float extreaDamage)
    {
        if (!aim.isAlive)
        {
            return;
        }

        aim.OnHpChange(-(this.attackDamage + extreaDamage));
        if (aim.hpNow == 0)
        {
            OnKill(aim);
            OnGetLearningValue(aim.lvNow * 15f);
        }
    }
Exemple #17
0
    //初始化
    void Start()
    {
        this.transform.root.tag = "AI";        //打上标记方便找

        thethis           = this.GetComponent <Acter> ();
        theMoveController = this.GetComponentInChildren <NavMeshAgent> ();
        theAnimator       = this.GetComponentInChildren <Animator> ();

        theStateNow = new FSM_Search();
        theStateNow.makeState(theMoveController, theAnimator, thethis, null);
        theStateNow.setArea(attackarea, searchArea);
        theStateNow.OnFSMStateStart();
        this.enabled = false;
    }
Exemple #18
0
    // Update is called once per frame
    void Update()
    {
        //ポーズの時に止める
        if (Time.timeScale <= 0)
        {
            return;
        }
        if (hp.Hp <= 0)
        {
            return;
        }
        switch (act)
        {
        case Acter.Start:
            if (GameObject.FindGameObjectWithTag("Boss").GetComponent <BossFirstAction>().action == BossFirstAction.MoveAction.End)
            {
                act = Acter.Attack;
            }
            break;

        case Acter.Attack:
            if (Cnt * Time.deltaTime > 1)
            {
                for (int x = 0; x < 10; x++)
                {
                    audioSource.PlayOneShot(BulletSE);
                    GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet2(transform.position, 0);
                }
                Cnt = 0;
                Cnt2++;
            }
            if (Cnt2 > 5)
            {
                for (int x = 0; x < 3; x++)
                {
                    audioSource.PlayOneShot(BulletSE);
                    GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet4(transform.position, 1);
                    GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet(transform.position, 1);
                }
                audioSource.PlayOneShot(BulletSE);
                // GameObject.FindGameObjectWithTag("Boss").GetComponent<BossBulletManager>().FBulletFactory[0].CreateBullet5(transform.position, 3);
                GameObject.FindGameObjectWithTag("Boss").GetComponent <BossBulletManager>().FBulletFactory[0].CreateBullet3(transform.position, 3);
                GetComponent <BossMove>().action = BossMove.MoveAction.Action1;
                Cnt2 = 0;
            }
            Cnt++;
            break;
        }
    }
Exemple #19
0
    void OptionChange()
    {
        UIWarManager.instance.PushHpBar(this);
        switch (nowActor.tag)
        {
        case "Monster":
            MonsterActor tempMonster = (MonsterActor)nowActor;
            tempMonster.SetHpBarExist = false;
            nowActor    = null;
            tempMonster = null;
            break;

        default:
            break;
        }
    }
Exemple #20
0
    //初始设定与刷新
    public void MakeFkash(Acter thePlayerIn)
    {
        SystemValues.bloodCamvasList.Add(this);
        this.thePlayer            = thePlayerIn;
        this.thePlayer.HpChanger += ChangeSlider;
        ChangeSlider(0f);

        if (this.thePlayer.gameObject == SystemValues.thePlayer)
        {
            theSliderFront.color = Color.green;
        }
        else
        {
            theSliderFront.color = Color.red;
        }
    }
Exemple #21
0
    public void SetBattleCharacter(Acter _setChar)
    {
        if (!gameObject.activeSelf)
        {
            gameObject.SetActive(true);
        }

        if (nowActor == _setChar)
        {
            return;
        }

        nowActor     = _setChar;
        minValue     = 0;
        maxValue     = nowActor.HChacter.MHeath;
        currentValue = maxValue;
        barText.text = string.Format("{0}", currentValue);
    }
Exemple #22
0
    protected override void TargetSet(Acter _target)
    {
        if (_target == Target)
        {
            return;
        }

        //플레이어가 나(몬스터)를 인식했으면 HPBar On
        if (haveCharacter.Life == Sang.DeadorLive.LIVE)
        {
            if (isHpBarExist == false)
            {
                UIWarManager.instance.HpBarReceiver(this);
                isHpBarExist = true;
            }
        }
        Target = _target;
        //Attackwork();
    }
Exemple #23
0
 void MoveToAttack()
 {
     if (attackEnable == true)
     {
         NavMove(Target.ActorTransform.position);
         if (navMesh.remainingDistance <= navMesh.stoppingDistance)
         {
             if (Target.HChacter.Life == DeadorLive.LIVE)
             {
                 Attack();
             }
             else
             {
                 Target = null;
             }
         }
     }
     else if (attackEnable == false)
     {
         AttackEnd();
     }
 }
Exemple #24
0
 public void HpBarReceiver(Acter _actor)
 {
     if (barList.Count <= 0)
     {
         GameObject temp    = Instantiate(HpBarPrefab);
         UIHpBar    tempBar = temp.GetComponent <UIHpBar>();
         temp.transform.SetParent(HpBarCollecter);
         temp.SetActive(true);
         tempBar.SetBattleCharacter(_actor);
         tempBar.AddEvent();
         return;
     }
     else if (barList.Count > 0)
     {
         UIHpBar tempBar = barList[0];
         tempBar.gameObject.SetActive(true);
         tempBar.SetBattleCharacter(_actor);
         barList.Remove(tempBar);
         tempBar.AddEvent();
         return;
     }
 }
Exemple #25
0
 void SkillParticleActive(Acter targetacter)
 {
     targetacter.haveParticlePlay(nowSkill.SkillIndex);
 }
Exemple #26
0
 public virtual void Hit(Acter Target)                         //남을 때릴때
 {
     Target.HChacter.HeathDamage(haveCharacter.Attack);
     UIWarManager.SetAmountChange(Target.HChacter);
     Target.HitAni();
 }
Exemple #27
0
 public void PartyTargetSet(Acter _target)
 {
     PurposeEvent(_target);
 }
Exemple #28
0
 public Player thePlayer;               //是哪一个玩家的任务
 public virtual void OnPlayerKill(Acter aim)
 {
 }                                                //击杀任务用这个方法处理
Exemple #29
0
 public void SetActor(int index, Acter _actor)
 {
     FriendActer[index] = _actor;
 }