mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
First tilde projects commit
This commit is contained in:
1 parent
9bcadfc4a7
commit
726861fae6
40 files changed
+20890
No files matched your search
@@ -0,0 +1,174 @@
|
||||
:: Start
|
||||
[[Start Adventure|krowbar-start]]
|
||||
<<set $items = {} >>
|
||||
<<set $events = {} >>
|
||||
<<set $stats = {} >>
|
||||
<<set $stats['health'] to 10 >>
|
||||
<<set $stats['health_max'] to 10 >>
|
||||
<<set $stats['mana'] to 5 >>
|
||||
<<set $stats['mana_max'] to 5 >>
|
||||
<<set $stats['intelligence'] to 3 >>
|
||||
<<set $skills = {} >>
|
||||
<<set $skills['adventuring'] = 2 >>
|
||||
<<set $items['gold'] to 0 >>
|
||||
|
||||
:: krowbar-start [start inv stats skills]
|
||||
<<if visited("krowbar-start") is 1>>Welcome to the adventure!<<endif>>
|
||||
There is a door on the wall.
|
||||
<<if not visited("Get McGuffin")>>You see a McGuffin<<endif>>
|
||||
<<if not visited("Get Coins")>>You see a few coins on the floor<<endif>>
|
||||
<<actions "Get McGuffin" "Get Coins">>\
|
||||
<<if $items['McGuffin'] is true>><<actions "Use McGuffin on door">><<endif>>\
|
||||
<<if visited("Use McGuffin on door")>>[[Go through door|Room2]]<<endif>>
|
||||
[[PlayerProfile]]
|
||||
|
||||
:: Get McGuffin
|
||||
You pick up the McGuffin.
|
||||
<<set $items['McGuffin'] to true>>
|
||||
[[Return|previous()]]
|
||||
|
||||
:: Get Coins
|
||||
You pick up the coins.
|
||||
<<set $items['gold'] += 3>>
|
||||
[[Return|previous()]]
|
||||
|
||||
:: Use McGuffin on door
|
||||
You use the McGuffin on the door.
|
||||
The McGuffin crumbles and the door opens.
|
||||
<<set $items['McGuffin'] to false>>
|
||||
[[Return|previous()]]
|
||||
|
||||
:: Room2 [inv]
|
||||
This is room2. There is nothing here.
|
||||
[[Go to room3|Room3]]
|
||||
|
||||
:: Room3 [inv]
|
||||
Seriously, nothing here.
|
||||
|
||||
:: Inventory
|
||||
<br>
|
||||
<strong>Inventory:</strong>
|
||||
<<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
|
||||
<br>
|
||||
<strong>Player Stats:</strong>
|
||||
<<PlayerStats>>
|
||||
|
||||
:: 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 += "<br>";
|
||||
}
|
||||
new Wikifier(place, msg);
|
||||
},
|
||||
init: function() { },
|
||||
};
|
||||
} catch(e) {
|
||||
throwError(place,"PlayerStats Setup Error: " + e.message);
|
||||
}
|
||||
|
||||
:: PlayerSkills
|
||||
<br>
|
||||
<strong>Player Skills:</strong>
|
||||
<<PlayerSkills>>
|
||||
|
||||
:: 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]+"<br>";
|
||||
}
|
||||
new Wikifier(place, msg);
|
||||
},
|
||||
init: function() { },
|
||||
};
|
||||
} catch(e) {
|
||||
throwError(place,"PlayerSkills Setup Error: " + e.message);
|
||||
}
|
||||
|
||||
:: PlayerProfile
|
||||
[[Return|previous()]]
|
||||
-~-~-~-~-~-
|
||||
<<display PlayerStats>>
|
||||
<<display PlayerSkills>>
|
||||
<<display Inventory>>
|
||||
|
||||
:: 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());
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user