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 acd90d5 104/237: ADDED Tris


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 acd90d5 104/237: ADDED Tristan and Fellnir
Date: Mon, 25 Jul 2016 18:15:00 +0000 (UTC)

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

    ADDED Tristan and Fellnir
---
 scripts/dialogues/Makefile.am               |    3 +-
 scripts/dialogues/tristan_start.py          |   88 +++++++++++++++++++++++++++
 scripts/init.py                             |   19 ++++++
 scripts/schedules/mapcharacters/Makefile.am |    2 +-
 scripts/schedules/mapcharacters/fellnir.py  |   70 +++++++++++++++++++++
 scripts/schedules/mapcharacters/tristan.py  |   87 ++++++++++++++++++++++++++
 6 files changed, 267 insertions(+), 2 deletions(-)

diff --git a/scripts/dialogues/Makefile.am b/scripts/dialogues/Makefile.am
index a876398..67a42f8 100755
--- a/scripts/dialogues/Makefile.am
+++ b/scripts/dialogues/Makefile.am
@@ -2,7 +2,8 @@ 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 jelom_start.py
+    frostbloom_start.py talan_start.py alek_start.py jelom_start.py \
+    tristan_start.py
 
 EXTRA_DIST = $(pkgdata_DATA)
 
diff --git a/scripts/dialogues/tristan_start.py 
b/scripts/dialogues/tristan_start.py
new file mode 100644
index 0000000..077615d
--- /dev/null
+++ b/scripts/dialogues/tristan_start.py
@@ -0,0 +1,88 @@
+import adonthell
+
+class tristan_start:
+       loop = []
+       strings = ["Yes?", "Hello, sir. My name is $name, and I am 
investigating the theft of Master Fingolson's gems.", "Oh, well met then, 
$name! I am Tristan Illig, a merchant by trade, and I am currently stuck in 
this trading post until this theft is cleared up. And you are the man who will 
do it?", "Well, good sir, I certainly will try. Now, do you mind if I ask you a 
couple of questions?", "Well, $name, I would like to be of help, but I am 
afraid that I know nothing that will aid you. You [...]
+
+       def set_name (self, new_name):
+               pass
+
+       def set_npc (self, new_npc):
+               pass
+
+       def set_portrait (self, new_portrait):
+               pass
+
+       def __init__(self, p, n):
+               self.the_player = p
+               self.the_npc = n
+
+               self.dialogue = [self.start, self.answer1, self.answer3, 
self.answer5, self.answer8, self.answer10, 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):
+               self.color = self.the_npc.get_color()
+               self.npc.append (0)
+               self.cont.append (-1)
+               self.player.append (1)
+               self.cont.append (1)
+               self.player.append (-1)
+
+       def answer1 (self):
+               self.color = self.the_npc.get_color()
+               self.npc.append (2)
+               self.cont.append (-1)
+               self.player.append (3)
+               self.cont.append (2)
+               self.player.append (-1)
+
+       def answer3 (self):
+               self.color = self.the_npc.get_color()
+               self.npc.append (4)
+               self.cont.append (-1)
+               self.player.append (5)
+               self.cont.append (3)
+               self.player.append (-1)
+
+       def answer5 (self):
+               self.color = self.the_npc.get_color()
+               self.npc.append (6)
+               self.cont.append (-1)
+               self.player.append (7)
+               self.cont.append (-1)
+               self.player.append (8)
+               self.cont.append (4)
+               self.player.append (-1)
+
+       def answer8 (self):
+               self.color = self.the_npc.get_color()
+               self.npc.append (9)
+               self.cont.append (-1)
+               self.player.append (10)
+               self.cont.append (5)
+               self.player.append (-1)
+
+       def answer10 (self):
+               self.color = self.the_npc.get_color()
+               self.npc.append (11)
+               self.cont.append (-1)
+               self.player.append (12)
+               self.cont.append (-1)
+               self.player.append (-1)
+
+       def answer12 (self):
+               pass
+
+       def answer7 (self):
+               pass
diff --git a/scripts/init.py b/scripts/init.py
index 54c8f16..ab4a277 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -885,6 +885,25 @@ class title_screen:
                 janesta.stand_north ()
                 janesta.set_schedule ("janesta")
 
+                fellnir = gamedata_get_character ("Fellnir Kezular")
+                fellnir.set_dialogue ("dialogues/fellnir_start")
+                fellnir.load ("fellnir.mchar")
+                fellnir.set_map (map_engine.get_landmap ())
+                fellnir.jump_to (10, 4, 4)
+                fellnir.set_action ("talk")
+                fellnir.stand_south ()
+                fellnir.set_schedule ("fellnir")
+
+                # -- A clone for now
+                tristan = gamedata_get_character ("Tristan Illig")
+                tristan.set_dialogue ("dialogues/tristan_start")
+                tristan.load ("servant2.mchar")
+                tristan.set_map (map_engine.get_landmap ())
+                tristan.jump_to (1, 4, 6)
+                tristan.set_action ("talk")
+                tristan.stand_west ()
+                tristan.set_schedule ("tristan")
+
                 # Once we want to generate the data context files,
                 # just call gamedata::save (1) and copy the .data files
                 # to the game's root directory.
diff --git a/scripts/schedules/mapcharacters/Makefile.am 
b/scripts/schedules/mapcharacters/Makefile.am
index 60b9eca..c305d5d 100644
--- a/scripts/schedules/mapcharacters/Makefile.am
+++ b/scripts/schedules/mapcharacters/Makefile.am
@@ -2,6 +2,6 @@ pkgdatadir = $(gamedatadir)/scripts/schedules/mapcharacters
 
 pkgdata_DATA = alek.py erek.py frostbloom.py janesta.py jelom.py \
        keyboard_control.py oliver.py orloth.py sarin.py silverhair.py \
-       talan.py
+       talan.py tristan.py fellnir.py
 
 EXTRA_DIST = $(pkgdata_DATA)
diff --git a/scripts/schedules/mapcharacters/fellnir.py 
b/scripts/schedules/mapcharacters/fellnir.py
new file mode 100644
index 0000000..a8c10b4
--- /dev/null
+++ b/scripts/schedules/mapcharacters/fellnir.py
@@ -0,0 +1,70 @@
+#
+#  (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 Fellnir Kezular
+#
+#    He'll busy himself in his room
+
+from adonthell import gamedata_player, STAND_NORTH, STAND_SOUTH, STAND_WEST, 
STAND_EAST
+from random import randint
+
+class fellnir:
+
+    def __init__ (self, mapcharacterinstance):
+        self.myself = mapcharacterinstance
+        self.speech = ["Master Orloth should throw out that brute!", \
+                       "Take equal parts of vitriol, nitre and sal ammoniac 
...", \
+                       "I have to talk with %s." % gamedata_player().get_name 
()]
+
+        self.coords = [(2, 5, STAND_EAST), \
+                       (4, 4, STAND_SOUTH), \
+                       (4, 2, STAND_NORTH), \
+                       (6, 5, STAND_WEST)]
+
+    def run (self):
+        myself = self.myself
+        
+        todo = myself.get_val ("todo")
+
+        # -- 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 ("delay", delay - 1)
+
+        # -- engage a new movement
+        elif todo == 1:
+            x, y, dir = self.coords[randint (0, 3)]
+
+            myself.set_goal (x, y, dir)
+            myself.set_val ("todo", 2)
+
+        # -- moving
+        elif todo == 2:
+            if myself.follow_path () == 1:
+                # -- the time we stay at the same place
+                delay = randint (30, 60) * 25
+
+                myself.set_val ("delay", delay)
+                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:
+            myself.speak (self.speech[randint (0, 2)])
+            delay = randint (20, 40) * 40
+            myself.set_val ("say_something", delay)
diff --git a/scripts/schedules/mapcharacters/tristan.py 
b/scripts/schedules/mapcharacters/tristan.py
new file mode 100644
index 0000000..52cee7f
--- /dev/null
+++ b/scripts/schedules/mapcharacters/tristan.py
@@ -0,0 +1,87 @@
+#
+#  (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 Tristan Illig
+#
+#    Illig will either be in the common room or outside at the gate.
+
+
+from adonthell import STAND_NORTH, STAND_SOUTH, STAND_EAST, STAND_WEST
+import adonthell
+from random import randint
+
+class tristan:
+
+    def __init__ (self, mapcharacterinstance):
+        self.myself = mapcharacterinstance
+
+        self.speech = ["Don't they know that I am losing money by the hour!?", 
\
+                       "What a fuss about a few worthless gems!", \
+                       "Ye gods! It cannot be that hard to find the thief!"]
+
+
+    def run (self):
+        myself = self.myself
+        todo = myself.get_val ("todo")
+
+        # -- 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 ("delay", delay - 1)
+
+        # -- get movement target
+        elif todo == 1:
+            # -- in common room -> go outside
+            if myself.submap () == 1:
+                myself.set_goal (13, 8, STAND_SOUTH)
+
+            # -- outside -> goto common room
+            else:
+                myself.set_goal (18, 13, STAND_NORTH)
+
+            myself.set_val ("todo", 2)
+
+        # -- move
+        elif todo == 2:
+            if myself.follow_path () == 1:
+                # -- reached common room
+                if myself.submap () == 1 and myself.posx () == 13:
+                    myself.set_goal (4, 6, STAND_WEST)
+
+                    delay = randint (75, 150) * 30
+                    myself.set_val ("delay", delay)
+
+                # -- reached yard
+                elif myself.submap () == 0 and myself.posx () == 18:
+                    myself.set_goal (12, 18, STAND_WEST)
+
+                    delay = randint (100, 150) * 30
+                    myself.set_val ("delay", delay)
+
+                # -- reached our final destination
+                else:
+                    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:
+            myself.speak (self.speech[randint (0, 2)])
+            delay = randint (50, 150) * 22
+            myself.set_val ("say_something", delay)



reply via email to

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