KaiMonkey's MP types Version 5.0, Now you gunner cant use potions to regain ammo! |
|
|
|
|
Apr 5 2009, 02:34 PM
|

Level 11

Group: Revolutionary
Posts: 193
Type: Scripter
RM Skill: Beginner

|
KaiMonkey's MP types 5.0by KaiMonkeyIntroductionThis template will help you to make a better presentation for your script. This is purely optional but will help to create a standard which in return will help user to quickly find the required info on your script. Features- Change the name of each classes MP - Change the colour to make MP represent anything from stamina to ammo! - Can be diffenrent for every class - Have in increase or decrease on attack or block - Make only the right potions and items regain the right MP (no more gunners getting ammo from potions and mages from clips!) Screenshots version 2  How to UsePost above main, duh.... e Well at the top there is seven configuration lines MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"] MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]] Dont_Have = [2,5] MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0] MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0] MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0] MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0] It looks complex, but don't worry, its very simple First MP_Types repristents the types of Mp for each class, in the order they come in the database. So the first thing in the databases uses RAGE, the second is N/A (see dont_have), but 3rd has holy, 4th uses MP 5th uses nothing (again see dont_have). The 6th uses DARK!, and the last two use EG again. Make sence? Good. Now MP_Colour (English spelling, sorry  ) this is quite complex, but it just shows the two colours in the bar, the first one fading into the second one. If you want a certain colour Look at the part of you window skin that looks abit like  Now, The top one (white) is 0, the one next to that is 1, 2 ,3 ,4 ,5 and once a new row starts you just read across like reading a page of a book! Easy? Well once you worked out the colors you want, you put them in, in the same place as they are in MP_Types. So EG is 18,10, which is Red fading into lighter red, MP, is 22,23 which is the normal blues, and DARK is 15,19, which is black and grey! Here are some simple colour samples to use if you don't want to work it out. These wont work with all WindowSkins! Blue [22,23] Red [18,10] Black [15,19] Green [3,11] White/grey [0,8] Pink/purple [30,31] Also make sure they all have commars after them exept the last one!  Any problems post those three lines here and I'll sort it out! Version 2 helpthe new line Dont_Have = [2,5] is simply the list of classes' ids that their MP is never shown. When you wright their MP_Type, but "N/A" , "None" or just "" and for MP_Colour, put anything it doesn't matter. In this case classes 2 and 5 don't show anything, exept their MP_Type! Version 3 helpThe new line MP_TO_DECREASE_Attacking = [5,0,5,0,0,0,0,0] this is a list of all classes, and how much to decrese the "MP" (or ammo or energy) by when they attack, to say they don't lost any, just put 0. On this class 1 and 3 lose 5 every attack and no other classes lose any thing! this can be used to represent ammo and such. Version 4 helpThen theres MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0] this is a list of all classes (in order they are in in the database) and how much there "MP" (or ammo, or enegy) is decreased when the user blocks. So the first class, loses 15 when they block, this can be used to represent rage. MP_TO_INCREASE_Blocking works just like Decreaing, expept makes it higher, so MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0] means that the 3rd class gains 5 "mp" when ever they guard. MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0] this works just works like the MP_TO_DECREASE_Attacking , expets adds, so the first class gains 5 "mp" whenever they attack, this can also be used as rage. Version 5 help (wow)New feature is setting up the potions.This is easy, just look at the part where it says $Potions_effect ={ # item id => [list of classes] # so 5 => [1,3] means class 1 and 3 can use item 5 4 => [4], 21 => [1,7,8], 22 => [3], 23 => [6] } As it states, you can set up potions that only heals MP for monks and preasts, and stop charactures with no MP drinking potions! ScriptCODE MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"] MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]] Dont_Have = [2,5] MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0] MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0] MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0] MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0] #####Potion config############# $Potions_effect ={ # item id => [list of classes] # so 5 => [1,3] means class 1 and 3 can use item 5 4 => [4], 21 => [1,7,8], 22 => [3], 23 => [6] } 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) have_or_not = 0 work = 0 while have_or_not == 0 if actor.class.id == Dont_Have[work] have_or_not = 1 break else work += 1 if work == Dont_Have.size break end end end if have_or_not == 1 final_word = MP_Types[actor.class.id - 1] self.contents.draw_text(x, y, 30, WLH, final_word) else draw_actor_mp_gauge(actor, x, y, width) self.contents.font.color = system_color final_word = MP_Types[actor.class.id - 1] self.contents.draw_text(x, y, 30, WLH, final_word) self.contents.font.color = mp_color(actor) last_font_size = self.contents.font.size xr = x + width if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 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) gw = width * actor.mp / [actor.maxmp, 1].max gc1 = mp_gauge_color1(actor) gc2 = mp_gauge_color2(actor) self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) end #-------------------------------------------------------------------------- # * Get MP Gauge Color 1 #-------------------------------------------------------------------------- def mp_gauge_color1(actor) return text_color(MP_Colour[actor.class.id - 1][0]) end #-------------------------------------------------------------------------- # * Get MP Gauge Color 2 #-------------------------------------------------------------------------- def mp_gauge_color2(actor) return text_color(MP_Colour[actor.class.id - 1][1]) end end ####################### # CREDIT TO KAIMONKEY # #######################
class Scene_Battle < Scene_Base def update_item_selection @item_window.active = true @item_window.update @help_window.update if Input.trigger?(Input::B) Sound.play_cancel end_item_selection elsif Input.trigger?(Input::C) @item = @item_window.item if @item != nil $game_party.last_item_id = @item.id end if $Potions_effect[@item.id] != nil if $game_party.item_can_use?(@item)&& $Potions_effect[@item.id].include?(@active_battler.class.id) Sound.play_decision determine_item else Sound.play_buzzer end else if $game_party.item_can_use?(@item) Sound.play_decision determine_item else Sound.play_buzzer end end end end def execute_action_attack if MP_TO_DECREASE_Attacking[@active_battler.id - 1] != nil if @active_battler.mp >= MP_TO_DECREASE_Attacking[@active_battler.class.id - 1] text = sprintf(Vocab::DoAttack, @active_battler.name) @message_window.add_instant_text(text) targets = @active_battler.action.make_targets display_attack_animation(targets) wait(20) for target in targets target.attack_effect(@active_battler) display_action_effects(target) end @active_battler.mp -= MP_TO_DECREASE_Attacking[@active_battler.class.id - 1] else text1= " hasn't enough " text = @active_battler.name + text1 + MP_Types[@active_battler.class.id - 1] + " to attack!" @message_window.add_instant_text(text) wait(200) end if MP_TO_INCREASE_Attacking[@active_battler.class.id - 1] != nil #~ p @active_battler.name #~ p @active_battler.mp #~ p MP_TO_INCREASE_Attacking[@active_battler.class.id - 1] text = sprintf(Vocab::DoAttack, @active_battler.name) @message_window.add_instant_text(text) targets = @active_battler.action.make_targets display_attack_animation(targets) wait(20) for target in targets target.attack_effect(@active_battler) display_action_effects(target) end @active_battler.mp += MP_TO_INCREASE_Attacking[@active_battler.class.id - 1] #~ p @active_battler.mp #~ p MP_TO_INCREASE_Attacking[@active_battler.id - 1] end else text = sprintf(Vocab::DoAttack, @active_battler.name) @message_window.add_instant_text(text) targets = @active_battler.action.make_targets display_attack_animation(targets) wait(20) for target in targets target.attack_effect(@active_battler) display_action_effects(target) end end end #~ def execute_action_guard if MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] != nil if MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] != 0 @active_battler.mp += MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] text = sprintf(Vocab::DoGuard, @active_battler.name) @message_window.add_instant_text(text) wait(45) text = "So " + @active_battler.name + "'s " + MP_Types[@active_battler.class.id - 1] + " increased!" @message_window.add_instant_text(text) wait(45) elsif MP_TO_INCREASE_Blocking[@active_battler.id - 1] != 0 @active_battler.mp -= MP_TO_DECREASE_Blocking[@active_battler.class.id - 1] text = sprintf(Vocab::DoGuard, @active_battler.name) @message_window.add_instant_text(text) wait(45) text = "So " + @active_battler.name + "'s " + MP_Types[@active_battler.class.id - 1] + " was Lost!" @message_window.add_instant_text(text) wait(45) end else text = sprintf(Vocab::DoGuard, @active_battler.name) @message_window.add_instant_text(text) wait(45) end end end
#~ #============================================================================= #~ # ** Scene_Item #~ #------------------------------------------------------------------------------ #~ # This class performs the item screen processing. #~ #==============================================================================
class Scene_Item < Scene_Base def determine_target used = false if @item.for_all? for target in $game_party.members target.item_effect(target, @item) used = true unless target.skipped end else $game_party.last_target_index = @target_window.index target = $game_party.members[@target_window.index] class_needed = $Potions_effect[@item.id] if class_needed.include?(target.class.id) target.item_effect(target, @item) used = true unless target.skipped end end if used use_item_nontarget else Sound.play_buzzer end end end FAQQ: Who should i credit? A: KaiMonkey Q: I'm finding it hard to configure, can you do it for me? A: Of coause (spelt wrong <_< ) Credit and Thanks - KaiMonkey - BigEd, for annoying me so much I starting scripting.....
This post has been edited by kaimonkey: Jun 24 2009, 05:49 AM
|
|
|
|
|
|
|
|
|
Apr 5 2009, 11:42 PM
|

What did you expect...

Group: Revolutionary
Posts: 461
Type: Developer
RM Skill: Intermediate

|
No suggestions, no questions, this script is perfect!!
P.S Yay I'm quoted
__________________________
 Check out my project http://www.rpgrevolution.com/forums/index....showtopic=29698[Show/Hide] I thought my sig was to big so... Clicky clicky  I taste a bit like Almonds. Mmm, the taste of almonds - anathema to many with nut allergies, and a bad sign for many more, as my taste is not unlike that of cyanide. Am I good or am I poison? A risky thing to guess about. What Flavour Are You? What Mystical creature are you? Pegasus  You are a shy, night time person and you are very gentle and soft hearted. You are like the opposite from your cousin the unicorn. Which Final Fantasy Character Are You?Final Fantasy 7Cna yuo raed tihs? Olny 55% of plepoe can. I cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! fi yuo cna raed tihs, palce it in yuor siantugre.
 Your answers suggest you are a Strategist The four aspects that make up this personality type are:  Summary of Strategists * Quiet, easy-going and intellectually curious * Use logical, objective thinking to find original solutions to problems * Think of themselves as bright, logical and individualistic * May be impractical, forgetting practical issues, such as paying bills or doing the shopping More about Strategists Strategists are quiet people who like to get to the heart of tough problems on their own and come up with innovative solutions. They analyse situations with a sceptical eye and develop ways of measuring everything, including themselves. Strategists are the group most likely to say they are unhappy in their job, according to a UK survey. Strategists are generally easy-going. They are intellectually curious and enjoy abstract ideas. Sometimes they like thinking of a solution to a problem more than taking practical steps to solve it. In situations where they can't use their talents, are unappreciated, or not taken seriously, Strategists may become negatively critical or sarcastic. Under extreme stress, Strategists could be prone to inappropriate, tearful or angry outbursts. Strategists may be insensitive to the emotional needs of others or how their behaviour impacts the people around them.
|
|
|
|
|
|
|
|
|
Apr 6 2009, 12:02 AM
|

Level 11

Group: Revolutionary
Posts: 193
Type: Scripter
RM Skill: Beginner

|
QUOTE (breadlord @ Apr 6 2009, 08:42 AM)  No suggestions, no questions, this script is perfect!!
P.S Yay I'm quoted  Um... Well thats boring... I might do the same for HP, incase..... nah that wont work.... Im bored *checks script requests*
|
|
|
|
|
|
|
|
|
Apr 6 2009, 11:53 PM
|

Level 11

Group: Revolutionary
Posts: 193
Type: Scripter
RM Skill: Beginner

|
QUOTE (jens009 @ Apr 7 2009, 04:37 AM)  Nice script. =]. Out of curiosity, what happens if the number of classes does not correspond to the number of entries in the list of MP_Types and MP_Colour? Do you get an error then? You would as it all works with a arrays, it would return nill, and you can't find the nill'th in another array, so big fat ERROR!
|
|
|
|
|
|
|
|
|
Apr 10 2009, 05:53 AM
|
Making a Comeback

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate

|
What an ingenious idea! please post it!! This will be probably the easiest ammunition script out there! Wonderful job, KaiMonkey! Can't wait for you to post it!
~Miget man12
__________________________
By the way:   I'm bored because it's summer so I decided to drop by for a bit.
|
|
|
|
|
|
|
|
|
Apr 10 2009, 05:56 AM
|

Level 11

Group: Revolutionary
Posts: 193
Type: Scripter
RM Skill: Beginner

|
Then wait no longer! CODE MP_Types = ["EG","N/A","HOLY","MP","MP","DARK","EG","EG"] MP_Colour = [[18,10],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]] Dont_Have = [2,5] MP_TO_DECREASE = [5,0,5,0,0,0,0,0]
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) have_or_not = 0 work = 0 while have_or_not == 0 if actor.class.id == Dont_Have[work] have_or_not = 1 break else work += 1 if work == Dont_Have.size break end end end if have_or_not == 1 final_word = MP_Types[actor.class.id - 1] self.contents.draw_text(x, y, 30, WLH, final_word) else draw_actor_mp_gauge(actor, x, y, width) self.contents.font.color = system_color final_word = MP_Types[actor.class.id - 1] self.contents.draw_text(x, y, 30, WLH, final_word) self.contents.font.color = mp_color(actor) last_font_size = self.contents.font.size xr = x + width if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 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) gw = width * actor.mp / [actor.maxmp, 1].max gc1 = mp_gauge_color1(actor) gc2 = mp_gauge_color2(actor) self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) end #-------------------------------------------------------------------------- # * Get MP Gauge Color 1 #-------------------------------------------------------------------------- def mp_gauge_color1(actor) return text_color(MP_Colour[actor.class.id - 1][0]) end #-------------------------------------------------------------------------- # * Get MP Gauge Color 2 #-------------------------------------------------------------------------- def mp_gauge_color2(actor) return text_color(MP_Colour[actor.class.id - 1][1]) end end ####################### # CREDIT TO KAIMONKEY # ####################### class Scene_Battle def execute_action_attack #~ p @active_battler.name #~ p @active_battler.mp #~ p MP_TO_DECREASE[@active_battler.id - 1] #~ if @active_battler.mp = MP_TO_DECREASE[@active_battler.id -1] text = sprintf(Vocab::DoAttack, @active_battler.name) @message_window.add_instant_text(text) targets = @active_battler.action.make_targets display_attack_animation(targets) wait(20) for target in targets target.attack_effect(@active_battler) display_action_effects(target) end @active_battler.mp -= MP_TO_DECREASE[@active_battler.id - 1] #~ #~ else #~ text1= "Not enough " #~ text = text1 + MP_Types[@active_battler.id - 1] #~ @message_window.add_instant_text(text) #~ end #~ p "after" + @active_battler.name #~ p @active_battler.mp #~ p MP_TO_DECREASE[@active_battler.id - 1] end end MP_TO_DECREASE = [5,0,5,0,0,0,0,0] this is a list of all classes, and how much to decrese the "MP" (or ammo or health) by when they attack, to say they don't lost any, just put 0. On this class 1 and 3 lose 5 every attack and no other classes lose any thing! Thankyou!
|
|
|
|
|
|
|
|
|
Apr 12 2009, 03:00 PM
|

