diff --git a/Assets/Prefabs/GameController.prefab b/Assets/Prefabs/GameController.prefab index 7d30b1c..835ca33 100644 --- a/Assets/Prefabs/GameController.prefab +++ b/Assets/Prefabs/GameController.prefab @@ -289,7 +289,8 @@ MonoBehaviour: type: 3} enemyPrefabs: - {fileID: 470211819356819165, guid: 1bd6e08f590fdd844854a34504aeaa4a, type: 3} - enemiesToSpawn: 10 + - {fileID: 1164136568549368904, guid: a4aeecfb369f0974490d158ef9489335, type: 3} + enemiesToSpawn: 15 --- !u!1 &6763073704789207264 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 54512d2..0e27d8e 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -177,7 +177,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f16e1b4841b0d4546a52853aafbb7d85, type: 3} m_Name: m_EditorClassIdentifier: - hpMax: 0 + hpMax: 10 overlappable: 0 hp: 0 sprite: {fileID: 0} diff --git a/Assets/Prefabs/Slime.prefab b/Assets/Prefabs/Slime.prefab index b3bc9aa..40d7ddf 100644 --- a/Assets/Prefabs/Slime.prefab +++ b/Assets/Prefabs/Slime.prefab @@ -92,7 +92,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1ce1b6adc640d6f46bbf4d7072735b7f, type: 3} m_Name: m_EditorClassIdentifier: - hpMax: 0 + hpMax: 2 overlappable: 0 hp: 0 sprite: {fileID: 0} diff --git a/Assets/Prefabs/TEST Item.prefab b/Assets/Prefabs/TEST Item.prefab index ea25af2..fc955a3 100644 --- a/Assets/Prefabs/TEST Item.prefab +++ b/Assets/Prefabs/TEST Item.prefab @@ -44,7 +44,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cfb3c44da9ebb1840b5a2bcdfd5e2730, type: 3} m_Name: m_EditorClassIdentifier: - hpMax: 0 + hpMax: 1 overlappable: 0 hp: 0 sprite: {fileID: 0} diff --git a/Assets/Scripts/Entity.cs b/Assets/Scripts/Entity.cs index fc30c76..c2cfe15 100644 --- a/Assets/Scripts/Entity.cs +++ b/Assets/Scripts/Entity.cs @@ -10,9 +10,6 @@ public class Entity : MonoBehaviour [AfterStartAttribute] public float hp; - [BeforeStartAttribute] - public Sprite sprite; - public Vector2Int MapPosition { get { return new Vector2Int((int)transform.position.x, (int)transform.position.y); @@ -28,7 +25,6 @@ public class Entity : MonoBehaviour protected virtual void Start() { spriteRenderer = GetComponent(); - spriteRenderer.sprite = sprite; gameController = GameObject.FindGameObjectWithTag("GameController"); turnHandler = gameController.GetComponentInChildren(); map = gameController.GetComponentInChildren(); diff --git a/Assets/Scripts/EntityItem.cs b/Assets/Scripts/EntityItem.cs index c68562e..1d62286 100644 --- a/Assets/Scripts/EntityItem.cs +++ b/Assets/Scripts/EntityItem.cs @@ -4,7 +4,12 @@ using UnityEngine; public class EntityItem : Entity { - public static string itemName = "White Triangle"; + public virtual string Name { + get { + Debug.LogWarning("No name given to an item"); + return ""; + } + } protected override void Start() { base.Start(); @@ -13,12 +18,12 @@ public class EntityItem : Entity public virtual void OnPickup(EntityPlayer player) { Debug.LogWarning("OnPickup not overridden"); - messageBar.Write("Picked up: " + itemName, Color.yellow); + messageBar.Write("Picked up: " + Name, Color.yellow); Destroy(gameObject); } public override void Die() { - messageBar.Write("Destroyed: " + itemName, Color.red); + messageBar.Write("Destroyed: " + Name, Color.red); Destroy(gameObject); } } \ No newline at end of file diff --git a/Assets/Scripts/EntityMonster.cs b/Assets/Scripts/EntityMonster.cs index d724cd9..1a130b5 100644 --- a/Assets/Scripts/EntityMonster.cs +++ b/Assets/Scripts/EntityMonster.cs @@ -4,7 +4,19 @@ using UnityEngine; public class EntityMonster : Entity { + public virtual string Name { + get { + Debug.LogWarning("No name given to a monster"); + return ""; + } + } + public virtual void OnTurn(){ Debug.LogWarning("OnTurn() not overridden"); } + + public override void Die() { + messageBar.Write("Killed: " + Name, Color.red); + Destroy(gameObject); + } } \ No newline at end of file diff --git a/Assets/Scripts/EntityMonsterSlime.cs b/Assets/Scripts/EntityMonsterSlime.cs index f1234de..7b49a38 100644 --- a/Assets/Scripts/EntityMonsterSlime.cs +++ b/Assets/Scripts/EntityMonsterSlime.cs @@ -4,6 +4,12 @@ using UnityEngine; public class EntityMonsterSlime : EntityMonster { + public override string Name { + get { + return "Slime"; + } + } + public float moveChance = 0.5f; public float visionRange = 4; protected EntityPlayer player;