projectile and enemy collision. Iniitial player death state (teleport to start)

This commit is contained in:
joonasp
2022-04-25 17:46:26 +03:00
parent fd683b4580
commit f2db095ab9
23 changed files with 25594 additions and 723 deletions

View File

@@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 8183020133918107436}
m_Layer: 0
m_Name: EssenceWell
m_TagString: Untagged
m_TagString: Portal
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0

View File

@@ -217,6 +217,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 08f72f5d017837743b67d344a6a7ed52, type: 3}
m_Name:
m_EditorClassIdentifier:
spawnLocation: {fileID: 0}
--- !u!1 &2674332924243185464
GameObject:
m_ObjectHideFlags: 0

View File

@@ -8,6 +8,7 @@ public class Projectile : MonoBehaviour
Vector3 oldEulerAngles;
public float damage;
private string element = null;
private void Start()
{
@@ -28,10 +29,14 @@ public class Projectile : MonoBehaviour
private void OnCollisionEnter(Collision collision)
{
Debug.LogWarning(collision.gameObject.name);
if (collision.gameObject.tag != "IceBolt" && collision.gameObject.tag != "Player" && !collided)
GameObject obj = collision.gameObject;
if (obj.tag != "IceBolt" && obj.tag != "Player" && !collided)
{
collided = true;
if (collision.gameObject.name == "Dummy") Destroy(collision.gameObject); //REPLACE WITH ENEMY TAG CHECK AND DAMAGE CHECKING
if (obj.CompareTag("Slime"))
{
obj.GetComponent<SlimeAI>().GetHit(Mathf.RoundToInt(damage));
}
Destroy(gameObject);
}

View File

@@ -68,6 +68,10 @@ public class CraftingTable : MonoBehaviour
item1 = null;
}
}
else if((item1.name.StartsWith("wand") && item2.name.StartsWith("Crystal")) || (item2.name.StartsWith("wand") && item1.name.StartsWith("Crystal")))
{
}
}
Debug.LogError("Invalid Recipe!");

View File

@@ -14,24 +14,28 @@ public class PlayerInfo : MonoBehaviour
private GameObject rightHandHeld;
private GameObject leftHandHeld;
public Transform spawnLocation;
private void Awake()
{
Instance = this;
health = 5;
essence_basic = 0;
essence_basic = 1;
rightHandHeld = null;
leftHandHeld = null;
}
public bool AddHealth(int value)
public void AddHealth(int value)
{
health += value;
if (health <= 0)
{
transform.position = spawnLocation.position;
health = 5;
Debug.Log("NO HEALTH REMAINING");
return false;
}
return true;
}
public bool AddEssenceBasic(int value)

View File

@@ -6,14 +6,9 @@ public class WandData : MonoBehaviour
{
public float power = 1f;
//public string element = "water";
public string element = null;
private void Awake()
{
}
public void SetPower(float pow)
{
power = pow;

View File

@@ -24,7 +24,7 @@ MonoBehaviour:
m_Value: 0.75
smoothness:
m_OverrideState: 1
m_Value: 0.4
m_Value: 0.543
rounded:
m_OverrideState: 0
m_Value: 0