示例#1
0
    public void Training(float mod)
    {
        int incHealth  = Random.Range(0, 4);
        int incDamage  = Random.Range(0, 2);
        int incStamina = Random.Range(0, 2);


        string msg = "";

        if (incHealth > 0)
        {
            incHealth = (int)(incHealth * mod);
            msg      += "Your health rised up by " + incHealth + " points!\n";
            character.GetHealth().IncreaseMaxValue(incHealth);
        }
        if (incDamage > 0)
        {
            incDamage = (int)(incDamage * mod);
            msg      += "Your damage rised up by " + incDamage + " points!\n";
            character.GetDamage().IncreaseMaxValue(incDamage);
        }
        if (incStamina > 0)
        {
            incStamina = (int)(incStamina * mod);
            msg       += "Your stamina rised up by " + incStamina + " points!";
            character.GetStamina().IncreaseMaxValue(incStamina);
        }

        InformationWindow.ShowInformation("Train result", msg, false);
    }
示例#2
0
        private void Submit(object sender, RoutedEventArgs e)
        {
            Button sent = sender as Button;

            if (((String)sent.Name).Equals("cancelButton"))
            {
                NavigationService.GoBack();
                return;
            }

            // only update a rental if it was found in the lookup
            if (rentalFound)
            {
                rental.CheckinTime     = DateTime.Now;
                rental.Resource.Status = Resource.ResourceStatus.RETURNED;

                rentals.updateSingle(rental);
                resources.updateSingle(rental.Resource);

                infoWindow = new InformationWindow("Item Checkin");
                infoWindow.setInfoText("Rental was successfully checked in.");

                infoWindow.ShowDialog();
            }

            NavigationService.GoBack();
        }
示例#3
0
    private void Awake()
    {
        if ( instance == null )
            instance = this;

        FindAndSetChildren();
    }
示例#4
0
        public void Information()
        {
            Window window = new InformationWindow();

            WindowVisibility = false;
            window.ShowDialog();
            WindowVisibility = true;
        }
示例#5
0
        public void ShowInfo()
        {
            GuestRoom         aGuestRoom = new GuestRoom(0, new Point(1, 1), new Point(1, 1), 1);
            InformationWindow window     = new InformationWindow();

            window.ShowInformation(aGuestRoom);
            Assert.IsTrue(window.IsShowingInfo);
        }
 protected void ShowInformationWindow(string information, object dataContext)
 {
     InformationWindowText = information;
     if (ShowNewWindow <InformationWindow>(dataContext) is InformationWindow informationWindow)
     {
         _informationWindow = informationWindow;
     }
 }
示例#7
0
        private void InformationButton_Click(object sender, RoutedEventArgs e)
        {
            InformationWindow IW = new InformationWindow();

            IW.Owner = this;
            this.Hide();
            IW.ShowDialog();
            this.Show();
        }
示例#8
0
    public virtual void GenerateLoot(Player player)
    {
        float mod   = (GetPower() / 50f);
        int   gold  = (int)(Random.Range(10, 20) * mod);
        Item  goldI = player.GetCharacter().GetInventory().GetItem("Gold");

        goldI.AddQty(gold);
        InformationWindow.ShowInformation("Gold!", "You have found " + gold + " gold on " + name);
    }
示例#9
0
 public void PlayerEvent(PlayerEvents type)
 {
     switch (type)
     {
     case PlayerEvents.DEAD:
         InformationWindow.ShowInformation("Game over", "Your hero is dead!");
         break;
     }
 }
