adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: wastesedge/scripts/schedules/mapcharacters sche


From: Kai Sterker <address@hidden>
Subject: [Adonthell-commits] CVS: wastesedge/scripts/schedules/mapcharacters schedule.py,NONE,1.1 alek.py,1.2,1.3 bjarn.py,1.3,1.4 erek.py,1.4,1.5 fellnir.py,1.3,1.4 frostbloom.py,1.3,1.4 janesta.py,1.2,1.3 jelom.py,1.2,1.3 lucia.py,1.4,1.5 oliver.py,1.4,1.5 orloth.py,1.3,1.4 sarin.py,1.2,1.3 talan.py,1.2,1.3 tristan.py,1.3,1.4
Date: Sat, 10 Aug 2002 08:20:50 -0400

Update of /cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters
In directory subversions:/tmp/cvs-serv5742

Modified Files:
        alek.py bjarn.py erek.py fellnir.py frostbloom.py janesta.py 
        jelom.py lucia.py oliver.py orloth.py sarin.py talan.py 
        tristan.py 
Added Files:
        schedule.py 
Log Message:
MADE character speech event-driven


--- NEW FILE ---
#
#  (C) Copyright 2002 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
#

# -- various low level schedule base classes

import adonthell
import random
import types

# -- let NPC utter random remarks
#    requires the NPC schedule to have the members 
#
#    speech, an array of remarks for the NPC, and 
#    speech_delay, a tuple with the minimum and maximum delay 
#        between two remarks
#
#    The derived schedule needs to call speak.__init__ (self) after
#    setting the above values.
class speak:
    def __init__ (self):
        # -- sanity checks
        if type (self.speech) != types.ListType:
            print "*** speak::__init__: 'speech' list not found!"
        if type (self.speech_delay) != types.TupleType:
            print "*** speak::__init__: 'speech_delay' tuple not found!"
        if len (self.speech_delay) != 2:
            print "*** speak::__init__: 'speech_delay' has wrong size!"
            
        # -- member initialization
        self.speech_length = len (self.speech)
        
        # -- register first speech
        delay = "%it" % random.randrange (self.speech_delay[0], 
self.speech_delay[1])
        self.speak_event = adonthell.time_event (delay)
        self.speak_event.set_callback (self.speak)
        adonthell.event_handler_register_event (self.speak_event)

        
    # -- make remark and set delay for the next one
    def speak (self):
        self.myself.speak (self.speech[random.randrange (0, 
self.speech_length)])

        delay = "%it" % random.randrange (self.speech_delay[0], 
self.speech_delay[1])
        self.speak_event = adonthell.time_event (delay)
        self.speak_event.set_callback (self.speak)
        adonthell.event_handler_register_event (self.speak_event)

Index: alek.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/alek.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** alek.py     6 May 2002 13:47:18 -0000       1.2
--- alek.py     10 Aug 2002 12:20:46 -0000      1.3
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 16,32 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! class alek:
      
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
          self.speech = [_("More Ale!"), \
                         _("I'll cut 'em open like ripe fruits."), \
                         _("They should sort out this business like real men!")]
! 
      def run (self):
          myself = self.myself
--- 16,36 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class alek (schedule.speak):
      
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
+         # -- make random remarks
          self.speech = [_("More Ale!"), \
                         _("I'll cut 'em open like ripe fruits."), \
                         _("They should sort out this business like real men!")]
!         self.speech_delay = (20, 40)
!         schedule.speak.__init__(self)
!         
      def run (self):
          myself = self.myself
***************
*** 62,72 ****
                  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[random.randrange (0, 3)])
-             delay = random.randrange (40, 80) * 25
-             myself.set_val ("say_something", delay)
--- 66,67 ----

