コード例 #1
0
ファイル: ConsoleMap.cs プロジェクト: ssozinov/bomberSoz
        public Entity ParseMapToCurrentDisplay(char symbolFromMap)
        {
            Entity result = new Entity();

            switch (symbolFromMap)
            {
            case ConsoleConsts.SYMBOL_BOMBER:
                result = new Bomber();
                break;

            case ConsoleConsts.SYMBOL_SPACE:
                result = new Space();
                break;

            case ConsoleConsts.SYMBOL_WALL:
                result = new Wall();
                break;

            case (char)4:
                result = new WallAngle();
                break;

            case ConsoleConsts.SYMBOL_MAP_WALL_VERTICAL:
                result = new WallVerticale();
                break;

            case ConsoleConsts.SYMBOL_MAP_WALL_HORIZONTAL:
                result = new WallHorizontal();
                break;
            }
            return(result);
        }
コード例 #2
0
ファイル: Gun.cs プロジェクト: TheDecimeter/RebuildTheVoid
    private IEnumerator Shoot()
    {
        while (enemies.Count > 0)
        {
            Bomber b = enemies.Pop();
            do
            {
                if (b == null)
                {
                    break;
                }
                yield return(new WaitForSeconds(CoolDown));

                if (b == null || Vector3.Distance(transform.position, b.transform.position) > range)
                {
                    break;
                }
                float pooptimer = 0;
                while (pooptimer < fireRate)
                {
                    if (b == null)
                    {
                        break;
                    }
                    weapon.PointAt(b.transform.position);
                    pooptimer += Time.deltaTime;
                    yield return(null);
                }
                weapon.Retract();
            } while (!b.TryKill(Damage()));
        }
    }
コード例 #3
0
        void EscapeAnimation()
        {
            CheckForIllegalCrossThreadCalls = false;

            txtoutput.ForeColor = Color.Yellow;
            txtoutput.Text      = "\r\nUnidentified Aircraft Detected\r\nFighter In Persuit";

            Bomber.Image  = PersuitSimulator.Properties.Resources.Bomber;
            Fighter.Image = PersuitSimulator.Properties.Resources.AirplaneLate;

            Bomber.Visible  = true;
            Fighter.Visible = true;

            for (int n = 0; n < 500; n++)
            {
                for (int n2 = 0; n2 < 500000; n2++)
                {
                }
                Fighter.Location = new Point(n - 250, n - 390);
                Bomber.Location  = new Point(n - 100, 100);
                Bomber.Refresh();
                Fighter.Refresh();
            }
            Bomber.Visible      = false;
            Fighter.Visible     = false;
            txtoutput.ForeColor = System.Drawing.Color.Red;
            txtoutput.Text      = "\r\nThe Target Has Escaped";
        }
コード例 #4
0
ファイル: MapGenerator.cs プロジェクト: jzhang113/GeomaceRL
        // HACK: ad-hoc placement code
        private void PlaceActors()
        {
            Game.Player.Pos = Map.GetRandomOpenPoint();
            Map.AddActor(Game.Player);

            for (int i = 0; i < Game._enemyCount[Level]; i++)
            {
                var         element   = (Element)(Rand.Next(4) + 1);
                int         enemyType = Rand.Next(4);
                Actor.Actor enemy;

                if (enemyType == 0)
                {
                    enemy = new Sprite(Map.GetRandomOpenPoint(), element);
                }
                else if (enemyType == 1)
                {
                    enemy = new Elemental(Map.GetRandomOpenPoint(), element);
                }
                else if (enemyType == 2)
                {
                    enemy = new Bomber(Map.GetRandomOpenPoint(), element);
                }
                else
                {
                    enemy = new Leech(Map.GetRandomOpenPoint(), element);
                }

                Map.AddActor(enemy);
            }

            Map.Refresh();
        }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     anim          = gameObject.GetComponent <Animator> ();
     rb2d          = gameObject.GetComponent <Rigidbody2D>();
     currentHealth = maxHealth;
     player        = GameObject.FindGameObjectWithTag("Player").GetComponent <Player> ();
     bomber        = GameObject.FindGameObjectWithTag("Enemy").GetComponent <Bomber> ();
 }
コード例 #6
0
 public MotionController(IDisplay display, IGamePad gamePad, IMap map, Bomber bomber, MapManager mapManager)
 {
     _display    = display;
     _gamePad    = gamePad;
     _map        = map;
     _bomber     = bomber;
     _mapManager = mapManager;
 }
コード例 #7
0
 public void RemoveBomber(Bomber bomber)
 {
     bombers.Remove(bomber);
     if (bomber != null)
     {
         Destroy(bomber.gameObject);
     }
 }
コード例 #8
0
 public ShipsBundle()
 {
     Bomber = new Bomber();
     Carrier = new Carrier();
     Fighter = new Fighter();
     Interceptor = new Interceptor();
     Juggernaut = new Juggernaut();
     Scout = new Scout();
 }
コード例 #9
0
    public void SpawnBomberOutOfObject(IAvaiableForEnemySpawn _object)
    {
        Bomber newBomber = ObjectSpawner.SpawnBomber(_object.GetPosition());

        SimulationInstance.enemyObjects.Add(newBomber);
        newBomber.SetupPlayerTransform(SimulationInstance.Player.transform);
        newBomber.SetupPlayersOrbitationWheel(SimulationInstance.Player.OrbitationWheel);
        newBomber.LaunchStartupKick(_object.GetSpawnKickTargetPosition());
        newBomber.ToggleToMoveTowardsPlayer();
    }