示例#10
0
    public override void Interact(Entity actor)
    {
        if (!IsPlayer(actor))
        {
            return;
        }

        Choice[] choices = new Choice[4];

        choices[0] = new Choice("Buy health potion (" + healthPotionCost + " gold)", delegate()
        {
            Inventory i = Player.Instance.GetCharacter().GetInventory();
            Item gold   = Player.Instance.GetCharacter().GetGold();
            if (gold.Get(healthPotionCost))
            {
                i.AddItem(new Item("Health potion", 1));
            }
            else
            {
                InformationWindow.ShowInformation("No money", "You are to poor to pay for health potion!", false);
            }
        });

        choices[1] = new Choice("Buy stamina potion (" + staminaPotionCost + " gold)", delegate()
        {
            Inventory i = Player.Instance.GetCharacter().GetInventory();
            Item gold   = Player.Instance.GetCharacter().GetGold();
            if (gold.Get(staminaPotionCost))
            {
                i.AddItem(new Item("Stamina potion", 1));
            }
            else
            {
                InformationWindow.ShowInformation("No money", "You are to poor to pay for stamina potion!", false);
            }
        });

        choices[2] = new Choice("Buy better equipment (" + equipmentCost + " gold)", delegate()
        {
            Item gold = Player.Instance.GetCharacter().GetGold();
            if (gold.Get(equipmentCost))
            {
                Attribute damage = Player.Instance.GetCharacter().GetDamage();
                damage.IncreaseMaxValue(equipmentQuality);
                damage.ResetValue();
            }
            else
            {
                InformationWindow.ShowInformation("No money", "You are to poor to pay for new equipment potion!", false);
            }
        });

        choices[3] = new Choice("Go away", null);

        ChoiceWindow.Open("City", "You are in the city of Patrunacs", choices);
    }
示例#11
0
        private void ShowInformationWindow(object obj)
        {
            if (_infoWindow == null)
            {
                _infoWindow = new InformationWindow();
            }

            _infoWindow.NavigateWebControlToInfoPage();
            _infoWindow.Show();
        }
示例#12
0
    public static void ShowInformation(string title, string body)
    {
        Event e = new Event();

        e.SetOnEventTriggerMethod(delegate()
        {
            InformationWindow window = ObjectPool.Get <InformationWindow>();
            window.Show(title, body);
            window.isEvent = true;
            window.GetComponent <Canvas>().sortingOrder = 100;
        });
    }
示例#13
0
    protected void OnQuestDone()
    {
        string    loot = "\n";
        Inventory inv  = Player.Instance.GetCharacter().GetInventory();
        int       size = items.Length;

        for (int i = 0; i < size; i++)
        {
            Item item = items[i];
            inv.AddItem(item);
            loot += item.GetName() + " " + item.GetQty() + ";\n";
        }

        InformationWindow.ShowInformation(title, doneText + loot, false);
    }
示例#14
0
        private static async Task ShowInformationDialogAsync(InformationMessage message)
        {
            if (message is ExceptionMessage)
            {
                Trace.TraceError($"Exception: { message.VM.Details }");
            }

            var window = new InformationWindow()
            {
                VM = message.VM
            };

            await window.ShowDialog(MainWindow);

            message.Process();
        }
示例#15
0
    public override void Interact(Entity actor)
    {
        if (!IsPlayer(actor))
        {
            return;
        }

        Choice[] choices = new Choice[3];

        choices[0] = new Choice("Training (" + trainingGoldRequired + " gold)", delegate()
        {
            Player p  = Player.Instance;
            Item gold = p.GetCharacter().GetGold();

            if (gold.Get(trainingGoldRequired))
            {
                p.Training(1);
                trainingGoldRequired += 10;
            }
            else
            {
                InformationWindow.ShowInformation("No money", "You are to poor to pay for training!", false);
            }
        });

        choices[1] = new Choice("Rest (" + restGoldRequired + " gold)", delegate()
        {
            Player p  = Player.Instance;
            Item gold = p.GetCharacter().GetGold();

            if (gold.Get(restGoldRequired))
            {
                p.GetCharacter().GetHealth().ResetValue();
                p.GetCharacter().GetStamina().ResetValue();
            }
            else
            {
                InformationWindow.ShowInformation("No money", "You are to poor to pay for training!", false);
            }
        });

        choices[2] = new Choice("Go away", null);

        ChoiceWindow.Open("Castle", ToString(), choices);
    }
示例#16
0
    public override void Interact(Entity actor)
    {
        if (!(actor is Character))
        {
            throw new System.Exception("There is something wrong: not a character is going to interact with a loot!");
        }

        Character cActor = actor as Character;

        string msg = cActor.name + " get:\n";

        int gold      = Random.Range(10, 20);
        int hPotions  = Random.Range(0, 100);
        int sPotions  = Random.Range(0, 100);
        int equipment = Random.Range(0, 100);

        msg += "Gold: " + gold + "\n";
        cActor.GetGold().AddQty(gold);

        if (hPotions > probability)
        {
            msg += "Health potion\n";
            cActor.GetHealthPotions().Increase();
        }

        if (sPotions > probability)
        {
            msg += "Stamina potion\n";
            cActor.GetStaminaPotions().Increase();
        }

        if (equipment > probability)
        {
            int       amount = Random.Range(1, 4);
            Attribute damage = cActor.GetDamage();
            damage.IncreaseMaxValue(amount);
            damage.ResetValue();
            msg += "Better equipment (+" + amount + " to damage)";
        }

        InformationWindow.ShowInformation("Loot", msg);
        DisableEntity();
    }
