| 
 
| 赞 | 1 |  
| VIP | 392 |  
| 好人卡 | 225 |  
| 积分 | 48 |  
| 经验 | 177731 |  
| 最后登录 | 2020-12-8 |  
| 在线时间 | 2037 小时 |  
 Lv3.寻梦者 虚空人形 
	梦石0 星屑4763 在线时间2037 小时注册时间2011-8-11帖子3398 
 | 
| 
本帖最后由 hcm 于 2013-12-2 13:20 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 以下的任务系统和加点系统在开启界面后地图会极限暗化(淡出),请问如何去除这一效果。
 希望透过半透明的窗口可以正常看到地图,像商店界面等那样。。
 
 任务系统:
 加点系统:复制代码=begin
领取任务:$game_party.get_task(任意数字,任务名称,任务描述)
完成任务:$game_party.finish_task(领取任务时设定的数字)
对已有任务追加说明:$game_party.add_task(任务编号,任务追加描述)
如:
前面有事件$game_party.get_task(1,"测试","只是测试")
此时任务1的说明为
>只是测试
后面完成任务的脚本就是$game_party.finish_task(1)
追加说明$game_party.add_task(1,"真的只是测试哦")
此时任务1的说明为:
>只是测试
>真的只是测试哦
召唤任务界面:SceneManager.call(Scene_Task)
该脚本来自66rpg,发布者:韩云溪
改进:工藤由纪(论坛ID:zyyczp)
=end
#===========================================================
#●任务系统
#===========================================================
class Task
  attr_reader :desc
  attr_reader :finished
  def initialize(origin_name,desc)
    @origin_name = origin_name
    @desc = desc
    @finished = false
  end
  def name
    if @finished
      return @origin_name + ""
    else
      return @origin_name
    end
  end
  def desc=(desc)
    @desc = desc
  end
  
  def finish
    @finished = true
  end
    
end
class Game_Party < Game_Unit
  alias old_init initialize
  def initialize
    old_init
    @tasks = {}
  end 
  def add_task(i,desc)
    @tasks[i].desc = @tasks[i].desc + "\n" + desc
  end
  def get_task(i,name,desc)
    @tasks[i]=Task.new(name,desc)
  end
  def have_task?(i)
    @tasks[i] != nil
  end
  def finish_task(i)
    @tasks[i].finish if have_task?(i)
  end
  def unfinished_tasks
    n = []
    for i in @tasks.values
      next if i.finished
      n.push(i)
    end
    return n
  end
  def finished_tasks
    n = []
    for i in @tasks.values
      next unless i.finished
      n.push(i)
    end
    return n
  end
end
class Window_Task_Type < Window_HorzCommand
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    activate
  end
  def window_width
    return Graphics.width
  end
  def col_max
    return 3
  end
  #--------------------------------------------------------------------------
  # ● コマンドリストの作成
  #--------------------------------------------------------------------------
  def make_command_list
    add_command("未完成任务",  :unfinished_task)
    add_command("已完成任务", :finished_task)
    add_command("取消", :cancel)
  end
end
class Window_TaskLeft < Window_Selectable
  attr_reader :finished
  def initialize
    super(0,48,160,Graphics.height - 48)
    create_contents
    @finished = false
    [url=home.php?mod=space&uid=370741]@Index[/url] = 0
    refresh
    deactivate
  end
  def set_finish(finish)
    @finished = finish
    set_item_max
  end
  def item_max
    return @item_max != nil ? @item_max : 0
  end
  def set_item_max
    if @finished
      @item_max = $game_party.finished_tasks.size
    else
      @item_max = $game_party.unfinished_tasks.size
    end
  end
  def refresh
    set_item_max
    super
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #--------------------------------------------------------------------------
  def draw_item(index)
    text = ""
    unless @finished
      if $game_party.unfinished_tasks[index] != nil
        text = $game_party.unfinished_tasks[index].name
      end
    else
      if $game_party.finished_tasks[index] != nil
        text = $game_party.finished_tasks[index].name  
      end
    end
    draw_text(item_rect_for_text(index), text)
  end
end
class Window_TaskRight < Window_Base
  attr_reader :left_index
  def initialize
    super(160,48,Graphics.width - 160,Graphics.height - 48)
    create_contents
    @left_index = 0
    @finished = false
    refresh
  end
  def set_index(i)
    @left_index = i
    refresh
  end
  def set_finish(i)
    @finished = i
  end
  
  def refresh
    contents.clear
    draw_desc
  end
  def draw_desc
    if @finished
      if $game_party.finished_tasks[@left_index] != nil
        draw_text_ex(0,0,$game_party.finished_tasks[@left_index].desc)
      end
    else
      if $game_party.unfinished_tasks[@left_index] != nil
        draw_text_ex(0,0,$game_party.unfinished_tasks[@left_index].desc)
      end
    end
  end
  
