Exemplo n.º 1
0
        public override void PostUpdate()
        {
            FirstTransformation = GetTransformation();

            PostUpdateKi();
            PostUpdateOverload();
            PostUpdateHandleTransformations();
            UpdateNPCs();
            PostUpdateTiles();

            // neuters flight if the player gets immobilized. Note the lack of Katchin Feet buff.
            if (IsPlayerImmobilized() && isFlying)
            {
                isFlying = false;
            }

            List <IHandleOnPlayerPostUpdate> items = player.GetItemsByType <IHandleOnPlayerPostUpdate>();

            for (int i = 0; i < items.Count; i++)
            {
                items[i].OnPlayerPostUpdate(this);
            }

            if (DBTWorld.DBTWorld.friezaShipTriggered && !NPC.AnyNPCs(mod.NPCType("FriezaShip")))
            {
                CheckFriezaShipSpawn();
            }

            HandleMouseOctantAndSyncTracking();
            //HandleChargeEffects();

            // flight system moved to PostUpdate so that it can benefit from not being client sided!
            FlightSystem.Update(player);
        }
Exemplo n.º 2
0
    void Start()
    {
        change_cam = GameObject.Find("changeacm").GetComponent <Button>();
        change_cam.onClick.AddListener(change_cam_click);

        change_wpn = GameObject.Find("changewpn").GetComponent <Button>();
        change_wpn.onClick.AddListener(change_wpn_click);

        gyroscope = GameObject.Find("gyroscope").GetComponent <Button>();
        gyroscope.onClick.AddListener(gyroscope_click);

        simplecont = GameObject.Find("simplecont").GetComponent <Button>();
        simplecont.onClick.AddListener(simplecont_click);

        flight = this.GetComponent <FlightSystem>();
        View   = (FlightView)GameObject.FindObjectOfType(typeof(FlightView));
        // setting all Touch screen controller in the position
        controllerTouch = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, Screen.height - 100));
        fireTouch       = new TouchScreenVal(new Rect(Screen.width / 2, 0, Screen.width / 2, Screen.height));
        switchTouch     = new TouchScreenVal(new Rect(0, Screen.height - 100, Screen.width / 2, 100));

        sliceTouch = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, 50));

        if (flight)
        {
            directVelBack = flight.DirectVelocity;
        }
    }
Exemplo n.º 3
0
 void Start()
 {
     timetolockcount  = Time.time;
     flight           = this.GetComponent <FlightSystem> ();
     flight.AutoPilot = true;
     timestatetemp    = 0;
 }
Exemplo n.º 4
0
	void Start ()
	{
		timetolockcount = Time.time;
		flight = this.GetComponent<FlightSystem> ();
		flight.AutoPilot = true;
		timestatetemp = 0;
	}
Exemplo n.º 5
0
 void Start()
 {
     Pitch    = 0.0f;
     Roll     = 0.0f;
     Yaw      = 0.0f;
     Throttle = 0.0f;
     plane    = GetComponent <FlightSystem>();
 }
Exemplo n.º 6
0
	void Awake ()
	{
		if (!CockpitCamera){
			if(this.transform.GetComponentInChildren (typeof(Camera))){
				CockpitCamera = this.transform.GetComponentInChildren (typeof(Camera)).gameObject;
			}
		}
		flight = this.GetComponent<FlightSystem>();
	}
Exemplo n.º 7
0
 void Awake()
 {
     if (!CockpitCamera)
     {
         if (this.transform.GetComponentInChildren(typeof(Camera)))
         {
             CockpitCamera = this.transform.GetComponentInChildren(typeof(Camera)).gameObject;
         }
     }
     flight = this.GetComponent <FlightSystem>();
 }
Exemplo n.º 8
0
        public void TestName()
        {
            //testowanie nazwy
            FlightSystem testflightsystem = new FlightSystem();

            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test", 1, 2));
            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test1", 12, 24));
            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test2", 13, 25));
            var    listids = testflightsystem.Airports.Select(x => x.Name).ToList();
            string t       = listids[1];

            Assert.AreEqual(t, "test1");
        }