示例#17
0
    private void Pray(int gold, Character actor)
    {
        if (!actor.GetGold().Get(gold))
        {
            InformationWindow.ShowInformation("No money", "You are to poor!", false);
            return;
        }

        int min = UnityEngine.Random.Range(0, 600);

        if (gold > min)
        {
            //Not sure about this decision
            Player.Instance.Training(5);
        }
        else
        {
            InformationWindow.ShowInformation("Void", "Nothing happend", false);
        }
    }
示例#18
0
    private void MoveCharacter(int x, int y)
    {
        Attribute stamina = character.GetStamina();

        if (stamina.Value < 1)
        {
            InformationWindow.ShowInformation("To tired", "You are to tired to move", false, "tiered");
            return;
        }
        bool moved = character.MoveDirection(x, y);

        if (moved)
        {
            EndTurn();
        }
        else
        {
            InformationWindow.ShowInformation("Info", "You cannot move there!", false, "movefail");
        }
    }
示例#19
0
    public static void ShowInformation(string title, string body, bool isEvent, string tag)
    {
        if (isEvent)
        {
            ShowInformation(title, body);
        }
        else
        {
            if (activeWindows.Contains(tag))
            {
                return;
            }

            InformationWindow window = ObjectPool.Get <InformationWindow>();
            window.Show(title, body);
            window.isEvent = false;
            window.wtag    = tag;
            window.GetComponent <Canvas>().sortingOrder = 101;
            activeWindows.Add(tag);
        }
    }
示例#20
0
        private void resourceId_LostFocus(object sender, RoutedEventArgs e)
        {
            TextBox       sent = sender as TextBox;
            int           id   = -1;
            List <Rental> checkedOut;

            if (sent.Text == "")
            {
                return;
            }

            if (!int.TryParse(sent.Text, out id))
            {
                //display error message
                return;
            }

            checkedOut = rentals.getRentalByResourceId(id);

            if (checkedOut == null || checkedOut.Count < 1)
            {
                infoWindow = new InformationWindow("Rental not found");

                infoWindow.setInfoText("A rental associated to the resource with id " +
                                       id + " was not found");

                infoWindow.ShowDialog();
                return;
            }

            rentalFound = true;

            rental           = checkedOut[0];
            renterName.Text  = rental.Renter.FullName;
            renterEmail.Text = rental.Renter.CpEmail;

            returnButton.Focus();
        }
示例#21
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Loot", "This is a loot", false, "entityinfo");
 }
示例#22
0
 public void ShowQuest()
 {
     InformationWindow.ShowInformation(title, description, false);
 }
 private void Information()
 {
     _informationWindow       = new InformationWindow();
     _informationWindow.Owner = Application.Current.MainWindow;
     _informationWindow.ShowDialog();
 }
示例#24
0
 public void ShowInformationWindow()
 {
     InformationOpen = new InformationWindow();
     InformationOpen.ShowDialog();
 }
示例#25
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Castle", ToString());
 }
示例#26
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Sanctuary", "This is a sanctuary", false, "entityinfo");
 }
示例#27
0
 static void displayInformation()
 {
     window = new InformationWindow();
     Application.Run(window);
 }
示例#28
0
 public void Sleep()
 {
     character.RestoreStamina(4);
     character.RestoreHealth(1);
     InformationWindow.ShowInformation("Sleep", "You have slept for a while and now you feel better!");
 }
示例#29
0
    public void CloseClick()
    {
        instance = null;

        Destroy( this.gameObject.transform.parent.parent.gameObject );
    }
示例#30
0
        public void InformationWindowConstructor()
        {
            InformationWindow window = new InformationWindow();

            Assert.IsNotNull(window);
        }
示例#31
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Camp", "Here is were criminals are enrolled!");
 }
示例#32
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Building", "This is building", false, "entityinfo");
 }