changeset 562:91ad18a5acf1

Celestial Doorway now counts tails.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 10 Apr 2011 02:09:19 +0200
parents 0236c5fe6ac1
children 2f75e57b987d
files data/levels/town.json skaapsteker/levelscene.py skaapsteker/sprites/base.py
diffstat 3 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/levels/town.json	Sun Apr 10 02:02:53 2011 +0200
+++ b/data/levels/town.json	Sun Apr 10 02:09:19 2011 +0200
@@ -47,7 +47,7 @@
         "to_theatre": {"type": "Doorway", "pos": [13, 5], "facing": "right", "leadsto": "theatre.starting"},
         "to_tea_house": {"type": "Doorway", "pos": [29, 3], "facing": "right", "leadsto": "tea_house.starting"},
         "to_market": {"type": "Doorway", "pos": [44, 6], "facing": "right", "leadsto": "market.starting"},
-        "to_celestial_plane": {"type": "Doorway", "pos": [59, 14], "facing": "left", "leadsto": "celestial_plane.starting"}
+        "to_celestial_plane": {"type": "CelestialDoorway", "pos": [59, 14], "facing": "left", "leadsto": "celestial_plane.starting"}
     },
     "music" : {
         "track" : "ambient japanese music 2.ogg",
--- a/skaapsteker/levelscene.py	Sun Apr 10 02:02:53 2011 +0200
+++ b/skaapsteker/levelscene.py	Sun Apr 10 02:09:19 2011 +0200
@@ -59,7 +59,7 @@
 
         for sprite in self._level.sprites:
             # XXX: NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
-            if isinstance(sprite, base.Monster):
+            if isinstance(sprite, base.Monster) or isinstance(sprite, base.CelestialDoorway):
                 sprite.world = game_state.world
             self._world.add(sprite)
         npcs_and_items = game_state.create_sprites(self._level.name)
--- a/skaapsteker/sprites/base.py	Sun Apr 10 02:02:53 2011 +0200
+++ b/skaapsteker/sprites/base.py	Sun Apr 10 02:09:19 2011 +0200
@@ -450,6 +450,16 @@
 
 
 
+class CelestialDoorway(Doorway):
+    def player_action(self, player):
+        from .. import engine
+        if len(self.world.fox.tails) < 8:
+            engine.OpenNotification.post(text="You need eight tails to enter the Celestial Plane.")
+            return
+        super(CelestialDoorway, self).player_action(player)
+
+
+
 class StartingDoorway(Doorway):
     actionable = False