/// <summary> /// Print the enter-message /// </summary> public virtual Boolean OnEnter() { /// This function gets called when the Room is Entered /// The magic stuff happens here: sub classes implement their story in this Func CIO.Print("you entered " + name); return true; }
public static void Attack() { CIO.Print("Which NPC?"); string input = CIO.ReadLine(); if (wannaExit(input)) { return; } Character enemy = Program.currentRoom.getNPCByName(input); Fight f = new Fight(enemy); f.startFight(); }
public static void GiveXP() { int amount = -1; while (amount == -1) { CIO.Print("How much?"); string input = CIO.ReadLine(); if (wannaExit(input)) { return; } Int32.TryParse(input, out amount); } Player.getInstance().GiveXP(amount); }
public static void GiveGold() { CIO.StartNewContext(new Handlers.IO.Context("How much?")); int amount = -1; while (amount == -1) { CIO.Print("How much?"); string input = CIO.ReadLine(); if (wannaExit(input)) { return; } Int32.TryParse(input, out amount); } Player.getInstance().AddGold(amount); CIO.EndContextWithoutReEnter(); }
public override void onFailure() { CIO.Print("the guard doesnt accept your bribe"); }
public override void onNotAvailable() { CIO.Print("Not Enough money"); }
/// <summary> /// Print the leave-message /// </summary> public virtual void OnExit() { // This function gets called when the Room is Exited CIO.Print("you left " + name); }