Gate created and player tagged correctly

This commit is contained in:
Melbyj1125
2021-12-03 13:17:12 -06:00
parent 55885e2ef1
commit 17d804080d
59 changed files with 419 additions and 76 deletions

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InventoryManager : MonoBehaviour
{
//allItems array
public Item[] allItems;
//Item list
private List<Item> itemList;
public List<Item> ItemList{
get{ return itemList; }
set{ itemList = value; }
}
//Item Dictionary
private Dictionary<string, Item> itemDict = new Dictionary<string, Item>();
public Dictionary<string, Item> ItemDict{
get{ return itemDict; }
}
void Awake(){
//Gets Items in Resource Folder
allItems = Resources.LoadAll<Item>("ItemObjects");
itemList = new List<Item>(allItems);
foreach(Item item in itemList){
itemDict.Add(item.name, item);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 66519fc5420181e45850c591aa1179ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,82 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu]
public class Item: ScriptableObject {
public int id;
public string itemName;
public string description;
[Space]
public float maxVelM;
public float minVelM;
public float curVelM;
public float accM;
public float jumpPowM;
public int jumpNumM;
public float tractionM;
public float kickPowM;
public float recovTimeM;
public float playerGravM;
public int costM;
public virtual void Equip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel += maxVelM;
}
if(minVelM != 0){
p.MinVel += minVelM;
}
if(curVelM != 0){
p.CurVel += curVelM;
}
if(accM != 0){
p.Acc += accM;
}
if(jumpPowM != 0){
p.JumpPow += jumpPowM;
}
if(jumpNumM != 0){
p.JumpNum += jumpNumM;
}
if(tractionM != 0){
p.Traction += tractionM;
}
if(kickPowM != 0){
p.KickPow += kickPowM;
}
if(playerGravM != 0){
p.PlayerGrav += playerGravM;
}
}
public virtual void Unequip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel -= maxVelM;
}
if(minVelM != 0){
p.MinVel -= minVelM;
}
if(curVelM != 0){
p.CurVel -= curVelM;
}
if(accM != 0){
p.Acc -= accM;
}
if(jumpPowM != 0){
p.JumpPow -= jumpPowM;
}
if(jumpNumM != 0){
p.JumpNum -= jumpNumM;
}
if(tractionM != 0){
p.Traction -= tractionM;
}
if(kickPowM != 0){
p.KickPow -= kickPowM;
}
if(playerGravM != 0){
p.PlayerGrav -= playerGravM;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d76cac0a7f5ea2a4cadbec8ef3315ec1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 286df2f965f4f3c4eb74950f0550e68f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,102 @@
using System.Collections;
using System.Collections.Generic;
using MLAPI;
using UnityEngine;
public class Blink : NetworkBehaviour {
// Start is called before the first frame update
private Camera cam;
public CharacterController controller;
//Blink Variables
private LineRenderer beam;
private Vector3 origin;
private Vector3 endPoint;
private Vector3 mousePos;
private RaycastHit hit;
LayerMask ignoreP;
/////
private void Awake()
{
beam = gameObject.AddComponent<LineRenderer>();
beam.startWidth = 0.2f;
beam.endWidth = 0.2f;
beam.enabled = false;
ignoreP = LayerMask.GetMask("Player");
controller = GetComponent<CharacterController>();
}
void Start(){
// Grab the main camera.
//camera transform
cam = GetComponentInChildren<Camera>();
}
//ADJUST SO DISTANCE IS DETERMINED BY SCROLL WHEEL
//blinks the player forwards
private void BlinkMove()
{
if (!IsLocalPlayer) { return; }
if (Input.GetMouseButton(1))
{
// Finding the origin and end point of laser.
origin = transform.position + transform.forward * transform.lossyScale.z;
// Finding mouse pos in 3D space.
mousePos = Input.mousePosition;
mousePos.z = 20f;
endPoint = cam.ScreenToWorldPoint(mousePos);
// Find direction of beam.
Vector3 dir = endPoint - origin;
dir.Normalize();
// Are we hitting any colliders?
if (Physics.Raycast(origin, dir, out hit, 20f))
{
// If yes, then set endpoint to hit-point.
endPoint = hit.point;
}
// Set end point of laser.
beam.SetPosition(0, origin);
beam.SetPosition(1, endPoint);
// Draw the laser!
beam.enabled = true;
/*Ray ray = camera.ScreenPointToRay(Input.mousePosition);
RaycastHit raycastHit;
if (Physics.Raycast(ray, out raycastHit, 5.0f)){
LineRenderer.SetPosition(1, raycastHit.point);
}*/
}
else if (!Input.GetMouseButton(1) && beam.enabled == true)
{
beam.enabled = false;
//if teleporting due to hit to object, bump them a bit outside normal
if (hit.point != null)
{
transform.position = endPoint + hit.normal * 1.25f;
}
//if teleporting in the air or something, just spawn at endpoint
else
{
transform.position = endPoint;
}
//reenable character controller
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5162a84172831f4449df60b9ad0ce22f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using MLAPI;
using UnityEngine;
public class Dash : NetworkBehaviour {
public Vector3 moveDirection;
public const float maxDashTime = 1.0f;
public float dashDistance = 10;
public float dashStoppingSpeed = 0.1f;
float currentDashTime = maxDashTime;
float dashSpeed = 12;
CharacterController characterController;
void Start(){
characterController = this.gameObject.GetComponent<CharacterController>();
}
//UPDATE CHECK FOR MOVEMENT ONLY WHEN DASHING
void FixedUpdate(){
if (!IsLocalPlayer) { return; }
if (Input.GetKeyDown(KeyCode.E))
{
currentDashTime = 0;
}
if(currentDashTime < maxDashTime)
{
moveDirection = transform.forward * dashDistance;
currentDashTime += dashStoppingSpeed;
}
else
{
moveDirection = Vector3.zero;
}
characterController.Move(moveDirection * Time.deltaTime * dashSpeed);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 980b3f40ede2d8a4c96587100cf71d02
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,107 @@
using System.Collections;
using System.Collections.Generic;
using MLAPI;
using UnityEngine;
public class GrapplingHook : NetworkBehaviour
{
public float maxGrappleDistance = 25;
private bool isGrappled;
private int hookPointIndex;
private GameObject hookPoint;
private GameObject[] hookPoints;
private float distance;
private CharacterController movementController;
private PlayerMovement playerMovement;
private PlayerStats pStats;
private float ropeLength;
private float climbRate = 5;
// Start is called before the first frame update
void Start()
{
isGrappled = false;
hookPoints = GameObject.FindGameObjectsWithTag("HookPoint");
movementController = gameObject.GetComponent<CharacterController>();
playerMovement = gameObject.GetComponent<PlayerMovement>();
pStats = gameObject.GetComponent<PlayerStats>();
}
// Update is called once per frame
void Update()
{
//if (!IsLocalPlayer) { return; }
if (Input.GetKeyDown(KeyCode.E)) //If grapple button is hit
{
if (!isGrappled) //If we are not grappling
{
hookPointIndex = FindHookPoint(); //Find the nearest hook point within max distance
if (hookPointIndex != -1) //If there is a hookpoint
{
hookPoint = hookPoints[hookPointIndex]; //The point we are grappling from
ropeLength = Vector3.Distance(gameObject.transform.position, hookPoint.transform.position) + 0.5f;
isGrappled = true; //toggle grappling state
}
}
else //Else we are grappling
{
//physics tear down?
isGrappled = false; //toggle grappling state to release
}
}
}
private void FixedUpdate()
{
if (isGrappled)
{
Debug.DrawRay(gameObject.transform.position, (hookPoint.transform.position - gameObject.transform.position)); //Visual of line
if (Input.GetKey(KeyCode.LeftShift)) //Extend hook
{
ropeLength += climbRate * Time.deltaTime;
if (ropeLength > maxGrappleDistance)
{
ropeLength = maxGrappleDistance;
}
//Debug.Log(ropeLength.ToString());
}
if (Input.GetKey(KeyCode.RightShift)) // Retract Hook
{
ropeLength -= climbRate * Time.deltaTime;
if (ropeLength < 5)
{
ropeLength = 5;
}
//Debug.Log(ropeLength.ToString());
}
//Do grappling physics based on hookPoint
if (Vector3.Distance(gameObject.transform.position, hookPoint.transform.position) > ropeLength)
{
//Impact Based
playerMovement.AddImpact((hookPoint.transform.position - gameObject.transform.position), pStats.PlayerGrav);
//Character controller move?
//movementController.Move((hookPoint.transform.position - gameObject.transform.position).normalized * ropeLength*Time.deltaTime);
//Lerp? or another smoother way? Better physics? Wait until refinement to deal with
}
}
}
int FindHookPoint()
{
float least = maxGrappleDistance;
int index = -1;
for(int i = 0; i<hookPoints.Length; i++)
{
distance = Vector3.Distance(gameObject.transform.position, hookPoints[i].transform.position);
if (distance <= least)
{
index = i;
}
}
return index;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cee70ea30de57ec43a325c1ca6257526
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Nitro : MonoBehaviour
{
private PlayerStats playerStats;
private CoolDown driver;
private bool isOnCoolDown = false;
//this will need to be set from scritable object or something;
private float coolDown;
// Start is called before the first frame update
void Start(){
playerStats = GetComponent<PlayerStats>();
coolDown = 5.0f;
//retrieves
driver = FindObjectOfType<CoolDown>();
}
// Update is called once per frame
void Update(){
//once cooldowns are implemented, put this on one (a long one)
if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false){
playerStats.CurVel = playerStats.MaxVel;
StartCoroutine(startCoolDown());
}
}
private IEnumerator startCoolDown(){
Debug.Log("start corotine");
isOnCoolDown = true;
driver.startUICooldown("Nitro");
yield return new WaitForSeconds(coolDown);
isOnCoolDown = false;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1a8c22589436d2449a89cf3a40b6d252
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,202 @@
using UnityEngine;
using System.Linq;
using MLAPI;
using UnityEngine.Rendering;
[RequireComponent (typeof(PlayerMovement))]
public class WallRun : NetworkBehaviour
{
public float wallMaxDistance = 5;
public float wallSpeedMultiplier = 1.2f;
public float minimumHeight = .1f;
public float maxAngleRoll = 20;
[Range(0.0f, 1.0f)]
public float normalizedAngleThreshold = 0.1f;
public float jumpDuration = .02f;
public float wallBouncing = 3;
public float cameraTransitionDuration = 1;
public float wallGravityDownForce = 5f;
[Space]
PlayerMovement playerMovementController;
Vector3[] directions;
RaycastHit[] hits;
bool isWallRunning = false;
Vector3 lastWallPosition;
Vector3 lastWallNormal;
float elapsedTimeSinceJump = 0;
float elapsedTimeSinceWallAttach = 0;
float elapsedTimeSinceWallDetatch = 0;
bool jumping;
bool isPlayergrounded() => playerMovementController.isGrounded;
public bool IsWallRunning() => isWallRunning;
bool CanWallRun()
{
float verticalAxis = Input.GetAxisRaw("Vertical");
return !isPlayergrounded() && verticalAxis > 0 && VerticalCheck();
}
bool VerticalCheck()
{
return !Physics.Raycast(transform.position, Vector3.down, minimumHeight);
}
void Start()
{
playerMovementController = GetComponent<PlayerMovement>();
directions = new Vector3[]{
Vector3.right,
Vector3.right + Vector3.forward,
Vector3.forward,
Vector3.left + Vector3.forward,
Vector3.left
};
}
public void WallRunRoutine()
{
//if (!IsLocalPlayer) { return; }
isWallRunning = false;
hits = new RaycastHit[directions.Length];
if(playerMovementController.GetJumpPressed())
{
jumping = true;
}
if(CanAttach())
{
for(int i=0; i<directions.Length; i++)
{
Vector3 dir = transform.TransformDirection(directions[i]);
Physics.Raycast(transform.position, dir, out hits[i], wallMaxDistance);
if(hits[i].collider != null)
{
Debug.DrawRay(transform.position, dir * hits[i].distance, Color.green);
}
else
{
Debug.DrawRay(transform.position, dir * wallMaxDistance, Color.red);
}
}
if(CanWallRun())
{
hits = hits.ToList().Where(h => h.collider != null).OrderBy(h => h.distance).ToArray();
if(hits.Length > 0)
{
if(hits[0].collider.tag == "WallRun")
{
OnWall(hits[0]);
lastWallPosition = hits[0].point;
lastWallNormal = hits[0].normal;
}
}
}
}
if(isWallRunning)
{
elapsedTimeSinceWallDetatch = 0;
elapsedTimeSinceWallAttach += Time.deltaTime;
playerMovementController.AddPlayerVelocity((Vector3.down * wallGravityDownForce * Time.deltaTime));
}
else
{
elapsedTimeSinceWallAttach = 0;
elapsedTimeSinceWallDetatch += Time.deltaTime;
playerMovementController.AddPlayerVelocity((Vector3.down * playerMovementController.pStats.PlayerGrav * Time.deltaTime));
}
}
bool CanAttach()
{
if(jumping)
{
elapsedTimeSinceJump += Time.deltaTime;
if(elapsedTimeSinceJump > jumpDuration)
{
elapsedTimeSinceJump = 0;
jumping = false;
}
return false;
}
return true;
}
void OnWall(RaycastHit hit){
float d = Vector3.Dot(hit.normal, Vector3.up);
if(d >= -normalizedAngleThreshold && d <= normalizedAngleThreshold)
{
Vector3 alongWall = Vector3.Cross(hit.normal, Vector3.up);
float vertical = Input.GetAxisRaw("Vertical");
//Vector3 alongWall = transform.TransformDirection(Vector3.forward);
// Debug.DrawRay(transform.position, alongWall.normalized * 10, Color.green);
// Debug.DrawRay(transform.position, lastWallNormal * 10, Color.magenta);
Vector3 moveToSet = alongWall * vertical * playerMovementController.PlayerSpeed() * Time.deltaTime;// * wallSpeedMultiplier;
Vector3 velNorm = playerMovementController.vel;
velNorm.Normalize();
moveToSet = new Vector3(moveToSet.x * -velNorm.x, moveToSet.y, moveToSet.z * -velNorm.z);
Vector3 moveToSetNorm = moveToSet;
moveToSetNorm.Normalize();
if((moveToSetNorm.x < 0 && velNorm.x > 0)){
moveToSet.x = (moveToSet.x * -velNorm.x);
}
else if((moveToSetNorm.x > 0 && velNorm.x < 0) ){
moveToSet.x = (-moveToSet.x * -velNorm.x);
}
if((moveToSetNorm.z < 0 && velNorm.z > 0)){
moveToSet.z = (moveToSet.z * -velNorm.z);
}
else if((moveToSetNorm.z > 0 && velNorm.z < 0)){
moveToSet.z = (-moveToSet.z * -velNorm.z);
}
moveToSet.y = 0;
playerMovementController.SetPlayerVelocity(moveToSet);
isWallRunning = true;
if(playerMovementController.curJumpNum != 0){
playerMovementController.curJumpNum = 0 ;
}
}
}
float CalculateSide()
{
if(isWallRunning)
{
Vector3 heading = lastWallPosition - transform.position;
Vector3 perp = Vector3.Cross(transform.forward, heading);
float dir = Vector3.Dot(perp, transform.up);
return dir;
}
return 0;
}
public Vector3 GetWallJumpDirection() //Add call in jump where if we are wallrunning and jump, the jump vector is multiplied by this
{
return lastWallNormal * wallBouncing + (transform.up);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 535009eaa735a4c4e95c6fc270e32741
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 08ce0ad440e9031429d13663cf77c6f0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 220c578e08133f54a95a442eb87b3702, type: 3}
m_Name: Blink
m_EditorClassIdentifier:
id: 9
itemName: Blink
description: Allows Blinking forwards
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 0
jumpNumM: 0
tractionM: 0
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 5
hasWallrunM: 0
hasBlinkM: 1
hasGrappleM: 0
hasGliderM: 0
hasNitroM: 0
hasDashM: 0
cooldownM: 5

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f3ec80a746c12614db0a11da845e3815
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 220c578e08133f54a95a442eb87b3702, type: 3}
m_Name: Nitro
m_EditorClassIdentifier:
id: 10
itemName: Nitro
description: Boosts player speed
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 0
jumpNumM: 0
tractionM: 0
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 6
hasWallrunM: 0
hasBlinkM: 0
hasGrappleM: 0
hasGliderM: 0
hasNitroM: 1
hasDashM: 0
cooldownM: 5

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b91f668477f6b3244b3fea3204e6cd87
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d76cac0a7f5ea2a4cadbec8ef3315ec1, type: 3}
m_Name: QuickStandup
m_EditorClassIdentifier:
id: 1
itemName: Quick Standup
description: Player gets up faster
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 0
jumpNumM: 0
tractionM: 0
kickPowM: 0
recovTimeM: -1.5
playerGravM: 0
costM: 5

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a4f559eb10aa9b243a2a08c544802857
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3f81b99cf16b831458726bf10a114803
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e292b284ab595e24684a1ed7e69c6a2d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 220c578e08133f54a95a442eb87b3702, type: 3}
m_Name: Dash
m_EditorClassIdentifier:
id: 11
itemName: Dash
description: Quickly Moves the player forwards
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 0
jumpNumM: 0
tractionM: 0
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 5
hasWallrunM: 0
hasBlinkM: 0
hasGrappleM: 0
hasGliderM: 0
hasNitroM: 0
hasDashM: 1
cooldownM: 15

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4399d7276b3edf446ac51c5145539a5e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 220c578e08133f54a95a442eb87b3702, type: 3}
m_Name: Glider
m_EditorClassIdentifier:
id: 7
itemName: Glider
description: Player Will Fall slower
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 0
jumpNumM: 0
tractionM: 0
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 7
hasWallrunM: 0
hasBlinkM: 0
hasGrappleM: 0
hasGliderM: 1
hasNitroM: 0
hasDashM: 0
cooldownM: 10

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8fe830ac457225a4ab1031a499db94fc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 220c578e08133f54a95a442eb87b3702, type: 3}
m_Name: Grapple
m_EditorClassIdentifier:
id: 8
itemName: Grapple
description: Allows the use of a grapple
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 0
jumpNumM: 0
tractionM: 0
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 4
hasWallrunM: 0
hasBlinkM: 0
hasGrappleM: 1
hasGliderM: 0
hasNitroM: 0
hasDashM: 0
cooldownM: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d48485317ff858c4189d9c3a24830f42
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d76cac0a7f5ea2a4cadbec8ef3315ec1, type: 3}
m_Name: RollerSkates
m_EditorClassIdentifier:
id: 2
itemName: Roller Skates
description: More Slidey But Faster
maxVelM: 15
minVelM: 0
curVelM: 0
accM: 0.3
jumpPowM: 0
jumpNumM: 0
tractionM: -2.2
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 6

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c6fce7543828d16448383a9e0c1d651d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d76cac0a7f5ea2a4cadbec8ef3315ec1, type: 3}
m_Name: Springs
m_EditorClassIdentifier:
id: 3
itemName: Springs
description: Jump Higher
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 100
jumpNumM: 0
tractionM: 0
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 6

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ca4d5584eacf416478beba5cd283bfa3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d76cac0a7f5ea2a4cadbec8ef3315ec1, type: 3}
m_Name: StrongerKick
m_EditorClassIdentifier:
id: 4
itemName: Strong Kick
description: Kick Harder
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 0
jumpNumM: 0
tractionM: 0
kickPowM: 100
recovTimeM: 0
playerGravM: 0
costM: 3

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a96dfb1a70e0d0a4f84c15378f38ce99
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d76cac0a7f5ea2a4cadbec8ef3315ec1, type: 3}
m_Name: TripleJump
m_EditorClassIdentifier:
id: 5
itemName: Triple Jump
description: Player gets an extra jump but has less jump height
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: -50
jumpNumM: 1
tractionM: 0
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 5

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6a839da810e4bd746bb2a72d791cb8a4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 220c578e08133f54a95a442eb87b3702, type: 3}
m_Name: Wall Run
m_EditorClassIdentifier:
id: 6
itemName: Wall Run
description: Allows player to run on walls
maxVelM: 0
minVelM: 0
curVelM: 0
accM: 0
jumpPowM: 0
jumpNumM: 0
tractionM: 0
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 4
hasWallrunM: 1
hasBlinkM: 0
hasGrappleM: 0
hasGliderM: 0
hasNitroM: 0
hasDashM: 0
cooldownM: 0
scriptM: {fileID: 11500000, guid: 535009eaa735a4c4e95c6fc270e32741, type: 3}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 82260a3a76214e04eafa1d267c1480fa
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,114 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CreateAssetMenu]
public class SpecialItem : Item
{
public bool hasWallrunM;
public bool hasBlinkM;
public bool hasGrappleM;
public bool hasGliderM;
public bool hasNitroM;
public bool hasDashM;
public float cooldownM;
public override void Equip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel += maxVelM;
}
if(minVelM != 0){
p.MinVel += minVelM;
}
if(curVelM != 0){
p.CurVel += curVelM;
}
if(accM != 0){
p.Acc += accM;
}
if(jumpPowM != 0){
p.JumpPow += jumpPowM;
}
if(jumpNumM != 0){
p.JumpNum += jumpNumM;
}
if(tractionM != 0){
p.Traction += tractionM;
}
if(kickPowM != 0){
p.KickPow += kickPowM;
}
if(playerGravM != 0){
p.PlayerGrav += playerGravM;
}
if(hasWallrunM != false){
p.HasWallrun = hasWallrunM;
}
if(hasBlinkM != false){
p.HasBlink = hasBlinkM;
}
if(hasGrappleM != false){
p.HasGrapple = hasGrappleM;
}
if(hasGliderM != false){
p.HasGlider = hasGliderM;
}
if(hasNitroM != false){
p.HasNitro = hasNitroM;
}
if(hasDashM != false){
p.HasDash = hasDashM;
}
}
public override void Unequip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel -= maxVelM;
}
if(minVelM != 0){
p.MinVel -= minVelM;
}
if(curVelM != 0){
p.CurVel -= curVelM;
}
if(accM != 0){
p.Acc -= accM;
}
if(jumpPowM != 0){
p.JumpPow -= jumpPowM;
}
if(jumpNumM != 0){
p.JumpNum -= jumpNumM;
}
if(tractionM != 0){
p.Traction -= tractionM;
}
if(kickPowM != 0){
p.KickPow -= kickPowM;
}
if(playerGravM != 0){
p.PlayerGrav -= playerGravM;
}
if(hasWallrunM != false){
p.HasWallrun = false;
}
if(hasBlinkM != false){
p.HasBlink = false;
}
if(hasGrappleM != false){
p.HasGrapple = false;
}
if(hasGliderM != false){
p.HasGlider = false;
}
if(hasNitroM != false){
p.HasNitro = false;
}
if(hasDashM != false){
p.HasDash = false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 220c578e08133f54a95a442eb87b3702
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: