Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    void Intro()
    {
        PlayerPrefs.SetInt("intro", 1);
        Intro i = transform.GetChild(2).GetComponent <Intro>();

        i.Init(this);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        LevelSet set = LevelHandler.GetLevelSet();
        Intro    i   = intro[set.setIndex];

        spriteIndex = 0;

        if (i.showText == true)
        {
            introText.enabled  = true;
            introComic.enabled = false;
            introText.text     = i.text;
        }
        else
        {
            introText.enabled  = false;
            introComic.enabled = true;
            introComic.sprite  = i.sprite[spriteIndex];
        }

        if (challenges.Length != 3)
        {
            Debug.LogError("Missing references to challege texts");
        }
        else
        {
            challenges[0].text = set.challenge1;
            challenges[1].text = set.challenge2;
            challenges[2].text = set.challenge3 /* + set.levelTimeChallenges[LevelHandler.CurrentLevel.id].ToString() */;
        }
    }
Ejemplo n.º 3
0
 private void Skipit(object sender, RoutedEventArgs e)
 {
     Intro.Stop();
     Intro.Visibility  = Visibility.Hidden;
     Mizeni.Visibility = Visibility.Hidden;
     Skip.Visibility   = Visibility.Hidden;
 }
Ejemplo n.º 4
0
        private void LogoutBtn_Click(object sender, RoutedEventArgs e)
        {
            ((Grid)((Grid)Application.Current.MainWindow.Content).Children[1]).Children.Remove(this);
            Intro intro = new Intro();

            intro.ShowDialog();
        }
Ejemplo n.º 5
0
        public int Add(Intro Intro)
        {
            string sql = "insert into Intro(Intro_Id,Intro_Image,Intro_Content,Intro_DeleteId,Intro_CreateTime,Intro_UpdateTime) " +
                         "values(@Intro_Id,@Intro_Image,@Intro_Content,@Intro_DeleteId,@Intro_CreateTime,@Intro_UpdateTime)";

            return(SqlHelper <Intro> .ExceuteNonQuery(sql, Intro));
        }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        parent      = gameObject.transform.parent.gameObject;
        img         = GetComponent <Image>();
        intro       = GameObject.Find("Event Controller").GetComponent <Intro>();
        taskCreator = GameObject.Find("Event Controller").GetComponent <TaskCreator>();
        gameMan     = GameObject.Find("Event Controller").GetComponent <GameManager>();

        SetWinType();

        if (textFromInspector)
        {
            for (int ii = 0; ii < textList.Count; ii++)
            {
                textList[ii] = textList[ii].Replace("NEWLINE", "\n");
            }

            displayText = gameObject.transform.parent.gameObject.transform.GetChild(0).GetChild(0).GetComponent <Text>();
            if (textList[textIndex].Length <= 33)
            {
                textList[textIndex] += "\n\n";
            }
            displayText.text = textList[textIndex];
            textIndex++;
            print(textIndex);
        }

        print(transform.position);
    }
Ejemplo n.º 7
0
            public Day(Intro intro, IList <Entry> entries, int startLineNumber)
            {
                if (object.ReferenceEquals(intro, null))
                {
                    throw new ArgumentNullException("intro");
                }

                if (object.ReferenceEquals(entries, null))
                {
                    throw new ArgumentNullException("entries");
                }

                if (startLineNumber < 0)
                {
                    throw new ArgumentOutOfRangeException(
                              "startLineNumber", startLineNumber, "Start line number has to be non-negative");
                }

                this.StartLineNumber = startLineNumber;

                // Compute total line/parse_issue count as sum over total line/parse_issue counts
                // of intro and all entries.
                this.TotalLineCount       = intro.TotalLineCount;
                this.TotalParseIssueCount = intro.TotalParseIssueCount;
                foreach (Entry entry in entries)
                {
                    this.TotalLineCount       = this.TotalLineCount + entry.TotalLineCount;
                    this.TotalParseIssueCount = this.TotalParseIssueCount + entry.TotalParseIssueCount;
                }

                this.DayIntro   = intro;
                this.DayEntries = entries;
            }
        public async Task <IActionResult> PutIntro(int id, Intro intro)
        {
            if (id != intro.IntroId)
            {
                return(BadRequest());
            }

            _context.Entry(intro).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!IntroExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 9
0
        protected virtual void ScreenChanged(IScreen current, IScreen newScreen)
        {
            switch (newScreen)
            {
            case Intro intro:
                introScreen = intro;
                break;

            case MainMenu menu:
                menuScreen = menu;
                break;
            }

            if (newScreen is IOsuScreen newOsuScreen)
            {
                OverlayActivationMode.Value = newOsuScreen.InitialOverlayActivationMode;

                if (newOsuScreen.HideOverlaysOnEnter)
                {
                    CloseAllOverlays();
                }
                else
                {
                    Toolbar.State = Visibility.Visible;
                }
            }
        }
Ejemplo n.º 10
0
        public void TestIntro()
        {
            //Arrange
            string expected    = "Welcome to HINAdventures Dag!\nThis game will let you play in a simulation of Narvik University College\nTo see all available rooms from the room you are in type 'scout'\nTo move to another room type 'Enter roomnumber'\nYou can also chat to other people in the chat below.\nFor a full list of commands type 'Help'\nEnjoy the game!\n\nTest Description\nYou see 2 doors labeled 'D3001', 'D3002'.\n";
            Room   enteredRoom = new Room {
                Id = 1, Name = "D3000", Description = "Test Description", ConnectedRooms = new List <Room>()
            };
            Room connectedRoom1 = new Room {
                Id = 2, Name = "D3001"
            };
            Room connectedRoom2 = new Room {
                Id = 3, Name = "D3002"
            };

            enteredRoom.ConnectedRooms.Add(connectedRoom1);
            enteredRoom.ConnectedRooms.Add(connectedRoom2);
            ApplicationUser user = new ApplicationUser {
                FirstName = "Dag", Room = enteredRoom
            };

            Mock <IRepository> repository = new Mock <IRepository>();

            repository.Setup(x => x.GetUser("userid")).Returns(user);
            var intro = new Intro(repository.Object);

            //Act
            string actual = intro.RunCommand("userid");

            //Assess
            Assert.AreEqual(expected, actual);
        }
        private void RegisterBtn_Click(object sender, RoutedEventArgs e)
        {
            Intro intro = new Intro();

            Close();
            intro.ShowDialog();
        }
Ejemplo n.º 12
0
        public string[] RenderPage(string headerText, string introText)
        {
            // Nackdel: komplex kod (lätt att råka skriva Round istället för Html)
            // Nackdel: om det tillkommer en till sort (ex RoundButton) så behövs kod uppdateras på många ställen
            Header header = _factory switch
            {
                PageFactory.Round => new RoundHeader(headerText),
                PageFactory.Html => new HtmlHeader(headerText),
                _ => throw new Exception()
            };

            // Nackdel: komplex kod
            Intro intro = _factory switch
            {
                PageFactory.Round => new RoundIntro(introText),
                PageFactory.Html => new HtmlIntro(introText),
                _ => throw new Exception()
            };

            string[] a = header.Render();
            string[] b = intro.Render();

            return(a.ToList().Concat(b).ToArray());
        }
    }
}
Ejemplo n.º 13
0
 private static void Main()
 {
     Intro.Run();
     while (AppCycle.Start())
     {
     }
 }
Ejemplo n.º 14
0
        public ActionResult <Intro> Intro()
        {
            Intro _return = new Intro();

            try
            {
                _return         = _sendKey.Intro();
                _return.Success = true;

                return(_return);
            }
            catch (SqlException ex)
            {
                _return.Success = false;
                _return.Message = ex.Message;
                _return.Details = ex.StackTrace;
                _return.Code    = "SQL";

                return(_return);
            }
            catch (System.Exception ex)
            {
                _return.Success = false;
                _return.Message = ex.Message;
                _return.Details = ex.StackTrace;

                return(_return);
            }
        }
Ejemplo n.º 15
0
    // Use this for initialization
    void Start()
    {
        intro = GameObject.Find("Intro").GetComponent <Intro>();
        targetingArrowHead = GameObject.Find("ArrowHead");
        targetingArrowBody = GameObject.Find("Arrow");
        targetingArrowHead.renderer.enabled = false;
        targetingArrowBody.renderer.enabled = false;

        GameObject anchor = GameObject.Find("FishermanAnchor");

        bobberAnchor = GameObject.Find("BobberAnchor");
        targetingArrowFishermanAnchorPos = anchor.transform.position;

        anchor = GameObject.Find(piratePortNames[0]);
        targetingArrowPirateAnchorPos[0] = anchor.transform.position;

        anchor = GameObject.Find(piratePortNames[1]);
        targetingArrowPirateAnchorPos[1] = anchor.transform.position;

        anchor = GameObject.Find(piratePortNames[2]);
        targetingArrowPirateAnchorPos[2] = anchor.transform.position;

        anchor = GameObject.Find(piratePortNames[3]);
        targetingArrowPirateAnchorPos[3] = anchor.transform.position;

        mouse0Targeting = false;
        mouse1Targeting = false;

        currentPoleAngle = 0;
        fishingPole      = GameObject.Find("Pole");
        //StartCoroutine(coPoleReturn());
    }
Ejemplo n.º 16
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            foreach (var a in _status.DrawObjects)
            {
                a.InitTextures(Content);
            }


            _intro = new Intro(Content);

            _status.Font = Content.Load <SpriteFont>(CONSTANTS.SPRITE_FONT_DEFAULT);
            _cityMenu    = new CityMenu(CONSTANTS.WINDOWWIDTH / 2, CONSTANTS.WINDOWHEIGHT / 2, Content);

            List <Tile> tiles = _status.Configuration.TileConfiguration.Tiles;

            _textures    = new Dictionary <string, Texture2D>(tiles.Count);
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            if (_mouse == null)
            {
                _mouse = new DrawMouse(this.Content, CONSTANTS.XSPACE, CONSTANTS.YSPACE);
            }
            foreach (Tile tile in tiles)
            {
                _textures.Add(tile.TileID, Content.Load <Texture2D>(CONSTANTS.FLD_TILE + tile.TilePath));
            }

            _textures.Add(CONSTANTS.TXT_YEAR_MENU, Content.Load <Texture2D>(CONSTANTS.PATH_TXT_YEAR_MENU));
            _textures.Add(CONSTANTS.TXT_CITY, Content.Load <Texture2D>(CONSTANTS.PATH_TXT_CITY));
        }
Ejemplo n.º 17
0
        protected virtual void ScreenChanged(IScreen current, IScreen newScreen)
        {
            switch (newScreen)
            {
            case Intro intro:
                introScreen = intro;
                break;

            case MainMenu menu:
                menuScreen = menu;
                break;
            }

            if (newScreen is IOsuScreen newOsuScreen)
            {
                backgroundParallax.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * newOsuScreen.BackgroundParallaxAmount;

                OverlayActivationMode.Value = newOsuScreen.InitialOverlayActivationMode;

                if (newOsuScreen.HideOverlaysOnEnter)
                {
                    CloseAllOverlays();
                }
                else
                {
                    Toolbar.State = Visibility.Visible;
                }
            }
        }
Ejemplo n.º 18
0
        static void Main()
        {
            Console.Clear();
            Intro.MainIntro();
            Console.OutputEncoding = Encoding.UTF8;
            SetupConsole();

            int totalLevels = 0;

            try
            {
                totalLevels = LoadLevels();
            }
            catch (Exception ex)
            {
                Console.Clear();
                Console.WriteLine("Unable to load the levels: {0} Exitting.", ex.Message);
                return;
            }

            for (int levelInPlay = 0; levelInPlay < totalLevels; levelInPlay++)
            {
                Console.Clear();
                PlayLevel(levelInPlay);
            }

            Ending.MainEnding();
        }
        public async Task <ActionResult <Intro> > PostIntro(Intro intro)
        {
            _context.intro.Add(intro);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetIntro", new { id = intro.IntroId }, intro));
        }
Ejemplo n.º 20
0
    void Awake()
    {
        intro  = GameObject.Find("IntrotManager").GetComponent <Intro>();
        player = GameObject.Find("First Person Controller");

        switch (type)
        {
        case Intro.TypeEvent.Interaction:
            Mess.Clear();
            Mess.Add("Tryck Enter");
            TextPos = 2;
            break;

        case Intro.TypeEvent.Talking:

            break;

        case Intro.TypeEvent.Message:
            Mess.Add("m");
            TextPos = 0;
            break;

        default:
            break;
        }
    }
Ejemplo n.º 21
0
        public MainViewW()
        {
            // TESTPOINT_MIGRATION_LOGGING_INIT_MIGRATION_LOG_WIZARD Initializes main log for MigrationWizard
            Log.InitializeLogging(Log.Level.Trace); // <- use Trace level for startup (and swicth to Info at bottom of this method)

            using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock("MainViewW.MainViewW"))
            {
                InitializeComponent();

                // Default is "server migration"
                Application.Current.Properties["migrationmode"] = "server";

                m_baseViewModel = new BaseViewModel();

                // Setup intro page
                m_introViewModel = new IntroViewModel(lbMode);
                Intro intro = new Intro();
                m_introViewModel.Name       = "IntroViewModel";
                m_introViewModel.ViewTitle  = "Welcome";
                m_introViewModel.lb         = lbMode;
                m_introViewModel.isBrowser  = true;
                m_introViewModel.WelcomeMsg = intro.WelcomeMsg;
                m_introViewModel.InstallDir = intro.InstallDir;

                m_introViewModel.SetupViews(true);
                m_introViewModel.AddViews(true);

                lbMode.SelectedIndex = 0;
                DataContext          = m_introViewModel;

                // Switch back to Info log level
                m_introViewModel.SelectedLogLevelCBItem.LogLevelEnum = Log.Level.Info;
            }
        }
