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 a1e51e2 061/237: ADDED Jelo


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 a1e51e2 061/237: ADDED Jelom
Date: Mon, 25 Jul 2016 18:14:57 +0000 (UTC)

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

    ADDED Jelom
    UPDATED Oliver to use new pathfinding
    FIXED python console
---
 scripts/dialogues/Makefile.am         |    2 +-
 scripts/dialogues/oliver_start.py     |    2 +-
 scripts/dialogues/orloth_start.py     |    4 +-
 scripts/dialogues/talan_start.py      |   20 +++++++--
 scripts/events/1st_to_silverhair.py   |   17 ++++++-
 scripts/init.py                       |   14 +++++-
 scripts/schedules/Makefile.am         |    2 +-
 scripts/schedules/keyboard_control.py |    9 ++--
 scripts/schedules/oliver.py           |   80 +++++++++++++++++++++++++--------
 9 files changed, 117 insertions(+), 33 deletions(-)

diff --git a/scripts/dialogues/Makefile.am b/scripts/dialogues/Makefile.am
index 10c2b51..a876398 100755
--- a/scripts/dialogues/Makefile.am
+++ b/scripts/dialogues/Makefile.am
@@ -2,7 +2,7 @@ pkgdatadir = $(gamedatadir)/scripts/dialogues
 
 pkgdata_DATA = orloth_start.py lucia_start.py sarin_start.py \
     janesta_start.py erek_start.py oliver_start.py bjarn_start.py \
-    frostbloom_start.py talan_start.py alek_start.py
+    frostbloom_start.py talan_start.py alek_start.py jelom_start.py
 
 EXTRA_DIST = $(pkgdata_DATA)
 
diff --git a/scripts/dialogues/oliver_start.py 
b/scripts/dialogues/oliver_start.py
index 93c6a87..7dbf0e2 100755
--- a/scripts/dialogues/oliver_start.py
+++ b/scripts/dialogues/oliver_start.py
@@ -27,7 +27,7 @@ class oliver_start:
         self.dialogue[answer]()
 
     def start (self):
-        if the_npc.get_val ("goto_players_room") == 2:
+        if the_npc.get_val ("goto_players_room") == 3:
 
             self.color = 0
             self.npc.append (28)
diff --git a/scripts/dialogues/orloth_start.py 
b/scripts/dialogues/orloth_start.py
index 495f260..309b1a2 100755
--- a/scripts/dialogues/orloth_start.py
+++ b/scripts/dialogues/orloth_start.py
@@ -31,11 +31,11 @@ class orloth_start:
     
     def __del__ (self):
         oliver = characters["Oliver Redwyne"]
-        if oliver.get_val ("goto_players_room") == 1:
+        if oliver.get_val ("goto_players_room") == 2:
             from events import switch_submap
             switch_submap (the_player, 12, 5, 3, 1)
             switch_submap (oliver, 12, 5, 4, 0)
-            oliver.set_val ("goto_players_room", 2)
+            oliver.set_val ("goto_players_room", 3)
     
 
 
diff --git a/scripts/dialogues/talan_start.py b/scripts/dialogues/talan_start.py
index 3af738f..f85b8d9 100755
--- a/scripts/dialogues/talan_start.py
+++ b/scripts/dialogues/talan_start.py
@@ -1,6 +1,6 @@
 class talan_start:
     loop = []
