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 89d9191 037/237: Added Tala


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 89d9191 037/237: Added Talan Wendth
Date: Mon, 25 Jul 2016 18:14:55 +0000 (UTC)

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

    Added Talan Wendth
---
 scripts/dialogues/Makefile.am    |    2 +-
 scripts/dialogues/talan_start.py |  373 ++++++++++++++++++++++++++++++++++++++
 scripts/init.py                  |   12 ++
 scripts/schedules/Makefile.am    |    2 +-
 scripts/schedules/talan.py       |   57 ++++++
 5 files changed, 444 insertions(+), 2 deletions(-)

diff --git a/scripts/dialogues/Makefile.am b/scripts/dialogues/Makefile.am
index 417e187..941182d 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
+    frostbloom_start.py talan_start.py
 
 EXTRA_DIST = $(pkgdata_DATA)
 
diff --git a/scripts/dialogues/talan_start.py b/scripts/dialogues/talan_start.py
new file mode 100755
index 0000000..3af738f
--- /dev/null
+++ b/scripts/dialogues/talan_start.py
@@ -0,0 +1,373 @@
+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. [...]
+
+    def set_name (self, new_name):
+        pass
+
+    def set_npc (self, new_npc):
+        pass
+
+    def set_portrait (self, new_portrait):
+        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 [...]
+
+    def clear (self):
+        del self.dialogue
+
+    def __getattr__ (self, name):
+        return 0
+
+    def run (self, answer):
+        self.npc = []
+        self.player = []
+        self.cont = []
+        self.dialogue[answer]()
+
+    def start (self):
+        if the_npc.get_val( "apologised" ) != 1:
+
+            self.color = the_npc.get_color()
+            self.npc.append (1)
+            self.cont.append (-1)
+            the_npc.set_val( "apologised", 1 );
+
+            self.player.append (2)
+            self.cont.append (1)
+            self.player.append (-1)
+        elif quests["demo"].get_val( "silverhair_free" ) != 1:
+
+            self.color = the_npc.get_color()
+            self.npc.append (0)
+            self.cont.append (-1)
+            if quests["demo"].get_val( "know_talan_singing" ) == 1:
+
+                self.player.append (14)
+                self.cont.append (8)
+            if quests["demo"].get_val( "know_talan_singing" ) != 1:
+
+                self.player.append (4)
+                self.cont.append (2)
+            self.player.append (-1)
+        else:
+
+            self.color = the_npc.get_color()
+            self.npc.append (52)
+            self.cont.append (-1)
+            self.player.append (53)
+            self.cont.append (27)
+            self.player.append (-1)
+
+    def answer53 (self):
+        if quests["demo"].get_val( "told_on_talan" ) != 1:
+
+            self.color = the_npc.get_color()
+            self.npc.append (54)
+            self.cont.append (-1)
+            self.player.append (57)
+            self.cont.append (28)
+            self.player.append (-1)
+        else:
+
+            self.color = the_npc.get_color()
+            self.npc.append (55)
+            self.cont.append (-1)
+            self.player.append (56)
+            self.cont.append (-1)
+            self.player.append (-1)
+
+    def answer56 (self):
+        pass
+
+    def answer57 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (58)
+        self.cont.append (-1)
+        self.player.append (59)
+        self.cont.append (29)
+        self.player.append (-1)
+
+    def answer59 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (60)
+        self.cont.append (-1)
+        self.player.append (61)
+        self.cont.append (30)
+        self.player.append (-1)
+
+    def answer61 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (62)
+        self.cont.append (31)
+        self.player.append (-1)
+
+    def answer62 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (63)
+        self.cont.append (32)
+        self.player.append (-1)
+
+    def answer63 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (64)
+        self.cont.append (-1)
+        self.player.append (65)
+        self.cont.append (-1)
+        self.player.append (-1)
+
+    def answer65 (self):
+        pass
+
+    def answer4 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (3)
+        self.cont.append (-1)
+        self.player.append (5)
+        self.cont.append (3)
+        if quests["demo"].get_val( "know_alek_eavesdrop" ) == 1:
+
+            self.player.append (11)
+            self.cont.append (6)
+        self.player.append (-1)
+
+    def answer11 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (12)
+        self.cont.append (7)
+        self.player.append (-1)
+
+    def answer12 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (13)
+        self.cont.append (-1)
+        self.player.append (10)
+        self.cont.append (-1)
+        self.player.append (5)
+        self.cont.append (3)
+        self.player.append (-1)
+
+    def answer10 (self):
+        pass
+
+    def answer5 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (6)
+        self.cont.append (-1)
+        self.player.append (7)
+        self.cont.append (4)
+        self.player.append (28)
+        self.cont.append (15)
+        self.player.append (-1)
+
+    def answer28 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (29)
+        self.cont.append (-1)
+        self.player.append (30)
+        self.cont.append (16)
+        self.player.append (-1)
+
+    def answer30 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (31)
+        self.cont.append (-1)
+        if quests["demo"].get_val( "know_jelom" ) != 2:
+        
+
+            self.player.append (33)
+            self.cont.append (18)
+        else:
+
+            self.player.append (32)
+            self.cont.append (17)
+        self.player.append (-1)
+
+    def answer32 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (36)
+        self.cont.append (-1)
+        self.player.append (37)
+        self.cont.append (20)
+        self.player.append (-1)
+
+    def answer37 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (38)
+        self.cont.append (-1)
+        if quests["demo"].get_val( "know_bjarns_insult" ) == 1:
+
+            self.player.append (40)
+            self.cont.append (22)
+        if quests["demo"].get_val( "know_bjarns_insult" ) != 1:
+
+            self.player.append (39)
+            self.cont.append (21)
+        self.player.append (-1)
+
+    def answer39 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (41)
+        self.cont.append (-1)
+        self.player.append (42)
+        self.cont.append (23)
+        self.player.append (-1)
+
+    def answer42 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (43)
+        self.cont.append (-1)
+        self.player.append (44)
+        self.cont.append (24)
+        self.player.append (-1)
+
+    def answer44 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (45)
+        self.cont.append (25)
+        self.player.append (-1)
+
+    def answer45 (self):
+        if quests["demo"].get_val( "know_jelom" ) != 2:
+
+            self.color = the_npc.get_color()
+            self.npc.append (46)
+            self.cont.append (-1)
+            self.player.append (48)
+            self.cont.append (26)
+            self.player.append (-1)
+        else:
+
+            self.color = the_npc.get_color()
+            self.npc.append (47)
+            self.cont.append (-1)
+            self.player.append (49)
+            self.cont.append (-1)
+            self.player.append (-1)
+
+    def answer49 (self):
+        pass
+
+    def answer48 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (50)
+        self.cont.append (-1)
+        self.player.append (51)
+        self.cont.append (-1)
+        self.player.append (-1)
+
+    def answer51 (self):
+        pass
+
+    def answer40 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (43)
+        self.cont.append (-1)
+        self.player.append (44)
+        self.cont.append (24)
+        self.player.append (-1)
+
+    def answer33 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (34)
+        self.cont.append (-1)
+        quests["demo"].set_val( "know_jelom", 1 );
+
+        self.player.append (35)
+        self.cont.append (19)
+        self.player.append (-1)
+
+    def answer35 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (36)
+        self.cont.append (-1)
+        self.player.append (37)
+        self.cont.append (20)
+        self.player.append (-1)
+
+    def answer7 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (8)
+        self.cont.append (5)
+        self.player.append (-1)
+
+    def answer8 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (9)
+        self.cont.append (-1)
+        self.player.append (28)
+        self.cont.append (15)
+        self.player.append (10)
+        self.cont.append (-1)
+        if quests["demo"].get_val( "know_alek_eavesdrop" ) == 1:
+
+            self.player.append (11)
+            self.cont.append (6)
+        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 answer16 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (17)
+        self.cont.append (-1)
+        self.player.append (18)
+        self.cont.append (10)
+        self.player.append (-1)
+
+    def answer18 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (19)
+        self.cont.append (-1)
+        self.player.append (20)
+        self.cont.append (11)
+        self.player.append (-1)
+
+    def answer20 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (21)
+        self.cont.append (-1)
+        self.player.append (22)
+        self.cont.append (12)
+        self.player.append (-1)
+
+    def answer22 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (23)
+        self.cont.append (-1)
+        self.player.append (24)
+        self.cont.append (13)
+        self.player.append (-1)
+
+    def answer24 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (25)
+        self.cont.append (-1)
+        self.player.append (26)
+        self.cont.append (14)
+        self.player.append (-1)
+
+    def answer26 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (27)
+        self.cont.append (-1)
+        self.player.append (-1)
+
+    def answer2 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (3)
+        self.cont.append (-1)
+        self.player.append (5)
+        self.cont.append (3)
+        if quests["demo"].get_val( "know_alek_eavesdrop" ) == 1:
+
+            self.player.append (11)
+            self.cont.append (6)
+        self.player.append (-1)
diff --git a/scripts/init.py b/scripts/init.py
index d3d9edf..6ecfda4 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -148,6 +148,8 @@ if retval < 5:
         # Creates the context for the game start
         map_engine.load_map ("test.map")
         lm = map_engine.get_landmap ()
