Exemple #1
0
        protected NPC(String a, Vector2 p) :
            base(a, p)
        {
            affiliation = AffliationTypes.grey;
            health      = 100;
            maxHealth   = 100;

            path         = new Path();
            pathTimer    = 11;
            pathTimerEnd = 5; //TODO: Find out if this is reasonable
            velocity     = new Vector2(1, 0) * movementSpeed;
            drag         = 0;

            movementSpeed = 75;
            shootingSpeed = 0.2f;
            grenadeSpeed  = 3f;
            turningSpeed  = maxTurningSpeed = MathHelper.Pi / 30;

            awareness = 75;
            sight     = 250;
            vision    = MathHelper.Pi / 3;

            shootingCounter = 0;
            grenadeCounter  = 0;

            lastDamager = null;
            fireStatus  = false;

            protectedTimer = 0;
        }
Exemple #2
0
 public GreenPlayerCommander(Vector2 p, AffliationTypes aT, ManagerHelper mH)
     : base("Dots/Green/commander_green", aT, p, mH, 3)
 {
     rockCounter         = 0;
     personalAffiliation = AffliationTypes.green;
     //Set up indicator
     indicator  = new Sprite("Effects/PI_greenCommander", GetOriginPosition(), Vector2.Zero);
     abilityUse = 55;
 }
        public BluePlayerCommander(Vector2 p, AffliationTypes aT, ManagerHelper mH)
            : base("Dots/Blue/commander_blue", aT, p, mH, 3)
        {
            //Set up indicator
            indicator           = new Sprite("Effects/PI_blueCommander", GetOriginPosition(), Vector2.Zero);
            personalAffiliation = AffliationTypes.blue;

            abilityUse = 70;
        }
        public PlayerCommander(string a, AffliationTypes aT, Vector2 p, ManagerHelper mH, double aS)
            : base(a, p)
        {
            affiliation    = aT;
            wantedRotation = rotation;
#if WINDOWS
            oldState = Keyboard.GetState();
#endif
        }
Exemple #5
0
        public RedPlayerCommander(Vector2 p, AffliationTypes aT, ManagerHelper mH)
            : base("Dots/Red/commander_red", aT, p, mH, 3)
        {
            personalAffiliation = AffliationTypes.red;
            //Set up indicator
            indicator = new Sprite("Effects/PI_redCommander", GetOriginPosition(), Vector2.Zero);

            abilityUse = 75;
        }
Exemple #6
0
        public BlueCommander(Vector2 p, AffliationTypes aT)
            : base("Dots/Blue/commander_blue", p)
        {
            affiliation         = aT;
            personalAffiliation = AffliationTypes.blue;
            //Set up indicator
            indicator = new Sprite("Effects/PI_blueCommander", GetOriginPosition());

            abilityUse = 70;
        }
Exemple #7
0
        public RedCommander(Vector2 p, AffliationTypes aT)
            : base("Dots/Red/commander_red", p)
        {
            affiliation         = aT;
            personalAffiliation = AffliationTypes.red;
            //Set up indicator
            indicator = new Sprite("Effects/PI_redCommander", GetOriginPosition(), Vector2.Zero);

            abilityUse = 75;
        }
        public GreenCommander(Vector2 p, AffliationTypes aT)
            : base("Dots/Green/commander_green", p)
        {
            rockCounter         = 0;
            affiliation         = aT;
            personalAffiliation = AffliationTypes.green;
            //Set up indicator
            indicator = new Sprite("Effects/PI_greenCommander", GetOriginPosition());

            abilityUse = 55;
        }
Exemple #9
0
        public Bomber(Vector2 p, AffliationTypes a, NPC t, ManagerHelper mH)
            : base("", p)
        {
            hasBombed      = false;
            drawTarget     = true;
            targetPosition = t.GetOriginPosition();
            health         = 100;
            movementSpeed  = 1000;
            affiliation    = a;

            //Set up rotation
            rotation = PathHelper.Direction(GetOriginPosition(), targetPosition);

            //Set up direction
            float dir = PathHelper.Direction(GetOriginPosition(), t.GetOriginPosition());

            velocity = new Vector2(DWMath.Cos(dir), DWMath.Sin(dir)) * movementSpeed;

            //Set up path
            path = new Path();
            path.Add(targetPosition, mH);

            string targeAsset = "";

            //Set up affiliation
            switch (a)
            {
            case AffliationTypes.red:
                targeAsset = "Dots/Red/targetRed";
                asset      = "Dots/Red/bomber_red";
                break;

            case AffliationTypes.blue:
                targeAsset = "Dots/Blue/targetBlue";
                asset      = "Dots/Blue/bomber_blue";
                break;

            case AffliationTypes.green:
                targeAsset = "Dots/Green/targetGreen";
                asset      = "Dots/Green/bomber_green";
                break;

            case AffliationTypes.yellow:
                targeAsset = "Dots/Yellow/targetYellow";
                asset      = "Dots/Yellow/bomber_yellow";
                break;
            }

            targetSprite = new Sprite(targeAsset, targetPosition);

            mH.GetAudioManager().Play(AudioManager.PLANE, AudioManager.RandomVolume(mH),
                                      AudioManager.RandomPitch(mH), 0, false);
        }
        public YellowCommander(Vector2 p, AffliationTypes aT)
            : base("Dots/Yellow/commander_yellow", p)
        {
            affiliation         = aT;
            personalAffiliation = AffliationTypes.yellow;
            //Set up indicator
            indicator = new Sprite("Effects/PI_yellowCommander", GetOriginPosition());

            abilityTime     = abilityTimer = 0.05f;
            shouldUsePower  = false;
            abilitySpeed    = 250;
            abilityOffSpeed = movementSpeed;
        }
        public YellowPlayerCommander(Vector2 p, AffliationTypes aT, ManagerHelper mH)
            : base("Dots/Yellow/commander_yellow", aT, p, mH, 3)
        {
            personalAffiliation = AffliationTypes.yellow;
            //Set up indicator
            indicator = new Sprite("Effects/PI_yellowCommander", GetOriginPosition(), Vector2.Zero);

            abilityTime    = abilityTimer = 0.05f;
            abilityUse     = 5;
            shouldUsePower = false;
            ranOut         = false;

            abilitySpeed    = 250;
            abilityOffSpeed = movementSpeed;
        }