IEnumerator pushPlant(Freeroam p) { if (watered) { yield return(StartCoroutine(showText("This plant has been watered. It is now too heavy to move."))); } else { //if there is nothing in front of us Rigidbody2D prb = p.GetComponent <Rigidbody2D>(); for (float distMoved = 0; distMoved < toMove;) { float delta = toMove / 50; rb.constraints = RigidbodyConstraints2D.FreezeRotation; rb.MovePosition((Vector2)transform.position + p.direction * delta); prb.MovePosition((Vector2)p.transform.position + p.direction * delta); distMoved += delta; yield return(new WaitForSeconds(0.01f)); rb.constraints = RigidbodyConstraints2D.FreezeAll; } } }
override public IEnumerator run(Freeroam p) { p.freeze(); yield return(StartCoroutine(display() /*display connected image*/)); p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); yield return(StartCoroutine(pushPlant(p))); p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); yield return(StartCoroutine(showImage(image))); p.unfreeze(); }
// Start is called before the first frame update override public IEnumerator run(Freeroam p) { p.freeze(); EventTracker.calendarSeen = true; yield return(StartCoroutine(showText("Today is January 20th"))); p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); EventTracker.faucetOn = true; yield return(StartCoroutine(showText("The water lines are working again"))); p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); EventTracker.hasKey = true; yield return(StartCoroutine(showText("You picked up the office key"))); p.unfreeze(); Destroy(gameObject); }
override public IEnumerator run(Freeroam p) { p.freeze(); if (!EventTracker.movedBS) { yield return(StartCoroutine(showText("The handle rattles, but the door remains closed."))); } p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); yield return(StartCoroutine(showImage(image))); yield return(StartCoroutine(showText("oh, yeah, my Sister's Birthday is coming up"))); EventTracker.foundBday = true; p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); EventTracker.hasJacket = true; door.opened(); //switch character sprite to jacket version yield return(StartCoroutine(showText("You grab your jacket"))); p.unfreeze(); Destroy(gameObject); }
override public IEnumerator run(Freeroam p) { p.freeze(); //freeze the player // print("frozen"); yield return(StartCoroutine(showImage(testImage))); //Wait for display interactions yield return(StartCoroutine(showText("we"))); yield return(StartCoroutine(showImageAndText(testImage, "we"))); p.unfreeze(); //unfreeze after display is finished // print("unfrozen"); }
override public IEnumerator run(Freeroam p) { p.freeze(); if (!EventTracker.faucetOn && !debugWater) { yield return(StartCoroutine(showText("This is labeled as the sprinkler system for another room, but the water lines are off"))); } else { yield return(StartCoroutine(showText("You hear water falling from beyond the current room"))); yield return(StartCoroutine(turnOnWater())); } p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); if (!EventTracker.movedBS) { //move bookshelf EventTracker.movedBS = true; door.unlock(); yield return(StartCoroutine(showText("The bookshelf is back where it is supposed to be, but the books are all out of order."))); yield return(StartCoroutine(showText("Oh no"))); yield return(StartCoroutine(bookshelf())); } p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); if (EventTracker.Oclosed == true && EventTracker.hasKey == true) { EventTracker.Oclosed = false; yield return(StartCoroutine(showText("The door became unlocked and swings open"))); dor.isTrigger = true; } else if (EventTracker.Oclosed == true) { yield return(StartCoroutine(showText("The door appears to be locked"))); } p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); if (!EventTracker.foundRope) { yield return(StartCoroutine(showText("This doesn't seem to be useful"))); } else { EventTracker.hasSS = true; yield return(StartCoroutine(showText("You pick up the step stool"))); } p.unfreeze(); if (EventTracker.hasSS) { Destroy(gameObject); } }
override public IEnumerator run(Freeroam p) { p.freeze(); if (EventTracker.Vclosed && EventTracker.hasSD) { //remove screwdriver from inventory and unscrew vent yield return(StartCoroutine(showText("With the screwdriver, you manage to open the vent"))); EventTracker.Vclosed = false; col.isTrigger = true; } else if (!EventTracker.hasSD) { yield return(StartCoroutine(showText("This is the air vent to the Break Room.\nIt is screwed on pretty tight"))); EventTracker.foundVent = true; } p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); if (!EventTracker.hasSS) { yield return(StartCoroutine(showText("This must be how I can go upstairs"))); yield return(StartCoroutine(showText("But I am too short to reach it"))); EventTracker.foundRope = true; } else { //place down stepstool yield return(StartCoroutine(showText("With the stepstool, you are able to reach the rope and pull down the stairs"))); col.isTrigger = true; } p.unfreeze(); }
override public IEnumerator run(Freeroam p) { p.freeze(); if (!EventTracker.hasJacket) { yield return(StartCoroutine(showText("As you open the door, the room beyond is too cold and you step back, letting the door swing close"))); } if (EventTracker.hasDS && !EventTracker.usedDS) { yield return(StartCoroutine(showText("You place the door stop in the door, keeping it open and letting the fog inside clear up"))); EventTracker.usedDS = true; } else if (!EventTracker.usedDS) { yield return(StartCoroutine(showText("Inside, there is heavy fog that you cannot see through"))); } /*if(EventTracker.CRclosed){ * yield return StartCoroutine(showText("There does not appear to be any way to open this door")); * } * else if(!EventTracker.hasJacket){ * yield return StartCoroutine(showText("It is too cold to go in there")); * } * else{ * //open path * if(EventTracker.hasDS){ * //option to put down door stop * EventTracker.usedDS = true;; * //clear's mist * yield return StartCoroutine(showText("Because the door isn't keeping it in anymore, the fog in the room clears up")); * } * else{ * //fog covers screen * } * * }*/ p.unfreeze(); }
public void receiveControl(Freeroam p) { StartCoroutine(run(p)); }
override public IEnumerator run(Freeroam p) { yield return(0); }
public abstract IEnumerator run(Freeroam p);
override public IEnumerator run(Freeroam p) { p.freeze(); //check hooks if (!EventTracker.plantsWatered || !EventTracker.usedDS || !EventTracker.foundBday || !EventTracker.movedBS || !EventTracker.hasJacket) { yield return(StartCoroutine(showText("The safe is locked. I need the code to open it.") /*or open and get journel*/)); yield return(StartCoroutine(showText("There is a hint on a sticky note. 'Red Flowers, Encyclopedia of Memory, Sibling's Birthday."))); } else { yield return(StartCoroutine(showText("You enter the code, '113120', and the safe opens. There's a jounral inside."))); yield return(StartCoroutine(showText("'It looks familiar, it must be mine!'"))); yield return(StartCoroutine(showText("January 1st. I've been forgetting things a lot. If I remember to write"))); yield return(StartCoroutine(showText("in here then it will be fine, haha. I’ll just use this to save like in a video game!"))); yield return(StartCoroutine(showText("January 5th. I forgot a few orders today, and I’ve been forgetting about this journal."))); yield return(StartCoroutine(showText("Lily wasn’t very happy when I forgot we had plans today. I think she realizes something is wrong."))); yield return(StartCoroutine(showText("January 7th. Lily realized I’m forgetting things."))); yield return(StartCoroutine(showText("I forgot too much and she noticed. I think she might have found my doctors report when she visited."))); yield return(StartCoroutine(showText(" I can’t remember if she did or not."))); yield return(StartCoroutine(showText("January 9th. It’s been tough remembering to do anything recently."))); yield return(StartCoroutine(showText(" I’ve been forgetting to water the plants, forgetting to do orders, forgetting what I’m doing."))); yield return(StartCoroutine(showText("January 11th. Lily told our parents about my condition."))); yield return(StartCoroutine(showText(" They want me to close the shop and focus on my health. But I can’t do that, I have to preserve my shop."))); yield return(StartCoroutine(showText(" If I close, I’ll lose business and I’ll lose the store. I have to prevent myself from forgetting!"))); yield return(StartCoroutine(showText("January 13th. Lily’s birthday is January 20th. Lily is my sister."))); yield return(StartCoroutine(showText(" I have a present for her that I’ll leave with the journal. I can’t remember anything anymore."))); yield return(StartCoroutine(showText("I’m afraid that I’ll forget about my family and my store."))); yield return(StartCoroutine(showText("...The entries end there."))); if (EventTracker.calendarSeen) { //good end yield return(StartCoroutine(showText("Wait a second, oday is January 20th! That’s what I was forgetting!"))); yield return(StartCoroutine(showText(" Well, I was forgetting everything, I suppose. Wait, I need to go now! Before I forget again!"))); yield return(StartCoroutine(showText("I have my journal and Lily’s present; I should be good to go!"))); p.finalReset(); //stubbed, do ending crap } else { //audi.Play(); yield return(StartCoroutine(showText("'I’ve been forgetting everything. This is bad. What will happen if I keep forgetting?"))); yield return(StartCoroutine(showText(" I can’t lose my shop, or forget my family. I... I have to preserve it...'"))); p.finalReset(); } } p.unfreeze(); }