public void FirstWink() { //turns on stars at the start of the game ProximateStars = GameObject.FindGameObjectsWithTag("Star"); if (!reachedSol) { for (int b = 0; b < ProximateStars.Length; b++) { //Debug.Log ("proximate stars "+ ProximateStars.Length); StarScript = ProximateStars [b].GetComponent<starscript> (); StarScript.SpecialWinkin (); } } }
public void SecondWink() { ProximateStars = GameObject.FindGameObjectsWithTag("Star"); if (!reachedSol) { for (int b = 0; b < ProximateStars.Length; b++) { //Debug.Log ("proximate stars "+ ProximateStars.Length); StarScript = ProximateStars [b].GetComponent<starscript> (); if (Playerscript.endMarker != null && Playerscript.endMarker.position != ProximateStars [b].transform.position) { StarScript.Winkin (); } } } }
public void ArriveAtStarStory() { StarScript = GameObject.Find (Playerscript.currentStar).GetComponent<starscript> (); if (Playerscript.currentStar == "Mara") { MaraStory (); } if(Playerscript.currentStar != "Wormhole Entrance"){ planets = StarScript.numplanets; string type = StarScript.StarType; currentStar = StarScript.name; //if the captain has 2 or more companions if(crewmembers.Count >= 3){ int whichStory = Random.Range (1, 10); if (whichStory >= 1 && whichStory < 4) { TravelStory1 (Playerscript.currentStar, planets, type); //enter, react, extract. Structured } if (whichStory >= 4 && whichStory <= 9) { TravelStory3 (Playerscript.currentStar, type); // reaction to star. One sentence. } if (whichStory == 10) { TravelStory4 (Playerscript.currentStar); // reminder of earth } } } //if captain has a single companion if(crewmembers.Count == 2) CaptainAndCompanionVisit(planets); //if captain visits alone if(crewmembers.Count == 1) CaptainAloneVisit(); ClearParts (); }
void MissionDecision() { StarScript = GameObject.Find (Playerscript.currentStar).GetComponent<starscript> (); DecidePlanet(); DecideResource(); DecideNameToUse(); if(resourceOfTheMoment=="water") WaterMission(); if(resourceOfTheMoment=="food") FoodMission(); if(resourceOfTheMoment=="fuel") FuelMission(); choice1.text = "Launch Mission\n(High Risk)"; choice1string = "missionyes"; choice2.text = "Leave"; choice2string = "missionno"; }
void JumpToWormOut() { endMarker = GameObject.Find ("Wormhole Exit").transform; starTarget = endMarker.position + new Vector3(0.0f,5f,0.0f); startMarker = transform; transform.LookAt(starTarget); starTargetRot = transform.rotation; rotated = false; startRot = transform.rotation; StarScript = endMarker.GetComponent<starscript>(); targetDir = starTarget - transform.position; journeyLength = Vector3.Distance (startMarker.position, starTarget); gmscript.WinkOutAllStars(); showMissionButton = false; //GameObject.Find("cones").GetComponent<seekcone>().StopSeeking(); wormholejumping = true; //play initial jump sound AudioSource soundeffect = GameObject.Find("effect").GetComponent<AudioSource>(); soundeffect.GetComponent<AudioSource>().clip = wormholeenter; soundeffect.Play (); //start playing turn sound PlayWarp(); }
void ClickEffect() { if(lastStarVisited!="") //if just starting out, don't do this GameObject.Find(lastStarVisited).GetComponent<starscript>().visited = true; //tell the star you've been at that it has been visited. if (endMarker != null && endMarker.name != lastStarVisited) { //clicked on a star clickedOnStar = true; if(endMarker.name != "Wormhole Entrance"){ starTarget = endMarker.position + new Vector3(0.0f,5f,0.0f); } else{ starTarget = endMarker.position; } startMarker = transform; transform.LookAt(starTarget); starTargetRot = transform.rotation; transform.rotation = startRot; StarScript = endMarker.GetComponent<starscript>(); targetDir = starTarget - transform.position; journeyLength = Vector3.Distance (startMarker.position, starTarget); gmscript.WinkOutAllStars(); jumps+=1; Storybox.jumpCount = jumps; //GameObject.Find("cones").GetComponent<seekcone>().StopSeeking(); PlayWarp(); if (readinglock == false){ //captains log entries will only read after the first jump readinglock = true; showEarthDist = false; } //make thrusters big GameObject[] thrusters = GameObject.FindGameObjectsWithTag("Thruster"); //thrusters[0].gameObject.GetComponent<ParticleSystem>().startSize *=1.5f; //thrusters[1].gameObject.GetComponent<ParticleSystem>().startSize *=1.5f; //thrusters[2].gameObject.GetComponent<ParticleSystem>().startSize *=1.5f; } }