mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-31 14:55:01 -05:00
Added Item Cost and Max Points
Added Glide Added Item adding verification
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3ec80a746c12614db0a11da845e3815
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8fe830ac457225a4ab1031a499db94fc
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d48485317ff858c4189d9c3a24830f42
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b91f668477f6b3244b3fea3204e6cd87
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -25,3 +25,4 @@ MonoBehaviour:
|
||||
kickPowM: 0
|
||||
recovTimeM: 20
|
||||
playerGravM: 0
|
||||
costM: 5
|
||||
|
||||
@@ -25,3 +25,4 @@ MonoBehaviour:
|
||||
kickPowM: 0
|
||||
recovTimeM: 0
|
||||
playerGravM: 0
|
||||
costM: 6
|
||||
|
||||
@@ -25,3 +25,4 @@ MonoBehaviour:
|
||||
kickPowM: 0
|
||||
recovTimeM: 0
|
||||
playerGravM: 0
|
||||
costM: 6
|
||||
|
||||
@@ -25,3 +25,4 @@ MonoBehaviour:
|
||||
kickPowM: 30
|
||||
recovTimeM: 0
|
||||
playerGravM: 0
|
||||
costM: 3
|
||||
|
||||
@@ -25,3 +25,4 @@ MonoBehaviour:
|
||||
kickPowM: 0
|
||||
recovTimeM: 0
|
||||
playerGravM: 0
|
||||
costM: 5
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82260a3a76214e04eafa1d267c1480fa
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user