Advertisement
LiTTleDRAgo

[RGSS2] Drago Simple Mission Script Revisi Ver 2

Apr 19th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 24.79 KB | None | 0 0
  1. #==============================================================================
  2. # Drago Simple Mission Script
  3. # Version 2.50
  4. # Author : LiTTleDRAgo
  5. #==============================================================================
  6. module LiTTleDRAgo
  7.  
  8.   MISSION = []
  9.  
  10.   # icon = icon index dari iconset
  11.   # Judul = judul dari mission
  12.   # switch = switch yang perlu dinyalakan untuk memunculkan mission
  13.   # variable = [id, result],
  14.   #            kalau value dari variable >= (result) maka mission completed
  15.   #            kalau value dari variable <= (-result) maka mission failed
  16.   #    misal = [1,4]
  17.   #            kalau value dari variable 1 = 4 (atau lebih besar) -> completed
  18.   #            kalau value dari variable 1 = -4 (atau lebih kecil) -> fail
  19.   #
  20.   # deskripsi = yaa tau sendiri lah
  21.   # gambar = file gambar yang diselipkan di kanan atas board, ga wajib
  22.   # commonevent = Common Event yang akan dieksekusi kalau claim reward
  23.  
  24.   MISSION[1] = { "icon"     => 94,  
  25.                  "judul"    => "Find the cat",
  26.                  "switch"   => 4,
  27.                  "variable" => [1,4],
  28.                  "deskripsi" => ["Kucingku hilang, tolong bantu aku mencarinya",
  29.                                  "2nd line",
  30.                                  "3rd line",
  31.                                  "4th line",
  32.                                  "5th line",
  33.                                  "From : Lea"],
  34.                  "gambar"     => "test",
  35.                 "commonevent" => 1, }
  36.                  
  37.   MISSION[2] = { "icon"     => 54,
  38.                  "judul"    => "Find the dog",
  39.                  "switch"   => 8,
  40.                  "variable" => [2,4],
  41.                  "deskripsi" => ["Cari anjing sialan itu, hidup atau mati !!",
  42.                                  "Bila ketemu langsung pancung saja kepalanya",
  43.                                  "",
  44.                                  "",
  45.                                  "",
  46.                                  "From : Kakek penjaga toko"],
  47.                 "commonevent" => 2, }
  48.                                  
  49.   # Transparency dari menu, makin kecil angkanya makin transparan                
  50.   BACK_OPACITY = 200
  51.  
  52.   # Posisi gambar X, Y, WIDTH, HEIGHT
  53.   GAMBAR = [180,0,180,130]
  54.  
  55.   # cara panggil =
  56.   # $scene = Scene_Mission.new
  57.   #
  58.   # cara merubah Ambil Request di game pakai script
  59.   # change_accepted(mission_id, value=true)
  60.   #
  61.   # cara merubah Ambil Reward di game pakai script
  62.   # change_claimed(mission_id, value=true)
  63.   #
  64.   # cara check mission sedang diambil atau tidak dengan call script
  65.   # mission_accepted?(mission_id)
  66.   #
  67.   # cara check mission sudah diambil rewardnya atau tidak dengan call script
  68.   # mission_claimed?(mission_id)
  69.   #
  70.   # Dibawah cuma konfigurasi string doang, pasti ngerti lah
  71.  
  72.   MISSION_VOCAB = "Silahkan Pilih Mission"
  73.  
  74.   TEXT_VOCAB    = ["Unavailable",
  75.                    "Available",
  76.                    "Accepted",
  77.                    "Completed",
  78.                    "Failed",
  79.                    "Reward Accepted",]
  80.                    
  81.   COMMAND_VOCAB = ["Take this request?" ,
  82.                    "Abort this request?",
  83.                    "Claim Reward?",]
  84.                    
  85.   HEADER_BOARD = ["Mission Board"]
  86.  
  87.   HEADER_MENU = ["No.","Request Name","Status"]
  88.  
  89. end
  90.  
  91. #==============================================================================
  92. # ** Game_Interpreter
  93. #------------------------------------------------------------------------------
  94. #  An interpreter for executing event commands. This class is used within the
  95. # Game_Map, Game_Troop, and Game_Event classes.
  96. #==============================================================================
  97. class Game_Interpreter
  98.   #--------------------------------------------------------------------------
  99.   # * Change Accepted
  100.   #--------------------------------------------------------------------------
  101.   def change_accepted(mission_id, value=true)
  102.     task = LiTTleDRAgo::MISSION[mission_id]
  103.     $game_self_switches[["MissionAccept",task["judul"]]] = value
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # * Change Claimed
  107.   #--------------------------------------------------------------------------
  108.   def change_claimed(mission_id, value=true)
  109.     task = LiTTleDRAgo::MISSION[mission_id]
  110.     $game_self_switches[["MissionReward",task["judul"]]] = value
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # * Mission Accepted?
  114.   #--------------------------------------------------------------------------
  115.   def mission_accepted?(mission_id)
  116.     task = LiTTleDRAgo::MISSION[mission_id]
  117.     return $game_self_switches[["MissionAccept",task["judul"]]]
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # * Mission Claimed?
  121.   #--------------------------------------------------------------------------
  122.   def mission_claimed?(mission_id)
  123.     task = LiTTleDRAgo::MISSION[mission_id]
  124.     return $game_self_switches[["MissionReward",task["judul"]]]
  125.   end
  126. end
  127.  
  128. #==============================================================================
  129. # ** Dialog system
  130. #------------------------------------------------------------------------------
  131. #  credit to Zeriab
  132. #==============================================================================
  133. class Dialog
  134.   STARTING_Z_VALUE = 1500 # Default value is 1500
  135.   attr_accessor :value
  136.   attr_writer :marked_to_close
  137.   #--------------------------------------------------------------------------
  138.   # * Getter with 'false' as default value
  139.   #--------------------------------------------------------------------------
  140.   def marked_to_close
  141.     @marked_to_close = false  if @marked_to_close.nil?
  142.     return @marked_to_close
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # * Initialization
  146.   #--------------------------------------------------------------------------
  147.   def mark_to_close
  148.     self.marked_to_close = true
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # * Show the dialog
  152.   #   Returns the value from the dialog
  153.   #--------------------------------------------------------------------------
  154.   def self.show(*args, &block)
  155.     dialog = self.new(*args, &block)
  156.     dialog.marked_to_close = false
  157.     return dialog.main
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # * Initialization
  161.   #--------------------------------------------------------------------------
  162.   def initialize(*args, &block)
  163.     # For subclasses to overwrite
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # * Main processing
  167.   #--------------------------------------------------------------------------
  168.   def main
  169.     # Create the dimmed background
  170.     create_background
  171.     # Create Windows
  172.     main_window
  173.     # Main loop if the dialog should not close
  174.     while !marked_to_close
  175.       # Update game screen
  176.       Graphics.update
  177.       # Update input information
  178.       Input.update
  179.       # Frame update
  180.       update
  181.     end
  182.     # Dispose of windows
  183.     main_dispose
  184.     # Dispose of background
  185.     dispose_background
  186.     # Update input information
  187.     Input.update
  188.     # Returns the acquired value
  189.     return self.value
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # * Create the dimmed background
  193.   #--------------------------------------------------------------------------
  194.   def create_background
  195.     bitmap = Bitmap.new(640,480)
  196.     bitmap.fill_rect(0,0,640,480,Color.new(0,0,0,128))
  197.     @background_sprite = Sprite.new
  198.     @background_sprite.z = STARTING_Z_VALUE
  199.     @background_sprite.bitmap = bitmap
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # * Create the windows
  203.   #--------------------------------------------------------------------------
  204.   def main_window
  205.     # For the subclasses to override
  206.     # Remember to set their z.value to at least STARTING_Z_VALUE + 1
  207.   end
  208.   #--------------------------------------------------------------------------
  209.   # * Dispose the background
  210.   #--------------------------------------------------------------------------
  211.   def dispose_background
  212.     @background_sprite.dispose
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # * Dispose the windows
  216.   #--------------------------------------------------------------------------
  217.   def main_dispose
  218.     # For the subclasses to override
  219.     # Dispose your windows here
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # * Frame Update
  223.   #--------------------------------------------------------------------------
  224.   def update
  225.     # For the subclasses to override
  226.     if Input.trigger?(Input::B)
  227.       mark_to_close
  228.     end
  229.   end
  230. end
  231.  
  232. #==============================================================================
  233. # * A Simple Yes/No dialog
  234. #----------------------------------------------------------------------------
  235. #  credit to Zeriab
  236. #==============================================================================
  237. class Dialog_YesNo < Dialog
  238.   # self.value: false = No, true = Yes
  239.  
  240.   #--------------------------------------------------------------------------
  241.   # * A show method
  242.   #--------------------------------------------------------------------------
  243.   def initialize(default_value = false, text = nil)
  244.     # Sets the default value
  245.     self.value = default_value
  246.     @text = text
  247.     # Sets the menu index
  248.     if default_value
  249.       @menu_index = 0
  250.     else
  251.       @menu_index = 1
  252.     end
  253.   end
  254.   #--------------------------------------------------------------------------
  255.   # * Create the windows
  256.   #--------------------------------------------------------------------------
  257.   def main_window
  258.     @disposables = []
  259.    
  260.     # The command window
  261.     @command_window = Window_Command.new(80, ['Yes', 'No'])
  262.     @command_window.index = @menu_index
  263.     @command_window.x = (Graphics.width - @command_window.width) / 2
  264.     @command_window.y = (Graphics.height - @command_window.height) / 2
  265.     @command_window.z = STARTING_Z_VALUE + 50
  266.     @command_window.opacity = 0
  267.     @command_window.back_opacity = 0
  268.     @disposables << @command_window
  269.    
  270.     # The text window
  271.     if @text.is_a?(String)
  272.       pos = [@command_window.x, @command_window.y]
  273.       wh = [@command_window.width, @command_window.height]
  274.       @text_window = Window_MissionStatus.new(pos[0]-50,pos[1]-50,wh[0]+100,wh[1]+50)
  275.       @text_window.set_text(@text, 1)
  276.       @text_window.z = STARTING_Z_VALUE + 1
  277.       @disposables << @text_window
  278.     end
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # * Dispose the windows
  282.   #--------------------------------------------------------------------------
  283.   def main_dispose
  284.     @disposables.each {|element| element.dispose}
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # * Frame Update
  288.   #--------------------------------------------------------------------------
  289.   def update
  290.     @command_window.update
  291.     if Input.trigger?(Input::B)
  292.       mark_to_close
  293.     end
  294.     if Input.trigger?(Input::C)
  295.       if @command_window.index == 0
  296.         self.value = true
  297.       else
  298.         self.value = false
  299.       end
  300.       mark_to_close
  301.     end
  302.   end
  303. end
  304. #==============================================================================
  305. # ** Window_Item
  306. #------------------------------------------------------------------------------
  307. #  This window displays a list of inventory items for the item screen, etc.
  308. #==============================================================================
  309.  
  310. class Window_Mission < Window_Selectable
  311.  
  312.   #--------------------------------------------------------------------------
  313.   # * Object Initialization
  314.   #     x      : window x-coordinate
  315.   #     y      : window y-coordinate
  316.   #     width  : window width
  317.   #     height : window height
  318.   #--------------------------------------------------------------------------
  319.   def initialize(x, y, width, height)
  320.     super(x, y+50, width, height-50)
  321.     self.back_opacity = 0
  322.     self.opacity = 0
  323.     @column_max = 1
  324.     self.index = 0
  325.     refresh
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # * Get Item
  329.   #--------------------------------------------------------------------------
  330.   def item
  331.     return @data[self.index]
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # * Whether or not to include in item list
  335.   #     item : item
  336.   #--------------------------------------------------------------------------
  337.   def include?(item)
  338.     return false if item == nil
  339.     return true
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # * Whether or not to display in enabled state
  343.   #     item : item
  344.   #--------------------------------------------------------------------------
  345.   def enable?(item)
  346.     return false if !$game_switches[item["switch"]]
  347.     return true
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # * Refresh
  351.   #--------------------------------------------------------------------------
  352.   def refresh
  353.     @data = []
  354.     (0..LiTTleDRAgo::MISSION.size).each {|i|
  355.       next unless include?(LiTTleDRAgo::MISSION[i])
  356.       @data.push(LiTTleDRAgo::MISSION[i]) }
  357.     @data.push(nil) if include?(nil)
  358.     @item_max = @data.size
  359.     fontsize = self.contents.font.size
  360.     create_contents
  361.     self.contents.font.color = system_color
  362.     self.contents.font.size = 16
  363.     for i in 0...@item_max
  364.       draw_item(i)
  365.     end
  366.     self.contents.font.color = normal_color
  367.     self.contents.font.size = fontsize
  368.   end
  369.   #--------------------------------------------------------------------------
  370.   # * Draw Item
  371.   #     index : item number
  372.   #--------------------------------------------------------------------------
  373.   def draw_item(index)
  374.     rect = item_rect(index)
  375.     self.contents.clear_rect(rect)
  376.     item = @data[index]
  377.     if item != nil
  378.       enabled = enable?(item)
  379.       rect.width -= 4
  380.       draw_icon(item["icon"], rect.x+24, rect.y, enabled) if item["icon"]
  381.       text = enabled ? (item["judul"] ? item["judul"] : "???") : "???"
  382.       self.contents.font.color = normal_color
  383.       self.contents.font.color.alpha = enabled ? 255 : 128
  384.       self.contents.draw_text(rect.x, rect.y, 200, WLH, sprintf("%02d", index))
  385.       self.contents.draw_text(rect.x+24+24, rect.y, 200, WLH, text)
  386.       if enabled
  387.         if $game_variables[item["variable"][0]] >= item["variable"][1]
  388.           self.contents.font.color = Color.new(0,255,0,255)
  389.           text = LiTTleDRAgo::TEXT_VOCAB[3]
  390.         elsif $game_variables[item["variable"][0]] <= (item["variable"][1]*-1)
  391.           self.contents.font.color = crisis_color
  392.           text = LiTTleDRAgo::TEXT_VOCAB[4]
  393.         else
  394.           if $game_self_switches[["MissionAccept",item["judul"]]]
  395.             self.contents.font.color = Color.new(0,255,255,255)
  396.             text = LiTTleDRAgo::TEXT_VOCAB[2]
  397.           else
  398.             text = LiTTleDRAgo::TEXT_VOCAB[1]
  399.           end
  400.         end
  401.       else
  402.         text = LiTTleDRAgo::TEXT_VOCAB[0]
  403.       end
  404.       self.contents.draw_text(rect.x, rect.y, 315, WLH, text,2)
  405.     end
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # * Update Help Text
  409.   #--------------------------------------------------------------------------
  410.   def update_help
  411.     @help_window.set_text(LiTTleDRAgo::MISSION_VOCAB)
  412.   end
  413. end
  414.  
  415. #==============================================================================
  416. # ** Window_Status
  417. #------------------------------------------------------------------------------
  418. #  This window displays full status specs on the status screen.
  419. #==============================================================================
  420.  
  421. class Window_MissionStatus < Window_Base
  422.   #--------------------------------------------------------------------------
  423.   # * Object Initialization
  424.   #     actor : actor
  425.   #--------------------------------------------------------------------------
  426.   def initialize(x, y, width, height)
  427.     super(x, y, width, height)
  428.     self.back_opacity = LiTTleDRAgo::BACK_OPACITY
  429.     refresh
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # * Refresh
  433.   #--------------------------------------------------------------------------
  434.   def refresh(s=nil)
  435.     self.contents.clear
  436.     return if s.nil?
  437.     s == 'Header' ? mission_header(s) : mission_description(s)
  438.   end
  439.   #--------------------------------------------------------------------------
  440.   # * Mission Header
  441.   #--------------------------------------------------------------------------
  442.   def mission_header(s)
  443.     fontsize = self.contents.font.size
  444.     self.contents.font.color = system_color
  445.     self.contents.font.size = 16
  446.     s = LiTTleDRAgo::HEADER_MENU
  447.     self.contents.draw_text(0, 0, 315, WLH, LiTTleDRAgo::HEADER_BOARD,1)
  448.     self.contents.draw_text(0, 30, 315, WLH, "#{s[0]} #{s[1]}",0)
  449.     self.contents.draw_text(0, 30, 315, WLH, "#{s[2]}",2)
  450.     self.contents.font.color = normal_color
  451.     self.contents.font.size = fontsize
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # * Mission Description
  455.   #--------------------------------------------------------------------------
  456.   def mission_description(s)
  457.     fontsize = self.contents.font.size
  458.     self.contents.font.size = 16
  459.    
  460.     if s["gambar"]
  461.       g = LiTTleDRAgo::GAMBAR
  462.       bitmap = Cache.picture(s["gambar"])
  463.       src_rect = Rect.new(g[0], g[1], g[2], g[3])
  464.       self.contents.stretch_blt(src_rect, bitmap, bitmap.rect)
  465.     end
  466.     text = [s["deskripsi"], s["variable"], ["MissionAccept",s["judul"]]]
  467.     text[3] = [LiTTleDRAgo::TEXT_VOCAB, $game_variables[text[1][0]]]
  468.    
  469.     (0..text[0].size).each {|i|
  470.        self.contents.draw_text(0, 4+24*i, 284, WLH, text[0][i]) } if text[0]
  471.    
  472.     if text[3][1] >= text[1][1]
  473.       self.contents.font.color = Color.new(0,255,0,255)
  474.       text[5] = text[3][0][3]
  475.     elsif text[3][1] <= (text[1][1]*-1)
  476.       self.contents.font.color = crisis_color
  477.       text[5] = text[3][0][4]
  478.     else
  479.       if $game_self_switches[text[2]]
  480.         self.contents.font.color = Color.new(0,255,255,255)
  481.         text[5] = text[3][0][2]
  482.       else
  483.         text[5] = text[3][0][1]
  484.       end
  485.     end
  486.     self.contents.draw_text(0, 200, 320, WLH, text[5],2)
  487.    
  488.     if $game_self_switches[["MissionReward",s["judul"]]]
  489.       self.contents.draw_text(0, 200, 320, WLH, text[3][0][5],0)
  490.     end
  491.     self.contents.font.color = normal_color
  492.     self.contents.font.size = fontsize
  493.    
  494.    
  495.    
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # * Set Text
  499.   #  text  : character string displayed in window
  500.   #  align : alignment (0..flush left, 1..center, 2..flush right)
  501.   #--------------------------------------------------------------------------
  502.   def set_text(text, align = 0)
  503.     if text != @text or align != @align
  504.       self.contents.clear
  505.       self.contents.font.color = normal_color
  506.       self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
  507.       @text = text
  508.       @align = align
  509.     end
  510.   end
  511. end
  512.  
  513.  
  514. #==============================================================================
  515. # ** Scene_Item
  516. #------------------------------------------------------------------------------
  517. #  This class performs the item screen processing.
  518. #==============================================================================
  519.  
  520. class Scene_Mission < Scene_Base
  521.   #--------------------------------------------------------------------------
  522.   # * Start processing
  523.   #--------------------------------------------------------------------------
  524.   def start
  525.     super
  526.     create_menu_background
  527.     @viewport = Viewport.new(0, 0, 544, 416)
  528.     @item_window = []
  529.     @item_window[0] = Window_Help.new
  530.     @item_window[0].viewport = @viewport
  531.     @item_window[1] = Window_Mission.new(100, 86, 360, 260)
  532.     @item_window[1].viewport = @viewport
  533.     @item_window[1].help_window = @item_window[0]
  534.     @item_window[1].active = false
  535.     @item_window[2] = Window_MissionStatus.new(100, 86, 360, 260)
  536.     @item_window[3] = Window_MissionStatus.new(100, 86, 360, 260)
  537.     @item_window[3].refresh('Header')
  538.     @item_window[3].z -= 400
  539.     @menuback_sprite.z -= 400
  540.     show_target_window(false)
  541.   end
  542.   #--------------------------------------------------------------------------
  543.   # * Termination Processing
  544.   #--------------------------------------------------------------------------
  545.   def terminate
  546.     super
  547.     dispose_menu_background
  548.     @viewport.dispose
  549.     @item_window.each {|i| i ? i.dispose : nil }
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # * Return to Original Screen
  553.   #--------------------------------------------------------------------------
  554.   def return_scene
  555.     $scene = Scene_Map.new
  556.   end
  557.   #--------------------------------------------------------------------------
  558.   # * Update Frame
  559.   #--------------------------------------------------------------------------
  560.   def update
  561.     super
  562.     update_menu_background
  563.     (0..2).each {|w| @item_window[w].update }
  564.     if @item_window[1].active
  565.       update_item_selection
  566.     elsif @item_window[2].active
  567.       update_target_selection
  568.     end
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # * Update Item Selection
  572.   #--------------------------------------------------------------------------
  573.   def update_item_selection
  574.     if Input.trigger?(Input::B)
  575.       Sound.play_cancel
  576.       return_scene
  577.     elsif Input.trigger?(Input::C)
  578.       @item = @item_window[1].item
  579.       if @item != nil && $game_switches[@item["switch"]]
  580.         Sound.play_decision
  581.         determine_item
  582.       else
  583.         Sound.play_buzzer
  584.       end
  585.     end
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # * Confirm Item
  589.   #--------------------------------------------------------------------------
  590.   def determine_item
  591.     show_target_window(true)
  592.   end
  593.   #--------------------------------------------------------------------------
  594.   # * Update Target Selection
  595.   #--------------------------------------------------------------------------
  596.   def update_target_selection
  597.     if Input.trigger?(Input::B)
  598.       Sound.play_cancel
  599.       @item_window[1].refresh    
  600.       show_target_window(false)
  601.     elsif Input.trigger?(Input::C)
  602.       v = [$game_variables[@item["variable"][0]], @item["variable"][1] ]
  603.       if @item == nil
  604.         Sound.play_buzzer
  605.       elsif v[0] >= v[1]
  606.         if !$game_self_switches[["MissionReward",@item["judul"]]]
  607.           Sound.play_decision
  608.           v = Dialog_YesNo.show(true, LiTTleDRAgo::COMMAND_VOCAB[2])
  609.           if v
  610.             $game_self_switches[["MissionReward",@item["judul"]]] = true
  611.             Sound.play_decision
  612.             @item_window[2].refresh(@item)
  613.             $game_temp.common_event_id = @item["commonevent"]
  614.             $scene = Scene_Map.new
  615.           else
  616.             Sound.play_cancel
  617.           end
  618.         else
  619.           Sound.play_buzzer
  620.         end
  621.       elsif v[0] <= (v[1]*-1)
  622.         Sound.play_buzzer
  623.       else
  624.         if !$game_self_switches[["MissionAccept",@item["judul"]]]
  625.           Sound.play_decision
  626.           v = Dialog_YesNo.show(true, LiTTleDRAgo::COMMAND_VOCAB[0])
  627.           if v
  628.             $game_self_switches[["MissionAccept",@item["judul"]]] = true
  629.             Sound.play_decision
  630.             @item_window[1].refresh    
  631.             @item_window[2].refresh(@item)
  632.             show_target_window(false)
  633.           else
  634.             Sound.play_cancel
  635.           end
  636.         else
  637.           Sound.play_decision
  638.           v = Dialog_YesNo.show(true, LiTTleDRAgo::COMMAND_VOCAB[1])
  639.           if v
  640.             $game_self_switches[["MissionAccept",@item["judul"]]] = false
  641.             Sound.play_decision
  642.             @item_window[1].refresh    
  643.             @item_window[2].refresh(@item)
  644.             show_target_window(false)
  645.           else
  646.             Sound.play_cancel
  647.           end
  648.         end    
  649.       end
  650.     end
  651.   end
  652.   #--------------------------------------------------------------------------
  653.   # * Show Target Window
  654.   #     right : Right justification flag (if false, left justification)
  655.   #--------------------------------------------------------------------------
  656.   def show_target_window(value)
  657.     @item_window[1].active = !value
  658.     @item_window[2].visible = value
  659.     @item_window[2].active = value
  660.     if value
  661.       @item_window[2].refresh(@item)
  662.     else
  663.       @viewport.rect.set(0, 0, 544, 416)
  664.       @viewport.ox = 0
  665.     end
  666.   end
  667. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement