상속: MonoBehaviour
예제 #1
0
    public override void OnPuzzleCreate(Puzzle puzzle)
    {
        var propPlace = puzzle.GetPlace("PropPlace");

        Fountain fountain = null;

        if (Random(3) < 2)
        {
            if (CheckSpawn(puzzle, 10, 20, 30, 50))
            {
                fountain = new Fountain("Fountain");
            }
        }
        else
        {
            if (CheckSpawn(puzzle, 0, 10, 15, 30))
            {
                fountain = new RedFountain("Fountain");
            }
        }

        if (fountain != null)
        {
            propPlace.AddProp(fountain, Placement.Center);
        }
    }
        protected override void Emit(Action<Particle> emitter)
        {
            var s1 = new SphereEmiter();
            s1.Location.Y = -100;
            s1.Location.X = 200;
            s1.Velocity.X = -5;
            emitter(s1);

            var s2 = new SphereEmiter();
            s2.Location.Y = -100;
            s2.Location.X = -200;
            s2.Velocity.X = 5;
            emitter(s2);

            var f = new Fountain();
            f.Location.Y = -100;
            f.Location.X = 200;
            f.Velocity.X = -5;
            f.Acceleration.X = 0.03f;
            emitter(f);

            var rf = new RedFountain();
            rf.Location.Y = -100;
            rf.Location.X = -200;
            rf.Velocity.X = 5;
            rf.Acceleration.X = -0.03f;
            emitter(rf);

            IsAlive = false;
        }
예제 #3
0
파일: Fountain.cs 프로젝트: lytle/GGJ2020
 public void Start()
 {
     if (singleton == null)
     {
         singleton = this;
     }
 }
예제 #4
0
        public void Fountain_Constructor()
        {
            Fountain fountain = new Fountain();

            Assert.IsTrue(fountain.Attributes.Contains(ItemAttribute.NoGet));
            Assert.AreEqual("Fountain", fountain.KeyWords[0]);
        }
예제 #5
0
        public Map(Game game, long firstSpawnTime, long spawnInterval, long firstGoldTime, bool hasFountainHeal, int id)
        {
            this.objects          = new Dictionary <int, GameObject>();
            this.champions        = new Dictionary <int, Champion>();
            this.visionUnits      = new Dictionary <int, Unit> [3];
            this.expToLevelUp     = new List <int>();
            this.waveNumber       = 0;
            this.firstSpawnTime   = firstSpawnTime;
            this.firstGoldTime    = firstGoldTime;
            this.spawnInterval    = spawnInterval;
            this.gameTime         = 0;
            this.nextSpawnTime    = firstSpawnTime;
            this.nextSyncTime     = 10 * 1000;
            this.announcerEvents  = new List <Pair <bool, Tuple <long, byte, bool> > >();
            this.game             = game;
            this.firstBlood       = true;
            this.killReduction    = true;
            this.hasFountainHeal  = hasFountainHeal;
            this.collisionHandler = new CollisionHandler(this);
            this.fountain         = new Fountain();
            this.id = id;

            for (var i = 0; i < visionUnits.Length; i++)
            {
                visionUnits[i] = new Dictionary <int, Unit>();
            }
        }
예제 #6
0
    public void OnTriggerEnter2D(Collider2D other)
    {
        //we hit something. if it is a wall, or on another team, "hit" it
        TeamComponent otherTeam = other.gameObject.GetComponent <TeamComponent>();

        if (otherTeam == null || otherTeam.team != this.teamComponent.team)
        {
            //nicely ask the target to freeze and then take damage
            Actor hitActor = other.gameObject.GetComponent <Actor>();
            if (hitActor != null)
            {
                hitActor.ModifyEffect(Actor.Effect.Freeze, freezeTime);
            }
            else
            {
                Fountain hitFountain = other.GetComponent <Fountain>();
                if (hitFountain != null)
                {
                    hitFountain.Freeze();
                }
            }
            other.gameObject.SendMessage("TakeDamage", this.damage, SendMessageOptions.DontRequireReceiver);

            StartCoroutine(Die());
        }
        //else ignore the collision
    }
예제 #7
0
        protected virtual IActuatorX CreateWallDecoration(int currentIdentifer, List <IGrabableItem> items)
        {
            var descriptor = builder.CurrentMap.WallDecorations[currentIdentifer];
            var texture    = builder.WallTextures[currentIdentifer];

            switch (descriptor.Type)
            {
            case GraphicsItemState.GraphicOnly:
                var decoration = new DecorationItem();
                decoration.Renderer = builder.Factories.RenderersSource.GetRandomDecorationRenderer(decoration, texture);
                return(decoration);

            case GraphicsItemState.Alcove:
                var alcove = new Alcove(items);
                items.Clear();
                alcove.Renderer = builder.Factories.RenderersSource.GetAlcoveDecorationRenderer(alcove, texture);
                return(alcove);

            case GraphicsItemState.ViAltair:
                var altair = new ViAltairAlcove(items);
                items.Clear();
                altair.Renderer = builder.Factories.RenderersSource.GetAlcoveDecorationRenderer(altair, texture);
                return(altair);

            case GraphicsItemState.Fountain:
                var fountain = new Fountain(builder.Factories);
                fountain.Renderer = builder.Factories.RenderersSource.GetFountainDecoration(fountain, texture);
                return(fountain);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
예제 #8
0
        public MapsPage(Fountain selectedFountain)
        {
            InitializeComponent();
            double longitude = Convert.ToDouble(selectedFountain.x_coord);
            double latitude  = Convert.ToDouble(selectedFountain.y_coord);

            AppMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(latitude, longitude), Distance.FromMiles(.05)));
            AddDummyPinFountain(latitude, longitude);
        }
