Just move the Cursor of the Item_Scene to the right - Djigit - 07-16-2015
Hi. I just need a little help with the MOG Scene_Item by moghunter. As you can see from the picture I posted as a Thumbnail, I want the cursor at the Item menu to be shifted a bit to the right so that the cursor fits in to the item box (the one that is under the cursor) Please can anyone tell me where the code is to change the cursor a bit to the right. I really couldn't find it.
Code: #_______________________________________________________________________________
# MOG Scene Item Laura V1.2
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
module MOG
#Transition Time.
MNIT = 20
#Transition Type(Name).
MNITT = "007-Line01"
end
$mogscript = {} if $mogscript == nil
$mogscript["menu_laura"] = true
###############
# Window_Base #
###############
class Window_Base < Window
def nada
face = RPG::Cache.picture("")
end
def drw_face(actor,x,y)
face = RPG::Cache.picture(actor.name + "_fc") rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_maphp3(actor, x, y)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("HP_Bar")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.picture("HP_Tx")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 35, y - ch + 30, text, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 81, y - 1, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 80, y - 2, 48, 32, actor.hp.to_s, 2)
end
def draw_mapsp3(actor, x, y)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("SP_Bar")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.picture("SP_Tx")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 35, y - ch + 30, text, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 81, y - 1, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 80, y - 2, 48, 32, actor.sp.to_s, 2)
end
def draw_mexp_it(actor, x, y)
lv_tx = RPG::Cache.picture("LV_tx")
cw = lv_tx.width
ch = lv_tx.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60 , y - ch + 32, lv_tx, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 101, y + 5, 24, 32, actor.level.to_s, 1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 100, y + 4, 24, 32, actor.level.to_s, 1)
end
def draw_actor_state_it(actor, x, y, width = 80)
text = make_battler_state_text(actor, width, true)
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(x, y, width, 32, text,1)
end
end
######################
# Window_Target_Item #
######################
class Window_Target_Item < Window_Selectable
def initialize
super(0, 130, 280, 300)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 14
self.z += 10
@item_max = $game_party.actors.size
refresh
end
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 4
y = i * 65
actor = $game_party.actors[i]
drw_face(actor,x,y + 55)
if $mogscript["TP_System"] == true
draw_actor_tp(actor, x + 168, y + 27 ,4)
else
draw_mexp_it(actor, x + 110, y + 25 )
end
draw_actor_state_it(actor, x + 165, y )
draw_maphp3(actor, x + 20, y + 0)
draw_mapsp3(actor, x + 20, y + 32)
end
end
def update_cursor_rect
if @index <= -2
self.cursor_rect.set(0, (@index + 10) * 65, self.width - 32, 60)
elsif @index == -1
self.cursor_rect.set(0, 0, self.width - 32, @item_max * 64 )
else
self.cursor_rect.set(0, @index * 65, self.width - 32, 60)
end
end
end
############
# Type_Sel #
############
class Type_Sel < Window_Base
attr_reader :index
attr_reader :help_window
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
def index=(index)
@index = index
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
def top_row
return self.oy / 32
end
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end
def page_row_max
return (self.height - 32) / 32
end
def page_item_max
return page_row_max * @column_max
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::RIGHT)
if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
if Input.repeat?(Input::LEFT)
if (@column_max == 1 and Input.trigger?(Input::LEFT)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
end
end
end
###############
# Window_Type #
###############
class Window_Type < Type_Sel
def initialize
super(0, 0, 0, 0)
@item_max = 3
self.index = 0
end
end
##################
# Window_Item_Ex #
##################
class Window_Item_Ex < Window_Selectable
def initialize
super(250, 50, 295, 350)
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.name = "Tahoma"
self.contents.font.size = 14
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 190, 32, item.name, 0)
self.contents.draw_text(x + 215, y, 16, 32, ":", 1)
self.contents.draw_text(x + 230, y, 24, 32, number.to_s, 2)
end
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#################
# Window_Weapon #
#################
class Window_Weapon < Window_Selectable
def initialize
super(250, 50, 295, 350)
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.name = "Tahoma"
self.contents.font.size = 14
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 190, 32, item.name, 0)
self.contents.draw_text(x + 215, y, 16, 32, ":", 1)
self.contents.draw_text(x + 230, y, 24, 32, number.to_s, 2)
end
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
################
# Window_Armor #
################
class Window_Armor < Window_Selectable
def initialize
super(250, 50, 295, 350)
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.name = "Tahoma"
self.contents.font.size = 14
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 190, 32, item.name, 0)
self.contents.draw_text(x + 215, y, 16, 32, ":", 1)
self.contents.draw_text(x + 230, y, 24, 32, number.to_s, 2)
end
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
##############
# Scene_Item #
##############
class Scene_Item
def main
@back = Plane.new
@back.bitmap = RPG::Cache.picture("MN_BK")
@back.z = 100
@item_lay = Sprite.new
@item_lay.bitmap = RPG::Cache.picture("Item_lay")
@item_lay.z = 100
@item_com = Sprite.new
@item_com.bitmap = RPG::Cache.picture("Item_com01")
@item_com.z = 100
@type = Window_Type.new
@type.opacity = 0
@type.visible = false
@help_window = Window_Help.new
@help_window.y = 405
@item_window = Window_Item_Ex.new
@item_window.help_window = @help_window
@item_window.visible = true
@item_window.active = true
@weapon_window = Window_Weapon.new
@weapon_window.help_window = @help_window
@weapon_window.visible = false
@weapon_window.active = true
@armor_window = Window_Armor.new
@armor_window.help_window = @help_window
@armor_window.visible = false
@armor_window.active = true
@target_window = Window_Target_Item.new
@target_window.x = -300
@target_window.active = false
@help_window.opacity = 0
@help_window.x = -200
@help_window.contents_opacity = 0
@item_window.opacity = 0
@weapon_window.opacity = 0
@armor_window.opacity = 0
@target_window.opacity = 0
@weapon_window.x = 640
@armor_window.x = 640
@item_window.x = 640
@weapon_window.contents_opacity = 0
@armor_window.contents_opacity = 0
@item_window.contents_opacity = 0
Graphics.transition(MOG::MNIT, "Graphics/Transitions/" + MOG::MNITT)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
for i in 0..30
@weapon_window.x += 20
@armor_window.x += 20
@item_window.x += 20
@weapon_window.contents_opacity -= 15
@armor_window.contents_opacity -= 15
@item_window.contents_opacity -= 15
@item_lay.zoom_x += 0.2
@item_lay.opacity -= 15
@item_com.zoom_y += 0.2
@item_com.opacity -= 15
@target_window.x -= 15
@help_window.contents_opacity -= 15
@back.ox += 1
Graphics.update
end
Graphics.freeze
@help_window.dispose
@item_window.dispose
@weapon_window.dispose
@armor_window.dispose
@target_window.dispose
@item_lay.dispose
@back.dispose
@item_com.dispose
@type.dispose
end
def update
if @target_window.active == true
@target_window.visible = true
if @target_window.x < 0
@target_window.x += 20
elsif @target_window.x >= 0
@target_window.x = 0
end
else
if @target_window.x > -300
@target_window.x -= 20
elsif @target_window.x >= -300
@target_window.x = -300
@target_window.visible = false
end
end
if @help_window.x < 0
@help_window.x += 10
@help_window.contents_opacity += 15
elsif @help_window.x >= 0
@help_window.x = 0
@help_window.contents_opacity = 255
end
if @item_window.x > 250
@weapon_window.x -= 20
@armor_window.x -= 20
@item_window.x -= 20
@weapon_window.contents_opacity += 15
@armor_window.contents_opacity += 15
@item_window.contents_opacity += 15
elsif @item_window.x <= 250
@weapon_window.x = 250
@armor_window.x = 250
@item_window.x = 250
@weapon_window.contents_opacity = 250
@armor_window.contents_opacity = 250
@item_window.contents_opacity = 250
end
if @target_window.active == false
if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::LEFT) or
Input.press?(Input::RIGHT) or Input.press?(Input::LEFT)
@weapon_window.x = 640
@armor_window.x = 640
@item_window.x = 640
@weapon_window.contents_opacity = 0
@armor_window.contents_opacity = 0
@item_window.contents_opacity = 0
end
if Input.trigger?(Input.dir4) or Input.trigger?(Input.dir4) or
Input.trigger?(Input::L) or Input.trigger?(Input::R)
@help_window.x = -200
@help_window.contents_opacity = 0
end
end
@back.ox += 1
@help_window.update
@item_window.update
@weapon_window.update
@armor_window.update
@target_window.update
@type.update
case @type.index
when 0
@item_com.bitmap = RPG::Cache.picture("Item_com01")
if @target_window.active == true
update_target
@item_window.active = false
@type.active = false
return
else
@item_window.active = true
@type.active = true
end
@weapon_window.active = false
@armor_window.active = false
@item_window.visible = true
@weapon_window.visible = false
@armor_window.visible = false
when 1
@item_com.bitmap = RPG::Cache.picture("Item_com02")
@item_window.active = false
@weapon_window.active = true
@armor_window.active = false
@item_window.visible = false
@weapon_window.visible = true
@armor_window.visible = false
when 2
@item_com.bitmap = RPG::Cache.picture("Item_com03")
@item_window.active = false
@weapon_window.active = false
@armor_window.active = true
@item_window.visible = false
@weapon_window.visible = false
@armor_window.visible = true
end
if @item_window.active
update_item
return
end
if @weapon_window.active
update_weapon
return
end
if @armor_window.active
update_armor
return
end
end
def update_weapon
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(0)
return
end
end
def update_armor
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(0)
return
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(0)
return
end
if Input.trigger?(Input::C)
@item = @item_window.item
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @item.scope >= 3
@item_window.active = false
@target_window.x = (@item_window.index + 1) % 1 * 304
@target_window.active = true
@target_window.x = -350
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
else
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
$scene = Scene_Map.new
return
end
end
return
end
end
def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
unless $game_party.item_can_use?(@item.id)
@item_window.refresh
end
@item_window.active = true
@target_window.active = false
return
end
if Input.trigger?(Input::C)
if $game_party.item_number(@item.id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
if used
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
RE: Just move the Cursor of the Item_Scene to the right - DerVVulfman - 07-17-2015
It's not that the cursor is off, but your entire window is off. The cursor is drawn around the items and quantity values with a set margin around them. As I can see, you don't quite have your list of items centered in your gray box area and needs to be shifted about... um... 30 more pixels to the right?
Code: ##################
# Window_Item_Ex #
##################
class Window_Item_Ex < Window_Selectable
def initialize
super(250, 50, 295, 350)
This is the area you need to look at, specifically the super statement.
The super statement defines the basic shape of your window (x-position, y-position, width, height). Try setting it to something like
super(280, 50, 295, 350)
Oh... I can see your confusion. Moghunter makes em quite visual. But his coding is hell to decipher and usually not compatible with other scripts (good luck getting other item scripts to work with it).
You MAY want to do a search in the forum for Moghunter scripts.... posted by ME. I did some script cleaning. ^_^ A lot more instructions... more notes... more to configure at your leisure. But read the instructions.
RE: Just move the Cursor of the Item_Scene to the right - Djigit - 07-17-2015
i've edited it to 280, but nothing changed. I even edited it to 380 but nothing changed either. Hm...
I've uplaoded some pictures how the item menu looks after the change. And even the changed line.
RE: Just move the Cursor of the Item_Scene to the right - DerVVulfman - 07-17-2015
Oh, wait. This is the window that slides over when the menu shows, isn't it?
It's actually defined in another class, and re-positioned in Scene_Item.... Change
Code: @target_window.x = -300
to something like -270 or so.
RE: Just move the Cursor of the Item_Scene to the right - Djigit - 07-17-2015
I did, but still not working.
RE: Just move the Cursor of the Item_Scene to the right - DerVVulfman - 07-18-2015
Sorry about that. Been occupied getting work done for the Gazette and was doing this just at glancing at the code. I just opened up my 'revisioned' versions of Moghunter's systems and I found it (though I again recommend my edited version as it is more compliant with other scripts that edit the menus)....
Within my edit, it is merely this code:
Code: if @item_window.x > 250
@item_window.x -= 20
@item_window.contents_opacity += 15
elsif @item_window.x <= 250
@item_window.x = 250
@item_window.contents_opacity = 250
end
And in YOUR version, the code is:
Code: if @item_window.x > 250
@weapon_window.x -= 20
@armor_window.x -= 20
@item_window.x -= 20
@weapon_window.contents_opacity += 15
@armor_window.contents_opacity += 15
@item_window.contents_opacity += 15
elsif @item_window.x <= 250
@weapon_window.x = 250
@armor_window.x = 250
@item_window.x = 250
@weapon_window.contents_opacity = 250
@armor_window.contents_opacity = 250
@item_window.contents_opacity = 250
end
It is the '250' value that stops the window as it scrolls over to X-Position 250. Here, you may wish to add 30 more points to make it stop at x-position 280. Obviously, you wouldn't need to alter as many lines in my version ^_^
RE: Just move the Cursor of the Item_Scene to the right - Djigit - 07-19-2015
Yes, but, sorry, I still dont know what to change exactly. If I change These lines:
@weapon_window.x = 250
@armor_window.x = 250
@item_window.x = 250
to
@weapon_window.x = 280
@armor_window.x = 280
@item_window.x = 280
the item menu is flickers around. Would it be possible for you to tell me the changed lines?
RE: Just move the Cursor of the Item_Scene to the right - DerVVulfman - 07-19-2015
You'd be changing....
Code: if @item_window.x > 280
And all from the elsif on down.....
Code: elsif @item_window.x <= 280
@weapon_window.x = 280
@armor_window.x = 280
@item_window.x = 280
@weapon_window.contents_opacity = 280
@armor_window.contents_opacity = 280
@item_window.contents_opacity = 280
end
In my rewritten version, it would have been a whole lot less.
But I do recommend looking at Moghunter Menus: Scene Item Laura, a version of this script I reformatted because...
- Sloppy scripting (improper formatting, lack of helpful comments, etc.)
- He made his own Window_Item2 class, so you cannot use any OTHER item script with this.
- Everything he had was hardwired. You have no options you can turn on/off
The revised version (and all other moggy ones in the link's demo) has- Formatted scripting (clear header breaks, proper indentation, helpful 'classic' comment style for scripters and users)
- Does not create new window classes, so it is more compatible with other scripts in use
- Includes a config section at the top so you can set fonts, identify what graphic files you're using, turn features on/off
And in mine, you'd only need to change:
Code: if @item_window.x > 280
@item_window.x -= 20
@item_window.contents_opacity += 15
elsif @item_window.x <= 280
@item_window.x = 280
@item_window.contents_opacity = 280
end
EDIT: Oh, and I have a copy of his 'terms of use' in the post. Basically 'give him credit' in your game infofar as your project is concerned.
RE: Just move the Cursor of the Item_Scene to the right - Djigit - 08-08-2015
Thank you very very much that far. I've a last request if you accept it.
In addition to the MOG Item Menu, I'm also using the MOG Menu Status script and the equip script which I both added below.
There is a addon script called "Equipment Multi Slots" which basically allows one to shape the equipment customized. For example it is possible to customize the equipment, so that one only can wear a Weapon, A armor and two accessories But the problem is, the "Equipment Multi Slots" by ATOA, which is basically a addon by the author of the script, that the equipment multi slots is not compatible with the MOG Status and Equip script I posted. When I arrange the Equipment other then the original (which is the goal of the script) I get a error on line 284 whenever I try to change my acessory in the equp menu. Is there any chance to make the both scripts compatible with the both MOG Scripts I posted?
Code: #==============================================================================
# Equipment Multi Slots
# By Atoa
#==============================================================================
# This scripts add an multi equipment slot system, wich allows you to add
# an new variety of equipment.
#
# Add this script above all actor related scripts.
#
# IMPORTANT:
# - If you using the multi slot equip system, the event command for changing
# equips will be screwed.
# So if you need to force any equip change with events, make an Script Call
# and add this command:
# $game_actors[Actor ID].equip(Slot Index, Equip ID)
# Slot Index = remember that indexes starts from 0, so the 1st slot will
# be index 0, the 2nd will be index 1...
# - This script change a lot of funcitons and may cause incompatiblities
# with other systems, if that happens you will have to choose wich system use.
#==============================================================================
module Atoa
# Do not remove or change these lines
Equip_Lock = {}
Armor_Lock = {}
# Do not remove or change these lines
# Equipment Kinds
# The order of the values here define the order that the equipment will be
# shown in the menu
# If you repeat an value, means that the actor can equip more than one
# equip of that type,
Equip_Kinds = [0,1,2,3,5,4,4]
# 0 = Weapons (if you add more than one value equal zero, all these equips
# will be considered 'right hand', so they won't remove the shield)
# 1 = Shields (any equip set as 'Shield' will be exchanged by an weapon if
# the actor have the dual wielding)
# 2 = Helmets
# 3 = Armors
# 4 = Accessories
# Values above 5 are the extra slots, use to creat equipments like Boots, Capes...
# You must set the IDs of the extra slots equips in 'Extra_Equips_ID'
#
# It's recomended that you leave only one 'Weapon' and one 'Shield', once
# it interfere in the Dual Wielding and 2 Haded Weapons
# You can change this value individually for each actor making an script call
# and adding this command:
# $game_actors[actor_id].equip_kind = [x,y,z]
# actor_id = actor ID
# [x,y,z] = new equip kind configuration
# IDs of the equipments
# Extra_Equips_ID = {kind => [equips_ids]}
# kind = equipment type, set on Equip_Kinds
# equips_ids = id of the armors of this equip type
Extra_Equips_ID = {5 => [38,39]}
# Name of the equips shown in the equip and status window
Equip_Names = ['Right Hand', 'Left Hand', 'Helmet', 'Armor', 'Boots',
'Accessory', 'Accessory']
# The order here is the order that the names are shown in the menu, set
# them according to the values set in 'Equip_Kinds'.
# if you change the value of the kinds with script calls, remember to change
# the names.
# You can change this value individually for each actor making an script call
# and adding this command:
# $game_actors[actor_id].equip_names = [x,y,z]
# actor_id = actor ID
# [x,y,z] = new equip names configuration
# Equipment Lock, these lines allows you to 'lock' an determined type of
# equipment, don't allow the actor to stay without equipment of this type
# You can change equips freely, but can't remove.
# E.g.: You have an Bow user character, and don't want him to stay without bows.
# Equip_Lock[equip_kind] = {actor_id =>[equip_type_id]}
# equip_kind = kind of the equipment
# 'Weapon' for weapons, 'Armor' for armors
# actor_id = actor id
# equip_type_id = id of the equipment
# 0 = right hand weapon
# 1 = left hand weapon or shield
# 2,3,4... = armors
Equip_Lock['Weapon']= {1 => [0], 2 => [0], 3 => [0], 4 => [0],
5 => [0], 6 => [0], 7 => [0], 8 => [0]}
Equip_Lock['Armor']= {1 => [1], 2 => [1]}
#=============================================================================
end
#==============================================================================
# ** Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa Multi Slot'] = true
#==============================================================================
# ** RPG::Armor
#------------------------------------------------------------------------------
# Class that manage armors
#==============================================================================
class RPG::Armor
#--------------------------------------------------------------------------
# * Type ID setting
#--------------------------------------------------------------------------
def type_id
if Extra_Equips_ID != nil
for kind in Extra_Equips_ID.dup
return kind[0] if kind[1].include?(@id)
end
end
return @kind + 1
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :weapon_fix
attr_accessor :armor_fix
attr_accessor :equip_kind
attr_accessor :equip_names
attr_accessor :equip_id
#--------------------------------------------------------------------------
# * Setup
# actor_id : actor ID
#--------------------------------------------------------------------------
alias setup_multislot setup
def setup(actor_id)
setup_multislot(actor_id)
@equip_id = []
@equip_kind = equip_kind
@equip_names = equip_names
for i in 0...@equip_kind.size
id = @equip_kind[i]
if id == 0 and i == 0
@equip_id[i] = @weapon_id
elsif id != 0 and (1..4).include?(id)
@equip_id[i] = eval("@armor#{id}_id")
else
@equip_id[i] = 0
end
end
@weapon_fix = [@weapon_fix]
@weapon_fix[1] = @armor1_fix if $atoa_script['Atoa Two Hands'] and two_swords_style
@armor_fix = [false]
for i in 0...@equip_kind.size
id = @equip_kind[i]
if (1..4).include?(id) and not ($atoa_script['Atoa Two Hands'] and id == 1 and
two_swords_style)
@armor_fix[i] = eval("@armor#{id}_fix")
elsif id > 0 and not ($atoa_script['Atoa Two Hands'] and id == 1 and two_swords_style)
@armor_fix[i] = false
end
end
@armor_fix[1] = @armor1_fix unless $atoa_script['Atoa Two Hands'] and two_swords_style
@equip_id[1] = 0 if $atoa_script['Atoa Two Hands'] and
(Two_Hands_Weapons.include?(@weapon_id) or two_swords_style)
for equip in armors do update_auto_state(nil, equip) end
end
#--------------------------------------------------------------------------
# * Get equip slots name
#--------------------------------------------------------------------------
def equip_names
return @equip_names.nil? ? Equip_Names : @equip_names
end
#--------------------------------------------------------------------------
# * Set new slot names
# n : new names
#--------------------------------------------------------------------------
def equip_names=(n)
@equip_names = n
end
#--------------------------------------------------------------------------
# * Get equips kind
#--------------------------------------------------------------------------
def equip_kind
return @equip_kind.nil? ? Equip_Kinds : @equip_kind
end
#--------------------------------------------------------------------------
# * Set new equips kind
# n : new kinds
#--------------------------------------------------------------------------
def equip_kind=(n)
for i in 0...@equip_kind.size
equip(i, 0) if @equip_kind[i] != n[i]
end
@equip_kind = n
set_equip_id
end
#--------------------------------------------------------------------------
# * Set equips ID
#--------------------------------------------------------------------------
def set_equip_id
for i in 0...@equip_kind.size
@equip_id[i] = 0 if @equip_id[i] == nil
end
end
#--------------------------------------------------------------------------
# * Get weapons
#--------------------------------------------------------------------------
def weapons
result = []
for i in 0...@equip_kind.size
id = @equip_kind[i]
if id == 0 or ($atoa_script['Atoa Two Hands'] and id == 1 and two_swords_style)
@weapon_id = @equip_id[i].nil? ? 0 : @equip_id[i] if id == 0
result << $data_weapons[@equip_id[i]]
end
end
result.delete_if {|x| x == nil }
return result
end
#--------------------------------------------------------------------------
# * Get armors
#--------------------------------------------------------------------------
def armors
result = []
for i in 0...@equip_kind.size
id = @equip_kind[i]
if id > 0 and not ($atoa_script['Atoa Two Hands'] and id == 1 and two_swords_style)
eval("@armor#{id}_id = @equip_id[i].nil? ? 0 : @equip_id[i]") if id < 5
result << $data_armors[@equip_id[i]]
end
end
result.delete_if {|x| x == nil }
return result
end
#--------------------------------------------------------------------------
# * Equipment lock
# type : equip type
#--------------------------------------------------------------------------
def lock_equip(type)
equip = (type == 0 or ($atoa_script['Atoa Two Hands'] and type == 1 and
two_swords_style)) ? 'Weapon' : 'Armor'
id = @equip_kind[type]
if Equip_Lock[equip] != nil
eqp = Equip_Lock[equip].dup
else
return false
end
return (eqp.include?(@actor_id) and eqp[@actor_id].include?(id))
end
#--------------------------------------------------------------------------
# * Change Equipment
# equip_type : type of equipment
# id : weapon or armor ID (If 0, remove equipment)
#--------------------------------------------------------------------------
def equip(equip_type, id)
type = @equip_kind[equip_type]
if type == 0
if id == 0 or $game_party.weapon_number(id) > 0
$game_party.gain_weapon(@equip_id[equip_type], 1)
@equip_id[equip_type] = id
$game_party.lose_weapon(id, 1)
end
elsif type == 1
if $atoa_script['Atoa Two Hands'] and two_swords_style
if id == 0 or $game_party.weapon_number(id) > 0
$game_party.gain_weapon(@equip_id[equip_type], 1)
@equip_id[equip_type] = id
$game_party.lose_weapon(id, 1)
end
else
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@equip_id[equip_type]], $data_armors[id])
$game_party.gain_armor(@equip_id[equip_type], 1)
@equip_id[equip_type] = id
$game_party.lose_armor(id, 1)
end
end
elsif type > 1
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@equip_id[equip_type]], $data_armors[id])
$game_party.gain_armor(@equip_id[equip_type], 1)
@equip_id[equip_type] = id
$game_party.lose_armor(id, 1)
end
end
end
#--------------------------------------------------------------------------
# * Remove secondary equip
#--------------------------------------------------------------------------
def remove_left_equip_actor
for i in 0...@equip_kind.size
equip(i, 0) if @equip_kind[i] == 1
end
end
#--------------------------------------------------------------------------
# * Remove secondary equip by class
# class_id : class ID
#--------------------------------------------------------------------------
def remove_left_equip_class(class_id)
if class_id == @class_id
for i in 0...@equip_kind.size
equip(i, 0) if @equip_kind[i] == 1
end
end
end
#--------------------------------------------------------------------------
# * Change Class ID
# class_id : new class ID
#--------------------------------------------------------------------------
def class_id=(class_id)
remove_equip_class_change(class_id, @class_id)
if $data_classes[class_id] != nil
@class_id = class_id
for i in 0...@equip_kind.size
if @equip_kind[i] == 0 or ($atoa_script['Atoa Two Hands'] and
@equip_kind[i] == 1 and two_swords_style)
equip(i, 0) unless equippable?($data_weapons[@equip_id[i]])
else
equip(i, 0) unless equippable?($data_armors[@equip_id[i]])
end
end
end
end
end
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window class contains cursor movement and scroll functions.
#==============================================================================
class Window_Selectable < Window_Base
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_windowselectable_multislot update
def update
if self.is_a?(Window_EquipRight)
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::DOWN)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
if Input.repeat?(Input::UP)
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
if Input.repeat?(Input::R)
@index == @item_max if @index < @item_max
end
if Input.repeat?(Input::L)
@index == @item_max if @index < @item_max
end
end
if self.active and @help_window != nil
update_help
end
update_cursor_rect
else
update_windowselectable_multislot
end
end
end
#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
# This window displays full status specs on the status screen.
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 40, 112)
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 96, 32)
draw_actor_state(@actor, 96, 64)
draw_actor_hp(@actor, 96, 112, 172)
draw_actor_sp(@actor, 96, 144, 172)
status_size = Object.const_defined?(:Extra_Status) ? Extra_Status.size : 0
for i in 0..2
draw_actor_parameter(@actor, 96, 164 + [(236/(status_size + 6)), 20].max * i, i)
end
for i in 3..6
draw_actor_parameter(@actor, 96, 168 + [(236/(status_size + 6)), 20].max * i, i)
end
for i in 7..(status_size + 6)
draw_actor_parameter(@actor, 96, 172 + [(236/(status_size + 6)), 20].max * i,
Extra_Status[i - 7]) if Extra_Status[i - 7] != nil
end
self.contents.font.color = system_color
self.contents.draw_text(320, 48, 80, 32, 'EXP')
self.contents.draw_text(320, 80, 80, 32, 'Próximo')
self.contents.draw_text(400, 128, 128, 32, 'Equipamentos')
self.contents.font.color = normal_color
self.contents.draw_text(400, 48, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(400, 80, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
data = []
for i in 0...@actor.equip_kind.size
id = @actor.equip_kind[i]
if id == 0
data.push($data_weapons[@actor.equip_id[i]])
elsif id == 1 and ($atoa_script['Atoa Two Hands'] and @actor.two_swords_style)
data.push($data_weapons[@actor.equip_id[i]])
elsif id != 0 or ($atoa_script['Atoa Two Hands'] and id == 1 and not @actor.two_swords_style)
data.push($data_armors[@actor.equip_id[i]])
end
end
self.contents.font.color = system_color
return if data.size == 0
for i in 0...@actor.equip_names.size
name = @actor.equip_names[i]
self.contents.draw_text(320, 160 + [(280/data.size), 24].max * i, 92, 32, name)
end
for i in 0...data.size
draw_item_name(data[i], 412, 160 + [(280/data.size), 24].max * i)
end
end
end
#==============================================================================
# ** Window_EquipRight
#------------------------------------------------------------------------------
# This window displays items the actor is currently equipped with on the
# equipment screen.
#==============================================================================
class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :data
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(272, 64, 368, 192)
self.contents = Bitmap.new(width - 32, actor.equip_kind.size * 32)
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
for i in 0...@actor.equip_kind.size
id = @actor.equip_kind[i]
if id == 0
@data.push($data_weapons[@actor.equip_id[i]])
elsif id == 1 and ($atoa_script['Atoa Two Hands'] and @actor.two_swords_style)
@data.push($data_weapons[@actor.equip_id[i]])
elsif id != 0 or ($atoa_script['Atoa Two Hands'] and id == 1 and not @actor.two_swords_style)
@data.push($data_armors[@actor.equip_id[i]])
end
end
@item_max = @data.size
self.contents.font.color = system_color
for i in 0...@actor.equip_names.size
name = @actor.equip_names[i]
self.contents.draw_text(4, 32 * i, 92, 32, name)
end
for i in 0...@data.size
draw_item_name(@data[i], 92, 32 * i)
end
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? '' : self.item.description)
end
end
#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
# This window displays choices when opting to change equipment on the
# equipment screen.
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :data
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
if @equip_type == 0 or ($atoa_script['Atoa Two Hands'] and
@equip_type == 1 and @actor.two_swords_style)
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
next if $atoa_script['Atoa Two Hands'] and Two_Hands_Weapons.include?(i) and @equip_type == 1
next if $atoa_script['Atoa Two Hands'] and Right_Hand_Weapons.include?(i) and @equip_type == 1
next if $atoa_script['Atoa Two Hands'] and Left_Hand_Weapons.include?(i) and @equip_type == 0
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
if @equip_type > 0 and not ($atoa_script['Atoa Two Hands'] and @equip_type == 1 and @actor.two_swords_style)
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].type_id == @equip_type
@data.push($data_armors[i])
end
end
end
end
@data.push(nil) unless @actor.lock_equip(@equip_type)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, [row_max, 1].max * 32)
self.opacity = Equip_Window_Opacity if $atoa_script['Atoa New Status']
for i in 0...(@actor.lock_equip(@equip_type) ? @item_max : @item_max - 1)
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
if $atoa_script['Atoa New Status']
case Equip_Menu_Syle
when 0,1,2
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
when 3,4
x = 4
y = index * 32
end
else
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
end
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ':', 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
#==============================================================================
# ** Window_ShopStatus
#------------------------------------------------------------------------------
# This window displays number of items in possession and the actor's equipment
# on the shop screen.
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
return if @item.nil?
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 32, 'Você tem')
self.contents.font.color = normal_color
self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
return if @item.is_a?(RPG::Item)
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.equippable?(@item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
for n in 0...actor.equip_kind.size
id = actor.equip_kind[n]
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.equip_id[n]] if id == 0
else
if $data_armors[actor.equip_id[n]].type == @item.type_id and not
(@item.type_id == 1 and actor.two_swords_style)
item1 = $data_armors[actor.equip_id[n]]
end
end
end
if actor.equippable?(@item)
change = 0
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
change = atk2 - atk1
elsif @item.is_a?(RPG::Armor) and @item.kind <= 2
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item.pdef : 0
mdef2 = @item != nil ? @item.mdef : 0
change = pdef2 - pdef1 + mdef2 - mdef1
elsif @item.is_a?(RPG::Armor) and @item.kind > 2
change = 0
item1 = nil
end
if change > 0 and actor.equippable?(@item)
self.contents.font.color = text_color(3)
elsif change < 0 and actor.equippable?(@item)
self.contents.font.color = text_color(2)
end
self.contents.draw_text(64, 64 + 64 * i, 128, 32,sprintf('%+d', change), 2)
self.contents.font.color = normal_color
end
if item1 != nil
x = 4
y = 64 + 64 * i + 32
bitmap = RPG::Cache.icon(item1.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item1.name)
end
end
end
end
#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
# This class performs equipment screen processing.
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# * Include Settings Module
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new(@actor)
@right_window = Window_EquipRight.new(@actor)
@right_window.index = @equip_index
item_window_update
@right_window.help_window = @help_window
for i in 0...@actor.equip_kind.size
eval("@item_window#{i + 1}.help_window = @help_window")
end
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
break if $scene != self
end
Graphics.freeze
@help_window.dispose
@left_window.dispose
@right_window.dispose
item_window_dispose
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@help_window.opacity = Equip_Window_Opacity if $atoa_script['Atoa New Status']
if @right_window.index > @right_window.data.size - 1
@right_window.index = @right_window.data.size - 1
end
for i in 0...@actor.equip_kind.size
eval("@item_window#{i + 1}.visible = (@right_window.index == #{i})")
end
item1 = @right_window.item
eval("@item_window = @item_window#{@right_window.index + 1}")
@left_window.set_new_parameters(nil, nil, nil) if @right_window.active
if @item_window.active
@item2 = @item_window.item
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, @item2 == nil ? 0 : @item2.id)
re_equip = []
if $atoa_script['Atoa Two Hands'] and @item2 != nil and @item2.type_id == 0 and Two_Hands_Weapons.include?(@item2.id)
for i in 0...@actor.equip_kind.size
id = @actor.equip_kind[i]
if id == 1
re_equip << [i, @actor.equip_id[i]]
@actor.equip(i, 0)
end
end
elsif @item2 != nil and (@item2.type_id == 1 or ($atoa_script['Atoa Two Hands'] and
@item2.type_id == 0 and @actor.two_swords_style))
for i in 0...@actor.equip_kind.size
id = @actor.equip_kind[i]
if $atoa_script['Atoa Two Hands'] and @right_window.index != i and id == 0 and
Two_Hands_Weapons.include?(@actor.equip_id[id])
re_equip << [i, @actor.equip_id[i]]
@actor.equip(i, 0)
end
end
end
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
if $atoa_script['Atoa New Status']
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
new_eva = @actor.eva
new_hit = @actor.hit
new_crt = @actor.crt
new_dmg = @actor.dmg
new_rcrt = @actor.rcrt
new_rdmg = @actor.rdmg
end
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
for equip in re_equip
@actor.equip(equip[0], equip[1])
end
@actor.hp = last_hp
@actor.sp = last_sp
if $atoa_script['Atoa New Status']
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex,
new_agi, new_int, new_eva, new_hit, new_crt, new_dmg, new_rcrt, new_rdmg)
else
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end
end
#--------------------------------------------------------------------------
# * Update item window
#--------------------------------------------------------------------------
def item_window_update
for i in 0...@actor.equip_kind.size
type = @actor.equip_kind[i]
eval("@item_window#{i+1} = Window_EquipItem.new(@actor, type)")
end
for i in 0...@actor.equip_kind.size
eval("@item_window#{i + 1}.help_window = @help_window")
end
refresh
end
#--------------------------------------------------------------------------
# * Dispose item window
#--------------------------------------------------------------------------
def item_window_dispose
for i in 0...@actor.equip_kind.size
eval("@item_window#{i+1}.dispose if @item_window#{i+1} != nil")
end
end
#--------------------------------------------------------------------------
# * Frame Update (when item window is active)
#--------------------------------------------------------------------------
alias update_item_multislot update_item
def update_item
if Input.trigger?(Input::C)
item = @item_window.item
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
update_hands(item) if $atoa_script['Atoa Two Hands']
@right_window.active = true
@item_window.active = false
@item_window.index = -1
@right_window.refresh
@item_window.refresh
$game_system.se_play($data_system.equip_se)
return
end
update_item_multislot
end
#--------------------------------------------------------------------------
# * Frame Update (when right window is active)
#--------------------------------------------------------------------------
def update_right
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
@item_window.index = -1
@item_window.refresh
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(2)
return
end
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index) or (@item_window.data.size == 0 and
@actor.lock_equip(@right_window.index))
return $game_system.se_play($data_system.buzzer_se)
end
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size + 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
end
end
[/quote]
Code: #_______________________________________________________________________________
# MOG Scene Equip Asuka V1.5
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
module MOG
#Transition Time.
MSEQPT= 20
#Transition Type.
MSEQPTT= "007-Line01"
# Set Maximum (STR,DEX,AGL,INT)
MST_ST = 999
# Set Maximum (ATK,PDEF,MDEF)
MST_STE = 999
end
$mogscript = {} if $mogscript == nil
$mogscript["menu_asuka"] = true
###############
# Window_Base #
###############
class Window_Base < Window
def nada2(actor)
face = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
end
def draw_heroface2(actor,x,y)
face = RPG::Cache.picture(actor.name + "_fc2") rescue nada2(actor)
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
if face == RPG::Cache.battler(actor.battler_name, actor.battler_hue)
self.contents.blt(x + 40 , y - ch - 240, face, src_rect)
else
self.contents.blt(x , y - ch, face, src_rect)
end
end
def drw_eqpup(x,y,type)
case type
when 0
est = RPG::Cache.icon("ST_EQU")
when 1
est = RPG::Cache.icon("ST_UP")
when 2
est = RPG::Cache.icon("ST_DOWN")
end
cw = est.width
ch = est.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, est, src_rect)
end
def drw_equist(x,y)
equist = RPG::Cache.picture("Equip_St")
cw = equist.width
ch = equist.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, equist, src_rect)
end
def draw_actor_parameter2(actor, x, y, type)
back = RPG::Cache.picture("STBAR_Back")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 50 , y - ch + 20, back, src_rect)
meter = RPG::Cache.picture("STBAR.png")
case type
when 0
parameter_value = actor.atk
cw = meter.width * actor.atk / MOG::MST_STE
when 1
parameter_value = actor.pdef
cw = meter.width * actor.pdef / MOG::MST_STE
when 2
parameter_value = actor.mdef
cw = meter.width * actor.mdef / MOG::MST_STE
when 3
parameter_value = actor.str
cw = meter.width * actor.str / MOG::MST_ST
when 4
parameter_value = actor.dex
cw = meter.width * actor.dex / MOG::MST_ST
when 5
parameter_value = actor.agi
cw = meter.width * actor.agi / MOG::MST_ST
when 6
parameter_value = actor.int
cw = meter.width * actor.int / MOG::MST_ST
end
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y - 2, 36, 32, parameter_value.to_s, 2)
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 50 , y - ch + 20, meter, src_rect)
end
def nada
face = RPG::Cache.picture("")
end
def draw_heroface3(actor,x,y)
face = RPG::Cache.picture(actor.name + "_fc3") rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
end
####################
# Window_EquipLeft #
####################
class Window_EquipLeft < Window_Base
def initialize(actor)
super(0, 64, 272, 446)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.contents.font.name = "Tahoma"
self.contents.font.size = 12
@actor = actor
refresh
end
def refresh
self.contents.clear
draw_heroface2(@actor, 20, 400)
drw_equist(0,390)
draw_actor_name(@actor, 130, -10)
draw_actor_level(@actor, 4, 32)
draw_actor_parameter2(@actor, 10, 164 , 0)
draw_actor_parameter2(@actor, 10, 196 , 1)
draw_actor_parameter2(@actor, 10, 228 , 2)
draw_actor_parameter2(@actor, 10, 260 , 3)
draw_actor_parameter2(@actor, 10, 292 , 4)
draw_actor_parameter2(@actor, 10, 324 , 5)
draw_actor_parameter2(@actor, 10, 356 , 6)
if @new_atk != nil
self.contents.font.color = system_color
if @new_atk < @actor.atk
drw_eqpup(170,190,2)
self.contents.font.color = Color.new(255,50,50,255)
elsif @new_atk > @actor.atk
drw_eqpup(170,190,1)
self.contents.font.color = Color.new(50,250,150,255)
else
drw_eqpup(170,190,0)
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(190, 162, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
if @new_pdef < @actor.pdef
drw_eqpup(170,226,2)
self.contents.font.color = Color.new(255,50,50,255)
elsif @new_pdef > @actor.pdef
drw_eqpup(170,226,1)
self.contents.font.color = Color.new(50,250,150,255)
else
drw_eqpup(170,226,0)
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(190, 194, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
if @new_mdef < @actor.mdef
drw_eqpup(170,258,2)
self.contents.font.color = Color.new(255,50,50,255)
elsif @new_mdef > @actor.mdef
drw_eqpup(170,258,1)
self.contents.font.color = Color.new(50,250,150,255)
else
drw_eqpup(170,258,0)
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(190, 226, 36, 32, @new_mdef.to_s, 2)
end
if @new_str != nil
if @new_str < @actor.str
drw_eqpup(170,290,2)
self.contents.font.color = Color.new(255,50,50,255)
elsif @new_str > @actor.str
drw_eqpup(170,290,1)
self.contents.font.color = Color.new(50,250,150,255)
else
drw_eqpup(170,290,0)
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(190, 258, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
if @new_dex < @actor.dex
drw_eqpup(170,322,2)
self.contents.font.color = Color.new(255,50,50,255)
elsif @new_dex > @actor.dex
drw_eqpup(170,322,1)
self.contents.font.color = Color.new(50,250,150,255)
else
drw_eqpup(170,322,0)
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(190, 290, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
if @new_agi < @actor.agi
drw_eqpup(170,354,2)
self.contents.font.color = Color.new(255,50,50,255)
elsif @new_agi > @actor.agi
drw_eqpup(170,354,1)
self.contents.font.color = Color.new(50,250,150,255)
else
drw_eqpup(170,354,0)
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(190, 322, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
if @new_int < @actor.int
drw_eqpup(170,386,2)
self.contents.font.color = Color.new(255,50,50,255)
elsif @new_int > @actor.int
drw_eqpup(170,386,1)
self.contents.font.color = Color.new(50,250,150,255)
else
drw_eqpup(170,386,0)
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(190, 354, 36, 32, @new_int.to_s, 2)
end
end
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex,
new_agi, new_int)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or
@new_str != new_str or @new_dex != new_dex or @new_agl != new_agi or
@new_int != new_int
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
refresh
end
end
end
#####################
# Window_EquipRight #
#####################
class Window_EquipRight < Window_Selectable
def initialize(actor)
super(272, 64, 368, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.contents.font.name = "Tahoma"
self.contents.font.size = 14
@actor = actor
refresh
self.index = 0
end
def item
return @data[self.index]
end
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@item_max = @data.size
self.contents.font.color = system_color
draw_item_name(@data[0], 92, 32 * 0)
draw_item_name(@data[1], 92, 32 * 1)
draw_item_name(@data[2], 92, 32 * 2)
draw_item_name(@data[3], 92, 32 * 3)
draw_item_name(@data[4], 92, 32 * 4)
end
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
####################
# Window_EquipItem #
####################
class Window_EquipItem < Window_Selectable
def initialize(actor, equip_type)
super(272, 256, 368, 224)
self.opacity = 0
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
def draw_item(index)
self.contents.font.name = "Tahoma"
self.contents.font.size = 14
item = @data[index]
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
###############
# Scene_Equip #
###############
class Scene_Equip
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end
def main
@mnback = Plane.new
@mnback.bitmap = RPG::Cache.picture("MN_BK")
@mnback.z = 1
@mnlay = Sprite.new
@mnlay.bitmap = RPG::Cache.picture("Equip_Lay")
@mnlay.z = 2
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@help_window.opacity = 0
@help_window.x = -300
@help_window.contents_opacity = 0
@left_window = Window_EquipLeft.new(@actor)
@left_window.x = -300
@left_window.contents_opacity = 0
@right_window = Window_EquipRight.new(@actor)
@item_window1 = Window_EquipItem.new(@actor, 0)
@item_window2 = Window_EquipItem.new(@actor, 1)
@item_window3 = Window_EquipItem.new(@actor, 2)
@item_window4 = Window_EquipItem.new(@actor, 3)
@item_window5 = Window_EquipItem.new(@actor, 4)
@item_window1.x = 640
@item_window2.x = 640
@item_window3.x = 640
@item_window4.x = 640
@item_window5.x = 640
@right_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
@right_window.index = @equip_index
@right_window.x = 640
refresh
Graphics.transition(MOG::MSEQPT, "Graphics/Transitions/" + MOG::MSEQPTT)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
for i in 0..20
@left_window.x -= 15
@left_window.contents_opacity -= 10
@item_window.x += 20
@item_window.contents_opacity -= 15
@right_window.x += 20
@right_window.contents_opacity -= 15
Graphics.update
end
Graphics.freeze
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
@mnback.dispose
@mnlay.dispose
end
def refresh
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
item1 = @right_window.item
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
if @right_window.active
@left_window.set_new_parameters(nil, nil, nil,nil, nil, nil,nil)
end
if @item_window.active
item2 = @item_window.item
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
new_dex,new_agi,new_int)
end
end
def update
if @right_window.x > 272
@right_window.x -= 25
elsif @right_window.x <= 272
@right_window.x = 272
end
if @item_window.x > 272
@item_window.x -= 25
elsif @item_window.x <= 272
@item_window.x = 272
end
if @item_window.active == false
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
@item_window.x = 640
end
end
if @left_window.x < 0
@left_window.x += 15
@left_window.contents_opacity += 10
elsif @left_window.x >= 0
@left_window.x = 0
@left_window.contents_opacity = 255
end
if @help_window.x < 0
@help_window.x += 20
@help_window.contents_opacity += 10
elsif @help_window.x >= 0
@help_window.x = 0
@help_window.contents_opacity = 255
end
@mnback.ox += 1
@left_window.update
@right_window.update
@item_window.update
if Input.trigger?(Input::B) or Input.trigger?(Input::C) or
Input.trigger?(Input.dir4) or Input.trigger?(Input::L) or
Input.trigger?(Input::R) or Input.press?(Input.dir4)
@help_window.x = -300
@help_window.contents_opacity = 0
refresh
end
if @right_window.active
update_right
return
end
if @item_window.active
update_item
return
end
end
def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(2)
return
end
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@item_window.active = true
@item_window.index = 0
refresh
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
refresh
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @item_window.item
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
@right_window.refresh
@item_window.refresh
refresh
return
end
end
end
Code: #_______________________________________________________________________________
# MOG Scene Status Eva V1.2
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
module MOG
#Transition Time.
MST_TT = 10
#Transition Type(Name).
MST_TTT = "007-Line01"
# Set Maximum (STR,DEX,AGL,INT)
MST_ST = 999
# Set Maximum (ATK,PDEF,MDEF)
MST_STE = 999
end
$mogscript = {} if $mogscript == nil
$mogscript["menu_eva"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def nada2(actor)
face = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
end
def draw_heroface4(actor,x,y)
face = RPG::Cache.picture(actor.name + "_fc2") rescue nada2(actor)
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
if face == RPG::Cache.battler(actor.battler_name, actor.battler_hue)
self.contents.blt(x + 45 , y - ch - 150, face, src_rect)
else
self.contents.blt(x , y - ch, face, src_rect)
end
end
def draw_actor_parameter2(actor, x, y, type)
back = RPG::Cache.picture("STBAR_Back")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 50 , y - ch + 20, back, src_rect)
meter = RPG::Cache.picture("STBAR.png")
case type
when 0
parameter_value = actor.atk
cw = meter.width * actor.atk / MOG::MST_STE
when 1
parameter_value = actor.pdef
cw = meter.width * actor.pdef / MOG::MST_STE
when 2
parameter_value = actor.mdef
cw = meter.width * actor.mdef / MOG::MST_STE
when 3
parameter_value = actor.str
cw = meter.width * actor.str / MOG::MST_ST
when 4
parameter_value = actor.dex
cw = meter.width * actor.dex / MOG::MST_ST
when 5
parameter_value = actor.agi
cw = meter.width * actor.agi / MOG::MST_ST
when 6
parameter_value = actor.int
cw = meter.width * actor.int / MOG::MST_ST
end
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y - 2, 36, 32, parameter_value.to_s, 2)
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 50 , y - ch + 20, meter, src_rect)
end
def draw_maphp5(actor, x, y)
back = RPG::Cache.picture("BAR")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("HP_Bar2")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 66, y - 1, 100, 32, actor.hp.to_s + "/" + actor.maxhp.to_s, 1)
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(x + 65, y - 2, 100, 32, actor.hp.to_s + "/" + actor.maxhp.to_s, 1)
end
def draw_mapsp5(actor, x, y)
back = RPG::Cache.picture("BAR")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65 , y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("SP_Bar2")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65 , y - ch + 30, meter, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 66, y - 1, 100, 32, actor.sp.to_s + "/" + actor.maxsp.to_s, 1)
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(x + 65, y - 2, 100, 32, actor.sp.to_s + "/" + actor.maxsp.to_s, 1)
end
def draw_mexp5(actor, x, y)
bitmap2 = RPG::Cache.picture("Exp_Back")
cw = bitmap2.width
ch = bitmap2.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60 , y - ch + 30, bitmap2, src_rect)
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
bitmap = RPG::Cache.picture("Exp_Meter")
if actor.level < 99
cw = bitmap.width * rate
else
cw = bitmap.width
end
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60 , y - ch + 30, bitmap, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 51, y , 84, 32, actor.next_rest_exp_s.to_s, 1)
self.contents.font.color = Color.new(55,255,55,255)
self.contents.draw_text(x + 52, y + 1, 84, 32, actor.next_rest_exp_s.to_s, 1)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 45, y + 7, 84, 32, "N",0)
self.contents.font.color = Color.new(55,255,155,255)
self.contents.draw_text(x + 44, y + 8, 84, 32, "N",0)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 10, y + 5, 30, 32, actor.level.to_s, 1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 11, y + 6, 30, 32, actor.level.to_s, 1)
end
end
##################
# Window_Status2 #
##################
class Window_Status < Window_Base
def initialize(actor)
super(0, 0, 660, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
self.opacity = 0
refresh
end
def refresh
self.contents.clear
self.contents.font.name = "Tahoma"
self.contents.font.size = 14
draw_actor_name(@actor,100, 55)
draw_actor_class(@actor, 510, -5 )
draw_mexp5(@actor,310,130)
draw_actor_state(@actor, 130, 55)
draw_maphp5(@actor, 275, 165)
draw_mapsp5(@actor, 430, 165)
draw_actor_parameter2(@actor, 280, 108, 0)
draw_actor_parameter2(@actor, 460, 137, 1)
draw_actor_parameter2(@actor, 460, 108, 2)
draw_actor_parameter2(@actor, 280, 53, 3)
draw_actor_parameter2(@actor, 460, 53, 4)
draw_actor_parameter2(@actor, 280, 80, 5)
draw_actor_parameter2(@actor, 460, 80, 6)
self.contents.font.color = system_color
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 228)
draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 258)
draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 288)
draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 318)
draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 348)
end
def dummy
self.contents.font.color = system_color
self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
end
end
###############
# Window_Face #
###############
class Window_Face < Window_Base
def initialize(actor)
super(0, -20, 300, 520)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
self.opacity = 0
refresh
end
def refresh
self.contents.clear
draw_heroface4(@actor,10,485)
end
end
################
# Scene_Status #
################
class Scene_Status
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
def main
@actor = $game_party.actors[@actor_index]
@status_window = Window_Status.new(@actor)
@status_face = Window_Face.new(@actor)
@status_face.z = 100 # edit: Eigentlic war 20
@status_face.x = -300
@status_face.contents_opacity = 0
@mst_lay = Sprite.new
@mst_lay.bitmap = RPG::Cache.picture("MST_Lay")
@mst_lay.z = 100
@mst_back1 = Plane.new
@mst_back1.bitmap = RPG::Cache.picture("MN_BK")
@mst_back1.z = 10
Graphics.transition(MOG::MST_TT, "Graphics/Transitions/" + MOG::MST_TTT)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
for i in 0..30
@status_face.x -= 20
@status_face.contents_opacity -= 15
Graphics.update
end
Graphics.freeze
@mst_lay.dispose
@mst_back1.dispose
@status_face.dispose
@status_window.dispose
end
def update
@mst_back1.ox += 1
@mst_back1.oy += 1
if @status_face.x < 0
@status_face.x += 20
@status_face.contents_opacity += 15
elsif @status_face.x >= 0
@status_face.x = 0
@status_face.contents_opacity = 255
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(3)
return
end
if Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Status.new(@actor_index)
return
end
if Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Status.new(@actor_index)
return
end
end
end
RE: Just move the Cursor of the Item_Scene to the right - DerVVulfman - 08-09-2015
That is PRECISELY my point about Moghunter's scripts. He rewrites the base code of the Equipment, Status, Items, Skills and all other menus so scripts like this do NOT work. And that is exactly why I mentioned my rewrites as they will work with the add-ons like Atoa's or my Multi-Slot scripts.
Hey, just for a laugh, just try my Moghunter Menus Revisioned demo right Here. You will have the same ARROW issue you had before, but I did describe the sections in the rewrite you would need to adjust (and with fewer lines to edit).
If you try these, you will find them more compliant (well, not 100% guaranteed) to work with more systems. Consider trying it as a birthday present to yourself.
|