Inheritance: Race
        public RemoveBlockMutation(Coordinate Location, Gnome Gnome)
        {
            this.MutationTimeFrame = MutationTimeFrame.BeforeUpdatingConnectivity;

            this.Location = Location;
            this.Gnome = Gnome;
        }
		public string LookupIcon(string icon_name, int size, Gnome.IconData icon_data, out int base_size) {
			IntPtr native_icon_name = GLib.Marshaller.StringToPtrGStrdup (icon_name);
			IntPtr raw_ret = gnome_icon_theme_lookup_icon(Handle, native_icon_name, size, ref icon_data, out base_size);
			GLib.Marshaller.Free (native_icon_name);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			return ret;
		}
Example #3
0
 void MyPrint(Gnome.PrintContext gpc)
 {
     gpc.BeginPage ("demo");
     gpc.MoveTo (1, 700);
     gpc.Show (tv.Buffer.Text);
     gpc.ShowPage ();
 }
		public VolumeSource (Gnome.Vfs.Volume vol)
		{
			this.Volume = vol;
			this.Name = vol.DisplayName;

			try {
				mount_point = new Uri (vol.ActivationUri).LocalPath;
			} catch (System.Exception e) {
				System.Console.WriteLine (e);
			}

			uri = mount_point;
			
                        if (this.Icon == null)
				this.Icon = PixbufUtils.LoadThemeIcon (vol.Icon, 32);
			
			if (this.IsIPodPhoto)
				this.Icon = PixbufUtils.LoadThemeIcon ("gnome-dev-ipod", 32);

			if (this.Icon == null && this.IsCamera)
				this.Icon = PixbufUtils.LoadThemeIcon ("gnome-dev-media-cf", 32);

			try {
				if (this.Icon == null)
					this.Icon = new Gdk.Pixbuf (vol.Icon);
			} catch (System.Exception e) {
				System.Console.WriteLine (e.ToString ());
			}
		}
        public PickupResourceMutation(Coordinate Location, String Resource, Gnome Gnome)
        {
            this.MutationTimeFrame = MutationTimeFrame.BeforeUpdatingConnectivity;

            this.Location = Location;
            this.Resource = Resource;
            this.Gnome = Gnome;
        }
		//FIXME: rewrite this as a Filter
	        public static Gnome.Vfs.Uri UniqueName (Gnome.Vfs.Uri path, string shortname)
	        {
	                int i = 1;
			Gnome.Vfs.Uri target = path.Clone();
	                Gnome.Vfs.Uri dest = target.AppendFileName(shortname);
	
	                while (dest.Exists) {
	                        string numbered_name = System.String.Format ("{0}-{1}{2}",
	                                                              System.IO.Path.GetFileNameWithoutExtension (shortname),
	                                                              i++,
	                                                              System.IO.Path.GetExtension (shortname));
	
	                	dest = target.AppendFileName(numbered_name);
	                }
	
	                return dest;
	        }
    // Swaps out the sprite for this part based on what kind of damage was received
    public void ApplyDamageSprite(Gnome.DamageType damageType)
    {
        Sprite spriteToUse = null;

        switch (damageType) {

        case Gnome.DamageType.Burning:
            spriteToUse = burnedSprite;

            break;

        case Gnome.DamageType.Slicing:
            spriteToUse = detachedSprite;

            break;
        }

        if (spriteToUse != null) {
            GetComponent<SpriteRenderer>().sprite = spriteToUse;
        }
    }
Example #8
0
    private void CreateNewGnome()
    {
        // Удалить текущего гномика, если имеется
        RemoveGnome();

        // Создать новый объект Gnome и назначить его текущим
        GameObject newGnome = (GameObject)Instantiate(gnomePrefab, startingPoint.transform.position, Quaternion.identity);

        currentGnome = newGnome.GetComponent <Gnome>();

        // Показать веревку
        rope.gameObject.SetActive(true);

        // Привязать конец веревки к заданному твердому телу в объекте Gnome (например, к его ноге)
        rope.connectedObject = currentGnome.ropeBoby;

        // Установить длину веревки в начальное значение
        rope.ResetLength();

        // Сообщить объекту cameraFollow, что он должен начать следить за новым объектом Gnome
        cameraFollow.target = currentGnome.cameraFollowTarget;
    }
Example #9
0
        public void TryMoveNorth(bool isBlocked)
        {
            // Arrange
            var gnomePositions = new Dictionary <IGnome, BoardPosition>();
            var board          = MockRepository.GenerateMock <IBoard>();
            var gnomeMovement  = new GnomeMovement(board, gnomePositions);
            var gnome          = new Gnome(1, 1, 1, gnomeMovement);

            gnomePositions.Add(gnome, startPosition);
            var northPosition = new BoardPosition(1, 0, isBlocked ? wallTile : corridorTile);

            board.Stub(x => x.GetPosition(1, 0)).Return(northPosition);

            // Act
            var couldMove = gnomeMovement.TryMove(gnome, Direction.North);

            // Assert
            Assert.AreEqual(isBlocked, !couldMove);
            var expectedPosition = isBlocked ? startPosition : northPosition;

            Assert.AreEqual(expectedPosition, gnomePositions[gnome]);
        }
Example #10
0
    void RemoveGnome()
    {
        if (gnomeInvincible)
        {
            return;
        }

        this.rope.gameObject.SetActive(false);
        this.cameraFolow.target = null;
        if (this.currentGnome != null)
        {
            currentGnome.holdingTreasure = false;
            currentGnome.gameObject.tag  = "Untagged";

            foreach (Transform child in this.currentGnome.transform)
            {
                child.gameObject.tag = "Untagged";
            }

            this.currentGnome = null;
        }
    }
Example #11
0
 /*
  * Author: Dr Nexus
  * Modified by: Kroy
  *
  * Choose the race and set race specific attributes, for character c.
  *
  * Parameter c Character to set.
  * Parameter race of the character.
  * Return create basic stats.
  */
 public bool OnCharacterChooseRace(Character c, Races race)
 {
     //Skill lang = null;
     if (race == Races.Dwarf)
     {
         Dwarf.Start(c);
     }
     else if (race == Races.Gnome)
     {
         Gnome.Start(c);
     }
     else if (race == Races.Human)
     {
         Human.Start(c);
     }
     else if (race == Races.NightElf)
     {
         NightElf.Start(c);
     }
     else if (race == Races.Orc)
     {
         Orc.Start(c);
     }
     else if (race == Races.Tauren)
     {
         Tauren.Start(c);
     }
     else if (race == Races.Troll)
     {
         Troll.Start(c);
     }
     else if (race == Races.Undead)
     {
         Undead.Start(c);
     }
     ChooseClass(c);          // Coose class after race.
     return(true);            // execute the caller code
 }
Example #12
0
        public IResponseFormatter Add()
        {
            var skillDefinitions = GnomanEmpire.Instance.GetSkillDefs();
            var faction = GnomanEmpire.Instance.World.AIDirector.PlayerFaction;
            var entryPosition = faction.FindRegionEntryPosition();

            var gnomadRaceClassDefs = faction.FactionDef.Squads.SelectMany(squad => squad.Classes.Where(squadClass => squadClass.Name == "Gnomad")).ToList();
            Int32 defCount = gnomadRaceClassDefs.Count;
            Int32 raceClassDefIndex = GnomanEmpire.Instance.Rand.Next(defCount);
            var raceClassDef = gnomadRaceClassDefs[raceClassDefIndex];
            var gnomad = new Character(entryPosition, raceClassDef, faction.ID);
            gnomad.SetBehavior(BehaviorType.PlayerCharacter);

            Dictionary<String, Int32> orderedProfessions = GetBestProfessions(gnomad);
            var bestProfession = orderedProfessions.OrderByDescending(obj => obj.Value).First().Key;
            SetProfession(gnomad, bestProfession);

            GnomanEmpire.Instance.EntityManager.SpawnEntityImmediate(gnomad);
            GnomanEmpire.Instance.World.NotificationManager.AddNotification(String.Format("The Gnomad {0} has arrived and been assigned as a {1}", gnomad.Name(), bestProfession));

            Gnome gnome = new Gnome(gnomad, skillDefinitions);
            return JsonResponse(gnome);
        }
Example #13
0
    public static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());

        string[] inputLines = new string[n];

        for (int i = 0; i < n; i++)
        {
            inputLines[i] = Console.ReadLine();
        }

        double minWeight    = double.Parse(Console.ReadLine());
        int    neededHeight = int.Parse(Console.ReadLine());

        try
        {
            Console.WriteLine(Gnome.GetGnome(inputLines, minWeight, neededHeight));
        }
        catch (ArgumentException e)
        {
            Console.WriteLine(e.Message);
        }
    }
