:: Start [[Start Adventure|krowbar-start]] <> <> <> <> <> <> <> <> <> <> <> :: krowbar-start [start inv stats skills] <>Welcome to the adventure!<> There is a door on the wall. <>You see a McGuffin<> <>You see a few coins on the floor<> <>\ <><><>\ <>[[Go through door|Room2]]<> [[PlayerProfile]] :: Get McGuffin You pick up the McGuffin. <> [[Return|previous()]] :: Get Coins You pick up the coins. <> [[Return|previous()]] :: Use McGuffin on door You use the McGuffin on the door. The McGuffin crumbles and the door opens. <> [[Return|previous()]] :: Room2 [inv] This is room2. There is nothing here. [[Go to room3|Room3]] :: Room3 [inv] Seriously, nothing here. :: Inventory
Inventory: <> :: ShowInventory [script] try { version.extensions['Inventory'] = { major:0, minor:1, revision:0 }; macros['Inventory'] = { handler: function(place, macroName, params, parser) { var msg = ""; var items = state.history[0].variables.items; if (items == undefined) { new Wikifier(place, "nothing"); return; } for(var name in items) { if(!isNaN(parseFloat(items[name])) && isFinite(items[name])) { msg += name + "(" + items[name] + "), "; } else if(items[name] != false) { msg += name + ", "; } }; new Wikifier(place, msg.slice(0,-2)); }, init: function() { }, }; } catch(e) { throwError(place,"Inventory Setup Error: " + e.message); } :: PlayerStats
Player Stats: <> :: ShowPlayerStats [script] try { version.extensions['PlayerStats'] = { major:0, minor:1, revision:0 }; macros['PlayerStats'] = { handler: function(place, macroName, params, parser) { var msg = ""; var stats = state.history[0].variables.stats; if (stats == undefined) { new Wikifier(place, "no stats"); return; } for(var stat in stats) { if(stat.slice(-4) == "_max") { continue; } msg += stat + ": " + stats[stat]; if(stats[stat+"_max"] != undefined) { msg += " / " + stats[stat+"_max"]; } msg += "
"; } new Wikifier(place, msg); }, init: function() { }, }; } catch(e) { throwError(place,"PlayerStats Setup Error: " + e.message); } :: PlayerSkills
Player Skills: <> :: ShowPlayerSkills [script] try { version.extensions['PlayerSkills'] = { major:0, minor:1, revision:0 }; macros['PlayerSkills'] = { handler: function(place, macroName, params, parser) { var msg = ""; var stats = state.history[0].variables.skills; if (stats == undefined) { new Wikifier(place, "no skills"); return; } for(var stat in stats) { msg += stat + ": " + stats[stat]+"
"; } new Wikifier(place, msg); }, init: function() { }, }; } catch(e) { throwError(place,"PlayerSkills Setup Error: " + e.message); } :: PlayerProfile [[Return|previous()]] -~-~-~-~-~- <> <> <> :: postrender [script] postrender.tagInventory = function(place) { var inv = tale.get("Inventory"); if (inv.id !== undefined && ~this.tags.indexOf("inv")) { new Wikifier(place, inv.processText()); }; var stats = tale.get("PlayerStats"); if(stats.id !== undefined && ~this.tags.indexOf("stats")) { new Wikifier(place, stats.processText()); }; var skills = tale.get("PlayerSkills"); if(skills.id !== undefined && ~this.tags.indexOf("skills")) { new Wikifier(place, skills.processText()); }; }