+        the_player.set_val ("gender", MALE)
+        the_player.set_val ("race", HALFELF)
         the_player.load ("player.mchar")
         the_player.set_map (lm)
         the_player.jump_to (0, 11, 18, STAND_EAST)
@@ -480,6 +482,16 @@ if retval < 5:
         erek.stand_north ()
         erek.set_schedule ("erek")
 
+        # -- that's a clone for now
+        talan = characters ["Talan Wendth"]
+        talan.set_dialogue ("dialogues/talan_start")
+        talan.load ("servant2.mchar")
+        talan.set_map (map_engine.get_landmap ())
+        talan.jump_to (0, 11, 20)
+        talan.set_action ("action_talk")
+        talan.stand_north ()
+        talan.set_schedule ("talan")
+
         oliver = characters ["Oliver Redwyne"]
         oliver.set_dialogue ("dialogues/oliver_start")
         oliver.load ("oliver.mchar")
diff --git a/scripts/schedules/Makefile.am b/scripts/schedules/Makefile.am
index 7ec83bd..bec143d 100755
--- a/scripts/schedules/Makefile.am
+++ b/scripts/schedules/Makefile.am
@@ -1,6 +1,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
+    sarin.py frostbloom.py silverhair.py oliver.py erek.py talan.py
 
 EXTRA_DIST = $(pkgdata_DATA)
