summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-01-15 12:11:40 -0500
committergumi <mekolat@users.noreply.github.com>2017-01-17 14:04:55 -0500
commitd20db213bb679b3daded777259144e48af0b23a4 (patch)
tree99a5322b67f1aeb4dd1227eb4e69fddbcbeaaaf6
parent1dfe4d358d88e1cbe87c3b5ef7e4467023db0544 (diff)
downloadserverdata-d20db213bb679b3daded777259144e48af0b23a4.tar.gz
serverdata-d20db213bb679b3daded777259144e48af0b23a4.tar.bz2
serverdata-d20db213bb679b3daded777259144e48af0b23a4.tar.xz
serverdata-d20db213bb679b3daded777259144e48af0b23a4.zip
make openbook inherit book name from calling npc
-rw-r--r--npc/001-2-5/books.txt8
-rw-r--r--npc/001-2-6/books.txt24
-rw-r--r--npc/functions/game-rules.txt4
-rw-r--r--npc/functions/openbook.txt12
4 files changed, 22 insertions, 26 deletions
diff --git a/npc/001-2-5/books.txt b/npc/001-2-5/books.txt
index 16f67100..d8f3654b 100644
--- a/npc/001-2-5/books.txt
+++ b/npc/001-2-5/books.txt
@@ -17,19 +17,17 @@
}
OnShelfUse:
- @book_name$ = .bookname$;
- if (openbookshelf ())
+ if (openbookshelf())
read_book;
close;
OnUse:
- @book_name$ = .bookname$;
- if (openbook ())
+ if (openbook())
read_book;
close;
OnInit:
- .bookname$ = "Communication Theory";
+ .book_name$ = "Communication Theory";
.sex = G_OTHER;
.distance = 1;
end;
diff --git a/npc/001-2-6/books.txt b/npc/001-2-6/books.txt
index 231785d6..23d26b8b 100644
--- a/npc/001-2-6/books.txt
+++ b/npc/001-2-6/books.txt
@@ -37,19 +37,17 @@
}
OnShelfUse:
- @book_name$ = .bookname$;
- if (openbookshelf ())
+ if (openbookshelf())
read_book;
close;
OnUse:
- @book_name$ = .bookname$;
- if (openbook ())
+ if (openbook())
read_book;
close;
OnInit:
- .bookname$ = "The Piou and The Fluffy";
+ .book_name$ = "The Piou and The Fluffy";
.sex = G_OTHER;
.distance = 1;
end;
@@ -92,19 +90,17 @@ OnInit:
}
OnShelfUse:
- @book_name$ = .bookname$;
- if (openbookshelf ())
+ if (openbookshelf())
read_book;
close;
OnUse:
- @book_name$ = .bookname$;
- if (openbook ())
+ if (openbook())
read_book;
close;
OnInit:
- .bookname$ = "Poem about Poems";
+ .book_name$ = "Poem about Poems";
.sex = G_OTHER;
.distance = 1;
end;
@@ -125,19 +121,17 @@ OnInit:
}
OnShelfUse:
- @book_name$ = .bookname$;
- if (openbookshelf ())
+ if (openbookshelf())
read_book;
close;
OnUse:
- @book_name$ = .bookname$;
- if (openbook ())
+ if (openbook())
read_book;
close;
OnInit:
- .bookname$ = "Chorus of the Woods";
+ .book_name$ = "Chorus of the Woods";
.sex = G_OTHER;
.distance = 1;
end;
diff --git a/npc/functions/game-rules.txt b/npc/functions/game-rules.txt
index afefd530..bb1cd3da 100644
--- a/npc/functions/game-rules.txt
+++ b/npc/functions/game-rules.txt
@@ -44,12 +44,12 @@ OnCall:
close;
OnUseBook:
- if (openbook(.book_name$))
+ if (openbook())
read_book;
bye;
OnShelfUse:
- if (openbookshelf(.book_name$))
+ if (openbookshelf())
read_book;
bye;
diff --git a/npc/functions/openbook.txt b/npc/functions/openbook.txt
index 8e7be072..9153900e 100644
--- a/npc/functions/openbook.txt
+++ b/npc/functions/openbook.txt
@@ -7,21 +7,25 @@
// @book_name$ = The name of the book to read.
function script openbook {
- .@book_name$ = "\"" + l(getarg(0, @book_name$)) + "\"";
+ .@book_name$ = "\"" + l(getarg(0, getvariableofnpc(.book_name$, strnpcinfo(0)))) + "\"";
narrator 4,
- l("You open a book named @@.", .@book_name$),
+ l("You open a book named @@.", .@book_name$);
+
+ narrator 8,
l("Do you want to read it?");
return (select ("Yes.", "No.") == 1);
}
function script openbookshelf {
- .@book_name$ = "\"" + l(getarg(0, @book_name$)) + "\"";
+ .@book_name$ = "\"" + l(getarg(0, getvariableofnpc(.book_name$, strnpcinfo(0)))) + "\"";
narrator 4,
l("You see a dust covered book on the shelf..."),
- l("The name of the book is @@.", .@book_name$),
+ l("The name of the book is @@.", .@book_name$);
+
+ narrator 8,
l("Do you want to read it?");
return (select ("Yes.", "No.") == 1);