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; }
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; }
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; } }
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; } }
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; } } }
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; } } }
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; } } }
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; } } }
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; } } }
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; } }