Index: bjarn.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/bjarn.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** bjarn.py    6 May 2002 13:47:18 -0000       1.3
--- bjarn.py    10 Aug 2002 12:20:46 -0000      1.4
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 16,31 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! class bjarn:
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          self.speech = [_("Ha! A tradesman is an honourable person, they 
say!"), \
                         _("Why don't they just take that Silverhair woman to 
prison!?"), \
                         _("Elves! The head in the sky and the mind full of 
clouds!")]
! 
          self.coords = [(7, 5, adonthell.STAND_WEST), \
                         (2, 4, adonthell.STAND_SOUTH), \
--- 16,36 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class bjarn (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
+         
+         # -- make random remarks
          self.speech = [_("Ha! A tradesman is an honourable person, they 
say!"), \
                         _("Why don't they just take that Silverhair woman to 
prison!?"), \
                         _("Elves! The head in the sky and the mind full of 
clouds!")]
!         self.speech_delay = (20, 40)
!         schedule.speak.__init__(self)
!         
          self.coords = [(7, 5, adonthell.STAND_WEST), \
                         (2, 4, adonthell.STAND_SOUTH), \
***************
*** 71,81 ****
                  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[random.randint (0, 2)])
-             delay = random.randint (20, 40) * 40
-             myself.set_val ("say_something", delay)
--- 76,77 ----

Index: erek.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/erek.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** erek.py     6 May 2002 13:47:18 -0000       1.4
--- erek.py     10 Aug 2002 12:20:46 -0000      1.5
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 17,33 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! class erek:
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
  
          self.speech = [_("How could they do that to the Master?"), \
                    _("This place is so much different from home."), \
                    _("Who could have taken the gems?")]
! 
          # -- the coordinates for normal schedule
          self.coords = \
--- 17,37 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class erek (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
  
+         # -- make random remarks
          self.speech = [_("How could they do that to the Master?"), \
                    _("This place is so much different from home."), \
                    _("Who could have taken the gems?")]
!         self.speech_delay = (20, 40)
!         schedule.speak.__init__(self)
!         
          # -- the coordinates for normal schedule
          self.coords = \
***************
*** 149,160 ****
                  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[random.randrange (0, 2)])
-             delay = random.randrange (60, 180) * 15
-             myself.set_val ("say_something", delay)
--- 153,154 ----

Index: fellnir.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/fellnir.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** fellnir.py  6 May 2002 13:47:18 -0000       1.3
--- fellnir.py  10 Aug 2002 12:20:46 -0000      1.4
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 16,29 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! 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 
...")]
  
          self.coords = [(2, 5, adonthell.STAND_EAST), \
--- 16,34 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class fellnir (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
+         
+         # -- make random remarks
          self.speech = [_("Master Orloth should throw out that brute!"), \
                         _("Take equal parts of vitriol, nitre and sal ammoniac 
...")]
+         self.speech_delay = (20, 40)
+         schedule.speak.__init__(self)
  
          self.coords = [(2, 5, adonthell.STAND_EAST), \
***************
*** 61,71 ****
                  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[random.randrange (0, 2)])
-             delay = random.randrange (20, 40) * 40
-             myself.set_val ("say_something", delay)
--- 66,67 ----

Index: frostbloom.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/frostbloom.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** frostbloom.py       6 May 2002 13:47:18 -0000       1.3
--- frostbloom.py       10 Aug 2002 12:20:46 -0000      1.4
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 16,24 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! class frostbloom:
      
      def __init__ (self, mapcharacterinstance):
--- 16,25 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class frostbloom (schedule.speak):
      
      def __init__ (self, mapcharacterinstance):
***************
*** 31,38 ****
          self.max_y = 29
  
          self.speech = [_("This tree is so inspiring."), \
                    _("I wonder why everybody seems so excited."), \
                    _("Do you know a creature more lovely than the yeti?")]
! 
      def run (self):
          myself = self.myself
--- 32,42 ----
          self.max_y = 29
  
+         # -- make random remarks
          self.speech = [_("This tree is so inspiring."), \
                    _("I wonder why everybody seems so excited."), \
                    _("Do you know a creature more lovely than the yeti?")]
!         self.speech_delay = (20, 55)
!         schedule.speak.__init__(self)
!         
      def run (self):
          myself = self.myself
***************
*** 66,76 ****
              if myself.follow_path () == 1:
                  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[random.randrange (0, 3)])
-             delay = random.randrange (50, 150) * 20
-             myself.set_val ("say_something", delay)
--- 70,71 ----

Index: janesta.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/janesta.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** janesta.py  6 May 2002 13:47:18 -0000       1.2
--- janesta.py  10 Aug 2002 12:20:46 -0000      1.3
***************
*** 16,31 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! class janesta:
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          self.speech = [_("Oh, dear. Oh, dear."), \
                         _("What will happen to us if they take the 
Mistress?"), \
                         _("I must do something about this awful room."), \
                         _("Oh, how do they expect us to live decently in a 
place like this?")]
  
          self.coords = [(1, 3, adonthell.STAND_NORTH), \
--- 16,36 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class janesta (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
+         
+         # -- make random remarks
          self.speech = [_("Oh, dear. Oh, dear."), \
                         _("What will happen to us if they take the 
Mistress?"), \
                         _("I must do something about this awful room."), \
                         _("Oh, how do they expect us to live decently in a 
place like this?")]
+         self.speech_delay = (25, 45)
+         schedule.speak.__init__(self)
  
          self.coords = [(1, 3, adonthell.STAND_NORTH), \
***************
*** 63,73 ****
                  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[random.randrange (0, 4)])
-             delay = random.randrange (50, 75) * 35
-             myself.set_val ("say_something", delay)
--- 68,69 ----

Index: jelom.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/jelom.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** jelom.py    6 May 2002 13:47:18 -0000       1.2
--- jelom.py    10 Aug 2002 12:20:46 -0000      1.3
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 16,19 ****
--- 16,20 ----
  
  import adonthell
+ import schedule
  import random
  
***************
*** 21,33 ****
  def _(message): return message
  
! class jelom:
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
          self.speech = [_("Someone fetch me a drink!"), \
                         _("That'll teach them fancy Elves a lesson!"), \
                         _("Send them to the cursed island, I say!")]
! 
      def run (self):
          myself = self.myself
--- 22,37 ----
  def _(message): return message
  
! class jelom (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
+         # -- make random remarks
          self.speech = [_("Someone fetch me a drink!"), \
                         _("That'll teach them fancy Elves a lesson!"), \
                         _("Send them to the cursed island, I say!")]
!         self.speech_delay = (30, 60)
!         schedule.speak.__init__(self)
!         
      def run (self):
          myself = self.myself
***************
*** 62,72 ****
                  myself.set_val ("delay", random.randrange (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:
-             myself.speak (self.speech[random.randrange (0, 3)])
-             delay = random.randrange (75, 150) * 20
-             myself.set_val ("say_something", delay)
--- 66,67 ----

Index: lucia.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/lucia.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** lucia.py    6 May 2002 13:47:18 -0000       1.4
--- lucia.py    10 Aug 2002 12:20:46 -0000      1.5
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Alexandre Courbot <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Alexandre Courbot <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 17,33 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! class lucia:
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
          self.speech = [_("When can I finally rest a bit?"), \
                         _("I told Orloth this place would bring us nothing but 
trouble!"), \
                         _("This smoke! I'm dying!")]
! 
          self.coords = [(3, 3, adonthell.STAND_NORTH), \
                    (6, 3, adonthell.STAND_EAST)]
--- 17,37 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class lucia (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
+         # -- make random remarks
          self.speech = [_("When can I finally rest a bit?"), \
                         _("I told Orloth this place would bring us nothing but 
trouble!"), \
                         _("This smoke! I'm dying!")]
!         self.speech_delay = (20, 40)
!         schedule.speak.__init__(self)
!         
          self.coords = [(3, 3, adonthell.STAND_NORTH), \
                    (6, 3, adonthell.STAND_EAST)]
***************
*** 72,83 ****
                                      
                  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[random.randrange (0, 3)])
-             delay = random.randrange (50, 100) * 20
-             myself.set_val ("say_something", delay)
--- 76,77 ----

Index: oliver.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/oliver.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** oliver.py   6 May 2002 13:47:18 -0000       1.4
--- oliver.py   10 Aug 2002 12:20:46 -0000      1.5
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 17,32 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! class oliver:
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
          self.speech = [_("It's so exciting. An Elven Lady, here at Waste's 
Edge!"), \
                    _("I gotta hurry before mother complains again."), \
                    _("Why can't I have a little dog!?")]
! 
          # -- the tiles around Orloth
          self.offsets = [(1,1),(1,-1),(-1,1),(-1,-1),(1,0),(0,1),(-1,0),(0,-1)]
--- 17,36 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class oliver (schedule.speak):
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
+         # -- make random remarks
          self.speech = [_("It's so exciting. An Elven Lady, here at Waste's 
Edge!"), \
                    _("I gotta hurry before mother complains again."), \
                    _("Why can't I have a little dog!?")]
!         self.speech_delay = (20, 40)
!         schedule.speak.__init__(self)
!         
          # -- the tiles around Orloth
          self.offsets = [(1,1),(1,-1),(-1,1),(-1,-1),(1,0),(0,1),(-1,0),(0,-1)]
***************
*** 112,123 ****
              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:
-             myself.speak (self.speech[random.randrange (0, 3)])
-             delay = random.randrange (80, 160) * 10
-             myself.set_val ("say_something", delay)
--- 116,117 ----

Index: orloth.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/orloth.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** orloth.py   6 May 2002 13:47:18 -0000       1.3
--- orloth.py   10 Aug 2002 12:20:46 -0000      1.4
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 17,32 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! class orloth:
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
          self.speech = [_("I gotta clean this mug!"), \
                    _("That barrel is leaking."), \
                    _("I hope they'll find the thief!")]
  
          self.coords = [(10, 3, adonthell.STAND_NORTH), \
--- 17,36 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class orloth (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
+         # -- make random remarks
          self.speech = [_("I gotta clean this mug!"), \
                    _("That barrel is leaking."), \
                    _("I hope they'll find the thief!")]
+         self.speech_delay = (25, 60)
+         schedule.speak.__init__(self)
  
          self.coords = [(10, 3, adonthell.STAND_NORTH), \
***************
*** 93,105 ****
  
                  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[random.randrange (0, 3)])
-             delay = random.randrange (50, 150) * 20
-             myself.set_val ("say_something", delay)
  
  
--- 97,100 ----

Index: sarin.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/sarin.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** sarin.py    6 May 2002 13:47:18 -0000       1.2
--- sarin.py    10 Aug 2002 12:20:46 -0000      1.3
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 18,26 ****
  from adonthell import WALK_NORTH, WALK_SOUTH, WALK_EAST, WALK_WEST, \
       STAND_NORTH, STAND_SOUTH, STAND_WEST, STAND_EAST
  import random
  
  def _(message): return message
  
! class sarin:
      
      def __init__ (self, mapcharacterinstance):
--- 18,27 ----
  from adonthell import WALK_NORTH, WALK_SOUTH, WALK_EAST, WALK_WEST, \
       STAND_NORTH, STAND_SOUTH, STAND_WEST, STAND_EAST
+ import schedule 
  import random
  
  def _(message): return message
  
! class sarin (schedule.speak):
      
      def __init__ (self, mapcharacterinstance):
***************
*** 33,41 ****
          self.max_y = 6
  
          self.speech = [_("Ruffinans, the lot of them!"), \
                         _("How dare they imprison one better than they?"), \
                         _("This is an insult to all of the High Born."), \
                         _("I cannot believe such disrespect. Barbarians!")]
! 
      def run (self):
          myself = self.myself
--- 34,45 ----
          self.max_y = 6
  
+         # -- make random remarks
          self.speech = [_("Ruffinans, the lot of them!"), \
                         _("How dare they imprison one better than they?"), \
                         _("This is an insult to all of the High Born."), \
                         _("I cannot believe such disrespect. Barbarians!")]
!         self.speech_delay = (20, 40)
!         schedule.speak.__init__(self)
!         
      def run (self):
          myself = self.myself
***************
*** 110,120 ****
  
                  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[random.randrange (0, 4)])
-             delay = random.randrange (50, 150) * 15
-             myself.set_val ("say_something", delay)
--- 114,115 ----

Index: talan.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/talan.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** talan.py    6 May 2002 13:47:18 -0000       1.2
--- talan.py    10 Aug 2002 12:20:46 -0000      1.3
***************
*** 1,4 ****
  #
! #  (C) Copyright 2001 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
--- 1,4 ----
  #
! #  (C) Copyright 2001/2002 Kai Sterker <address@hidden>
  #  Part of the Adonthell Project http://adonthell.linuxgames.com
  #
***************
*** 17,31 ****
  import adonthell
  import random
  
  def _(message): return message
  
! class talan:
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
          self.speech = [_("Halt! Who goes there?"), \
                         "\"Ai! laurie lantar lassi surinen ...\"", \
                         _("Nobody may pass through the gate!")]
  
      def run (self):
--- 17,35 ----
  import adonthell
  import random
+ import schedule
  
  def _(message): return message
  
! class talan (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
          
+         # -- make random remarks
          self.speech = [_("Halt! Who goes there?"), \
                         "\"Ai! laurie lantar lassi surinen ...\"", \
                         _("Nobody may pass through the gate!")]
+         self.speech_delay = (30, 60)
+         schedule.speak.__init__(self)
  
      def run (self):
***************
*** 61,70 ****
                  myself.set_val ("delay", random.randrange (25, 50) * 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:
-             myself.speak (self.speech[random.randrange (0, 3)])
-             delay = random.randrange (50, 150) * 20
-             myself.set_val ("say_something", delay)
--- 65,66 ----

Index: tristan.py
===================================================================
RCS file: 
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/tristan.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** tristan.py  6 May 2002 13:47:18 -0000       1.3
--- tristan.py  10 Aug 2002 12:20:46 -0000      1.4
***************
*** 17,33 ****
  
  import adonthell
  import random
  
  def _(message): return message
  
! 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):
--- 17,36 ----
  
  import adonthell
+ import schedule
  import random
  
  def _(message): return message
  
! class tristan (schedule.speak):
  
      def __init__ (self, mapcharacterinstance):
          self.myself = mapcharacterinstance
  
+         # -- make random remarks
          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!")]
!         self.speech_delay = (20, 55)
!         schedule.speak.__init__(self)
  
      def run (self):
***************
*** 75,86 ****
                  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[random.randint (0, 2)])
-             delay = random.randint (50, 150) * 22
-             myself.set_val ("say_something", delay)
--- 78,79 ----





reply via email to

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