예제 #1
0
파일: FireForm.cs 프로젝트: armani03k/RAID
    /*
     * private void Update() {
     *  if (Input.GetButtonUp("Ability") && !isHolding && delayTimer < FTDelay
     *      && Form.FlameOn && Form.GetComponent<PlayerMovement>().GetGround) Fireball();
     *
     *  if (Input.GetButtonUp("Ability") && isHolding) StopFT();
     * }
     */

    public override void UseGroundAbility()
    {
        if (pStat.StaminaRef >= AbilityCost)
        {
            pStat.StaminaDeplete(AbilityCost);
            Form.GetComponent <Rigidbody2D>().velocity = Vector2.up * BurstFrc;
        }
    }
예제 #2
0
        public RemotePlayerModel(ushort playerId)
        {
            // Spawn remote player model by cloning the player prefab and replacing local player script by remote player ones.
            string playerPrefabPath = LDB.players.Select(PLAYER_PROTO_ID).PrefabPath;

            if (playerPrefabPath != null)
            {
                PlayerTransform      = Object.Instantiate(Resources.Load <Transform>(playerPrefabPath));
                PlayerModelTransform = PlayerTransform.Find("Model");

                // Remove local player components
                Object.Destroy(PlayerTransform.GetComponent <PlayerFootsteps>());
                Object.Destroy(PlayerTransform.GetComponent <PlayerEffect>());
                Object.Destroy(PlayerTransform.GetComponent <PlayerAudio>());
                Object.Destroy(PlayerTransform.GetComponent <PlayerAnimator>());
                Object.Destroy(PlayerTransform.GetComponent <PlayerController>());
                PlayerTransform.GetComponent <Rigidbody>().isKinematic = true;

                // Add remote player components
                Movement = PlayerTransform.gameObject.AddComponent <RemotePlayerMovement>();
                Animator = PlayerTransform.gameObject.AddComponent <RemotePlayerAnimation>();
            }

            PlayerTransform.gameObject.name = $"Remote Player ({playerId})";
        }
예제 #3
0
        public RemotePlayerModel(ushort playerId, string username)
        {
            // Spawn remote player model by cloning the player prefab and replacing local player script by remote player ones.
            string playerPrefabPath = LDB.players.Select(PLAYER_PROTO_ID).PrefabPath;

            if (playerPrefabPath != null)
            {
                PlayerTransform      = Object.Instantiate(Resources.Load <Transform>(playerPrefabPath));
                PlayerModelTransform = PlayerTransform.Find("Model");

                // Remove local player components
                Object.Destroy(PlayerTransform.GetComponent <PlayerFootsteps>());
                Object.Destroy(PlayerTransform.GetComponent <PlayerEffect>());
                Object.Destroy(PlayerTransform.GetComponent <PlayerAudio>());
                Object.Destroy(PlayerTransform.GetComponent <PlayerAnimator>());
                Object.Destroy(PlayerTransform.GetComponent <PlayerController>());
                PlayerTransform.GetComponent <Rigidbody>().isKinematic = true;

                // Add remote player components
                Movement = PlayerTransform.gameObject.AddComponent <RemotePlayerMovement>();
                Animator = PlayerTransform.gameObject.AddComponent <RemotePlayerAnimation>();
                Effects  = PlayerTransform.gameObject.AddComponent <RemotePlayerEffects>();
            }

            PlayerTransform.gameObject.name = $"Remote Player ({playerId})";

            PlayerInstance = new global::Player();
            MechaInstance  = new Mecha();
            AccessTools.Property(typeof(global::Player), "mecha").SetValue(PlayerInstance, MechaInstance, null);
            MechaInstance.Init(PlayerInstance);

            //Fix MechaDroneRenderers
            AccessTools.Field(typeof(MechaDroneRenderer), "mat_0").SetValue(MechaInstance.droneRenderer, new Material(Configs.builtin.mechaDroneMat.shader));
            Material mat = (Material)AccessTools.Field(typeof(MechaDroneRenderer), "mat_0").GetValue(MechaInstance.droneRenderer);

            MethodInvoker.GetHandler(AccessTools.Method(typeof(Material), "CopyPropertiesFromMaterial", new System.Type[] { typeof(Material) })).Invoke(mat, Configs.builtin.mechaDroneMat);

            PlayerId = playerId;
            Username = username;
        }
예제 #4
0
 public override void Use()
 {
     PlayerTransform.GetComponent <PlayerControl.PlayerPickupUse>().PickupPutdown();
 }
예제 #5
0
 public override void Use()
 {
     PlayerTransform.GetComponent <PlayerControl.PlayerPickupUse>().PickupPutdown();
     PickupItem.itemRigidbody.AddForce((CameraFocusTransform.rotation * throwForce), ForceMode.VelocityChange);
     StartCoroutine(CountDown());
 }