end
class Scene_Task < Scene_Base
  def start
    super
    create_task_type_window
    create_left_window
    create_right_window
  end
  def update
    super
    if @left_window.active
      if Input.trigger?(:B)
        @left_window.deactivate
        @task_type_window.activate
      end
      if Input.trigger?(:UP) || Input.trigger?(:DOWN)
        @right_window.set_finish(@left_window.finished)
        @right_window.set_index(@left_window.index)
      end
    end
  end
  
  def terminate
    super
  end
  def create_task_type_window
    @task_type_window = Window_Task_Type.new
    @task_type_window.set_handler(:unfinished_task,method(:view_unfinished_task))
    @task_type_window.set_handler(:finished_task,method(:view_finished_task))
    @task_type_window.set_handler(:cancel,method(:return_scene))
  end
  def create_left_window
    @left_window = Window_TaskLeft.new
    @left_window.set_finish(false)
    @left_window.refresh
  end
  def create_right_window
    @right_window = Window_TaskRight.new
    @right_window.refresh
  end
  def view_unfinished_task
    @left_window.set_finish(false)
    @left_window.refresh
    @left_window.activate
    @task_type_window.deactivate
    @right_window.set_finish(false)
    @right_window.set_index(@left_window.index)
  end
  def view_finished_task
    @left_window.set_finish(true)
    @left_window.refresh
    @left_window.activate
    @task_type_window.deactivate
    @right_window.set_finish(true)
    @right_window.set_index(@left_window.index)
  end
end
复制代码#原作者:superufo
#转换者:消失的三千
#原脚本出处:http://rpg.blue/thread-73243-1-1.html
#要修改加点的属性在280~318行
LEVEL_UP_POINT = 3 #升级时所获得的点数
LEVEL_UP_VARIABLE = 50 #控制角色属性点的变量
                       #比如说角色ID1的属性变量就是51,ID2就是52,依此推类
class Game_Actor < Game_Battler
  def level_up
    [url=home.php?mod=space&uid=22147]@level[/url] += 1
    $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
    for learning in self.class.learnings
      learn_skill(learning.skill_id) if learning.level == @level
    end
  end
end
class Window_PointCommand < Window_Command
  def initialize
    super(25,200)
    self.opacity = 0
    self.z = 1000
    open
  end
  def window_width
    return 115
  end
  def make_command_list
    add_command("+MHP", :HPBoost)#(Vocab::param(0), :HPBoost)
    add_command("+MSP", :MPBoost)#(Vocab::param(1), :MPBoost)
    add_command("+ATK", :ATKBoost)#(Vocab::param(2), :ATKBoost)
    add_command("+DEF", :DEFBoost)#(Vocab::param(3), :DEFBoost)
    add_command("+MAT", :MATBoost)#(Vocab::param(4), :MATBoost)
    add_command("+MDF", :MDFBoost)#(Vocab::param(5), :MDFBoost)
    add_command("+AGI", :AGIBoost)#(Vocab::param(6), :AGIBoost)
    add_command("+LUK", :LUKBoost)#(Vocab::param(7), :LUKBoost)
    add_command("重叠加点", :PointReset)
    add_command("确认加点", :PointBoost)
  end
  def point_enought
    $point > 0
  end
