Ejemplo n.º 1
0
        protected override void UsePower(ManagerHelper mH)
        {
            if (CurrentPower() > abilityUse && !mH.GetAbilityManager().HasReachedLargeRockCap())
            {
                Vector2 tempPos;

                if (GetPercentHealth() < .5)
                {
                    tempPos = new Vector2(64) * lastDamagerDirection + GetOriginPosition();
                }
                else
                {
                    tempPos = new Vector2(64) * PathHelper.Direction(rotation) + GetOriginPosition();
                }
                tempPos.X = tempPos.X - (tempPos.X % 32) + 16;
                tempPos.Y = tempPos.Y - (tempPos.Y % 32) + 16;

                if (tempPos.X > 0 && tempPos.X < mH.GetLevelSize().X&&
                    tempPos.Y > 0 && tempPos.Y < mH.GetLevelSize().Y&&
                    !PathHelper.IsNodeBlocked(tempPos))
                {
                    mH.GetAbilityManager().AddLargeRock(tempPos, affiliation);

                    base.UsePower(mH);
                    UpdatePowerStatistic();
                }
            }
        }
Ejemplo n.º 2
0
        protected override void UsePower(ManagerHelper mH)
        {
            if (CurrentPower() > abilityUse)
            {
                Vector2 tempPos = new Vector2(64) * PathHelper.Direction(rotation) + GetOriginPosition();
                tempPos.X = tempPos.X - (tempPos.X % 32) + 16;
                tempPos.Y = tempPos.Y - (tempPos.Y % 32) + 16;

                if (tempPos.X > 0 && tempPos.X < mH.GetLevelSize().X&&
                    tempPos.Y > 0 && tempPos.Y < mH.GetLevelSize().Y&&
                    !PathHelper.IsNodeBlocked(tempPos))
                {
                    mH.GetAbilityManager().AddLargeRock(tempPos, affiliation);

                    base.UsePower(mH);
                    UpdatePowerStatistic();
                }
            }
        }