示例#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);
 }
示例#2
0
    public Acter theThis;                  //自己

    //获得必要的数据
    public void makeState(NavMeshAgent theMoveControllerIn, Animator theAnimatorIn, Acter thisIn, Acter AimIn)
    {
        theMoveController = theMoveControllerIn;
        theAnimator       = theAnimatorIn;
        theAim            = AimIn;
        theThis           = thisIn;
    }
示例#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);
     }
 }
示例#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;
        }
    }
示例#5
0
 // Start is called before the first frame update
 void Start()
 {
     hp          = gameObject.GetComponent <BossHp>();
     act         = Acter.Start;
     audioSource = GetComponent <AudioSource>();
     SECharge    = false;
 }
示例#6
0
 /// <summary>
 ///击杀方法包装
 /// </summary>
 /// <param name="aim">Aim.</param>
 public void OnKill(Acter aim)
 {
     if (KillEvent != null)
     {
         KillEvent(aim);
     }
 }
示例#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);
            }
        }
    }
示例#8
0
文件: Priest.cs 项目: sso0632/NDG
    void SkillParticleSet(Acter targetacter)
    {
        skillParticle temp = new skillParticle();

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

        targetacter.SkillParticleSet(temp);
    }
示例#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;
 }
示例#10
0
    void OnTriggerEnter(Collider collisioner)
    {
        Acter playeraim = collisioner.GetComponent <Acter> ();

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

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

        if (_target.HChacter.Life == DeadorLive.LIVE)
        {
            Target = _target;
            TargetView();
        }
    }
示例#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);
        }
    }
示例#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);
 }
示例#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);
        }
    }
示例#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;
    }
示例#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;
        }
    }
示例#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;
        }
    }
示例#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;
        }
    }
示例#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);
    }
示例#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();
    }
示例#23
0
文件: Acter.cs 项目: sso0632/NDG
 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();
     }
 }
示例#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;
     }
 }
示例#25
0
文件: Priest.cs 项目: sso0632/NDG
 void SkillParticleActive(Acter targetacter)
 {
     targetacter.haveParticlePlay(nowSkill.SkillIndex);
 }
示例#26
0
文件: Acter.cs 项目: sso0632/NDG
 public virtual void Hit(Acter Target)                         //남을 때릴때
 {
     Target.HChacter.HeathDamage(haveCharacter.Attack);
     UIWarManager.SetAmountChange(Target.HChacter);
     Target.HitAni();
 }
示例#27
0
 public void PartyTargetSet(Acter _target)
 {
     PurposeEvent(_target);
 }
示例#28
0
 public Player thePlayer;               //是哪一个玩家的任务
 public virtual void OnPlayerKill(Acter aim)
 {
 }                                                //击杀任务用这个方法处理
示例#29
0
 public void SetActor(int index, Acter _actor)
 {
     FriendActer[index] = _actor;
 }