protected async Task <TInitializer> SetupInitializer <TInitializer>(TInitializer initializer, ActuatorItemData data) where TInitializer : SensorInitializerX { var local = data.ActionLocation as LocalTarget; var remote = data.ActionLocation as RemoteTarget; initializer.Audible = data.HasSoundEffect; initializer.Effect = (SensorEffect)data.Action; initializer.LocalEffect = data.IsLocal; initializer.ExperienceGain = local?.ExperienceGain ?? false; initializer.Rotate = local?.RotateAutors ?? false; initializer.OnceOnly = data.IsOnceOnly; initializer.RevertEffect = data.IsRevertable; initializer.TimeDelay = 1000 / 6 * data.ActionDelay; initializer.Specifer = remote?.Position.Direction.ToMapDirection() ?? MapDirection.North; var tileResult = await builder.GetTargetTile(remote?.Position.Position.ToAbsolutePosition(builder.CurrentMap), initializer.Specifer); initializer.TargetTile = tileResult?.Item1; if (tileResult != null) //invertDirection { initializer.Specifer = tileResult.Item2; } return(initializer); }
private async void GetTeleportTarget(TeleprotInitializer teleportInitializer) { if (teleportInitializer.NextLevelIndex != builder.CurrentLevelIndex) { return; } teleportInitializer.NextLevelEnter = (await builder.GetTargetTile(teleportInitializer.TargetTilePosition, MapDirection.North)).Item1; }
public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence) { return new Button( context.GetWallPosition(matchedSequence[0].TilePosition, currentTile), context.GetTargetTile(matchedSequence[0]), matchedSequence[0].GetActionStateX()) { Texture = context.WallTextures[matchedSequence[0].Decoration - 1], }; }
public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList <ActuatorItemData> matchedSequence) { return(new Button( context.GetWallPosition(matchedSequence[0].TilePosition, currentTile), context.GetTargetTile(matchedSequence[0]), matchedSequence[0].GetActionStateX()) { Texture = context.WallTextures[matchedSequence[0].Decoration - 1], }); }
public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList<ActuatorItemData> matchedSequence) { var leverDown = matchedSequence[1]; return new LeverActuator( context.GetWallPosition(matchedSequence[0].TilePosition, context.WallActuatorCreator.CurrentTile), context.GetTargetTile(matchedSequence[0]), false,//TODO onceOnlyy flag ??? matchedSequence[0].GetActionStateX()) { UpTexture = context.WallTextures[matchedSequence[0].Decoration - 1], DownTexture = context.WallTextures[leverDown.Decoration - 1] }; }
public override Actuator CreateItem(LegacyMapBuilder context, Tile currentTile, IReadOnlyList <ActuatorItemData> matchedSequence) { var leverDown = matchedSequence[1]; return(new LeverActuator( context.GetWallPosition(matchedSequence[0].TilePosition, context.WallActuatorCreator.CurrentTile), context.GetTargetTile(matchedSequence[0]), false,//TODO onceOnlyy flag ??? matchedSequence[0].GetActionStateX()) { UpTexture = context.WallTextures[matchedSequence[0].Decoration - 1], DownTexture = context.WallTextures[leverDown.Decoration - 1] }); }