Ejemplo n.º 22
0
        static void Main(string[] args)
        {
            Intro value = CaptarNumeros();

            Console.WriteLine("[{0}]", string.Join(", ", CreateArray(value)));
            Console.ReadLine();
        }
Ejemplo n.º 23
0
    internal static void Start()

    {
        //valid frequency >37 && frequency< 32767 hertz.

        var MyPiano = new Intro();

        //https://blog.dhampir.no/content/fun-with-beep

        Console.WriteLine("Start the nice intro music");

        Console.Beep(38, 1000);    // low

        Console.Beep(55, 1000);    // medium A1

        Console.Beep(110, 1000);   // medium A2

        Console.Beep(220, 1000);   // medium A3

        Console.Beep(440, 1000);   // medium A4

        Console.Beep(880, 1000);   // medium A5

        Console.Beep(1760, 1000);  // medium A6



        Console.WriteLine("Intro music has ended");
    }
Ejemplo n.º 24
0
        internal static void IntroPatch(Intro __instance, int ___currentState)
        {
            try
            {
                if (MainClass.ModHelper == null)
                {
                    return;
                }

                string toSpeak = " ";

                if (___currentState == 3)
                {
                    toSpeak = MainClass.ModHelper.Translation.Get("intro.scene3");
                }
                else if (___currentState == 4)
                {
                    toSpeak = MainClass.ModHelper.Translation.Get("intro.scene4");
                }

                if (toSpeak != " " && introQuery != toSpeak)
                {
                    introQuery = toSpeak;
                    MainClass.ScreenReader.Say(toSpeak, false);
                    return;
                }
            }
            catch (System.Exception e)
            {
                MainClass.ErrorLog($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}");
            }
        }
Ejemplo n.º 25
0
 public void WriteToROM()
 {
     if (NewGame != null && NewGame.Visible)
     {
         NewGame.WriteToROM();
     }
     if (Animations != null && Animations.Visible)
     {
         Animations.WriteToROM();
     }
     if (Attacks != null && Attacks.Visible)
     {
         Attacks.WriteToROM();
     }
     if (Battlefields != null && Battlefields.Visible)
     {
         Battlefields.WriteToROM();
     }
     if (Dialogues != null && Dialogues.Visible)
     {
         Dialogues.WriteToROM();
     }
     if (EventScripts != null && EventScripts.Visible)
     {
         EventScripts.WriteToROM();
     }
     if (Fonts != null && Fonts.Visible)
     {
         Fonts.WriteToROM();
     }
     if (Formations != null && Formations.Visible)
     {
         Formations.WriteToROM();
     }
     if (Items != null && Items.Visible)
     {
         Items.WriteToROM();
     }
     if (Areas != null && Areas.Visible)
     {
         Areas.WriteToROM();
     }
     if (Monsters != null && Monsters.Visible)
     {
         Monsters.WriteToROM();
     }
     if (Sprites != null && Sprites.Visible)
     {
         Sprites.WriteToROM();
     }
     if (Intro != null && Intro.Visible)
     {
         Intro.WriteToROM();
     }
     if (WorldMaps != null && WorldMaps.Visible)
     {
         WorldMaps.WriteToROM();
     }
 }
Ejemplo n.º 26
0
        public async Task <Intro> AddIntro(Intro intro)
        {
            var introEntry = await this.Intros.AddAsync(intro);

            await this.SaveChangesAsync();

            return(introEntry.Entity);
        }
Ejemplo n.º 27
0
        public Program()
        {
            bool fullScreen = false;

            Hardware.Init(800, 600, 24, fullScreen);

            intro = new Intro();
        }
 public static void Play()
 {
     Munich.BuildMunich();
     Intro.HowTo();
     Current.CurrentPlayer();
     Current.CurrentItems();
     Run();
 }
Ejemplo n.º 29
0
        // Intro i = new Intro(args);
        //Leapyearcopy l = new Leapyearcopy();
        //  l.run();
        //   test(args);
        //   Console.ReadKey();

        /*
         * To add a project, first add a new folder naming it the [projectname]
         * then type
         * dotnet new classlib -o [projectname]
         * then cd to 0_main and type
         * dotnet add reference ../[projectname]/[projectname].csproj
         */
        static void test(string [] args)
        {
            Intro                  i  = new Intro(args);
            OOP                    o  = new OOP(args);
            Design_Patterns        d  = new Design_Patterns(args);
            Functional_Programming f  = new Functional_Programming(args);
            Database_Design        dd = new Database_Design(args);
        }
