コード例 #1
0
 public Shot(Point location, Direction direction, ShotType shotType)
 {
     Location   = location;
     Direction  = direction;
     _lastMoved = DateTime.Now;
     ShotType   = shotType;
 }
コード例 #2
0
ファイル: BallisticDemo.cs プロジェクト: amitprakash07/dx11
        private BallisticDemo(IntPtr hInstance)
            : base(hInstance) {
            _currentShotType = ShotType.Laser;

            MainWindowCaption = "Ballistic Demo";

            _lastMousePos = new Point();

            _camera = new FpsCamera();
            _camera.LookAt(new Vector3(10, 2, -10), new Vector3(0, 1, 0), Vector3.UnitY);

            _dirLights = new[] {
                new DirectionalLight {
                    Ambient = new Color4( 0.2f, 0.2f, 0.2f),
                    Diffuse = new Color4(0.7f, 0.7f, 0.7f),
                    Specular = new Color4(0.8f, 0.8f, 0.8f),
                    Direction = new Vector3(-0.57735f, -0.57735f, 0.57735f)
                },
                new DirectionalLight {
                    Ambient = new Color4(0,0,0),
                    Diffuse = new Color4(1.0f, 0.4f, 0.4f, 0.4f),
                    Specular = new Color4(1.0f, 0.2f, 0.2f, 0.2f),
                    Direction = new Vector3(-0.707f, -0.707f, 0)
                },
                new DirectionalLight {
                    Ambient = new Color4(0,0,0),
                    Diffuse = new Color4(1.0f,0.2f, 0.2f, 0.2f),
                    Specular = new Color4(0.2f,0.2f,0.2f),
                    Direction = new Vector3(0, 0, -1)
                }
            };
        }
コード例 #3
0
 public HistoryShot(int playerShooting, ShotCoord from, ShotCoord to, ShotType type)
 {
     this.playerShooting = playerShooting;
     this.from           = from;
     this.to             = to;
     this.type           = type;
 }
コード例 #4
0
 static void AddHit(ShotType shot) 
 {
     switch (shot)
     {
         case ShotType.Green:
         {
             statSheet.GreenHit++;
             break;
         }
         case ShotType.Fairway:
         {
             statSheet.FairWayHit++;
             break;
         }
         case ShotType.Scramble:
         {
             statSheet.ScrambleHit++;
             break;
         }
         default:
         {
             WriteError(CALC_ERROR);
             break;
         }
     }
 }
コード例 #5
0
        private BallisticDemo(IntPtr hInstance)
            : base(hInstance)
        {
            _currentShotType = ShotType.Laser;

            MainWindowCaption = "Ballistic Demo";

            _lastMousePos = new Point();

            _camera = new FpsCamera();
            _camera.LookAt(new Vector3(10, 2, -10), new Vector3(0, 1, 0), Vector3.UnitY);

            _dirLights = new[] {
                new DirectionalLight {
                    Ambient   = new Color4(0.2f, 0.2f, 0.2f),
                    Diffuse   = new Color4(0.7f, 0.7f, 0.7f),
                    Specular  = new Color4(0.8f, 0.8f, 0.8f),
                    Direction = new Vector3(-0.57735f, -0.57735f, 0.57735f)
                },
                new DirectionalLight {
                    Ambient   = new Color4(0, 0, 0),
                    Diffuse   = new Color4(1.0f, 0.4f, 0.4f, 0.4f),
                    Specular  = new Color4(1.0f, 0.2f, 0.2f, 0.2f),
                    Direction = new Vector3(-0.707f, -0.707f, 0)
                },
                new DirectionalLight {
                    Ambient   = new Color4(0, 0, 0),
                    Diffuse   = new Color4(1.0f, 0.2f, 0.2f, 0.2f),
                    Specular  = new Color4(0.2f, 0.2f, 0.2f),
                    Direction = new Vector3(0, 0, -1)
                }
            };
        }