コード例 #10
0
        public void With_Bomber_Unit_For_1_second_Then_It_Should_Run_And_Cover_6_Map_Spaces()
        {
            var bomberUnit              = new Bomber();
            var timeForMovementSeconds  = 1;
            var expectedCoveredDistance = 6;

            var actualCoveredDistance = bomberUnit.Move(timeForMovementSeconds);

            Assert.AreEqual(expectedCoveredDistance, actualCoveredDistance);
        }
コード例 #11
0
 // Start is called before the first frame update
 void Start()
 {
     locomotor = GetComponent <Locomotor>();
     bomber    = GetComponent <Bomber>();
     turret    = this.transform.GetChild(2).gameObject;
     if (pcControl)
     {
         moveJoystick.gameObject.SetActive(false);
         aimJoystick.gameObject.SetActive(false);
     }
 }
コード例 #12
0
ファイル: Bomber.cs プロジェクト: LeaKyJar/Aerial-Defence
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #13
0
    private void LaunchBomber()
    {
        Tile target = Tiles[Random.Range(0, Tiles.Count - 1)];
        //print("launching bomber at " + target.gameObject.name);

        GameObject g = Instantiate(BomberTemplate.gameObject);
        Bomber     b = g.GetComponent <Bomber>();

        b.Init(target, this);
        bombers.Add(b);
    }
コード例 #14
0
ファイル: Gun.cs プロジェクト: TheDecimeter/RebuildTheVoid
    private void OnTriggerEnter(Collider other)
    {
        Bomber b = other.gameObject.GetComponent <Bomber>();

        if (b)
        {
            enemies.Push(b);
            if (enemies.Count == 1)
            {
                StartCoroutine(Shoot());
            }
        }
    }
コード例 #15
0
    private void SpawnBomber()
    {
        if (spawningEnabled)
        {
            Bomber newBomber = ObjectSpawner.SpawnBomberRandomlyOnSpawnWheel(SpawnPointWheel);
            SimulationInstance.enemyObjects.Add(newBomber);
            newBomber.SetupPlayerTransform(SimulationInstance.Player.transform);
            newBomber.SetupPlayersOrbitationWheel(SimulationInstance.Player.OrbitationWheel);
            newBomber.LaunchStartupKick(SpawnPointWheel.GetKickTagetPositionForJustSpawnedMeteor());
            newBomber.ToggleToMoveTowardsPlayer();

            TimeingManager.SchoudleDelayedFunctionTrigger(BomberSpawnDelayDuration, SpawnBomber);
        }
    }
コード例 #16
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ///                                             PUBLIC FUNCTIONS											     ///
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /**
     * @public Call on GUI to update the custom inspector. Also, calls parent version for common functionality
     **/
    public override void OnInspectorGUI()
    {
        GUI.changed = false;
        Bomber _weapon = target as Bomber;

        base.OnInspectorGUI();

        _weapon.projectile = (GameObject)EditorGUILayout.ObjectField("Projectile", _weapon.projectile, typeof(GameObject), true);

        // If changed then you need to set dirty
        if (GUI.changed)
        {
            EditorUtility.SetDirty(_weapon);
        }
    }
コード例 #17
0
    void FixedUpdate()
    {
        timer            -= Time.deltaTime;
        CrossAir.position = new Vector3(transform.position.x + (Input.GetAxis("Turret" + PlID)) * 2, transform.position.y - (Input.GetAxis("Turret" + PlID + "-2")) * 2);
        if (Input.GetButton("Shoot" + PlID))
        {
            Shoot();
        }

        float angle = 0;

        Vector3 relative = Bomber.InverseTransformPoint(CrossAir.position);

        angle = Mathf.Atan2(relative.x, relative.y) * Mathf.Rad2Deg;
        Bomber.Rotate(0, 0, -angle);
    }
コード例 #18
0
ファイル: LevelData.cs プロジェクト: Lswbanban/Ardulem
        public void SaveToClipboard(int minX)
        {
            // adjust startX and HomeX, without going outside of the screen
            int shiftedStartX = StartX - minX;

            if (shiftedStartX < 0)
            {
                shiftedStartX = 0;
            }

            int shiftedHomeX = HomeX - minX;

            if (shiftedHomeX < 0)
            {
                shiftedHomeX = 0;
            }

            // start the string with the declaration of the map
            string text = "\t{ // -------- LEVEL -----------" + GetEOL();

            text += "\t\t" + shiftedStartX.ToString() + ", //StartX" + GetEOL();
            text += "\t\t" + StartY.ToString() + ", //StartY" + GetEOL();
            text += "\t\t" + shiftedHomeX.ToString() + ", //HomeX" + GetEOL();
            text += "\t\t" + HomeY.ToString() + ", //HomeY" + GetEOL();
            text += "\t\t" + m_TotalTimeIn10thSec.ToString() + ", //Time In Multiple Of 10 seconds" + GetEOL();
            text += "\t\t" + m_SpawnLemCount.ToString() + ", //Available Lem Count in multiple of 5 (from 0 to 15 max!!)" + GetEOL();
            text += "\t\t" + m_RequiredLemCount.ToString() + ", //RequiredLemCount in multiple of 5 (obviously less or equals than the previous number)" + GetEOL();
            text += "\t\t" + MinDropSpeed.ToString() + ", //Min Drop Speed in rough seconds (more precisely in multiple of 27 frames) (from 0 to 15) (high value = slow)" + GetEOL();
            text += "\t\t" + Walker.ToString() + ", //Nb of available Walker" + GetEOL();
            text += "\t\t" + Blocker.ToString() + ", //Nb of available Blocker" + GetEOL();
            text += "\t\t" + Bomber.ToString() + ", //Nb of available Bomber" + GetEOL();
            text += "\t\t" + DiagDigger.ToString() + ", //Nb of available Diagonal Digger" + GetEOL();
            text += "\t\t" + HorizDigger.ToString() + ", //Nb of available Horizontal Digger" + GetEOL();
            text += "\t\t" + VertDigger.ToString() + ", //Nb of available Vertical Digger" + GetEOL();
            text += "\t\t" + Stairer.ToString() + ", //Nb of available Stair Builder" + GetEOL();
            text += "\t\t" + Climber.ToString() + ", //Nb of available Climber" + GetEOL();
            text += "\t\t" + Parachuter.ToString() + ", //Nb of available Parachuter" + GetEOL();
            text += "\t\t(const unsigned char *)" + m_LocaMapName + ", //SpriteLocalization" + GetEOL();
            text += "\t\tsizeof(" + m_LocaMapName + "), //size of the Map in number of sprite columns" + GetEOL();
            text += "\t\t(const unsigned int *)" + m_MapIdsName + " //SpriteIdList" + GetEOL();
            text += "\t}," + GetEOL();

            // copy the text to the clipboard
            Clipboard.SetText(text);
        }