Example #14
0
    void CreateNewGnome()
    {
        // 移除已经存在的矮人对象
        RemoveGnome();

        // 实例化一个新矮人,替代我们的当前矮人
        GameObject newGnome = (GameObject)Instantiate(gnomePrefab,
                                                      startingPoint.transform.position, Quaternion.identity);

        currentGnome = newGnome.GetComponent <Gnome>();

        // 使绳索可见
        rope.gameObject.SetActive(true);

        // 连接绳索末端和当前矮人的脚踝
        rope.connectedObject = currentGnome.ropeBody;

        // 重设绳索长度为默认值
        rope.ResetLength();

        // 相机开始跟随新生成的目标对象
        cameraFollow.target = currentGnome.cameraFollowTarget;
    }
    public void SpawnGnome()
    {
        if (pawn != null)
        {
            return;
        }           // we have a gnome already!

        Vector3 SpawnLocation = Vector3.zero;

        SpawnLocation.z = Random.Range(-4, 15);
        SpawnLocation.x = (Dragon.instance.gameObject.transform.position.x - BurnLogic.instance.Spawnoffset);
        GameObject newG = Instantiate(BurnLogic.instance.GnomePrefab, SpawnLocation, Quaternion.identity);
        Gnome      g    = newG.GetComponent <Gnome>();

        pawn     = g;
        g.Master = this;

        // Send Message to Device ID show Alive DIV
        AirConsole.instance.Message(deviceID, "Playing");

        DamageDelt_CurrentLife = 0;
        ArrowShot_CurrentLife  = 0;
    }
Example #16
0
    void CreateNewGnome()
    {
        // Remove the current gnome, if there is one
        RemoveGnome();
        // Create a new Gnome object, and make it be our
        // currentGnome
        GameObject newGnome =
            (GameObject)Instantiate(gnomePrefab,
                                    startingPoint.transform.position,
                                    Quaternion.identity);

        currentGnome = newGnome.GetComponent <Gnome>();
        // Make the rope visible
        rope.gameObject.SetActive(true);
        // Connect the rope's trailing end to whichever
        // rigidbody the Gnome object wants (e.g., his foot)
        rope.connectedObject = currentGnome.ropeBody;
        // Reset the rope's length to the default
        rope.ResetLength();
        // Tell the cameraFollow to start tracking the new
        // Gnome object
        cameraFollow.target = currentGnome.cameraFollowTarget;
    }
Example #17
0
    // END 2d_gamemanager_createnewgnome

    // BEGIN 2d_gamemanager_removegnome
    void RemoveGnome()
    {
        // Don't actually do anything if the gnome is invincible
        if (gnomeInvincible)
        {
            return;
        }

        // Hide the rope
        rope.gameObject.SetActive(false);

        // Stop tracking the gnome
        cameraFollow.target = null;

        // If we have a current gnome, make that no longer be the player
        if (currentGnome != null)
        {
            // This gnome is no longer holding the treasure
            currentGnome.holdingTreasure = false;

            // Mark this object as not the player (so that
            // colliders won't report when the object
            // hits them)
            currentGnome.gameObject.tag = "Untagged";

            // Find everything that's currently tagged "Player",
            // and remove that tag
            foreach (Transform child in currentGnome.transform)
            {
                child.gameObject.tag = "Untagged";
            }

            // Mark ourselves as not currently having a gnome
            currentGnome = null;
        }
    }
Example #18
0
    void CreateNewGnome()
    {
        //Удаление старого гнома
        RemoveGnome();

        //Создание нового
        GameObject newGnome =
            Instantiate(gnomePrefab, startingPoint.transform.position, Quaternion.identity);

        //Добавление его в текущего
        currentGnome = newGnome.GetComponent <Gnome>();

        //Отображение веревки
        rope.gameObject.SetActive(true);

        //привязка веревки к гному
        rope.connectedObject = currentGnome.ropeBody;

        //Установка веревки в нуль
        rope.ResetLength();

        //Сообщение камеры, что надо следить за новым гномом
        cameraFollow.target = currentGnome.cameraFollowTarget;
    }
Example #19
0
    private void ShowTrainingStep(int step)
    {
        switch (step)
        {
        case 0:
            if (IsTrainingFinished())
            {
                gameObject.SetActive(false);
                return;
            }
            _benches = GameObject.Find("benches");
            _benches.SetActive(false);
            _isBonusDropEnabled = false;
            _doorsTimer.SetActive(false);
            _ticketsCounter.SetActive(false);
            _haresCounter.SetActive(false);
            _killedCounter.SetActive(false);
            _lifes.SetActive(false);
            _bonusSelectWindow.SetActive(false);
            _isPassengerClickAllowed = false;
            _centralWayout.SetActive(false);
            _centralWayoutSprite.SetActive(false);
            _bonusesUI.SetActive(false);
            _megabonusUI.SetActive(false);
            _bonusButton.SetVisible(false);
            Time.timeScale = 0;
            _doorsTimerController.SetMoveAndStopDuration(3, 1);
            _doorsTimerController.SetMovementLocked(true);
            _fullConductorWindow.DisplayText(StringResources.GetLocalizedString("Training1"), false);
            break;

        case 1:
            _fullConductorWindow.DisplayTextWithImage(StringResources.GetLocalizedString("Training2"), Resources.Load <Sprite>("Sprites/training/training1"), false);
            break;

        case 2:
            _fullConductorWindow.DisplayText(StringResources.GetLocalizedString("Training3"), true);
            break;

        case 3:
            Time.timeScale = 1;
            SpawnPassengerFromRandomDoor("gnome", Spawner.TicketAdditionMode.WithTicket);
            StartCoroutine(WaitAndMoveNext(2));
            break;

        case 4:
            Time.timeScale = 0;
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training4"), true);
            GameObject gnomeObject = GameObject.Find("gnome(Clone)");
            _gnomePassenger = gnomeObject.GetComponent <Gnome>();
            _gnomePassenger.SetAttackEnabled(false);
            _gnomePassenger.SetFlyAwayDenied(true);
            _gnomePassenger.SetDragDenied(true);
            DisplayArrowForPassenger(_gnomePassenger);
            _isPassengerClickAllowed = true;
            break;

        case 5:
            Time.timeScale = 1;
            _ticketsCounter.SetActive(true);
            break;

        case 6:
            Time.timeScale = 0;
            Destroy(_activeArrow);
            _doorsTimer.SetActive(true);
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training5"), true);
            break;

        case 7:
            Time.timeScale = 1;
            _doorsTimerController.SetMovementLocked(false);
            StartCoroutine(WaitAndMoveNext(2));
            break;

        case 8:
            SpawnPassengerFromRandomDoor("bird", Spawner.TicketAdditionMode.WithoutTicket);
            GameObject bird = GameObject.Find("bird(Clone)");
            _birdPassenger = bird.GetComponent <Bird>();
            _birdPassenger.SetFlyAwayDenied(true);
            _birdPassenger.SetAttackEnabled(false);
            _birdPassenger.SetRunawayDenied(true);
            DisplayArrowForPassenger(_birdPassenger);
            _doorsTimerController.SetMovementLocked(true);
            break;

        case 9:
            Time.timeScale = 0;
            Destroy(_activeArrow);
            _doorsTimer.SetActive(true);
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training6"), true);
            break;

        case 10:
            _centralWayout.SetActive(true);
            _centralWayoutSprite.SetActive(true);
            DisplayArrow(_centralWayout);
            Time.timeScale = 1;
            _floor.AddDragCenterListner(_birdPassenger.name);
            break;

        case 11:
            Time.timeScale = 0;
            Destroy(_activeArrow);
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training7"), true);
            break;

        case 12:
            Time.timeScale = 1;
            _birdPassenger.SetRunawayDenied(false);
            _birdPassenger.SetFlyAwayDenied(false);
            _birdPassenger.ActivateFlyAwayListener();
            _haresCounter.SetActive(true);
            break;

        case 13:
            Time.timeScale = 0;
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training8"), true);
            break;

        case 14:
            _doorsTimerController.SetMoveAndStopDuration(3, 5);
            Time.timeScale = 1;
            _doorsTimerController.SetMovementLocked(false);
            _goAwayDoorIndex = Randomizer.GetInRange(0, _doors.Length);
            _gnomePassenger.SetAlwaysStickForTraining();
            _gnomePassenger.StartGoAway();
            StartCoroutine(WaitAndMoveNext(2.9f));
            break;

        case 15:
            _doors[(_goAwayDoorIndex)].Open(false);
            break;

        case 16:
            Time.timeScale = 0;
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training9"), true);
            break;

        case 17:
            Time.timeScale = 1;
            break;

        case 18:
            Time.timeScale = 0;
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString(_isGnomeSurvived ? "Training10" : "Training11"), true);
            break;

        case 19:
            Time.timeScale = 1;
            _doors[(_goAwayDoorIndex)].Close();
            _doorsTimerController.Unstick();
            StartCoroutine(WaitAndMoveNext(_doorsTimerController.GetCurrentRemainingTime() + 3));
            break;

        case 20:
            _goAwayDoorIndex = Randomizer.GetInRange(0, _doors.Length);
            _doorsTimerController.OpenDoors();

            int index = Randomizer.GetInRange(0, _doors.Length);
            _doors[index].OpenAndSpawnByName("granny", Spawner.TicketAdditionMode.WithTicket);
            index = Randomizer.GetInRange(0, _doors.Length);
            _doors[index].OpenAndSpawnByName("cat", Spawner.TicketAdditionMode.WithoutTicket);
            StartCoroutine(WaitAndMoveNext(0.1f));
            break;

        case 21:
            _doorsTimerController.SetMovementLocked(true);
            GameObject grannyObject = GameObject.Find("granny(Clone)");
            _grannyPassenger = grannyObject.GetComponent <Granny>();
            GameObject catObject = GameObject.Find("cat(Clone)");

            _catPassenger = catObject.GetComponent <Cat>();
            _catPassenger.SetMaximumAttackProbabilityForTraining();
            _grannyPassenger.SetMaximumAttackProbabilityForTraining();
            _grannyPassenger.SetConductorAttackDenied(true);
            _catPassenger.SetConductorAttackDenied(true);
            _catPassenger.SetFlyAwayDenied(true);
            _grannyPassenger.SetFlyAwayDenied(true);
            _catPassenger.SetHalfImmortal(true);
            _grannyPassenger.SetHalfImmortal(true);
            _hero = GameObject.Find("hero").GetComponent <ConductorSM>();
            _hero.SetHalfImmortal(true);
            break;

        case 22:
            _grannyPassenger.DisableAttackListener();
            _catPassenger.DisableAttackListener();
            if (_attackedPassenger != null)
            {
                DisplayArrowForPassenger((PassengerSM)_attackedPassenger);
            }
            break;

        case 23:
            Time.timeScale = 0;
            Destroy(_activeArrow);
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training12"), false);
            break;

        case 24:
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training13"), false);
            break;

        case 25:
            _grannyPassenger.SetDragListenerEnabled(true);
            _catPassenger.SetDragListenerEnabled(true);
            _killedCounter.SetActive(true);
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training14"), true);
            break;

        case 26:
            Time.timeScale             = 1;
            _catPassenger.AttackTarget = _grannyPassenger;
            break;

        case 27:
            _grannyPassenger.SetDragListenerEnabled(false);
            _grannyPassenger.SetCounterAttackProbability(0);
            _catPassenger.SetDragListenerEnabled(false);
            _catPassenger.SetConductorAttackDenied(false);
            _catPassenger.SetPassengerAttackDenied(true);
            _hero.SetAttackListenerActivated();
            _catPassenger.AttackTarget = _hero;
            break;

        case 28:
            StartCoroutine(WaitAndMoveNext(1));
            break;

        case 29:
            Time.timeScale = 0;
            _lifes.SetActive(true);
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training15"), true);
            _catPassenger.SetFlyAwayDenied(false);
            _isBonusDropEnabled = true;
            _catPassenger.IncreaseBonusProbability();
            break;

        case 30:
            DisplayArrowForPassenger(_catPassenger);
            Time.timeScale = 1;
            break;

        case 31:
            Destroy(_activeArrow);
            _bonusTimer.ActivateDropListener();
            break;

        case 32:
            StartCoroutine(WaitAndMoveNext(1));
            break;

        case 33:
            Time.timeScale = 0;
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training16"), true);
            break;

        case 34:
            Time.timeScale = 1;
            _bonusTimer.ActivateDropListener();
            break;

        case 35:
            Time.timeScale = 0;
            _bonusesUI.SetActive(true);
            _megabonusUI.SetActive(true);
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training17"), false);
            break;

        case 36:
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training18"), true);
            break;

        case 37:
            Time.timeScale = 1;
            _doorsTimerController.SetMoveAndStopDuration(3, 7);
            _doorsTimerController.OpenDoors();
            _doorsTimerController.SetMovementLocked(false);
            _grannyPassenger.SetStickProbability(0);
            _grannyPassenger.StartGoAway();
            _grannyPassenger.IncreaseGoAwayVelocity();
            _grannyPassenger.SetDragDenied(true);
            _goAwayDoorIndex = Randomizer.GetInRange(0, _doors.Length);
            _doors[(_goAwayDoorIndex)].Open(false);
            _grannyPassenger.IncrementStationCount();
            StartCoroutine(WaitAndMoveNext(_doorsTimerController.GetCurrentRemainingTime() + 3));
            break;

        case 38:
            _doorsTimerController.OpenDoors();
            SpawnPassengerFromRandomDoor("alien", Spawner.TicketAdditionMode.WithTicket);
            SpawnPassengerFromRandomDoor("alien", Spawner.TicketAdditionMode.WithTicket);
            StartCoroutine(WaitAndMoveNext(1));
            break;

        case 39:
            _doorsTimerController.SetMovementLocked(true);
            Time.timeScale = 0;
            _benches.SetActive(true);
            DisplayArrow(_benches);
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training19"), true);
            break;

        case 40:
            Destroy(_activeArrow);
            Time.timeScale = 1;
            _benchArray    = FindObjectsOfType <Bench>();
            foreach (var bench in _benchArray)
            {
                bench.SetCheckState(false);
            }
            _aliens = FindObjectsOfType <Alien>();
            foreach (var alien in _aliens)
            {
                alien.SetFlyAwayDenied(true);
                alien.SetSitListenerActivated(true);
            }
            break;

        case 41:
            foreach (var alien in _aliens)
            {
                alien.SetSitListenerActivated(false);
            }
            _hero.SetHalfImmortal(false);
            Time.timeScale = 0;
            _shortConductorWindow.DisplayText(StringResources.GetLocalizedString("Training20"), true);
            foreach (var bench in _benchArray)
            {
                bench.SetCheckState(true);
            }
            break;

        case 42:
            Time.timeScale = 1;
            _doorsTimerController.SetStationCountListener(3);
            _doorsTimerController.SetMovementLocked(false);
            _doorsTimerController.DisableTrainingMode();
            break;

        case 43:
            PassengerSM[] passengers = FindObjectsOfType <PassengerSM>();
            foreach (var passengerSm in passengers)
            {
                passengerSm.StartGoAway();
                passengerSm.IncreaseGoAwayVelocity();
            }
            _doorsTimerController.DisableSpawn();
            _doorsTimerController.SetStationCountListener(2);
            break;

        case 44:
            _shortConductorWindow.ForceHide();
            Time.timeScale = 0;
            _fullConductorWindow.DisplayTextWithImage(StringResources.GetLocalizedString("Training21"), Resources.Load <Sprite>("Sprites/training/training2"), false, true);
            break;

        case 45:
            PlayerPrefs.SetString(TrainingKey, TrainingKey);
            SceneManager.LoadSceneAsync("MainMenu");
            break;
        }
        _isRefreshInProgress = false;
    }
Example #20
0
 public virtual void CrownIsStolen(Gnome gnome)
 {
 }
Example #21
0
 public static void MoveURIs(Gnome.Vfs.Uri[] sources, Gnome.Vfs.Uri[] targets)
 {
     XferURIs (sources, targets, true);
 }
Example #22
0
 public override void Interact(Gnome gnome = null)
 {
     base.Interact(gnome);
     StartCoroutine(Stealing(gnome));
 }
Example #23
0
 /** DESTRUCTIVE, ASYNC */
 public static void XferURIs(Gnome.Vfs.Uri[] sources, Gnome.Vfs.Uri[] targets, bool removeSources)
 {
     XferURIs(sources, targets, removeSources, ConsoleXferProgressCallback);
 }
Example #24
0
 /** BLOCKING */
 public static int ConsoleXferProgressCallback(Gnome.Vfs.XferProgressInfo info)
 {
     switch (info.Status) {
       case Gnome.Vfs.XferProgressStatus.Vfserror:
     LogError("{0}: {1} in {2} -> {3}", info.Status, info.VfsStatus, info.SourceName, info.TargetName);
     return (int)Gnome.Vfs.XferErrorAction.Abort;
       case Gnome.Vfs.XferProgressStatus.Overwrite:
     LogError("{0}: {1} in {2} -> {3}", info.Status, info.VfsStatus, info.SourceName, info.TargetName);
     return (int)Gnome.Vfs.XferOverwriteAction.Abort;
       default:
     //         LogError("{0} / {1} {2} -> {3}", info.BytesCopied, info.BytesTotal, info.SourceName, info.TargetName);
     return 1;
     }
 }
		private void HandleMsg (Gnome.Vfs.ModuleCallback cb)
		{
			Gnome.Vfs.ModuleCallbackStatusMessage msg = cb as Gnome.Vfs.ModuleCallbackStatusMessage;
			System.Console.WriteLine ("{0}", msg.Message);
		}