diff --git a/scripts/schedules/talan.py b/scripts/schedules/talan.py
new file mode 100755
index 0000000..8d54f70
--- /dev/null
+++ b/scripts/schedules/talan.py
@@ -0,0 +1,57 @@
+#
+#  (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
+#
+
+# -- Movement schedule for Talan Wendth
+#
+#    He guards the gate
+
+import schedules
+import random
+
+speech = ["Halt! Who goes there?", \
+          "\"Ai! laurie lantar lassi surinen ...\"", \
+          "Nobody may pass through the gate!"]
+
+todo = myself.get_val ("switch_direction")
+
+# -- calculate a new direction
+if todo == 0:
+    # -- the time we stay at one side of the gata
+    delay = random.randint (25, 50) * 20
+
+    # -- walk downwards
+    if myself.posy () == 17:
+        myself.set_val ("switch_direction", -delay)
+
+    # -- walk upwards
+    else:
+        myself.set_val ("switch_direction", delay)
+
+# -- walk downwards
+elif todo < 0:
+    myself.set_val ("switch_direction", todo + 1)
+    if schedules.simple_goto_xy (myself, 11, 20) == 1:
+        myself.stand_north ()
+
+# -- walk upwards
+else:
+    myself.set_val ("switch_direction", todo - 1)
+    if schedules.simple_goto_xy (myself, 11, 17) == 1:
+        myself.stand_south ()
+
+# -- utter a random remark
+tmp = myself.get_val ("say_something")
+myself.set_val ("say_something", tmp - 1)
+if tmp == 0:
+    schedules.speak (myself, speech[random.randint (0, 2)])
+    delay = random.randint (40, 120) * 15
+    myself.set_val ("say_something", delay)



reply via email to

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