コード例 #1
0
 //--------------------------------------------------------------------------
 // ● 名称的描绘
 //     actor : 角色
 //     x     : 描画目标 X 坐标
 //     y     : 描画目标 Y 坐标
 //--------------------------------------------------------------------------
 public void draw_actor_name(Game_Actor actor, int x, int y)
 {
     this.contents.font.color = normal_color;
     this.contents.draw_text(x, y, 120, 32, actor.name);
 }
コード例 #2
0
 //--------------------------------------------------------------------------
 // ● 职业的描绘
 //     actor : 角色
 //     x     : 描画目标 X 坐标
 //     y     : 描画目标 Y 坐标
 //--------------------------------------------------------------------------
 public void draw_actor_class(Game_Actor actor, int x, int y)
 {
     this.contents.font.color = normal_color;
     this.contents.draw_text(x, y, 236, 32, actor.class_name);
 }
コード例 #3
0
        //--------------------------------------------------------------------------
        // ● 刷新画面 (目标窗口被激活的情况下)
        //--------------------------------------------------------------------------
        public void update_target()
        {
            // 按下 B 键的情况下
            if (Input.is_trigger(Input.B))
            {
                // 演奏取消 SE
                Global.game_system.se_play(Global.data_system.cancel_se);
                // 删除目标窗口
                this.skill_window.active   = true;
                this.target_window.visible = false;
                this.target_window.active  = false;
                return;
            }
            bool used = false;

            // 按下 C 键的情况下
            if (Input.is_trigger(Input.C))
            {
                // 因为 SP 不足而无法使用的情况下
                if (!this.actor.is_skill_can_use(this.skill.id))
                {
                    // 演奏冻结 SE
                    Global.game_system.se_play(Global.data_system.buzzer_se);
                    return;
                }
                // 目标是全体的情况下
                if (this.target_window.index == -1)
                {
                    // 对同伴全体应用特技使用效果
                    used = false;
                    foreach (var i in Global.game_party.actors)
                    {
                        used |= i.skill_effect(this.actor, this.skill);
                    }
                }
                Game_Actor target = null;
                // 目标是使用者的情况下
                if (this.target_window.index <= -2)
                {
                    // 对目标角色应用特技的使用效果
                    target = Global.game_party.actors[this.target_window.index + 10];
                    used   = target.skill_effect(this.actor, this.skill);
                }
                // 目标是单体的情况下
                if (this.target_window.index >= 0)
                {
                    // 对目标角色应用特技的使用效果
                    target = Global.game_party.actors[this.target_window.index];
                    used   = target.skill_effect(this.actor, this.skill);
                }
                // 使用特技的情况下
                if (used)
                {
                    // 演奏特技使用时的 SE
                    Global.game_system.se_play(this.skill.menu_se);
                    // 消耗 SP
                    this.actor.sp -= this.skill.sp_cost;
                    // 再生成各窗口内容
                    this.status_window.refresh();
                    this.skill_window.refresh();
                    this.target_window.refresh();
                    // 全灭的情况下
                    if (Global.game_party.is_all_dead)
                    {
                        // 切换到游戏结束画面
                        Global.scene = new Scene_Gameover();
                        return;
                    }
                    // 公共事件 ID 有效的情况下
                    if (this.skill.common_event_id > 0)
                    {
                        // 预约调用公共事件
                        Global.game_temp.common_event_id = this.skill.common_event_id;
                        // 切换到地图画面
                        Global.scene = new Scene_Map();
                        return;
                    }
                }
                // 无法使用特技的情况下
                if (!used)
                {
                    // 演奏冻结 SE
                    Global.game_system.se_play(Global.data_system.buzzer_se);
                }
                return;
            }
        }