Esempio n. 1
0
        public void fireLazer(GuiEvent evt)
        {
            //stop the periodic color growth
            Clock.RemoveRender(chargeInterval);

            //remove (hide) the gui element created in chargeLazer
            GuiLayer.GetLayerByName("CursorLayer").Hide();

            int range = 10;

            //create the light
            LightSource plCol = new LightSource(evt.eventPos.x, evt.eventPos.y, 5, range);
            plCol.SetDiminishing(true);
            plCol.SetColor(newLightColor);

            //create a shadow creature, of the same color as the player dropped

            //chase away any nearby shadow creatures colored opposite to what the player dropped

            /*
            //show / affect any nearby lightstones
            List<LightSource> lightsInRange = Stage.CurrentStage.GetLightsNear(evt.eventPos, range);
            foreach (LightSource light in lightsInRange)
            {
                if (light is Lightstone)
                {
                    light.Show();
                    Clock.TimedExecute(light.Hide, 1);
                }
            }
            */
            int lightRange = Helpah.d2i(plCol.GetRange());
            List<LightSource> lightList = Stage.CurrentStage.GetLightsNear(plCol.GetPosition(), lightRange);
            //Debug.log("There are " + lightList.Count + " lights in within " + lightRange + " of click.");
            foreach (LightSource light in lightList)
            {
                if (!(light is Lightstone))
                {
                    continue;
                }
                light.Show();
                Clock.TimedExecute(light.Hide, 1);
            }
        }