L Did you know? Death gods... only eat apples

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled

|
QUOTE (kaimonkey @ Apr 12 2009, 03:05 PM)  Well what scrips do people want, if no one gives a monkeys peanuts about the new version, do people only care about how stupid mastermind 29 year olds do three billion page scripts in there sleep but couldn't care less about when a small child, who pours there heart into learing somthing. Well what do you want, do you want me to just go away until Im so amazing that I cam make the best scripts in my sleep, does no one care atall about anyone who tring to learn somthing new, and only cares about those people who can script in there sleep, well someone just post here and tell to go away if im so bad at coding, if no ones going to bother even posting 1 one! I dont know, "thx" three letters too much for a days work, or maybe the fact that it took me a whole day when Kylock or Pim or whoever could do it in seconds. Well I don't care! Or maybe the reason no-one posts is because my scripts don't have 100's or errors in that people tell me about! MAYBE,JUST MAYBY, MY SCRIPTS DO WHAT THEY ARE TRYING TO DO AND DON'T HAVE A HUDRED BUGS! Kai, there's no need to be outraged like that. It is true that you are just learning scripting. However, I do think your scripts are wonderful. They are simple and easy to use. Short and sweet. =]. I'm kind of amazed that you learned scripting so quick! I remember a few months back you were asking for support. Now look at you, you're on your own making custom scripts. Excellent job. =D Now, I'm sure nobody wants you out of here. Every scripter we have in RRR should be treasured. So in a way, you're a treasure too. If your scripts don't get enough attention, so what? Your script did what it was supposed to do. It didn't have any bugs or issues like those complicated scripts. Like I said, I enjoy your short and simple scripts. You don't have to be amazing. No, not at all. People might not be appreciative right now, but trust me. This will come in handy for someone out there. They might find this script really useful. Take me for example. I enjoy learning new tricks with RGSS. I didn't know you could use the colors on the system graphic to create your own gradient. That code snippet will be useful for me in the future. Heck, you just saved me a lot of time trying to figure out how to integrate different types of MP bars to different classes. This knowledge will be useful for me one way or another. So don't be discouraged. Every script is useful. Besides, your script does what it's suppose to do.
__________________________
My RMXP Project:  Farewell RRR. =]
|
|
|
|
|
|
|
|
|
May 16 2009, 08:57 AM
|