end
class Window_Base < Window
  def draw_actor_hp_lvup(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x , y, 96, 32, Vocab::param(0))
    if $temp_hp == 0
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 70 , y, 48, 32, actor.mhp.to_s, 2)
    else
      mhp = actor.mhp + $temp_hp
      self.contents.font.color = Color.new(255, 128, 128, 255)
      self.contents.draw_text(x + 75 , y, 48, 32, mhp.to_s ,2)
      self.contents.font.color = normal_color      
      if $temp_hp >=0
        self.contents.font.color = Color.new(255, 128, 128, 255)
        self.contents.draw_text(x + 105, y, 36, 32, " +",2)
      else
        self.contents.font.color = Color.new(255,255,0,255)
        self.contents.draw_text(x + 105, y, 36, 32, " -",2)
      end
      self.contents.draw_text(x + 145, y, 32, 32, $temp_hp.to_s, 1)
      self.contents.font.color = normal_color
    end
  end
  def draw_actor_mp_lvup(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x , y, 96, 32, Vocab::param(1))
    if $temp_mp == 0
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 70 , y, 48, 32, actor.mmp.to_s, 2)
    else
      mmp = actor.mmp + $temp_mp
      self.contents.font.color = Color.new(255, 128, 128, 255)
      self.contents.draw_text(x + 75 , y, 48, 32, mmp.to_s ,2)
      self.contents.font.color = normal_color      
      if $temp_mp >=0
        self.contents.font.color = Color.new(255, 128, 128, 255)
        self.contents.draw_text(x + 105, y, 36, 32, " +",2)
      else
        self.contents.font.color = Color.new(255,255,0,255)
        self.contents.draw_text(x + 105, y, 36, 32, " -",2)
      end
      self.contents.draw_text(x + 145, y, 32, 32, $temp_mp.to_s, 1)
      self.contents.font.color = normal_color
    end
  end
  def draw_actor_lvup(actor, x, y, type)
    lvup = normal_color
    upcolor = Color.new(255, 128, 128, 255)
    self.contents.font.color = normal_color    
    case type
    when 0
      parameter_name = Vocab::param(2)
      parameter_value = actor.atk
      parameter_value_temp = parameter_value + $temp_atk
      if $temp_atk != 0
        lvup = upcolor
        if $temp_atk >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 205, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 205, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 205, y, 88, 32, $temp_atk.abs.to_s,1)
        self.contents.font.color = normal_color
      end
    when 1
      parameter_name = Vocab::param(3)
      parameter_value = actor.def
      parameter_value_temp = parameter_value + $temp_def
      if $temp_def != 0
        lvup = upcolor
        if $temp_def >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 205, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 205, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 205, y, 88, 32, $temp_def.abs.to_s,1)
        self.contents.font.color = normal_color
      end
    when 2
      parameter_name = Vocab::param(4)
      parameter_value = actor.mat
      parameter_value_temp = parameter_value + $temp_mat
      if $temp_mat != 0
        lvup = upcolor
        if $temp_mat >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 205, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 205, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 205, y, 88, 32, $temp_mat.abs.to_s,1)
        self.contents.font.color = normal_color
      end
    when 3
      parameter_name = Vocab::param(5)
      parameter_value = actor.mdf
      parameter_value_temp = parameter_value + $temp_mdf
      if $temp_mdf != 0
        lvup = upcolor
        if $temp_mdf >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 205, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 205, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 205, y, 88, 32, $temp_mdf.abs.to_s,1)
        self.contents.font.color = normal_color
      end
    when 4
      parameter_name = Vocab::param(6)
      parameter_value = actor.agi
      parameter_value_temp = parameter_value + $temp_agi
      if $temp_agi != 0
        lvup = upcolor
        if $temp_agi >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 205, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 205, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 205, y, 88, 32, $temp_agi.abs.to_s,1)
        self.contents.font.color = normal_color
      end
    when 5
      parameter_name = Vocab::param(7)
      parameter_value = actor.luk
      parameter_value_temp = parameter_value + $temp_luk
      if $temp_luk != 0
        lvup = upcolor
        if $temp_luk >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 205, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 205, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 205, y, 88, 32, $temp_luk.abs.to_s,1)
        self.contents.font.color = normal_color
      end
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 32, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 86, y, 36, 32, parameter_value.to_s)
    self.contents.draw_text(x + 110, y, 36, 32, "→")
    self.contents.font.color = lvup
    self.contents.draw_text(x + 146, y, 96, 32, parameter_value_temp.to_s)
    self.contents.font.color = normal_color            
  end
end
class Window_Lvpoint < Window_Base
  def initialize
    super(28,300,180,60)
    self.opacity = 0
    refresh
  end
  def refresh
    self.contents.clear
    parameter_name = "剩余点数"
    parameter_value = $point
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, self.contents.width, self.contents.height, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, self.contents.width, self.contents.height, parameter_value.to_s,2)
  end
end
class Window_Lvup < Window_Base
  def initialize
    super(0, 0, 800, 544)