Example #26
0
        public void Init()
        {
            Gnome gnome = new Gnome();

            Gnome = gnome;
        }
 private void OnImportKeyPagePrepared(object o, Gnome.PreparedArgs args)
 {
     this.importDomain.Text = this.selectedDomainName+"-"+this.selectedDomainIP;
     ImportUpdateSensitivity();
     KeyRecoveryDruid.SetButtonsSensitive(true,false , true, true);
 }
Example #28
0
    private static void OnSaveYourselfEvent(object o, Gnome.SaveYourselfArgs args)
    {
        string [] argv = { "monopod" };

        session_client.SetRestartCommand (1, argv);
    }
Example #29
0
 public override void CrownIsStolen(Gnome gnome)
 {
     StartCoroutine(CrownStolenCutscene(gnome));
 }
Example #30
0
 public override void Interact(Gnome gnome = null)
 {
     base.Interact(gnome);
     Wear(gnome);
 }
Example #31
0
 private void GrabeGnome(Gnome gnome)
 {
     GrabbedGnome = gnome.ExtractGnomeData();
     gnome.SilentRemove();
 }
 public virtual void Interact(Gnome gnome = null)
 {
     HideUI(false);
     popupIsActive = false;
 }
		void Item_Event (object obj, Gnome.CanvasEventArgs args) {
			EventButton ev = new EventButton (args.Event.Handle);
			CanvasRE item = (CanvasRE) obj;

			switch (ev.Type) {
			case EventType.ButtonPress:
				if (ev.Button == 1) {
					remember_x = ev.X;
					remember_y = ev.Y;
					args.RetVal = true;
					return;
				} else if (ev.Button == 3) {
					item.Destroy ();
					args.RetVal = true;
					return;
				}
				break;
			case EventType.TwoButtonPress:
				ChangeItemColor (item);
				args.RetVal = true;
				return;
			case EventType.MotionNotify:
				Gdk.ModifierType state = (Gdk.ModifierType) ev.State;
				if ((state & Gdk.ModifierType.Button1Mask) != 0) {
					double new_x = ev.X, new_y = ev.Y;
					item.Move (new_x - remember_x, new_y - remember_y);
					remember_x = new_x;
					remember_y = new_y;
					args.RetVal = true;
					return;
				}
				break;
			case EventType.EnterNotify:
				item.WidthUnits = 3.0;
				args.RetVal = true;
				return;
			case EventType.LeaveNotify:
				item.WidthUnits = 1.0;
				args.RetVal = true;
				return;
			}

			args.RetVal = false;
			return;
		}
Example #34
0
 public void Unfocus(Gnome gnome)
 {
     MultipleTargetsAverageFollow.instance.focusArea = null;
     gnomesInField.Remove(gnome);
 }
Example #35
0
 public void TakeOff(Gnome gnome, bool _popupIsActive = false)
 {
     transform.parent = null;
     gnome.TrenchCoat = null;
     popupIsActive    = _popupIsActive;
 }
Example #36
0
        public PreferencesDialog(Gnome.Program program)
        {
            ui = new Glade.XML (null, "lat.glade", "preferencesDialog", null);
            ui.Autoconnect (this);

            this.program = program;

            profileStore = new ListStore (typeof (string));
            profilesTreeView.Model = profileStore;
            profileStore.SetSortColumnId (0, SortType.Ascending);

            TreeViewColumn col;
            col = profilesTreeView.AppendColumn ("Name", new CellRendererText (), "text", 0);
            col.SortColumnId = 0;

            UpdateProfileList ();

            LoadPreference (Preferences.BROWSER_SELECTION);

            preferencesDialog.Icon = Global.latIcon;
            preferencesDialog.Resize (300, 400);
            preferencesDialog.Run ();

            if (gettingHelp) {
                preferencesDialog.Run ();
                gettingHelp = false;
            }

            preferencesDialog.Destroy ();
        }
Example #37
0
 private void OnConnectPagePrepared(object o, Gnome.PreparedArgs args)
 {
     this.Title = Util.GS("iFolder Account Assistant - (3 of 3)");
        ServerNameVerifyLabel.Text = ServerNameEntry.Text;
        UserNameVerifyLabel.Text = UserNameEntry.Text;
        RememberPasswordVerifyLabel.Text =
     RememberPasswordCheckButton.Active ?
      Util.GS("Yes") :
      Util.GS("No");
        MakeDefaultVerifyLabel.Text =
     DefaultServerCheckButton.Active ?
      Util.GS("Yes") :
      Util.GS("No");
        DomainInformation[] domains = domainController.GetDomains();
        if (domains != null && domains.Length > 0)
        {
     MakeDefaultPromptLabel.Visible = true;
     MakeDefaultVerifyLabel.Visible = true;
        }
        else
        {
     MakeDefaultPromptLabel.Visible = false;
     MakeDefaultVerifyLabel.Visible = false;
        }
        ForwardButton.Label = Util.GS("Co_nnect");
 }
Example #38
0
  public static void XferURIs(Gnome.Vfs.Uri[] sources, Gnome.Vfs.Uri[] targets, bool removeSources,
 Gnome.Vfs.XferProgressCallback callback)
  {
      Gnome.Vfs.Vfs.Initialize ();
      Gnome.Vfs.XferOptions mode = Gnome.Vfs.XferOptions.Recursive;
      if (removeSources) mode = mode | Gnome.Vfs.XferOptions.Removesource;
      Gnome.Vfs.Xfer.XferUriList (
        sources, targets, mode,
        Gnome.Vfs.XferErrorMode.Query,
        Gnome.Vfs.XferOverwriteMode.Replace,
        callback
      );
  }
Example #39
0
 private void OnFinishClicked(object o, Gnome.FinishClickedArgs args)
 {
     CloseDialog();
        Util.ShowiFolderWindow();
 }
Example #40
0
 public static void CopyURIs(Gnome.Vfs.Uri[] sources, Gnome.Vfs.Uri[] targets)
 {
     XferURIs (sources, targets, false);
 }
Example #41
0
 private void OnIntroductoryPagePrepared(object o, Gnome.PreparedArgs args)
 {
     this.Title = Util.GS("iFolder Account Assistant");
        AccountDruid.SetButtonsSensitive(false, true, true, true);
 }
        public static void NewRace(Character character)
        {
            switch (character.ChosenRace)
            {
            case "Aasimar(Protector)":
                Aasimar.Protector(character);
                break;

            case "Aasimar(Scourge)":
                Aasimar.Scourge(character);
                break;

            case "Aasimar(Fallen)":
                Aasimar.Fallen(character);
                break;

            case "Cambion":
                Cambion.Base(character);
                break;

            case "Changeling":
                Changeling.Base(character);
                break;

            case "Dhampir":
                Dhampir.Base(character);
                break;

            case "Dragonborn":
                Dragonborn.Base(character);
                break;

            case "Hill Dwarf":
                Dwarf.Hill(character);
                break;

            case "Mountain Dwarf":
                Dwarf.Mountain(character);
                break;

            case "Avariel":
                Elf.Avariel(character);
                break;

            case "Drow":
                Elf.Drow(character);
                break;

            case "Eladrin":
                Elf.Eladrin(character);
                break;

            case "Moon Elf":
                Elf.Moon(character);
                break;

            case "Sea Elf":
                Elf.Sea(character);
                break;

            case "Shadar-Kai":
                Elf.ShadarKai(character);
                break;

            case "High Elf":
                Elf.High(character);
                break;

            case "Wild Elf":
                Elf.Wild(character);
                break;

            case "Wood Elf":
                Elf.Wood(character);
                break;

            case "Forest Gnome":
                Gnome.Forest(character);
                break;

            case "Rock Gnome":
                Gnome.Rock(character);
                break;

            case "Goliath":
                Goliath.Base(character);
                break;

            case "Half-Elf":
                HalfElf.Base(character);
                break;

            case "Half-Orc":
                HalfOrc.Base(character);
                break;

            case "Lightfoot Halfling":
                Halfling.Lightfoot(character);
                break;

            case "Stout Halfling":
                Halfling.Stout(character);
                break;

            case "Human":
                Human.Base(character);
                break;

            case "Variant Human":
                Human.Variant(character);
                break;

            case "Minotaur":
                Minotaur.Base(character);
                break;

            case "Shade":
                Shade.Base(character);
                break;

            case "Tiefling":
                Tiefling.Base(character);
                break;

            case "Feral Tiefling":
                Tiefling.Feral(character);
                break;

            case "Demigod":
                Demigod.Base(character);
                break;
            }
        }