コード例 #19
0
ファイル: FormDisplay.cs プロジェクト: ssozinov/bomberSoz
 public FormDisplay(FormMap map, Form mainForm, Graphics gfx, BufferedGraphics myBufer, Bomber bomber, SoundPlayer mainSound)
 {
     this._map          = map;
     this._mainForm     = mainForm;
     this.gfx           = gfx;
     _bomberImage       = new BomberImage();
     _backgroundImage   = new BackgroundImage();
     _wallImage         = new WallImage();
     _notRushImage      = new NotRushWall();
     _bombImage         = new BombImage();
     _monsterImage      = new MonsterImage();
     _remoteBombUpgrade = new RemotBombUpgradeImage();
     _multiBombUpgrade  = new MultibombUpgradeImage();
     _moreFlameUpgrade  = new MoreFlameUpgradeImage();
     _flameImage        = new Flame_Image();
     _myBufer           = myBufer;
     _bomber            = bomber;
     _mainSound         = mainSound;
 }
コード例 #20
0
ファイル: AddItems.cs プロジェクト: ModernHephaestus/MHDB
        internal static void AddFWA(object Item, string SType)
        {
            using (var db = new DatabaseContext())
            {
                switch (SType)
                {
                case "Bomber":
                    Bomber tempB = new Bomber();
                    foreach (PropertyInfo x in Item.GetType().GetProperties())
                    {
                        x.SetValue(tempB, x.GetValue(Item));
                    }
                    db.FixedWingAircraft.Add(tempB);
                    break;

                case "CommandAndControl":
                    CommandAndControl tempCAC = new CommandAndControl();
                    foreach (PropertyInfo x in Item.GetType().GetProperties())
                    {
                        x.SetValue(tempCAC, x.GetValue(Item));
                    }
                    db.FixedWingAircraft.Add(tempCAC);
                    break;

                case "Fighter":
                    Fighter tempF = new Fighter();
                    foreach (PropertyInfo x in Item.GetType().GetProperties())
                    {
                        x.SetValue(tempF, x.GetValue(Item));
                    }
                    db.FixedWingAircraft.Add(tempF);
                    break;

                case "GroundAttack":
                    GroundAttack tempGA = new GroundAttack();
                    foreach (PropertyInfo x in Item.GetType().GetProperties())
                    {
                        x.SetValue(tempGA, x.GetValue(Item));
                    }
                    db.FixedWingAircraft.Add(tempGA);
                    break;

                case "Gunship":
                    Gunship tempG = new Gunship();
                    foreach (PropertyInfo x in Item.GetType().GetProperties())
                    {
                        x.SetValue(tempG, x.GetValue(Item));
                    }
                    db.FixedWingAircraft.Add(tempG);
                    break;

                case "Transport":
                    Transport tempT = new Transport();
                    foreach (PropertyInfo x in Item.GetType().GetProperties())
                    {
                        x.SetValue(tempT, x.GetValue(Item));
                    }
                    db.FixedWingAircraft.Add(tempT);
                    break;

                case "UAV":
                    Transport tempU = new Transport();
                    foreach (PropertyInfo x in Item.GetType().GetProperties())
                    {
                        x.SetValue(tempU, x.GetValue(Item));
                    }
                    db.FixedWingAircraft.Add(tempU);
                    break;
                }
                db.SaveChanges();
            }
        }
コード例 #21
0
 void Awake()
 {
     instance = this;
     bombT    = GetComponent <Text>();
     ChangeValue();
 }