예제 #9
0
파일: Abuse.cs 프로젝트: Fluffy322/Ensage-1
 public void OnLoad()
 {
     Hero           = ObjectManager.LocalHero;
     enemyTeam      = Hero.GetEnemyTeam();
     heroTeam       = Hero.Team;
     Menu           = new MenuManager();
     Sleeper        = new MultiSleeper();
     fountain       = new Fountain(heroTeam);
     itemManager    = new ItemManager();
     abilityUpdater = new AbilityUpdater();
 }
예제 #10
0
    public void Respawn(Fountain fount) {
        parent = null;
        transform.SetParent(fount.gameObject.transform);
        transform.localPosition = new Vector3(1, 0, 0);
        transform.localEulerAngles = new Vector3(1, 0, 0);
        transform.SetParent(null);
        m_StartPos = transform.position;
        m_EndPos = fount.respawnPointPrefab.transform.position;

        StartCoroutine ("Animate");
    }
        public bool favFountainExists(Fountain fountain)
        {
            foreach (string favFountain in Globals.user.favorites)
            {
                if (fountain._id == favFountain)
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #12
0
        private Fountain Room13_Fountain()
        {
            Fountain fountain = new Fountain();

            fountain.Id = itemId++;
            fountain.KeyWords.Add("fountain");

            fountain.ShortDescription    = "An ornate fountain.";
            fountain.LongDescription     = "A large ornate fountain pours water down several tiers.";
            fountain.ExamineDescription  = "The fountain is made of blue glass with four tiers.  The first three tiers flow down into the 4th tier and the bottom pool shoots water up into the 4th tier.  The blue color causes the fountain to blend into the water making the whole thing appear as one big moving fountain of water.";
            fountain.SentenceDescription = "fountain";

            return(fountain);
        }
예제 #13
0
파일: BaseZone.cs 프로젝트: elavanis/Mud
        public T CreateItem <T>()
        {
            Type  type = typeof(T);
            IItem item = null;

            if (type == typeof(IItem) ||
                type == typeof(Item))
            {
                item = new Item();
            }
            else if (type == typeof(Fountain))
            {
                item = new Fountain();
            }
            else if (type == typeof(IRecallBeacon) ||
                     type == typeof(RecallBeacon))
            {
                item = new RecallBeacon();
            }
            else if (type == typeof(IContainer) ||
                     type == typeof(Container))
            {
                item = new Container();
            }
            else if (type == typeof(IEnchantery) ||
                     type == typeof(Enchantery))
            {
                item = new Enchantery();
            }
            else if (type == typeof(IMoney) ||
                     type == typeof(Money))
            {
                item = new Money();
            }

            if (item == null)
            {
                throw new Exception($"Unsupported type {type.ToString()}");
            }
            else
            {
                item.Id   = ItemId++;
                item.Zone = Zone.Id;
            }

            return((T)item);
        }
예제 #14
0
    public void notifyOfAdherentRemove(Adherent adherent, Fountain fount) {
        if (m_intersectionAdherents == null) {
            return;
        }

        for (int i=0; i < m_intersectionAdherents.Count; ++i) {
            WeakReference obj = m_intersectionAdherents[i];
            if (obj.IsAlive && adherent == (Adherent)obj.Target) {
                m_intersectionAdherents.Remove(obj);
                break;
            }
        }

        if (m_intersectionAdherents.Count == 0) {
            Respawn(fount);
        }
    }
예제 #15
0
    public FountainR(Fountain fountain, DateTime referenceDate)
    {
        Long    = fountain.Long;
        Lat     = fountain.Lat;
        Antoine = fountain.Antoine;
        Camille = fountain.Camille;
        Loic    = fountain.Loic;
        Xavier  = fountain.Xavier;
        Rafaela = fountain.Rafaela;
        var zurichImages = "/Zurich/Images";
        var path         = HttpContext.Current.Server.MapPath("~" + zurichImages);

        Images = Directory.EnumerateFiles(path).Where(x => x.Contains(string.Format("\\Fountain-{0},{1}-", String.Format("{0:0.00000000}", Long).Replace(',', '.'), String.Format("{0:0.00000000}", Lat).Replace(',', '.')))).Select(
            x =>
        {
            var strings = x.Split('\\');
            return(zurichImages + '/' + strings.Last());
        }).ToList();
        int value = 0;

        if (Antoine.HasValue && Antoine.Value > referenceDate)
        {
            value += 1;
        }
        if (Camille.HasValue && Camille.Value > referenceDate)
        {
            value += 2;
        }
        if (Loic.HasValue && Loic.Value > referenceDate)
        {
            value += 4;
        }
        if (Xavier.HasValue && Xavier.Value > referenceDate)
        {
            value += 8;
        }
        if (Rafaela.HasValue && Rafaela.Value > referenceDate)
        {
            value += 16;
        }

        Found = value;
    }
예제 #16
0
        public static string createMakeFountainRequest(string xCoord, string yCoord, string filterStatus, string rating, string coldness)
        {
            Fountain temp = new Fountain();

            temp.x_coord       = xCoord;
            temp.y_coord       = yCoord;
            temp.filter_status = filterStatus;
            temp.rating        = rating;
            temp.coldness      = coldness;

            var jsonString = JsonConvert.SerializeObject(temp,
                                                         Formatting.None,
                                                         new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore
            });

            return(jsonString);
        }
예제 #17
0
	public override void OnPuzzleCreate(Puzzle puzzle)
	{
		var propPlace = puzzle.GetPlace("PropPlace");

		Fountain fountain = null;

		if (Random(3) < 2)
		{
			if (CheckSpawn(puzzle, 10, 20, 30, 50))
				fountain = new Fountain("Fountain");
		}
		else
		{
			if (CheckSpawn(puzzle, 0, 10, 15, 30))
				fountain = new RedFountain("Fountain");
		}

		if (fountain != null)
			propPlace.AddProp(fountain, Placement.Center);
	}
예제 #18
0
        public static void InsertFountain(bool antoine, bool camille, bool loic, bool rafaela, bool xavier, bool notInZurich, double longitude, double lattitude)
        {
            if (!antoine && !camille && !loic && !rafaela && !xavier)
            {
                return;
            }

            longitude = Math.Round(longitude, 8);
            lattitude = Math.Round(lattitude, 8);
            var now = TimeZoneInfo.ConvertTime(DateTime.Now,
                                               TimeZoneInfo.FindSystemTimeZoneById("Romance Standard Time"));

            using (var context = new Entities())
            {
                var fountain = context.Fountains.ToList().FirstOrDefault(x => x.Long == longitude && x.Lat == lattitude);
                if (fountain == null)
                {
                    fountain = new Fountain {
                        Long = longitude, Lat = lattitude, InZurich = !notInZurich
                    };
                    if (antoine)
                    {
                        fountain.Antoine = now;
                    }
                    if (camille)
                    {
                        fountain.Camille = now;
                    }
                    if (loic)
                    {
                        fountain.Loic = now;
                    }
                    if (rafaela)
                    {
                        fountain.Rafaela = now;
                    }
                    if (xavier)
                    {
                        fountain.Xavier = now;
                    }
                    context.Fountains.Add(fountain);
                }
                else
                {
                    if (antoine && fountain.Antoine == null)
                    {
                        fountain.Antoine = now;
                    }
                    if (camille && fountain.Camille == null)
                    {
                        fountain.Camille = now;
                    }
                    if (loic && fountain.Loic == null)
                    {
                        fountain.Loic = now;
                    }
                    if (rafaela && fountain.Rafaela == null)
                    {
                        fountain.Rafaela = now;
                    }
                    if (xavier && fountain.Xavier == null)
                    {
                        fountain.Xavier = now;
                    }
                }

                context.SaveChanges();
            }
        }
예제 #19
0
파일: Abuse.cs 프로젝트: IdcNoob/Ensage
 public void OnLoad()
 {
     Hero = ObjectManager.LocalHero;
     enemyTeam = Hero.GetEnemyTeam();
     heroTeam = Hero.Team;
     Menu = new MenuManager();
     Sleeper = new MultiSleeper();
     fountain = new Fountain(heroTeam);
     itemManager = new ItemManager();
     abilityUpdater = new AbilityUpdater();
 }
예제 #20
0
 private async void favoriteFountainList_ItemSelected(object sender, SelectedItemChangedEventArgs e)
 {
     Fountain selectedFountain = (Fountain)e.SelectedItem;
     await Navigation.PushAsync(new MapsPage(selectedFountain)).ConfigureAwait(true);
 }
예제 #21
0
 public void ReplaceText(int location, int length, string replaceText) => Fountain.ReplaceText(location, length, replaceText);
예제 #22
0
 public string GetText(Range range) => Fountain.GetText(range);
예제 #23
0
 public void Init(Couch couch, Fountain fountain)
 {
     this.couch    = couch;
     this.fountain = fountain;
 }
예제 #24
0
 public virtual IRenderer GetFountainDecoration(Fountain fountain, Texture2D texture)
 {
     return(new FountainRenderer(texture, fountain));
 }