diablosbud
Member
I am using Chaosg1's Test your Might Minigame and I need a little bit of help getting it to fail. The problem is every time I fail it for some reason causes me to pass. Here is my script:
No it is not the fact that I renamed the Class I made sure I put in "$scene = Mining.new(time,increase,decrease)". Here is my conditional branch's script line "$test_passed = true". But every time I fail it makes me pass. I have tried adding a conditional branch for "$test_passed = false" but it still no matter what I do forces my pass. Could someone please help me setup this script?
EDIT: Oh, yes this is for XP.
Code:
#==============================================================================
# Script Test_Might
#
# By: Chaosg1
# Version : 1.0
# Date :13-09-2006
#==============================================================================
class Mining
 #--------------------------------------------------------------------------
 # * Main - Handles drawing/disposing windows and the main loop
 #--------------------------------------------------------------------------
 def initialize(time,increase,decrese)
  $test_passed = false
  @window_status = Window_Base.new(0,0 ,160,160)
  @time = time + 4
  @decrease = decrese
  @increase = (increase*5) * $game_party.actors[0].str/100 + $game_party.actors[0].int/100
  @might_value = 0
  @window_status.contents = Bitmap.new(@window_status.width - 32, @window_status.height - 32)
  @window_status.opacity = 0
 end
 #--------------------------------------------------------------------------
 # * Main
 #--------------------------------------------------------------------------
 def main
  @spriteset_map = Spriteset_Map.new
  Graphics.transition
  # Main loop
  loop do
   # Update game screen
   Graphics.update
   # Update input information
   Input.update
   # Frame update
   update
   #refresh
   refresh
   # Abort loop if screen is changed
   if $scene != self
    break
   end
  end
  # Prepare for transition
  Graphics.freeze
  # Dispose of windows
  @window_status.dispose
  @spriteset_map.dispose
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
  @total_sec = Graphics.frame_count / Graphics.frame_rate
  @window_status.contents.clear
  @window_status.contents.draw_text(12,0,60,32,"Time Left:",2)
  @window_status.contents.draw_text(72,0,30,32,@time.to_s,2)
  @window_status.contents.draw_text(20,25,60,32,"Mining",2)
  @window_status.draw_gradient_bar(0, 60, @might_value, 1000, "021-Metallic02", width = nil, height = nil, hue = 0, back = "021-Metallic02", back2 = "022-Metallic03")
 end
 #--------------------------------------------------------------------------
 # * Update
 #--------------------------------------------------------------------------
 def update
  if @time <= 0 and @might_value < 800
   $scene = Scene_Map.new
   $game_system.se_play($data_system.buzzer_se)
  elsif @might_value > 800 and @time > 0
   $scene = Scene_Map.new
   $test_passed = true
   return
  end
  @might_value -= @decrease if @might_value > 0 and @might_value < 999
  if Input.trigger?(Input::C)
   @might_value += @increase
  end
  @spriteset_map.update
  if Graphics.frame_count / Graphics.frame_rate != @total_sec
   refresh
   @time -=1
  end
 end
end
No it is not the fact that I renamed the Class I made sure I put in "$scene = Mining.new(time,increase,decrease)". Here is my conditional branch's script line "$test_passed = true". But every time I fail it makes me pass. I have tried adding a conditional branch for "$test_passed = false" but it still no matter what I do forces my pass. Could someone please help me setup this script?
EDIT: Oh, yes this is for XP.