コード例 #22
0
        public bool CheckPosition(PointInMap point, Monster monster, Bomber bomber)
        {
            bool isNotOutRange = ((point.X < 0) || (point.X >= _map.Height) || (point.Y < 0) || (point.Y >= _map.Width));

            if ((!CheckPosition(point, monster)) && (!isNotOutRange))
            {
                if (_map.ArrayMap[point.X, point.Y] is Bomber)
                {
                    // _display.DrawMap();
                    bomber.IsDead = true;
                    return(true);
                }
                if (_map.ArrayMap[point.X, point.Y] is Bomb)
                {
                    return(false);
                }
                if ((_map.ArrayMap[point.X, point.Y] is Bomb) && (monster.TypeMonsters == 3))
                {
                    switch (monster.Direction)
                    {
                    case 1:
                        nextPoint.X = monster.Position.X - 2;
                        nextPoint.Y = monster.Position.Y;
                        return(CheckPosition(nextPoint, monster));

                    case 2:
                        nextPoint.X = monster.Position.X + 2;
                        nextPoint.Y = monster.Position.Y;
                        return(CheckPosition(nextPoint, monster));

                    case 3:
                        nextPoint.X = monster.Position.X;
                        nextPoint.Y = monster.Position.Y - 2;
                        return(CheckPosition(nextPoint, monster));

                    case 4:
                        nextPoint.X = monster.Position.X;
                        nextPoint.Y = monster.Position.Y + 2;
                        return(CheckPosition(nextPoint, monster));
                    }
                }
                if ((_map.ArrayMap[point.X, point.Y] is MonsterNotFly) || (_map.ArrayMap[point.X, point.Y] is MonsterFly))
                {
                    switch (monster.Direction)
                    {
                    case 1:
                        nextPoint.X = monster.Position.X - 2;
                        nextPoint.Y = monster.Position.Y;
                        return(CheckPosition(nextPoint, monster));

                    case 2:
                        nextPoint.X = monster.Position.X + 2;
                        nextPoint.Y = monster.Position.Y;
                        return(CheckPosition(nextPoint, monster));

                    case 3:
                        nextPoint.X = monster.Position.X;
                        nextPoint.Y = monster.Position.Y - 2;
                        return(CheckPosition(nextPoint, monster));

                    case 4:
                        nextPoint.X = monster.Position.X;
                        nextPoint.Y = monster.Position.Y + 2;
                        return(CheckPosition(nextPoint, monster));
                    }
                }
                return(false);
            }
            else
            {
                if (!isNotOutRange)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
コード例 #23
0
        public Ship SpawnShip(ShipType type, Vector2 position, Ship owner = null)
        {
            Ship newShip = null;

            switch (type)
            {
            case ShipType.Miner:
            {
                newShip = new Miner(owner, position);
            }
            break;

            case ShipType.Fighter:
            {
                newShip = new Fighter(owner, position);
            }
            break;

            case ShipType.Bomber:
            {
                newShip = new Bomber(owner, position);
            }
            break;

            case ShipType.RepairShip:
            {
                newShip = new RepairShip(owner, position);
            }
            break;

            case ShipType.MissileFrigate:
            {
                newShip = new MissileFrigate(owner, position);
            }
            break;

            case ShipType.BeamFrigate:
            {
                newShip = new BeamFrigate(owner, position);
            }
            break;

            case ShipType.SupportCruiser:
            {
                newShip = new SupportCruiser(owner, position);
            }
            break;

            case ShipType.HeavyCruiser:
            {
                newShip = new HeavyCruiser(owner, position);
            }
            break;

            case ShipType.Battleship:
            {
                newShip = new Battleship(owner, position);
            }
            break;

            case ShipType.Carrier:
            {
                newShip = new Carrier(owner, position);
            }
            break;
            }

            if (newShip == null)
            {
                return(newShip);
            }

            if (newShip.IsPlayerShip)
            {
                GameplayState.WorldManager.PlayerShips.Add(newShip);
            }
            else
            {
                GameplayState.WorldManager.EnemyShips.Add(newShip);
            }

            GameplayState.WorldManager.Ships.Add(newShip);

            if (newShip is Miner)
            {
                GameplayState.WorldManager.Miners.Add(newShip);
            }

            return(newShip);
        } // SpawnShip
コード例 #24
0
        protected override void Moving()
        {
            if (!this.godmode && this.Hp <= this.HpMax / 2)
            {
                this.GodMode();
            }
            else
            {
                this.neutlal = this.Motion == NaviBase.MOTION.neutral;
                switch (this.Motion)
                {
                case NaviBase.MOTION.neutral:
                    if (this.moveflame)
                    {
                        this.animationpoint = this.AnimeNeutral(this.waittime % 3);
                        ++this.waittime;
                    }
                    if (this.moveflame && (this.waittime >= 8 / (version == 0 ? 5 : version) || this.atack))
                    {
                        this.waittime = 0;
                        ++this.roopneutral;
                        if (this.roopneutral >= 1 && this.parent.nowscene != SceneBattle.BATTLESCENE.end)
                        {
                            this.roopneutral = 0;
                            if (this.roopmove > this.moveroop && !this.badstatus[4])
                            {
                                this.roopmove = this.version > 3 ? this.Random.Next(-1, this.moveroop + 1) : 0;
                                ++this.atackroop;
                                if (!this.atack)
                                {
                                    if (this.hp <= this.hpmax / 2)
                                    {
                                        this.attack    = (Mima.ATTACK) this.pattern2[this.action];
                                        this.powerPlus = this.powers[this.pattern2[this.action]];
                                    }
                                    else
                                    {
                                        this.attack    = (Mima.ATTACK) this.pattern[this.action];
                                        this.powerPlus = this.powers[this.pattern[this.action]];
                                    }
                                    ++this.action;
                                    if (this.action >= this.pattern.Length)
                                    {
                                        this.action = 0;
                                    }
                                    switch (this.attack)
                                    {
                                    case Mima.ATTACK.IllProminence:
                                        this.counterTiming = true;
                                        this.sound.PlaySE(SoundEffect.pikin);
                                        this.speed        = 4;
                                        this.targetPanels = ((IEnumerable <Point>) this.RandomMultiPanel(4, this.UnionEnemy)).ToList <Point>();
                                        for (int index = 0; index < this.targetPanels.Count; ++index)
                                        {
                                            List <AttackBase> attacks = this.parent.attacks;
                                            IAudioEngine      sound   = this.sound;
                                            SceneBattle       parent  = this.parent;
                                            Point             point   = this.targetPanels[index];
                                            int x = point.X;
                                            point = this.targetPanels[index];
                                            int y     = point.Y;
                                            int union = (int)this.union;
                                            point = new Point();
                                            Point hitrange = point;
                                            Dummy dummy    = new Dummy(sound, parent, x, y, (Panel.COLOR)union, hitrange, 25, true);
                                            attacks.Add(dummy);
                                        }
                                        break;

                                    case Mima.ATTACK.DarkWave:
                                        this.sound.PlaySE(SoundEffect.sand);
                                        this.speed = 3;
                                        break;

                                    case Mima.ATTACK.GrandSpear:
                                        this.sound.PlaySE(SoundEffect.quake);
                                        this.ShakeStart(1, 30);
                                        this.speed = 4;
                                        break;

                                    case Mima.ATTACK.SoulFlame:
                                        this.speed = 3;
                                        break;

                                    case Mima.ATTACK.CrescentCharge:
                                        this.speed = 3;
                                        this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.union == Panel.COLOR.blue ? 5 : 0, 1, this.union, new Point(6, 0), 30, true));
                                        break;

                                    case Mima.ATTACK.Reincarnation:
                                        this.sound.PlaySE(SoundEffect.charge);
                                        this.speed = 3;
                                        break;
                                    }
                                    this.attackProcess = 0;
                                }
                                this.waittime = 0;
                                this.Motion   = NaviBase.MOTION.attack;
                            }
                            else
                            {
                                this.speed    = 4;
                                this.waittime = 0;
                                if (this.atack)
                                {
                                    this.roopmove = this.moveroop + 1;
                                }
                                this.Motion = NaviBase.MOTION.move;
                            }
                        }
                        break;
                    }
                    break;

                case NaviBase.MOTION.attack:
                    if (this.moveflame)
                    {
                        ++this.waittime;
                        if (this.moveflame)
                        {
                            switch (this.attack)
                            {
                            case Mima.ATTACK.IllProminence:
                                if (this.attackProcess == 0)
                                {
                                    this.animationpoint = this.AnimeIllProminence1(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 2:
                                        this.counterTiming = false;
                                        ++this.attackProcess;
                                        this.waittime = 0;
                                        break;
                                    }
                                }
                                else
                                {
                                    this.animationpoint = this.AnimeIllProminence2(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 3:
                                        this.sound.PlaySE(SoundEffect.bombmiddle);
                                        Point point;
                                        for (int index = 0; index < this.targetPanels.Count; ++index)
                                        {
                                            this.ShakeStart(2, 8);
                                            List <AttackBase> attacks = this.parent.attacks;
                                            IAudioEngine      sound1  = this.sound;
                                            SceneBattle       parent1 = this.parent;
                                            point = this.targetPanels[index];
                                            int x1 = point.X;
                                            point = this.targetPanels[index];
                                            int        y1         = point.Y;
                                            int        union      = (int)this.union;
                                            int        power      = this.Power;
                                            BombAttack bombAttack = new BombAttack(sound1, parent1, x1, y1, (Panel.COLOR)union, power, 1, ChipBase.ELEMENT.poison);
                                            attacks.Add(bombAttack);
                                            List <EffectBase> effects = this.parent.effects;
                                            IAudioEngine      sound2  = this.sound;
                                            SceneBattle       parent2 = this.parent;
                                            point = this.targetPanels[index];
                                            int x2 = point.X;
                                            point = this.targetPanels[index];
                                            int    y2     = point.Y;
                                            Bomber bomber = new Bomber(sound2, parent2, x2, y2, Bomber.BOMBERTYPE.poison, 3);
                                            effects.Add(bomber);
                                        }
                                        if (this.attackProcess < 2)
                                        {
                                            this.targetPanels = ((IEnumerable <Point>) this.RandomMultiPanel(4, this.UnionEnemy)).ToList <Point>();
                                            for (int index = 0; index < this.targetPanels.Count; ++index)
                                            {
                                                List <AttackBase> attacks = this.parent.attacks;
                                                IAudioEngine      sound   = this.sound;
                                                SceneBattle       parent  = this.parent;
                                                point = this.targetPanels[index];
                                                int x = point.X;
                                                point = this.targetPanels[index];
                                                int y     = point.Y;
                                                int union = (int)this.union;
                                                point = new Point();
                                                Point hitrange = point;
                                                Dummy dummy    = new Dummy(sound, parent, x, y, (Panel.COLOR)union, hitrange, 25, true);
                                                attacks.Add(dummy);
                                            }
                                            break;
                                        }
                                        break;

                                    case 8:
                                        if (this.attackProcess >= 2)
                                        {
                                            this.waittime = 0;
                                            this.motion   = NaviBase.MOTION.move;
                                            break;
                                        }
                                        ++this.attackProcess;
                                        this.waittime = 0;
                                        break;
                                    }
                                }
                                break;

                            case Mima.ATTACK.DarkWave:
                                switch (this.attackProcess)
                                {
                                case 0:
                                    this.animationpoint = this.AnimeDarkWave1(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 1:
                                        this.effecting     = true;
                                        this.positionre    = this.RandomTarget(this.union);
                                        this.positionre.X -= this.UnionRebirth(this.union);
                                        if (!this.NoObject(this.positionre, this.number))
                                        {
                                            this.nohit       = false;
                                            this.Motion      = NaviBase.MOTION.move;
                                            this.frame       = 0;
                                            this.waittime    = 0;
                                            this.roopneutral = 0;
                                            ++this.roopmove;
                                            break;
                                        }
                                        break;

                                    case 6:
                                        this.counterTiming = true;
                                        this.position      = this.positionre;
                                        this.PositionDirectSet();
                                        break;

                                    case 9:
                                        ++this.attackProcess;
                                        this.waittime = 0;
                                        break;
                                    }
                                    break;

                                case 1:
                                    this.animationpoint = this.AnimeDarkWave2(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 3:
                                        this.counterTiming = false;
                                        this.sound.PlaySE(SoundEffect.wave);
                                        this.parent.effects.Add(new MimaWaveLong(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, 3));
                                        AttackBase attackBase1 = new LanceAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 2, ChipBase.ELEMENT.aqua, false);
                                        attackBase1.invincibility = false;
                                        this.parent.attacks.Add(attackBase1);
                                        break;

                                    case 7:
                                        ++this.attackProcess;
                                        this.waittime = 0;
                                        break;
                                    }
                                    break;

                                case 2:
                                    this.animationpoint = this.AnimeDarkWave3(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 3:
                                        this.sound.PlaySE(SoundEffect.wave);
                                        this.parent.effects.Add(new MimaWaveDream(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, 3));
                                        AttackBase attackBase2 = new Halberd(this.sound, this.parent, this.position.X, this.position.Y, this.union, this.Power, 2, ChipBase.ELEMENT.aqua, true);
                                        attackBase2.invincibility = false;
                                        this.parent.attacks.Add(attackBase2);
                                        break;

                                    case 6:
                                        this.waittime  = 0;
                                        this.effecting = false;
                                        this.motion    = NaviBase.MOTION.move;
                                        break;
                                    }
                                    break;
                                }
                                break;

                            case Mima.ATTACK.GrandSpear:
                                switch (this.attackProcess)
                                {
                                case 0:
                                    this.animationpoint = this.AnimeMove(this.waittime);
                                    if (this.moveflame)
                                    {
                                        switch (this.waittime)
                                        {
                                        case 1:
                                            this.MoveRandom(true, false);
                                            break;

                                        case 5:
                                            this.counterTiming = true;
                                            this.position      = this.positionre;
                                            this.PositionDirectSet();
                                            break;

                                        case 10:
                                            this.nohit = false;
                                            ++this.attackProcess;
                                            this.waittime = 0;
                                            break;
                                        }
                                        break;
                                    }
                                    break;

                                case 1:
                                    this.animationpoint = this.AnimeGrandSpear(this.waittime);
                                    if (this.moveflame)
                                    {
                                        switch (this.waittime)
                                        {
                                        case 2:
                                            this.counterTiming = false;
                                            this.parent.attacks.Add(new MimaRockTower(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, MimaRockTower.MOTION.init));
                                            break;

                                        case 4:
                                            this.parent.attacks.Add(new MimaRockTower(this.sound, this.parent, this.position.X + 2 * this.UnionRebirth(this.union), this.position.Y - 1, this.union, this.Power, MimaRockTower.MOTION.init));
                                            this.parent.attacks.Add(new MimaRockTower(this.sound, this.parent, this.position.X + 2 * this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, MimaRockTower.MOTION.init));
                                            this.parent.attacks.Add(new MimaRockTower(this.sound, this.parent, this.position.X + 2 * this.UnionRebirth(this.union), this.position.Y + 1, this.union, this.Power, MimaRockTower.MOTION.init));
                                            break;

                                        case 6:
                                            this.parent.attacks.Add(new MimaRockTower(this.sound, this.parent, this.position.X + 3 * this.UnionRebirth(this.union), this.position.Y - 1, this.union, this.Power, MimaRockTower.MOTION.init));
                                            this.parent.attacks.Add(new MimaRockTower(this.sound, this.parent, this.position.X + 3 * this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, MimaRockTower.MOTION.init));
                                            this.parent.attacks.Add(new MimaRockTower(this.sound, this.parent, this.position.X + 3 * this.UnionRebirth(this.union), this.position.Y + 1, this.union, this.Power, MimaRockTower.MOTION.init));
                                            this.waittime = 0;
                                            this.motion   = NaviBase.MOTION.move;
                                            break;
                                        }
                                        break;
                                    }
                                    break;
                                }
                                break;

                            case Mima.ATTACK.SoulFlame:
                                if (this.position.X != 1)
                                {
                                    this.sound.PlaySE(SoundEffect.dark);
                                    this.parent.attacks.Add(new MimaFrame(this.sound, this.parent, this.position.X, this.position.Y, this.union, this.Power, 2, new Vector2(this.positionDirect.X, this.positionDirect.Y + 16f), ChipBase.ELEMENT.heat, 2));
                                }
                                this.waittime = 0;
                                this.motion   = NaviBase.MOTION.move;
                                break;

                            case Mima.ATTACK.CrescentCharge:
                                if (this.moveflame)
                                {
                                    switch (this.attackProcess)
                                    {
                                    case 0:
                                        if (this.waittime < 5)
                                        {
                                            this.animationpoint = this.AnimeMove(this.waittime);
                                        }
                                        else
                                        {
                                            this.animationpoint.X = -1;
                                        }
                                        this.nohit = true;
                                        switch (this.waittime)
                                        {
                                        case 10:
                                            this.sound.PlaySE(SoundEffect.shoot);
                                            this.mimacharge = new MimaCharge(this.sound, this.parent, this.union == Panel.COLOR.blue ? 5 : 0, 1, this.union, this.Power, 1, this.positionDirect, this.element, 8);
                                            this.parent.attacks.Add(mimacharge);
                                            this.waittime = 0;
                                            ++this.attackProcess;
                                            break;
                                        }
                                        break;

                                    case 1:
                                        this.animationpoint.X = -1;
                                        if (!this.mimacharge.flag)
                                        {
                                            this.waittime = 0;
                                            ++this.attackProcess;
                                            break;
                                        }
                                        break;

                                    case 2:
                                        this.animationpoint = this.AnimeMove(this.waittime + 5);
                                        switch (this.waittime)
                                        {
                                        case 5:
                                            this.nohit            = false;
                                            this.waittime         = 0;
                                            this.motion           = NaviBase.MOTION.neutral;
                                            this.animationpoint.X = 0;
                                            break;
                                        }
                                        break;
                                    }
                                    break;
                                }
                                break;

                            case Mima.ATTACK.Reincarnation:
                                if (this.attackProcess == 1)
                                {
                                    this.counterTiming = true;
                                }
                                switch (this.attackProcess)
                                {
                                case 0:
                                case 1:
                                case 2:
                                    this.animationpoint = this.AnimeReincarnation(this.waittime);
                                    if (this.waittime >= 6)
                                    {
                                        ++this.attackProcess;
                                        this.waittime = 0;
                                        break;
                                    }
                                    break;

                                case 3:
                                    this.counterTiming = false;
                                    this.MoveRandom(true, false);
                                    this.sound.PlaySE(SoundEffect.dark);
                                    this.parent.objects.Add(new MimaNavi(this.sound, this.parent, this.positionre.X, this.positionre.Y, this.union));
                                    this.waittime = 0;
                                    this.roopmove = -4;
                                    this.motion   = NaviBase.MOTION.move;
                                    break;
                                }
                                break;
                            }
                        }
                        break;
                    }
                    break;

                case NaviBase.MOTION.move:
                    this.animationpoint = this.AnimeMove(this.waittime);
                    if (this.moveflame)
                    {
                        switch (this.waittime)
                        {
                        case 0:
                            this.MoveRandom(false, false);
                            if (this.position == this.positionre)
                            {
                                this.nohit       = false;
                                this.Motion      = NaviBase.MOTION.neutral;
                                this.frame       = 0;
                                this.roopneutral = 0;
                                ++this.roopmove;
                                break;
                            }
                            break;

                        case 3:
                            this.nohit = true;
                            break;

                        case 5:
                            this.position = this.positionre;
                            this.PositionDirectSet();
                            break;

                        case 8:
                            this.nohit = false;
                            break;

                        case 10:
                            this.nohit       = false;
                            this.Motion      = NaviBase.MOTION.neutral;
                            this.speed       = this.nspeed;
                            this.frame       = 0;
                            this.roopneutral = 0;
                            ++this.roopmove;
                            break;
                        }
                        ++this.waittime;
                        break;
                    }
                    break;

                case NaviBase.MOTION.knockback:
                    switch (this.waittime)
                    {
                    case 2:
                        this.NockMotion();
                        this.nohit         = false;
                        this.counterTiming = false;
                        this.effecting     = false;
                        this.PositionDirectSet();
                        break;

                    case 3:
                        this.NockMotion();
                        break;

                    case 15:
                        this.animationpoint = new Point(0, 2);
                        this.PositionDirectSet();
                        break;

                    case 21:
                        this.animationpoint = new Point(0, 0);
                        this.waittime       = 0;
                        this.Motion         = NaviBase.MOTION.neutral;
                        break;
                    }
                    if (this.waittime >= 2 && this.waittime <= 6)
                    {
                        this.positionDirect.X -= this.UnionRebirth(this.union);
                    }
                    ++this.waittime;
                    break;
                }
                if (this.effecting && !this.nohit)
                {
                    this.AttackMake(this.Power, 0, 0);
                }
                this.FlameControl();
                this.MoveAftar();
            }
        }
