Merge branch 'master' of https://github.com/Steffo99/LD44
This commit is contained in:
commit
dff1c71086
2 changed files with 38 additions and 0 deletions
27
Assets/Scripts/EntityItemPoisonHeart.cs
Normal file
27
Assets/Scripts/EntityItemPoisonHeart.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EntityItemPoisonHeart : EntityItem
|
||||
{
|
||||
public int damage;
|
||||
protected EntityPlayer player;
|
||||
public override string Name {
|
||||
get {
|
||||
return "Poisonous Heart";
|
||||
}
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
protected new void Start() {
|
||||
base.Start();
|
||||
player = GameObject.FindGameObjectWithTag("Player").GetComponent<EntityPlayer>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
public override void OnPickup(EntityPlayer player) {
|
||||
messageBar.Write("You used: " + Name, Color.yellow);
|
||||
player.hp-=damage;
|
||||
if (player.hp <= 0) player.Die();
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
11
Assets/Scripts/EntityItemPoisonHeart.cs.meta
Normal file
11
Assets/Scripts/EntityItemPoisonHeart.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6effa3f71be846844844432d38652a57
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in a new issue