This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
First put this in a nnew script in above main:
Trickster's Bar and Game_Bully
Code:
class Window_Base
# define enemy name
def draw_enemy_name(enemy, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, enemy.name)
end
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_location(x,y,w,h)
self.contents.draw_text(x,y,w,h, "Location: " + $game_bully.location.to_s)
end
def draw_BullyStatus
self.contents.font.size = 14
self.contents.draw_text(5,-12,600,32,"Bully Status: ",0)
self.contents.font.size = 12
cx = self.contents.text_size("Bully Status: ").width
x = cx + 10
self.contents.draw_text(x,-11,600,32,$game_bully.bullystatus.to_s + "/2000",0)
self.contents.font.size = 14
end
def draw_slant_bar(x, y, min, max, width = 152, height = 6,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
end
class Game_Bully
attr_accessor :bullystatus
attr_accessor :location
attr_accessor :defaultlocation
attr_accessor :cup
attr_accessor :eup
attr_accessor :might
attr_accessor :enemymight
attr_accessor :maximum
attr_accessor :winstatus
attr_accessor :sprite
def initialize
@bullystatus = 0
@location = "Kirayla Middle School"
@defaultlocation = "Kirayla Middle School"
@cup = 0
@eup = 0
@might = 0
@enemymight = 0
@maximum = 0
@winstatus = 0
end
end
class Interpreter
#--------------------------------------------------------------------------
# * Add to BullyStatus
#--------------------------------------------------------------------------
def s89_add(number)
$game_bully.bullystatus += number
$scene.bully_window.refresh
$scene.bully_window.update
end
def change_location(location)
$game_bully.location = location
$scene.bully_window.refresh
$scene.bully_window.update
end
def change_location_to_default
$game_bully.location = $game_bully.defaultlocation
$scene.bully_window.refresh
$scene.bully_window.update
end
end
#==============================================================================
# Class Scene Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Alias' New Game Method
#--------------------------------------------------------------------------
alias new_game2 command_new_game
#--------------------------------------------------------------------------
# * Adds Difficulty Game Variables
#--------------------------------------------------------------------------
def command_new_game
$game_bully = Game_Bully.new
new_game2
end
end
#==============================================================================
# Scene_Save
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Alias Save Data
#--------------------------------------------------------------------------
alias new_save2 write_save_data
#--------------------------------------------------------------------------
# * Write Save Data
#--------------------------------------------------------------------------
def write_save_data(file)
new_save2(file)
Marshal.dump($game_bully, file)
end
end
#==============================================================================
# Scene_Load
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Alias Read Save Data
#--------------------------------------------------------------------------
alias new_load2 read_save_data
#--------------------------------------------------------------------------
# * Read Save Data
#--------------------------------------------------------------------------
def read_save_data(file)
new_load2(file)
$game_bully = Marshal.load(file)
end
end
Now for the First Minigame... You need it for all of the Others.... Because I used the same method in Every single script. Of course you need to do a little editting try finding $scene.sprite.bitmap = RPG::Cache.picture("youwin") or $scene.sprite.bitmap = RPG::Cache.picture("youlose") and changing youlose and youwin to the Win and Lose Graphics of the minigame.
Test Your Might
Object Try to get your bar all the way up before the Computer:
Test Your Might
Code:
class Scene_Test
attr_accessor :cup
attr_accessor :eup
attr_accessor :maximum
attr_accessor :addtobullystatus
attr_accessor :sprite
def initialize(cup,eup,maximum,addtobullystatus)
@cup = cup
@eup = eup
@addtobullystatus = addtobullystatus
@maximum = maximum
$game_bully.cup = @cup
$game_bully.eup = @eup
$game_bully.maximum = @maximum
end
def main
@spriteset = Spriteset_Map.new
@test_window = Window_Test.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture("youlose")
@sprite.visible = false
# Transition run
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
@test_window.dispose
end
def update
@test_window.refresh
if @sprite.visible == false
$game_bully.enemymight += eup
end
if Input.trigger?(Input::C)
if @sprite.visible == true
if $game_bully.winstatus < 0
$scene = Scene_Gameover.new
return
else
$scene = Scene_Map.new
$game_bully.cup = 0
$game_bully.eup = 0
$game_bully.might = 0
$game_bully.enemymight = 0
$game_bully.maximum = 0
@bully_window = Window_Bully.new
$game_bully.bullystatus += @addtobullystatus
@bully_window.refresh
@bully_window.update
$game_switches[3] = false
return
end
end
$game_bully.might += cup
end
if $game_bully.might == $game_bully.maximum
$game_bully.winstatus += 1
$game_system.map_interpreter.showpictureyouwin
end
if $game_bully.enemymight == $game_bully.maximum
$game_bully.winstatus -= 1
$game_system.map_interpreter.showpictureyoulose
end
end
end
class Window_Test < Window_Base
def initialize
super(240,160,160,160)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 14
self.contents.draw_text(0,14,600,32,"Press C Continually")
self.contents.draw_text(0,28,600,32,"")
self.contents.draw_text(0,44,600,32,"Lose and it's Gameover")
end
def refresh
draw_slant_bar(0, 0, $game_bully.might, $game_bully.maximum, width = 96, height = 4)
draw_slant_bar(0, 12, $game_bully.enemymight, $game_bully.maximum, width = 96, height = 4)
end
end
class Interpreter
def showpictureyouwin
$scene.sprite.dispose
$scene.sprite = Sprite.new
$scene.sprite.visible = true
$scene.sprite.bitmap = RPG::Cache.picture("youwin")
Audio.me_play("Audio/ME/" + "013-Gag02", 100, 150)
#Audio.me_stop
end
def showpictureyoulose
$scene.sprite.dispose
$scene.sprite = Sprite.new
$scene.sprite.visible = true
$scene.sprite.bitmap = RPG::Cache.picture("youlose")
Audio.me_play("Audio/ME/" + "012-Gag01", 100, 150)
#Audio.me_stop
end
end
Now for the second Minigame. It is called a push pull. You try to pull the Bar Up while the Cumputer pulls it down....
Push Pull
Code:
class Scene_Boom
attr_accessor :cup
attr_accessor :eup
attr_accessor :maximum
attr_accessor :addtobullystatus
attr_accessor :sprite
def initialize(cup,eup,maximum,addtobullystatus)
@cup = cup
@eup = eup
@addtobullystatus = addtobullystatus
@maximum = maximum
$game_bully.cup = @cup
$game_bully.eup = @eup
$game_bully.maximum = @maximum
$game_bully.might = $game_bully.maximum / 2
end
def main
@spriteset = Spriteset_Map.new
@boom_window = Window_Boom.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture("youlose")
@sprite.visible = false
# Transition run
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
@boom_window.refresh
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
@boom_window.dispose
end
def update
@boom_window.update
if @sprite.visible == false
$game_bully.might -= @eup
end
if Input.trigger?(Input::C)
if @sprite.visible == true
if $game_bully.winstatus < 0
$scene = Scene_Gameover.new
return
else
$scene = Scene_Map.new
$game_bully.cup = 0
$game_bully.eup = 0
$game_bully.might = 0
$game_bully.enemymight = 0
$game_bully.maximum = 0
@bully_window = Window_Bully.new
$game_bully.bullystatus += @addtobullystatus
@bully_window.refresh
@bully_window.update
$game_switches[3] = false
return
end
end
$game_bully.might += cup
end
if $game_bully.might <= 0
$game_bully.winstatus -= 1
$game_system.map_interpreter.showpictureyoulose
end
if $game_bully.might >= @maximum
$game_bully.winstatus += 1
$game_system.map_interpreter.showpictureyouwin
end
end
end
class Window_Boom < Window_Base
def initialize
super(240,160,160,160)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 14
self.contents.draw_text(0,14,600,32,"Press C Continually")
self.contents.draw_text(0,28,600,32,"")
self.contents.draw_text(0,44,600,32,"Lose and it's Gameover")
end
def refresh
draw_slant_bar(0, 0, $game_bully.might, $game_bully.maximum, width = 96,height = 4)
end
end
Now the Third. It is called the Timed Challenge. Try to get your bar up before the time bar runs down.
Timed Challenge
Code:
class Scene_Timed
attr_accessor :cup
attr_accessor :eup
attr_accessor :eup2
attr_accessor :maximum
attr_accessor :addtobullystatus
attr_accessor :sprite
def initialize(cup,time,maximum,addtobullystatus)
@cup = cup
@eup = time
@eup2 = time
@addtobullystatus = addtobullystatus
@maximum = maximum
$game_bully.cup = @cup
$game_bully.eup = @eup
$game_bully.maximum = @maximum
$game_bully.might = $game_bully.maximum / 2
end
def main
@spriteset = Spriteset_Map.new
@boom_window = Window_Timed2.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture("youlose")
@sprite.visible = false
# Transition run
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
@boom_window.refresh
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
@boom_window.dispose
end
def update
@boom_window.update
if @sprite.visible == false
@eup -= 1
end
if Input.trigger?(Input::C)
if @sprite.visible == true
if $game_bully.winstatus < 0
$scene = Scene_Gameover.new
return
else
$scene = Scene_Map.new
$game_bully.cup = 0
$game_bully.eup = 0
$game_bully.might = 0
$game_bully.enemymight = 0
$game_bully.maximum = 0
@bully_window = Window_Bully.new
$game_bully.bullystatus += @addtobullystatus
@bully_window.refresh
@bully_window.update
$game_switches[3] = false
return
end
end
$game_bully.might += cup
end
if @eup <= 0
$game_bully.winstatus -= 1
$game_system.map_interpreter.showpictureyoulose
end
if $game_bully.might >= @maximum
$game_bully.winstatus += 1
$game_system.map_interpreter.showpictureyouwin
end
end
end
class Window_Timed2 < Window_Base
def initialize
super(240,160,160,160)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 14
self.contents.draw_text(0,14,600,32,"Press C Continually")
self.contents.draw_text(0,28,600,32,"")
self.contents.draw_text(0,44,600,32,"Lose and it's Gameover")
self.contents.draw_text(0,58,600,32,"Get your bar to the end")
self.contents.draw_text(0,72,600,32,"before the Time runs out")
end
def refresh
draw_slant_bar(0, 0, $game_bully.might, $game_bully.maximum, width = 96, height = 4)
draw_slant_bar(0, 12, $scene.eup, $scene.eup2, width = 96, height = 4)
end
end
There are a few errors with them that I'm hoping to fix. The Problem is that if your winstatus variable is more the -1 and you lose it messes up...
But before I press the submit button Here is the RGSS:
For Test Your Might, use this Call Script:
$scene = Scene_Test.new(amount,computeramount,maximum,addto)
amount = The Amount that the bar goes up when player presses C
computeramount = Amount the Computer's bar goes up.
maximum = Maximum Bar Amont
addto = You don't need to worry about this. just put a random number.
For Push Pull
$scene = Scene_Boom.new(amount,computeramount,maximum,addto)
amount = The Amount that the bar goes up when player presses C
computeramount = The Amount the Computer pulls it down.
maximum = Bar Maximum
addto = Put a random Number.
For Timed Challenge:
$scene = Scene_Timed.new(cup,time,maximum,addtobullystatus)
cup = The Amount that the bar goes up when player presses C
time = The Amount of time the player has to finish
maximum = Bar Maximum
addtobullystatus = random number