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 bf5e61e 123/237: Took care


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 bf5e61e 123/237: Took care of the case when the player takes Erek to Jelom and has not made it into Bjarn's room yet
Date: Mon, 25 Jul 2016 18:15:04 +0000 (UTC)

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

    Took care of the case when the player takes Erek to Jelom and has not made 
it into Bjarn's room yet
---
 scripts/dialogues/erek_start.py         |    7 ++++
 scripts/dialogues/jelom_2nd.py          |    5 ++-
 scripts/schedules/mapcharacters/erek.py |   62 ++++++++++++++++++++++---------
 3 files changed, 55 insertions(+), 19 deletions(-)

diff --git a/scripts/dialogues/erek_start.py b/scripts/dialogues/erek_start.py
index 1203822..f4760bf 100755
--- a/scripts/dialogues/erek_start.py
+++ b/scripts/dialogues/erek_start.py
@@ -39,9 +39,16 @@ class erek_start:
            if adonthell.gamedata_get_quest("demo").get_val ("bjarn_door_open") 
== 2:
                erek = adonthell.gamedata_get_character ("Erek Stonebreaker")
                from events import switch_submap
+               erek.set_val ("goto", erek.submap ())
                switch_submap (self.the_player, 7, 1, 6, 3)
                switch_submap (erek, 7, 2, 7, 0)
        
+           if adonthell.gamedata_get_quest("demo").get_val ("convince_jelom") 
== 2:
+               erek = adonthell.gamedata_get_character ("Erek Stonebreaker")
+               erek.set_schedule_active (0)
+               from events import switch_submap
+               switch_submap (self.the_player, 9, 1, 3, 3)
+               switch_submap (erek, 9, 2, 4, 0)
 
 
        def __getattr__ (self, name):
diff --git a/scripts/dialogues/jelom_2nd.py b/scripts/dialogues/jelom_2nd.py
index a32b22f..1ca7e1d 100644
--- a/scripts/dialogues/jelom_2nd.py
+++ b/scripts/dialogues/jelom_2nd.py
@@ -38,6 +38,7 @@ class jelom_2nd:
                player.set_schedule ("to_cellar")
                        
                erek = adonthell.gamedata_get_character("Erek Stonebreaker")
+               erek.set_schedule_active (1)
                erek.set_schedule ("to_cellar")
                erek.set_val ("delay", 45)
                        
@@ -89,11 +90,13 @@ class jelom_2nd:
                                self.player.append (12)
                                self.cont.append (7)
                        self.player.append (-1)
-               elif adonthell.gamedata_get_quest("demo").get_val 
("convince_jelom") == 2:
+               else:
 
                        self.color = self.the_npc.get_color()
                        self.npc.append (23)
                        self.cont.append (13)
+                       adonthell.gamedata_get_quest("demo").set_val 
("convince_jelom" , 3)
+
                        self.player.append (-1)
 
        def answer23 (self):
diff --git a/scripts/schedules/mapcharacters/erek.py 
b/scripts/schedules/mapcharacters/erek.py
index 20c3307..a5d871f 100755
--- a/scripts/schedules/mapcharacters/erek.py
+++ b/scripts/schedules/mapcharacters/erek.py
@@ -28,11 +28,26 @@ class erek:
                   "This place is so much different from home.", \
                   "Who could have taken the gems?"]
 
-        self.coords = [(5, 5, STAND_NORTH), \
-                       (10, 6, STAND_WEST), \
-                       (5, 3, STAND_NORTH), \
-                       (4, 5, STAND_SOUTH)]
-
+        # -- the coordinates for normal schedule
+        self.coords = \
+            [(5, 5, STAND_NORTH), \
+            (10, 6, STAND_WEST), \
+            (5, 3, STAND_NORTH), \
+            (4, 5, STAND_SOUTH)]
+
+        # -- the coordinates for getting back to common room
+        self.to_common = \
+            [(0, 7, STAND_WEST), \
+            (6, 1, STAND_NORTH)]
+
+        # -- the coordinates for getting back to the 1st floor
+        self.to_1st = \
+            [(0, 7, STAND_WEST), \
+            (6, 1, STAND_NORTH), \
+            (12, 1, STAND_NORTH), \
+            (2, 4, STAND_SOUTH)]
+
+        self.index = 0
 
     def run (self):
         myself = self.myself
@@ -44,26 +59,36 @@ class erek:
             fingolson = adonthell.gamedata_get_character ("Bjarn Fingolson")
             fingolson.launch_action (adonthell.gamedata_player ())
 
-        # -- leave cellar again
+        # -- help the player with jelom
+        elif adonthell.gamedata_get_quest ("demo").get_val ("convince_jelom") 
== 2:
+            myself.set_schedule_active (0)
+            # -- start Jelom's conversation with the player and Erek
+            jelom = adonthell.gamedata_get_character ("Jelom Rasgar")
+            jelom.launch_action (adonthell.gamedata_player ())
+
+        # -- leave Bjarn's room
         elif myself.get_val ("leave_bjarn") == 1:
-            submap = myself.submap ()
+            goto = myself.get_val ("goto")
+            myself.set_val ("delay", 0)
 
-            # -- in Bjarn's room
-            if submap == 7:
-                myself.set_val ("delay", 0)
-                myself.set_goal (0, 7, STAND_WEST)
-                myself.set_val ("leave_bjarn", 2)
+            # -- goto first floor
+            if goto == 9: coords = self.to_1st
+            # -- goto common room
+            else: coords = self.to_common
 
-            # -- in the Cellar
-            elif submap == 4:
-                myself.set_goal (6, 1, STAND_NORTH)
+            if self.index < len (coords):
                 myself.set_val ("leave_bjarn", 2)
+                x, y, dir = coords[self.index]
+                myself.set_goal (x, y, dir)
 
-            # -- hopefully in the common room
+            # -- arrived
             else:
                 myself.set_val ("leave_bjarn", 0)
-                x, y, dir = self.coords[randint (0, 1)]
-                myself.set_goal (x, y, dir)
+                if myself.submap () == 1:
+                    x, y, dir = self.coords[randint (0, 1)]
+                    myself.set_goal (x, y, dir)
+                else:
+                    myself.set_schedule_active (0)
 
             myself.set_val ("todo", 2)
 
@@ -86,6 +111,7 @@ class erek:
             # -- on our way back from bjarn's room
             if myself.get_val ("leave_bjarn") == 2:
                 myself.set_val ("leave_bjarn", 1)
+                self.index = self.index + 1
 
             # -- switch places
             else:



reply via email to

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