#    self.opacity = 0
    self.contents = Bitmap.new(width - 25, height - 25)
    [url=home.php?mod=space&uid=95897]@actor[/url] = $game_party.menu_actor
    refresh
  end  
  def refresh
    self.contents.clear
    draw_actor_face(@actor, 0, 0)
    change_color(system_color)
    draw_text(30, 15, 180, line_height, "Name:")
    draw_text(260, 15, 180, line_height, "Race:")
    draw_text(450, 15, 180, line_height, "Nickname:")
    change_color(normal_color)
    draw_actor_name(@actor, 90, 15)
    draw_actor_class(@actor, 290, 15)
    draw_actor_nickname(@actor, 550, 15)
    draw_actor_level(@actor, 130, 270)
    draw_actor_hp_lvup(@actor, 120, 55)
    draw_actor_mp_lvup(@actor, 120, 79)
    draw_actor_lvup(@actor, 120, 103, 0)
    draw_actor_lvup(@actor, 120, 127, 1)
    draw_actor_lvup(@actor, 120, 151, 2)
    draw_actor_lvup(@actor, 120, 175, 3)
    draw_actor_lvup(@actor, 120, 199, 4)
    draw_actor_lvup(@actor, 120, 223, 5)
  end
end
class Scene_Lvup < Scene_Base
  def initialize
