Added Item Cost and Max Points

Added Glide
Added Item adding verification
This commit is contained in:
Melbyj1125
2021-10-18 12:19:44 -05:00
parent a42e802ace
commit 39bc66244e
25 changed files with 945 additions and 327 deletions

View File

@@ -18,8 +18,9 @@ public class Item: ScriptableObject {
public float kickPowM;
public float recovTimeM;
public float playerGravM;
public int costM;
public void Equip(PlayerStats p){
public virtual void Equip(PlayerStats p){
if(maxVelM != 0){
p.MaxVel += maxVelM;
}
@@ -49,7 +50,7 @@ public class Item: ScriptableObject {
}
}
public void Unequip(PlayerStats p){
public virtual void Unequip(PlayerStats p){
if(maxVelM != 0){
p.MaxVel -= maxVelM;
}

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: 0

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: 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,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: 0

View File

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

View File

@@ -25,3 +25,4 @@ MonoBehaviour:
kickPowM: 0
recovTimeM: 20
playerGravM: 0
costM: 5

View File

@@ -25,3 +25,4 @@ MonoBehaviour:
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 6

View File

@@ -25,3 +25,4 @@ MonoBehaviour:
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 6

View File

@@ -25,3 +25,4 @@ MonoBehaviour:
kickPowM: 30
recovTimeM: 0
playerGravM: 0
costM: 3

View File

@@ -25,3 +25,4 @@ MonoBehaviour:
kickPowM: 0
recovTimeM: 0
playerGravM: 0
costM: 5

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: 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

View File

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

View File

@@ -2,6 +2,111 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[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){
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){
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 != true){
p.HasWallrun = hasWallrunM;
}
if(hasBlinkM != true){
p.HasBlink = hasBlinkM;
}
if(hasGrappleM != true){
p.HasGrapple = hasGrappleM;
}
if(hasGliderM != true){
p.HasGlider = hasGliderM;
}
if(hasNitroM != true){
p.HasNitro = hasNitroM;
}
if(hasDashM != true){
p.HasDash = hasDashM;
}
}
}