示例#1
0
 public Tower(Rectangle towerBase, int health)
 {
     mWorld     = DefenderWorld.Instance;
     mTowerBase = towerBase;
     mCenter    = new Vector2(towerBase.Width / 2 + towerBase.X, towerBase.Height / 2 + towerBase.Y);
     mHealth    = health;
 }
示例#2
0
文件: Arrow.cs 项目: GodLesZ/svn-dump
		public Arrow( DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision )
			: base( world, position, target, dmg, speed, imprecision ) {
			texProjectile = world.texArrow;
			mHitAnimation = "red puff";
			mMissAnimation = "dirt puff";

			SetupProjectile();
			CalculateMovement();
		}
示例#3
0
        public Arrow(DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision)
            : base(world, position, target, dmg, speed, imprecision)
        {
            texProjectile  = world.texArrow;
            mHitAnimation  = "red puff";
            mMissAnimation = "dirt puff";

            SetupProjectile();
            CalculateMovement();
        }
示例#4
0
 public Projectile(DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision)
 {
     mWorld        = world;
     mTarget       = target;
     mPosition     = position;
     mDmg          = dmg;
     mSpeed        = speed;
     mImprecision  = imprecision;
     texProjectile = world.texArrow;
 }
示例#5
0
        public Bullet(DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision)
            : base(world, position, target, dmg, speed, imprecision)
        {
            texProjectile  = world.texBullet;
            mMissAnimation = "dirt puff";
            mHitAnimation  = "red puff";

            mAdditive = true;
            mScale    = 0.4f;
            mDmgType  = EUnitDamageType.Pierce;

            mColor = new Color(255, 150, 150, 255);

            CalculateMovement();
            SetupProjectile();
        }
示例#6
0
        public override void Press()
        {
            base.Press();

            DefenderWorld world = DefenderWorld.Instance;

            if (world.Interface.SelectedTower == null || world.Interface.SelectedTower.Level >= Tower.MAX_LVL)
            {
                return;
            }

            if (world.Status.Money >= world.Interface.SelectedTower.UpgradeCost)
            {
                world.Status.Money -= world.Interface.SelectedTower.Upgrade();
            }
        }
示例#7
0
        public Pulse(DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision)
            : base(world, position, target, dmg, speed, imprecision)
        {
            texProjectile  = world.texBullet;
            mMissAnimation = "redCircle";
            mHitAnimation  = "pulseHit";

            mDmgType      = EUnitDamageType.Energy;
            mAcceleration = 0;
            mAdditive     = true;
            mScale        = 0.7f;

            mColor = new Color(255, 60, 60, 255);

            CalculateMovement();
            SetupProjectile();
        }
示例#8
0
        public Concussion(DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision, int netSize, float slowEffect, int duration)
            : base(world, position, target, dmg, speed, imprecision)
        {
            texProjectile  = world.texConcussion;
            mMissAnimation = "concussion";
            mHitAnimation  = "concussion";
            mSplash        = true;

            mDmgType = EUnitDamageType.Energy;

            mNetSize    = netSize;
            mSlowEffect = slowEffect;
            mDuration   = duration;

            CalculateMovement();
            SetupProjectile();
        }
示例#9
0
        public Flame(DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision, int sDmg, int sRange, float acceleration)
            : base(world, position, target, dmg, speed, imprecision)
        {
            texProjectile  = world.texFire;
            mHitAnimation  = "explosion3";
            mMissAnimation = mHitAnimation;

            mDmgType = EUnitDamageType.Burn;

            mSplash       = true;
            mSplashDmg    = sDmg;
            mSplashRange  = sRange;
            mAcceleration = acceleration;

            SetupProjectile();
            CalculateMovement();
        }
示例#10
0
        public Shell(DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision, int sDmg, int sRange, float acceleration, bool homing)
            : base(world, position, target, dmg, speed, imprecision)
        {
            texProjectile = world.texRocket;

            mHitAnimation  = "explosion1";
            mHitSound      = "RndExplosion";
            mMissAnimation = mHitAnimation;

            mDmgType  = EUnitDamageType.Explosive;
            mMaxSpeed = 15;
            mSplash   = true;

            mSplashDmg    = sDmg;
            mSplashRange  = sRange;
            mHoming       = homing;
            mAcceleration = acceleration;

            SetupProjectile();
            CalculateMovement();
        }
示例#11
0
		public Projectile( DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision ) {
			mWorld = world;
			mTarget = target;
			mPosition = position;
			mDmg = dmg;
			mSpeed = speed;
			mImprecision = imprecision;
			texProjectile = world.texArrow;
		}
示例#12
0
文件: Tower.cs 项目: GodLesZ/svn-dump
		public Tower(Rectangle towerBase, int health) {
			mWorld = DefenderWorld.Instance;
			mTowerBase = towerBase;
			mCenter = new Vector2(towerBase.Width / 2 + towerBase.X, towerBase.Height / 2 + towerBase.Y);
			mHealth = health;
		}