#    super(128,128,128,58)
    [url=home.php?mod=space&uid=95897]@actor[/url] = $game_party.menu_actor
    set_data
    create_window
  end
   def dispose_background
     @background_sprite.dispose
   end
  def create_window
    @command_window = Window_PointCommand.new
    @command_window.set_handler(:HPBoost, method(:CommandHPBoost))
    @command_window.set_handler(:MPBoost, method(:CommandMPBoost))
    @command_window.set_handler(:ATKBoost, method(:CommandATKBoost))
    @command_window.set_handler(:DEFBoost, method(:CommandDEFBoost))
    @command_window.set_handler(:MATBoost, method(:CommandMATBoost))
    @command_window.set_handler(:MDFBoost, method(:CommandMDFBoost))
    @command_window.set_handler(:AGIBoost, method(:CommandAGIBoost))
    @command_window.set_handler(:LUKBoost, method(:CommandLUKBoost))
    @command_window.set_handler(:PointReset, method(:reset_point))
    @command_window.set_handler(:PointBoost, method(:process_point))
    @command_window.set_handler(:cancel,    method(:return_scene))
    @command_window.y = 56
    @lvup_window = Window_Lvup.new
    @lvpoint_window = Window_Lvpoint.new
  end
  def set_data
    reset_point
    
    @hp_hp = 15;@hp_mp = 0
    @hp_atk = 0;@hp_def = 0
    @hp_mat = 0;@hp_mdf = 0
    @hp_agi = 0;@hp_luk = 0
    
    @mp_hp = 0;@mp_mp = 10
    @mp_atk = 0;@mp_def = 0
    @mp_mat = 0;@mp_mdf = 0
    @mp_agi = 0;@mp_luk = 0
    
    @atk_hp = 0;@atk_mp = 0
    @atk_atk = 1;@atk_def = 0
    @atk_mat = 0;@atk_mdf = 0
    @atk_agi = 0;@atk_luk = 0
    
    @def_hp = 0;@def_mp = 0
    @def_atk = 0;@def_def = 1
    @def_mat = 0;@def_mdf = 0
    @def_agi = 0;@def_luk = 0
    
    @mat_hp = 0;@mat_mp = 0
    @mat_atk = 0;@mat_def = 0
    @mat_mat = 1;@mat_mdf = 0
    @mat_agi = 0;@mat_luk = 0
    
    @mdf_hp = 0;@mdf_mp = 0
    @mdf_atk = 0;@mdf_def = 0
    @mdf_mat = 0;@mdf_mdf = 1
    @mdf_agi = 0;@mdf_luk = 0
    
    @agi_hp = 0;@agi_mp = 0
    @agi_atk = 0;@agi_def = 0
    @agi_mat = 0;@agi_mdf = 0
    @agi_agi = 1;@agi_luk = 0
    
    @luk_hp = 0;@luk_mp = 0
    @luk_atk = 0;@luk_def = 0
    @luk_mat = 0;@luk_mdf = 0
    @luk_agi = 0;@luk_luk = 1
  end
  def window_refresh
    @lvup_window.refresh
    @lvpoint_window.refresh
    @command_window.activate
  end
  def CommandHPBoost
    Sound.play_buzzer if $point == 0
    @command_window.activate if $point == 0
    return if $point == 0
    $temp_hp += @hp_hp
    $temp_mp += @hp_mp
    $temp_atk += @hp_atk
    $temp_def += @hp_def
    $temp_mat += @hp_mat
    $temp_mdf += @hp_mdf
    $temp_agi += @hp_agi
    $temp_luk += @hp_luk
    $point -= 1
    window_refresh
  end
  def CommandMPBoost
    Sound.play_buzzer if $point == 0
    @command_window.activate if $point == 0
    return if $point == 0
    $temp_hp += @mp_hp
    $temp_mp += @mp_mp
    $temp_atk += @mp_atk
    $temp_def += @mp_def
    $temp_mat += @mp_mat
    $temp_mdf += @mp_mdf
    $temp_agi += @mp_agi
    $temp_luk += @mp_luk
    $point -= 1
    window_refresh
  end
  def CommandATKBoost
    Sound.play_buzzer if $point == 0
    @command_window.activate if $point == 0
    return if $point == 0
    $temp_hp += @atk_hp
    $temp_mp += @atk_mp
    $temp_atk += @atk_atk
    $temp_def += @atk_def
    $temp_mat += @atk_mat
    $temp_mdf += @atk_mdf
    $temp_agi += @atk_agi
    $temp_luk += @atk_luk
    $point -= 1
    window_refresh
  end
  def CommandDEFBoost
    Sound.play_buzzer if $point == 0
    @command_window.activate if $point == 0
    return if $point == 0
    $temp_hp += @def_hp
    $temp_mp += @def_mp
    $temp_atk += @def_atk
    $temp_def += @def_def
    $temp_mat += @def_mat
    $temp_mdf += @def_mdf
    $temp_agi += @def_agi
    $temp_luk += @def_luk
    $point -= 1
    window_refresh
  end
  def CommandMATBoost
    Sound.play_buzzer if $point == 0
    @command_window.activate if $point == 0
    return if $point == 0
    $temp_hp += @mat_hp
    $temp_mp += @mat_mp
    $temp_atk += @mat_atk
    $temp_def += @mat_def
    $temp_mat += @mat_mat
    $temp_mdf += @mat_mdf
    $temp_agi += @mat_agi
    $temp_luk += @mat_luk
    $point -= 1
    window_refresh
  end
  def CommandMDFBoost
    Sound.play_buzzer if $point == 0
    @command_window.activate if $point == 0
    return if $point == 0
    $temp_hp += @mdf_hp
    $temp_mp += @mdf_mp
    $temp_atk += @mdf_atk
    $temp_def += @mdf_def
    $temp_mat += @mdf_mat
    $temp_mdf += @mdf_mdf
    $temp_agi += @mdf_agi
    $temp_luk += @mdf_luk
    $point -= 1
    window_refresh
  end
  def CommandAGIBoost
    Sound.play_buzzer if $point == 0
    @command_window.activate if $point == 0
    return if $point == 0
    $temp_hp += @agi_hp
    $temp_mp += @agi_mp
    $temp_atk += @agi_atk
    $temp_def += @agi_def
    $temp_mat += @agi_mat
    $temp_mdf += @agi_mdf
    $temp_agi += @agi_agi
    $temp_luk += @agi_luk
    $point -= 1
    window_refresh
  end
  def CommandLUKBoost
    Sound.play_buzzer if $point == 0
    @command_window.activate if $point == 0
    return if $point == 0
    $temp_hp += @luk_hp
    $temp_mp += @luk_mp
    $temp_atk += @luk_atk
    $temp_def += @luk_def
    $temp_mat += @luk_mat
    $temp_mdf += @luk_mdf
    $temp_agi += @luk_agi
    $temp_luk += @luk_luk
    $point -= 1
    window_refresh
  end
  def reset_point
    $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
    $temp_hp = 0
    $temp_mp = 0
    $temp_atk = 0
    $temp_def = 0
    $temp_mat = 0
    $temp_mdf = 0
    $temp_agi = 0
    $temp_luk = 0
    window_refresh if @command_window != nil
  end
  def process_point
    if $temp_hp + $temp_mp + $temp_atk + $temp_def + $temp_mat + $temp_mdf + $temp_agi + $temp_luk < 1
      Sound.play_buzzer
      @command_window.activate
      return
    else
      $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
      @actor.add_param(0, $temp_hp)
      @actor.add_param(1, $temp_mp)
      @actor.add_param(2, $temp_atk)
      @actor.add_param(3, $temp_def)
      @actor.add_param(4, $temp_mat)
      @actor.add_param(5, $temp_mdf)
      @actor.add_param(6, $temp_agi)
      @actor.add_param(7, $temp_luk)
      reset_point
    end
  end
end
 | 
 |