[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[adonthell-wastesedge-commits] Release_0-3-1 31f9068 122/237: Schedule t
From: |
Kai Sterker |
Subject: |
[adonthell-wastesedge-commits] Release_0-3-1 31f9068 122/237: Schedule to get everybody down the cellar |
Date: |
Mon, 25 Jul 2016 18:15:04 +0000 (UTC) |
tag: Release_0-3-1
commit 31f9068b0fa61bc81b32adb9101502a39f53eefa
Author: adondev <adondev>
Commit: adondev <adondev>
Schedule to get everybody down the cellar
---
scripts/schedules/mapcharacters/to_cellar.py | 97 ++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
diff --git a/scripts/schedules/mapcharacters/to_cellar.py
b/scripts/schedules/mapcharacters/to_cellar.py
new file mode 100644
index 0000000..744244a
--- /dev/null
+++ b/scripts/schedules/mapcharacters/to_cellar.py
@@ -0,0 +1,97 @@
+#
+# (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 all characters to get to Bjarn's room
+
+import adonthell
+import random
+
+class to_cellar:
+
+ def __init__ (self, mapcharacterinstance):
+ self.myself = mapcharacterinstance
+
+ # -- gives the proper exit for each submap to reach Bjarn's room
+ # (yard, common room, parlour, kitchen, cellar, bath, Alek's room,
+ # Bjarn's room, store room, 1st floor Fellnir's room, Frostbloom's
+ # room, Player's room, Silverhair's room)
+ self.exits = \
+ [(18, 13, adonthell.STAND_NORTH), \
+ (9, 1, adonthell.STAND_NORTH), \
+ (0, 4, adonthell.STAND_WEST), \
+ (6, 6, adonthell.STAND_SOUTH), \
+ (10, 7, adonthell.STAND_EAST), \
+ (4, 7, adonthell.STAND_SOUTH), \
+ (6, 6, adonthell.STAND_SOUTH), \
+ (-1, -1, -1), \
+ (7, 3, adonthell.STAND_EAST), \
+ (8, 1, adonthell.STAND_NORTH), \
+ (0, 3, adonthell.STAND_WEST), \
+ (5, 3, adonthell.STAND_EAST), \
+ (5, 1, adonthell.STAND_NORTH), \
+ (5, 1, adonthell.STAND_NORTH)]
+
+ self.myself.set_val ("todo", 0)
+
+
+ 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:
+ x, y, dir = self.exits[myself.submap ()]
+
+ # -- in Bjarn's room
+ if x == -1:
+ submap = myself.mymap ().get_submap (myself.submap ())
+ x = random.randint (1, 4)
+ y = random.randint (5, 9)
+
+ while not submap.get_square (x, y).is_free ():
+ 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
+
+ myself.set_goal (x, y, dir)
+ myself.set_val ("todo", 2)
+
+ # -- move
+ elif todo == 2:
+ if myself.follow_path () == 1:
+ # -- reached our final destination
+ myself.set_val ("todo", 0)
+
+ if myself.submap () == 7 and myself.posx () != 1:
+ if myself.get_name () == adonthell.gamedata_player
().get_name ():
+ myself.set_schedule ("keyboard_control")
+ else:
+ myself.set_schedule_active (0)
\ No newline at end of file
- [adonthell-wastesedge-commits] Release_0-3-1 662757a 091/237: FIXED a small bug in the python console, (continued)
- [adonthell-wastesedge-commits] Release_0-3-1 662757a 091/237: FIXED a small bug in the python console, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 af508ec 185/237: ADDED in-game tunes, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 3bca664 054/237: Added new mapcharacters., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 ae421bc 146/237: Python scripts files are now compiled by the Adonthell binary., Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 3e84510 056/237: Forgot to update the Makefile, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 d6345fa 228/237: REMOVED audio schedule for the extro, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 bf5e61e 123/237: Took care of the case when the player takes Erek to Jelom and has not made it into Bjarn's room yet, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 1b6640a 151/237: MOVED engine control into seperate script, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 7ff9ee3 116/237: FIXED a few spelling errors, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 89d9191 037/237: Added Talan Wendth, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 31f9068 122/237: Schedule to get everybody down the cellar,
Kai Sterker <=
- [adonthell-wastesedge-commits] Release_0-3-1 ed1c142 160/237: FIXED Makefile.am's, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 6087908 137/237: ADDED Bjarn's schedule, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 69c9103 210/237: Fixed the extro a bit, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 79418df 227/237: ADDED Enter as alternative 'Action' key, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 4f1725f 119/237: FIXED erek and jelom, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 8fdfd66 165/237: Added Barn interior, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 48053be 090/237: Updated the init script, so you can skip the title sequence, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 547a59d 130/237: FIXED the mess I made ; P, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 b1a1e7a 154/237: ADDED extro dialogue, Kai Sterker, 2016/07/25
- [adonthell-wastesedge-commits] Release_0-3-1 c31d284 145/237: MOVED fading code to mapengine, Kai Sterker, 2016/07/25