PVP Directions

Results 1 to 3 of 3
  1. #1
    Apprentice qwerty011342 is offline
    MemberRank
    Jul 2014 Join Date
    10Posts

    PVP Directions

    Code:
    private static void getDirection(AbstractDealDamageHandler.AttackInfo attack) {
                    if (isAoe) {
                            isRight = false;
                            isLeft = false;
                    } else if (attack.direction < 0 && attack.stance < 0) {
                            isRight = false;
                            isLeft = true;
                    } else if (attack.direction > 0 && attack.stance > 0) {
                        isRight = true;
                        isLeft = false;
                    } else {
                        isRight = false;
                        isLeft = false;
                    }
            }
    How do I modify this so that if a the player's attacks only affect the direction they are facing? EX. A player facing left would only be able to hit his left side meanwhile a player facing right can only hit players on his right side


  2. #2
    Account Upgraded | Title Enabled! Xerdox is offline
    MemberRank
    Oct 2011 Join Date
    PolandLocation
    312Posts

    Re: PVP Directions

    What a sh***y code! Why did you set isRight and isLeft to false for isAoe? When isAoe will be false, isRight and isLeft will be again false too.

  3. #3
    Apprentice qwerty011342 is offline
    MemberRank
    Jul 2014 Join Date
    10Posts

    Re: PVP Directions

    Quote Originally Posted by Xerdox View Post
    What a sh***y code! Why did you set isRight and isLeft to false for isAoe? When isAoe will be false, isRight and isLeft will be again false too.
    isAoe represents AOE skills such as dragon roar. I disabled those.
    Still does not work even if I set those to true.

    Heres my current one :
    Code:
    private static void getDirection(AbstractDealDamageHandler.AttackInfo attack) {
            if (isAoe) {
                isRight = true;
                isLeft = true;
            } else if (attack.direction < 0 && attack.stance < 0) {
                isRight = true;
                isLeft = false;
                
                } else if (attack.direction > 0 && attack.stance > 0) {
                isRight = false;
                isLeft = true;
            } else if (attack.direction == 0 && attack.stance == 0) {
                isRight = true;
                isLeft = false;
            }
        }
    For this code, when a player is facing >>>>>>, it works correctly. However, when the player is facing <<< it does not work.
    Last edited by qwerty011342; 24-07-14 at 10:38 PM.



Advertisement