Level 18

Group: Revolutionary
Posts: 368
Type: None
RM Skill: Undisclosed

|
Hey, Kaimonkey, I am having a problem when I am trying to use this script in conjunction with Yanfly's Interface Fix script, do you think you could fix it? Here's the script... CODE #=============================================================================== # # Yanfly Engine RD - Interface Fix # Last Date Updated: 2009.04.23 # Level: Easy # # Redone the drawing fixes from the prototype version for the current Yanfly # Engine. This one includes all the stuff you've seen before in the other fix # but this time, HP and MP bars that are below their base HP and base MP will # show another shade to indicate how much of them were shaved off. This also # makes a better check for what to draw and reduce the overall bitmap overload # from the interface itself. # # Status effects with an icon ID of zero will now be omitted. This is the # default clear icon and shouldn't have anything in its place anyway. States # with this empty icon will no longer clog up the limited area which states # can be shown. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.04.23 - Improved display for 0 MaxMP. # o 2009.04.17 - Started script. #=============================================================================== # Instructions #=============================================================================== # # Nothing to instruct, really. Just input this script somewhere and let it run # its stuff. Adjust the values down below for quicker access to text colours. # #=============================================================================== # # Compatibility # - Overwrites: Window_Base, *_color, draw_actor_state # - Overwrites: Window_Base, draw_actor_hp_gauge, draw_actor_mp_gauge # #===============================================================================
$imported = {} if $imported == nil $imported["InterfaceFix"] = true
module YE module FIX module TEXT # This affects various colours used by the ingame system. NORMAL = 0 # This is the normal text colour. SYSTEM = 16 # This is the system text colour. CRISIS = 17 # This is the critical HP colour. LOW_MP = 17 # This is the low MP colour. KNOCKOUT = 18 # This is the knocked out colour. BACK_HP = 19 # This is the gauge background colour for HP. BACK_MP = 19 # This is the gauge background colour for HP. EXHAUST = 7 # This is the exhaust colour. HPGAUGE1 = 20 # This is the first HP gauge colour. HPGAUGE2 = 21 # This is the second HP gauge colour. MPGAUGE1 = 23 # This is the first MP gauge colour. MPGAUGE2 = 24 # This is the second MP gauge colour. POWER_UP = 24 # This is the equips boost a stat colour. POWER_DN = 25 # This is the equips nerf a stat colour. end #module TEXT module DRAW # This affects when crisis level HP and low MP colours appear. HP_UNDER = 25 # If Current HP is under this percent. MP_UNDER = 25 # If Current MP is under this percent. GAUGE_HEIGHT = 6 # This adjusts the gauge height. end #module DRAW end # module FIX end # module YE
#=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #===============================================================================
#============================================================================== # Window_Base #==============================================================================
class Window_Base < Window
#-------------------------------------------------------------------------- # text colour overwrites #-------------------------------------------------------------------------- def normal_color; return text_color(YE::FIX::TEXT::NORMAL); end def system_color; return text_color(YE::FIX::TEXT::SYSTEM); end def crisis_color; return text_color(YE::FIX::TEXT::CRISIS); end def low_mp_color; return text_color(YE::FIX::TEXT::LOW_MP); end def knockout_color; return text_color(YE::FIX::TEXT::KNOCKOUT); end def gauge_back_color; return text_color(YE::FIX::TEXT::BACK_HP); end def gauge_back_color_mp; return text_color(YE::FIX::TEXT::BACK_MP); end def exhaust_color; return text_color(YE::FIX::TEXT::EXHAUST); end def hp_gauge1_color; return text_color(YE::FIX::TEXT::HPGAUGE1); end def hp_gauge2_color; return text_color(YE::FIX::TEXT::HPGAUGE2); end def mp_gauge1_color; return text_color(YE::FIX::TEXT::MPGAUGE1); end def mp_gauge3_color; return text_color(YE::FIX::TEXT::MPGAUGE2); end def power_up_color; return text_color(YE::FIX::TEXT::POWER_UP); end def power_down_color; return text_color(YE::FIX::TEXT::POWER_DN); end #-------------------------------------------------------------------------- # hp_colour and mp_colour #-------------------------------------------------------------------------- def hp_color(actor) return knockout_color if actor.hp == 0 per = YE::FIX::DRAW::HP_UNDER return crisis_color if actor.hp < (actor.maxhp * per / 100) return normal_color end def mp_color(actor) per = YE::FIX::DRAW::MP_UNDER return low_mp_color if actor.mp < (actor.maxmp * per / 100) return normal_color end #-------------------------------------------------------------------------- # Draw HP Gauge #-------------------------------------------------------------------------- def draw_actor_hp_gauge(actor, x, y, width = 120, height = nil) actor.hp = actor.maxhp if actor.hp > actor.maxhp gc0 = gauge_back_color gc1 = hp_gauge_color1 gc2 = hp_gauge_color2 if height == nil gh = YE::FIX::DRAW::GAUGE_HEIGHT else gh = height end gy = y + WLH - 8 - (gh - 6) if actor.maxhp < actor.base_maxhp and actor.base_maxhp > 0 gb = width * actor.maxhp / actor.base_maxhp self.contents.fill_rect(x, gy, width, gh, exhaust_color) else gb = width end self.contents.fill_rect(x, gy, gb, gh, gc0) if actor.maxhp <= 0 if actor.base_maxhp <= 0 gw = width else gw = 0 end else gw = gb * actor.hp / actor.maxhp self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2) end end #-------------------------------------------------------------------------- # Draw MP Gauge #-------------------------------------------------------------------------- def draw_actor_mp_gauge(actor, x, y, width = 120, height = nil) actor.mp = actor.maxmp if actor.mp > actor.maxmp gc0 = gauge_back_color_mp gc1 = mp_gauge_color1 gc2 = mp_gauge_color2 if height == nil gh = YE::FIX::DRAW::GAUGE_HEIGHT else gh = height end gy = y + WLH - 8 - (gh - 6) if actor.maxmp < actor.base_maxmp and actor.base_maxmp > 0 gb = width * actor.maxmp / actor.base_maxmp self.contents.fill_rect(x, gy, width, gh, exhaust_color) else gb = width end self.contents.fill_rect(x, gy, gb, gh, gc0) if actor.maxmp <= 0 if actor.base_maxmp <= 0 gw = width else gw = 0 end else gw = gb * actor.mp / actor.maxmp end self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2) end #-------------------------------------------------------------------------- # Draw State #-------------------------------------------------------------------------- def draw_actor_state(actor, x, y, width = 96) count = 0 for state in actor.states unless state.icon_index == 0 draw_icon(state.icon_index, x + 24 * count, y) count += 1 break if (24 * count > width - 24) end end end end #end Window_Base
#=============================================================================== # # END OF FILE # #===============================================================================
This post has been edited by Octople Threat: May 16 2009, 08:57 AM
__________________________
I'm mostly a databaser... O.o
|
|
|
|
|
|
|
|
|
May 26 2009, 02:07 PM
|

Level 6

Group: Member
Posts: 80
Type: Writer
RM Skill: Intermediate

|
-Snip-
This post has been edited by Okamisolaris: Aug 29 2012, 05:51 PM
__________________________
Years later i return and this place is still the same... This place will never get less awesome!
|
|
|
|
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|