Esempio n. 1
0
        public int CreateTileBehavior(string tileBehaviorType, IntVector2 affectedTile)
        {
            GameObject obj = null;

            if (tileBehaviorType == "door")
            {
                obj = new TileBehavior_Door(GetNextID(), affectedTile);
            }
            else if (tileBehaviorType == "stoneToGlass")
            {
                obj = new TileBehavior_StoneToGlass(GetNextID(), affectedTile);
            }
            else
            {
                throw new NotImplementedException();
            }

            return(RegisterGameObject(obj));
        }
Esempio n. 2
0
        public override bool CastAtTarget(IntVector2 target)
        {
            Actor currentCaster = _scene.GetGameObjectPool().GetActor(OwnerID);

            //We can't cast if there's nobody there
            if (!_scene.GetMap().DoesTileHaveFeature(target, Tiles.Tile_SimpleFeatureType.STONE_WALL))
            {
                _scene.WriteMessage("That spell must be cast on a wall!");
                return(false);
            }

            _activeBehaviorID = _scene.GetGameObjectPool().CreateTileBehavior("stoneToGlass", target);
            TileBehavior_StoneToGlass b = (TileBehavior_StoneToGlass)_scene.GetGameObjectPool().GetTileBehavior(_activeBehaviorID);

            _scene.GetMap().AddTileBehavior(_activeBehaviorID);
            _scene.GetTurnCounter().AddObjectToCounter(_activeBehaviorID);

            b.SpreadStrength = 10;

            StartCooldown();
            return(true);
        }