Example #43
0
 private void OnServerInformationPagePrepared(object o, Gnome.PreparedArgs args)
 {
     this.Title = Util.GS("iFolder Account Assistant - (1 of 3)");
        UpdateServerInformationPageSensitivity(null, null);
        DomainInformation[] domains = domainController.GetDomains();
        if (domains != null && domains.Length > 0)
        {
     MakeDefaultLabel.Visible = true;
     DefaultServerCheckButton.Visible = true;
        }
        else
        {
     DefaultServerCheckButton.Active = true;
     MakeDefaultLabel.Visible = false;
     DefaultServerCheckButton.Visible = false;
        }
        ServerNameEntry.GrabFocus();
 }
		public DriveSource (Gnome.Vfs.Drive drive) 
		{
			this.Name = drive.DisplayName;
			this.Drive = drive;

			if (drive.IsMounted) {
				this.Icon = PixbufUtils.LoadThemeIcon (drive.MountedVolume.Icon, 32);
				//this.Sensitive = drive.MountedVolume.IsMounted;
			} else {
				this.Icon = PixbufUtils.LoadThemeIcon (drive.Icon, 32);
			}
		}
Example #45
0
 private void OnSummaryPagePrepared(object o, Gnome.PreparedArgs args)
 {
     this.Title = Util.GS("iFolder Account Assistant");
        if (ConnectedDomain != null && ConnectedDomain.Name != null && ConnectedDomain.Host != null)
        {
     SummaryPage.Text =
      string.Format(
       "Congratulations!  You are now connected to:\n\n{0}\n({1})\n\nYou can now add folders to be synchronized to the server.  You may also download folders from the server and have them be synchronized to your computer.\n\nClick \"Finish\" to close this window.",
       ConnectedDomain.Name,
       ConnectedDomain.Host);
        }
        FinishButton.Label = Util.GS("_Finish");
        AccountDruid.SetButtonsSensitive(false, true, false, true);
 }
        static void Main(string[] args)
        {
            /////////////
            // DiceLib //
            /////////////
            Console.WriteLine("-------------------------------\n\tTesting DiceLib\n-------------------------------");

            Console.WriteLine("==========\n50 / 50\n==========");

            List <bool> all_fifty_fifty_rolls = new List <bool>();

            DiceLib.Dice die = new DiceLib.Dice();

            for (int i = 0; i < 10; i++)
            {
                int temp = die.Roll();
                Console.WriteLine("50 / 50 result: {0}", temp);
                all_fifty_fifty_rolls.Add(temp == 0 ? true : false);
            }

            Console.WriteLine("\n==========\nd4 Rolls\n==========");

            List <int> all_d4_rolls = new List <int>();

            DiceLib.Dice die4 = new DiceLib.Dice(4);

            for (int i = 0; i < 10; i++)
            {
                int temp = die4.Roll();
                Console.WriteLine("d4 result: {0}", temp);
                all_d4_rolls.Add(temp);
            }

            Console.WriteLine("\n==========\nd12 Rolls\n==========");

            List <int> all_d12_rolls = new List <int>();

            DiceLib.Dice die12 = new DiceLib.Dice(12);

            for (int i = 0; i < 10; i++)
            {
                int temp = die12.Roll();
                Console.WriteLine("d12 result: {0}", temp);
                all_d12_rolls.Add(temp);
            }

            Console.WriteLine("\n==========\nd100 Rolls\n==========");

            List <int> all_d100_rolls = new List <int>();

            DiceLib.Dice die100 = new DiceLib.Dice(100);

            for (int i = 0; i < 10; i++)
            {
                int temp = die100.Roll();
                Console.WriteLine("d100 result: {0}", temp);
                all_d100_rolls.Add(temp);
            }

            Console.WriteLine("\n==========\nPulling From Rolls\n==========");
            Console.WriteLine("And a result for the 50 / 50: {0}\n" +
                              "And a result for the d4: {1}\n" +
                              "And a result for d12: {2}\n" +
                              "And a result for d100: {3}",
                              all_fifty_fifty_rolls[1],
                              all_d4_rolls[1],
                              all_d12_rolls[1],
                              all_d100_rolls[1]);

            Console.WriteLine("\n==========\nRoll Average\n==========");
            Console.WriteLine("=== d8 x10 ===");

            DiceLib.Dice avg            = new DiceLib.Dice(8);
            double       return_average = avg.RollAverage(avg, 10);

            Console.WriteLine("{0} returned from class method.", return_average);
            Console.WriteLine("{0} returned value rounded.", Math.Round(return_average));

            Console.WriteLine("\n=== d20 x100 ===");

            DiceLib.Dice avg2 = new DiceLib.Dice(20);

            double return_average2 = avg.RollAverage(avg2, 100);

            Console.WriteLine("{0} returned from class method.", return_average2);
            Console.WriteLine("{0} returned value rounded.", Math.Round(return_average2));

            Console.WriteLine("\n==========\nStandard Points\n==========");

            DiceLib.Dice standard       = new DiceLib.Dice();
            List <int>   standard_stats = standard.StandardStatPoints();

            foreach (int i in standard_stats)
            {
                Console.WriteLine(i);
            }

            Console.WriteLine("Here is how you can find and use items in the middle of a list");
            Console.WriteLine("13 is in position: {0}", standard_stats.IndexOf(13));

            Console.WriteLine("Here is how you can find and use items in the beginning of a list");
            Console.WriteLine("15 is in position: {0}", standard_stats.IndexOf(15));


            Console.WriteLine("Here is how you can find and use items in the end of a list");
            Console.WriteLine("8 is in position: {0}", standard_stats.IndexOf(8));

            Console.WriteLine("\n==========\nRoll Four d6 and Take Top Three\n==========");

            DiceLib.Dice fd6            = new DiceLib.Dice(6);
            int          stat_score_fd6 = fd6.RollFourD6TakeTopThree(fd6);

            Console.WriteLine("Top three of four added: {0}", stat_score_fd6);

            Console.WriteLine("\nPress [ENTER] to continue or [CRTL] + [C] to stop.");
            Console.Read();
            // Console.Clear();

            //////////////////
            // CharacterLib //
            //////////////////

            Console.WriteLine("------------------------------------\n\tTesting CharacterLib\n------------------------------------");
            Console.WriteLine("Creating a character and printing out the base stats:");

            Character        character = new Character();
            List <Character> stat_list = new List <Character>();

            stat_list.Add(character);

            Console.WriteLine("STRENGTH stat is: {0}", stat_list[0].strength);
            Console.WriteLine("DEXTERITY stat is: {0}", stat_list[0].dexterity);
            Console.WriteLine("CONSTITUTION stat is: {0}", stat_list[0].constitution);
            Console.WriteLine("INTELLIGENCE stat is: {0}", stat_list[0].intelligence);
            Console.WriteLine("WISDOM stat is: {0}", stat_list[0].wisdom);
            Console.WriteLine("CHARISMA stat is: {0}", stat_list[0].charisma);

            Console.WriteLine("\nWhat happens if I do this? {0}", stat_list[0]);
            Console.WriteLine("What happens if I do THIS?! {0}", stat_list);

            Console.WriteLine("\nPress [ENTER] to continue!");
            Console.Read();

            Console.WriteLine("==========\nAssigning Strength 50\n==========");

            character.strength = 50;

            Console.WriteLine("Strength is: {0}", character.strength);

            Console.WriteLine("\n==========\nAssigning Intelligence 500\n==========");

            character.intelligence = 500;

            Console.WriteLine("Intelligence is: {0}", character.intelligence);

            Console.WriteLine("\n==========\nWisdom should still be unassigned\n==========");
            Console.WriteLine("Wisdom is: {0}", character.wisdom);

            Console.WriteLine("\nPress [ENTER] to continue or [CTRL] + [C] to stop.");
            Console.Read();
            // Console.Clear();

            //////////////////////////////////////////
            // Bringing Character and Dice together //
            //////////////////////////////////////////

            Console.WriteLine("----------------------------------------------------------\n\tBringing ChacacterLib and DiceLib together\n----------------------------------------------------------");

            DiceLib.Dice d6         = new DiceLib.Dice(6);
            List <int>   stat_score = new List <int>();

            Console.WriteLine("\nRolling for the stats...");

            for (int i = 0; i < 6; i++)
            {
                stat_score.Add(d6.RollFourD6TakeTopThree(d6));
            }

            stat_score.Sort();

            Console.WriteLine("Rolled stats are:");

            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine(stat_score[i]);
            }

            Console.WriteLine("\nPress [ENTER] to continue or [CTRL] + [C] to stop.");
            Console.Read();
            // Console.Clear();

            ///////////////////////////////////////////////
            // Selecting and adding the roll to the stat //
            ///////////////////////////////////////////////
            Console.WriteLine("Lets put the rolled stats to the character:\n");

            // TODO: probably can be moved somewhere else
            Dictionary <string, string> stat_menu = new Dictionary <string, string> {
                { "str", "Strength" },
                { "dex", "Dexterity" },
                { "con", "Constitution" },
                { "int", "Intelligence" },
                { "wis", "Wisdom" },
                { "cha", "Charisma" },
            };

            while (stat_score.Count > 0)
            {
                Console.WriteLine("Id  - Stat Score");
                Console.WriteLine("-----------------");

                foreach (int s in stat_score)
                {
                    Console.WriteLine("[{0}] - {1}", stat_score.IndexOf(s), s);
                }

                Console.Write("\nSelection: ");
                string stat_selection = Console.ReadLine();
                int    stat_number;
                Int32.TryParse(stat_selection, out stat_number);

                // validation
                // TODO: probably can be broken off into its' own thing
                if (stat_number > stat_score.Count - 1)
                {
                    // Console.Clear();
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\n\nWRONG! PLEASE SELECT A VALID CHOICE!\n\n");
                    Console.ResetColor();
                    continue;
                }

                Console.Write("\nYour selection was {0}: ", stat_number);
                Console.ForegroundColor = ConsoleColor.Magenta;
                Console.WriteLine("{0}\n", stat_score[stat_number]);
                Console.ResetColor();

                Console.Write("Which stat do you want to put ");
                Console.ForegroundColor = ConsoleColor.Magenta;
                Console.Write("{0}", stat_score[stat_number]);
                Console.ResetColor();
                Console.WriteLine(" to?\n");
                Console.WriteLine("Stat  - Description");
                Console.WriteLine("---------------------");

                foreach (KeyValuePair <string, string> kvp in stat_menu)
                {
                    Console.WriteLine("{0} - {1}", kvp.Key, kvp.Value);
                }

                Console.Write("\nSelection: ");
                string character_selection = Console.ReadLine().ToLower().Trim();

                // validation
                // TODO: probably can be borken off into its' own thing
                if (!stat_menu.ContainsKey(character_selection))
                {
                    // Console.Clear();
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\n\n{0} has either been used already or never existed.  Please try again.\n\n", character_selection);
                    Console.ResetColor();
                    continue;
                }

                switch (character_selection)
                {
                case "str":
                    character.strength = stat_score[stat_number];
                    break;

                case "dex":
                    character.dexterity = stat_score[stat_number];
                    break;

                case "con":
                    character.constitution = stat_score[stat_number];
                    break;

                case "int":
                    character.intelligence = stat_score[stat_number];
                    break;

                case "wis":
                    character.wisdom = stat_score[stat_number];
                    break;

                case "cha":
                    character.charisma = stat_score[stat_number];
                    break;
                }

                Console.WriteLine("\nCharacter's stats are now:");
                Console.WriteLine("str is: {0}", character.strength);
                Console.WriteLine("dex is: {0}", character.dexterity);
                Console.WriteLine("con is: {0}", character.constitution);
                Console.WriteLine("int is: {0}", character.intelligence);
                Console.WriteLine("wis is: {0}", character.wisdom);
                Console.WriteLine("cha is: {0}\n", character.charisma);
                // Console.WriteLine("\n\n");

                // remove the stat number from the selection
                stat_score.RemoveAt(stat_number);
                stat_menu.Remove(character_selection);
            }

            Console.WriteLine("==========\nCharacter's stats and modifiers\n==========");

            Console.WriteLine("Strength is: {0}", character.strength);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.strength));

            Console.WriteLine("Dexterity is: {0}", character.dexterity);
            Console.WriteLine("Modifier is:  {0}\n", character.AbilityModifiers(character.dexterity));

            Console.WriteLine("Constitution is: {0}", character.constitution);
            Console.WriteLine("Modifier is:     {0}\n", character.AbilityModifiers(character.constitution));

            Console.WriteLine("Intelligence is: {0}", character.intelligence);
            Console.WriteLine("Modifier is:     {0}\n", character.AbilityModifiers(character.intelligence));

            Console.WriteLine("Wisdom is:   {0}", character.wisdom);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.wisdom));

            Console.WriteLine("Charisma is: {0}", character.charisma);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.charisma));

            Console.WriteLine("\nPress [ENTER] to continue or [CTRL] + [C] to stop.");
            Console.Read();
            // Console.Clear();

            /////////////////
            // Adding Race //
            /////////////////
            Console.WriteLine("-------------------------------\n\tTesting RaceLib\n-------------------------------");

            Dictionary <string, string> race_menu = new Dictionary <string, string>
            {
                { "dwa", "Dwarf" },
                { "elf", "Elf" },
                { "hal", "Halfling" },
                { "hum", "Human" },
                { "dra", "Dragonborn" },
                { "gno", "Gnome" },
                { "hel", "Half-Elf" },
                { "hor", "Half-Orc" },
                { "tie", "Tiefling" },
            };

            bool   race_flag      = true;
            string race_selection = "";

            while (race_flag)
            {
                Console.WriteLine("\nChoose what RACE you'd like to be:");
                Console.WriteLine("\nId  - Main Race");
                Console.WriteLine("-----------------");

                foreach (KeyValuePair <string, string> kvp in race_menu)
                {
                    Console.WriteLine("[{0}] - {1}", kvp.Key, kvp.Value);
                }

                Console.Write("\nSelection: ");
                race_selection = Console.ReadLine().ToLower().Trim();

                // validation
                // TODO: probably can be broken off into its' own thing
                if (!race_menu.ContainsKey(race_selection))
                {
                    // Console.Clear();
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\n\n{0} is not a valid race.  Please try again.\n\n", race_selection);
                    Console.ResetColor();
                    continue;
                }

                race_flag = false;
            }

            Console.WriteLine("\n==========\nAdding Race Modifiers to Character\n==========");
            // TODO: These need to be cleaned up and done better
            switch (race_selection)
            {
            case "dwa":
                Dwarf dwarf = new Dwarf();
                character.strength += dwarf.RaceModifiers();
                break;

            case "elf":
                Elf elf = new Elf();
                character.dexterity += elf.RaceModifiers();
                break;

            case "hal":
                Halfling halfling = new RaceLib.Halfling();
                character.dexterity += halfling.RaceModifiers();
                break;

            case "hum":
                Human human = new Human();
                character.strength     += human.RaceModifiers();
                character.dexterity    += human.RaceModifiers();
                character.constitution += human.RaceModifiers();
                character.intelligence += human.RaceModifiers();
                character.wisdom       += human.RaceModifiers();
                character.charisma     += human.RaceModifiers();
                break;

            case "dra":
                Dragonborn dragonborn = new Dragonborn();
                character.strength += dragonborn.RaceModifiers();
                character.strength += dragonborn.RaceModifiers();
                character.charisma += dragonborn.RaceModifiers();
                break;

            case "gno":
                Gnome gnome = new Gnome();
                character.intelligence += gnome.RaceModifiers();
                break;

            case "hel":
                Half_Elf half_elf = new Half_Elf();
                character.strength += half_elf.RaceModifiers();
                character.strength += half_elf.RaceModifiers();
                character.charisma += half_elf.RaceModifiers();
                character.charisma += half_elf.RaceModifiers();
                break;

            case "hor":
                Half_Orc half_orc = new Half_Orc();
                character.constitution += half_orc.RaceModifiers();
                break;

            case "tie":
                Tiefling tiefling = new Tiefling();
                character.intelligence += tiefling.RaceModifiers();
                character.charisma     += tiefling.RaceModifiers();
                character.charisma     += tiefling.RaceModifiers();
                break;

            default:
                break;
            }

            Console.WriteLine("\nCharacter's stats are now: ");
            Console.WriteLine("- str is: {0}", character.strength);
            Console.WriteLine("- dex is: {0}", character.dexterity);
            Console.WriteLine("- con is: {0}", character.constitution);
            Console.WriteLine("- int is: {0}", character.intelligence);
            Console.WriteLine("- wis is: {0}", character.wisdom);
            Console.WriteLine("- cha is: {0}\n", character.charisma);
            // Console.WriteLine("\n\n");

            Console.WriteLine("==========\nCharacter's stats and modifiers\n==========");

            Console.WriteLine("Strength is: {0}", character.strength);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.strength));

            Console.WriteLine("Dexterity is: {0}", character.dexterity);
            Console.WriteLine("Modifier is:  {0}\n", character.AbilityModifiers(character.dexterity));

            Console.WriteLine("Constitution is: {0}", character.constitution);
            Console.WriteLine("Modifier is:     {0}\n", character.AbilityModifiers(character.constitution));

            Console.WriteLine("Intelligence is: {0}", character.intelligence);
            Console.WriteLine("Modifier is:     {0}\n", character.AbilityModifiers(character.intelligence));

            Console.WriteLine("Wisdom is:   {0}", character.wisdom);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.wisdom));

            Console.WriteLine("Charisma is: {0}", character.charisma);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.charisma));

            Console.WriteLine("\nPress [ENTER] to continue or [CTRL] + [C] to stop.");
            Console.Read();

            Console.WriteLine("==========\nAdding the SUBRACES\n==========");

            Dictionary <string[], string> subrace_menu = new Dictionary <string[], string>
            {
                { new string[] { "hil", "Hill" }, "dwa" },
                { new string[] { "mou", "Mountain", }, "dwa" },
                { new string[] { "dro", "Drow" }, "elf" },
                { new string[] { "hig", "High" }, "elf" },
                { new string[] { "woo", "Wood" }, "elf" },
                { new string[] { "lig", "Lightfoot" }, "hal" },
                { new string[] { "sto", "Stout" }, "hal" },
                { new string[] { "for", "Forest" }, "gno" },
                { new string[] { "roc", "Rock" }, "gno" },
            };

            string [] has_subrace_races = { "dwa", "elf", "hal", "gno" };
            bool      subrace_flag      = (Array.Exists(has_subrace_races, sr => sr.Equals(race_selection)) ? true : false);
            string    subrace_selection = "";

            while (subrace_flag)
            {
                Console.WriteLine("\nChoose what SUB RACE you'd like to be:");
                Console.WriteLine("\nId  - Sub Race");
                Console.WriteLine("-----------------");

                foreach (KeyValuePair <string[], string> kvp in subrace_menu)
                {
                    // only show the subraces that match a main race
                    if (kvp.Value == race_selection)
                    {
                        Console.WriteLine("[{0}] - {1} for {2}", kvp.Key[0], kvp.Key[1], race_menu[race_selection]);
                    }
                }

                Console.Write("\nSelection: ");
                subrace_selection = Console.ReadLine().ToLower().Trim();

                // validation
                // TODO: probably can be broken off into its' own thing
                // if(!subrace_menu.ContainsKey(subrace_selection))
                // {
                //     Console.Clear();
                //     Console.ForegroundColor = ConsoleColor.Red;
                //     Console.WriteLine("\n\n{0} is not a valid race.  Please try again.\n\n", subrace_selection);
                //     Console.ResetColor();
                //     continue;
                // }

                subrace_flag = false;
            }

            Console.WriteLine("\n==========\nAdding Subrace Modifiers to Character\n==========");

            switch (subrace_selection)
            {
            case "hil":
                RaceLib.HillDwarf hill_dwarf = new RaceLib.HillDwarf();
                character.wisdom += hill_dwarf.RaceModifiers();
                break;

            case "mou":
                RaceLib.MountainDwarf mountain_dwarf = new RaceLib.MountainDwarf();
                character.strength += mountain_dwarf.RaceModifiers();
                break;

            case "dro":
                RaceLib.Drow drow = new RaceLib.Drow();
                character.charisma += drow.RaceModifiers();
                break;

            case "hig":
                RaceLib.High high_elf = new RaceLib.High();
                character.intelligence += high_elf.RaceModifiers();
                break;

            case "woo":
                RaceLib.Wood wood_elf = new RaceLib.Wood();
                character.wisdom += wood_elf.RaceModifiers();
                break;

            case "lig":
                RaceLib.Lightfoot lightfoot_halfling = new RaceLib.Lightfoot();
                character.charisma += lightfoot_halfling.RaceModifiers();
                break;

            case "sto":
                RaceLib.Stout stout_halfling = new RaceLib.Stout();
                character.constitution += stout_halfling.RaceModifiers();
                break;

            case "for":
                RaceLib.Forest forest_gnome = new RaceLib.Forest();
                character.dexterity += forest_gnome.RaceModifiers();
                break;

            case "roc":
                RaceLib.Rock rock_gnome = new RaceLib.Rock();
                character.constitution += rock_gnome.RaceModifiers();
                break;

            default:
                break;
            }

            Console.WriteLine("\nCharacter's stats are now: ");
            Console.WriteLine("- str is: {0}", character.strength);
            Console.WriteLine("- dex is: {0}", character.dexterity);
            Console.WriteLine("- con is: {0}", character.constitution);
            Console.WriteLine("- int is: {0}", character.intelligence);
            Console.WriteLine("- wis is: {0}", character.wisdom);
            Console.WriteLine("- cha is: {0}\n", character.charisma);
            // Console.WriteLine("\n\n");

            Console.WriteLine("==========\nCharacter's stats and modifiers\n==========");

            Console.WriteLine("Strength is: {0}", character.strength);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.strength));

            Console.WriteLine("Dexterity is: {0}", character.dexterity);
            Console.WriteLine("Modifier is:  {0}\n", character.AbilityModifiers(character.dexterity));

            Console.WriteLine("Constitution is: {0}", character.constitution);
            Console.WriteLine("Modifier is:     {0}\n", character.AbilityModifiers(character.constitution));

            Console.WriteLine("Intelligence is: {0}", character.intelligence);
            Console.WriteLine("Modifier is:     {0}\n", character.AbilityModifiers(character.intelligence));

            Console.WriteLine("Wisdom is:   {0}", character.wisdom);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.wisdom));

            Console.WriteLine("Charisma is: {0}", character.charisma);
            Console.WriteLine("Modifier is: {0}\n", character.AbilityModifiers(character.charisma));

            Console.WriteLine("\nPress [ENTER] to continue or [CTRL] + [C] to stop.");
            Console.Read();

            Console.WriteLine("END");
        }
