Ejemplo n.º 1
0
        internal void Update()
        {
            /* Segway */
            if (CurrentLocation == world.Wilderness) {
                if (--Distance <= 0) {
                    CurrentLocation = Destination;
                    if (Destination == world.Town) {
                        int pos = rand.Next(36); //Circle
                        if (pos < 10) {
                            this.Y = 0;
                            this.X = pos;
                        } else if (pos < 20) {
                            this.Y = 9;
                            this.X = pos - 10;
                        } else if (pos < 28) {
                            this.X = 0;
                            this.Y = pos - 19;
                        } else {
                            this.X = 9;
                            this.Y = pos - 27;
                        }
                    }
                    CurrentLocation.AddHero(this);
                    return;
                } else {
                    world.Wilderness.AddHero(this);
                    return;
                }
            }

            /* Asthetic */
            Offset = new Vector2d(rand.NextDouble() - 0.5, rand.NextDouble() - 0.5);
            CurrentLocation.AddHero(this);

            /* Resolve Needs */
            Needs.GetNeed().Resolve();
        }