/// <summary>
    /// 攻撃時の効果音
    /// </summary>
    /// <param name="status"></param>
    public void ChangeAttackAudio(Player.Status status)
    {
        switch (status)
        {
        case Player.Status.normal:
            audioSource.clip = vacuum;
            break;

        case Player.Status.cheek:
            audioSource.clip = spitting;
            break;

        case Player.Status.beam:
            audioSource.clip = beam;
            break;

        case Player.Status.fire:
            audioSource.clip = fire;
            break;

        case Player.Status.cutter:
            audioSource.clip = cutter;
            break;

        case Player.Status.sword:
            audioSource.clip = sword;
            break;
        }
        if (audioSource.clip == null)
        {
            return;
        }
        // Audioの再生
        audioSource.Play();
    }
Beispiel #2
0
    public static void Talk(int i)
    {
        if (Player.status != Player.Status.TASK)
        {
            player_last_status = Player.status;
        }
        Player.status = Player.Status.TASK;

        if (i == 0)
        {
            Message.show("인전", "안녕하세요!", "yo.png", Message.Face.LEFT);
            block();
            Message.show("NPC", "게임월드에 오신걸 환영합니다!", "face3_2.png", Message.Face.RIGHT);
            block();
            Message.show("인전", "나의 첫번쨰 임무는 무엇인가요?", "yo.png", Message.Face.LEFT);
            block();
        }
        if (i == 1)
        {
            Message.showtip("남자를 만나다");
            block();
        }
        if (i == 2)
        {
            Map.change_map(Form1.map, Form1.player, Form1.npc, 1, 950, 500, 2, Form1.music_player);
        }
        if (i == 3)
        {
            Map.change_map(Form1.map, Form1.player, Form1.npc, 0, 50, 500, 3, Form1.music_player);
        }
        Player.status = player_last_status;
    }
Beispiel #3
0
 public void show()
 {
     panel          = this;
     current_button = default_button;
     set_button_status(Button.Status.SELECT);
     if (Player.status != Player.Status.PANEL)
     {
         last_player_status = Player.status;
     }
     Player.status = Player.Status.PANEL;
 }
Beispiel #4
0
    public void show()     //激活界面
    {
        panel          = this;
        current_button = default_button;
        set_button_status(Button.Status.SELECT);

        if (Player.status != Player.Status.PANEL)          //保存角色状态,并设置角色当前状态为panel
        {
            last_player_status = Player.status;
        }
        Player.status = Player.Status.PANEL;
    }
Beispiel #5
0
    //任务流程
    public static void story(int npc_id, int type)//type-0-正常 1-回调
    {
        //保存状态
        if (Player.status != Player.Status.TASK && Player.status != Player.Status.FIGHT)
        {
            player_last_status = Player.status;
        }
        Player.status = Player.Status.TASK;
        //事件
        if (task == null)
        {
            return;
        }

        if (type == 1 && id >= 0)
        {
            int ret = task[id].task_event(id, step);
            if (ret == 0)
            {
                task[id].deal_result();
            }
        }
        else if (type == 0)
        {
            for (int i = task.Length - 1; i >= 0; i--)
            {
                if (task[i] == null)
                {
                    continue;
                }
                if (task[i].check_conditions(npc_id) != 0)
                {
                    continue;
                }
                id   = i;
                step = 0;
                int ret = task[i].task_event(i, step);
                if (ret == 0)
                {
                    task[i].deal_result();
                }
                break;
            }
        }


        //恢复状态
        Player.status = player_last_status;
    }
Beispiel #6
0
    //开始战斗
    public static void start(int[] enemy, string bg_path, int isgameover, int winitem1, int winitem2, int winitem3, int losemoney)
    {
        Form1.music_player.URL = "fight/fight.mp3";
        set_pos();
        //敌人
        if (enemy.Length < 3)
        {
            MessageBox.Show("enemy数组长度小与3!");
            return;
        }
        for (int i = 0; i < 3; i++)
        {
            if (enemy[i] >= Enemy.enemy.Length)
            {
                MessageBox.Show("enemy值大于id");
                return;
            }
            if (enemy[i] != -1 && Enemy.enemy[enemy[i]] == null)
            {
                MessageBox.Show("敌人id" + enemy[i].ToString() + "未定义");
                return;
            }
            Fight.enemy[i].id = enemy[i];
            if (Fight.enemy[i].id != -1)
            {
                Fight.enemy[i].hp     = Enemy.enemy[enemy[i]].maxhp;
                Fight.enemy[i].order  = -1 * Enemy.enemy[enemy[i]].fspeed;
                Fight.enemy[i].status = 0;
            }
            else
            {
                Fight.enemy[i].hp     = 0;
                Fight.enemy[i].order  = -1;
                Fight.enemy[i].status = 0;
            }
        }
        //背景图
        if (bg_path != null && bg_path != "")
        {
            Fight.bg = new Bitmap(bg_path);
            Fight.bg.SetResolution(96, 96);
        }
        //胜负
        Fight.isgameover = isgameover;
        Fight.winitem1   = winitem1;
        Fight.winitem2   = winitem2;
        Fight.winitem3   = winitem3;
        Fight.lostmoney  = losemoney;
        //玩家
        int[] player = get_fplayer();
        for (int i = 0; i < 3; i++)
        {
            Fight.player[i].id = player[i];
            if (Fight.player[i].id != -1)
            {
                Fight.player[i].hp     = Form1.player[player[i]].hp;
                Fight.player[i].mp     = Form1.player[player[i]].hp;
                Fight.player[i].order  = -1 * get_property(PLAYER_PTY.SPD, player[i]);
                Fight.player[i].status = 0;
            }
            else
            {
                Fight.player[i].hp     = 0;
                Fight.player[i].mp     = 0;
                Fight.player[i].order  = -1;
                Fight.player[i].status = 0;
            }
        }
        //开始战斗
        if (Player.status != Player.Status.FIGHT)
        {
            player_last_status = Player.Status.FIGHT;
        }
        fighting = 1;

        fight_logic();
    }
Beispiel #7
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            Player.Status status = this.players[this.playerToMove].Step(TimeSpan.FromMilliseconds((double)this.gameTimer.Interval));
            if (status > Player.Status.GoingOver)
            {
                this.gameTimer.Enabled = false;
                string            reason = "";
                frmGameEnd.Remedy none   = frmGameEnd.Remedy.None;
                switch (status)
                {
                case Player.Status.MovesOverInGame:
                    reason = "Total moves over in game exceeded limit.";
                    none   = frmGameEnd.Remedy.Ignore;
                    break;

                case Player.Status.MovesOverInRow:
                    reason = "Moves over in-a-row exceeded limit.";
                    none   = frmGameEnd.Remedy.Ignore;
                    break;

                case Player.Status.GameTimeUsed:
                    reason = "Game time has exceeded limit.";
                    none   = frmGameEnd.Remedy.IncreaseGameTime;
                    break;

                case Player.Status.GameOverTimeUsed:
                    reason = "Total turn over time has exceeded limit.";
                    none   = frmGameEnd.Remedy.IncreaseTotalTurnOverTime;
                    break;

                case Player.Status.TurnOverTimeUsed:
                    reason = "Time gone over this turn exceeded limit.";
                    none   = frmGameEnd.Remedy.MoveThenIgnore;
                    break;
                }
                frmGameEnd end = new frmGameEnd(this.players[this.playerToMove].playerName, reason, none);
                end.ShowDialog();
                if (!end.continueGame)
                {
                    base.Close();
                }
                else
                {
                    switch (none)
                    {
                    case frmGameEnd.Remedy.Ignore:
                        this.gameTimer.Enabled = true;
                        break;

                    case frmGameEnd.Remedy.MoveThenIgnore:
                        this.SwitchPlayerMoving();
                        break;

                    case frmGameEnd.Remedy.IncreaseTotalTurnOverTime:
                        this.players[this.playerToMove].IncreaseTotalTurnOverTime(end.increaseBy);
                        this.gameTimer.Enabled = true;
                        break;

                    case frmGameEnd.Remedy.IncreaseGameTime:
                        this.players[this.playerToMove].IncreaseGameTime(end.increaseBy);
                        this.gameTimer.Enabled = true;
                        break;
                    }
                }
            }
            stopwatch.Stop();
        }