Exemple #1
0
CLOSED_SHAFT = partial(
    Object,
    True,
    '|',
    'closed shaft',
    id = 1,
    color = Color.BATTLESHIPGREY
)

DESC_STAIRS = partial(
    Object,
    True,
    '>',
    'descending stairs',
    event_map = on_interact_map(raise_ev(NextLevel)),
    id = 2,
    x_=140,
    y_=90
)

ASC_STAIRS = partial(
    ASC_STAIRS,
    x_ = 130,
    y_ = 90
)

leverid = 4

def replace_for_lever(this, that):
    def r(self):
Exemple #2
0
#
# game 3 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with game 3.  If not, see <http://www.gnu.org/licenses/>.

from exception import AppendMessage, PreviousLevel
from functools import partial
from function import raise_ev
from obj import Object

def on_interact_map(fun):
    return {'on_interact': fun}

append_message = partial(raise_ev, AppendMessage)

def on_interact_append_message(message):
    return on_interact_map(append_message(message))

ASC_STAIRS = partial(
    Object,
    True,
    '<',
    'ascending stairs',
    event_map = on_interact_map(raise_ev(PreviousLevel)),
    id = -2,
)