private bool ActivateAllPossibleAbilities() { bool finalResult = false; List <bool> activationResults = new List <bool>(); int count = abilities.Count; for (int i = 0; i < count; i++) { if (AbilityDeckManager.IsCardInUse() && abilities[i].overrideOtherAbilities == false) { Debug.Log("Another ability is in use, so " + abilities[i].abilityName + " cannnot activate"); continue; } Debug.Log(abilities[i].abilityName + " is being activated from an ability card"); activationResults.Add(abilities[i].Activate()); } int boolCount = activationResults.Count; for (int i = 0; i < count; i++) { if (activationResults[i] == true) { finalResult = true; break; } } return(finalResult); }
public void Initialize(Entity owner, AbilityDeckManager deckManager) { this.owner = owner; this.deckManager = deckManager; PopulateCards(); }
protected override void Start() { //GameManager.RegisterEntity(this); stats = new StatCollection(statTemplate); Controller = GetComponent <Controller2D>(); MyAnimator = GetComponentInChildren <Animator>(); deckManager = GetComponentInChildren <AbilityDeckManager>(); deckManager.Initialize(this); inateAbiliites = GetComponentInChildren <AbilityManager>(); inateAbiliites.Initialize(this); inventory = GetComponentInChildren <Inventory>(); inventory.Initialize(); //AbilityManager2 = GetComponent<AbilityManager2>(); //AbilityManager2.Initialize(MyAnimator, controller); wallStickTimer = new Timer(wallStickTime, true, UnStickFromWall); gravity = -(2 * maxJumpheight) / Mathf.Pow(timeToJumpApex, 2); maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex; minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight); }