Ejemplo n.º 30
0
 void Awake()
 {
     player       = GameObject.Find("Player");
     blacksmith   = GameObject.FindWithTag("Blacksmith");
     playerLevel  = player.GetComponent <PlayerLevel> ();
     playerHealth = player.GetComponent <PlayerHealth> ();
     intro        = blacksmith.GetComponent <Intro> ();
 }
Ejemplo n.º 31
0
    void Awake()
    {
        introduction = GameObject.FindObjectOfType<Intro>();
        if(Application.isEditor)
        {
            if(introduction!=null)
                introduction.SkipIntro = DisableIntro;

            if(DisableMusic)
            {
                music.volume = 0.0f;
            } else {
                music.volume = 1.0f;
            }

            if(DisableEffects)
            {
                effects.volume = 0.0f;
            } else {
                effects.volume = 1.0f;
            }
        }
    }
Ejemplo n.º 32
0
        public Event(DateTime ClockStart, DateTime ClockEnd, int ClockRunTime, System.Xml.Linq.XDocument XMLEvents, ref CrashHandler Crash)
        {
            ch = Crash;
            events = new Dictionary<string, List<EventItem>>();
            clock = new PartyClock(ClockStart, ClockEnd, ClockRunTime);
            Util.ShowClock = true;
            sound = new Sound(true);
            text = new Text2D();
            chess = new Chess();
            sf = new Starfield(150);

            intro = new Intro(ref sound, ref text);
            outro = new Outro(ref sound);

            advent = new Advent(ref sound);
            birthday = new Birthday(ref sound, ref text, ref chess);
            xmas = new Christmas(ref sound);
            smurf = new Datasmurf(ref sound, ref text); // random
            dif = new Dif(ref chess, ref sound); // random
            fbk = new Fbk(ref sound); // random
            hw = new Halloween(ref chess, ref sound, 25);
            lucia = new Lucia(ref chess, ref sound);
            newyear = new NewYear();
            richard = new RMS(ref sound, ref text); // random
            scroller = new Scroller(ref chess, ref sf, ref text); // random
            semla = new Semla();
            sune = new SuneAnimation(ref sound, ref text);
            tl = new TurboLogo(ref sound, ref chess, (OpenGL.Util.SpringOrFall.Equals("Spring")? true:false)/*((ClockStart.Month >= 1 && ClockStart.Month <= 8)? false:true)*/ ); // vilken termin är det? jan till början av augusti VT, resten HT... random
            valentine = new Valentine(ref sound);
            wl = new WinLinux(ref chess); //random
            creators = new Self(ref sound); // random
            bb = new BB(ref sound); // random
            GM = new GummiBears(ref sound);
            NDay = new National(ref chess, ref sound);
            easter = new Easter(ref sound);
            hajk = new Hajk(ref sound);
            mid = new Midsummer(ref sound);
            vaf = new Vaffla();
            wp = new Walpurgis();
            crayfish = new CrayFish();

            ts = new TeknatStyle(ref chess, ref sound, ref text);
            m = new Matrix(ref text);
            q = new Quiz(ref text, false, ref sound);
            talepsin = new Talespin(ref sound);
            cd = new ChipAndDale(ref sound, ref chess);
            nerd = new Nerdy(ref chess, ref sound);
            trex = new Trex(ref sound);
            sailormoon = new Sailormoon(ref sound,ref chess);
            gb = new GhostBusters(ref sound);
            zelda = new Zelda(ref sound, ref chess);
            tardis = new Tardis(ref sound);
            f**k = new F**k(ref sound, ref chess);

            silverFang = new SilverFang(ref sound);
            mt = new MoraT(ref sound);

            swine = new Swine(ref chess, ref text);
            tjall = new Tjall(ref chess, ref text);

            ronja = new Ronja(ref sound);
            emil = new Emil(ref sound);
            djungelboken = new Djungelboken(ref sound);
            fabbe = new Fabbe(ref sound);
            drink = new Drink(ref sound);
            frozen = new Frozen(ref sound);

            eventCurrent = null; // event item for events to be triggerd in clock_NewDate
            //randomEvent = new List<string>(new string[] { "starfield", "SuneAnimation", "TurboLogo", "Datasmurf", "WinLinux", "Scroller", "BB", "GummiBears", "TeknatStyle", "Matrix"});
            randomEvent = new List<string>(new string[] { "starfield", "Nerdy", "Talespin", "Sailormoon", "GhostBusters", "Zelda", "Tardis", "F**k", "SilverFang", "MoraT" });
            //new stuff
             List<UtilXML.EventData> ed = UtilXML.Loadeffectdata();

            // TODO: Make a clean list with all events allowed to be used implement so that it is actaully usable instead of a switch at the bottom of this file.
            Dictionary<string, Effect> effects = new Dictionary<string, Effect>()
            {
                {"SuneAnimation", new Effect(sune, ed.Find(e => e.Name == "SuneAnimation"))},
                {"Dif",new Effect(dif, ed.Find(e => e.Name == "Dif"))},
                {"Fbk",new Effect(fbk, ed.Find(e => e.Name == "Fbk"))},
                {"TurboLogo",new Effect(tl, ed.Find(e => e.Name == "TurboLogo"))},
                {"Datasmurf", new Effect(smurf, ed.Find(e => e.Name == "Datasmurf"))},
                {"RMS",new Effect(richard, ed.Find(e => e.Name == "RMS"))},
                {"WinLinux",new Effect(wl, ed.Find(e => e.Name == "WinLinux"))},
                {"Scroller",new Effect(scroller, ed.Find(e => e.Name == "Scroller"))},
                {"Self",new Effect(creators, ed.Find(e => e.Name == "Self"))},
                {"BB",new Effect(bb, ed.Find(e => e.Name == "BB"))},
                {"GummiBears",new Effect(GM, ed.Find(e => e.Name == "GummiBears"))},
                {"Hajk",new Effect(hajk, ed.Find(e => e.Name == "Hajk"))},
                {"TeknatStyle",new Effect(ts, ed.Find(e => e.Name == "TeknatStyle"))},
                {"Matrix",new Effect(m, ed.Find(e => e.Name == "Matrix"))},
                {"Quiz",new Effect(q, ed.Find(e => e.Name == "Quiz"))},
                {"Talespin",new Effect(talepsin, ed.Find(e => e.Name == "Talespin"))},
                {"ChipDale",new Effect(cd, ed.Find(e => e.Name == "ChipDale"))},
                {"Nerdy",new Effect(nerd, ed.Find(e => e.Name == "Nerdy"))},
              /*  {"Trex",new Effect(trex, ed.Find(e => e.Name == "Trex"))},*/
                {"Sailormoon",new Effect(sailormoon, ed.Find(e => e.Name == "Sailormoon"))},
                {"GhostBusters",new Effect(gb, ed.Find(e => e.Name == "GhostBusters"))},
                {"Zelda",new Effect(zelda, ed.Find(e => e.Name == "Zelda"))},
                {"Tardis",new Effect(tardis, ed.Find(e => e.Name == "Tardis"))},
                {"F**k",new Effect(f**k, ed.Find(e => e.Name == "F**k"))},
                {"SilverFang",new Effect(silverFang, ed.Find(e => e.Name == "SilverFang"))},
                {"MoraT",new Effect(mt, ed.Find(e => e.Name == "MoraT"))},
                {"Ronja",new Effect(ronja, ed.Find(e => e.Name == "Ronja"))},
                {"Emil",new Effect(emil, ed.Find(e => e.Name == "Emil"))},
                {"Djungelboken",new Effect(djungelboken, ed.Find(e => e.Name == "Djungelboken"))},
                {"Fabbe",new Effect(fabbe, ed.Find(e => e.Name == "Fabbe"))},
                {"Drink",new Effect(drink, ed.Find(e => e.Name == "Drink"))},
                {"Frozen",new Effect(drink, ed.Find(e => e.Name == "Frozen"))}
            };

            runEffectInMonth = new Dictionary<string, List<objdata>>();

            string[] months = Util.monthlist();
            int counter;
            foreach (KeyValuePair<string, Effect> pair in effects)
            {
                counter = 0;
                foreach (bool b in pair.Value.RunAllowedlist)
                {
                    if (b == true)
                    {
                        if (!runEffectInMonth.ContainsKey(months[counter]))
                        {
                            runEffectInMonth.Add(months[counter], new List<objdata>());
                        }

                        runEffectInMonth[months[counter]].Add(new objdata(pair.Key, pair.Value.Vetolist[counter], pair.Value.Priolist[counter], pair.Value.Runslist[counter]));
                    }
                    counter++;
                }
            }

            clock.NewDate += clock_NewDate; // Event listener

            if (ch.CrashDialogResult == System.Windows.Forms.DialogResult.Yes)
            {
                clock.clock = ch.CrashClock;
            }

            string name, date, type;
            // Event dates setup
            foreach (var item in XMLEvents.Descendants("event"))
            {
                name = item.Element("name").Value;
                date = item.Element("date").Value;
                type = item.Element("type").Value.ToLower();
                EventItem ei = new EventItem(name, type, date);
                if (!events.ContainsKey(date))
                {
                    List<EventItem> list = new List<EventItem>(); // seems most bad in my eyes...
                    events.Add(date, list);
                }

                for (int i = 0; i < events[date].Count; i++)
                {
                    EventItem e = events[date][i];
                    if ("birthday".Equals(e.Type) && "birthday".Equals(ei.Type))
                    {
                        e.Name += "\n\n" + ei.Name;
                        events[date][i] = e;
                    }
                }
                events[date].Add(ei);
                name = date = type = string.Empty;
            }

            // this needs to be fixed nicer...
            if (events.ContainsKey(ClockEnd.ToShortDateString()))
            {
                events[ClockEnd.ToShortDateString()].Clear(); // force this to be top..
                events[ClockEnd.ToShortDateString()].Add( new EventItem("outro", "outro", ClockEnd.ToShortDateString()) );
            }
            else
            {
                events.Add(ClockEnd.ToShortDateString(), new List<EventItem>() { new EventItem("outro", "outro", ClockEnd.ToShortDateString()) });
            }

            // Random effects on dates with no effects and check against new list of allowed things for them...
            DateTime dt = ClockStart;
            bool star = (Util.Rnd.Next(0, 1000) < 500 ? true:false); // make this random at the start too?
            int num = 0;

            while (dt <= ClockEnd)
            {
                date = dt.ToShortDateString();
                if (!events.ContainsKey(date))
                {
                    EventItem ei;

                    if (num == 0 || num == 1)
                    {
                        ei = new EventItem("starfield", "random", date);
                    }
                    else
                    {
                        //ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);

                        string month = "";
                        if (dt != null)
                            month = dt.Month.ToString();

                        switch (month)
                        {
                            case "1": month = "jan"; break;
                            case "2": month = "feb"; break;
                            case "3": month = "mar"; break;
                            case "4": month = "apr"; break;
                            case "5": month = "maj"; break;
                            case "6": month = "jun"; break;
                            case "7": month = "jul"; break;
                            case "8": month = "aug"; break;
                            case "9": month = "sep"; break;
                            case "10": month = "okt"; break;
                            case "11": month = "nov"; break;
                            case "12": month = "dec"; break;
                        }//switch

                        if (runEffectInMonth.ContainsKey(month))
                        {
                            List<objdata> mobj = runEffectInMonth[month];

                            List<objdata> vetolist = new List<objdata>();
                            List<objdata> novetolist = new List<objdata>();

                            foreach (objdata n in mobj)
                            {

                                if ("Quiz".Equals(n.Name) && eventnum == 4)
                                {
                                    n.vetoAgain();
                                    eventnum = 0;
                                }

                                if (n.Veto == true)
                                {
                                    if (n.Runs > 0)
                                        vetolist.Add(n);
                                }
                                else
                                {
                                    if (n.Runs > 0)
                                        novetolist.Add(n);
                                }
                            }

                            vetolist.Sort();
                            novetolist.Sort();

                            if (vetolist.Count > 0)
                            {
                                ei = new EventItem(vetolist[0].Name, "random", date);
                                vetolist[0].noMoreVeto();
                            }
                            else if (novetolist.Count > 0)
                            {
                                ei = new EventItem(novetolist[0].Name, "random", date);
                                novetolist[0].decRuns();
                                if (eventnum < 4)
                                    eventnum++;
                            }
                            else
                            {
                                ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);
                            }
                        }
                        else
                        {
                            ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);
                        }
                    }

                    num++;
                    if (num == 3)
                    {
                        num = 0;
                    }
                    ei = new EventItem("Self", "random", date); // this is for debuging new events
                    events.Add(date, new List<EventItem>());
                    events[date].Add(ei);
                }

                dt = dt.AddDays(1);
                date = string.Empty;
            }
        }