コード例 #6
0
        private void GetTypeOfShot()
        {
            var shotTypeOdds = GetOdds(new List <double>
            {
                playerShooting.Rating.ShortRange,
                playerShooting.Rating.MediumRange,
                playerShooting.Rating.LongRange
            }).ToList();

            shotTypeOdds[1] = shotTypeOdds[0] + shotTypeOdds[1];
            shotTypeOdds[2] = shotTypeOdds[1] + shotTypeOdds[2];

            var randomNumber = Util.RandomDouble();

            if (randomNumber <= shotTypeOdds[0])
            {
                shotType = ShotType.CloseRange;
            }
            else if (randomNumber <= shotTypeOdds[1])
            {
                shotType = ShotType.MediumRange;
            }
            else
            {
                shotType = ShotType.ThreePointer;
            }
        }
コード例 #7
0
    void PowerUp(PowerBlock po)
    {
        PowerBlock.PoweUpType type = po.Type;

        switch (type)
        {
        case PowerBlock.PoweUpType.Plain:
            soundEffect.playPowerUp1();
            GameSystemData.Instance.Score.Value += 100;
            break;

        case PowerBlock.PoweUpType.SpeedUp:
            Speed += 0.5f;
            soundEffect.playPowerUp2();
            break;

        case PowerBlock.PoweUpType.TwinShot:
            shotMode = ShotType.Twin;
            soundEffect.playPowerUp2();
            break;

        case PowerBlock.PoweUpType.TripleShot:
            shotMode = ShotType.Triple;
            soundEffect.playPowerUp2();
            break;

        case PowerBlock.PoweUpType.Option:
            createOption();
            soundEffect.playPowerUp2();
            break;
        }
    }
コード例 #8
0
 /// <summary>
 /// Creates a shot object
 /// </summary>
 /// <param name="texture">
 /// The object's texture
 /// </param>
 /// <param name="position">
 /// The 2D position of the object on the game screen
 /// </param>
 /// <param name="direction">
 /// The direction in which the shot will move
 /// </param>
 /// /// <param name="speed">
 /// The speed of the object
 /// </param>
 public Shot(Texture2D texture, Vector2 position, Direction direction, int speed, ShotType generatedBy) :
     base(texture, position, speed)
 {
     this.direction   = direction;
     this.speed       = speed;
     this.generatedBy = generatedBy;
 }
コード例 #9
0
ファイル: ShipsService.cs プロジェクト: ylt/Battleships
        public ShotType Fire(int playerId, Position pos)
        {
            gb.SendMessage(new ChatMessage("SYSTEM", "TURN:" + (1 - playerId)));
            ShotType stype = gb.games[1 - playerId].FireAtShip(pos);

            return(stype);
        }
