-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFramework Illustration.html
54 lines (38 loc) · 3.17 KB
/
Framework Illustration.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<tw-storydata name="Framework Illustration" startnode="1" creator="Twine" creator-version="2.2.1" ifid="F03CC758-C8F0-41AA-B720-DD025D5B3215" zoom="1" format="Snowman" format-version="1.3.0" options="" hidden><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style><script role="script" id="twine-user-script" type="text/twine-javascript"></script><tw-passagedata pid="1" name="Intro" tags="" position="430,297.5" size="100,100"><p>Hello, this is NOT a translation of the french one, but an illustration of the framework.</p>
<p>[[A permanent place->PermanentPlace1]]</p>
<%
class Quest{
constructor(id,target,condition){
this.id = id;
this.target = target;
this.condition = condition;
}
}
s.quest = [];
s.quest['permPlace1']=[];
s.quest['permPlace1'].push(new Quest("newQuest","[[Go on this fabulous new quest->ANewQuest]]", function(){return true;}));
s.quest['permPlace1'].push(new Quest("anotherQuest","[[This is another quest->AnotherQuest]]", function(){return true;}));
s.quest['permPlace1'].push(new Quest("secretQuest","[[This is a secret quest !->SecretQuest]]", function(){return s.quest['permPlace1'].length<3;}));
%></tw-passagedata><tw-passagedata pid="2" name="PermanentPlace1" tags="" position="419,510.5" size="100,100"><h1>Permanent Place 1</h1>
<p>Some permanent explanation</p>
<%
_.each(s.quest['permPlace1'],function(quest){
if(quest.condition()){
%><p><%=quest.target%></p><%
}
});
s.back="[[Return to Permanent Place 1->PermanentPlace1]]";
%></tw-passagedata><tw-passagedata pid="3" name="ANewQuest" tags="" position="730,204.5" size="100,100"><h1>A new quest</h1>
<p>You can manage this quest from here. This is where your reader will come when he click on the quest (that will be displayed in the permanent place you choose.)</p>
<p>You can add other quest to be displayed for some permanent place, like when you create this quest.</p>
<p>You even can remove this quest by deleting here the link to the permanent place.</p>
<p>[[Go here to remove the link->QuestRemove]]</p>
<p>[[Go here to see that links works->BetaQuest]]</p>
<%=s.back%></tw-passagedata><tw-passagedata pid="4" name="QuestRemove" tags="" position="605,416.5" size="100,100"><%
s.quest['permPlace1'] = _.reject(s.quest['permPlace1'],function(quest){
return quest.id=="newQuest";});
%>
<%=s.back%></tw-passagedata><tw-passagedata pid="5" name="BetaQuest" tags="" position="757,417.5" size="100,100"><%=s.back%></tw-passagedata><tw-passagedata pid="6" name="AnotherQuest" tags="" position="434,79" size="100,100"><p>Blabla blac bla Another quest...</p>
<%=s.back%></tw-passagedata><tw-passagedata pid="7" name="SecretQuest" tags="" position="69,239.5" size="100,100"><h1>Secret Quest !</h1>
<p>This is a secret quest ! To see it, you must have deleted a quest.</p>
<%=s.back%></tw-passagedata></tw-storydata>