Beispiel #1
0
        public GangChef(int numberMinion, Vector2 position, PhysicObj target) : base(position, target)
        {
            height = 0;

            lifePoints = 1;

            Animation anim = new Animation(Bloodbender.ptr.Content.Load <Texture2D>("GangChef/chefstand"));

            addAnimation(anim);

            Animation attackAnimation = new Animation(Bloodbender.ptr.Content.Load <Texture2D>("GangChef/chefwork"), 7, 0.1f, 0, 0, 0, 0);

            attackAnimation.isLooping = false;
            addAnimation(attackAnimation);

            attackRate = 3.5f;

            Bloodbender.ptr.shadowsRendering.addShadow(new Shadow(this));

            scale = new Vector2(1.5f, 1.5f);

            fixture       = createOctogoneFixture(64f, 64f, Vector2.Zero, new AdditionalFixtureData(this, HitboxType.BOUND));
            Radius        = 50f;
            body.BodyType = BodyType.Static;
            //add method to be called on collision, different denpending of fixture
            addFixtureToCheckedCollision(fixture);

            fixture.OnCollision += Collision;

            pathNodeType = PathFinderNodeType.OUTLINE;
            createOutlinePathNodes();

            node = new PhysicObj(Vector2.Zero, PathFinderNodeType.CENTER);
            node.createOctogoneFixture(10, 10, Vector2.Zero, new AdditionalFixtureData(node, HitboxType.BOUND)).IsSensor = true;
            node.Radius = 10.0f;

            canAttack             = true;
            canGenerateProjectile = false;
            canBeHitByPlayer      = false;
            canBeHitByProjectile  = true;

            for (int i = 0; i < numberMinion; ++i)
            {
                Bloodbender.ptr.listGraphicObj.Add(new GangMinion(new Vector2(position.X += Bloodbender.ptr.rdn.Next(-50, 51), position.Y += Bloodbender.ptr.rdn.Next(-50, 51)), this, target));
            }

            bloodSpawner.scaleRef = 2;
        }
Beispiel #2
0
        public PartnerFar(Vector2 position, PhysicObj target) : base(position, target)
        {
            height = 0;

            Animation anim = new Animation(Bloodbender.ptr.Content.Load <Texture2D>("Pair/coursePair2"), 7, 0.1f, 0, 0, 0, 0);

            anim.reset();
            addAnimation(anim);

            Animation attackAnimation = new Animation(Bloodbender.ptr.Content.Load <Texture2D>("Pair/attackPair2"), 7, 0.075f, 0, 0, 0, 0);

            attackAnimation.isLooping = false;
            addAnimation(attackAnimation);

            Bloodbender.ptr.shadowsRendering.addShadow(new Shadow(this));

            fixture  = createOctogoneFixture(50f, 50f, Vector2.Zero, new AdditionalFixtureData(this, HitboxType.BOUND));
            Radius   = 50f;
            velocity = _initialVelocity;

            addFixtureToCheckedCollision(fixture);

            _node = new PhysicObj(new Vector2(position.X, position.Y), PathFinderNodeType.CENTER);
            _node.createOctogoneFixture(10, 10, Vector2.Zero, new AdditionalFixtureData(_node, HitboxType.BOUND)).IsSensor = true;
            _node.Radius = 10.0f;

            IComponent comp = new KeepDistanceComponent(300, Bloodbender.ptr.player, _node, this);

            _node.addComponent(comp);

            IComponent comp2 = new FollowBehaviorComponent(this, _node, 0);

            addComponent(comp2);

            distanceAttackWithTarget = 400;

            canAttack             = true;
            canGenerateProjectile = true;
            canBeHitByPlayer      = false;
            canBeHitByProjectile  = false;
        }