Ejemplo n.º 33
0
 // Use this for initialization
 void Start()
 {
     intro = GetComponent<Intro> ();
 }
Ejemplo n.º 34
0
 void Awake()
 {
     S = this;
 }
Ejemplo n.º 35
0
 public static void Initialize(SpriteBatch batch, ContentManager manager, GraphicsDevice graphics)
 {
     Gamestate.manager = manager;
     Gamestate.batch = batch;
     Gamestate.graphics = graphics;
     font = manager.Load<SpriteFont>("fonts/font");
     font2 = manager.Load<SpriteFont>("fonts/font2");
     intro = new Intro(batch, manager);
     state = State.intro;
     level = new Level(batch, manager, "1-1");
     SoundEffect tmp = manager.Load<SoundEffect>("sounds/gameover");
     gameover = tmp.CreateInstance();
     tmp = manager.Load<SoundEffect>("sounds/cointoscore");
     coinstoscoresound = tmp.CreateInstance();
     coinstoscoresound.IsLooped = true;
     videoPlayer = new VideoPlayer();
     myVideoFile = manager.Load<Video>("videos/Ending");
     myVideoFile2 = manager.Load<Video>("videos/Cat");
 }
Ejemplo n.º 36
0
 void Start()
 {
     intro = GameObject.Find("Intro").GetComponent<Intro>();
     StartCoroutine(coJump());
 }
