public override void Use(float _str, float _int, float _agi) { if (ActionMan.GetComponent <TurnManager>().CurrentCombatMode == TurnManager.CombatMode.Realtime) { if (Cooldown <= 0) { Cooldown = 1; foreach (GameObject item in enemies) { item.GetComponent <Enemy>().CurrentHealth -= _str; ActionPos = transform.position; ActionMan.GetComponent <ActionManager>().Attacked(item, this); } } Debug.Log("Used Sword"); } else { foreach (GameObject item in enemies) { item.GetComponent <Enemy>().CurrentHealth -= _str; ActionPos = transform.position; ActionMan.GetComponent <ActionManager>().Attacked(item, this); } } }
public override void Use(float _str, float _int, float _agi) { if (Cooldown <= 0) { MinorUpdate(); foreach (GameObject item in enemies) { item.GetComponent <Enemy>().CurrentHealth -= _agi; ActionMan.GetComponent <ActionManager>().Attacked(item, this); Debug.Log("Target slowed : " + item.GetComponent <Enemy>().IsSlowed); } } Debug.Log("Used Bow"); }
public override void Use(float _str, float _int, float _agi) { if (Cooldown <= 0) { MinorUpdate(); foreach (GameObject item in enemies) { item.GetComponent <Enemy>().CurrentHealth -= _str; ActionMan.GetComponent <ActionManager>().Attacked(item, this); Debug.Log("Staff used for real :p"); } } Debug.Log("Used Staff"); }
static void Main(string[] args) { Person brother = new Person(); ActionMan am = new ActionMan(); am.guns = "Laser Beam"; brother.actionMan = am; Person sister = new Person(); Doll d = new Doll(); d.name = "Jill"; sister.doll = d; Serialize(brother, "brother.xml"); Serialize(sister, "sister.xml"); Person b = Deserialize("brother.xml"); Person s = Deserialize("sister.xml"); Console.WriteLine(((ActionMan)b.toy).guns); Console.WriteLine(((Doll)s.toy).name); Console.Read(); }