adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[adonthell-wastesedge-commits] Release_0-3-1 11fcf14 167/237: ADDED Sear


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 11fcf14 167/237: ADDED Searching of Silverhair's luggage
Date: Mon, 25 Jul 2016 18:15:09 +0000 (UTC)

tag: Release_0-3-1
commit 11fcf14960a8e72b1c6eb4a1abf113074d1faf2d
Author: adondev <adondev>
Commit: adondev <adondev>

    ADDED Searching of Silverhair's luggage
---
 scripts/events/Makefile.am     |    2 +-
 scripts/events/search_chest.py |   31 +++++++++++++++++++++++++++++++
 scripts/init.py                |   23 ++++++++++++++++++++++-
 3 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/scripts/events/Makefile.am b/scripts/events/Makefile.am
index f24b5b7..b15ad4e 100755
--- a/scripts/events/Makefile.am
+++ b/scripts/events/Makefile.am
@@ -4,7 +4,7 @@ pkgdata_DATA = *.pyc
 
 EXTRA_DIST = teleport.py cellar_to_bjarn.py fst_to_silverhair.py \
        character_speak.py open_inn_door.py silverhair_to_fst.py \
-       silverhair_to_brn.py brn_to_silverhair.py
+       silverhair_to_brn.py brn_to_silverhair.py search_chest.py
 
 all:
        $(adonthell_binary) -c
diff --git a/scripts/events/search_chest.py b/scripts/events/search_chest.py
new file mode 100644
index 0000000..ec8505f
--- /dev/null
+++ b/scripts/events/search_chest.py
@@ -0,0 +1,31 @@
+#
+#  (C) Copyright 2001 Kai Sterker <address@hidden>
+#  Part of the Adonthell Project http://adonthell.linuxgames.com
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License.
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY.
+#
+#  See the COPYING file for more details
+#
+
+# -- Let the player search Silverhair's chest
+
+import adonthell
+
+class search_chest:
+
+    # Parameters:
+    # name: name of the character that should speak when the event is triggered
+    def __init__ (self, eventinstance, name):
+        self.myself = eventinstance
+        self.mapchar = adonthell.gamedata_get_character (name)
+
+    def run (self, submap, x, y, dir, name):
+        if adonthell.gamedata_get_quest ("demo").get_val ("get_item") == 1:
+            self.mapchar.speak ("What is that!? There is one of Fingolson's 
gems in there!")
+            adonthell.gamedata_get_quest ("demo").set_val ("get_item", 2)
+            adonthell.gamedata_get_quest ("demo").set_val ("have_gem", 1)
+        else:
+            self.mapchar.speak ("I know this chest. The Lady uses it on her 
journeys.")
diff --git a/scripts/init.py b/scripts/init.py
index e50a85a..8e8ea85 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -1207,7 +1207,28 @@ class title_screen:
             "I cannot rest when my mistress needs me!"))
         lm.add_event (ev)
 
-       # -- Now setup the characters
+        # -- stables
+        ev = action_event ()
+        ev.thisown = C
+        ev.submap = 21
+        ev.x = 1
+        ev.y = 6
+        ev.dir = STAND_WEST
+        ev.set_script ("search_chest", (player.get_id (),))
+        lm.add_event (ev)
+
+        ev = action_event ()
+        ev.thisown = C
+        ev.submap = 21
+        ev.x = 2
+        ev.y = 4
+        ev.dir = STAND_EAST
+        ev.set_script ("character_speak", (player.get_id (), \
+            "An old, empty crate!"))
+        lm.add_event (ev)
+
+
+        # -- Now setup the characters
         lucia = gamedata_get_character ("Lucia Redwyne")
         lucia.set_dialogue ("dialogues/lucia_start")
         lucia.load ("lucia.mchar")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]