Group: Member
Posts: 24
Type: Scripter
RM Skill: Skilled
some_person 7/14/10
Introduction Though I'm known on some other RPG maker sites, I've never been active on RPGrevolution much. Consider this me introducing myself as a scripter.
Scripts:
Battle Starts by Troop ID Website link on title screen Side Scroller Movement MP by Elements Seasons Calender System Shop Sound Effects Earthbound Styled Rolling HP After Battle Events
Download:
Battle Starts by Troop ID
CODE
################################################################################ ### Variating battlestarts by troop ID ### Written by; Q ### Requested by; bc gy ################################################################################ ### This script checks the ID of the upcomming troop before stating the battle ### Transition, and plays a different transition based pff different IDS. ### Good for bosses, special troops, ect. ################################################################################ module Q
# Here's where you edit which troops have which battlebacks. # format is like this: # when *ID number*; return *"Battle start image name"*
def self.get_troop_battlestart(troop_id) case troop_id when 1; return "BattleStart" # when ID 1 use "Battlestart" picture when 2; return "BattleStart2" # when ID 2 use "Battlestart2" picture when 3; return "BattleStartRah" # when ID 3 use "BattlestartRah" picture when 7; return "BattleStart2" # when ID 7 use "Battlestart2" picture
else; return "BattleStart" # if the ID isn't stated above use "BattleStart" end end
end
#############################END CUSTOMIZATION################################## class Scene_Map < Scene_Base
############################################################################### ### Website from title screen ### written by: Q, Requested by pelican1015 ### special thanks to Modern Algebra ### Creates an additional option to go to a website from the title screen ### Overwrites methods used in my other simple title screen scripts, so they've ### just been incorporated into here. optionally, of course. ###############################################################################
module Q # don't edit Website_url = "start http://www.google.com" #insert the URL of the website here. # you need to leave the "start " at the begining of it. Also, you probably will # be required to have the full 'http://www.' web address. # be careful with editing this, system commands aren't a good place to mess up # on. It should be fine if you only change the website name though. End_game_on_website = false # do you want the game to close out when the website # is loaded? set to true if you do, false if you don't. Command_window_position = 1 # incorporated feature from my right sided command # window script. Set to 0 if you want the command window on the left side of # the screen. 1 if you want it in it's normal spot. 2 if you want it on the # right side. TEXT_RESIZE = false # my text resizing script incorporated into here. set to # true if you'd like easy manipulating of the title and game's font size/ Text_size_title = 24 # how big do you want the text to be on the title screen?
Text_size_game = 20 # how big do you want the text to be when the game starts? # It'll stay this size the rest of the game if you don't have other scripts # editing it.
Y_pixel_offset = -12 # decided to look at Modern Algebra's version of this # right before I posted mine. Here's a feature he used. I've used it in scripts # that change the hight of the command window before. It's a good to use. # if you don't want, set to -0 or something similar.
end # editing is bad
module Vocab # do not edit
def self.website # do not edit return "Website" # edit the word for 'website' here. end # no
end # no!
#########################END CUSTOMIZATION##################################### # editing is forbidden beyond here. At least if you can't script. If you can # edit away for your liking. ###############################################################################
class Scene_Title < Scene_Base #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super @command_window.update if Input.trigger?(Input::C) case @command_window.index when 0 #New game command_new_game when 1 # Continue command_continue when 2 # Website command_website when 3 # Shutdown command_shutdown end end end
def command_website if Q::End_game_on_website == false Sound.play_decision system(Q::Website_url) else system(Q::Website_url) command_shutdown end end
alias :rada_website_terminate :terminate
def terminate if Q::TEXT_RESIZE == true font.size = Q::Text_size_game end rada_website_terminate end
alias :rada_website_start :start
def start if Q::TEXT_RESIZE == true font.size = Q::Text_size_title end rada_website_start end
end
Side Scroller Movement
CODE
### Quick Snippet by Q, Requested by tobo123 ### Side Scroller movement.
module Q SS_require_switch = true #if you only want this effect sometimes, have it # require a switch to work SS_switch_id = 9 # if above is true, put ID od switch you want to bind it to. end
class Game_Player < Game_Character
#-------------------------------------------------------------------------- # * Processing of Movement via input from the Directional Buttons #-------------------------------------------------------------------------- alias :orig_move_by_input :move_by_input
def move_by_input if Q::SS_require_switch == true #1 if $game_switches[Q::SS_switch_id] == false #2 orig_move_by_input else #2 return unless movable? return if $game_map.interpreter.running? case Input.dir4 #3 when 2; move_lower_right when 8; move_upper_right else; move_right #3 end #3 end #2 else #1 return unless movable? return if $game_map.interpreter.running? case Input.dir4 #4 when 2; move_lower_right when 8; move_upper_right else; move_right #3 end #4 end #1 end #method
#-------------------------------------------------------------------------- # * Move Lower Right #-------------------------------------------------------------------------- def move_lower_right unless @direction_fix @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction) end if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or (passable?(@x+1, @y) and passable?(@x+1, @y+1)) @x += 1 @y += 1 increase_steps @move_failed = false else move_right end end
def move_upper_right unless @direction_fix @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction) end if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or (passable?(@x+1, @y) and passable?(@x+1, @y-1)) @x += 1 @y -= 1 increase_steps @move_failed = false else move_right end end
end
MP by Elements
CODE
################################################################################ ###MP by Elements(MP_by_levels edit) ###Original Code by 332211, Edited by Q ###Requested by: Onyx Tanuki, who also assisted in making these edits. ###Creates Multible(5 or 6) MP types to be used. ### Not perfectly done, and poorly written. I don't feel like fixing this up, ### but I might on request. ################################################################################
# undefined skills will be treated as level 0 skills, with no need to recharge
#the name for each level, 'first level name', 'second level name', '3rd' # feel free to add/remove some if you have a different number of levels
# to accomodate that this won't be used, the drawing method has been updated # using this now requires a space to be after the name. EX. 'Fire ' LEVELNAMES = ['','','','','','', '','','','','','','','','']
Delete_Regular_MP_System = true # true: Mp will disapear (it is advised that all skills* have 0 mp cost) # *monster only skills are the exception # false: Mp won't disapear and skills will function within both systems
Max_MP_Level = 6 # define max spells level
Max_MP_Charges = 99 # define max spell mp
# Items marked with this element will recover mp Recharge_Element = 17 R_Items = { # <items_id> => [<Mp_level>, <quantity>] 21 => [1, 5] }
### These are Onyx Tanuki's formula's. They'll be left for example, but please #don't steal them. if cur_actor_id == 1 #Valedo if mp_level == 1 #Fire n = 4 + (character_level / 5 * 3) elsif mp_level == 2 #water n = 7 + (character_level / 5 * 4) elsif mp_level == 3 #earth n = 1 + (character_level / 9 * 2) elsif mp_level == 4 #wood n = 2 + (character_level / 4 * 3) elsif mp_level == 5 #Metal n = 1 + (character_level / 13 * 2) elsif mp_level == 6 #void n = (character_level / 8) - 25 end elsif cur_actor_id == 2 #Gareth if mp_level == 1 #Fire n = 1 + (character_level / 7 * 2) elsif mp_level == 2 #water n = 1 + (character_level / 5 * 2) elsif mp_level == 3 #earth n = (character_level / 9 * 4) + 2 elsif mp_level == 4 #wood n = 7 + (character_level / 7 * 6) elsif mp_level == 5 #Metal n = 7 + (character_level / 11 * 8) elsif mp_level == 6 #void n = (character_level / 11 * 3) - 25 end elsif cur_actor_id == 3 #Jang if mp_level == 1 #Fire n = 3 + (character_level / 2 * 3) elsif mp_level == 2 #water n = 1 + (character_level / 6) elsif mp_level == 3 #earth n = (character_level / 7 * 2) + 2 elsif mp_level == 4 #wood n = 1 + (character_level / 8 * 3) elsif mp_level == 5 #Metal n = 5 + (character_level / 4 * 3) elsif mp_level == 6 #void n = (character_level / 20 * 3) - 25 end elsif cur_actor_id == 4 #Equus if mp_level == 1 #Fire n = 1 + (character_level / 7 * 2) elsif mp_level == 2 #water n = 4 + (character_level / 9 * 4) elsif mp_level == 3 #earth n = 5 + (character_level / 6 * 5) elsif mp_level == 4 #wood n = 5 + (character_level / 6 * 5) elsif mp_level == 5 #Metal n = 2 + (character_level / 11 * 5) elsif mp_level == 6 #void n = (character_level / 25 * 4) - 25 end elsif cur_actor_id == 5 #Eliyrah if mp_level == 1 #Fire n = 1 + (character_level / 9 * 2) elsif mp_level == 2 #water n = 9 + (character_level / 3 * 4) elsif mp_level == 3 #earth n = 4 + (character_level / 5 * 4) elsif mp_level == 4 #wood n = 9 + (character_level / 3 * 4) elsif mp_level == 5 #Metal n = 2 + (character_level / 11 * 3) elsif mp_level == 6 #void n = (character_level / 13 * 7) - 25 end elsif cur_actor_id == 6 #Crucio if mp_level == 1 #Fire n = 1 + (character_level / 3) elsif mp_level == 2 #water n = 1 + (character_level / 5 * 2) elsif mp_level == 3 #earth n = (character_level / 9 * 4) + 2 elsif mp_level == 4 #wood n = 7 + (character_level / 7 * 6) elsif mp_level == 5 #Metal n = 7 + (character_level / 11 * 8) elsif mp_level == 6 #void n = (character_level / 17 * 3) - 12 end elsif cur_actor_id == 7 #Ferr if mp_level == 1 #Fire n = 1 + (character_level / 3) elsif mp_level == 2 #water n = 1 + (character_level / 5 * 2) elsif mp_level == 3 #earth n = (character_level / 9 * 4) + 2 elsif mp_level == 4 #wood n = 7 + (character_level / 7 * 6) elsif mp_level == 5 #Metal n = 7 + (character_level / 11 * 8) elsif mp_level == 6 #void n = (character_level / 17 * 3) - 12 end elsif cur_actor_id == 8 #Tima if mp_level == 1 #Fire n = 1 + (character_level / 3) elsif mp_level == 2 #water n = 1 + (character_level / 5 * 2) elsif mp_level == 3 #earth n = (character_level / 9 * 4) + 2 elsif mp_level == 4 #wood n = 7 + (character_level / 7 * 6) elsif mp_level == 5 #Metal n = 7 + (character_level / 11 * 8) elsif mp_level == 6 #void n = (character_level / 17 * 3) - 12 end elsif cur_actor_id == 9 #Kurow if mp_level == 1 #Fire n = 1 + (character_level / 3) elsif mp_level == 2 #water n = 1 + (character_level / 5 * 2) elsif mp_level == 3 #earth n = (character_level / 9 * 4) + 2 elsif mp_level == 4 #wood n = 7 + (character_level / 7 * 6) elsif mp_level == 5 #Metal n = 7 + (character_level / 11 * 8) elsif mp_level == 6 #void n = (character_level / 17 * 3) - 12 end end n = [[ 0, n].max, Max_MP_Charges].min return n end end
#============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # This class handles actors. It's used within the Game_Actors class # ($game_actors) and referenced by the Game_Party class ($game_party). #============================================================================== class Game_Actor < Game_Battler
include Mp_by_levels
#-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :max_mp attr_accessor :cur_mp #-------------------------------------------------------------------------- # * Setup (aliased) # actor_id : actor ID #-------------------------------------------------------------------------- alias mp_setup setup def setup(actor_id) mp_setup(actor_id) @max_mp = []; @cur_mp = [] x = 1 until x == Max_MP_Level + 1 @max_mp[x] = get_max_mp(@level, x, actor_id) @cur_mp[x] = @max_mp[x] x += 1 end end #-------------------------------------------------------------------------- # * Level Up #-------------------------------------------------------------------------- alias mp_level_up level_up def level_up mp_level_up @max_mp = [] x = 1 until x == Max_MP_Level + 1 @max_mp[x] = get_max_mp(@level, x, @actor_id) x += 1 end @cur_mp[x] = @max_mp[x] end #-------------------------------------------------------------------------- # * Level Down #-------------------------------------------------------------------------- alias mp_level_down level_down def level_down mp_level_down @max_mp = [] x = 1 until x == Max_MP_Level + 1 @max_mp[x] = get_max_mp(@level, x, @actor_id) x += 1 end end #-------------------------------------------------------------------------- # * Recharge all #-------------------------------------------------------------------------- def recharge_all for i in 1..@max_mp.size @cur_mp[i] = @max_mp[i] end end end
#============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # This class performs battle screen processing. #==============================================================================
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Execute Battle Action: Skill #-------------------------------------------------------------------------- alias mp_execute_action_skill execute_action_skill def execute_action_skill mp_execute_action_skill ml_level = Mp_by_levels::Skill_levels[@active_battler.action.skill.id] ml_cost = Mp_by_levels::Skill_cost[@active_battler.action.skill.id] @active_battler.cur_mp[ml_level] -= ml_cost if !ml_level.nil? end end
#============================================================================== # ** Scene_Skill #------------------------------------------------------------------------------ # This class performs the skill screen processing. #==============================================================================
class Scene_Skill < Scene_Base #-------------------------------------------------------------------------- # * Use Skill (apply effects to non-ally targets) #-------------------------------------------------------------------------- alias mp_use_skill_nontarget use_skill_nontarget def use_skill_nontarget ml_level = Mp_by_levels::Skill_levels[@skill.id] ml_cost = Mp_by_levels::Skill_cost[@skill.id] @actor.cur_mp[ml_level] -= ml_cost mp_use_skill_nontarget end end
#============================================================================== # ** Game_Interpreter #------------------------------------------------------------------------------ # An interpreter for executing event commands. This class is used within the # Game_Map, Game_Troop, and Game_Event classes. #==============================================================================
class Game_Interpreter def recharge_party for m in $game_party.members m.recharge_all end end end
#============================================================================== # ** Game_Battler #------------------------------------------------------------------------------ # This class deals with battlers. It's used as a superclass of the Game_Actor # and Game_Enemy classes. #==============================================================================
class Game_Battler #-------------------------------------------------------------------------- # * Determine if an Item can be Used # user : Item user # item : item #-------------------------------------------------------------------------- alias mp_item_effective? item_effective? def item_effective?(user, item) if item.element_set.include?(Mp_by_levels::Recharge_Element) return true if test_item(user, item) else mp_item_effective?(user, item) end end #-------------------------------------------------------------------------- # * Determine if an Item will charge effectivelly # user : Item user # item : item #-------------------------------------------------------------------------- def test_item(user, item) a = 0 a += 1 a += 1 if user.is_a?(Game_Actor) a += 1 if user.cur_mp[Mp_by_levels::R_Items[item.id][0]] < user.max_mp[Mp_by_levels::R_Items[item.id][0]] return true if a == 3 end #-------------------------------------------------------------------------- # * Apply Item Effects # user : Item user # item : item #-------------------------------------------------------------------------- alias mp_item_effect item_effect def item_effect(user, item) mp_item_effect(user, item) rc_level = Mp_by_levels::R_Items[item.id][0] if item.element_set.include?(Mp_by_levels::Recharge_Element) and user.is_a?(Game_Actor) user.cur_mp[rc_level] += Mp_by_levels::R_Items[item.id][1] while user.cur_mp[rc_level] > user.max_mp[rc_level] user.cur_mp[rc_level] -= 1 end end end #-------------------------------------------------------------------------- # * Determine Usable Skills # skill : skill #-------------------------------------------------------------------------- alias mp_skill_can_use? skill_can_use? def skill_can_use?(skill) if self.is_a?(Game_Actor) a = Mp_by_levels::Skill_levels[skill.id] if !a.nil? b = self.cur_mp[a] c = Mp_by_levels::Skill_cost[skill.id] if b < c return false end end end mp_skill_can_use?(skill) end end
#============================================================================== # ** Window_Skill #------------------------------------------------------------------------------ # This window displays a list of usable skills on the skill screen, etc. #==============================================================================
class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) if Mp_by_levels::Skill_levels[skill.id] == 1 self.contents.font.color = Mp_by_levels::FIRST_COLOR elsif Mp_by_levels::Skill_levels[skill.id] == 2 self.contents.font.color = Mp_by_levels::SECOND_COLOR elsif Mp_by_levels::Skill_levels[skill.id] == 3 self.contents.font.color = Mp_by_levels::THIRD_COLOR elsif Mp_by_levels::Skill_levels[skill.id] == 4 self.contents.font.color = Mp_by_levels::FOURTH_COLOR elsif Mp_by_levels::Skill_levels[skill.id] == 5 self.contents.font.color = Mp_by_levels::FIFTH_COLOR elsif Mp_by_levels::Skill_levels[skill.id]== 6 self.contents.font.color = Mp_by_levels::SIXTH_COLOR end skill = @data[index] if skill != nil rect.width -= 4 enabled = @actor.skill_can_use?(skill) draw_item_name(skill, rect.x, rect.y, enabled) s_level = Mp_by_levels::Skill_levels[skill.id] if s_level.nil? s_level = 0 level = @actor.calc_mp_cost(skill) if level == 0 level = "" else level = sprintf("%s %s", level, $data_system.terms.mp_a) end else c = @actor.cur_mp[s_level]; d = @actor.max_mp[s_level] a = @actor.calc_mp_cost(skill) level = sprintf("%s %s <%s/%s>", a, $data_system.terms.mp_a, c, d) end self.contents.draw_text(rect, level, 2) end end end #============================================================================== # ** Game_Party #------------------------------------------------------------------------------ # This class handles the party. It includes information on amount of gold # and items. The instance of this class is referenced by $game_party. #==============================================================================
class Game_Party < Game_Unit #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias a_jugh_initialize initialize def initialize a_jugh_initialize if !Mp_by_levels::Delete_Regular_MP_System for i in 1...$data_skills.size skill = $data_skills[i]; s_level = Mp_by_levels::Skill_levels[skill.id] $data_skills[i].description = sprintf("Level %s: ", s_level) + skill.description if !s_level.nil? end end end end
if Mp_by_levels::Delete_Regular_MP_System
#============================================================================== # ** Window_Skill #------------------------------------------------------------------------------ # This window displays a list of usable skills on the skill screen, etc. #==============================================================================
class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) skill = @data[index] if skill != nil rect.width -= 4 enabled = @actor.skill_can_use?(skill) draw_item_name(skill, rect.x, rect.y, enabled) s_level = Mp_by_levels::Skill_levels[skill.id] if s_level.nil? s_level = 0 level = "" else c = @actor.cur_mp[s_level]; d = @actor.max_mp[s_level] type = Mp_by_levels::LEVELNAMES[s_level] e = Mp_by_levels::Skill_cost[skill.id] level = sprintf("%s%s", type, e) end if Mp_by_levels::COLORED_COSTS == true if Mp_by_levels::Skill_levels[skill.id] == 1 self.contents.font.color = Mp_by_levels::FIRST_COLOR elsif Mp_by_levels::Skill_levels[skill.id] == 2 self.contents.font.color = Mp_by_levels::SECOND_COLOR elsif Mp_by_levels::Skill_levels[skill.id] == 3 self.contents.font.color = Mp_by_levels::THIRD_COLOR elsif Mp_by_levels::Skill_levels[skill.id] == 4 self.contents.font.color = Mp_by_levels::FOURTH_COLOR elsif Mp_by_levels::Skill_levels[skill.id] == 5 self.contents.font.color = Mp_by_levels::FIFTH_COLOR elsif Mp_by_levels::Skill_levels[skill.id]== 6 self.contents.font.color = Mp_by_levels::SIXTH_COLOR end end self.contents.draw_text(rect, level, 2) end end end
#============================================================================== # ** Window_Base #------------------------------------------------------------------------------ # This is a superclass of all windows in the game. #==============================================================================
class Window_Base < Window #-------------------------------------------------------------------------- # * Draw MP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width = 120) xx = x - 10 a = actor.cur_mp[1] c = actor.cur_mp[2] e = actor.cur_mp[3] g = actor.cur_mp[4] i = actor.cur_mp[5] k = actor.cur_mp[6] m = actor.cur_mp[7] b = actor.max_mp[1] d = actor.max_mp[2] f = actor.max_mp[3] h = actor.max_mp[4] j = actor.max_mp[5] l = actor.max_mp[6] n = actor.max_mp[7] if $scene.is_a?(Scene_Battle) or $scene.is_a?(Scene_Skill) if actor.class.id.between?(Mp_by_levels::LOWEST_THIRD_CLASS_ID, Mp_by_levels::HIGHEST_THIRD_CLASS_ID) self.contents.font.color = Mp_by_levels::FIRST_COLOR self.contents.draw_text(xx, y, 13, 20, a, 0) self.contents.font.color = Mp_by_levels::SECOND_COLOR self.contents.draw_text(xx + 14, y, 13, 20, c, 0) self.contents.font.color = Mp_by_levels::THIRD_COLOR self.contents.draw_text(xx + 28, y, 13, 20, e, 0) self.contents.font.color = Mp_by_levels::FOURTH_COLOR self.contents.draw_text(xx + 42, y, 13, 20, g, 0) self.contents.font.color = Mp_by_levels::FIFTH_COLOR self.contents.draw_text(xx + 56, y, 13, 20, i, 0) self.contents.font.color = Mp_by_levels::SIXTH_COLOR self.contents.draw_text(xx + 70, y, 13, 20, k, 0) else self.contents.font.color = Mp_by_levels::FIRST_COLOR self.contents.draw_text(xx, y, 13, 20, a, 0) self.contents.font.color = Mp_by_levels::SECOND_COLOR self.contents.draw_text(xx + 17, y, 13, 20, c, 0) self.contents.font.color = Mp_by_levels::THIRD_COLOR self.contents.draw_text(xx + 34, y, 13, 20, e, 0) self.contents.font.color = Mp_by_levels::FOURTH_COLOR self.contents.draw_text(xx + 51, y, 13, 20, g, 0) self.contents.font.color = Mp_by_levels::FIFTH_COLOR self.contents.draw_text(xx + 68, y, 13, 20, i, 0) end else cost_row_one_one = sprintf("%s/%s", a, b) cost_row_one_two = sprintf("%s/%s", c, d) cost_row_one_three = sprintf("%s/%s", e, f) cost_row_two_one = sprintf("%s/%s", g, h) cost_row_two_two = sprintf("%s/%s", i, j) cost_row_two_three = sprintf("%s/%s", k, l) if actor.class.id.between?(Mp_by_levels::LOWEST_THIRD_CLASS_ID, Mp_by_levels::HIGHEST_THIRD_CLASS_ID) self.contents.font.color = Mp_by_levels::FIRST_COLOR self.contents.draw_text(x, y, 40, 20, cost_row_one_one, 2) self.contents.font.color = Mp_by_levels::SECOND_COLOR self.contents.draw_text(x + 40, y, 40, 20, cost_row_one_two, 2) self.contents.font.color = Mp_by_levels::THIRD_COLOR self.contents.draw_text(x + 80, y, 40, 20, cost_row_one_three, 2) self.contents.font.color = Mp_by_levels::FOURTH_COLOR self.contents.draw_text(x, y + 18, 40, 20, cost_row_two_one, 2) self.contents.font.color = Mp_by_levels::FIFTH_COLOR self.contents.draw_text(x + 40, y + 18, 40, 20, cost_row_two_two, 2) self.contents.font.color = Mp_by_levels::SIXTH_COLOR self.contents.draw_text(x + 80, y + 18, 40, 20, cost_row_two_three, 2) else self.contents.font.color = Mp_by_levels::FIRST_COLOR self.contents.draw_text(x, y, 40, 20, cost_row_one_one, 2) self.contents.font.color = Mp_by_levels::SECOND_COLOR self.contents.draw_text(x + 40, y, 40, 20, cost_row_one_two, 2) self.contents.font.color = Mp_by_levels::THIRD_COLOR self.contents.draw_text(x + 80, y, 40, 20, cost_row_one_three, 2) self.contents.font.color = Mp_by_levels::FOURTH_COLOR self.contents.draw_text(x + 20, y + 18, 40, 20, cost_row_two_one, 2) self.contents.font.color = Mp_by_levels::FIFTH_COLOR self.contents.draw_text(x + 60, y + 18, 40, 20, cost_row_two_two, 2) end end end #-------------------------------------------------------------------------- # * Draw MP Gauge # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_mp_gauge(actor, x, y, width = 120) end
end
end
class Game_Interpreter #-------------------------------------------------------------------------- # * Recover All #-------------------------------------------------------------------------- def command_314 iterate_actor_id(@params[0]) do |actor| actor.recover_all for i in 1..actor.max_mp.size actor.cur_mp[i] = actor.max_mp[i] end end return true end
end
Seasons Calender System
CODE
################################################################################ ### Season/Calender System ### Written By; Q ### Requested By; dorky106 ### This script allows a Calender type thing to be added to the gold window in ### the menu. It also allows use of the date via switches and variables. ### To add a day, run script... "$game_system.add_day" in an event. ################################################################################
module Vocab # DO NOT EDIT Day = "Day" Spring = "Spring" Summer = "Summer" Fall = "Fall" Winter = "Winter" Year = "Year"
def add_day @day += 1 if @day > 30 @day = 1 @season += 1 if @season > 4 @season = 1 @year +=1 end end if USE_SEASONAL_SWITCHES == true if @season == 1 $game_switches[SPRING_SWITCH] = true $game_switches[SUMMER_SWITCH] = false $game_switches[FALL_SWITCH] = false $game_switches[WINTER_SWITCH] = false end if @season == 2 $game_switches[SPRING_SWITCH] = false $game_switches[SUMMER_SWITCH] = true $game_switches[FALL_SWITCH] = false $game_switches[WINTER_SWITCH] = false end if @season == 3 $game_switches[SPRING_SWITCH] = false $game_switches[SUMMER_SWITCH] = false $game_switches[FALL_SWITCH] = true $game_switches[WINTER_SWITCH] = false end if @season == 4 $game_switches[SPRING_SWITCH] = false $game_switches[SUMMER_SWITCH] = false $game_switches[FALL_SWITCH] = false $game_switches[WINTER_SWITCH] = true end end if USE_DAY_VARIABLE == true $game_variables[DAY_VARIABLE] = @day end if USE_YEAR_VARIABLE == true $game_variables[YEAR_VARIABLE] = @year end end
end
class Window_Base def draw_day cx = contents.text_size(Vocab::Day).width self.contents.font.color = normal_color self.contents.draw_text(x, y, width-cx-2, WLH, value, 2) end end
class Window_Gold < Window_Base def initialize(x, y) if $scene.is_a?(Scene_Menu) super(x, y-46, 160, 106) else super(x, y, 160, WLH + 32) end refresh end
def refresh self.contents.clear if $scene.is_a?(Scene_Menu) draw_currency_value($game_party.gold, 4, 50, 120) draw_day_value($game_system.day, 4, 0, 120) draw_season_value(4, 18, 120) draw_year_value($game_system.year, 4, 34, 120) else draw_currency_value($game_party.gold, 4, 0, 120) end end
def draw_day_value(value, x, y, width) self.contents.font.color = normal_color self.contents.draw_text(x, y, width +4, WLH, $game_system.day, 2) self.contents.font.color = system_color self.contents.draw_text(x, y, width -20, WLH, Vocab::Day, 2) end
def draw_season_value(x, y, width) self.contents.font.color = system_color if $game_system.season == 1 self.contents.draw_text(x, y, width, WLH, Vocab::Spring, 2) end if $game_system.season == 2 self.contents.draw_text(x, y, width, WLH, Vocab::Summer, 2) end if $game_system.season == 3 self.contents.draw_text(x, y, width, WLH, Vocab::Fall, 2) end if $game_system.season == 4 self.contents.draw_text(x, y, width, WLH, Vocab::Winter, 2) end end
def draw_year_value(value, x, y, width) self.contents.font.color = normal_color self.contents.draw_text(x, y, width +4, WLH, $game_system.year, 2) self.contents.font.color = system_color self.contents.draw_text(x, y, width -20, WLH, Vocab::Year, 2) end
end
Shop Sound Effects
CODE
################################################################################ ###Custom Shop Sound Effects V 2.0 ###Written by: Q ###Requested by: Um... I forget... ###Plays different sound effects during the shop scene, similar to RE4 ###May later be upgraded for different sounds in different shops, like in TWEWY ################################################################################
#This script overwrites some sound effects during the shop scene, to have them #return to normal afterwards. set the normal sound you're using in the game here DEFAULT_DECISION_SOUND_EFFECT = RPG::SE.new("Decision1", 80, 100) #for Decisions DEFAULT_DECISION_SHOP_EFFECT = RPG::SE.new("Shop", 80, 100) #for shops # I don't know if the shop sound effect is ever gonna be needed now, but It's # there to return to normal just in case.
# Here's where you set the different sound effects to be used in shops. # when you select purchase Q_PURCHASE_SE = RPG::SE.new("Cow", 80, 100) # when you select sell Q_SELLING_SE = RPG::SE.new("Darkness1", 80, 100) # when you select exit Q_EXIT_SE = RPG::SE.new("Darkness2", 80, 100) # when you select an item to buy Q_BUY_SE = RPG::SE.new("Darkness3", 80, 100) # after you select quanity of the item being bought Q_BUY_DONE_SE = RPG::SE.new("Darkness4", 80, 100) # when you select an item to sell Q_SELL_SE = RPG::SE.new("Decision1", 80, 100) # after you select quanity of the item being sold Q_SELL_DONE_SE = RPG::SE.new("Shop", 80, 100)
alias :qse_update_command_selection :update_command_selection
def update_command_selection $data_system.sounds[1] = RPG::SE.new("Decision1", 0, 100) $data_system.sounds[17] = RPG::SE.new("Shop", 0, 100) if Input.trigger?(Input::C) qse_update_command_selection case @command_window.index when 0 # buy Q_PURCHASE_SE.play when 1 # sell if $game_temp.shop_purchase_only else Q_SELLING_SE.play end when 2 # Quit Q_EXIT_SE.play end end $data_system.sounds[1] = DEFAULT_DECISION_SOUND_EFFECT $data_system.sounds[17] = DEFAULT_DECISION_SHOP_EFFECT end
alias :qse_update_buy_selection :update_buy_selection
def update_buy_selection $data_system.sounds[1] = RPG::SE.new("Decision1", 0, 100) $data_system.sounds[17] = RPG::SE.new("Shop", 0, 100) qse_update_buy_selection if @number_window.active == true Q_BUY_SE.play end $data_system.sounds[1] = DEFAULT_DECISION_SOUND_EFFECT $data_system.sounds[17] = DEFAULT_DECISION_SHOP_EFFECT end
alias :qse_update_sell_selection :update_sell_selection
def update_sell_selection $data_system.sounds[1] = RPG::SE.new("Decision1", 0, 100) $data_system.sounds[17] = RPG::SE.new("Shop", 0, 100) qse_update_sell_selection if @number_window.active == true Q_SELL_SE.play end $data_system.sounds[1] = DEFAULT_DECISION_SOUND_EFFECT $data_system.sounds[17] = DEFAULT_DECISION_SHOP_EFFECT end
alias :qse_decide_number_input :decide_number_input
def decide_number_input $data_system.sounds[1] = RPG::SE.new("Decision1", 0, 100) $data_system.sounds[17] = RPG::SE.new("Shop", 0, 100) qse_decide_number_input case @command_window.index when 0 Q_BUY_DONE_SE.play when 1 # sell Q_SELL_DONE_SE.play end $data_system.sounds[1] = DEFAULT_DECISION_SOUND_EFFECT $data_system.sounds[17] = DEFAULT_DECISION_SHOP_EFFECT end
end
Earthbound Styled Rolling HP
CODE
############################################################################### ### Rolling HP ### written by: Q, part of his dropped attempt to recreate the Earthbound ### Battle System ### Causes HP to roll gradually instead of instantly change ###############################################################################
module Q HP_roll_speed = 1 # speed which HP decreases Rolling_Noise = RPG::SE.new("Knock", 80, 100) MP_roll = false # does MP have rolling effect too? MP_roll_speed = 1 # speed which MP decreases MP_Rolling_Noise = RPG::SE.new("Knock", 80, 100)
OVERWRITE_WAIT_METHOD = true # this will make HP roll even when "wait" is # happening. This is most seen with message pop ups and playing animations. # This will increase lag, and be slightly problematic. Test it out to see # if you want it. May react differently with different battle systems. end
#============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # This class performs battle screen processing. #==============================================================================
class Scene_Battle < Scene_Base
#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias :rolling_hp_update :update def update for actor in $game_party.existing_members #1 if actor.hp_roll != 0 #2 Q::Rolling_Noise.play if actor.hp_roll > 0 #3 if actor.hp_roll >= Q::HP_roll_speed#4 if actor.hp > Q::HP_roll_speed #5 actor.hp -= Q::HP_roll_speed actor.hp_roll -= Q::HP_roll_speed else #5 actor.hp = 0 actor.hp_roll = 0 end #/5 end#/4 else #3 if actor.hp_roll.abs >= Q::HP_roll_speed.abs # 3.5 actor.hp_roll += Q::HP_roll_speed actor.hp += Q::HP_roll_speed else #3.5 actor.hp += Q::hp_roll actor.hp_roll = 0 end #/3.5 end #/3 @status_window.refresh end #2 if actor.mp_roll != 0 Q::MP_Rolling_Noise.play if actor.mp_roll > 0 #3 if actor.mp_roll >= Q::mp_roll_speed#4 if actor.mp > Q::mp_roll_speed #5 actor.mp -= Q::mp_roll_speed actor.mp_roll -= Q::mp_roll_speed else #5 actor.mp = 0 actor.mp_roll = 0 end #/5 end#/4 else #3 if actor.mp_roll.abs >= Q::MP_roll_speed.abs # 3.5 actor.mp_roll += Q::MP_roll_speed actor.mp += Q::MP_roll_speed else #3.5 actor.mp += Q::mp_roll actor.mp_roll = 0 end #/3.5 end #/3 @status_window.refresh end #2
end #1 rolling_hp_update end
if Q::OVERWRITE_WAIT_METHOD == true
def wait(duration, no_fast = false) for i in 0...duration update_basic for actor in $game_party.existing_members #1 if actor.hp_roll != 0 #2 Q::Rolling_Noise.play if actor.hp_roll > 0 #3 if actor.hp_roll >= Q::HP_roll_speed#4 if actor.hp > Q::HP_roll_speed #5 actor.hp -= Q::HP_roll_speed actor.hp_roll -= Q::HP_roll_speed else #5 actor.hp = 0 actor.hp_roll = 0 end #/5 end#/4 else #3 if actor.hp_roll.abs >= Q::HP_roll_speed.abs # 3.5 actor.hp_roll += Q::HP_roll_speed actor.hp += Q::HP_roll_speed else #3.5 actor.hp += Q::hp_roll actor.hp_roll = 0 end #/3.5 end #/3 @status_window.refresh end #2 if actor.mp_roll != 0 Q::MP_Rolling_Noise.play if actor.mp_roll > 0 #3 if actor.mp_roll >= Q::mp_roll_speed#4 if actor.mp > Q::mp_roll_speed #5 actor.mp -= Q::mp_roll_speed actor.mp_roll -= Q::mp_roll_speed else #5 actor.mp = 0 actor.mp_roll = 0 end #/5 end#/4 else # 3 if actor.mp_roll.abs >= Q::MP_roll_speed.abs # 3.5 actor.mp_roll += Q::MP_roll_speed actor.mp += Q::MP_roll_speed else #3.5 actor.mp += Q::mp_roll actor.mp_roll = 0 end #/3.5 end #/3 @status_window.refresh end #/2
end #/1 break if not no_fast and i >= duration / 2 and show_fast? end end
end
end #============================================================================== # ** Game_Battler #------------------------------------------------------------------------------ # This class deals with battlers. It's used as a superclass of the Game_Actor # and Game_Enemy classes. #==============================================================================
class Game_Battler #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :hp_roll attr_reader :mp_roll #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias :rolling_initialize :initialize def initialize rolling_initialize @hp_roll = 0 @mp_roll = 0 end #-------------------------------------------------------------------------- # * Clear Values Added to Parameter #-------------------------------------------------------------------------- def hp_roll=(hp_roll) @hp_roll = hp_roll end
def mp_roll=(mp_roll) @mp_roll = mp_roll end
end
class Game_Actor
def execute_damage(user) if @hp_damage > 0 # Damage is a positive number remove_states_shock # Remove state due to attack end @hp_roll += @hp_damage if Q::MP_roll == true @mp_roll += @mp_damage else self.mp -= @mp_damage end if @absorbed # If absorbing @hp_roll -= @hp_damage if Q::MP_roll == true @mp_roll -= @mp_damage else user.mp += @mp_damage end end end
end
After Battle Events
CODE
################################################################################ ###After Battle Events V 2.5 ###Written by: Q ###Makes it much simpler to have common events for after specific, or general, ###battles, using switches and variables. ### *commented for maximum sensation* ################################################################################
# these options should be store in a module, but I was less script-capable when # I wrote this
# *inserts module*
module Q SWITCH_WHEN_WIN = true # Turn a switch on when battle is won? # I'm setting a value to either true or false here. The # The script will funtion differently with different settings set here. WIN_SWITCH = 2 # If set to true, which switch to turn on? # Same as above, except I'm using a number value. SWITCH_WHEN_ESCAPE = true # Turn a switch on when battle is escaped? ESCAPE_SWITCH = 3 # If set to true, which switch to turn on? SWITCH_WHEN_LOSE = false # Turn a switch on when battle is lost? LOSE_SWITCH = 4 # If set to true, which switch to turn on? USE_TROOP_VARIABLE = true # Store the ID of the troop you fought in a variable? TROOP_VARIABLE = 2 # If set to true, which Variable to set it to? end
##########################End of customization##################################
class Game_Troop < Game_Unit # opening the game_troop class to change stuff.
# A quick explaination on aliases: # An alias basically stores an old definition in a new term. You can then # Redefine the definition and call the old processes by using the set term. ############################
alias abe_setup setup #storing the setup method in abe_setup # I just used "abe" as a shortened for that it's for After Battle Events. def setup(troop_id) #redefining the setup. The troop ID is something sent to #the method when it's called. if Q::USE_TROOP_VARIABLE # start a conditional branch that plays only if # USE_TROOP_VARIABLE is set to true. $game_variables[Q::TROOP_VARIABLE] = troop_id # the game variable you set in # [TROOP_VARIABLE] gets set to the troop_id end # end the 'if USE_TROOP_VARIABLE' conditional branch. abe_setup(troop_id) # call the original setup method. end # end the redefining of the setup method.
end# we're done in Game_Troop, we're closing it up.
class Scene_Battle < Scene_Base # Time to edit Scene_Battle
alias :abe_battle_end :battle_end # Storing battle_end into the abe_battle)end
def battle_end(result) #Redefine The battle_end method # the result is sent when the method is called. It's stored as a number. abe_battle_end(result) # call the original method first. if result == 0 and Q::SWITCH_WHEN_WIN == true # if the result is 0(Win result) and # you have it to turn on a switch when battle is won. $game_switches[Q::WIN_SWITCH] = true # the switch set in WIN_SWITCH is set to true #True and ON are the same thing with switches. end #end this conditional branch. if result == 1 and Q::SWITCH_WHEN_ESCAPE== true #start a new, similar one. $game_switches[Q::ESCAPE_SWITCH] = true end # end it. if result == 2 and Q::SWITCH_WHEN_LOSE == true # another again $game_switches[Q::LOSE_SWITCH] = true end # end it again. end # end the new battle_end Method.
end # And we're done, close up scene_battle
Installation
Under Materials.. above Main.. that's all..
Credits - some_person(Q) - anyone credited in the specific scripts.
Terms and Conditions Don't claim as your own. Tell me if it's gonna be in any big completed games project, or anything commercial, but their allowed to be used for either regardless.
Special Note Forgive my laziness, but It'd take me well over an hour to put all my scripts in this topic. If you'd like access to the rest of them, click the link to my scripting website in my signature.
Edit: I was tired last night, so I didn't transfer as many scripts over as I thought. I've added 2 more noe.
This post has been edited by some_person: Jul 15 2010, 06:31 AM