Example #1
0
        public async Task Handle(FireShot command)
        {
            var aggregateGame = await _store.GetById <Game>(command.GameId);

            aggregateGame.FireShot(command.Target, command.AttackingPlayerIndex, command.TargetPlayerIndex);
            await _store.Save(aggregateGame, aggregateGame.Version);
        }
 private void HandleCollision(IPlayer mario, FireShot fireshot, Direction direction)
 {
     fireshot.IsRemove = true;
     if (!(mario.CurrentPowerState is MarioStarBigState || mario.CurrentPowerState is MarioStarSmallState))
     {
         mario.TakeDamage();
     }
 }
 void Awake()
 {
     normalShot  = new NormalShot(ShotSpawnPoint, NormalBolt);
     fireShot    = new FireShot(ShotSpawnPoint, FireBolt);
     makeClone   = new MakeClone(gameObject, ClonePlayer);
     makeBarrior = new MakeBarrior(Barrior, ShotSpawnPoint);
     mateorShot  = new MateorShot(gameObject, Mateor);
     gravityShot = new GravityShot(ShotSpawnPoint, Gravity_Set);
 }
        public void FireShotHandleLoop(IPlayer mario, FireShot fireshot)
        {
            Rectangle marioBox        = mario.Rectangle;
            Rectangle intersectionBox = Rectangle.Intersect(marioBox, fireshot.Rectangle);

            if (!intersectionBox.IsEmpty)
            {
                Direction direction = AllCollisionHandler.GetCollisionDirection(intersectionBox, mario.Rectangle, fireshot.Rectangle);
                HandleCollision(mario, fireshot, direction);
            }
        }
Example #5
0
        public void Shoot()
        {
            if (!BossPhysics.IsFacingLeft)
            {
                heightFactor = 80;
            }
            else
            {
                heightFactor = 0;
            }
            FireShot fireShot = new FireShot(new Vector2(Location.X + heightFactor, Location.Y + randomHeight), BossPhysics.IsFacingLeft);

            fireShots.Add(fireShot);
        }
 public void FireShotHandleLoop(IList <IBlock> BlocksAround, FireShot fireshot)
 {
     foreach (IBlock block in BlocksAround)
     {
         if (block != null)
         {
             Rectangle blockBox        = block.Rectangle;
             Rectangle intersectionBox = Rectangle.Intersect(blockBox, fireshot.Rectangle);
             if (!intersectionBox.IsEmpty)
             {
                 Direction direction = AllCollisionHandler.GetCollisionDirection(intersectionBox, fireshot.Rectangle, blockBox);
                 HandleCollision(fireshot, block, direction);
             }
         }
     }
 }
Example #7
0
    void ShotFireLeft()
    {
        Debug.Log("ShotFireLeft");
        float x    = 1000 * (nowLeftHand.x - prevLeftHand.x);
        float y    = 1000 * (nowLeftHand.y - prevLeftHand.y);
        float z    = 1000 * (nowLeftHand.z - prevLeftHand.z);
        float dist = Vector3.Distance(nowLeftHand, prevLeftHand) * 1000;

        GameObject wildFire = (GameObject)Instantiate(WildFire, nowLeftHand, Quaternion.identity);

        wildFire.transform.parent = effect.transform;
        wildFire.name             = "leftShot";
        FireShot fireShot = wildFire.GetComponent <FireShot> ();

        fireShot.Force(x, y, z);

        Destroy(leftFire);
        leftFire = null;
    }
 private void HandleCollision(FireShot fireshot, IBlock block, Direction direction)
 {
     fireshot.IsRemove = true;
 }
Example #9
0
 public override void Shoot()
 {
     currentShot  = ObjectPool.instance.ActivateProjectile(shotPrefab.weapon, fireSpawn.position, shotPrefab.transform.rotation);
     fireShotComp = currentShot.GetComponent <FireShot>();
     fireShotComp.Initialize(ugB.GetLevel(), numFire, range, burnDamage, burnInterval, numBurns, isUsingSpecial);
 }
 public async Task Handle(FireShot command)
 {
     await Command.Save(command);
 }