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 0933dbf 063/237: How could


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 0933dbf 063/237: How could I forget them ... ? ; )
Date: Mon, 25 Jul 2016 18:14:57 +0000 (UTC)

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

    How could I forget them ... ? ;)
---
 scripts/dialogues/jelom_start.py |  283 ++++++++++++++++++++++++++++++++++++++
 scripts/schedules/jelom.py       |   58 ++++++++
 2 files changed, 341 insertions(+)

diff --git a/scripts/dialogues/jelom_start.py b/scripts/dialogues/jelom_start.py
new file mode 100644
index 0000000..9b8ba45
--- /dev/null
+++ b/scripts/dialogues/jelom_start.py
@@ -0,0 +1,283 @@
+class jelom_start:
+    loop = []
+    strings = ["Halt there! No-one is allowed into the prisoner's room!", 
"Stop right there, half-elf! You know that you are not allowed in there!", 
"No-one is allowed into the prisoner's room, so please leave this hallway!", 
"You again, half-elf? What do you want this time?", "Ah, you must be Jelom. 
Talan told me that I could find you here.", "And just who are you to prevent me 
from entering, sir?", "Nice to see you again, Jelom. Look, I have some more 
questions for you.", "Look, Jelom, [...]
+
+    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.answer4, self.answer5, self.answer6, 
self.answer7, self.answer10, self.answer13, self.answer15, self.answer17, 
self.answer19, self.answer21, self.answer23, self.answer24, self.answer27, 
self.answer29, self.answer31, self.answer32, self.answer34, self.answer36, 
self.answer38, self.answer40, None]
+
+    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_player.get_val ("at_silverhairs_door") == 1 and 
quests["demo"].get_val ("know_jelom") != 2:
+        
+
+            self.color = the_npc.get_color()
+            self.npc.append (0)
+            self.cont.append (-1)
+            if quests["demo"].get_val( "know_jelom" ) == 1:
+
+                self.player.append (4)
+                self.cont.append (1)
+            else:
+
+                self.player.append (5)
+                self.cont.append (2)
+            self.player.append (-1)
+        elif the_player.get_val( "at_silverhairs_door" ) == 1:
+
+            self.color = the_npc.get_color()
+            self.npc.append (1)
+            self.cont.append (-1)
+            if quests["demo"].get_val ("know_talan_singing") != 2:
+
+                self.player.append (6)
+                self.cont.append (3)
+            elif quests["demo"].get_val ("know_talan_singing") == 2:
+
+                self.player.append (7)
+                self.cont.append (4)
+            self.player.append (-1)
+        elif the_player.get_val ("at_silverhairs_door") != 1 and 
quests["demo"].get_val ("know_jelom") != 2:
+
+            self.color = the_npc.get_color()
+            self.npc.append (2)
+            self.cont.append (-1)
+            if quests["demo"].get_val( "know_jelom" ) == 1:
+
+                self.player.append (4)
+                self.cont.append (1)
+            else:
+
+                self.player.append (5)
+                self.cont.append (2)
+            self.player.append (-1)
+        else:
+        
+
+            self.color = the_npc.get_color()
+            self.npc.append (3)
+            self.cont.append (-1)
+            if quests["demo"].get_val ("know_talan_singing") != 2:
+
+                self.player.append (6)
+                self.cont.append (3)
+            elif quests["demo"].get_val ("know_talan_singing") == 2:
+
+                self.player.append (7)
+                self.cont.append (4)
+            self.player.append (-1)
+
+    def answer7 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (12)
+        self.cont.append (-1)
+        self.player.append (13)
+        self.cont.append (6)
+        self.player.append (-1)
+
+    def answer13 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (14)
+        self.cont.append (-1)
+        self.player.append (15)
+        self.cont.append (7)
+        self.player.append (-1)
+
+    def answer15 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (16)
+        self.cont.append (-1)
+        self.player.append (17)
+        self.cont.append (8)
+        self.player.append (-1)
+
+    def answer17 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (18)
+        self.cont.append (-1)
+        self.player.append (19)
+        self.cont.append (9)
+        self.player.append (-1)
+
+    def answer19 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (20)
+        self.cont.append (-1)
+        self.player.append (21)
+        self.cont.append (10)
+        self.player.append (-1)
+
+    def answer21 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (22)
+        self.cont.append (-1)
+        self.player.append (23)
+        self.cont.append (11)
+        self.player.append (24)
+        self.cont.append (12)
+        self.player.append (-1)
+
+    def answer24 (self):
+        quests["demo"].set_val( "told_on_talan", 1 );
+
+        self.color = the_npc.get_color()
+        self.npc.append (26)
+        self.cont.append (-1)
+        self.player.append (27)
+        self.cont.append (13)
+        self.player.append (-1)
+
+    def answer27 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (28)
+        self.cont.append (-1)
+        self.player.append (29)
+        self.cont.append (14)
+        self.player.append (-1)
+
+    def answer29 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (30)
+        self.cont.append (-1)
+        quests["demo"].set_val( "silverhair_free", 1 );
+
+        self.player.append (-1)
+
+    def answer23 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (25)
+        self.cont.append (-1)
+        self.player.append (27)
+        self.cont.append (13)
+        self.player.append (-1)
+
+    def answer6 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (11)
+        self.cont.append (-1)
+        if quests["demo"].get_val ("know_alek_eavesdrop") == 1 and 
quests["demo"].get_val ("know_talan_singing") != 2:
+
+            self.player.append (32)
+            self.cont.append (16)
+        if quests["demo"].get_val ("ask_packed_gems") == 1 and 
quests["demo"].get_val ("know_talan_singing") != 2:
+
+            self.player.append (31)
+            self.cont.append (15)
+        elif quests["demo"].get_val ("know_talan_singing") == 2:
+
+            self.player.append (7)
+            self.cont.append (4)
+        else:
+
+            self.player.append (38)
+            self.cont.append (19)
+        self.player.append (-1)
+
+    def answer38 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (39)
+        self.cont.append (-1)
+        self.player.append (40)
+        self.cont.append (20)
+        self.player.append (-1)
+
+    def answer40 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (37)
+        self.cont.append (-1)
+        quests["demo"].set_val ("know_jelom" , 2)
+
+        self.player.append (-1)
+
+    def answer31 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (33)
+        self.cont.append (-1)
+        self.player.append (34)
+        self.cont.append (17)
+        self.player.append (-1)
+
+    def answer34 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (35)
+        self.cont.append (-1)
+        self.player.append (36)
+        self.cont.append (18)
+        self.player.append (-1)
+
+    def answer36 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (37)
+        self.cont.append (-1)
+        quests["demo"].set_val ("know_jelom" , 2)
+
+        self.player.append (-1)
+
+    def answer32 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (35)
+        self.cont.append (-1)
+        self.player.append (36)
+        self.cont.append (18)
+        self.player.append (-1)
+
+    def answer5 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (8)
+        self.cont.append (-1)
+        self.player.append (10)
+        self.cont.append (5)
+        self.player.append (-1)
+
+    def answer10 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (11)
+        self.cont.append (-1)
+        if quests["demo"].get_val ("know_alek_eavesdrop") == 1 and 
quests["demo"].get_val ("know_talan_singing") != 2:
+
+            self.player.append (32)
+            self.cont.append (16)
+        if quests["demo"].get_val ("ask_packed_gems") == 1 and 
quests["demo"].get_val ("know_talan_singing") != 2:
+
+            self.player.append (31)
+            self.cont.append (15)
+        elif quests["demo"].get_val ("know_talan_singing") == 2:
+
+            self.player.append (7)
+            self.cont.append (4)
+        else:
+
+            self.player.append (38)
+            self.cont.append (19)
+        self.player.append (-1)
+
+    def answer4 (self):
+        self.color = the_npc.get_color()
+        self.npc.append (9)
+        self.cont.append (-1)
+        self.player.append (10)
+        self.cont.append (5)
+        self.player.append (-1)
diff --git a/scripts/schedules/jelom.py b/scripts/schedules/jelom.py
new file mode 100644
index 0000000..715ce7a
--- /dev/null
+++ b/scripts/schedules/jelom.py
@@ -0,0 +1,58 @@
+#
+#  (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 Jelom Rasgar
+#
+#    He guards the door to Lady Silverhair's room
+
+speech = ["Someone fetch me a drink!", \
+          "That'll teach them fancy Elves a lesson!", \
+          "Send them to the cursed island, I say!"]
+
+todo = myself.get_val ("todo")
+
+# If standing
+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 ("delay", delay - 1)
+
+# Engage a new movement
+elif todo == 1:
+    # Choose where to move, if destination is already occupied we'll
+    # fall into the wait state (0) again automatically next time
+    if myself.posy () == 3:
+        myself.set_goal (2, 6, STAND_NORTH)
+    else:
+        myself.set_goal (2, 3, STAND_SOUTH)
+        
+    # Next time we'll actually move!
+    myself.set_val ("todo", 2)
+
+# Moving, follow the path until it is reached.
+elif todo == 2:
+    # Reached the goal? Wait a while then...
+    if myself.follow_path ():
+        myself.set_val ("delay", randint (30, 60) * 20)
+        myself.set_val ("todo", 0)
+
+
+# -- utter a random remark
+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 (75, 150) * 20
+    myself.set_val ("say_something", delay)



reply via email to

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