/// <summary> /// This function decides which attack the Gate should use /// </summary> void Reason() { _attackTimer = attackDelay; // i = defaultI // Attacks contains of Spikes, Crap out of gate & smash Debug.Log("EnemyGate :: Reason Called"); // Smash should be used when player is near the gate // Spikes & Trash can be used anytime also we prefer smash over trash & spoikes if (isPlayerInSmashRadius) { // SMASH State = GateStatus.Smash; Debug.Log("EnemyGate :: Smashing (https://i.imgur.com/F2IrisG.jpg)"); } else { // No smash :( int random = Mathf.FloorToInt(Random.Range(0, 2)); Debug.Log("EnemyGate :: Random Attack: " + random); if (random == 1) { State = GateStatus.Spikes; } else { State = GateStatus.Trash; } } _animator.SetState(State); }
public void Activate() { Console.WriteLine(""); Console.WriteLine("KAWOOOOOOOSH"); Console.WriteLine(""); Status = GateStatus.Active; }
public Entity(InstanceConfiguration configuration) { Id = configuration.Id; Ip = configuration.Gate.Host.Ip; Port = configuration.Gate.Host.Port; Name = configuration.Gate.Name; Status = GateStatus.Online; }
IEnumerator WaitForRecoverTime() { yield return(new WaitForSeconds(1f)); State = GateStatus.Idle; _animator.SetState(State); _animator.Trigger("smashRecover"); }
public Entity(ushort id, GateConfiguration request) { Id = id; Ip = request.Host.Ip; Port = request.Host.Port; Name = request.Name; Status = GateStatus.Online; }
public void Deactivate() { Chevrons.ForEach(c => { c.Glyph = Glyph.Origin; c.Status = ChevronStatus.Inactive; }); Console.WriteLine("Gate shut down."); Status = GateStatus.Inactive; }
private void loadGateInfo(string appID) { GateStatus gStatus = new GateStatus(); _status = gStatus.GetGateStatus(Int32.Parse(appID)); foreach (var item in _status) { _gatestatus = item.Status; _questionNbr = item.QuestionNbrs; _attempt = item.Attempt; } }
// Use this for initialization void Awake() { if (!_player) { _player = GameObject.FindGameObjectWithTag("Player"); } _animator = GetComponent <GateAnimation>(); _health = GetComponent <Health>(); State = GateStatus.Idle; _health.HasDied += OnDeath; _attackTimer = attackDelay; }
public virtual void Stop() { var triger = this.OnStop; if (triger != null) { triger(this); } if (this.RunningStatus != GateStatus.Started) { throw new InvalidOperationException(String.Format("Trying to stop a {0} control object", this.RunningStatus)); } this.RunningStatus = GateStatus.Endded; }
/// <summary> /// Coroutine die das Tor öffnet/schließt /// </summary> /// <param name="pi_Direction">Bewegungsrichtung</param> private IEnumerator MoveGate(GateStatus pi_Direction) { //------------------------------------------------------ //Limitiere Bewegung //------------------------------------------------------ while (pi_Direction == GateStatus.Open ? m_Gate.transform.position.y > m_Opened.y : m_Gate.transform.position.y < m_Closed.y) { //------------------------------------------------------ //Nur falls nicht im Editmodus //------------------------------------------------------ if (!UIManager.Instance.EditEnabled) { //------------------------------------------------------ //Je nach Richtung //------------------------------------------------------ if (pi_Direction == GateStatus.Close) { //------------------------------------------------------ //Bewege entsprechend //------------------------------------------------------ m_Gate.transform.Translate(0, Mathf.Abs(m_OpenSpeed) * Time.deltaTime, 0, Space.World); yield return(null); } else if (pi_Direction == GateStatus.Open) { m_Gate.transform.Translate(0, (-1) * Mathf.Abs(m_OpenSpeed) * Time.deltaTime, 0, Space.World); yield return(null); } } else { //------------------------------------------------------ //Ansonsten warte //------------------------------------------------------ yield return(null); } } //------------------------------------------------------ //Nach Abschluss ändere aktuelle Position //------------------------------------------------------ m_Current = pi_Direction; }
public void EnterGlyph(Glyph glyph) { if (Chevrons.Take(6).All(c => c.Status == ChevronStatus.Encoded) && glyph != Glyph.Origin) { Console.WriteLine("Last glyph must be the Point of Origin"); Deactivate(); return; } //if (Chevrons.Take(6).Any(c => c.Glyph == glyph)) return; Status = GateStatus.Dialing; if (rotateRing) { RotateRing(glyph); } var nextChevron = Chevrons.First(c => c.Status != ChevronStatus.Encoded); nextChevron.Glyph = glyph; nextChevron.Status = ChevronStatus.Encoded; if (nextChevron.Ordinal == 7) { var address = GetGateAddress(); if (!address.IsValid) { Console.WriteLine("Chevron 7 NOT LOCKED"); Console.WriteLine("Unable to connect."); Deactivate(); return; } Console.WriteLine("Chevron 7...LOCKED"); Status = GateStatus.Dialed; } else { Console.WriteLine($"Chevron {nextChevron.Ordinal} Encoded: {glyph}"); } }
public Gate(Game game, int xPos, int yPos, int screenWidth, int screenHeight, Texture2D texture, Level _parentLevel) { parentLevel = _parentLevel; position = new Rectangle(); position.Width = screenWidth / colsPerScreen; position.Height = screenHeight / rowsPerScreen; position.X = xPos * position.Width; position.Y = yPos * position.Height; leftHalf = new Rectangle(0, 0, spriteWidth, spriteHeight); rightHalf = new Rectangle(spriteWidth, 0, spriteWidth, spriteHeight); state = GateState.closed; status = GateStatus.closing; ticker = -1; gateTexture = texture; /* Block off the right half of the gate right now */ Rectangle changeRect = new Rectangle((position.X / position.Width) + 1, position.Y / position.Height, 1, 4); parentLevel.modifyTiles(changeRect, CollisionType.invisible); }
public void flip() { if (status == GateStatus.closing && state == GateState.closed) { status = GateStatus.opening; state = GateState.quarterOpen; } else if (status == GateStatus.opening && state == GateState.open) { status = GateStatus.closing; state = GateState.halfOpen; } ticker = 0; }
void OnDeath() { State = GateStatus.Dead; _animator.SetState(State); }