Commit 3729be12 authored by Danny Huang's avatar Danny Huang
Browse files

fixed null

parent 0a222f89
......@@ -36,14 +36,14 @@ public class ItemModifierInfoCollection
_addItemModiferInfo ("{}x projectiles fired", 6, 6, eItemSubtype.GUN, eItemRarity.RARE);
_addItemModiferInfo ("{}x projectiles fired", 8, 8, eItemSubtype.GUN, eItemRarity.UNIQUE);
_addItemModiferInfo ("Slows enemy by {}% for 5 seconds", 10, 10, eItemSubtype.GUN, eItemRarity.UNUSUAL);
_addItemModiferInfo ("Slows enemy by {}% for 5 seconds", 50, 50, eItemSubtype.GUN, eItemRarity.RARE);
_addItemModiferInfo ("Freezes enemy for 5 seconds", 100, 100, eItemSubtype.GUN, eItemRarity.UNIQUE);
//_addItemModiferInfo ("Slows enemy by {}% for 5 seconds", 10, 10, eItemSubtype.GUN, eItemRarity.UNUSUAL);
//_addItemModiferInfo ("Slows enemy by {}% for 5 seconds", 50, 50, eItemSubtype.GUN, eItemRarity.RARE);
//_addItemModiferInfo ("Freezes enemy for 5 seconds", 100, 100, eItemSubtype.GUN, eItemRarity.UNIQUE);
_addItemModiferInfo ("Knockback", 0, 0, eItemSubtype.GUN, eItemRarity.UNUSUAL);
_addItemModiferInfo ("Pierce", 0, 0, eItemSubtype.GUN, eItemRarity.RARE);
//_addItemModiferInfo ("Knockback", 0, 0, eItemSubtype.GUN, eItemRarity.UNUSUAL);
//_addItemModiferInfo ("Pierce", 0, 0, eItemSubtype.GUN, eItemRarity.RARE);
//_addItemModiferInfo ("Reanimate killed enemies", 0, 0, eItemSubtype.GUN, eItemRarity.UNIQUE);
/*Hat modifiers*/
_addItemModiferInfo ("Enhanced durability by {}%", 10, 50, eItemSubtype.HAT, eItemRarity.COMMON);
......@@ -56,17 +56,17 @@ public class ItemModifierInfoCollection
_addItemModiferInfo ("Regenerate durability by {}% every 5 seconds", 5, 6, eItemSubtype.HAT, eItemRarity.RARE);
_addItemModiferInfo ("Regenerate durability by {}% every 5 seconds", 7, 8, eItemSubtype.HAT, eItemRarity.UNIQUE);
_addItemModiferInfo ("{}% faster hit recovery", 10, 20, eItemSubtype.HAT, eItemRarity.COMMON);
_addItemModiferInfo ("{}% faster hit recovery", 21, 30, eItemSubtype.HAT, eItemRarity.UNUSUAL);
_addItemModiferInfo ("{}% faster hit recovery", 31, 40, eItemSubtype.HAT, eItemRarity.RARE);
_addItemModiferInfo ("{}% faster hit recovery", 41, 50, eItemSubtype.HAT, eItemRarity.UNIQUE);
//_addItemModiferInfo ("{}% faster hit recovery", 10, 20, eItemSubtype.HAT, eItemRarity.COMMON);
//_addItemModiferInfo ("{}% faster hit recovery", 21, 30, eItemSubtype.HAT, eItemRarity.UNUSUAL);
//_addItemModiferInfo ("{}% faster hit recovery", 31, 40, eItemSubtype.HAT, eItemRarity.RARE);
//_addItemModiferInfo ("{}% faster hit recovery", 41, 50, eItemSubtype.HAT, eItemRarity.UNIQUE);
_addItemModiferInfo ("{}% chance to reflect projectiles", 10, 20, eItemSubtype.HAT, eItemRarity.UNUSUAL);
_addItemModiferInfo ("{}% chance to reflect projectiles", 21, 30, eItemSubtype.HAT, eItemRarity.RARE);
_addItemModiferInfo ("{}% chance to reflect projectiles", 31, 40, eItemSubtype.HAT, eItemRarity.UNIQUE);
//_addItemModiferInfo ("{}% chance to reflect projectiles", 10, 20, eItemSubtype.HAT, eItemRarity.UNUSUAL);
//_addItemModiferInfo ("{}% chance to reflect projectiles", 21, 30, eItemSubtype.HAT, eItemRarity.RARE);
//_addItemModiferInfo ("{}% chance to reflect projectiles", 31, 40, eItemSubtype.HAT, eItemRarity.UNIQUE);
_addItemModiferInfo ("Regenerate life by {}% every 5 seconds", 5, 10, eItemSubtype.HAT, eItemRarity.UNUSUAL);
_addItemModiferInfo ("Reduces damage by {}%", 30, 50, eItemSubtype.HAT, eItemRarity.RARE);
//_addItemModiferInfo ("Regenerate life by {}% every 5 seconds", 5, 10, eItemSubtype.HAT, eItemRarity.UNUSUAL);
//_addItemModiferInfo ("Reduces damage by {}%", 30, 50, eItemSubtype.HAT, eItemRarity.RARE);
//_addItemModiferInfo ("Dual wield guns", 0, 0, eItemSubtype.HAT, eItemRarity.UNIQUE);
}
......
......@@ -69,7 +69,11 @@ public class ProjectileController : MonoBehaviour {
public bool isHeroProjectile()
{
return (this.gunCtrl.gameObject.transform.parent.name == "InventoryBag");
if (this.gunCtrl != null)
if (this.gunCtrl.gameObject.transform.parent != null)
return (this.gunCtrl.gameObject.transform.parent.name == "InventoryBag");
return false;
}
public void RegisterHit()
......
......@@ -110,7 +110,7 @@ public class HatController : ItemCtrl {
public int ReceiveProjectileImpact(GameObject incomingProjectile)
{
ProjectileController projCtrl = (ProjectileController) incomingProjectile.GetComponent<ProjectileController>();
Debug.Log ("received");
/*Get amount of damage that this projectile inflicts and subtract it from hat's durability*/
int damage = projCtrl.getDamage ();
this.durability -= damage;
......
m_EditorVersion: 5.4.0f3
m_EditorVersion: 5.4.1f1
m_StandardAssetsVersion: 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment