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 8e16709 166/237: ADDED some


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 8e16709 166/237: ADDED some Barn <-> Silverhair teleport magic :)
Date: Mon, 25 Jul 2016 18:15:09 +0000 (UTC)

tag: Release_0-3-1
commit 8e1670996ec067e0aea00344c1eb048487c7f46a
Author: adondev <adondev>
Commit: adondev <adondev>

    ADDED some Barn <-> Silverhair teleport magic :)
---
 scripts/events/Makefile.am          |    3 ++-
 scripts/events/brn_to_silverhair.py |   38 +++++++++++++++++++++++++++++++++
 scripts/events/silverhair_to_brn.py |   36 +++++++++++++++++++++++++++++++
 scripts/events/silverhair_to_fst.py |   40 +++++++++++++++++++++++++++++++++++
 scripts/init.py                     |   12 +++++------
 5 files changed, 122 insertions(+), 7 deletions(-)

diff --git a/scripts/events/Makefile.am b/scripts/events/Makefile.am
index 8f0ecd6..f24b5b7 100755
--- a/scripts/events/Makefile.am
+++ b/scripts/events/Makefile.am
@@ -3,7 +3,8 @@ pkgdatadir = $(gamedatadir)/scripts/events
 pkgdata_DATA = *.pyc
 
 EXTRA_DIST = teleport.py cellar_to_bjarn.py fst_to_silverhair.py \
-       character_speak.py open_inn_door.py
+       character_speak.py open_inn_door.py silverhair_to_fst.py \
+       silverhair_to_brn.py brn_to_silverhair.py
 
 all:
        $(adonthell_binary) -c
diff --git a/scripts/events/brn_to_silverhair.py 
b/scripts/events/brn_to_silverhair.py
new file mode 100644
index 0000000..a84ec5c
--- /dev/null
+++ b/scripts/events/brn_to_silverhair.py
@@ -0,0 +1,38 @@
+#
+#  (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
+#
+
+# -- Map Event to teleport a character from the barn into Silverhair's room
+
+import adonthell
+import events
+
+class brn_to_silverhair:
+
+    # Parameters:
+    # smdest: destination submap
+    # xdest: X position on smdest
+    # ydest: Y position on smdest
+    # destdir: direction where to look at after the teleport
+    def __init__ (self, eventinstance, smdest, xdest, ydest, destdir):
+        self.smdest = smdest
+        self.xdest = xdest
+        self.ydest = ydest
+        self.destdir = destdir
+
+    def run (self, submap, x, y, dir, name):
+        p = adonthell.gamedata_get_character (name)
+        p.set_val ("came_from_barn", 1)
+
+        events.switch_submap (p, self.smdest, self.xdest, self.ydest, 
self.destdir)
+        p.stand ()
+        p.go_west ()
+        adonthell.gamedata_get_character ("Imoen Silverhair").launch_action (p)
diff --git a/scripts/events/silverhair_to_brn.py 
b/scripts/events/silverhair_to_brn.py
new file mode 100644
index 0000000..dd5ef4b
--- /dev/null
+++ b/scripts/events/silverhair_to_brn.py
@@ -0,0 +1,36 @@
+#
+#  (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
+#
+
+# -- Map Event to teleport a character from the barn into Silverhair's room
+
+import adonthell
+import events
+
+class silverhair_to_brn:
+
+    # Parameters:
+    # smdest: destination submap
+    # xdest: X position on smdest
+    # ydest: Y position on smdest
+    # destdir: direction where to look at after the teleport
+    def __init__ (self, eventinstance, smdest, xdest, ydest, destdir):
+        self.smdest = smdest
+        self.xdest = xdest
+        self.ydest = ydest
+        self.destdir = destdir
+
+    def run (self, submap, x, y, dir, name):
+        p = adonthell.gamedata_get_character (name)
+
+        if p.get_val ("came_from_barn") == 1:
+            p.set_val ("came_from_barn", 0)
+            events.switch_submap (p, self.smdest, self.xdest, self.ydest, 
self.destdir)
diff --git a/scripts/events/silverhair_to_fst.py 
b/scripts/events/silverhair_to_fst.py
new file mode 100644
index 0000000..9a84dc8
--- /dev/null
+++ b/scripts/events/silverhair_to_fst.py
@@ -0,0 +1,40 @@
+#
+#  (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
+#
+
+# -- Map Event to teleport a character from Silverhair's room, if allowed.
+
+import adonthell
+import events
+
+class silverhair_to_fst:
+
+    # Parameters:
+    # smdest: destination submap
+    # xdest: X position on smdest
+    # ydest: Y position on smdest
+    # destdir: direction where to look at after the teleport
+    def __init__ (self, eventinstance, smdest, xdest, ydest, destdir):
+        self.smdest = smdest
+        self.xdest = xdest
+        self.ydest = ydest
+        self.destdir = destdir
+
+    def run (self, submap, x, y, dir, name):
+        p = adonthell.gamedata_get_character (name)
+
+        # -- Jelom not convinced of Silverhair's innocence
+        if p.get_val ("came_from_barn") == 1:
+            p.stand ()
+            p.go_south ()
+            p.speak ("I better leave the way I came.")
+        else:
+            events.switch_submap (p, self.smdest, self.xdest, self.ydest, 
self.destdir)
diff --git a/scripts/init.py b/scripts/init.py
index 12a267c..e50a85a 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -510,7 +510,7 @@ class title_screen:
         ev.submap = 13
         ev.x = 5
         ev.y = 1
-        ev.set_script ("teleport", (9, 1, 6, STAND_NORTH))
+        ev.set_script ("silverhair_to_fst", (9, 1, 6, STAND_NORTH))
         lm.add_event (ev)
 
         # From 2nd to Redwyne's
@@ -813,20 +813,20 @@ class title_screen:
         ev.submap = 21
         ev.x = 0
         ev.y = 7
-        ev.set_script ("teleport", (13, 6, 4, STAND_WEST))
+        ev.set_script ("brn_to_silverhair", (13, 6, 4, STAND_WEST))
         lm.add_event (ev)
 
-        # Action events
         # From silverhair to loft
-        ev = action_event ()
+        ev = enter_event ()
         ev.thisown = C
         ev.submap = 13
         ev.x = 6
         ev.y = 4
-        ev.dir = STAND_EAST
-        ev.set_script ("teleport", (21, 1, 7, STAND_EAST))
+        ev.set_script ("silverhair_to_brn", (21, 1, 7, STAND_EAST))
         lm.add_event (ev)
 
+        # Action events
+
         # -- Common room
         ev = action_event ()
         ev.thisown = C



reply via email to

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