mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-31 23:04:54 -05:00
Implemented Item Scripts into objects
Implemented Ragdoll kinda There are some issues with getting hit while ragdolling that need to be fixed Adjusted Dash Dash still needs some adjustments before being fully implemented
This commit is contained in:
@@ -20,7 +20,7 @@ public class Item: ScriptableObject {
|
||||
public float playerGravM;
|
||||
public int costM;
|
||||
|
||||
public virtual void Equip(PlayerStats p){
|
||||
public virtual void Equip(PlayerStats p, GameObject player){
|
||||
if(maxVelM != 0){
|
||||
p.MaxVel += maxVelM;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class Item: ScriptableObject {
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Unequip(PlayerStats p){
|
||||
public virtual void Unequip(PlayerStats p, GameObject player){
|
||||
if(maxVelM != 0){
|
||||
p.MaxVel -= maxVelM;
|
||||
}
|
||||
|
||||
@@ -33,3 +33,4 @@ MonoBehaviour:
|
||||
hasNitroM: 0
|
||||
hasDashM: 0
|
||||
cooldownM: 0
|
||||
scriptM: {fileID: 11500000, guid: 5162a84172831f4449df60b9ad0ce22f, type: 3}
|
||||
|
||||
@@ -33,3 +33,4 @@ MonoBehaviour:
|
||||
hasNitroM: 0
|
||||
hasDashM: 0
|
||||
cooldownM: 0
|
||||
scriptM: {fileID: 11500000, guid: 535009eaa735a4c4e95c6fc270e32741, type: 3}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CreateAssetMenu]
|
||||
public class SpecialItem : Item
|
||||
@@ -12,8 +13,9 @@ public class SpecialItem : Item
|
||||
public bool hasNitroM;
|
||||
public bool hasDashM;
|
||||
public float cooldownM;
|
||||
public MonoScript scriptM;
|
||||
|
||||
public override void Equip(PlayerStats p){
|
||||
public override void Equip(PlayerStats p, GameObject player){
|
||||
if(maxVelM != 0){
|
||||
p.MaxVel += maxVelM;
|
||||
}
|
||||
@@ -59,9 +61,12 @@ public class SpecialItem : Item
|
||||
if(hasDashM != false){
|
||||
p.HasDash = hasDashM;
|
||||
}
|
||||
if(scriptM != null){
|
||||
player.AddComponent(scriptM.GetClass());
|
||||
}
|
||||
}
|
||||
|
||||
public override void Unequip(PlayerStats p){
|
||||
public override void Unequip(PlayerStats p, GameObject player){
|
||||
if(maxVelM != 0){
|
||||
p.MaxVel -= maxVelM;
|
||||
}
|
||||
@@ -89,23 +94,26 @@ public class SpecialItem : Item
|
||||
if(playerGravM != 0){
|
||||
p.PlayerGrav -= playerGravM;
|
||||
}
|
||||
if(hasWallrunM != true){
|
||||
p.HasWallrun = hasWallrunM;
|
||||
if(hasWallrunM != false){
|
||||
p.HasWallrun = false;
|
||||
}
|
||||
if(hasBlinkM != true){
|
||||
p.HasBlink = hasBlinkM;
|
||||
if(hasBlinkM != false){
|
||||
p.HasBlink = false;
|
||||
}
|
||||
if(hasGrappleM != true){
|
||||
p.HasGrapple = hasGrappleM;
|
||||
if(hasGrappleM != false){
|
||||
p.HasGrapple = false;
|
||||
}
|
||||
if(hasGliderM != true){
|
||||
p.HasGlider = hasGliderM;
|
||||
if(hasGliderM != false){
|
||||
p.HasGlider = false;
|
||||
}
|
||||
if(hasNitroM != true){
|
||||
p.HasNitro = hasNitroM;
|
||||
if(hasNitroM != false){
|
||||
p.HasNitro = false;
|
||||
}
|
||||
if(hasDashM != true){
|
||||
p.HasDash = hasDashM;
|
||||
if(hasDashM != false){
|
||||
p.HasDash = false;
|
||||
}
|
||||
if(scriptM != null){
|
||||
Destroy(player.GetComponent(scriptM.GetClass()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class WallRunItem : Item
|
||||
{
|
||||
public void Equip(PlayerStats p){
|
||||
p.HasWallrun = true;
|
||||
}
|
||||
|
||||
public void Unequip(PlayerStats p)
|
||||
{
|
||||
p.HasWallrun = false;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80dbcf4212f11a74ebd5289c2b5eb309
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user