Exemplo n.º 9
0
        public void TestCor2()
        {
            //testowanie dlugosci
            FlightSystem testflightsystem = new FlightSystem();

            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test", 1, 2));
            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test1", 12, 24));
            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test2", 13, 25));
            var           listids = testflightsystem.Airports.Select(x => x.Coordinate).ToList();
            GeoCoordinate t       = new GeoCoordinate();

            t.Longitude = listids[1].Longitude;
            Assert.AreEqual(t.Longitude, 24);
        }
Exemplo n.º 10
0
        public void TestId()
        //Testowanie jednostkowe tworzenia nowego Lotniska
        {
            //testowanie id
            FlightSystem testflightsystem = new FlightSystem();

            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test", 1, 2));
            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test1", 12, 24));
            Helper.SetIDAndAddToList(testflightsystem.Airports, new Airport("test2", 13, 25));
            var listids = testflightsystem.Airports.Select(x => x.Id).ToList();
            int t       = listids[1];

            Assert.AreEqual(t, 1);
        }
Exemplo n.º 11
0
 void Start()
 {
     timetolockcount  = Time.time;
     flight           = this.GetComponent <FlightSystem> (); // get Flight System
     flight.AutoPilot = true;                                // set auto pilot to true will make this plane flying and looking to Target automatically
     timestatetemp    = 0;
     if (!CenterOfBattle)
     {
         BattleCenter btcenter = (BattleCenter)GameObject.FindObjectOfType(typeof(BattleCenter));
         if (btcenter != null)
         {
             CenterOfBattle = btcenter.gameObject.GetComponent <BattleCenter>();
         }
     }
 }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        mainRot         = Quaternion.identity;
        DistanceLock    = 10000000;
        LimitedDistance = 1000.0f;
        BattleCenter    = GameObject.FindGameObjectWithTag("BattleCenter");
        VersionSight    = 0.2f;
        //TimeToSelectTarget = 2.0f;
        AttackRate     = 3.0f;
        TargetPosition = Vector3.zero;

        selfState = SelfState.Patrol;
        flight    = GetComponent <FlightSystem>();
        rigid     = GetComponent <Rigidbody>();
    }
Exemplo n.º 13
0
    void Start()
    {
        flight = this.GetComponent <FlightSystem>();
        View   = (FlightView)GameObject.FindObjectOfType(typeof(FlightView));
        // setting all Touch screen controller in the position
        controllerTouch = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, Screen.height - 100));
        fireTouch       = new TouchScreenVal(new Rect(Screen.width / 2, 0, Screen.width / 2, Screen.height));
        switchTouch     = new TouchScreenVal(new Rect(0, Screen.height - 100, Screen.width / 2, 100));

        sliceTouch = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, 50));

        if (flight)
        {
            directVelBack = flight.DirectVelocity;
        }
    }
Exemplo n.º 14
0
    public FlightSystem flight;          // core plane system

    void Awake()
    {
        if (CockpitCamera.Length <= 0)
        {
            if (this.transform.GetComponentsInChildren(typeof(Camera)).Length > 0)
            {
                var cams = this.transform.GetComponentsInChildren(typeof(Camera));
                CockpitCamera = new Camera[cams.Length];
                for (int i = 0; i < cams.Length; i++)
                {
                    CockpitCamera [i] = cams [i].camera;
                }
            }
        }
        flight = this.GetComponent <FlightSystem> ();
    }
Exemplo n.º 15
0
    void Start()
    {
        flight = this.GetComponent <FlightSystem>();
        View   = (FlightView)GameObject.FindObjectOfType(typeof(FlightView));
        // setting all Touch screen controller in the position
        controllerTouch = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, Screen.height));
        fireTouch       = new TouchScreenVal(new Rect(Screen.width / 2, 0, Screen.width / 2, Screen.height));
        switchTouch     = new TouchScreenVal(new Rect(0, Screen.height - 100, Screen.width / 2, 100));

        sliceTouch = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, 50));

        if (flight)
        {
            directVelBack = flight.DirectVelocity;
        }
        Acceleration            = UIController.acceleration;
        AccelerationSensitivity = TiltSensativity.sensativity;

        GameObject.FindObjectOfType <VolumeController> ().Adjust();
    }