-    strings = ["Oh, hullo again, $name.", "Listen, I really am sorry about 
that fuss at the gate. I hope you will not hold it against me.", "Please, my 
good man, do not mention it again. I assure you that I hold no grudge against 
you. Now, if we may go on to the business at hand?", "Oh... that. Yes, how may 
I help you?", "Hello, Talan. Look, I have a couple questions about the theft.", 
"Well, can you tell me what happened on the night of the theft?", "Sure, but 
there is not much to tell. [...]
+    strings = ["Oh, hullo again, $name.", "Listen, I really am sorry about 
that fuss at the gate. I hope you will not hold it against me.", "Please, my 
good man, do not mention it again. I assure you that I hold no grudge against 
you. Now, if we may go on to the business at hand?", "Oh... that. Yes, how may 
I help you?", "Hello, Talan. Look, I have a couple questions about the theft.", 
"Well, can you tell me what happened on the night of the theft?", "Sure, but 
there is not much to tell. [...]
 
     def set_name (self, new_name):
         pass
@@ -12,7 +12,7 @@ class talan_start:
         pass
 
     def __init__(self):
-        self.dialogue = [self.start, self.answer2, self.answer4, self.answer5, 
self.answer7, self.answer8, self.answer11, self.answer12, self.answer14, 
self.answer16, self.answer18, self.answer20, self.answer22, self.answer24, 
self.answer26, self.answer28, self.answer30, self.answer32, self.answer33, 
self.answer35, self.answer37, self.answer39, self.answer40, self.answer42, 
self.answer44, self.answer45, self.answer48, self.answer53, self.answer57, 
self.answer59, self.answer61, self.answe [...]
+        self.dialogue = [self.start, self.answer2, self.answer4, self.answer5, 
self.answer7, self.answer8, self.answer11, self.answer12, self.answer14, 
self.answer16, self.answer18, self.answer20, self.answer22, self.answer24, 
self.answer26, self.answer28, self.answer30, self.answer32, self.answer33, 
self.answer35, self.answer37, self.answer39, self.answer40, self.answer42, 
self.answer44, self.answer45, self.answer48, self.answer53, self.answer57, 
self.answer59, self.answer61, self.answe [...]
 
     def clear (self):
         del self.dialogue
@@ -300,13 +300,17 @@ class talan_start:
         self.cont.append (15)
         self.player.append (10)
         self.cont.append (-1)
+        if quests["demo"].get_val ("know_talan_singing") == 1:
+
+            self.player.append (66)
+            self.cont.append (33)
         if quests["demo"].get_val( "know_alek_eavesdrop" ) == 1:
 
             self.player.append (11)
             self.cont.append (6)
         self.player.append (-1)
 
-    def answer14 (self):
+    def answer137 (self):
         self.color = the_npc.get_color()
         self.npc.append (15)
         self.cont.append (-1)
@@ -358,6 +362,16 @@ class talan_start:
         self.color = the_npc.get_color()
         self.npc.append (27)
         self.cont.append (-1)
+        quests["demo"].set_val ("know_talan_singing" , 2)
+
+        self.player.append (-1)
+
+    def answer14 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (15)
+        self.cont.append (-1)
+        self.player.append (16)
+        self.cont.append (9)
         self.player.append (-1)
 
     def answer2 (self):
diff --git a/scripts/events/1st_to_silverhair.py 
b/scripts/events/1st_to_silverhair.py
index 7351911..d5c86b1 100755
--- a/scripts/events/1st_to_silverhair.py
+++ b/scripts/events/1st_to_silverhair.py
@@ -1,7 +1,20 @@
 p = characters [name]
 
 if p.submap () == 9:
-  events.switch_submap (p, 13, 5, 2, STAND_SOUTH)
+    # -- bjarn's door closed
+    free = quests["demo"].get_val("silverhair_free")
+
+    # -- Jelom not convinced of Silverhair's innocence
+    if not free and p == the_player:
+        # -- we only need that for the dialogue, ...
+        p.set_val ("at_silverhairs_door", 1)
+        characters["Jelom Rasgar"].launch_action (p)
+        p.stand ()
+        p.go_north ()
+        # -- ... so remove it again afterwards
+        p.set_val ("at_silverhairs_door", 0)
+    else:
+        events.switch_submap (p, 13, 5, 2, STAND_SOUTH)
 else:
-  events.switch_submap (p, 9, 1, 6, STAND_NORTH)
+    events.switch_submap (p, 9, 1, 6, STAND_NORTH)
 
diff --git a/scripts/init.py b/scripts/init.py
index e399478..42463f8 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -80,7 +80,7 @@ class title_screen:
         self.quit = 0
         self.bgimage = win_image ()
         self.bgimage.move (0, 0)
-        image_copy (self.bgimage, background)
+        image.copy (self.bgimage, background)
         self.bgimage.pack ()
         
         self.window = win_container ()
@@ -560,6 +560,8 @@ if retval < 5:
         erek.jump_to (1, 5, 5)
         erek.set_action ("action_talk")
         erek.stand_north ()
+        # changed Erek's text color to violet
+        erek.set_color (3)
         erek.set_schedule ("erek")
 
         talan = characters ["Talan Wendth"]
@@ -572,6 +574,16 @@ if retval < 5:
         talan.set_schedule ("talan")
 
         # -- that's a clone for now
+        jelom = characters ["Jelom Rasgar"]
+        jelom.set_dialogue ("dialogues/jelom_start")
+        jelom.load ("talan.mchar")
+        jelom.set_map (map_engine.get_landmap ())
+        jelom.jump_to (9, 2, 6)
+        jelom.set_action ("action_talk")
+        jelom.stand_north ()
+        jelom.set_schedule ("jelom")
+
+        # -- that's a clone for now
         alek = characters ["Alek Endhelm"]
         alek.set_dialogue ("dialogues/alek_start")
         alek.load ("servant2.mchar")
diff --git a/scripts/schedules/Makefile.am b/scripts/schedules/Makefile.am
index 315bbf4..4592ef8 100755
--- a/scripts/schedules/Makefile.am
+++ b/scripts/schedules/Makefile.am
@@ -2,6 +2,6 @@ pkgdatadir = $(gamedatadir)/scripts/schedules
 
 pkgdata_DATA = action_talk.py center_player.py keyboard_control.py orloth.py \
     sarin.py frostbloom.py silverhair.py oliver.py erek.py talan.py \
-    alek.py
+    alek.py jelom.py
 
 EXTRA_DIST = $(pkgdata_DATA)
diff --git a/scripts/schedules/keyboard_control.py 
b/scripts/schedules/keyboard_control.py
index 3c58d4d..2b8ce7c 100755
--- a/scripts/schedules/keyboard_control.py
+++ b/scripts/schedules/keyboard_control.py
@@ -7,7 +7,7 @@ def on_menu_close (retval, player):
         map_engine.quit ()
 
 # Reactive map update when data_screen closed
-def on_data_screen_close (retval, player):
+def on_data_screen_close (retval):
     map_engine.set_should_update_map (1)
 
 # Opens the gate
@@ -113,7 +113,7 @@ elif input_has_been_pushed (SDLK_p):
 elif input_has_been_pushed (SDLK_l):
     s = data_screen (LOAD_SCREEN)
     s.thisown = C
-    s.py_signal_connect (on_data_screen_close, win_event_CLOSE, None)
+    s.py_signal_connect (on_data_screen_close, win_event_CLOSE)
     # Stop updating the map
     map_engine.set_should_update_map (0)
     s.set_activate (1) 
@@ -125,7 +125,7 @@ elif input_has_been_pushed (SDLK_l):
 elif input_has_been_pushed (SDLK_s):
     s = data_screen (SAVE_SCREEN)
     s.thisown = C
-    s.py_signal_connect (on_data_screen_close, win_event_CLOSE, None)
+    s.py_signal_connect (on_data_screen_close, win_event_CLOSE)
     # Stop updating the map
     map_engine.set_should_update_map (0)
     s.set_activate (1) 
@@ -138,6 +138,9 @@ elif input_has_been_pushed (SDLK_TAB):
     import console
     c = console.console (globals ())
     c.thisown = C
+    c.py_signal_connect (on_data_screen_close, win_event_CLOSE)
+    # Stop updating the map
+    map_engine.set_should_update_map (0)
     c.set_activate (1)
     win_manager_add (c)
     win_manager_set_focus (c)
diff --git a/scripts/schedules/oliver.py b/scripts/schedules/oliver.py
index 2bcce4b..630c9e7 100755
--- a/scripts/schedules/oliver.py
+++ b/scripts/schedules/oliver.py
@@ -15,9 +15,10 @@
 #    He'll walk around in the stable and yard.
 #    When summoned by Orloth, he'll show the player to his room
 
-speech = ["It's so exciting. An Elven Lady at Waste's Edge!", \
+
+speech = ["It's so exciting. An Elven Lady, here at Waste's Edge!", \
           "I gotta hurry before mother complains again.", \
-          "I want a little dog!"]
+          "Why can't I have a little dog!?"]
 
 # -- Oliver summoned to common room
 if myself.get_val ("goto_players_room") == 1:
@@ -25,18 +26,26 @@ if myself.get_val ("goto_players_room") == 1:
     if myself.submap () != 1:
         myself.jump_to (1, 13, 7, STAND_NORTH)
 
-    goal_x = characters["Orloth Redwyne"].posx () + 1
-    goal_y = characters["Orloth Redwyne"].posy () + 1
+    # -- the tiles around Orloth
+    offsets = [(1,1),(1,-1),(-1,1),(-1,-1),(1,0),(0,1),(-1,0),(0,-1)]
+
+    # -- find a free spot near Orloth and the player
+    i = 0
+    orloth = characters["Orloth Redwyne"]
+    while i < 7:
+        x, y = offsets[i][:2]
+        x = x + orloth.posx ()
+        y = y + orloth.posy ()
+        if myself.set_goal (x, y, NO_MOVE): break
+        i = i + 1
 
-    schedules.simple_goto_xy (myself, goal_x, goal_y)
+    myself.set_val ("goto_players_room", 2)
+    myself.set_val ("todo", 2)
 
 # -- in the player's room
-elif myself.get_val ("goto_players_room") == 2:
+elif myself.get_val ("goto_players_room") == 3:
     # -- start talking to the player
     myself.launch_action (the_player)
-    # -- does not make a change
-    myself.set_schedule_active (0)
-    the_player.set_schedule_active (0)
 
 # -- leave the player's room and goto the barn
 elif myself.get_val ("goto_barn") == 1:
@@ -44,24 +53,57 @@ elif myself.get_val ("goto_barn") == 1:
 
     # -- Player's room
     if location == 12:
-        schedules.simple_goto_xy (myself, 5, 1)
+        myself.set_goal (5, 1, NO_MOVE)
+        myself.set_val ("goto_barn", 2)
 
     # -- First floor
     elif location == 9:
-        schedules.simple_goto_xy (myself, 8, 1)
+        myself.set_goal (8, 1, NO_MOVE)
+        myself.set_val ("goto_barn", 2)
 
     # -- Common Room
     elif location == 1:
-        schedules.simple_goto_xy (myself, 13, 8)
+        myself.set_goal (13, 8, NO_MOVE)
+        myself.set_val ("goto_barn", 2)
 
-    # -- Yard
+    # -- Yard, our final goal (for now)
     elif location == 0:
-        if myself.posx () == 25 and myself.posy () == 15:
-            myself.set_val ("goto_barn", 0)
-        else:
-            schedules.simple_goto_xy (myself, 25, 15)
+        myself.set_goal (25, 15, NO_MOVE)
+        myself.set_val ("goto_barn", 0)
+
+    myself.set_val ("todo", 2)
+
+
+# -- "normal" schedule
+todo = myself.get_val ("todo")
 
-    # -- should be outside the inn!
+# -- waiting
+if todo == 0:
+    delay = myself.get_val ("delay")
+
+    # If standing delay expired, move around next time
+    if delay == 0:
+        myself.set_val ("todo", 1)
     else:
-        myself.set_val ("goto_barn", 0)
+        myself.set_val ("delay", delay - 1)
+
+# -- get movement target
+elif todo == 1:
+    # -- on our way back from bjarn's room
+    if myself.get_val ("goto_barn") == 2:
+        myself.set_val ("goto_barn", 1)
+
+# -- move
+elif todo == 2:
+    if myself.follow_path () == 1:
+        myself.set_val ("todo", 0)
+
+
+# -- do some random babbling
+tmp = myself.get_val ("say_something")
+myself.set_val ("say_something", tmp - 1)
 
+if tmp == 0:
+    schedules.speak (myself, speech[randint (0, 2)])
+    delay = randint (80, 160) * 10
+    myself.set_val ("say_something", delay)



reply via email to

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