import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, sim_items, main, dungeon
from util import *

class Scroll(sim_items.Scroll):
    def __init__(self):
        sim_items.Scroll.__init__(self, "phasing", "?", 
                ('go', 'far'),
                idDescription="This scroll contains a brief but elaborately "\
                    "assonant chant, whose incantation will cause the "\
                    "speaker to quite suddenly find himself standing "\
                    "somewhere else. Exactly where else does not seem to be "\
                    "controllable.")

    def read(self, reader):
        destTile = dungeon.getRandomPlacementTile(main.mapFrame.getMap())
        main.schedule.add(sim.Event('translocate', main.schedule.time,
            (reader, (destTile.col, destTile.row), reader.parentTile.map),
            dests=[reader]))
        if reader is main.player:
            main.transient('Suddenly you stand elsewhere.', destTile)
        reader.identify(self, False)

#========================================
thingClass = Scroll

