public void castSpell(GameObject target)
{
if(target.GetComponent("Enchantable") == null)
{
TraceLogger.LogKVtime("attempt", getSpellName());
TraceLogger.LogKV("target", target.GetInstanceID().ToString()+", "+target.name+", "+target.transform.position);
TraceLogger.LogKV("player", ""+ObjectManager.FindById("Me").transform.position);
(GameObject.Find("Popup").GetComponent("Popup") as Popup).popup("Target ("+target.name+") immune to magic.");
SetHidden(false);
return;
}
TraceLogger.LogKVtime("spell", getSpellName());
ProgramLogger.LogKVtime("spell", getSpellName());
TraceLogger.LogKV("target", target.GetInstanceID().ToString()+", "+target.name+", "+target.transform.position);
TraceLogger.LogKV("player", ""+ObjectManager.FindById("Me").transform.position);
June june = new June(target, file_name);
SetHidden(false);
item_name = "Blank";
file_name = "";
animate = false;
inventoryTexture = Resources.Load( "Textures/Scroll") as Texture2D;
(target.GetComponent("Enchantable") as Enchantable).enchant(june, delegate(GameObject t){absorbSpell(t); });
}