[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Adonthell-commits] CVS: wastesedge/scripts/schedules/mapcharacters bjar
From: |
Kai Sterker <address@hidden> |
Subject: |
[Adonthell-commits] CVS: wastesedge/scripts/schedules/mapcharacters bjarn.py,1.5,1.6 erek.py,1.6,1.7 jelom.py,1.6,1.7 silverhair.py,1.6,1.7 to_cellar.py,1.4,1.5 |
Date: |
Wed, 21 Aug 2002 11:34:52 -0400 |
Update of /cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters
In directory subversions:/tmp/cvs-serv25088/scripts/schedules/mapcharacters
Modified Files:
bjarn.py erek.py jelom.py silverhair.py to_cellar.py
Log Message:
UPDATED the last few schedules for the new event system
ADDED file with player text for i18n
FIXED a few bugs caused by the schedule rewrite (hope I got all!)
Index: bjarn.py
===================================================================
RCS file:
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/bjarn.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** bjarn.py 10 Aug 2002 22:03:15 -0000 1.5
--- bjarn.py 21 Aug 2002 15:34:50 -0000 1.6
***************
*** 38,77 ****
(3, 6, adonthell.STAND_WEST)]
! def run_old (self):
! myself = self.myself
! # -- Get at the proper place when Erek lets the player into the room
! # and at the end of the game.
! if adonthell.gamedata_get_quest ("demo").get_val("the_end") == 1 or \
! adonthell.gamedata_get_quest ("demo").get_val("bjarn_door_open")
== 2:
! myself.jump_to (myself.submap (), 3, 6)
! myself.stand_west ()
! myself.set_val ("delay", 150)
! return
!
! 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[random.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 = random.randint (30, 60) * 25
!
! myself.set_val ("delay", delay)
! myself.set_val ("todo", 0)
--- 38,58 ----
(3, 6, adonthell.STAND_WEST)]
! self.myself.set_callback (self.goal_reached)
! # -- Get at the proper place when Erek lets the player into the room
! # and at the end of the game.
! def await_player (self):
! self.myself.jump_to (self.myself.submap (), 3, 6)
! self.myself.stand_west ()
!
! def start_talking (self):
! self.myself.launch_action (adonthell.gamedata_player ())
! adonthell.gamedata_get_character ("Erek Stonebreaker").pause ()
!
! def walk (self):
! x, y, dir = self.coords[random.randint (0, 3)]
! self.myself.set_goal (x, y, dir)
!
! def goal_reached (self):
! delay = "%it" % random.randrange (15, 30)
! self.myself.time_callback (delay, self.walk)
Index: erek.py
===================================================================
RCS file:
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/erek.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** erek.py 10 Aug 2002 22:03:15 -0000 1.6
--- erek.py 21 Aug 2002 15:34:50 -0000 1.7
***************
*** 54,154 ****
self.index = 0
!
! def run_old (self):
! myself = self.myself
! # -- lead the player into bjarn's room
! if adonthell.gamedata_get_quest ("demo").get_val ("bjarn_door_open")
== 2:
! myself.set_schedule_active (0)
! # -- start Bjanr's conversation with the player and Erek
! fingolson = adonthell.gamedata_get_character ("Bjarn Fingolson")
! fingolson.launch_action (adonthell.gamedata_player ())
!
! # -- help the player with jelom
! elif adonthell.gamedata_get_quest ("demo").get_val ("convince_jelom")
== 2:
! myself.set_schedule_active (0)
! # -- start Jelom's conversation with the player and Erek
! jelom = adonthell.gamedata_get_character ("Jelom Rasgar")
! jelom.launch_action (adonthell.gamedata_player ())
!
! # -- leave Bjarn's room
! elif myself.get_val ("leave_bjarn") == 1:
! goto = myself.get_val ("goto")
! myself.set_val ("delay", 0)
!
! # -- goto first floor
! if goto == 9: coords = self.to_1st
! # -- goto common room
! else: coords = self.to_common
!
! if self.index < len (coords):
! myself.set_val ("leave_bjarn", 2)
! x, y, dir = coords[self.index]
! myself.set_goal (x, y, dir)
!
! # -- arrived
! else:
! myself.set_val ("leave_bjarn", 0)
! if myself.submap () == 1:
! x, y, dir = self.coords[random.randrange (0, 2)]
! myself.set_goal (x, y, dir)
! else:
! myself.set_schedule_active (0)
!
! myself.set_val ("todo", 2)
!
!
! # -- "normal" schedule
! 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:
! # -- on our way back from bjarn's room
! if myself.get_val ("leave_bjarn") == 2:
! myself.set_val ("leave_bjarn", 1)
! self.index = self.index + 1
!
! # -- switch places
else:
! # -- in common room -> goto parlour
! if myself.submap () == 1:
! myself.set_goal (14, 4, adonthell.STAND_EAST)
!
! # -- in parlour -> goto common room
! else:
! myself.set_goal (0, 4, adonthell.STAND_WEST)
!
! 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:
! x, y, dir = self.coords[random.randrange (0, 2)]
! myself.set_goal (x, y, dir)
!
! delay = random.randrange (50, 150) * 20
! myself.set_val ("delay", delay)
!
! # -- reached parlour
! elif myself.submap () == 2 and myself.posx () == 1:
! x, y, dir = self.coords[random.randrange (2, 4)]
! myself.set_goal (x, y, dir)
!
! delay = random.randrange (60, 180) * 30
! myself.set_val ("delay", delay)
!
! # -- reached our final destination
! else:
! myself.set_val ("todo", 0)
--- 54,118 ----
self.index = 0
! self.walk_delay = "45t"
! if self.myself.get_val ("goto") != 0:
! self.myself.set_callback (self.leave_cellar)
! else:
! self.myself.set_callback (self.goal_reached)
!
! def walk (self):
! # -- in common room -> goto parlour
! if self.myself.submap () == 1:
! self.myself.set_goal (14, 4, adonthell.STAND_EAST)
! self.walk_delay = "%it" % random.randrange (36, 108)
!
! # -- in parlour -> goto common room
! else:
! self.myself.set_goal (0, 4, adonthell.STAND_WEST)
! self.walk_delay = "%it" % random.randrange (20, 60)
!
! def goal_reached (self):
! # -- reached common room
! if self.myself.submap () == 1 and self.myself.posx () == 13:
! x, y, dir = self.coords[random.randrange (0, 2)]
! self.myself.set_goal (x, y, dir)
! # -- reached parlour
! elif self.myself.submap () == 2 and self.myself.posx () == 1:
! x, y, dir = self.coords[random.randrange (2, 4)]
! self.myself.set_goal (x, y, dir)
! # -- reached our final destination
! else:
! self.myself.time_callback (self.walk_delay, self.walk)
!
! # -- leave Bjarn's room
! def leave_bjarn (self):
! # -- set alternative schedule
! self.myself.set_callback (self.leave_cellar)
!
! x, y, dir = self.to_common[self.index]
! self.myself.set_goal (x, y, dir)
!
! def leave_cellar (self):
! self.index = self.index + 1
! goto = self.myself.get_val ("goto")
!
! # -- goto first floor
! if goto == 9: coords = self.to_1st
! # -- goto common room
! else: coords = self.to_common
!
! if self.index < len (coords):
! x, y, dir = coords[self.index]
! self.myself.set_goal (x, y, dir)
!
! # -- arrived
! else:
! # -- restore normal schedule
! self.myself.set_callback (self.goal_reached)
! self.myself.set_val ("goto", 0)
!
! if self.myself.submap () == 1:
! x, y, dir = self.coords[random.randrange (0, 2)]
! self.myself.set_goal (x, y, dir)
else:
! self.myself.pause ()
Index: jelom.py
===================================================================
RCS file:
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/jelom.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** jelom.py 19 Aug 2002 19:59:06 -0000 1.6
--- jelom.py 21 Aug 2002 15:34:50 -0000 1.7
***************
*** 45,46 ****
--- 45,51 ----
delay = "%it" % random.randrange (20, 65)
self.myself.time_callback (delay, self.walk)
+
+ def start_talking (self):
+ self.myself.launch_action (adonthell.gamedata_player ())
+ adonthell.gamedata_get_character ("Erek Stonebreaker").pause ()
+
Index: silverhair.py
===================================================================
RCS file:
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/silverhair.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** silverhair.py 19 Aug 2002 19:59:06 -0000 1.6
--- silverhair.py 21 Aug 2002 15:34:50 -0000 1.7
***************
*** 40,49 ****
if self.myself.posx () == 4:
# ... and speak about the weather
! self.delay = "%it" % random.randrange (15, 22)
self.myself.set_goal (6, 4, adonthell.STAND_EAST)
# -- go back to our normal position
else:
! self.delay = "%it" % random.randrange (70, 140)
if self.myself.set_goal (4, 4, adonthell.STAND_SOUTH) == 0:
self.myself.go_north ()
--- 40,49 ----
if self.myself.posx () == 4:
# ... and speak about the weather
! self.myself.set_val ("delay", random.randrange (15, 22))
self.myself.set_goal (6, 4, adonthell.STAND_EAST)
# -- go back to our normal position
else:
! self.myself.set_val ("delay", random.randrange (15, 22))
if self.myself.set_goal (4, 4, adonthell.STAND_SOUTH) == 0:
self.myself.go_north ()
***************
*** 54,56 ****
self.myself.speak (self.speech[3])
! self.myself.time_callback (self.delay, self.walk)
--- 54,57 ----
self.myself.speak (self.speech[3])
! delay = "%it" % self.myself.get_val ("delay")
! self.myself.time_callback (delay, self.walk)
Index: to_cellar.py
===================================================================
RCS file:
/cvsroot/adonthell/wastesedge/scripts/schedules/mapcharacters/to_cellar.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** to_cellar.py 6 May 2002 13:47:18 -0000 1.4
--- to_cellar.py 21 Aug 2002 15:34:50 -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
#
***************
*** 41,48 ****
(5, 1, adonthell.STAND_NORTH)]
! self.myself.set_val ("todo", 0)
! def run (self):
myself = self.myself
todo = myself.get_val ("todo")
--- 41,87 ----
(5, 1, adonthell.STAND_NORTH)]
! self.myself.set_callback (self.walk)
! def walk (self):
! x, y, dir = self.exits[self.myself.submap ()]
!
! # -- in Bjarn's room
! if x == -1:
! self.myself.set_callback (self.goal_reached)
!
! submap = self.myself.mymap ().get_submap (self.myself.submap ())
! x = random.randint (1, 4)
! y = random.randint (5, 9)
!
! while not submap.get_square (x, y).is_free () or (y == 5 and x >
2):
! x = random.randint (1, 4)
! y = random.randint (5, 9)
!
! # -- calculate direction
! # -- north-western area
! if x + y < 10:
! if x + 3 > y: dir = adonthell.STAND_SOUTH
! else: dir = adonthell.STAND_EAST
! # -- south-east corner
! else:
! if y - (x + 3) > 0: dir = adonthell.STAND_NORTH
! else: dir = adonthell.STAND_WEST
!
! self.myself.set_goal (x, y, dir)
!
! # -- reached Bjarn's room
! def goal_reached (self):
! if self.myself.get_name () == adonthell.gamedata_player ().get_name
():
! self.myself.set_schedule ("keyboard_control")
! bjarn = adonthell.gamedata_get_character ("Bjarn Fingolson")
! bjarn.set_dialogue ("dialogues.extro")
! bjarn.launch_action (self.myself)
!
! else:
! self.myself.pause ()
!
!
! def run_old (self):
myself = self.myself
todo = myself.get_val ("todo")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Adonthell-commits] CVS: wastesedge/scripts/schedules/mapcharacters bjarn.py,1.5,1.6 erek.py,1.6,1.7 jelom.py,1.6,1.7 silverhair.py,1.6,1.7 to_cellar.py,1.4,1.5,
Kai Sterker <address@hidden> <=