private void Awake() { BossPattern[] tempPatterns; tempPatterns = patterns.GetComponentsInChildren <WildGrowth>(true); foreach (BossPattern tempPattern in tempPatterns) { wildGrowth.Add(tempPattern); } tempPatterns = patterns.GetComponentsInChildren <BulletSpread>(true); foreach (BossPattern tempPattern in tempPatterns) { bulletSpread.Add(tempPattern); } tempPatterns = patterns.GetComponentsInChildren <ShotBigBullet>(true); foreach (BossPattern tempPattern in tempPatterns) { shotBigBullet.Add(tempPattern); } Damage = 50.0f; greatMigration = gameObject.GetComponent <GreatMigration>(); }
//======================================================================================== LAUNCH PATTERN /// <summary> /// launch the selected pattern /// </summary> /// <param name="pattern"></param> public void LaunchPattern(BossPattern pattern) { switch (pattern) { case BossPattern.MysticLine: StartCoroutine(MysticLineCoroutine()); break; case BossPattern.FireBall: StartCoroutine(FireBallCoroutine()); break; case BossPattern.ElectricZone: StartCoroutine(ElectricZoneCoroutine()); break; case BossPattern.ShrinkMysticLines: StartCoroutine(Shrink()); break; case BossPattern.ElectricCone: StartCoroutine(ElectricConeCoroutine()); break; case BossPattern.Charge: StartCoroutine(ChargeCoroutine()); break; case BossPattern.ElectricAOE: StartCoroutine(ElectricAOECoroutine()); break; } }
void BlockAttack() { if (m_bAttackBlockSkill) { if (m_nBlockType < 5) { m_nBlockTimer += Time.deltaTime; } else { m_bAttackBlockSkill = false; _BossPattern = BossPattern.None; return; } if (m_nBlockTimer >= 0.4f) { if (_BlockList[m_nBlockType] == null || m_nBlockTimer >= 1.0f) { StartCoroutine("AttackStart"); m_nBlockTimer = 0; } else { Vector3 vTargetPos = new Vector3(CGameManager._instance._PlayerPos.position.x, CGameManager._instance._PlayerPos.position.y + 0.5f, CGameManager._instance._PlayerPos.position.z); _BlockList[m_nBlockType].transform.position = Vector3.Lerp(_BlockList[m_nBlockType].transform.position, vTargetPos, m_nBlockSpeed * Time.deltaTime); } } } }
public EnemyBoss(SceneGame sc, BossPattern op, Status s) { SourceStatus = s; SourceUser = s.User; Phases = op(this); PhaseIndex = -1; MoveNextPhase(); }
public void FootHooldSkillSetting() { _BossPattern = BossPattern.Foothold; vPlayerPos2 = GameObject.Find("Player").transform.position; _FootholdObj = Instantiate(_FootholdObjRoad) as GameObject; _FootholdObj.transform.position = vPlayerPos2; StartCoroutine("StartFoothold"); }
// Start is called before the first frame update void Start() { GenerateShooters(); TextAsset patternAsset = Resources.Load <TextAsset>("Patterns/Enemies/Boss1"); BossPattern pattern = XmlSerialization.ReadFromXmlResource <BossPattern>(patternAsset); actions = pattern.actions; }
void BossPattern() { time = 0; switch (state) { case State.MOVE: //이동이 끝나고 휴식 anim.SetInteger("State", 0); restTime = Random.Range(0.1f, maxRestTime); state = State.REST; break; case State.REST: //휴식이 끝나고 이동이나 공격준비 anim.SetInteger("State", 1); if (movCount <= 0) //이동이 모두 끝나고 공격준비 { curPattern = patterns[patternIndex]; curPattern.ActBegin(); dest = curPattern.startPos; state = State.ATKREADY; patternIndex++; //패턴 카운트 +1 if (patternIndex >= patterns.Length) { PatternShuffle(); //꽉차면 셔플 } break; } movCount--; //이동 dest = GetRandomArea(-moveArea.y); //랜덤 위치 정하기 state = State.MOVE; break; case State.ATKREADY: //공격준비가 끝나고 공격으로 anim.SetInteger("State", curPattern.animNum); state = State.ATTACK; restTime = curPattern.animTime; break; case State.ATTACK: //공격이 끝나고 움직임으로 curPattern.ActEnd(); //종료 패턴 movCount = Random.Range(1, maxMoveCount); state = State.MOVE; break; } }
public void BlockSkillSetting() { m_nBlockType = -2; _BlockList.Clear(); // 블럭 5개 생성 for (int i = 0; i < _BossSkillPos.Length; i++) { BlockObjCreate(_BossSkillPos[i].transform.position); } m_nBlockType++; StartCoroutine("AttackStart"); m_bAttackBlockSkill = true; _BossPattern = BossPattern.Block; }
public IEnumerator PatternIterator() { while (enabled) { BossPattern pattern = patterns[GetRandomPattern()]; if (pattern.behaviour) { pattern.behaviour.TriggerPattern(); } switch (pattern.movement) { case MovementType.March: movement.isMarching = true; movement.target = GameManager.Ins.player; yield return(new WaitForSeconds(pattern.behaviour.Time + delayBetweenPatterns)); break; case MovementType.Still: movement.isMarching = false; movement.target = GameManager.Ins.player; yield return(new WaitForSeconds(pattern.behaviour.Time + delayBetweenPatterns)); break; case MovementType.GoTo: movement.isMarching = true; movement.target = pos; if (pattern.behaviour == null) { yield return(new WaitUntil(() => (transform.position - pos.position).sqrMagnitude < 0.05f)); } else { float goal = Time.time + pattern.behaviour.Time + delayBetweenPatterns; yield return(new WaitUntil(() => (transform.position - pos.position).sqrMagnitude < 0.05f && Time.time > goal)); } break; } } }
private void Awake() { BossPattern[] tempPattern; tempPattern = patternObject.GetComponentsInChildren <ShotEyeBall>(true); for (int i = 0; i < tempPattern.Length; i++) { eyeBalls.Add(tempPattern[i]); } LightPillar[] pillars = patternObject.GetComponentsInChildren <LightPillar>(true); for (int i = 0; i < pillars.Length; i++) { if (pillars[i].Index.Equals(0)) { lightPillarColumns.Add(pillars[i]); } else { lightPillarRows.Add(pillars[i]); } } ShotFallEyeBall[] fallEyeBalls = patternObject.GetComponentsInChildren <ShotFallEyeBall>(true); for (int i = 0; i < fallEyeBalls.Length; i++) { if (fallEyeBalls[i].Index.Equals(0)) { firstFallEyeBalls.Add(fallEyeBalls[i]); } else { secondFallEyeBalls.Add(fallEyeBalls[i]); } } longRazor = patternObject.GetComponentInChildren <LongRazor>(true); eyeCrossAttack = gameObject.GetComponentInChildren <EyeCrossAttack>(true); viberateEye = gameObject.GetComponentInChildren <ViberateEye>(true); }
private void Awake() { patterns = new BossPattern[4]; patterns[0] = heading; patterns[1] = kick; patterns[2] = dash; patterns[3] = stomp; ragePatterns = new BossPattern[4]; ragePatterns[0] = RageHeading; ragePatterns[1] = RageKick; ragePatterns[2] = RageDash; ragePatterns[3] = RageStomp; //patterns = new BossPattern[1]; //patterns[0] = stomp; //RagePatterns = new BossPattern[1]; //RagePatterns[0] = RageStomp; }
// Update is called once per frame void Update() { if (!pause) { time += Time.deltaTime; } if (Input.GetMouseButtonDown(0) && !Input.GetKey(KeyCode.Space)) { Vector2 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); actions.Add(new ActionEvent("Go", time, pos.x, pos.y)); ai.Go(pos); } if (Input.GetMouseButtonDown(0) && Input.GetKey(KeyCode.Space)) { Vector2 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); actions.Add(new ActionEvent("GoAndShoot", time, pos.x, pos.y)); ai.GoAndShoot(pos, cooldown); } if (Input.GetKeyDown(KeyCode.Keypad0)) { ai.SwitchShooters(0); actions.Add(new ActionEvent("SwitchShooters", time, 0)); } if (Input.GetKeyDown(KeyCode.Keypad1)) { ai.SwitchShooters(1); actions.Add(new ActionEvent("SwitchShooters", time, 1)); } if (Input.GetKeyDown(KeyCode.Keypad2)) { ai.SwitchShooters(2); actions.Add(new ActionEvent("SwitchShooters", time, 2)); } if (Input.GetKeyDown(KeyCode.Keypad3)) { ai.SwitchShooters(3); actions.Add(new ActionEvent("SwitchShooters", time, 3)); } if (Input.GetKeyDown(KeyCode.Keypad4)) { ai.SwitchShooters(4); actions.Add(new ActionEvent("SwitchShooters", time, 4)); } if (Input.GetKeyDown(KeyCode.Keypad5)) { ai.SwitchShooters(5); actions.Add(new ActionEvent("SwitchShooters", time, 5)); } if (Input.GetKeyDown(KeyCode.Keypad6)) { ai.SwitchShooters(6); actions.Add(new ActionEvent("SwitchShooters", time, 6)); } if (Input.GetKeyDown(KeyCode.Keypad7)) { ai.SwitchShooters(7); actions.Add(new ActionEvent("SwitchShooters", time, 7)); } if (Input.GetKeyDown(KeyCode.KeypadPlus)) { cooldown *= 1.1f; actions.Add(new ActionEvent("IncreaseCooldown", time)); } if (Input.GetKeyDown(KeyCode.KeypadMinus)) { cooldown /= 1.1f; actions.Add(new ActionEvent("DecreaseCooldown", time)); } if (Input.GetKeyDown(KeyCode.UpArrow)) { period++; actions.Add(new ActionEvent("IncreasePeriod", time)); } if (Input.GetKeyDown(KeyCode.DownArrow)) { period--; actions.Add(new ActionEvent("DecreasePeriod", time)); } if (Input.GetKeyDown(KeyCode.RightArrow)) { offset++; actions.Add(new ActionEvent("IncreaseOffset", time)); } if (Input.GetKeyDown(KeyCode.LeftArrow)) { offset--; actions.Add(new ActionEvent("DecreaseOffset", time)); } if (Input.GetKeyDown(KeyCode.W)) { ai.ShootRegular("enemyBullet", period, offset); actions.Add(new ActionEvent("ShootRegular", time)); } if (Input.GetKeyDown(KeyCode.X)) { ai.ShootRegularOffsetTime("enemyGreenBullet", period, offset, cooldown); actions.Add(new ActionEvent("ShootRegularOffsetTime", time)); } if (Input.GetKey(KeyCode.C)) { if (Input.GetKeyDown(KeyCode.C)) { ai.TargetPlayer(true); actions.Add(new ActionEvent("TargetPlayer", time, 1)); } else { ai.TargetPlayer(false); actions.Add(new ActionEvent("TargetPlayer", time, 0)); } } if (Input.GetKeyDown(KeyCode.V)) { ai.ReleaseTargetingBullets(); actions.Add(new ActionEvent("ReleaseTargetingBullets", time)); } if (Input.GetKeyDown(KeyCode.B)) { ai.ReleaseTargetingBullets(cooldown); actions.Add(new ActionEvent("ReleaseTargetingBulletsOffsetTime", time)); } if (Input.GetKeyDown(KeyCode.N)) { ai.ShootRegularTargeting("targetingBullet", null, period, offset, 0, true); actions.Add(new ActionEvent("ShootRegularTargeting", time)); } if (Input.GetKeyDown(KeyCode.P)) { if (pause) { pause = false; source.Play(); } else { pause = true; source.Pause(); } } informations.text = "time:" + time + "\ncooldown" + cooldown + "\nperiod" + period + "\noffset" + offset; if (Input.GetKeyDown(KeyCode.F5)) { BossPattern pattern = new BossPattern(actions); XmlSerialization.WriteToXmlResource("Patterns/Enemies/Boss1.xml", pattern); } }