示例#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
        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);
        }
示例#3
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);
    }
示例#4
0
 public void PlayerEvent(PlayerEvents type)
 {
     switch (type)
     {
     case PlayerEvents.DEAD:
         InformationWindow.ShowInformation("Game over", "Your hero is dead!");
         break;
     }
 }
示例#5
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);
    }
示例#6
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);
    }
示例#7
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);
    }
示例#8
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();
    }
示例#9
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");
        }
    }
示例#10
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);
        }
    }
示例#11
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Castle", ToString());
 }
示例#12
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Camp", "Here is were criminals are enrolled!");
 }
示例#13
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Building", "This is building", false, "entityinfo");
 }
示例#14
0
 public void Sleep()
 {
     character.RestoreStamina(4);
     character.RestoreHealth(1);
     InformationWindow.ShowInformation("Sleep", "You have slept for a while and now you feel better!");
 }
示例#15
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Sanctuary", "This is a sanctuary", false, "entityinfo");
 }
示例#16
0
 public void ShowQuest()
 {
     InformationWindow.ShowInformation(title, description, false);
 }
示例#17
0
 public override void ShowInfo()
 {
     InformationWindow.ShowInformation("Loot", "This is a loot", false, "entityinfo");
 }