Exemplo n.º 1
0
        private void varEditStripBtn_Click(object sender, EventArgs e)
        {
            VarManager varManager = new VarManager(Context.ActionModel.VariableActionModel);

            varManager.FormClosed += new FormClosedEventHandler(varManager_FormClosed);
            varManager.ShowDialog();
        }
Exemplo n.º 2
0
        public xEmulateForm(string[] args)
        {
            InitializeComponent();

            Singleton<InfoTextManager>.Instance.Init(ref infoText);
            Singleton<InputManager>.Instance.Init();
            Singleton<DxInputManager>.Instance.Init(this);
            Singleton<XimDyn>.Instance.Init();

            m_commandParser = CommandParser.Instance;
            m_ximulator = new Ximulator(this);

            m_configManager = ConfigManager.Instance;
            m_varManager = VarManager.Instance;

            if (args.Length == 0 || !m_configManager.LoadConfig(args[0]))
            {
                m_configManager.LoadDefaultConfig();
            }

            this.cbGame.Items.AddRange(GamesManager.GameNames);

            if(System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
                this.version.Text = "Version: "+System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();

            this.drawSticksCenter = new Vector2(this.mouseDisplayRect.Location.X + this.mouseDisplayRect.Size.Width / 2,
                                            this.mouseDisplayRect.Location.Y + this.mouseDisplayRect.Size.Height / 2);
            drawSticksSize = this.mouseDisplayRect.Size.Height;

            SyncUI();
            SetTooltips();
            commandBox.Focus();
        }
Exemplo n.º 3
0
        public BetaMouseMath()
        {
            this.varManager = VarManager.Instance;
            this.inputManager = InputManager.Instance;
            this.gamesManager = BetaGamesManager.Instance;

            this.varManager.GetVar(VarManager.Names.Speed, out m_speed);
            this.varManager.GetVar(VarManager.Names.Speed2, out m_speed2);
            this.varManager.GetVar(VarManager.Names.Speed3, out m_speed3);
            this.varManager.GetVar(VarManager.Names.Speed4, out m_speed4);
            this.varManager.GetVar(VarManager.Names.Accel, out m_accel);
            this.varManager.GetVar(VarManager.Names.Accel2, out m_accel2);
            this.varManager.GetVar(VarManager.Names.Accel3, out m_accel3);
            this.varManager.GetVar(VarManager.Names.Accel4, out m_accel4);
            this.varManager.GetVar(VarManager.Names.Sensitivity1, out m_sensitivity1);
            this.varManager.GetVar(VarManager.Names.Sensitivity2, out m_sensitivity2);
            this.varManager.GetVar(VarManager.Names.AltSens, out m_altSens);
            this.varManager.GetVar(VarManager.Names.AltSens2, out m_altSens2);
            this.varManager.GetVar(VarManager.Names.AltSens3, out m_altSens3);
            this.varManager.GetVar(VarManager.Names.Deadzone, out m_deadzone);
            this.varManager.GetVar(VarManager.Names.YXRatio, out m_yxratio);
            this.varManager.GetVar(VarManager.Names.TransExponent1, out m_transExp1);
            this.varManager.GetVar(VarManager.Names.Smoothness, out m_smoothness);
            this.varManager.GetVar(VarManager.Names.Rate, out m_rate);
            this.varManager.GetVar(VarManager.Names.AutoAnalogDisconnect, out m_autoAnalogDisconnect);
            this.varManager.GetVar(VarManager.Names.CircularDeadzone, out m_circularDeadzone);
            this.varManager.GetVar(VarManager.Names.UseXimApiMouseMath, out m_useXimApiMouseMath);
            this.varManager.GetVar(VarManager.Names.DiagonalDampen, out m_diagonalDampen);
            this.varManager.GetVar(VarManager.Names.CurrentGame, out m_currentGame);
            this.varManager.GetVar(VarManager.Names.MouseStickX, out m_mouseStickX);
            this.varManager.GetVar(VarManager.Names.MouseStickY, out m_mouseStickY);
            this.varManager.GetVar(VarManager.Names.InvertY, out m_inverty);
            this.varManager.GetVar(VarManager.Names.MouseDPI, out m_mouseDpi);
        }
    IEnumerator WaitThenClearCourse()
    {
        // Bíða í 2 sekúndur
        yield return(new WaitForSeconds(1.5f));

        Flip();  // Snúa leikmanni til vinstri

        // Færa leikmann á réttan stað m.v. hvernig hann snýr
        MovePlayerXTo(flagpolePosXFacingLeft);

        // Bíða í 0.5 sekúndur
        yield return(new WaitForSeconds(0.5f));

        Flip();                                 // Snúa leikmanni aftur til hægri
        animator.SetBool("On Flagpole", false); // Láta leikmann sleppa fánastöng

        cameraController.SetStatic(false);      // Losa myndavél þegar leikmaður er að fara af fánastöng

        // Spila clear hljóð og ganga í átt að kastala
        clearSoundLength     = audioManager.PlayAudio("Clear"); // Geyma lengd í clearSoundLength til að vita hvenær á að fara í næsta borð
        walkingTowardsCastle = true;

        // Bíða þar til clear hljóð er búið + 1 sek og fara í næsta borð
        yield return(new WaitForSeconds(clearSoundLength + 1f));

        // Fara í næsta borð
        VarManager.GoToNextLevel();
    }
Exemplo n.º 5
0
 void Update()
 {
     // Fara á upphafsskjá ef notandi ýtir á Cancel (esc)
     if (Input.GetButton("Cancel"))
     {
         VarManager.GoToMainMenu();
     }
 }
Exemplo n.º 6
0
    IEnumerator WaitThenRestartScene()
    {
        yield return(new WaitForSeconds(5.0f));

        VarManager.lives--;
        // Ef leikmaður á fleiri en 0 líf eftir, byrja aftur á borði
        if (VarManager.lives > 0)
        {
            VarManager.GoToLevelSplash();
        }
        // Annars er leik lokið
        else
        {
            VarManager.GoToGameOver();
        }
    }
Exemplo n.º 7
0
        private CommandParser()
        {
            m_infoTextManager = InfoTextManager.Instance;
            m_bindingManager = BindingManager.Instance;
            m_varManager = VarManager.Instance;

            foreach (Xim.Button button in Enum.GetValues(typeof(Xim.Button)))
            {
                String name = Enum.GetName(typeof(Xim.Button), button);
                m_buttonMap.Add(name.ToLower(), button);
            }

            foreach (Xim.Analog button in Enum.GetValues(typeof(Xim.Analog)))
            {
                String name = Enum.GetName(typeof(Xim.Analog), button);
                m_ximAnalogMap.Add(name.ToLower(), button);
            }
        }
Exemplo n.º 8
0
    // Construct a new quest from quest data
    public Quest(QuestData.Quest q)
    {
        game = Game.Get();

        // This happens anyway but we need it to be here before the following code is executed
        game.quest = this;

        // Static data from the quest file
        qd = new QuestData(q);

        // Initialise data
        boardItems    = new Dictionary <string, BoardComponent>();
        vars          = new VarManager();
        items         = new HashSet <string>();
        monsters      = new List <Monster>();
        heroSelection = new Dictionary <string, List <Quest.Hero> >();
        puzzle        = new Dictionary <string, Puzzle>();
        eventQuota    = new Dictionary <string, int>();
        delayedEvents = new List <QuestData.Event.DelayedEvent>();
        undo          = new Stack <string>();
        log           = new List <LogEntry>();
        monsterSelect = new Dictionary <string, string>();

        GenerateMonsterSelection();
        eManager = new EventManager();

        // Populate null hero list, these can then be selected as hero types
        heroes = new List <Hero>();
        for (int i = 1; i <= game.gameType.MaxHeroes(); i++)
        {
            heroes.Add(new Hero(null, i));
        }

        // Set quest vars for selected expansions
        foreach (string s in game.cd.GetLoadedPackIDs())
        {
            if (s.Length > 0)
            {
                vars.SetValue("#" + s, 1);
            }
        }
    }
Exemplo n.º 9
0
    // Construct a new quest from quest data
    public Quest(QuestData.Quest q)
    {
        game = Game.Get();

        // This happens anyway but we need it to be here before the following code is executed
        game.quest = this;

        // Static data from the quest file
        qd = new QuestData(q);

        // Initialise data
        boardItems    = new Dictionary <string, BoardComponent>();
        vars          = new VarManager();
        items         = new HashSet <string>();
        monsters      = new List <Monster>();
        heroSelection = new Dictionary <string, List <Quest.Hero> >();
        puzzle        = new Dictionary <string, Puzzle>();
        eventQuota    = new Dictionary <string, int>();
        eManager      = new EventManager();
        delayedEvents = new List <QuestData.Event.DelayedEvent>();
        undo          = new Stack <string>();
        log           = new List <LogEntry>();

        // Populate null hero list, these can then be selected as hero types
        heroes = new List <Hero>();
        for (int i = 1; i <= game.gameType.MaxHeroes(); i++)
        {
            heroes.Add(new Hero(null, i));
        }

        // Set quest vars for selected expansions
        Dictionary <string, string> packs = game.config.data.Get(game.gameType.TypeName() + "Packs");

        if (packs != null)
        {
            foreach (KeyValuePair <string, string> kv in packs)
            {
                vars.SetValue("#" + kv.Key, 1);
            }
        }
    }
Exemplo n.º 10
0
 private static bool IsButtonEnabled(QuestButtonData b, VarManager varManager)
 {
     return(b.ConditionFailedAction == QuestButtonAction.NONE || !b.HasCondition || varManager.Test(b.Condition));
 }
Exemplo n.º 11
0
    // Read save data
    public void LoadQuest(IniData saveData)
    {
        game = Game.Get();

        // This happens anyway but we need it to be here before the following code is executed (also needed for loading saves)
        game.quest = this;

        // Get state
        int.TryParse(saveData.Get("Quest", "round"), out round);
        int.TryParse(saveData.Get("Quest", "morale"), out morale);
        bool.TryParse(saveData.Get("Quest", "heroesSelected"), out heroesSelected);
        bool horror;

        bool.TryParse(saveData.Get("Quest", "horror"), out horror);
        if (horror)
        {
            phase = MoMPhase.horror;
        }

        // Set camera
        float camx, camy, camz;

        float.TryParse(saveData.Get("Quest", "camx"), out camx);
        float.TryParse(saveData.Get("Quest", "camy"), out camy);
        float.TryParse(saveData.Get("Quest", "camz"), out camz);
        game.cc.gameObject.transform.position = new Vector3(camx, camy, camz);

        game.cc.minLimit = false;
        if (saveData.Get("Quest", "camxmin").Length > 0)
        {
            game.cc.minLimit = true;
            int.TryParse(saveData.Get("Quest", "camxmin"), out game.cc.minPanX);
            int.TryParse(saveData.Get("Quest", "camymin"), out game.cc.minPanY);
        }

        game.cc.maxLimit = false;
        if (saveData.Get("Quest", "camxmax").Length > 0)
        {
            game.cc.maxLimit = true;
            int.TryParse(saveData.Get("Quest", "camxmax"), out game.cc.maxPanX);
            int.TryParse(saveData.Get("Quest", "camymax"), out game.cc.maxPanY);
        }

        // Populate DelayedEvents (depreciated)
        delayedEvents = new List <QuestData.Event.DelayedEvent>();
        string[] saveDelayed = saveData.Get("Quest", "DelayedEvents").Split(" ".ToCharArray(), System.StringSplitOptions.RemoveEmptyEntries);
        foreach (string de in saveDelayed)
        {
            delayedEvents.Add(new QuestData.Event.DelayedEvent(de));
        }

        // Set static quest data
        string questPath = saveData.Get("Quest", "path");

        qd = new QuestData(questPath);

        monsterSelect = saveData.Get("SelectMonster");
        if (monsterSelect == null)
        {
            // Support old saves
            monsterSelect = new Dictionary <string, string>();
            GenerateMonsterSelection();
        }

        // Clear all tokens
        game.tokenBoard.Clear();
        // Clean up everything marked as 'board'
        foreach (GameObject go in GameObject.FindGameObjectsWithTag("board"))
        {
            Object.Destroy(go);
        }

        // Repopulate items on the baord
        boardItems = new Dictionary <string, BoardComponent>();
        Dictionary <string, string> saveBoard = saveData.Get("Board");

        foreach (KeyValuePair <string, string> kv in saveBoard)
        {
            if (kv.Key.IndexOf("Door") == 0)
            {
                boardItems.Add(kv.Key, new Door(qd.components[kv.Key] as QuestData.Door, game));
            }
            if (kv.Key.IndexOf("Token") == 0)
            {
                boardItems.Add(kv.Key, new Token(qd.components[kv.Key] as QuestData.Token, game));
            }
            if (kv.Key.IndexOf("Tile") == 0)
            {
                boardItems.Add(kv.Key, new Tile(qd.components[kv.Key] as QuestData.Tile, game));
            }
        }

        Dictionary <string, string> saveVars = saveData.Get("Vars");

        vars = new VarManager(saveVars);

        // Set items
        items = new HashSet <string>();
        Dictionary <string, string> saveItems = saveData.Get("Items");

        foreach (KeyValuePair <string, string> kv in saveItems)
        {
            items.Add(kv.Key);
        }

        // Restart event EventManager
        eManager = new EventManager();

        // Clean undo stack (we don't save undo stack)
        // When performing undo this is replaced later
        undo = new Stack <string>();

        // Fetch hero state
        heroes   = new List <Hero>();
        monsters = new List <Monster>();
        foreach (KeyValuePair <string, Dictionary <string, string> > kv in saveData.data)
        {
            if (kv.Key.IndexOf("Hero") == 0 && kv.Key.IndexOf("HeroSelection") != 0)
            {
                heroes.Add(new Hero(kv.Value));
            }
        }

        // Monsters must be after heros because some activations refer to heros
        foreach (KeyValuePair <string, Dictionary <string, string> > kv in saveData.data)
        {
            if (kv.Key.IndexOf("Monster") == 0)
            {
                monsters.Add(new Monster(kv.Value));
            }
        }

        // Restore hero selections
        heroSelection = new Dictionary <string, List <Hero> >();
        Dictionary <string, string> saveSelection = saveData.Get("HeroSelection");

        foreach (KeyValuePair <string, string> kv in saveSelection)
        {
            // List of selected heroes
            string[]    selectHeroes = kv.Value.Split(" ".ToCharArray(), System.StringSplitOptions.RemoveEmptyEntries);
            List <Hero> heroList     = new List <Hero>();

            foreach (string s in selectHeroes)
            {
                foreach (Hero h in heroes)
                {
                    // Match hero id
                    int id;
                    int.TryParse(s, out id);
                    if (id == h.id)
                    {
                        heroList.Add(h);
                    }
                }
            }
            // Add this selection
            heroSelection.Add(kv.Key, heroList);
        }

        puzzle = new Dictionary <string, Puzzle>();
        foreach (KeyValuePair <string, Dictionary <string, string> > kv in saveData.data)
        {
            if (kv.Key.IndexOf("PuzzleSlide") == 0)
            {
                puzzle.Add(kv.Key.Substring("PuzzleSlide".Length, kv.Key.Length - "PuzzleSlide".Length), new PuzzleSlide(kv.Value));
            }
            if (kv.Key.IndexOf("PuzzleCode") == 0)
            {
                puzzle.Add(kv.Key.Substring("PuzzleCode".Length, kv.Key.Length - "PuzzleCode".Length), new PuzzleCode(kv.Value));
            }
            if (kv.Key.IndexOf("PuzzleImage") == 0)
            {
                puzzle.Add(kv.Key.Substring("PuzzleImage".Length, kv.Key.Length - "PuzzleImage".Length), new PuzzleImage(kv.Value));
            }
        }
        // Restore event quotas
        eventQuota = new Dictionary <string, int>();
        foreach (KeyValuePair <string, string> kv in saveData.Get("EventQuota"))
        {
            int value;
            int.TryParse(kv.Value, out value);
            eventQuota.Add(kv.Key, value);
        }

        // Restore event log
        log = new List <LogEntry>();
        foreach (KeyValuePair <string, string> kv in saveData.Get("Log"))
        {
            log.Add(new LogEntry(kv.Key, kv.Value));
        }

        // Update the screen
        game.monsterCanvas.UpdateList();
        game.heroCanvas.UpdateStatus();
    }
Exemplo n.º 12
0
        public Ximulator(xEmulateForm form)
        {
            this.ximDyn = XimDyn.Instance;

            m_form = form;

            m_varManager = VarManager.Instance;
            m_eventManager = EventManager.Instance;
            m_textModeManager = TextModeManager.Instance;
            m_inputManager = InputManager.Instance;
            m_infoTextManager = InfoTextManager.Instance;

            m_prevMouseStates = new Queue<Vector2>();

            // Init the vars so we dont have to get them again.
            m_varManager.GetVar("rate", out m_rate);
            m_varManager.GetVar("textmode", out m_textMode);
            m_varManager.GetVar("textmoderate", out m_textModeRate);
            m_varManager.GetVar("autoanalogdisconnect", out m_autoAnalogDisconnect);
            m_varManager.GetVar("useximapimousemath", out m_useXimApiMouseMath);

            this.mouseMath = new MouseMath();
            this.betaMouseMath = new BetaMouseMath();

            m_utilThread = new UtilThread();
        }
Exemplo n.º 13
0
Arquivo: Frog.cs Projeto: Nin1/2D-RPG
 public void OnInteract()
 {
     VarManager.CreateVar("frogTest", 0);
     CutsceneRunner.instance.StartCutscene(CutsceneRunner.instance.FrogInteract);
 }
Exemplo n.º 14
0
 // Endurræsa leik (núllstilla allt og byrja)
 public void RestartGame()
 {
     VarManager.ResetAll();
     StartGame();
 }
Exemplo n.º 15
0
 public SetVarEvent(VarManager.Var var, Object val)
 {
     m_var = var;
     m_value = val;
 }
Exemplo n.º 16
0
 private bool CreateSetVarEvent(VarManager.Var v, String val, out SetVarEvent e)
 {
     Object valAsObject;
     if (v.CanSetValue(val, out valAsObject))
     {
         e = new SetVarEvent(v, valAsObject);
         return true;
     }
     e = new SetVarEvent(null, null);
     return false;
 }
Exemplo n.º 17
0
 // Byrja leik
 public void StartGame()
 {
     VarManager.GoToLevelSplash();
 }
Exemplo n.º 18
0
 public void Start()
 {
     VarManager.CollectCoin();
 }
Exemplo n.º 19
0
 public HoldVarEvent(ref VarManager.Var var, Object newVal)
 {
     m_var = var;
     m_newValue = newVal;
     m_oldValue = null;
 }
Exemplo n.º 20
0
    /** SCRIPT FUNCTIONS */

    void SetInt(string varName, int value)
    {
        VarManager.SetVar(varName, value);
    }
Exemplo n.º 21
0
 public ToggleVarEvent(ref VarManager.Var var)
 {
     m_var = var;
 }
Exemplo n.º 22
0
 int GetInt(string varName)
 {
     return(VarManager.GetVar(varName));
 }