Example #47
0
 private void OnUserInformationPagePrepared(object o, Gnome.PreparedArgs args)
 {
     this.Title = Util.GS("iFolder Account Assistant - (2 of 3)");
        UpdateUserInformationPageSensitivity(null, null);
        UserNameEntry.GrabFocus();
        ForwardButton.Label = "gtk-go-forward";
 }
Example #48
0
        void RectEvent(object obj, Gnome.CanvasEventArgs args)
        {
            EventButton ev = new EventButton(args.Event.Handle);

            switch (ev.Type)
            {
            case EventType.ButtonPress :
                if (ev.Button == 1) {
                rememberX = ev.X;
                rememberY = ev.Y;
                dragY = Y;
                args.RetVal = true;
                return;
            }
                break;
            case EventType.MotionNotify :
                Gdk.ModifierType state = (Gdk.ModifierType)ev.State;
                if ((state & Gdk.ModifierType.Button1Mask) != 0) {
                //Console.WriteLine("old: " + rememberX + " " + rememberY + " new: " + ev.X + " " + ev.Y);
                X += ev.X - rememberX;
                dragY -= ev.Y - rememberY;
                Y = Math.Min(Math.Max(dragY, 0.0), 1.0);
                rememberX = ev.X;
                rememberY = ev.Y;
                if (Active && (X < 0.0 || X > 1.0)) {
                    Console.WriteLine("removing");
                    curveWidget.CurvePointRemoved(this);
                    Active = false;
                } else if (!Active && (X >= 0.0 && X <= 1.0)) {
                    curveWidget.CurvePointAdded(this);
                    Console.WriteLine("adding");
                    Active = true;
                } else if (Active) {
                    Console.WriteLine("updating");
                    curveWidget.CurvePointChanged(this);
                }
                args.RetVal = true;
                return;
            }
                break;
            case EventType.ButtonRelease :
                if (!Active) {
                //rect.Dispose();
            }
                break;
            }

            args.RetVal = false;
            return;
        }