コード例 #10
0
        private void capture(ShotType shotType)
        {
            try
            {
                CaptureForm _captureForm = new CaptureForm(shotType);

                if ((_captureForm.ShowDialog() != DialogResult.OK) || (_captureForm.Image == null))
                {
                    return;
                }

                string _filename =
                    string.Format("{0}.{1}", DateTime.Now.ToString("yyyyMMddHHmmssff"), ImageFormat.Jpeg).ToLower();

                Image _img = _captureForm.Image;

                string _pathToSave = Path.Combine(GCONST.CachePath, _filename);

                _img.Save(_pathToSave, ImageFormat.Jpeg);

                Post(new List <string> {
                    GCONST.CachePath + _filename
                }, PostType.Photo);
            }
            catch (Exception _e)
            {
                MessageBox.Show(_e.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #11
0
        /// <summary>
        /// The projectile now triggers this method
        /// </summary>
        public void PlayShootingAnimation(ShotType shotType)
        {
            //Animation
            //Reset current animation to force ChangeFlipbook validation succeed
            ChangeFlipbookState(ActorFlipbookState.All, true);

            if (shotType == ShotType.S1 || shotType == ShotType.TeleportationBeacon)
            {
                ChangeFlipbookState(ActorFlipbookState.ShootingS1, true);
            }
            else if (shotType == ShotType.S2)
            {
                ChangeFlipbookState(ActorFlipbookState.ShootingS2, true);
            }
            else if (shotType == ShotType.SS)
            {
                ChangeFlipbookState(ActorFlipbookState.ShootingSS, true);
            }

            if (IsHealthCritical)
            {
                MobileFlipbook.EnqueueAnimation(ActorFlipbookState.StandLowHealth);
            }
            else
            {
                MobileFlipbook.EnqueueAnimation(ActorFlipbookState.Stand);
            }
        }
コード例 #12
0
        static void WriteWithGolfColors(string line, ShotType shot)
        {
            switch (shot)
            {
                case ShotType.Green:
                    {
                        Console.BackgroundColor = ConsoleColor.DarkGreen;
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        break;
                    }
                case ShotType.Fairway:
                    {
                        Console.BackgroundColor = ConsoleColor.DarkBlue;
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        break;
                    }
                case ShotType.Scramble:
                    {
                        Console.BackgroundColor = ConsoleColor.Yellow;
                        Console.ForegroundColor = ConsoleColor.Black;
                        break;
                    }
                default:
                    {
                        Console.BackgroundColor = ConsoleColor.DarkMagenta;
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        break;
                    }
            }

            Console.WriteLine("\n"+line);
            Console.ResetColor();
            Console.WriteLine();
        }
コード例 #13
0
        private void Update()
        {
            //get inputs if particle demo is active

            if (Input.GetKeyDown("1"))
            {
                currentShotType = ShotType.PISTOL;
                Debug.Log("currentShotType->" + currentShotType);
            }
            if (Input.GetKeyDown("2"))
            {
                currentShotType = ShotType.ARTILLERY;
                Debug.Log("currentShotType->" + currentShotType);
            }
            if (Input.GetKeyDown("3"))
            {
                currentShotType = ShotType.FIREBALL;
                Debug.Log("currentShotType->" + currentShotType);
            }
            if (Input.GetKeyDown("4"))
            {
                currentShotType = ShotType.LASER;
                Debug.Log("currentShotType->" + currentShotType);
            }
            if (Input.GetButtonDown("Fire1"))
            {
                Fire();
            }
        }
コード例 #14
0
        public void ConsumeShootAction(SyncMobile syncMobile)
        {
            ShotType tmp = syncMobile.SelectedShotType;

            if (tmp == ShotType.SS)
            {
                GameScene.Camera.ApplyCameraEffect(CameraSpecialEffect.FadeOut);
            }

            ShootWithModifiers(syncMobile);

            LastCreatedProjectileList.ForEach((x) => x.OnFinalizeExecutionAction += () =>
            {
                if (tmp == ShotType.SS)
                {
                    GameScene.Camera.ApplyCameraEffect(CameraSpecialEffect.FadeIn);
                }

                FinalizeTurn(syncMobile.SelectedShotType);
                LevelScene.HUD.StatusBarDictionary[this].UpdateAttributeList();

                OnEndTurn?.Invoke();
                OnEndTurn = default;

                //Refresh Status (if necessary)
                LevelScene.HUD.StatusBarDictionary[this].UpdateAttributeList();
            });

            GameScene.Camera.TrackObject(LastCreatedProjectileList.First());

            if (IsPlayable)
            {
                LevelScene.HUD.DisableSS();
            }
        }
コード例 #15
0
    /// <summary>
    /// Plays an animation given the type and hand.
    /// </summary>
    public void PlayAnimationForType(ShotType type, bool leftHanded)
    {
        switch (type)
        {
        case ShotType.SHOT:
            m_animator.Play("Shoot");
            break;

        case ShotType.LAYUP:
            if (leftHanded)
            {
                m_animator.Play("LayupL");
            }
            else
            {
                m_animator.Play("Layup");
            }
            break;

        case ShotType.DUNK:
            if (leftHanded)
            {
                m_animator.Play("1hand_dunkL");
            }
            else
            {
                m_animator.Play("1hand_dunk");
            }
            StartCoroutine(PlayerUtils.Dunk(this, GameManager.GetBasket()));
            break;

        default:
            break;
        }
    }
コード例 #16
0
ファイル: Shot.cs プロジェクト: kubek96/PI
 /// <summary>
 /// Konstruktor kopiuj¹cy.
 /// </summary>
 /// <param name="shot">Obiekt wzorcowy.</param>
 public Shot(Shot shot)
 {
     _shotGraphic = shot._shotGraphic.Clone();
     _shotType    = shot._shotType;
     _speed       = shot._speed;
     _shootEnemy  = shot._shootEnemy;
 }
コード例 #17
0
        static private Bitmap Shot(ShotType shotType)
        {
            Rectangle rect = new Rectangle();

            switch (shotType)
            {
            case ShotType.PrimaryScreen:
                rect = Screen.PrimaryScreen.Bounds;
                break;

            case ShotType.VirtualScreen:
                rect = SystemInformation.VirtualScreen;
                break;

            case ShotType.WorkingArea:
                rect = Screen.PrimaryScreen.WorkingArea;
                break;

            case ShotType.ActiveWindow:
                rect = ForegroundWindow.GetForegroundWindowRect();
                break;
            }

            return(Shot(rect));
        }
コード例 #18
0
 static void AddMiss(ShotType shot, bool left = false) // left is set to false, making it an optional parameter.
 {
     switch (shot)
     {
         case ShotType.Green:
             {
                 if (left)
                     statSheet.GreenMissLeft++;
                 else
                     statSheet.GreenMissRight++;
                 break;
             }
         case ShotType.Fairway:
             {
                 if (left)
                     statSheet.FairWayMissLeft++;
                 else
                     statSheet.FairWayMissRight++;
                 break;
             }
         case ShotType.Scramble:
             {
                 statSheet.ScrambleMiss++;
                 break;
             }
         default:
             {
                 WriteError(CALC_ERROR);
                 break;
             }
     }
 }
コード例 #19
0
        public CaptureForm(ShotType shotType)
        {
            InitializeComponent();

            //this code must be here, you must set beckground before form takes focus
            ScreenCapture _sc = new ScreenCapture();

            BackgroundImageLayout = ImageLayout.None;
            BackgroundImage       = _sc.CaptureRectangle(GetScreenSize());

            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            switch (shotType)
            {
            case ShotType.General:
                m_state = new GeneralState(this);
                break;

            case ShotType.Region:
                m_state = new RegionState(this);
                break;

            case ShotType.Window:
                m_state = new WindowState(this);
                break;

            case ShotType.Screen:
                m_state = new ScreenState(this);
                break;
            }
        }
コード例 #20
0
        public bool CanFire(GameTime gameTime, ShotType type)
        {
            if (m_Hull <= 0f)
            {
                return(false);
            }

            float time = (float)gameTime.TotalGameTime.TotalSeconds;

            if (type == ShotType.Artillery)
            {
                if (time - m_LastArtillery < m_ArtilleryDelay)
                {
                    return(false);
                }

                m_LastArtillery = time;
            }
            else if (type == ShotType.Laser)
            {
                if (time - m_LastLaser < m_LaserDelay)
                {
                    return(false);
                }

                m_LastLaser = time;
            }

            return(true);
        }
コード例 #21
0
    private void SetShotSelectionBackgroundImageColour(ShotType shotType, bool animated)
    {
        Color targetColour = shotType switch {
            ShotType.Flat => flatShotColour,
            ShotType.TopSpin => topSpinShotColour,
            ShotType.Slice => sliceShotColour,
            ShotType.DropOrLob => dropOrLobShotColour,
            _ => Color.white
        };

        if (animated)
        {
            AnimationOperation colourOperation = new AnimationOperation(shotSelectionBackgroundImage.gameObject, UIAnimationType.Colour, EaseType.SmoothStepSmoother, 0, 0.5f)
            {
                colourSettings = new AnimationOperation.ColourSettings {
                    startColour  = shotSelectionBackgroundImage.color,
                    targetColour = targetColour
                }
            };
            AnimationSequence colourAnimation = new AnimationSequence(e => StartCoroutine(e));
            colourAnimation.AddOperation(colourOperation);

            colourAnimation.Play();
        }
        else
        {
            shotSelectionBackgroundImage.color = targetColour;
        }
    }
コード例 #22
0
ファイル: Shot.cs プロジェクト: MartinTodorov/SmallGames
        public Shot(ShotType type)
        {
            this.Type = type;

            switch (type)
            {
                case ShotType.Normal:
                    this.Color = ConsoleColor.White;
                    this.Symbol = new char[,] { { '^' } };
                    break;
                case ShotType.MachineGune:
                    this.Color = ConsoleColor.Red;
                    this.Symbol = new char[,] { { '\'' }, { ' ' } , { '\'' } };
                    break;
                case ShotType.Laser:
                    this.Color = ConsoleColor.Yellow;
                    this.Symbol = new char[,] { { '|' }, { '|' } };
                    break;
                case ShotType.Hook:
                    this.Color = ConsoleColor.Green;
                    this.Symbol = new char[,] { { '^' } };
                    break;
                default:
                    break;
            }
        }
コード例 #23
0
 void Fire(ShotType shotType)
 {
     if (ammo.Count < 64)
     {
         ammo.Add(new AmmoRound(shotType));
     }
 }
コード例 #24
0
    void Update()
    {
        if (shotCap == 10)
        {
            shotCap  = 0;
            shotType = ShotType.Basic;
        }

        if (Time.time >= nextAttackTime)
        {
            if (Input.GetButtonDown("Fire1"))
            {
                anim.SetBool("isShooting", true);
                //T6_AudioManager.am.RandomSoundEffect(shotsAudio);
                T6_AudioManager.am.Play(shotsAudio[0]);
                // AudioSource.PlayClipAtPoint(shotAudio[0], Camera.main.transform.position, 1);
                switch (shotType)
                {
                case ShotType.Basic:
                    ShotBasic();
                    player.ShootPlaceState(true);
                    break;

                case ShotType.Triple:
                    ShotTriple();
                    player.ShootPlaceState(true);
                    break;

                default:
                    break;
                }
                AttackTime();
            }
            else
            {
                anim.SetBool("isShooting", false);
                player.ShootPlaceState(false);
            }
            if (canShotGranade)
            {
                if (Input.GetButtonDown("Fire2"))
                {
                    anim.SetBool("granade", true);
                    // T6_AudioManager.am.RandomSoundEffect(shotsAudio);
                    T6_AudioManager.am.Play(shotsAudio[1]);
                    //AudioSource.PlayClipAtPoint(shotAudio[1], Camera.main.transform.position, 2);
                    shotType = ShotType.Granade;
                    player.GranadePlaceState(true);
                    ShotGranade();
                    AttackTime();
                    shotType = ShotType.Basic;
                }
                else
                {
                    anim.SetBool("granade", false);
                    player.GranadePlaceState(false);
                }
            }
        }
    }
コード例 #25
0
ファイル: GunCrew.cs プロジェクト: tng2903/BES_Cannoneer
        public void FireShot(ShotType shot, int powderCharge = 5)
        {
            if (!this.IsReady || this._isFiring)
            {
                return;
            }
            this.IsReady   = false;
            this._isFiring = true;
            var ossVect = new Vector2(this.ShotSpawnLocation.transform.position.x - this.transform.position.x,
                                      this.ShotSpawnLocation.transform.position.y - this.transform.position.y);

            switch (shot)
            {
            case ShotType.CHAIN:
                break;

            case ShotType.GRAPE:
                break;

            case ShotType.ROUND:
                this.FireRoundShot(ossVect.normalized * powderCharge);
                break;

            default:
                throw new ArgumentOutOfRangeException("shot");
            }
            this._isFiring = false;
        }
コード例 #26
0
        public void ChangeShotType(ShotType ShotType)
        {
            if (ShotType == this.ShotType)
            {
                return;
            }
            this.ShotType = ShotType;

            if (ShotType == ShotType.S1 || ShotType == ShotType.SS)
            {
                desiredFinalPosition = S1OwnerOffset.Y;
            }
            else if (ShotType == ShotType.S2)
            {
                desiredFinalPosition = S2OwnerOffset.Y;
            }

            if (desiredFinalPosition == CurrentOffset.Y)
            {
                return;
            }

            if (desiredFinalPosition < CurrentOffset.Y)
            {
                currentStartingSpeed = -currentStartingSpeed;
            }
            else
            {
                currentStartingSpeed = Math.Abs(currentStartingSpeed);
            }

            yMovementComponent.Preset(CurrentOffset.Y, desiredFinalPosition, currentStartingSpeed, Parameter.SatelliteSSAnimationTotalMotionTime);
        }
コード例 #27
0
ファイル: CombatManager.cs プロジェクト: Syldarion/DJD-JP
    public void UpdateShotType(int new_type)
    {
        //0 - normal, 1 - cluster, 2 - chain

        switch (new_type)
        {
        case 0:
        default:
            SelectedShotType = ShotType.Normal;
            ShotHullDamage   = 2;
            ShotSailDamage   = 2;
            break;

        case 1:
            SelectedShotType = ShotType.Cluster;
            ShotHullDamage   = 3;
            ShotSailDamage   = 1;
            break;

        case 2:
            SelectedShotType = ShotType.Chain;
            ShotHullDamage   = 1;
            ShotSailDamage   = 3;
            break;
        }

        UpdatePlayerDamage();
    }
コード例 #28
0
        //------------------------------------------------------------------------------------------------------------------
        //                                                  SHOT TYPES
        //------------------------------------------------------------------------------------------------------------------

        public static ShotTypeProbabilities GenerateShotTypeProbabilities(ShotType previousType, PlayerMatchInstance player)
        {
            ShotTypeProbabilities shotTypeProbabilities = ShotTypeProbabilities.GetShotTypeProbabilitiesFollowing(previousType);

            ShotTypePlaystyleModification(ref shotTypeProbabilities, player);
            return(shotTypeProbabilities);
        }
コード例 #29
0
    //初期設定
    public void setUp()
    {
        //使用する各種コンポーネントを設定
        enemyMove  = GetComponent <EnemyMove> ();
        shottype   = GetComponent <ShotType> ();
        spaceship  = GetComponent <Spaceship> ();
        managerObj = FindObjectOfType <Manager> ();

        //プレイヤーを設定 || Player -> null, Player(Clone) -> OK
        playerObj = GameObject.Find(managerObj.selectedPlayer.name + "(Clone)");
        //managerObj.selectedPlayer.name + "(Clone)"
        // 倒した時のポイントを設定
        if (isLastBoss != false)
        {
            point = LAST_BOSS_POINT;
        }
        else if (isSpecialEnemy != false)
        {
            point = SPECIAL_ENEMY_POINT;
        }
        else
        {
            point = NORMAL_ENEMY_POINT;
        }
    }
コード例 #30
0
    void ShotChange(int plus)
    {
        if (select_prim)
        {
            prim_shot += plus;
            if (prim_shot < ShotType.FourWay)
            {
                prim_shot = ShotType.Spread;
            }
            else if (prim_shot > ShotType.Spread)
            {
                prim_shot = ShotType.FourWay;
            }
        }
        else
        {
            seco_shot += plus;
            if (seco_shot < ShotType.FourWay)
            {
                seco_shot = ShotType.Spread;
            }
            else if (seco_shot > ShotType.Spread)
            {
                seco_shot = ShotType.FourWay;
            }
        }

        StartCoroutine(CoolTime());
    }
コード例 #31
0
        /// <summary>
        /// Show the shot result on the shooting board.
        /// </summary>
        /// <param name="coords"></param>
        /// <param name="result"></param>
        public void ProcessShotResult(Coordinates coords, ShotType result)
        {
            var cell = ShootingBoard.Cells.At(coords.Row, coords.Column) as ShootingCell;

            if (cell == null)
            {
                return;
            }

            switch (result)
            {
            case ShotType.Hit:
            case ShotType.Miss:
            case ShotType.Sunk:
            {
                cell.ShotType = result;
                break;
            }

            default:
            {
                cell.ShotType = ShotType.Unknown;
                break;
            }
            }
        }
コード例 #32
0
ファイル: Shot.cs プロジェクト: jmfb/XComGenerations
		private static Shot Create(ShotType shotType, int accuracy, int timeUnits)
		{
			return new Shot
			{
				ShotType = shotType,
				Accuracy = accuracy,
				TimeUnits = timeUnits
			};
		}
コード例 #33
0
 public IWindAdjuster GetWindAdjuster(ShotType shotType)
 {
     switch (shotType)
     {
         case ShotType.Normal:
             return new NormalShotWindAdjuster(this.Elevation, this.WindSpeed, this.WindDirection);
         default:
             return new NullShotWindAdjuster();
     }
 }
コード例 #34
0
 public IEnumerator FireAtWill( bool shouldFireAtWill, ShotType sType )
 {
     this.ShouldFireAtWill = shouldFireAtWill;
     do {
         yield return new WaitForFixedUpdate();
         if ( !this.IsReady ) {
             this.SignalReady();
         }
         yield return new WaitForFixedUpdate();
         this.FireShot( sType );
     } while ( this.ShouldFireAtWill );
 }
コード例 #35
0
 public void FireShot( ShotType shot, int powderCharge = 5 )
 {
     if ( !this.IsReady || this._isFiring ) return;
     this.IsReady = false;
     this._isFiring = true;
     var ossVect = new Vector2( this.ShotSpawnLocation.transform.position.x - this.transform.position.x,
         this.ShotSpawnLocation.transform.position.y - this.transform.position.y );
     switch ( shot ) {
         case ShotType.CHAIN:
             break;
         case ShotType.GRAPE:
             break;
         case ShotType.ROUND:
             this.FireRoundShot( ossVect.normalized * powderCharge );
             break;
         default:
             throw new ArgumentOutOfRangeException( "shot" );
     }
     this._isFiring = false;
 }
コード例 #36
0
 public void Shot(ShotType pShotType)
 {
     if(pShotType == ShotType.Magic)
       {
       Instantiate(Magic, transform.position, transform.rotation);
       }
       if (pShotType == ShotType.Fireball)
       {
       Instantiate(Fireball, transform.position, transform.rotation);
       }
       if (pShotType == ShotType.Boulder)
       {
       Instantiate(Boulder, transform.position, transform.rotation);
       }
       if (pShotType == ShotType.Meatmissile)
       {
       Instantiate(MeatMissile, transform.position, transform.rotation);
       Instantiate(MeatMissile, transform.position, new Quaternion(transform.rotation.x,transform.rotation.y,transform.rotation.z+ 0.1f,transform.rotation.w));
       Instantiate(MeatMissile, transform.position, new Quaternion(transform.rotation.x, transform.rotation.y, transform.rotation.z - 0.1f, transform.rotation.w));
       }
 }
コード例 #37
0
ファイル: StandardShot.cs プロジェクト: JonSaffron/Labyrinth
        public StandardShot(World world, Vector2 position, Direction d, int energy, ShotType shotType)
            : base(world, position)
        {
            this.Energy = energy;
            this.ShotType = shotType;
            this._directionOfTravel = d;
            TrySetDirectionAndDestination();

            string textureName;
            switch (this.ShotType)
                {
                case ShotType.Player:
                    textureName = "Sprites/Shot/RedShot";
                    break;
                case ShotType.Monster:
                    textureName = "Sprites/Shot/GreenShot";
                    break;
                default:
                    throw new InvalidOperationException();
                }
            var staticImage = Animation.StaticAnimation(World, textureName);
            Ap.PlayAnimation(staticImage);
            ResetTimeToTravel();
        }
コード例 #38
0
 public ShotTypeViewModel(ShotType shotType)
 {
     this.ShotType = shotType;
 }
コード例 #39
0
 private IEnumerator FireOffShot( GunCrew gCrew, ShotType sType )
 {
     if ( !gCrew.IsReady ) {
         gCrew.SignalReady();
         yield return new WaitForSeconds( gCrew.ReloadTime );
     }
     this.FireShot( gCrew, sType );
 }
コード例 #40
0
 void FireShot( GunCrew gCrew, ShotType sType )
 {
     gCrew.FireShot( sType );
     this.RoundShotsRemaining--;
     this.OnFiredRoundShot( this );
 }
コード例 #41
0
 // Use this for initialization
 void Start()
 {
     //  Screen.SetResolution(1600, 900, true);
     life = MAXLIFE;
     mShotType = ShotType.Boulder;
     isLatter = false;
     startVector = transform.position;
 }
コード例 #42
0
ファイル: BallisticDemo.cs プロジェクト: remy22/dx11
        public override void UpdateScene(float dt)
        {
            base.UpdateScene(dt);
            if (Util.IsKeyDown(Keys.Up)) {
                _camera.Walk(10.0f * dt);
            }
            if (Util.IsKeyDown(Keys.Down)) {
                _camera.Walk(-10.0f * dt);
            }
            if (Util.IsKeyDown(Keys.Left)) {
                _camera.Strafe(-10.0f * dt);
            }
            if (Util.IsKeyDown(Keys.Right)) {
                _camera.Strafe(10.0f * dt);
            }
            if (Util.IsKeyDown(Keys.PageUp)) {
                _camera.Zoom(-dt);
            }
            if (Util.IsKeyDown(Keys.PageDown)) {
                _camera.Zoom(+dt);
            }

            _camera.UpdateViewMatrix();

            for (var index = 0; index < _ammo.Count; index++) {
                var shot = _ammo[index];
                shot.Particle.Integrate(dt);
                if (shot.Particle.Position.Y < 0.0f || shot.StartTime + 10.0f < Timer.TotalTime || shot.Particle.Position.Z > 200.0f) {
                    _ammo.Remove(shot);
                }
            }
            fireDelay -= dt;
            if (Util.IsKeyDown(Keys.D1)){
                _currentShotType = ShotType.Pistol;
            } else if (Util.IsKeyDown(Keys.D2)) {
                _currentShotType = ShotType.Artillery;
            } else if (Util.IsKeyDown(Keys.D3)) {
                _currentShotType = ShotType.Fireball;
            } else if (Util.IsKeyDown(Keys.D4)) {
                _currentShotType = ShotType.Laser;
            } else if (Util.IsKeyDown(Keys.Space) && fireDelay < 0) {
                Fire();
                fireDelay = 0.2f;
            }
        }
コード例 #43
0
ファイル: CombatManager.cs プロジェクト: Syldarion/DJD-JP
    public void UpdateShotType(int new_type)
    {
        //0 - normal, 1 - cluster, 2 - chain

        switch (new_type)
        {
            case 0:
            default:
                SelectedShotType = ShotType.Normal;
                ShotHullDamage = 2;
                ShotSailDamage = 2;
                break;
            case 1:
                SelectedShotType = ShotType.Cluster;
                ShotHullDamage = 3;
                ShotSailDamage = 1;
                break;
            case 2:
                SelectedShotType = ShotType.Chain;
                ShotHullDamage = 1;
                ShotSailDamage = 3;
                break;
        }

        UpdatePlayerDamage();
    }