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