Example #49
0
        /*
         * Author: Dr Nexus
         * Modified by: Kroy
         *
         * Call the level up method for the corresponding class.
         *
         * Parameter c Character to level up.
         * Parameter level Current level.
         * Parameter gainHP Hit points to gain on level up.
         * Parameter gainMana Mana to gain on level up.
         * Parameter gainStrength Strength to gain on level up.
         * Parameter gainAgility Agility to gain on level up.
         * Parameter gainStamina Stamina to gain on level up.
         * Parameter gainInt Intellect to gain on level up.
         * Parameter gainSpirit Spirit to gain on level up.
         * Return level up or default code.
         */
        bool OnLevelUp(Character c, int level, ref int gainHp, ref int gainMana,
                       ref float gainStrength, ref float gainAgility,
                       ref float gainStamina, ref float gainInt, ref float gainSpirit)
        {
            /* Class specific level up */
            switch (c.Classe)
            {
            case Classes.Druid:
                Druid.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                              ref gainAgility, ref gainStamina, ref gainInt,
                              ref gainSpirit);
                break;

            case Classes.Hunter:
                Hunter.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                               ref gainAgility, ref gainStamina, ref gainInt,
                               ref gainSpirit);
                break;

            case Classes.Mage:
                Mage.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                             ref gainAgility, ref gainStamina, ref gainInt,
                             ref gainSpirit);
                break;

            case Classes.Priest:
                Priest.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                               ref gainAgility, ref gainStamina, ref gainInt,
                               ref gainSpirit);
                break;

            case Classes.Paladin:
                Paladin.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                                ref gainAgility, ref gainStamina, ref gainInt,
                                ref gainSpirit);
                break;

            case Classes.Rogue:
                Rogue.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                              ref gainAgility, ref gainStamina, ref gainInt,
                              ref gainSpirit);
                break;

            case Classes.Shaman:
                Shaman.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                               ref gainAgility, ref gainStamina, ref gainInt,
                               ref gainSpirit);
                break;

            case Classes.Warrior:
                Warrior.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                                ref gainAgility, ref gainStamina, ref gainInt,
                                ref gainSpirit);
                break;

            case Classes.Warlock:
                Warlock.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                                ref gainAgility, ref gainStamina, ref gainInt,
                                ref gainSpirit);
                break;

            default:
                Console.WriteLine("LevelUP wrong Classe:" + c.Classe);
                break;
            }
            /* If we have racial bonus */
            switch (c.Race)
            {
            case Races.Gnome:
                Gnome.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                              ref gainAgility, ref gainStamina, ref gainInt,
                              ref gainSpirit);
                break;

            case Races.Human:
                Human.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                              ref gainAgility, ref gainStamina, ref gainInt,
                              ref gainSpirit);
                break;

            case Races.Tauren:
                Tauren.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength,
                               ref gainAgility, ref gainStamina, ref gainInt,
                               ref gainSpirit);
                break;

            default:
                break;
            }
            /* Penalty for low stat classes */
            if (((c.Iq + gainInt) <= 20) &&
                (gainInt > 0))
            {
                // Before 20 int point you not gain that much mana
                gainMana -= 14;
                if (gainMana < 0)
                {
                    gainMana = 0;
                }
            }
            if (((c.Stamina + gainStamina) <= 20) &&
                (gainStamina > 0))
            {
                // Before 20 stamina point you not gain that much hp
                gainHp -= 9;
            }
            return(true);            // execute the default code
        }
		private int Progress (Gnome.Vfs.XferProgressInfo info)
		{
			progress_dialog.ProgressText = info.Phase.ToString ();

			if (info.BytesTotal > 0) {
				progress_dialog.Fraction = info.BytesCopied / (double)info.BytesTotal;
			}
			
			switch (info.Status) {
			case Gnome.Vfs.XferProgressStatus.Vfserror:
				progress_dialog.Message = Catalog.GetString ("Error: Error while transferring; Aborting");
				return (int)Gnome.Vfs.XferErrorAction.Abort;
			case Gnome.Vfs.XferProgressStatus.Overwrite:
				progress_dialog.ProgressText = Catalog.GetString ("Error: File Already Exists; Aborting");
				return (int)Gnome.Vfs.XferOverwriteAction.Abort;
			default:
				return 1;
			}

		}