Exemplo n.º 16
0
        public Tuple <float, Vector2> GetAuraRotationAndPosition(MyPlayer modPlayer)
        {
            // update handler to reorient the charge up aura after the aura offsets are defined.
            bool    isPlayerMostlyStationary = Math.Abs(modPlayer.player.velocity.X) <= 6F && Math.Abs(modPlayer.player.velocity.Y) <= 6F;
            float   rotation    = 0f;
            Vector2 position    = Vector2.Zero;
            float   scale       = GetAuraScale(modPlayer);
            int     auraOffsetY = GetAuraOffsetY(modPlayer);

            if (modPlayer.IsFlying && !isPlayerMostlyStationary && !FlightSystem.IsPlayerUsingKiWeapon(modPlayer))
            {
                // ever so slightly shift the aura down a tad.
                var    forwardOffset  = (int)Math.Floor(modPlayer.player.height * 0.75f);
                double rotationOffset = modPlayer.player.fullRotation <= 0f ? (float)Math.PI : -(float)Math.PI;
                rotation = (float)(modPlayer.player.fullRotation + rotationOffset);

                // using the angle of attack, construct the cartesian offsets of the aura based on the height of both things
                double widthRadius      = modPlayer.player.width / 4;
                double heightRadius     = modPlayer.player.height / 4;
                double auraWidthRadius  = GetWidth() / 4;
                double auraHeightRadius = GetHeight() / 4;

                // for right now, I'm just doing this with some hard coding. When we get more aura work done
                // we can try to unify this code a bit.
                double widthOffset      = auraWidthRadius - (widthRadius + auraOffsetY + forwardOffset);
                double heightOffset     = auraHeightRadius - (heightRadius + auraOffsetY + forwardOffset);
                double cartesianOffsetX = widthOffset * Math.Cos(modPlayer.player.fullRotation);
                double cartesianOffsetY = heightOffset * Math.Sin(modPlayer.player.fullRotation);

                Vector2 cartesianOffset = modPlayer.player.Center + new Vector2((float)-cartesianOffsetY, (float)cartesianOffsetX);

                // offset the aura
                position = cartesianOffset;
            }
            else
            {
                position = modPlayer.player.Center + new Vector2(0f, auraOffsetY);
                rotation = 0f;
            }
            return(new Tuple <float, Vector2>(rotation, position));
        }
Exemplo n.º 17
0
    void Awake()
    {
        systems          = GetComponentsInChildren <ShipSystem> ();
        autoWeaponSystem = GetComponentInChildren <AutoWeaponSystem> ();
        flightSystem     = GetComponentInChildren <FlightSystem> ();
        detectionSystem  = GetComponentInChildren <DetectionSystem> ();
        cargoSystem      = GetComponentInChildren <CargoSystem> ();
        tradeSystem      = GetComponentInChildren <TradeSystem> ();
        if (flightSystem != null)
        {
            flightSystem.MyBody = GetComponent <Rigidbody> ();            // Ужас!
        }

        if (detectionSystem != null && autoWeaponSystem != null)
        {
            autoWeaponSystem.SubscribeToDetectionSystem(detectionSystem);
        }
        if (tradeSystem != null && cargoSystem != null)
        {
            tradeSystem.SubscribeToCargoSystem(cargoSystem);
        }
    }
Exemplo n.º 18
0
 void Awake()
 {
     scale  = 500f / Screen.width;
     flight = this.GetComponent <FlightSystem> ();
 }
	void Start () {
		flight = this.GetComponent<FlightSystem>();
	}
Exemplo n.º 20
0
 void Start()
 {
     flight = this.GetComponent <FlightSystem>();
 }