public Parrot(ParrotPlatform platform, int x, int y, bool facing_right, bool facing_up) { _platform = platform; texture = Game1.temporaryContent.Load <Texture2D>("LooseSprites\\parrots"); position = new Vector2(x, y); anchorPosition = position; facingRight = facing_right; facingUp = facing_up; swayOffset = Utility.RandomFloat(0f, 100f); }
public virtual void Activate() { List <Response> responses = new List <Response>(); foreach (KeyValuePair <string, KeyValuePair <string, Point> > destination in GetDestinations()) { if (destination.Key != currentLocationKey) { responses.Add(new Response("Go" + destination.Key, Game1.content.LoadString("Strings\\UI:ParrotPlatform_" + destination.Key))); } } responses.Add(new Response("Cancel", Game1.content.LoadString("Strings\\Locations:MineCart_Destination_Cancel"))); Game1.currentLocation.createQuestionDialogue(Game1.content.LoadString("Strings\\UI:ParrotPlatform_Question"), responses.ToArray(), "ParrotPlatform"); activePlatform = this; }
public virtual bool AnswerQuestion(Response answer) { if (this == activePlatform) { if (Game1.currentLocation.lastQuestionKey != null && Game1.currentLocation.afterQuestion == null && (Game1.currentLocation.lastQuestionKey.Split(' ')[0] + "_" + answer.responseKey).StartsWith("ParrotPlatform_Go")) { string destination_key = answer.responseKey.Substring(2); foreach (KeyValuePair <string, KeyValuePair <string, Point> > destination in GetDestinations()) { if (destination.Key == destination_key) { currentDestination = destination; break; } } StartDeparture(); return(true); } activePlatform = null; } return(false); }
public virtual void Cleanup() { activePlatform = null; }