Ejemplo n.º 37
0
        protected override void LoadContent()
        {
            ttle = new TransitionToLevelEffect();

            GameContent.LoadContent(Content);
            GameContent.Loadxml(Content);

            currentSong = "8bit";
            MediaPlayer.Play(GameContent.eightbit);
            MediaPlayer.IsRepeating = true;

            spriteBatch = new SpriteBatch(GraphicsDevice);

            home = new Home(GameContent.normalfont, GameContent.button, GameContent.buttonhover, GameContent.logo);
            intro = new Intro(GameContent.normalfont, Content.Load<Texture2D>("guis/text box"), GameContent.button, GameContent.buttonhover, GameContent.typewriter, GameContent.spacebar, false);
            continueintro = new Intro(GameContent.normalfont, Content.Load<Texture2D>("guis/text box"), GameContent.button, GameContent.buttonhover, GameContent.typewriter, GameContent.spacebar, true);
            levellist = SubLevels.registerLevels(GameContent.playermove, GameContent.playerattack, GameContent.grass, GameContent.grassbarrier, GameContent.foamsword, GameContent.portal, GameContent.eightbit, GameContent.cantina_theme, GameContent.arcade, GameContent.normalfont, GameContent.button, GameContent.buttonhover, GameContent.tshirt, GameContent.fourpixels, GameContent.slimeparticle, GameContent.skyportal, GameContent.tooltip, GameContent.descriptionsfont, GameContent.keytxture, GameContent.keydown);
            gameover = new GameOver(GameContent.gameovertexture, GameContent.button, GameContent.buttonhover, GameContent.normalfont);
            inventory = new Inventory(GameContent.invtxture, GameContent.selectedinventory);
            healthManager = new HealthManager(GameContent.hitparticle, GameContent.fourpixels);
            width = GraphicsDevice.Viewport.Width;
            height = GraphicsDevice.Viewport.Height;
        }
