Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> ASCIIgod rename MP Vocab each class Lv:3, an easier and cleaner code because you deserve it
ASCIIgod
post Feb 22 2012, 03:50 AM
Post #1


Demonic God of Snippets of Doom +10
Group Icon

Group: Revolutionary
Posts: 271
Type: Scripter
RM Skill: Intermediate




ASCIIgod rename MP







INTRODUCTION

okay so i was amaze on how kaimonkey's MP script. the way of having different MP per class... however, i was expecting that it is still the same mp just renamed vocab mp and vocab mp_a... so why not make it quite simplier without the different potion usage...

how to use
so how to use it? you can refer to my other scripts but to say it here, i uses hash most for the modules... so quite easy to use...

credit goes to me and some to kaimonkey for the idea...

here comes the script
Scripts
Copy this into a new place on your scripts... preferable below all...

script

CODE
#ASCIIgod rename MP Vocab each class Lv:3
#
# a simpler MP rename script without the same function as the one in the net
#
# Lv:1 = Initial coding. Name Functions
# Lv:2 = choose from 2 characters or name
# Lv:3 = recoulor gauges depending on what you chooses
################################################################################

module ASCIIGOD
  module RENAME_MP
    
    #Format::Class_id => "name"
    NAME_MP_CLASS =
    {
      1 => "Mana",
      2 => "Tech",
      3 => "Mana",
      4 => "Mana",
      5 => "Tech",
      6 => "Mana",
      7 => "Mana",
      8 => "Mana",
      9 => "Chi",
      10 => "Tech",
      11 => "Mana",
      12 => "Power",
      13 => "Power",
      14 => "Rune",
      15 => "Bond",
      16 => "Sleight",
      17 => "Sleight",
      18 => "Sleight",
      19 => "Mana",
      20 => "Mana",
    }
    
    #Usage::1 = full name, 0 = abbreviation
    TYPE_NAME = 0
    
    #Format::Class_id => "abbreviation"
    NAME_MP_CLASS_A =
    {
      1 => "Mp",
      2 => "Tp",
      3 => "Mp",
      4 => "Mp",
      5 => "Tp",
      6 => "Mp",
      7 => "Mp",
      8 => "Mp",
      9 => "Cp",
      10 => "Tp",
      11 => "Mp",
      12 => "Pp",
      13 => "Pp",
      14 => "Rp",
      15 => "Bp",
      16 => "Sp",
      17 => "Sp",
      18 => "Sp",
      19 => "Mp",
      20 => "Mp",
    }
    
    GAUGE_COULOR_1 =
    {
      1 => 22,
      2 => 24,
      3 => 26,
      4 => 28,
      5 => 30,
      6 => 32,
      7 => 34,
      8 => 36,
      9 => 38,
      10 => 40,
      11 => 42,
      12 => 44,
      13 => 46,
      14 => 48,
      15 => 50,
      16 => 22,
      17 => 22,
      18 => 22,
      19 => 22,
      20 => 22,
    }
    
    GAUGE_COULOR_2 =
    {
      1 => 23,
      2 => 23,
      3 => 23,
      4 => 23,
      5 => 23,
      6 => 23,
      7 => 23,
      8 => 23,
      9 => 23,
      10 => 23,
      11 => 23,
      12 => 23,
      13 => 23,
      14 => 23,
      15 => 23,
      16 => 23,
      17 => 23,
      18 => 23,
      19 => 23,
      20 => 23,
    }
    
  end
end

class Window_Base
  
  def draw_actor_mp(actor, x, y, width = 120)
    draw_actor_mp_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    case ASCIIGOD::RENAME_MP::TYPE_NAME
    when 0
      text = ASCIIGOD::RENAME_MP::NAME_MP_CLASS_A[actor.class.id]
    when 1
      text = ASCIIGOD::RENAME_MP::NAME_MP_CLASS[actor.class.id]
    else
      text = ASCIIGOD::RENAME_MP::NAME_MP_CLASS[actor.class.id]
    end
    
    self.contents.draw_text(x, y, 30, WLH, text)
    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
  
  def draw_actor_mp_gauge(actor, x, y, width = 120)
    gw = width * actor.mp / [actor.maxmp, 1].max
    gc1 = text_color(ASCIIGOD::RENAME_MP::GAUGE_COULOR_1[actor.class.id])
    gc2 = text_color(ASCIIGOD::RENAME_MP::GAUGE_COULOR_2[actor.class.id])
    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
end



__________________________

Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
Kread-EX
post Feb 22 2012, 01:30 PM
Post #2


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




You know, it would be easier to make your script use the default value and only replace it if an entry exists, rather than forcing the user to fill a name for all the classes.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   



Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 05:16 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker