public DelugeAction(IScope scope, ICost cost, IScreenEffect screenEffect, int power, AttackType attackType, Landform waterLandform)
 {
     _scope = scope;
     _cost = cost;
     _screenEffect = screenEffect;
     _brinkLandform = waterLandform;
     _power = power;
     _attackType = attackType;
 }
        public void Load()
        {
            string gamePicturePath = Path.Combine(_scenarioPath, "Picture");
            string gameDataPath = Path.Combine(_scenarioPath, "Data");

            // 地形タイプ情報の読み込み
            var landformInfos = LoadInfo();

            // 各チップ画像の取得
            var landImages = WarGlobal.BmpManager.GetSurfaces(
                Path.Combine(gamePicturePath, "BMAPCHAR.BMP"), WarGlobal.ChipSize);

            var objectImages = WarGlobal.BmpManager.GetSurfaces(
                Path.Combine(gamePicturePath, "BMAPOBJ.BMP"), WarGlobal.ChipSize,
                path => BitmapUtil.Load(path, Color.Black));

            // 地形チップの生成
            var landforms = new Landform[landImages.Count];
            // 地形タイプの読み込み
            using (var reader = new StreamReader(Path.Combine(gameDataPath, "TikeiType"), WarGlobal.Encoding))
            {
                var sc = new Scanner(reader);
                for (int i = 0; i < landforms.Length; i++)
                {
                    int id = sc.NextInt32(NumberStyles.HexNumber);
                    landforms[i] = new Landform(landImages[i], landformInfos[id + 1]);
                }
            }
            WarGlobal.Landforms = landforms;

            // オブジェクトチップの生成
            var constructs = new Construct[objectImages.Count + 2];
            // 0番目は移動不可, 1番目はnull
            for (int i = 2; i < objectImages.Count; i++)
            {
                int id;
                if (i > EndWall)
                    id = 18;
                else if (i > EndCity)
                    id = 17;
                else
                    id = 16;
                constructs[i] = new Construct(objectImages[i - 1], landformInfos[id + 1]);
            }
            // 移動不可オブジェクトの生成
            constructs[0] = new Construct(null, landformInfos[0]);

            WarGlobal.Constructs = constructs;
        }
Beispiel #3
0
        public Land(int height, Landform landform, Construct construct)
        {
            Height = Math.Max(height, 0);
            _landform = landform;
            _construct = construct;

            if (construct != null)
            {
                Image = new LayerSurface(new[] { _landform.Image, _construct.Image });
                Info = construct.Info;
            }
            else
            {
                Image = landform.Image;
                Info = landform.Info;
            }
        }