Example #51
0
 public void RestartGame()
 {
     Destroy(currentGnome.gameObject);
     currentGnome = null;
     Reset();
 }
		private void HandleAuth (Gnome.Vfs.ModuleCallback cb)
		{
			Gnome.Vfs.ModuleCallbackFullAuthentication fcb = cb as Gnome.Vfs.ModuleCallbackFullAuthentication;
			System.Console.Write ("Enter your username ({0}): ", fcb.Username);
			string username = System.Console.ReadLine ();
			System.Console.Write ("Enter your password : ");
			string passwd = System.Console.ReadLine ();
			
			if (username.Length > 0)
				fcb.Username = username;
			fcb.Password = passwd;
		}
Example #53
0
 private void OnCancelClicked(object o, Gnome.CancelClickedArgs args)
 {
     CloseDialog();
 }
			private void InfoLoaded (Gnome.Vfs.Result result, Gnome.Vfs.FileInfo []info, uint entries_read)
			{
				if (result != Gnome.Vfs.Result.Ok && result != Gnome.Vfs.Result.ErrorEof)
					return;

				ArrayList items = new ArrayList ();

				for (int i = 0; i < entries_read; i++) {
					Gnome.Vfs.Uri vfs = new Gnome.Vfs.Uri (uri.ToString ());
					vfs = vfs.AppendFileName (info [i].Name);
					Uri file = new Uri (vfs.ToString ());
					System.Console.WriteLine ("tesing uri = {0}", file.ToString ());
					
					if (FSpot.ImageFile.HasLoader (file))
						items.Add (new FileBrowsableItem (file));
				}

				Gtk.Application.Invoke (items, System.EventArgs.Empty, delegate (object sender, EventArgs args) {
					collection.Add (items.ToArray (typeof (FileBrowsableItem)) as FileBrowsableItem []);
				});
			}
    void Update()
    {
        //Check if frozen for movment and other abilities to be active
        if (!freeze)
        {
            //Do the Calculations for rotation
            rotation.x += Input.GetAxis("Mouse X") * sensitivity.x;
            rotation.y += Input.GetAxis("Mouse Y") * sensitivity.y;
            rotation.y  = Mathf.Clamp(rotation.y, rotationMin.y, rotationMax.y);

            transform.localEulerAngles        = new Vector3(0.0f, rotation.x, 0.0f);
            camera.transform.localEulerAngles = new Vector3(-rotation.y, 0.0f, 0.0f);

            //Movement Controls
            if (!hitSomethingInAir)
            {
                Vector3 targetVelocity = new Vector3(Input.GetAxis("Horizontal"), 0.0f, Input.GetAxis("Vertical"));
                targetVelocity = transform.TransformDirection(targetVelocity);
                targetVelocity = new Vector3(targetVelocity.x * speed, rigidbody.velocity.y, targetVelocity.z * speed);
                Vector3 velocityChange = targetVelocity - rigidbody.velocity;

                rigidbody.AddForce(velocityChange, ForceMode.VelocityChange);
            }
            if (Input.GetButtonDown("Crouch"))
            {
                transform.localScale -= new Vector3(0.0f, 0.25f, 0.0f);
            }
            if (Input.GetButtonUp("Crouch"))
            {
                transform.localScale += new Vector3(0.0f, 0.25f, 0.0f);
            }
            if (Input.GetButtonDown("Sprint"))
            {
                this.speed = 10f;
            }
            if (Input.GetButtonUp("Sprint"))
            {
                this.speed = 5f;
            }
            if (onGround && Input.GetButtonDown("Jump"))
            {
                rigidbody.AddForce(transform.up * jumpVelocity, ForceMode.VelocityChange);
            }


            //Item handel this stuff m8
            if (Input.GetButtonDown("Interact"))
            {
                RaycastHit hit;
                Ray        ray = gameObject.GetComponentInChildren <Camera> ().ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2));

                if (Physics.Raycast(ray, out hit))
                {
                    if (hit.transform.gameObject.tag == "Interactable")
                    {
                        Inventory.Add(hit.collider.gameObject);
                        InventoryGUI.Add(hit.collider.gameObject);

                        hit.collider.transform.position = InventoryBag.transform.position;
                        hit.collider.transform.rotation = InventoryBag.transform.rotation;
                        hit.collider.transform.parent   = InventoryBag.transform;
                    }
                }
            }

            //Weapon Interactions
            if (Input.GetButtonDown("Fire2"))
            {
                //Knock dem bitches back
                RaycastHit hit;
                Ray        ray = camera.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0.0f));

                if (Physics.Raycast(ray, out hit, knockbackDistance))
                {
                    if (hit.collider.tag == "Gnome")
                    {
                        Gnome gnome = hit.collider.gameObject.GetComponent <Gnome> ();
                        gnome.knockbackGnome(transform);
                    }
                }
            }

            if (Input.GetButtonDown("Fire1"))
            {
                RaycastHit hit;
                //ray through the middle of the screen, i.e. where the player is looking
                Ray ray = gameObject.GetComponentInChildren <Camera> ().ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2));

                if (Physics.Raycast(ray, out hit))
                {
                    if (hit.collider.tag == "Gnome")
                    {
                        Gnome gnome = hit.collider.gameObject.GetComponent <Gnome> ();
                        //TODO: weapons should be the things dealing damage. once the equip system is set up, change this to be something like `currentWeapon.DealDamage(gnome);`
                        DealDamage(gnome);
                    }
                }
            }
        }
    }