コード例 #25
0
    public Bomber SpawnBomber(Vector2 _spawnPosition)
    {
        Bomber _spawnedBobmer = SpawnPollableObject(PrefabCollection.Bomber, _spawnPosition) as Bomber;

        return(_spawnedBobmer);
    }
コード例 #26
0
    public Bomber SpawnBomberRandomlyOnSpawnWheel(SpawnPointWheel _spawnPointWheel)
    {
        Bomber newSpawnedBomber = SpawnPollableObject(PrefabCollection.Bomber, _spawnPointWheel) as Bomber;

        return(newSpawnedBomber);
    }
コード例 #27
0
        void DestroyAnimation()
        {
            CheckForIllegalCrossThreadCalls = false;

            txtoutput.ForeColor = Color.Yellow;
            txtoutput.Text      = "\r\nUnidentified Aircraft Detected\r\nFighter In Persuit";

            int[] xb = { 80, 90, 99, 108, 116, 125, 133, 141, 151, 160, 169, 179, 180 };
            int[] yb = { 0, -2, -5, -9, -15, -18, -23, -29, -28, -25, -21, -20, -17 };

            double cosx, sinx;

            double[] dist = new double[13];

            double[] xf = new double[13];
            double[] yf = new double[13];

            xf[0] = 0.0;
            yf[0] = 50.0;

            dist[0] = Math.Sqrt((xf[0] - xb[0]) * (xf[0] - xb[0]) + (yf[0] - yb[0]) * (yf[0] - yb[0]));

            for (int t = 0; t <= 11; t++)
            {
                cosx        = (xb[t] - xf[t]) / dist[t];
                sinx        = (yb[t] - yf[t]) / dist[t];
                xf[t + 1]   = xf[t] + vf * cosx;
                yf[t + 1]   = yf[t] + vf * sinx;
                dist[t + 1] = Math.Sqrt((xf[t + 1] - xb[t + 1]) * (xf[t + 1] - xb[t + 1]) + (yf[t + 1] - yb[t + 1]) * (yf[t + 1] - yb[t + 1]));

                if (dist[t + 1] <= 10)
                {
                    Time     = t + 1;
                    Distance = (double)dist[t + 1];

                    //Battle Animation
                    Bomber.Image  = PersuitSimulator.Properties.Resources.Bomber;
                    Fighter.Image = PersuitSimulator.Properties.Resources.Fighter;

                    for (int i = 0; i < 13; i++)
                    {
                        int x = (int)xf[i];
                        int y = (int)yf[i];

                        if (x != 0 && y != 0)
                        {
                            Fighter.Location = new Point(x + 40, y + 100);
                            Fighter.Visible  = true;
                            Fighter.Refresh();
                        }
                        for (int j = 0; j < 10000000; j++)
                        {
                        }

                        Bomber.Location = new Point(xb[i] + 130, yb[i] + 100);
                        Bomber.Visible  = true;
                        Bomber.Refresh();

                        if (i == 12)
                        {
                            //Rocket Animation
                            int rocketinitx = Fighter.Location.X + 60;
                            int rocketinity = Fighter.Location.Y + 20;
                            int space       = Bomber.Location.X - rocketinitx - 33;

                            Rocket.Visible = true;

                            for (int move = 0; move <= space; move++)
                            {
                                for (int n2 = 0; n2 < 5000000; n2++)
                                {
                                }
                                Rocket.Location = new Point(rocketinitx + move, rocketinity);
                                Rocket.Refresh();
                            }

                            Rocket.Visible = false;


                            Bomber.Image = PersuitSimulator.Properties.Resources.AirplaneEscaped;

                            for (int n5 = 0; n5 < 80; n5++)
                            {
                                //Bomber Falling
                                int x2 = Bomber.Location.X;
                                int y2 = Bomber.Location.Y;
                                for (int n2 = 0; n2 < 5000000; n2++)
                                {
                                }

                                int y3 = y2 + n5;
                                if (y3 <= 160)
                                {
                                    Bomber.Location = new Point(x2, y3);
                                    Bomber.Refresh();
                                }
                                else
                                {
                                    Bomber.Visible = false;
                                }

                                txtoutput.ForeColor = System.Drawing.Color.Lime;
                                txtoutput.Text      = "\r\nThe Target Has Been Destroyed .\r\nTime = " + Time + " min, Distance = " + Distance + " km .";


                                //Fighter Continue With Bomber Falling
                                int x1 = Fighter.Location.X;
                                int y1 = Fighter.Location.Y;
                                for (int j = 0; j < 5000000; j++)
                                {
                                }
                                Fighter.Location = new Point(x1 + 3, y1);
                                Fighter.Refresh();
                            }
                        }
                    }
                    Fighter.Visible = false;
                    Bomber.Visible  = false;

                    //To Stop checking if (dist[t + 1] <= 10) at first occurance
                    break;
                }
            }
        }
コード例 #28
0
 public static void OnSpawn(Bomber bomber)
 {
     bomber.Go(mainTower.transform);
 }
コード例 #29
0
        private static IUnit CreateUnit(UnitType type, int x, int y)
        {
            IUnit unit;

            switch (type)
            {
            case UnitType.Settlers: unit = new Settlers(); break;

            case UnitType.Militia: unit = new Militia(); break;

            case UnitType.Phalanx: unit = new Phalanx(); break;

            case UnitType.Legion: unit = new Legion(); break;

            case UnitType.Musketeers: unit = new Musketeers(); break;

            case UnitType.Riflemen: unit = new Riflemen(); break;

            case UnitType.Cavalry: unit = new Cavalry(); break;

            case UnitType.Knights: unit = new Knights(); break;

            case UnitType.Catapult: unit = new Catapult(); break;

            case UnitType.Cannon: unit = new Cannon(); break;

            case UnitType.Chariot: unit = new Chariot(); break;

            case UnitType.Armor: unit = new Armor(); break;

            case UnitType.MechInf: unit = new MechInf(); break;

            case UnitType.Artillery: unit = new Artillery(); break;

            case UnitType.Fighter: unit = new Fighter(); break;

            case UnitType.Bomber: unit = new Bomber(); break;

            case UnitType.Trireme: unit = new Trireme(); break;

            case UnitType.Sail: unit = new Sail(); break;

            case UnitType.Frigate: unit = new Frigate(); break;

            case UnitType.Ironclad: unit = new Ironclad(); break;

            case UnitType.Cruiser: unit = new Cruiser(); break;

            case UnitType.Battleship: unit = new Battleship(); break;

            case UnitType.Submarine: unit = new Submarine(); break;

            case UnitType.Carrier: unit = new Carrier(); break;

            case UnitType.Transport: unit = new Transport(); break;

            case UnitType.Nuclear: unit = new Nuclear(); break;

            case UnitType.Diplomat: unit = new Diplomat(); break;

            case UnitType.Caravan: unit = new Caravan(); break;

            default: return(null);
            }
            unit.X         = x;
            unit.Y         = y;
            unit.MovesLeft = unit.Move;
            return(unit);
        }
コード例 #30
0
 public Bomber(Bomber from) : base(from)
 {
 }
コード例 #31
0
 void Start()
 {
     PlID   = GetComponent <CarController>().PlID;
     ArmaID = GetComponent <CarController>().Arma;
     Source = Bomber.GetComponent <AudioSource>();
 }