void Awake() { pod = GameObject.FindGameObjectWithTag("Player"); script = pod.GetComponent<DropPod>(); podPos = pod.transform.position; explosion = false; play = false; min = -0.21f; max = 0.21f; offset = midSpeedOffset; location = 0.7f; //curve = new AnimationCurve(); Vector3 temp = transform.position; temp.y = 0.7f; transform.position = temp; if (!startOfGame) { temp.y = podPos.y; transform.position = temp; } else { /*for (index = 0; location < startPos.y; index++) { curve.AddKey(KeyframeUtil.GetNew(Time.time + index, location, TangentMode.Linear)); location += scartScrollDistancePS; } curve.AddKey(KeyframeUtil.GetNew(Time.time + index, startPos.y, TangentMode.Linear)); curve.UpdateAllLinearTangents();*/ } startPos = transform.position; timeStep = 1.0f / ((podPos.y - startPos.y) / maxVelocity); timer = 0.0f; }
private void interceptPods(bool flag_InterceptDropPod) { if (!this.shieldInterceptDropPod || !flag_InterceptDropPod) { return; } IEnumerable <Thing> source = (IEnumerable <Thing>)Find.get_ListerThings().ThingsOfDef((ThingDef)ThingDefOf.DropPod); if (source == null) { return; } using (List <Thing> .Enumerator enumerator = source.Where <Thing>((Func <Thing, bool>)(t => { IntVec3 position = t.get_Position(); // ISSUE: explicit reference operation return(((IntVec3)@position).InHorDistOf(this.position, (float)this.shieldShieldRadius)); })).ToList <Thing>().GetEnumerator()) { while (enumerator.MoveNext()) { DropPod current = (DropPod)enumerator.Current; ((Thing)current).Destroy((DestroyMode)0); BodyPartDamageInfo bodyPartDamageInfo = new BodyPartDamageInfo(new BodyPartHeight?(), new BodyPartDepth?((BodyPartDepth)2)); ExplosionInfo explosionInfo = (ExplosionInfo)null; explosionInfo.center = (__Null)((Thing)current).get_Position(); explosionInfo.radius = (__Null)1.0; explosionInfo.dinfo = (__Null) new DamageInfo((DamageDef)DamageDefOf.Flame, 10, (Thing)current, new BodyPartDamageInfo?(), (ThingDef)null); // ISSUE: explicit reference operation ((ExplosionInfo)@explosionInfo).DoExplosion(); } } }
// Use this for initialization void Start() { txt = GetComponent<Text>(); GameObject go = GameObject.Find("GUIManager"); GUIHandler guih = go.GetComponent<GUIHandler>(); pod = guih.pod; }
// Use this for initialization void Awake () { motionBlur = GetComponent<CameraMotionBlur>(); pod = (GameObject.FindGameObjectWithTag("Player")).GetComponent<DropPod>(); // Make sure that the velocity starts at zero motionBlur.velocityScale = 0; }
protected override void Awake() { base.Awake(); m_pod = GetComponent<DropPod>(); Handler = GameObject.Find("Input Handler"); Ihandler = Handler.GetComponent<InputHandler>(); }
private void OnTriggerEnter2D(Collider2D c) { GameObject other = c.gameObject; sc = other.GetComponent<DropPod>(); if (other.tag.Equals("Player")) { Destroy(GetComponent<CircleCollider2D>()); Destroy(model); Explode(); } }
// Use this for initialization void Start () { img = GetComponent<RectTransform>(); pod = transform.root.GetComponent<GUIHandler>().pod; }
// Use this for initialization void Start () { txt = GetComponent<Text>(); guih = transform.root.GetComponent<GUIHandler>(); pod = guih.pod; }
// Use this for initialization void Awake () { GameObject go = GameObject.FindGameObjectWithTag("Player"); m_pod = go.GetComponent<DropPod>(); }
bool CheckGoal(int choice) { if (currentGoalListenerIndex >= 0) { float successRate = -1; string type = "null"; if (choice == 0) { successRate = ironRate; type = "Refined Iron"; } else if (choice == 1) { successRate = copperRate; type = "Refined Copper"; } else if (choice == 2) { successRate = brickRate; type = "Brick"; } else if (choice == 3) { successRate = pycreteRate; type = "Pycrete"; } if (successRate >= currentGoalListenerRate) { aGoalHasBeenMet = true; //succeeded goal DropPod pod = Instantiate(dropPodAnim, Vector3.zero, Quaternion.identity); //calculate reward string rewardType = "null"; int timeSinceStart = Mathf.RoundToInt(Time.time) - timeOfStart; int reward = Mathf.Clamp((Mathf.RoundToInt(successRate * 500)) - timeSinceStart, 100, 2000); // reward based on how well the player did //now find the weakest inv type int curIro = inv.storedVals["Refined Iron"]; int curCop = inv.storedVals["Refined Copper"]; int curPyc = inv.storedVals["Pycrete"]; int curBri = inv.storedVals["Brick"]; int smallest = Mathf.Min(curIro, curCop, curPyc, curBri); if (smallest == curIro) { rewardType = "Refined Iron"; } if (smallest == curCop) { rewardType = "Refined Copper"; } if (smallest == curPyc) { rewardType = "Pycrete"; } if (smallest == curBri) { rewardType = "Brick"; } ///it is clamped between 100 and 2000 to make it not too op ///If the reward is tiny at 100, play a flavor message saying words of deprecational encouragement ///if it is greater than 1500, say they have done very well. ///You can pull teh flavor from the Europa writing doc if (reward <= 100) { cons?.AddLine("We are dissapointed in you commander. A light pod of " + rewardType + " is being dropped in, but you make it difficult to justify the investment. The survival of our company depends on our victory in this race, now act like it!"); } else if (reward >= 1500) { cons?.AddLine("Amazing work, commander! A large payload of " + rewardType + " is being dropped from the sat. Keep it up, and we might just come out on top"); } else { cons?.AddLine("Well done. You have met the production goal within the expected parameters. A reward of " + rewardType + " is being dropped from the sat right now, use it well."); } pod.Drop(rewardType, reward); //reset listeners currentGoalListenerIndex = -1; return(true); } else { //failed goal return(false); } } else { return(false); } }
// Use this for initialization void Start () { txt = GetComponent<Text>(); GameObject go = GameObject.Find("GUIManager"); guih = transform.root.GetComponent<GUIHandler>(); pod = guih.pod; }