| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2014-8-3 |
| 在线时间 | 41 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 41 小时
- 注册时间
- 2010-7-10
- 回帖
- 89
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 zhangchi5 于 2012-3-18 19:35 编辑
新版发布啦!!!
神奇呀神奇~神奇呀神奇~神奇呀神奇~神奇呀神奇~……
任务系统 for VA
添加后 以前的存档都不能用。。。要新开存档
By SkyZH
使用方法:
新开任务:
事件中插入脚本--
- str="任务名称"
- $game_missions.mission(20).setTitle(str)
- str="介绍"
- $game_missions.mission(20).setText(str)
- str="重要信息以及奖励"
- $game_missions.mission(20).setImText(str)
- str="接任务NPC"
- str1="收任务NPC"
- $game_missions.mission(20).setNPC(str,str1)
- $game_missions.mission(20).setStatus(true)
复制代码
完成任务:
事件中插入脚本--
- @p=$game_missions.serMission("任务名称")
- $game_missions.mission(@p).clear
- $game_missions.mission(@p).setStatus(false)
复制代码 serMission(任务名称),返回此任务的编号!
查找是否接了这个任务:
事件中条件分歧-第4页-脚本
$game_missions.serMission("任务名")!=-1
地图提示:
事件中插入脚本--
- $game_maphint.clear
- stringa="世界真猥琐~"
- $game_maphint.setText(0,stringa)
- stringa="全家就是你家,欢迎回家~"
- $game_maphint.setText(1,stringa)
复制代码 $game_maphint.setText(行号,文字)
(老版)截图:
(新版)截图:
代码一堆堆。。。
- #==============================================================================
- # ■ Game_MapHint
- #------------------------------------------------------------------------------
- # 地图提示信息显示。
- #==============================================================================
- class Game_MapHint
- def initialize
- @texts = []
- end
- def visible_line
- @texts.size
- end
- def text(line)
- @texts[line]
- end
- def setText(line , text)
- @texts[line]=text
- end
- def clear
- for i in 0...@texts.size
- @texts.delete_at(i)
- end
- end
- end
- #==============================================================================
- # ■ Game_Mission
- #------------------------------------------------------------------------------
- # 任务信息显示。
- #==============================================================================
- class Game_Mission
- def initialize
- @texts = ""
- @titletext = ""
- @imtext = ""
- @NPC1 = ""
- @NPC2 = ""
- @bool_mission = false
- end
- def setText(text)
- @texts=text
- end
- def setTitle(text)
- @tetlitext=text
- end
- def setImText(text)
- @imtext=text
- end
- def setNPC(t1, t2)
- @NPC1=t1
- @NPC2=t2
- end
- def setStatus(b)
- @bool_mission=b
- end
- def getText
- @texts
- end
- def getTitle
- @tetlitext
- end
- def getImText
- @imtext
- end
- def getNPC1
- @NPC1
- end
- def getNPC2
- @NPC2
- end
- def getStatus
- @bool_mission
- end
- def clear
- @texts = ""
- @titletext = ""
- @imtext = ""
- @NPC1 = ""
- @NPC2 = ""
- @bool_mission = false
- end
- end
- #==============================================================================
- # ■ Game_Missions
- #------------------------------------------------------------------------------
- # 任务信息显示。
- #==============================================================================
- class Game_Missions
- def initialize
- @mission_array=Array.new
- for i in 0...100
- @mission_array[i]=Game_Mission.new
- end
- end
- def mission(t)
- return @mission_array[t]
- end
- def getNoMission
- for i in 99..0
- if @mission_array[i].getStatus==false
- return i
- end
- end
- end
- def clear
- for i in 0...100
- @mission_array[i].clear
- end
- end
- def serMission(titletext)
- for i in 0...100
- if @mission_array[i].getTitle==titletext && @mission_array[i].getStatus==true then
- return i
- end
- end
- return -1
- end
- def getMissionNum
- @r=0
- for i in 99..0
- if @mission_array[i].getStatus==true
- @r=@r+1
- end
- end
- return @r
- end
- end
- #==============================================================================
- # ■ Window_MapHint
- #------------------------------------------------------------------------------
- # 显示地图信息。 By SkyZH
- #==============================================================================
- class Window_MapHint < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, window_width, Graphics.height)
- self.openness = 0
- open
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的宽度
- #--------------------------------------------------------------------------
- def window_width
- return Graphics.width - 256
- end
- def draw_title
- self.contents.font.color=system_color
- self.contents.font.size=48
- draw_text(4, 0, window_width-40, fitting_height(1),"提示 - " + $game_map.display_name,1)
- self.contents.font.color=normal_color
- self.contents.font.size=Font.default_size
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- draw_title
- for i in 0..($game_maphint.visible_line-1)
- @tempn=$game_maphint.text(i)
- draw_text(4, fitting_height(i+1), window_width-40, fitting_height(1) ,@tempn,1)
- end
- end
- end
- #==============================================================================
- # ■ Window_MissionShow
- #------------------------------------------------------------------------------
- # 显示任务信息。 By SkyZH
- #==============================================================================
- class Window_MissionShow < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, window_width, Graphics.height)
- self.openness = 0
- open
- end
- def setNumber(numbers)
- @Mnumber=numbers
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的宽度
- #--------------------------------------------------------------------------
- def window_width
- return Graphics.width
- end
- def draw_title(text , line, size ,dwhere ,color)
- self.contents.font.color=color
- self.contents.font.size=size
- draw_text(4, 0 , window_width-40, fitting_height(line+1), text ,dwhere)
- self.contents.font.color=normal_color
- self.contents.font.size=Font.default_size
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- @texts= $game_missions.mission(@Mnumber).getTitle
- draw_title(@texts,0,48,1,Color.new(255,100,100))
- draw_title("任务介绍",4,22,0,Color.new(100,255,255))
- draw_title($game_missions.mission(@Mnumber).getText,6,18,0,Color.new(255,255,255))
- draw_title("任务奖励/重要信息",9,22,0,Color.new(100,255,255))
- draw_title($game_missions.mission(@Mnumber).getImText,11,18,0,Color.new(255,255,255))
- draw_title("领取任务NPC",14,22,0,Color.new(100,255,255))
- draw_title($game_missions.mission(@Mnumber).getNPC1,16,18,0,Color.new(255,255,255))
- draw_title("交接任务NPC",19,22,0,Color.new(100,255,255))
- draw_title($game_missions.mission(@Mnumber).getNPC2,21,18,0,Color.new(255,255,255))
- end
- end
- #==============================================================================
- # ■ Window_MenuCommand
- #------------------------------------------------------------------------------
- # 任务画面中显示指令的窗口 By SkyZH
- #==============================================================================
- class Window_MissionCommand < Window_Command
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0)
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的宽度
- #--------------------------------------------------------------------------
- def window_width
- return 256
- end
- #--------------------------------------------------------------------------
- # ● 获取显示行数
- #--------------------------------------------------------------------------
- def visible_line_number
- (Graphics.height-standard_padding*2)/line_height
- end
- #--------------------------------------------------------------------------
- # ● 生成指令列表
- #--------------------------------------------------------------------------
- def make_command_list
- add_original_commands
- add_return_command
- end
- #--------------------------------------------------------------------------
- # ● 独自添加指令用
- #--------------------------------------------------------------------------
- def add_original_commands
- for i in 0...100
- @r=i+1
- @t="mission" + i.to_s
- if $game_missions.mission(i).getStatus==true
- add_command($game_missions.mission(i).getTitle, @t.to_sym)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 结束指令用
- #--------------------------------------------------------------------------
- def add_return_command
- add_command("返回", :returnsc)
- end
- #--------------------------------------------------------------------------
- # ● 按下确定键时的处理
- #--------------------------------------------------------------------------
- def process_ok
- super
- end
- def call_handler(symbol)
- @handler[symbol].call(symbol.id2name[7,symbol.id2name.size-7].to_i) if handle?(symbol)
- end
- end
- #encoding:utf-8
- #==============================================================================
- # ■ Scene_Mission
- #------------------------------------------------------------------------------
- # 任务
- #==============================================================================
- class Scene_Mission < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start
- super
- create_command_window
- end
- #--------------------------------------------------------------------------
- # ● 生成指令窗口
- #--------------------------------------------------------------------------
- def create_command_window
- @maphint_window= Window_MapHint.new(256,0)
- @command_window = Window_MissionCommand.new
- @window_missionShow=Window_MissionShow.new(0,0)
- @window_missionShow.hide
- @command_window.set_handler(:returnsc, method(:scenereturns))
- @command_window.set_handler(:cancel, method(:scenereturns))
- @window_missionShow.set_handler(:cancel, method(:missionHide))
- @window_missionShow.set_handler(:ok, method(:missionHide))
- for i in 0...100
- @r=i
- @t="mission" + i.to_s
- @command_window.set_handler(@t.to_sym, method(:missionShow))
- end
- end
- def scenereturns( t)
- SceneManager.return
- end
- def missionShow( t)
- @window_missionShow.setNumber(t)
- @command_window.deactivate
- @window_missionShow.activate
- @window_missionShow.openness=0
- @window_missionShow.show
- @window_missionShow.open
- @window_missionShow.refresh
- end
- def missionHide
- @command_window.activate
- @window_missionShow.deactivate
- @window_missionShow.close
- update until @window_missionShow.close?
- @window_missionShow.hide
- end
- end
- #==============================================================================
- # ■ Window_MenuCommand
- #------------------------------------------------------------------------------
- # 菜单画面中显示指令的窗口
- #==============================================================================
- class Window_MenuCommand < Window_Command
- #--------------------------------------------------------------------------
- # ● 独自添加指令用
- #--------------------------------------------------------------------------
- def add_original_commands
- add_command("地图提示", :maphint)
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 菜单画面
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ● 生成指令窗口
- #--------------------------------------------------------------------------
- def create_command_window
- @command_window = Window_MenuCommand.new
- @command_window.set_handler(:item, method(:command_item))
- @command_window.set_handler(:skill, method(:command_personal))
- @command_window.set_handler(:equip, method(:command_personal))
- @command_window.set_handler(:status, method(:command_personal))
- @command_window.set_handler(:formation, method(:command_formation))
- @command_window.set_handler(:save, method(:command_save))
- @command_window.set_handler(:game_end, method(:command_game_end))
- @command_window.set_handler(:cancel, method(:return_scene))
- @command_window.set_handler(:maphint, method(:command_maphint))
- end
- def command_maphint
- SceneManager.call(Scene_Mission)
- end
- end
- #==============================================================================
- # ■ DataManager
- #------------------------------------------------------------------------------
- # 数据库和游戏实例的管理器。所有在游戏中使用的全局变量都在这里初始化。
- #==============================================================================
- module DataManager
- #--------------------------------------------------------------------------
- # ● 生成各种游戏对象
- #--------------------------------------------------------------------------
- def self.create_game_objects
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_timer = Game_Timer.new
- $game_message = Game_Message.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- $game_maphint = Game_MapHint.new
- $game_missions = Game_Missions.new
- end
- #--------------------------------------------------------------------------
- # ● 生成存档内容
- #--------------------------------------------------------------------------
- def self.make_save_contents
- contents = {}
- contents[:system] = $game_system
- contents[:timer] = $game_timer
- contents[:message] = $game_message
- contents[:switches] = $game_switches
- contents[:variables] = $game_variables
- contents[:self_switches] = $game_self_switches
- contents[:actors] = $game_actors
- contents[:party] = $game_party
- contents[:troop] = $game_troop
- contents[:map] = $game_map
- contents[:player] = $game_player
- contents[:maphint] = $game_maphint
- contents[:missions] = $game_missions
- contents
- end
- #--------------------------------------------------------------------------
- # ● 展开存档内容
- #--------------------------------------------------------------------------
- def self.extract_save_contents(contents)
- $game_system = contents[:system]
- $game_timer = contents[:timer]
- $game_message = contents[:message]
- $game_switches = contents[:switches]
- $game_variables = contents[:variables]
- $game_self_switches = contents[:self_switches]
- $game_actors = contents[:actors]
- $game_party = contents[:party]
- $game_troop = contents[:troop]
- $game_map = contents[:map]
- $game_player = contents[:player]
- $game_maphint = contents[:maphint]
- $game_missions = contents[:missions]
- end
- end
复制代码
|
评分
-
查看全部评分
|