Ejemplo n.º 1
0
        public bool CastSpell(ICreature caster, Vector2 targetWorldIndex, AreaOfEffect affectedArea, World world)
        {
            ITerrain targetTile = world.Tiles[(int)targetWorldIndex.X, (int)targetWorldIndex.Y];

            if (targetTile.IsExploredByPlayer && targetTile.CanCreatureEnter(caster) && world.IsWorldIndexFreeOfObstacles(targetWorldIndex))
            {
                caster.WorldIndex = targetWorldIndex;
                world.CenterCameraOnPlayer();
                world.DiscoverTerrainAroundPlayer();
            }
            else
            {
                Announcer.Instance.Announce(caster.Name + " tried to teleport, but could not.", MessageTypes.SpellFailure);
            }

            return(true);
        }