コード例 #1
0
ファイル: RoomGenSpecificBoss.cs プロジェクト: PMDCollab/PMDC
        public override void DrawOnMap(T map)
        {
            if (this.Draw.Width != this.Tiles.Length || this.Draw.Height != this.Tiles[0].Length)
            {
                this.DrawMapDefault(map);
                return;
            }

            base.DrawOnMap(map);

            //create new bosses from the spawns, adjusting their locations
            MobSpawnState mobSpawnState = new MobSpawnState();

            foreach (MobSpawn spawn in Bosses)
            {
                MobSpawn    newSpawn = spawn.Copy();
                MobSpawnLoc setLoc   = null;
                foreach (MobSpawnExtra extra in newSpawn.SpawnFeatures)
                {
                    MobSpawnLoc extraLoc = extra as MobSpawnLoc;
                    if (extraLoc != null)
                    {
                        setLoc = extraLoc;
                        break;
                    }
                }

                if (setLoc != null)
                {
                    setLoc.Loc = setLoc.Loc + this.Draw.Start;
                }
                else
                {
                    setLoc = new MobSpawnLoc(this.Draw.Center);
                    newSpawn.SpawnFeatures.Add(setLoc);
                }
                mobSpawnState.Spawns.Add(newSpawn);
            }

            ////place the boss bounds here
            //CheckIntrudeBoundsEvent trapZone = new CheckIntrudeBoundsEvent();
            //trapZone.Bounds = new Rect(Trigger.Start + new Loc(this.Draw.Start), Trigger.Size);
            //{
            //    LockdownMapEvent lockdown = new LockdownMapEvent();
            //    lockdown.Bounds = new Rect(this.Draw.Start - new Loc(1), this.Draw.Size + new Loc(2));
            //    trapZone.Effects.Add(lockdown);
            //    trapZone.Effects.Add(new BossSpawnEvent(this.Draw, mobSpawns.ToArray()));
            //}
            //map.CheckEvents.Add(trapZone);


            EffectTile newEffect = new EffectTile(TriggerTile, true, Trigger + this.Draw.Start);

            newEffect.TileStates.Set(mobSpawnState);
            newEffect.TileStates.Set(new BoundsState(new Rect(this.Draw.Start - new Loc(1), this.Draw.Size + new Loc(2))));
            newEffect.TileStates.Set(new SongState(Song));
            ((IPlaceableGenContext <EffectTile>)map).PlaceItem(Trigger + this.Draw.Start, newEffect);
        }
コード例 #2
0
ファイル: MobSpawnExtra.cs プロジェクト: PMDCollab/PMDC
 public MobSpawnLoc(MobSpawnLoc other)
 {
     Loc = other.Loc;
     Dir = other.Dir;
 }