コード例 #1
0
ファイル: Projectile.cs プロジェクト: willym1/PantsGame
 public Projectile(Projectile attack, Actor source)
     : base(attack, source)
 {
     knockback = attack.knockback;
     particle = new ProjectileParticle(Global.particleManager.Get(key), new Vector2(source.col_rect.Center.X, source.col_rect.Bottom), direction);
     if (attack.knockback) source.velocity = -particle.velocity;
 }
コード例 #2
0
ファイル: Attack.cs プロジェクト: willym1/PantsGame
        public Attack(Attack attack, Actor source)
            : base(attack)
        {
            attackType = attack.attackType;
            damage = attack.damage;

            sourceUnit = source.unitType;
            source.curAnim = key;
            direction = Global.getVectorAngle(source.direction);

            if (this.GetType() != typeof(CollisionDamage)) source.SetAttackTimer(attack.cooldown);
        }
コード例 #3
0
ファイル: DamageEffect.cs プロジェクト: willym1/PantsGame
        public DamageEffect(Actor source)
        {
            alpha = (float)(removeTimer.Interval);
            sprite = Global.spriteManager.dict["damage_effect"].Get("damage_effect1");

            removeTimer.AutoReset = false;
            removeTimer.Elapsed += new ElapsedEventHandler(removeTimer_Elapsed);
            removeTimer.Start();

            imgpos.X = source.col_rect.Center.X - sprite.rect.Width / 2 + Global.random.Next(-10, 10);
            imgpos.Y = source.col_rect.Center.Y - sprite.rect.Height / 2 + Global.random.Next(-5, 5);
            depth = (imgpos.Y + sprite.texture.Height + 1) * 0.0001f;
        }
コード例 #4
0
ファイル: ChargeAttack.cs プロジェクト: willym1/PantsGame
        public ChargeAttack(ChargeAttack chargeAttack, Actor source)
        {
            startKey = chargeAttack.startKey;
            attackKey = chargeAttack.attackKey;
            /*
            switch (Global.attackManager.dict[source.key].Get(chargeAttack.attackKey).attackType)
            {
                case (AttackType.Melee): attack = new Melee(Global.attackManager.dict[source.key].Get(chargeAttack.attackKey) as Melee, source); break;
                case (AttackType.Projectile): attack = new Projectile(Global.attackManager.dict[source.key].Get(chargeAttack.attackKey) as Projectile, source); break;
                case (AttackType.AreaOfEffect): attack = new AreaOfEffect(Global.attackManager.dict[source.key].Get(chargeAttack.attackKey) as AreaOfEffect, source); break;
            }*/

            //source.curAnim = chargeAttack.startKey;
            //source.charge_timer.Interval = chargeAttack.interval;
            //source.charge_timer.Start();
        }
コード例 #5
0
ファイル: Melee.cs プロジェクト: willym1/PantsGame
 public Melee(Melee attack, Actor source)
     : base(attack, source)
 {
     col_rect.X = (int)(source.col_rect.Center.X + Math.Cos(direction) * (source.col_rect.Width + source.col_rect.Height) / 2 - col_rect.Width / 2);
     col_rect.Y = (int)(source.col_rect.Center.Y + Math.Sin(direction) * (source.col_rect.Width + source.col_rect.Height) / 2 - col_rect.Height / 2);
 }
コード例 #6
0
ファイル: Collision.cs プロジェクト: willym1/PantsGame
 public static void TryCollision(Actor source)
 {
     foreach (Actor target in Global.scene.actors.Where(t => source != t && source.unitType == t.unitType))
         CheckCollision(source, target);
 }
コード例 #7
0
ファイル: AreaOfEffect.cs プロジェクト: willym1/PantsGame
 public AreaOfEffect(AreaOfEffect attack, Actor source)
     : base(attack, source)
 {
     radius = attack.radius;
     pos = Global.toCenter(source.col_rect);
 }