public ErrorResponse Unfollow(FollowType followType, List <String> ids) { JObject ob = new JObject(); ob.Add("ids", new JArray(ids.ToArray())); return(UploadData <ErrorResponse>("https://api.spotify.com/v1/me/following?type=" + followType.GetStringAttribute(""), ob.ToString(Formatting.None), "DELETE")); }
/// <summary> /// Call this to initialize a Behaviour with data supplied in a file. /// </summary> /// <param name="fileName">The file to load from.</param> public override void LoadContent(String fileName) { base.LoadContent(fileName); mCurrentFollowType = FollowType.None; mExplodeDistanceSqr = 8 * 8; mBLineDistanceSqr = 40 * 40; mCloseRangeDistanceSqr = 88 * 88; mFrozenDistanceSqr = 160 * 160; mMoveSpeedPathFinding = 0.8f; mMoveSpeedDirectApproach = 0.5f; mMoveSpeedBLine = mMoveSpeedDirectApproach * 1.5f; mForceBLine = false; mBLineTimer = StopWatchManager.pInstance.GetNewStopWatch(); mBLineTimer.pLifeTime = 120.0f; mBLineTimer.pIsPaused = true; mBLineTimer.SetUpdatePass(MBHEngineContentDefs.BehaviourDefinition.Passes.DEFAULT); // Allocate these ahead of time to avoid triggering GC. mSetDestinationMsg = new PathFind.SetDestinationMessage(); mSetSourceMsg = new PathFind.SetSourceMessage(); mGetCurrentBestNodeMsg = new PathFind.GetCurrentBestNodeMessage(); mClearDestinationMsg = new PathFind.ClearDestinationMessage(); mDetonateMsg = new Explosive.DetonateMessage(); mIncrementScoreMsg = new PlayerScore.IncrementScoreMessage(); mSetActiveAnimMsg = new SpriteRender.SetActiveAnimationMessage(); mSetTargetObjectMsg = new PathFollow.SetTargetObjectMessage(); }
public PetBot(int int_4) { this.SpeechTimer = new Random((int_4 ^ 2) + DateTime.Now.Millisecond).Next(25, 60); this.ActionTimer = new Random((int_4 ^ 2) + DateTime.Now.Millisecond).Next(10, 60); this.FollowType = FollowType.None; this.FollowUser = null; }
public void Follow(FollowType followType, string id) { Debug.Log("Starting Follow Thread, " + followType); Thread myThread = new Thread(() => FollowThread(followType, id)); myThread.Start(); }
sealed public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(mainText); EditorGUILayout.PropertyField(minorText); EditorGUILayout.PropertyField(durationTime); EditorGUILayout.PropertyField(isFollow); FollowType layoutFollow = (FollowType)isFollow.enumValueIndex; if (layoutFollow == FollowType.True) { EditorGUILayout.PropertyField(distance); EditorGUILayout.PropertyField(anchortype); } EditorGUILayout.PropertyField(noticetype); serializedObject.ApplyModifiedProperties(); // Place the button at the bottom Module_Notice notice = (Module_Notice)target; if (GUILayout.Button("Refresh Info")) { notice.RefreshInfo(); } }
public UsersPage(string title, string userId, FollowType followType) { Title = title; _FollowType = followType; _UserId = userId; }
public void Sweep(float vAngle = 45) { lastSweepAngle = vAngle; followType = FollowType.Sweep; gimbalParent.localRotation = Quaternion.Euler(new Vector3(vAngle, 0, 0)); // gimbalParent.localRotation = Quaternion.identity; sweepAccum = 0; }
/// <summary> /// Add the current user as a follower of one or more artists or other Spotify users. /// </summary> /// <param name="followType">The ID type: either artist or user.</param> /// <param name="ids">A list of the artist or the user Spotify IDs</param> /// <returns></returns> /// <remarks>Needs Authorization</remarks> public ErrorResponse Follow(FollowType followType, List <String> ids) { JObject ob = new JObject { { "ids", new JArray(ids) } }; return(UploadData <ErrorResponse>(APIBase + "/me/following?type=" + followType.GetStringAttribute(""), ob.ToString(Formatting.None), "PUT") ?? new ErrorResponse()); }
public static PathFollower FollowPath(this Transform transform, string pathName, float moveSpeed, FollowType followType = FollowType.Once, FollowDirection followDirection = FollowDirection.Forward) { PathData pathData = WaypointManager.instance.GetPathData(pathName); var pathFollower = PathFollower.Create(transform); if (pathData != null) pathFollower.Follow(pathData, moveSpeed, followType, followDirection); else Debug.LogError(string.Format("[WaypointManager] couldn't find path('{0}')", pathName)); return pathFollower; }
public void Sweep360(bool sweepRight = true) { followType = FollowType.Sweep360; sweepSpeed = Mathf.Abs(sweepSpeed); if (!sweepRight) { sweepSpeed = -sweepSpeed; } }
public void AddPattern(System.Collections.Generic.List <AudioEntity> newSteps, FollowType newFollowType, AudioEntity newPulseSource) { var index = AudioComponentsLookup.Pattern; var component = CreateComponent <Pattern>(index); component.steps = newSteps; component.followType = newFollowType; component.pulseSource = newPulseSource; AddComponent(index, component); }
public async Task<bool> Follow(string userId, string followId, FollowType entityTypeToFollow) { string typeToFollow = ParamValueAttributeHelper.GetParamValueOfEnumAttribute<FollowType>(entityTypeToFollow); var result = await BeatsMusicManager.PutData<ContentData>( string.Format("{0}/{1}/follows/{2}", typeToFollow, userId, followId), null); return result.Code.ToLower() == "ok"; }
public void SetFollowType(FollowType type, bool instant = false) { _followType = type; if (instant) { switch (type) { case FollowType.None: break; case FollowType.Normal: _currOffsetNeed = _offsetNormal; _currOffsetLookNeed = _lookOffsetNormal; _currOffset = _offsetNormal; _currOffsetLook = _lookOffsetNormal; break; case FollowType.Jump: _currOffsetNeed = _offsetJump; _currOffsetLookNeed = _lookOffsetJump; _currOffset = _offsetJump; _currOffsetLook = _lookOffsetJump; break; case FollowType.Slide: _currOffsetNeed = _offsetSlide; _currOffsetLookNeed = _lookOffsetSlide; _currOffset = _offsetSlide; _currOffsetLook = _lookOffsetSlide; break; case FollowType.DeathLoop: _currOffsetNeed = _offsetDeathloop; _currOffsetLookNeed = _lookOffsetDeathloop; _currOffset = _offsetDeathloop; _currOffsetLook = _lookOffsetDeathloop; break; case FollowType.StartTrack: _currOffsetNeed = _offsetStart; _currOffsetLookNeed = _lookOffsetStart; _currOffset = _offsetStart; _currOffsetLook = _lookOffsetStart; break; case FollowType.FinishTrack: _target = null; return; default: throw new ArgumentOutOfRangeException(nameof(_followType), _followType, null); } } }
public override void DrawOnGUI() { followType = (FollowType)EditorGUILayout.EnumPopup("Follow type", followType); followAheadPercent = EditorGUILayout.Slider("How much to look ahead on path (%)", followAheadPercent, 0.01f, 0.9f); if (followType == FollowType.PredictivePath) { predictTime = EditorGUILayout.FloatField("How much to predict (s)", predictTime); } base.DrawOnGUI(); }
void updateCameraPosition(FollowType type) { switch (type) { case FollowType.Strict: transform.position = leader.position + offset; break; case FollowType.Smooth: transform.position = Vector3.Lerp(transform.position, leader.position + offset, Time.deltaTime * smoothness); break; } }
/// <summary> /// Get the current user’s followed artists. /// </summary> /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. </param> /// <param name="after">The last artist ID retrieved from the previous request.</param> /// <returns></returns> /// <remarks>AUTH NEEDED</remarks> public string GetFollowedArtists(int limit = 20, string after = "") { limit = Math.Min(limit, 50); const FollowType followType = FollowType.Artist; //currently only artist is supported. StringBuilder builder = new StringBuilder(APIBase + "/me/following?type=" + followType.GetStringAttribute()); builder.Append("&limit=" + limit); if (!string.IsNullOrEmpty(after)) { builder.Append("&after=" + after); } return(builder.ToString()); }
public void Follow(PathData pathData, float moveSpeed, FollowType followType, FollowDirection followDirection) { this.pathData = pathData; this.moveSpeed = moveSpeed; this.followType = followType; this.followDirection = followDirection; StopFollowing(); var closestLineIndex = GetClosestLineIndex(_transform.position); _currentIndex = GetClosestPointIndex(closestLineIndex * 20, _transform.position); StartCoroutine("FollowPath"); }
/// <summary> /// Get Api Follow Type /// </summary> /// <param name="followType">Follow Type</param> /// <returns></returns> public static Enums.FollowType GetApiFollowType(FollowType followType) { switch (followType) { case FollowType.Artist: return(Enums.FollowType.Artist); case FollowType.User: return(Enums.FollowType.User); default: throw new ArgumentOutOfRangeException(); } }
public void FollowThread(FollowType followType, string id) { ErrorResponse errorResponse = _spotify.Follow(followType, id); if (errorResponse.HasError()) { Debug.LogError(errorResponse.Error.Message); Debug.LogError(errorResponse.Error.Status); } else { Debug.Log("Followed artist " + id); } }
private void Start() { if (target != null) { MoveToPosition(target.transform.position); } velocities = new RollingFloatArray(velocityPoints); targetRigidbody = target.GetComponent <Rigidbody2D>(); if (followType == FollowType.Velocity && targetRigidbody == null) { followType = FollowType.Position; } camera = GetComponent <Camera>(); camera.orthographicSize = baseSize; }
public void FollowToPoint(PathData pathData, float moveSpeed, Vector2 targetPos) { this.pathData = pathData; this.moveSpeed = moveSpeed; this.followType = FollowType.Once; StopFollowing(); var closestLineIndex = GetClosestLineIndex(_transform.position); _currentIndex = GetClosestPointIndex(closestLineIndex * 20, _transform.position); closestLineIndex = GetClosestLineIndex(targetPos); var targetIndex = GetClosestPointIndex(closestLineIndex * 20, targetPos); this.followDirection = (_currentIndex < targetIndex) ? FollowDirection.Forward : FollowDirection.Backward; StartCoroutine("FollowPathToPoint", targetIndex); }
public static PathFollower FollowPath(this Transform transform, string pathName, float moveSpeed, FollowType followType = FollowType.Once, FollowDirection followDirection = FollowDirection.Forward) { PathData pathData = WaypointManager.instance.GetPathData(pathName); var pathFollower = PathFollower.Create(transform); if (pathData != null) { pathFollower.Follow(pathData, moveSpeed, followType, followDirection); } else { Debug.LogError(string.Format("[WaypointManager] couldn't find path('{0}')", pathName)); } return(pathFollower); }
/// <summary> /// Get the current user’s followed artists. /// </summary> /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. </param> /// <param name="after">The last artist ID retrieved from the previous request.</param> /// <returns></returns> /// <remarks>AUTH NEEDED</remarks> public FollowedArtists GetFollowedArtists(int limit = 20, String after = "") { if (!UseAuth) { throw new InvalidOperationException("Auth is required for GetFollowedArtists"); } limit = Math.Max(limit, 50); const FollowType followType = FollowType.Artist; //currently only artist is supported. StringBuilder builder = new StringBuilder(APIBase + "/me/following?type=" + followType.GetStringAttribute("")); builder.Append("&limit=" + limit); if (after != "") { builder.Append("&after=" + after); } return(DownloadData <FollowedArtists>(builder.ToString())); }
/// <summary> /// /// </summary> public ListResponse <Boolean> IsFollowing(FollowType followType, List <String> ids) { JToken res = DownloadData <JToken>("https://api.spotify.com/v1/me/following/contains?type=" + followType.GetStringAttribute("") + "&ids=" + string.Join(",", ids)); if (res is JArray) { return(new ListResponse <Boolean> { List = res.ToObject <List <Boolean> >(), ErrorResponse = null }); } else { return(new ListResponse <Boolean> { List = null, ErrorResponse = res.ToObject <Error>() }); } }
private void SetIsFollow(FollowType isFollow) { if (isFollow == FollowType.True) { if (_Follower?.enabled == false) { _Follower.enabled = true; } } else if (isFollow == FollowType.False) { if (_Follower?.enabled == true) { _Follower.enabled = false; } } }
public PixivNew(ContentType contentType, FollowType followType, IPixivClient pixivClient, IQueryCacheService queryCacheService) { _contentType = contentType; _followType = followType; _pixivClient = pixivClient; _queryCacheService = queryCacheService; NewIllusts = new ObservableCollection <IIllust>(); NewNovels = new ObservableCollection <INovel>(); _offset = ""; _maxNovelId = ""; _maxIllustId = ""; #if OFFLINE HasMoreItems = false; #else HasMoreItems = true; #endif }
public JsonResult Follow(string followingId, FollowType type) { var following = new Following() { Id = Guid.NewGuid().ToString(), FollowingId = followingId, UserId = User.Identity.GetUserId(), CreatedAt = DateTime.Now, }; var follower = new Follower() { Id = Guid.NewGuid().ToString(), CreatedAt = DateTime.Now }; switch (type) { case FollowType.Author: following.AuthorId = followingId; var author = _context.Authors.Get(followingId); follower.UserId = author.AspNetUser.Id; var currentAuthor = _context.Authors.GetAuthorByUserId(following.UserId); follower.FollowerId = currentAuthor.Id; follower.AuthorId = currentAuthor.Id; break; case FollowType.Publication: following.PublicationId = followingId; break; case FollowType.Topic: following.TopicId = followingId; break; } _context.Followers.Add(follower); _context.Followings.Add(following); _context.Complete(); return(Json(new { result = true }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Check to see if the current user is following one or more artists or other Spotify users. /// </summary> /// <param name="followType">The ID type: either artist or user.</param> /// <param name="ids">A list of the artist or the user Spotify IDs to check</param> /// <returns></returns> /// <remarks>Needs Authorization</remarks> public ListResponse <Boolean> IsFollowing(FollowType followType, List <String> ids) { if (!UseAuth) { throw new InvalidOperationException("Auth is required for IsFollowing"); } JToken res = DownloadData <JToken>(APIBase + "/me/following/contains?type=" + followType.GetStringAttribute("") + "&ids=" + string.Join(",", ids)); if (res is JArray) { return new ListResponse <Boolean> { List = res.ToObject <List <Boolean> >(), Error = null } } ; return(new ListResponse <Boolean> { List = null, Error = res["error"].ToObject <Error>() }); }
void Awake() { tr = colorCam.transform; if (gimbalParent == null) { gimbalParent = tr; } initialLocalRotation = gimbalParent.localRotation; // lastRotation = gimbalParent.rotation; followType = FollowType.None; // maskCam.depthTextureMode = DepthTextureMode.Depth; // maskCam2.depthTextureMode = DepthTextureMode.Depth; // envMaskCam.depthTextureMode = DepthTextureMode.Depth; // maskCam.enabled = true; // maskCam2.enabled = true; // envMaskCam.enabled = true; Time.timeScale = timeScale; recordFrequency = 1f / recordFrequency; RecordingController.BeginRecordCallback = OnBeginRecording; RecordingController.EndRecordCallback = OnEndRecording; }
public void AddItem(string name, FollowType type, float offset_x, Transform camera, Transform target) { foreach (var de in follows) { if (de.itemName == name) { return; //避免重复添加 } } if (camera == null) { camera = Camera.main.transform; } follows.Add(new FollowInfo() { itemName = name, followType = type, offset_x = offset_x, cameraTarget = camera, followTarget = target, }); }
internal AudioEntity CreatePattern(int size, FollowType type, AudioEntity pulseSource) { var e = _contexts.audio.CreateEntity(); List <AudioEntity> steps = new List <AudioEntity>(); for (int i = 0; i < size; i++) { var s = _contexts.audio.CreateEntity(); s.AddStep(false); s.AddVolume(1f); s.AddPitch(0); s.AddOffset(0); steps.Add(s); } e.AddPattern(steps, type, pulseSource); e.AddStepIndex(0); e.AddPosition(new IntVector2(0, type == FollowType.Pulse ? 0 : -3)); e.isInteractive = true; e.AddAsset(type == FollowType.Pulse ? Res.KickSampler : Res.XyloSampler); e.AddPulseTrigger(AudioSettings.dspTime); entityService.CreateButtonLayout(type == FollowType.Pulse ? 0:-3, size, e); return(e); }
public override void ShowGUI(List<ActionParameter> parameters) { npcToMoveParameterID = Action.ChooseParameterGUI ("NPC to affect:", parameters, npcToMoveParameterID, ParameterType.GameObject); if (npcToMoveParameterID >= 0) { npcToMoveID = 0; npcToMove = null; } else { npcToMove = (NPC) EditorGUILayout.ObjectField ("NPC to affect:", npcToMove, typeof(NPC), true); npcToMoveID = FieldToID <NPC> (npcToMove, npcToMoveID); npcToMove = IDToField <NPC> (npcToMove, npcToMoveID, false); } followType = (FollowType) EditorGUILayout.EnumPopup ("Follow type:", followType); if (followType == FollowType.StartFollowing) { followPlayer = EditorGUILayout.Toggle ("Follow Player?", followPlayer); if (!followPlayer) { charToFollowParameterID = Action.ChooseParameterGUI ("Character to follow:", parameters, charToFollowParameterID, ParameterType.GameObject); if (charToFollowParameterID >= 0) { charToFollowID = 0; charToFollow = null; } else { charToFollow = (Char) EditorGUILayout.ObjectField ("Character to follow:", charToFollow, typeof(Char), true); if (charToFollow && charToFollow == (Char) npcToMove) { charToFollow = null; Debug.LogWarning ("An NPC cannot follow themselves!"); } else { charToFollowID = FieldToID <Char> (charToFollow, charToFollowID); charToFollow = IDToField <Char> (charToFollow, charToFollowID, false); } } } updateFrequency = EditorGUILayout.FloatField ("Update frequency (s):", updateFrequency); if (updateFrequency == 0f || updateFrequency < 0f) { EditorGUILayout.HelpBox ("Update frequency must be greater than zero.", MessageType.Warning); } followDistance = EditorGUILayout.FloatField ("Minimum distance:", followDistance); if (followDistance <= 0f) { EditorGUILayout.HelpBox ("Minimum distance must be greater than zero.", MessageType.Warning); } followDistanceMax = EditorGUILayout.FloatField ("Maximum distance:", followDistanceMax); if (followDistanceMax <= 0f || followDistanceMax < followDistance) { EditorGUILayout.HelpBox ("Maximum distance must be greater than minimum distance.", MessageType.Warning); } } AfterRunningOption (); }
public Following(FollowType t, ShaderStageType s, int i, int a) { Type = t; Stage = s; index = i; arrayEl = a; }
/// <summary> /// Move the enemy /// </summary> /// <param name="originalPosition"></param> /// <returns></returns> public static Vector3 MoveEnemy(Vector3 originalPosition, Vector3 target, FollowType followType, bool onFloor, float speed) { Vector3 finalPosition = originalPosition; // Moves the entity using the right function switch (followType) { case FollowType.MoveTowards: finalPosition = Vector3.MoveTowards(originalPosition, target, speed * Time.deltaTime); break; case FollowType.Lerp: finalPosition = Vector3.Lerp(originalPosition, target, speed * Time.deltaTime); break; } if (onFloor) finalPosition.y = originalPosition.y; return finalPosition; }
private void Append(VariableScope scopeType, VariableType variableType, FollowType followType){ byte b = (byte)((byte)ParameterFormat.Long| (byte) ParameterType.Variable | (byte) scopeType | (byte)variableType | (byte)followType); Append (b); }
/// <summary> /// A camera occupies a space on the game screen to draw game objects. /// An error will occur if the camera is positioned outside of the game window. /// </summary> /// <param name="x">The x position of the camera.</param> /// <param name="y">The y position of the camera.</param> /// <param name="width">The width of the camera.</param> /// <param name="height">The height of the camera.</param> /// <param name="zoom">The scale at which to draw objects in the camera.</param> public GenCamera(float x, float y, int width, int height, float zoom) { _cameraRect = new Rectangle(0, 0, width, height); _cameraView = new GenAABB(0f, 0f, width, height); _centerPosition = new Vector2(_cameraView.MidpointX, _cameraView.MidpointY); _up = new Vector2(0f, -1f); RenderTarget = new RenderTarget2D(GenG.GraphicsDevice, width, height); PixelRenderTarget = new RenderTarget2D(GenG.GraphicsDevice, width, height); _backgroundTexture = GenU.MakeTexture(Color.White, 1, 1); Color = Color.White; BgColor = Color.Transparent; _scroll = Vector2.Zero; _oldScroll = _scroll; _velocity = Vector2.Zero; _rotation = 0f; Origin = new Vector2(width * 0.5f, height * 0.5f); Scale = Vector2.One; _drawPosition = new Vector2(x + Origin.X, y + Origin.Y); _initialZoom = zoom; Zoom = _initialZoom; CameraFollowType = FollowType.LockOn; _followTargets = new List<GenObject>(); FollowPosition = Vector2.Zero; FollowLeading = new Vector2(50, 30); _followStrength = 1f; MinZoom = _initialZoom; MaxZoom = 4f; _shakeOffset = Vector2.Zero; _shakeIntensity = 0f; _shakeDecreasing = false; _shakeTimer = new GenTimer(0f, null); SpriteEffect = SpriteEffects.None; _cameraEffect = new GenScreenEffect(_cameraRect); Transform = Matrix.Identity; // Set up the default camera blend state as alpha blend. BlendState = new BlendState(); BlendState.ColorSourceBlend = Blend.One; BlendState.ColorDestinationBlend = Blend.InverseSourceAlpha; BlendState.ColorBlendFunction = BlendFunction.Add; BlendState.AlphaSourceBlend = Blend.One; BlendState.AlphaDestinationBlend = Blend.InverseSourceAlpha; BlendState.AlphaBlendFunction = BlendFunction.Add; }
public override void OnUserSay(RoomUser RoomUser, string string_0) { RoomUser Pet = base.GetRoomUser(); //TODO: Pet Commands :D if (Pet.RoomBot.RoomUser_0 == null) { if (string_0.ToLower().Equals(Pet.PetData.Name.ToLower())) { Pet.method_9(Rotation.GetRotation(Pet.X, Pet.Y, RoomUser.X, RoomUser.Y)); } else { if (string_0.ToLower().StartsWith(Pet.PetData.Name.ToLower() + " ") && RoomUser.GetClient().GetHabbo().Username.ToLower() == base.GetRoomUser().PetData.OwnerName.ToLower()) { string key = string_0.Substring(Pet.PetData.Name.ToLower().Length + 1); if ((Pet.PetData.Energy >= 10 && this.method_4() < 6) || Pet.PetData.Level >= 15) { Pet.Statusses.Clear(); if (!Essential.GetGame().GetRoleManager().dictionary_5.ContainsKey(key)) { string[] array = new string[] { EssentialEnvironment.GetExternalText("pet_response_confused1"), EssentialEnvironment.GetExternalText("pet_response_confused2"), EssentialEnvironment.GetExternalText("pet_response_confused3"), EssentialEnvironment.GetExternalText("pet_response_confused4"), EssentialEnvironment.GetExternalText("pet_response_confused5"), EssentialEnvironment.GetExternalText("pet_response_confused6"), EssentialEnvironment.GetExternalText("pet_response_confused7") }; Random random = new Random(); Pet.HandleSpeech(null, array[random.Next(0, array.Length - 1)], false); } else { switch (Essential.GetGame().GetRoleManager().dictionary_5[key]) { case 0: // Remove Status RemovePetStatus(); this.SpeechTimer = 0; this.ActionTimer = 0; this.FollowType = FollowType.None; // Add Status Pet.Statusses.Add("sit", TextHandling.GetString(Pet.double_0)); break; case 1: this.ActionTimer = 25; this.FollowType = FollowType.None; // Remove Status RemovePetStatus(); Pet.PetData.AddExpirience(10, -10); // Give XP // Add Status Pet.Statusses.Add("sit", TextHandling.GetString(Pet.double_0)); break; case 2: this.ActionTimer = 30; this.FollowType = FollowType.None; // Remove Status RemovePetStatus(); Pet.PetData.AddExpirience(10, -10); // Give XP // Add Status Pet.Statusses.Add("lay", TextHandling.GetString(Pet.double_0)); break; case 3: this.ActionTimer = 30; this.FollowType = FollowType.None; RemovePetStatus(); int NewX = RoomUser.X; int NewY = RoomUser.Y; #region Rotation if (RoomUser.BodyRotation == 4) { NewY = RoomUser.Y + 1; } else if (RoomUser.BodyRotation == 0) { NewY = RoomUser.Y - 1; } else if (RoomUser.BodyRotation == 6) { NewX = RoomUser.X - 1; } else if (RoomUser.BodyRotation == 2) { NewX = RoomUser.X + 1; } else if (RoomUser.BodyRotation == 3) { NewX = RoomUser.X + 1; NewY = RoomUser.Y + 1; } else if (RoomUser.BodyRotation == 1) { NewX = RoomUser.X + 1; NewY = RoomUser.Y - 1; } else if (RoomUser.BodyRotation == 7) { NewX = RoomUser.X - 1; NewY = RoomUser.Y - 1; } else if (RoomUser.BodyRotation == 5) { NewX = RoomUser.X - 1; NewY = RoomUser.Y + 1; } #endregion Pet.PetData.AddExpirience(11, -10); // Give XP Pet.MoveTo(NewX, NewY); break; case 4: this.ActionTimer = 10; this.FollowType = FollowType.None; //Remove Status RemovePetStatus(); Pet.PetData.AddExpirience(15, -13); // Give XP Pet.Statusses.Add("beg", TextHandling.GetString(Pet.double_0)); break; case 5: this.ActionTimer = 30; this.FollowType = FollowType.None; // Remove Status RemovePetStatus(); // Add Status Pet.Statusses.Add("ded", TextHandling.GetString(Pet.double_0)); Pet.PetData.AddExpirience(20, -18); // Give XP break; case 6: this.ActionTimer = 120; this.FollowType = FollowType.None; // Remove Status RemovePetStatus(); // Add Status Pet.Statusses.Add("sit", TextHandling.GetString(Pet.double_0)); Pet.PetData.AddExpirience(20, -18); // Give XP Pet.MoveTo(Pet.X, Pet.Y); break; case 7: this.ActionTimer = 120; this.FollowType = FollowType.Normal; this.FollowUser = RoomUser; Pet.PetData.AddExpirience(30, -30); // Give XP this.PetFollowUser(RoomUser, Pet, FollowType.Normal); break; case 8: //Stand break; case 9: this.ActionTimer = 5; this.FollowType = FollowType.None; // Remove Status RemovePetStatus(); // Add Status Pet.Statusses.Add("jmp", TextHandling.GetString(Pet.double_0)); Pet.PetData.AddExpirience(35, -30); // Give XP break; case 10: // Remove Status RemovePetStatus(); Pet.PetData.AddExpirience(35, -30); // Give XP this.SpeechTimer = 2; this.FollowType = FollowType.None; break; case 11: //Play break; case 12: // Remove Status RemovePetStatus(); Pet.PetData.AddExpirience(35, -30); // Give XP this.SpeechTimer = 120; this.FollowType = FollowType.None; break; case 13: //Nest Pesä this.ActionTimer = 30; List<RoomItem> Nests = new List<RoomItem>(); foreach (RoomItem PetItem in this.GetRoomUser().GetRoom().Hashtable_0.Values) { if (PetItem.GetBaseItem().InteractionType.ToLower() == "pet_nest") { Nests.Add(PetItem); } } if (Nests.Count == 0) { return; } int PetNX = Nests[new Random().Next(0, Nests.Count - 1)].GetX; int PetNY = Nests[new Random().Next(0, Nests.Count - 1)].Int32_1; Pet.MoveTo(PetNX, PetNY); Nests.Clear(); Nests = null; Pet.PetData.AddExpirience(15, -10); // Give XP break; case 14: //Drink this.ActionTimer = 30; List<RoomItem> Drinks = new List<RoomItem>(); foreach (RoomItem PetItem in this.GetRoomUser().GetRoom().Hashtable_0.Values) { if (PetItem.GetBaseItem().InteractionType.ToLower() == "pet_drink") { Drinks.Add(PetItem); } } if (Drinks.Count == 0) { return; } int PetDX = Drinks[new Random().Next(0, Drinks.Count - 1)].GetX; int PetDY = Drinks[new Random().Next(0, Drinks.Count - 1)].Int32_1; Pet.MoveTo(PetDX, PetDY); Drinks.Clear(); Drinks = null; Pet.PetData.AddExpirience(25, -10); // Give XP break; case 15: this.ActionTimer = 120; this.FollowType = FollowType.Left; this.FollowUser = RoomUser; Pet.PetData.AddExpirience(35, -30); // Give XP this.PetFollowUser(RoomUser, Pet, FollowType.Left); break; case 16: this.FollowType = FollowType.Right; this.FollowUser = RoomUser; Pet.PetData.AddExpirience(35, -30); // Give XP this.PetFollowUser(RoomUser, Pet, FollowType.Right); break; case 17: //Play football break; case 24: //Move forwar break; case 25: //Turn left break; case 26: //Turn right break; case 43: //Eat break; } } } else { string[] array2 = new string[] { EssentialEnvironment.GetExternalText("pet_response_sleeping1"), EssentialEnvironment.GetExternalText("pet_response_sleeping2"), EssentialEnvironment.GetExternalText("pet_response_sleeping3"), EssentialEnvironment.GetExternalText("pet_response_sleeping4"), EssentialEnvironment.GetExternalText("pet_response_sleeping5") }; string[] array3 = new string[] { EssentialEnvironment.GetExternalText("pet_response_refusal1"), EssentialEnvironment.GetExternalText("pet_response_refusal2"), EssentialEnvironment.GetExternalText("pet_response_refusal3"), EssentialEnvironment.GetExternalText("pet_response_refusal4"), EssentialEnvironment.GetExternalText("pet_response_refusal5") }; Pet.int_10 = Pet.int_12; Pet.int_11 = Pet.int_13; Pet.Statusses.Clear(); if (Pet.PetData.Energy < 10) { Random random2 = new Random(); Pet.HandleSpeech(null, array2[random2.Next(0, array2.Length - 1)], false); if (Pet.PetData.Type != 13u) { Pet.Statusses.Add("lay", Pet.double_0.ToString()); } else { Pet.Statusses.Add("lay", (Pet.double_0 - 1.0).ToString()); } this.SpeechTimer = 25; this.ActionTimer = 20; base.GetRoomUser().PetData.PetEnergy(25); } else { Random random2 = new Random(); Pet.HandleSpeech(null, array3[random2.Next(0, array3.Length - 1)], false); } } Pet.UpdateNeeded = true; } } } }
public override void OnTimerTick() { if (this.SpeechTimer <= 0) { RoomUser @class = base.GetRoomUser(); string[] array = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_dog1"), EssentialEnvironment.GetExternalText("pet_chatter_dog2"), EssentialEnvironment.GetExternalText("pet_chatter_dog3"), EssentialEnvironment.GetExternalText("pet_chatter_dog4"), EssentialEnvironment.GetExternalText("pet_chatter_dog5") }; string[] array2 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_cat1"), EssentialEnvironment.GetExternalText("pet_chatter_cat2"), EssentialEnvironment.GetExternalText("pet_chatter_cat3"), EssentialEnvironment.GetExternalText("pet_chatter_cat4"), EssentialEnvironment.GetExternalText("pet_chatter_cat5") }; string[] array3 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_croc1"), EssentialEnvironment.GetExternalText("pet_chatter_croc2"), EssentialEnvironment.GetExternalText("pet_chatter_croc3"), EssentialEnvironment.GetExternalText("pet_chatter_croc4"), EssentialEnvironment.GetExternalText("pet_chatter_croc5") }; string[] array4 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_dog1"), EssentialEnvironment.GetExternalText("pet_chatter_dog2"), EssentialEnvironment.GetExternalText("pet_chatter_dog3"), EssentialEnvironment.GetExternalText("pet_chatter_dog4"), EssentialEnvironment.GetExternalText("pet_chatter_dog5") }; string[] array5 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_bear1"), EssentialEnvironment.GetExternalText("pet_chatter_bear2"), EssentialEnvironment.GetExternalText("pet_chatter_bear3"), EssentialEnvironment.GetExternalText("pet_chatter_bear4"), EssentialEnvironment.GetExternalText("pet_chatter_bear5") }; string[] array6 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_pig1"), EssentialEnvironment.GetExternalText("pet_chatter_pig2"), EssentialEnvironment.GetExternalText("pet_chatter_pig3"), EssentialEnvironment.GetExternalText("pet_chatter_pig4"), EssentialEnvironment.GetExternalText("pet_chatter_pig5") }; string[] array7 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_lion1"), EssentialEnvironment.GetExternalText("pet_chatter_lion2"), EssentialEnvironment.GetExternalText("pet_chatter_lion3"), EssentialEnvironment.GetExternalText("pet_chatter_lion4"), EssentialEnvironment.GetExternalText("pet_chatter_lion5") }; string[] array8 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_rhino1"), EssentialEnvironment.GetExternalText("pet_chatter_rhino2"), EssentialEnvironment.GetExternalText("pet_chatter_rhino3"), EssentialEnvironment.GetExternalText("pet_chatter_rhino4"), EssentialEnvironment.GetExternalText("pet_chatter_rhino5") }; string[] array9 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_spider1"), EssentialEnvironment.GetExternalText("pet_chatter_spider2"), EssentialEnvironment.GetExternalText("pet_chatter_spider3"), EssentialEnvironment.GetExternalText("pet_chatter_spider4"), EssentialEnvironment.GetExternalText("pet_chatter_spider5") }; string[] array10 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_turtle1"), EssentialEnvironment.GetExternalText("pet_chatter_turtle2"), EssentialEnvironment.GetExternalText("pet_chatter_turtle3"), EssentialEnvironment.GetExternalText("pet_chatter_turtle4"), EssentialEnvironment.GetExternalText("pet_chatter_turtle5") }; string[] array11 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_chic1"), EssentialEnvironment.GetExternalText("pet_chatter_chic2"), EssentialEnvironment.GetExternalText("pet_chatter_chic3"), EssentialEnvironment.GetExternalText("pet_chatter_chic4"), EssentialEnvironment.GetExternalText("pet_chatter_chic5") }; string[] array12 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_frog1"), EssentialEnvironment.GetExternalText("pet_chatter_frog2"), EssentialEnvironment.GetExternalText("pet_chatter_frog3"), EssentialEnvironment.GetExternalText("pet_chatter_frog4"), EssentialEnvironment.GetExternalText("pet_chatter_frog5") }; string[] array13 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_dragon1"), EssentialEnvironment.GetExternalText("pet_chatter_dragon2"), EssentialEnvironment.GetExternalText("pet_chatter_dragon3"), EssentialEnvironment.GetExternalText("pet_chatter_dragon4"), EssentialEnvironment.GetExternalText("pet_chatter_dragon5") }; string[] array14 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_horse1"), EssentialEnvironment.GetExternalText("pet_chatter_horse2"), EssentialEnvironment.GetExternalText("pet_chatter_horse3"), EssentialEnvironment.GetExternalText("pet_chatter_horse4"), EssentialEnvironment.GetExternalText("pet_chatter_horse5") }; string[] array15 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_monkey1"), EssentialEnvironment.GetExternalText("pet_chatter_monkey2"), EssentialEnvironment.GetExternalText("pet_chatter_monkey3"), EssentialEnvironment.GetExternalText("pet_chatter_monkey4"), EssentialEnvironment.GetExternalText("pet_chatter_monkey5") }; string[] array16 = new string[] { EssentialEnvironment.GetExternalText("pet_chatter_generic1"), EssentialEnvironment.GetExternalText("pet_chatter_generic2"), EssentialEnvironment.GetExternalText("pet_chatter_generic3"), EssentialEnvironment.GetExternalText("pet_chatter_generic4"), EssentialEnvironment.GetExternalText("pet_chatter_generic5") }; string[] array17 = new string[] { "sit", "lay", "snf", "ded", "jmp", "snf", "sit", "snf" }; string[] array18 = new string[] { "sit", "lay" }; string[] array19 = new string[] { "wng", "grn", "flm", "std", "swg", "sit", "lay", "snf", "plf", "jmp", "flm", "crk", "rlx", "flm" }; if (@class != null) { Random random = new Random(); int num = Essential.smethod_5(1, 4); if (num == 2) { @class.Statusses.Clear(); if (base.GetRoomUser().RoomBot.RoomUser_0 == null) { if (@class.PetData.Type == 13u) { @class.Statusses.Add(array18[random.Next(0, array18.Length - 1)], @class.double_0.ToString()); } else { if (@class.PetData.Type != 12u) { @class.Statusses.Add(array17[random.Next(0, array17.Length - 1)], @class.double_0.ToString()); } else { @class.Statusses.Add(array19[random.Next(0, array19.Length - 1)], @class.double_0.ToString()); } } } } switch (@class.PetData.Type) { case 0u: @class.HandleSpeech(null, array[random.Next(0, array.Length - 1)], false); break; case 1u: @class.HandleSpeech(null, array2[random.Next(0, array2.Length - 1)], false); break; case 2u: @class.HandleSpeech(null, array3[random.Next(0, array3.Length - 1)], false); break; case 3u: @class.HandleSpeech(null, array4[random.Next(0, array4.Length - 1)], false); break; case 4u: @class.HandleSpeech(null, array5[random.Next(0, array5.Length - 1)], false); break; case 5u: @class.HandleSpeech(null, array6[random.Next(0, array6.Length - 1)], false); break; case 6u: @class.HandleSpeech(null, array7[random.Next(0, array7.Length - 1)], false); break; case 7u: @class.HandleSpeech(null, array8[random.Next(0, array8.Length - 1)], false); break; case 8u: @class.HandleSpeech(null, array9[random.Next(0, array9.Length - 1)], false); break; case 9u: @class.HandleSpeech(null, array10[random.Next(0, array10.Length - 1)], false); break; case 10u: @class.HandleSpeech(null, array11[random.Next(0, array11.Length - 1)], false); break; case 11u: @class.HandleSpeech(null, array12[random.Next(0, array12.Length - 1)], false); break; case 12u: @class.HandleSpeech(null, array13[random.Next(0, array13.Length - 1)], false); break; case 13u: @class.HandleSpeech(null, array14[random.Next(0, array14.Length - 1)], false); break; case 14u: @class.HandleSpeech(null, array15[random.Next(0, array15.Length - 1)], false); break; default: @class.HandleSpeech(null, array16[random.Next(0, array16.Length - 1)], false); break; } } this.SpeechTimer = Essential.smethod_5(30, 120); } else { this.SpeechTimer--; } if (this.ActionTimer <= 0) { base.GetRoomUser().PetData.PetEnergy(10); if (base.GetRoomUser().RoomBot.RoomUser_0 == null) { this.method_5(0, 0, true); } this.ActionTimer = 30; this.FollowType = FollowType.None; this.FollowUser = null; } else { this.ActionTimer--; if (this.FollowType != FollowType.None && this.FollowUser != null) { this.PetFollowUser(this.FollowUser, base.GetRoomUser(), this.FollowType); } } }
/// <summary> /// Check to see if the current user is following one or more artists or other Spotify users. /// </summary> /// <param name="followType">The ID type: either artist or user.</param> /// <param name="ids">A list of the artist or the user Spotify IDs to check</param> /// <returns></returns> /// <remarks>AUTH NEEDED</remarks> public string IsFollowing(FollowType followType, List<String> ids) { return $"{APIBase}/me/following/contains?type={followType.GetStringAttribute("")}&ids={string.Join(",", ids)}"; }
public void SetNoticeInfo(string mainString, string subString, NoticeType type = NoticeType.Warning, float distance = 0.8f, AlignmentType _anchorType = AlignmentType.Center, FollowType isFollower = FollowType.True) { SetMainText(mainString); SetSubText(subString); SetIsFollow(isFollower); SetDistance(distance); SetIconTip(type); SetTextAnchor(_anchorType); }
public void PetFollowUser(RoomUser RoomUser, RoomUser Pet, FollowType FollowType) { RemovePetStatus(); int NewX = RoomUser.X; int NewY = RoomUser.Y; #region Rotation if (RoomUser.BodyRotation == 4) { if (FollowType == FollowType.Normal) { NewY = RoomUser.Y - 1; } else if (FollowType == FollowType.Left) { NewX = RoomUser.X + 1; } if (FollowType == FollowType.Right) { NewX = RoomUser.X - 1; } } else if (RoomUser.BodyRotation == 0) { if (FollowType == FollowType.Normal) { NewY = RoomUser.Y + 1; } else if (FollowType == FollowType.Left) { NewX = RoomUser.X - 1; } if (FollowType == FollowType.Right) { NewX = RoomUser.X + 1; } } else if (RoomUser.BodyRotation == 6) { if (FollowType == FollowType.Normal) { NewX = RoomUser.X + 1; } else if (FollowType == FollowType.Left) { NewY = RoomUser.Y + 1; } if (FollowType == FollowType.Right) { NewY = RoomUser.Y - 1; } } else if (RoomUser.BodyRotation == 2) { if (FollowType == FollowType.Normal) { NewX = RoomUser.X - 1; } else if (FollowType == FollowType.Left) { NewY = RoomUser.Y - 1; } if (FollowType == FollowType.Right) { NewY = RoomUser.Y + 1; } } else if (RoomUser.BodyRotation == 3) { if (FollowType == FollowType.Normal) { NewX = RoomUser.X - 1; NewY = RoomUser.Y - 1; } else if (FollowType == FollowType.Left) { NewY = RoomUser.Y - 1; } if (FollowType == FollowType.Right) { NewX = RoomUser.X - 1; } } else if (RoomUser.BodyRotation == 1) { if (FollowType == FollowType.Normal) { NewX = RoomUser.X - 1; NewY = RoomUser.Y + 1; } else if (FollowType == FollowType.Left) { NewX = RoomUser.X - 1; } if (FollowType == FollowType.Right) { NewY = RoomUser.Y + 1; } } else if (RoomUser.BodyRotation == 7) { if (FollowType == FollowType.Normal) { NewX = RoomUser.X + 1; NewY = RoomUser.Y + 1; } else if (FollowType == FollowType.Left) { NewY = RoomUser.Y + 1; } if (FollowType == FollowType.Right) { NewX = RoomUser.X + 1; } } else if (RoomUser.BodyRotation == 5) { if (FollowType == FollowType.Normal) { NewX = RoomUser.X + 1; NewY = RoomUser.Y - 1; } else if (FollowType == FollowType.Left) { NewX = RoomUser.X + 1; } if (FollowType == FollowType.Right) { NewY = RoomUser.Y - 1; } } #endregion if (Pet.X != NewX && Pet.Y != NewY) { Pet.MoveTo(NewX, NewY); } }
/// <summary> /// Append the specified longType and followType. /// </summary> /// <param name="longType">Long type.</param> /// <param name="followType">Follow type.</param> private void Append(ConstantParameterType longType, FollowType followType){ byte b = (byte)((byte)ParameterFormat.Long| (byte) ParameterType.Constant | (byte) longType | (byte)followType); Append (b); }
public Following(FollowType t, int i) { Type = t; index = i; }
/// <summary> /// Remove the current user as a follower of one or more artists or other Spotify users. /// </summary> /// <param name="followType">The ID type: either artist or user.</param> /// <returns></returns> /// <remarks>AUTH NEEDED</remarks> public string Unfollow(FollowType followType) { return $"{APIBase}/me/following?type={followType.GetStringAttribute("")}"; }