コード例 #1
0
ファイル: Trap.cs プロジェクト: GoodAI/BrainSimulator
 public void Update(IAtlas atlas, ITilesetTable table)
 {
     List<IGameObject> stayingOnTile = atlas.StayingOnTile(Position);
     if (stayingOnTile.Count != 0) return;
     atlas.ReplaceWith(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable),
         new TrapCharged(table, Position));
     NextUpdateAfter = 0;
 }
コード例 #2
0
        public void Update(IAtlas atlas, ITilesetTable table)
        {
            List <IGameObject> stayingOnTile = atlas.StayingOnTile(Position);

            if (stayingOnTile.Count != 0)
            {
                return;
            }
            atlas.ReplaceWith(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable),
                              new TrapCharged(table, Position));
            NextUpdateAfter = 0;
        }
コード例 #3
0
ファイル: Bed.cs プロジェクト: GoodAI/BrainSimulator
        public void Update(IAtlas atlas, ITilesetTable table)
        {
            List<IGameObject> gameActorPositions = atlas.StayingOnTile(Position);

            SomeoneOnTile = gameActorPositions.Any();

            foreach (IGameObject gameActor in gameActorPositions)
            {
                IAvatar avatar = gameActor as IAvatar;
                if (avatar != null)
                    avatar.Rested += TWConfig.Instance.BedRechargeRate;
            }
        }
コード例 #4
0
ファイル: Trap.cs プロジェクト: GoodAI/BrainSimulator
 public void Update(IAtlas atlas)
 {
     List<IGameObject> stayingOnTile = atlas.StayingOnTile(Position);
     if (stayingOnTile.Count == 0)
     {
         Charged = true;
     }
     if (Charged)
     {
         var avatars = stayingOnTile.OfType<IAvatar>();
         avatars.ForEach(x => x.Energy -= ENERGY_FOR_STEP_ON_TRAP);
         Charged = false;
     }
 }
コード例 #5
0
        public void Update(IAtlas atlas, ITilesetTable table)
        {
            List<IGameObject> gameActorPositions = atlas.StayingOnTile(Position);

            SomeoneOnTile = gameActorPositions.Any();

            foreach (IGameObject gameActor in gameActorPositions)
            {
                var avatar = gameActor as IAvatar;
                if (avatar != null)
                {
                    avatar.Energy -= ENERGY_FOR_STEP_OR_WAIT_A_SECOND_ON_POISON;
                }
            }
        }
コード例 #6
0
        public void Update(IAtlas atlas)
        {
            List <IGameObject> gameActorPositions = atlas.StayingOnTile(Position);

            SomeoneOnTile = gameActorPositions.Any();

            foreach (IGameObject gameActor in gameActorPositions)
            {
                IAvatar avatar = gameActor as IAvatar;
                if (avatar != null)
                {
                    avatar.Rested += TWConfig.Instance.BedRechargeRate;
                }
            }
        }
コード例 #7
0
        public void Update(IAtlas atlas, ITilesetTable table)
        {
            List <IGameObject> gameActorPositions = atlas.StayingOnTile(Position);

            SomeoneOnTile = gameActorPositions.Any();

            foreach (IGameObject gameActor in gameActorPositions)
            {
                var avatar = gameActor as IAvatar;
                if (avatar != null)
                {
                    avatar.Energy -= ENERGY_FOR_STEP_OR_WAIT_A_SECOND_ON_POISON;
                }
            }
        }
コード例 #8
0
ファイル: Recharger.cs プロジェクト: GoodAI/BrainSimulator
        public void Update(IAtlas atlas, ITilesetTable table)
        {
            List<IGameObject> gameActorPositions = atlas.StayingOnTile(Position);

            SomeoneOnTile = gameActorPositions.Any();

            foreach (IGameObject gameActor in gameActorPositions)
            {
                var avatar = gameActor as IAvatar;
                if (avatar != null)
                {
                    avatar.Energy += ENERGY_RECHARGED;
                }
            }
        }
コード例 #9
0
        public void Update(IAtlas atlas, ITilesetTable table)
        {
            List <IGameObject> gameActorPositions = atlas.StayingOnTile(Position);

            SomeoneOnTile = gameActorPositions.Any();

            foreach (IGameObject gameActor in gameActorPositions)
            {
                var avatar = gameActor as IAvatar;
                if (avatar != null)
                {
                    avatar.Energy += ENERGY_RECHARGED;
                }
            }
        }
コード例 #10
0
        public void Update(IAtlas atlas)
        {
            List <IGameObject> stayingOnTile = atlas.StayingOnTile(Position);

            if (stayingOnTile.Count == 0)
            {
                Charged = true;
            }
            if (Charged)
            {
                var avatars = stayingOnTile.OfType <IAvatar>();
                avatars.ForEach(x => x.Energy -= ENERGY_FOR_STEP_ON_TRAP);
                Charged = false;
            }
        }