Ejemplo n.º 38
0
	//Añade la intro al dialogo
	public void AnyadirIntro(Intro intro)
	{
		//Si la intro con el ID especificado no existe en el dialogo, la añadimos
		if(!IntroExiste (intro.ID))
			intros.Add (intro);

		//Ordena las intros por prioridad de mayor a menor, manteniendo el orden de los elementos con la misma prioridad
		//Una intro añadida con la misma prioridad será colocada abajo de los iguales, es decir, como si fuera menor.
		intros = intros.OrderByDescending(x => x.prioridad).ToList();
	}
Ejemplo n.º 39
0
    // Use this for initialization
    void Start()
    {
        intro = GameObject.Find("Intro").GetComponent<Intro>();
        targetingArrowHead = GameObject.Find("ArrowHead");
        targetingArrowBody = GameObject.Find("Arrow");
        targetingArrowHead.renderer.enabled = false;
        targetingArrowBody.renderer.enabled = false;

        GameObject anchor = GameObject.Find("FishermanAnchor");
        bobberAnchor = GameObject.Find("BobberAnchor");
        targetingArrowFishermanAnchorPos = anchor.transform.position;

        anchor = GameObject.Find(piratePortNames[0]);
        targetingArrowPirateAnchorPos[0] = anchor.transform.position;

        anchor = GameObject.Find(piratePortNames[1]);
        targetingArrowPirateAnchorPos[1] = anchor.transform.position;

        anchor = GameObject.Find(piratePortNames[2]);
        targetingArrowPirateAnchorPos[2] = anchor.transform.position;

        anchor = GameObject.Find(piratePortNames[3]);
        targetingArrowPirateAnchorPos[3] = anchor.transform.position;

        mouse0Targeting = false;
        mouse1Targeting = false;

        currentPoleAngle = 0;
        fishingPole = GameObject.Find("Pole");
        //StartCoroutine(coPoleReturn());
    }