Exemple #1
0
	def run(self):
		"""
		c.run()

		With this command, the player can exit places such as houses, shops,
		dungeons... to go back in the world
		"""
		if len(self._args) == 0:
			raise core.command.exception(_('ERROR_EXIT_NO_PLACE_GIVEN'))

		areaType = self._args[0]

		p = place.factory.getFromExitArea(self._player.getAreaId(), areaType)
		if p is None:
			raise place.exception(_('ERROR_ENTER_PLACE_NOT_AVAILABLE'))

		self._player.goTo(p['id_area'])
		return [_('EXIT_CONFIRMATION')]
Exemple #2
0
	def run(self):
		"""
		c.run()

		With this command, the player can enter places such as houses, shops,
		dungeons...
		"""
		if len(self._args) == 0:
			raise core.command.exception(_('ERROR_ENTER_NO_PLACE_GIVEN'))

		areaType = self._args[0]

		p = place.factory.getFromEntranceArea(self._player.getAreaId(), areaType)
		if p is None:
			raise place.exception(_('ERROR_ENTER_PLACE_NOT_AVAILABLE'))

		if p['entrance_id'] is None:
			p = place.factory.generate(p, areaType)
		self._player.goTo(p['entrance_id'])
		return [_('ENTER_CONFIRMATION')]