赞 | 4 |
VIP | 0 |
好人卡 | 0 |
积分 | 78 |
经验 | 15725 |
最后登录 | 2024-11-21 |
在线时间 | 1343 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7802
- 在线时间
- 1343 小时
- 注册时间
- 2015-8-15
- 帖子
- 752
|
5楼
楼主 |
发表于 2022-10-12 14:59:02
|
只看该作者
本帖最后由 金芒芒 于 2022-10-12 15:10 编辑
- #==============================================================================
- # ■ Window_Status_Slg
- #------------------------------------------------------------------------------
- # SLG战斗中的状态窗口。
- #==============================================================================
- class Window_Status_Slg < Window_Base
- # 变量定义
- attr_accessor :actor
- # 初始化
- def initialize
- super(320, 320, 320,160)
- self.contents = Bitmap.new(width - 32, height - 32)
- #"engage_enermy_base"
- self.contents.font.size = 18
- self.contents.font.name = "Garamond"
- self.opacity = Wzj::OPACITY_IN_SLG
- #@back_engage = Sprite.new
- #@back_engage.bitmap = RPG::Cache.menu("engage_enermy_base")
- #@back_engage.visible = false
- @my_actor = nil
- refresh
- end
- # 刷新
- def refresh
- if @actor != nil and @my_actor != $scene.armies[@actor]
- @my_actor = $scene.armies[@actor]#.clone
- self.contents.clear
- # p @my_actor.player_team,@my_actor
- if @my_actor.player_team
- refresh_us
- else
- refresh_enemy
- end
- end
- end
- def dispose
- super
- # @back_engage.dispose
- end
- # 刷新 我军
- def refresh_us
-
- comment_refresh #if Graphics.frame_count / Graphics.frame_rate != @how_do_i_know_what_is_this
- # 图标
- icon_name = "010-Head01"
- bitmap = RPG::Cache.icon(icon_name)
- self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24))
-
- end
- # 刷新 敌军
- def refresh_enemy
- comment_refresh #if Graphics.frame_count / Graphics.frame_rate != @how_do_i_know_what_is_this
- icon_name = "011-Head02"
- bitmap = RPG::Cache.icon(icon_name)
- self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24))
- end
- end
- ###########################################
- class Window_Status_Slg_componet < Window_Base
- attr_accessor :actor
- def initialize
- super(0, 320, 320,160)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size = 18
- self.contents.font.name = "Garamond"
- self.opacity = Wzj::OPACITY_IN_SLG
- @my_actor = nil
- refresh
- end
- def refresh
- if @actor != nil and @my_actor != $scene.armies[@actor]
- @my_actor = $scene.armies[@actor].clone
- self.contents.clear
- if @my_actor.player_team
- refresh_us
- else
- refresh_enemy
- end
- end
- end
- def refresh_us
- comment_refresh #if Graphics.frame_count / Graphics.frame_rate != @how_do_i_know_what_is_this
- # 图标
- icon_name = "010-Head01"
- bitmap = RPG::Cache.icon(icon_name)
- self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24))
-
- end
- def refresh_enemy
- comment_refresh #if Graphics.frame_count / Graphics.frame_rate != @how_do_i_know_what_is_this
- icon_name = "011-Head02"
- bitmap = RPG::Cache.icon(icon_name)
- self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24))
- end
- end
- =begin
- #==============================================================================
- # ■ Window_PlayTime
- #------------------------------------------------------------------------------
- # 菜单画面显示游戏时间的窗口。
- #==============================================================================
- class Window_PlayTime < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 160, 96)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
- =end
- ######################################################
- class Window_Base
-
-
- def comment_refresh
- return if @my_actor == nil
-
- alives = @my_actor.get_num_all_type(true)
- totals = @my_actor.get_num_all_type
- self.contents.draw_text3(0, 0, 320-16, 32, @my_actor.the_name+" ("+@my_actor.get_alive_num.to_s+"/"+@my_actor.base_member_size.to_s+")", 1)
- self.contents.draw_text(0, 16, 160-8, 32, "总战斗力:", 0)
- self.contents.draw_text(0, 16, 160-16, 32, @my_actor.get_battle_effective.to_s, 2)
- self.contents.draw_text(160-8, 16, 160-8, 32, "士气:", 0)
- self.contents.draw_text(160-8, 16, 160-32, 32, @my_actor.get_morale.to_s, 2)
- self.contents.draw_text(0, 32, 160-8, 32, "轻步兵:", 0)
- self.contents.draw_text(0, 32, 160-16, 32, alives[1].to_s+"/"+totals[1].to_s, 2)
- self.contents.draw_text(160-8, 32, 160-8, 32, "重步兵:", 0)
- self.contents.draw_text(160-8, 32, 160-32, 32, alives[2].to_s+"/"+totals[2].to_s, 2)
- self.contents.draw_text(0, 48, 160-8, 32, "轻骑兵:", 0)
- self.contents.draw_text(0, 48, 160-16, 32, alives[3].to_s+"/"+totals[3].to_s, 2)
- self.contents.draw_text(160-8, 48, 160-8, 32, "重骑兵:", 0)
- self.contents.draw_text(160-8, 48, 160-32, 32, alives[4].to_s+"/"+totals[4].to_s, 2)
- self.contents.draw_text(0, 64, 160-8, 32, "远程步兵:", 0)
- self.contents.draw_text(0, 64, 160-16, 32, alives[5].to_s+"/"+totals[5].to_s, 2)
- self.contents.draw_text(160-8, 64, 160-8, 32, "远程骑兵:", 0)
- self.contents.draw_text(160-8, 64, 160-32, 32, alives[6].to_s+"/"+totals[6].to_s, 2)
- self.contents.draw_text(0,80, 160-8, 32, "精英:", 0)
- self.contents.draw_text(0,80, 160-16, 32, alives[7].to_s+"/"+totals[7].to_s, 2)
- self.contents.draw_text(160-8,80, 160-8, 32, "特殊:", 0)
- self.contents.draw_text(160-8, 80, 160-32, 32, alives[8].to_s+"/"+totals[8].to_s, 2)
- #self.contents.draw_text(0, 16, 160-8, 32, "总战斗力:", 0)
-
-
- end
-
-
- end
- #==============================================================================
- # ■ Window_Item_Slg
- #------------------------------------------------------------------------------
- # SLG中的物品窗口。
- #==============================================================================
- class Window_Item_Slg < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(80, 80, 480, 320)
- self.opacity = Wzj::OPACITY_IN_SLG
- @column_max = 2
- refresh
- self.index = 0
- 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
- # 在战斗中以外添加武器、防具
- unless $game_temp.in_battle
- for i in 1...$data_weapons.size
- if $game_party.weapon_number(i) > 0
- @data.push($data_weapons[i])
- end
- end
- for i in 1...$data_armors.size
- if $game_party.armor_number(i) > 0
- @data.push($data_armors[i])
- end
- end
- end
- # 如果项目数不是 0 就生成位图、重新描绘全部项目
- @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
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- 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
- if item.is_a?(RPG::Item)
- if $game_party.item_can_use?(item.id)
- self.contents.font.color = normal_color
- else
- self.contents.font.color = disabled_color
- end
- else
- self.contents.font.color = normal_color
- end
- x = 4 + index % 2 * (208 + 32)
- y = index / 2 * 32
- rect = Rect.new(x, y, self.width / @column_max - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(item.icon_name)
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
- self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
- self.contents.draw_text(x + 154, y, 16, 32, "×", 1)
- self.contents.draw_text(x + 170, y, 24, 32, number.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- # 文字取得
- text = self.item == nil ? "" : self.item.description
- # 是否移动判断
- if Wzj::HELP_WINDOW_FOLLOW_THE_INDEX
- #-----<邪恶的7行代码>-----
- row = self.index / 2
- if row < self.top_row
- self.top_row = row
- end
- if row > self.top_row + (self.page_row_max - 1)
- self.top_row = row - (self.page_row_max - 1)
- end
- #-------------------------
- # 坐标取得
- x = self.index % 2 * (self.width/2) + self.x + (self.width/2 - 256)/2
- y = self.index / 2 *32 + 16 - self.oy
- # 更新帮助窗口说明
- @help_window.set_text(text, 0, true, self.item, x, y)
- else
- @help_window.set_text(text, 0, true, self.item, 112+self.x, 64+self.y)
- end
- end
- end
- #==============================================================================
- # ■ Window_Skill_Slg
- #------------------------------------------------------------------------------
- # SLG中的技能窗口。
- #==============================================================================
- class Window_Skill_Slg < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(80, 80, 480, 320)
- @actor = actor
- self.opacity = Wzj::OPACITY_IN_SLG
- @column_max = 2
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 获取特技
- #--------------------------------------------------------------------------
- def skill
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- #p @actor.skills.size
- for i in [email protected]
- skill = $data_skills[@actor.skills[i]]
- if skill != nil
- @data.push(skill)
- end
- end
- # 如果项目数不是 0 就生成位图、重新描绘全部项目
- @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
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- skill = @data[index]
- if @actor.skill_can_use?(skill.id)
- self.contents.font.color = normal_color
- else
- self.contents.font.color = disabled_color
- end
- x = 4 + index % 2 * (208 + 32)
- y = index / 2 * 32
- rect = Rect.new(x, y, self.width - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(skill.icon_name)
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
- self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
- self.contents.draw_text(x + 150, y, 48, 32, skill.sp_cost.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- # 文字取得
- text = self.skill == nil ? "" : self.skill.description
- # 是否移动判断
- if Wzj::HELP_WINDOW_FOLLOW_THE_INDEX
- #-----<邪恶的7行代码>-----
- row = self.index / 2
- if row < self.top_row
- self.top_row = row
- end
- if row > self.top_row + (self.page_row_max - 1)
- self.top_row = row - (self.page_row_max - 1)
- end
- #-------------------------
- # 坐标取得
- x = self.index % 2 * (self.width/2) + self.x + (self.width/2 - 256)/2
- y = self.index / 2 *32 + 16 - self.oy
- # 更新帮助窗口说明
- @help_window.set_text(text, 0, true, self.skill, x, y)
- else
- @help_window.set_text(text, 0, true, self.skill, 112+self.x, 64+self.y)
- end
- end
- end
- #==============================================================================
- # ■ Win_Lv
- #------------------------------------------------------------------------------
- # SLG中的升级提示窗口。
- #==============================================================================
- class Win_Lv < Window_Base
-
- attr_accessor :n1
- attr_accessor :n2
- attr_accessor :n3
- attr_accessor :n4
- attr_accessor :n5
- attr_accessor :n6
- attr_accessor :n7
- attr_accessor :actor
-
- def initialize(last_skill)
- super(0, 0, 224, 260)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size = 20
- self.contents.font.name = "楷体_GB2312"
- self.opacity = Wzj::OPACITY_IN_SLG
- @last_skill = last_skill
- @my_actor = nil
- refresh
- end
- def refresh
- self.contents.clear
- if @actor == nil
- return
- end
- # 获取角色
- @my_actor = $scene.battler[@actor].clone
- # 新技能判断
- skill = []
- if @last_skill != @my_actor.skills
- skill = @my_actor.skills - @last_skill
- self.height += 32*skill.size
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size = 20
- self.contents.font.name = "楷体_GB2312"
- self.y = 240-self.height/2
- end
- l = 32
- # 获取升级前能力值
- lv = @my_actor.level-@n1
- hp = @my_actor.maxhp-@n2
- sp = @my_actor.maxsp-@n3
- str = @my_actor.str-@n4
- dex = @my_actor.dex-@n5
- agi = @my_actor.agi-@n6
- int = @my_actor.int-@n7
-
- w = contents.text_size("等级:").width
- w1= contents.text_size(lv.to_s).width
- # 字的描绘
- self.contents.font.color = system_color
- self.contents.draw_text(0, 0*l, 84 ,32, "等级:", 0)
- self.contents.draw_text(0, 1*l, 84 ,32, "HP:", 0)
- self.contents.draw_text(0, 2*l, 84 ,32, "SP:", 0)
- self.contents.draw_text(0, 3*l, 84 ,32, "力量:", 0)
- self.contents.draw_text(0, 4*l, 84 ,32, "技术:", 0)
- self.contents.draw_text(0, 5*l, 84 ,32, "速度:", 0)
- self.contents.draw_text(0, 6*l, 84 ,32, "魔力:", 0)
- # 升级前属性值描绘
- self.contents.font.color = Color.new(255,255,255,255)
- self.contents.draw_text(w, 0*l, 84 ,32, lv.to_s, 0)
- self.contents.draw_text(w, 1*l, 84 ,32, hp.to_s, 0)
- self.contents.draw_text(w, 2*l, 84 ,32, sp.to_s, 0)
- self.contents.draw_text(w, 3*l, 84 ,32, str.to_s, 0)
- self.contents.draw_text(w, 4*l, 84 ,32, dex.to_s, 0)
- self.contents.draw_text(w, 5*l, 84 ,32, agi.to_s, 0)
- self.contents.draw_text(w, 6*l, 84 ,32, int.to_s, 0)
- # "+" 号描绘
- a = 24
- self.contents.draw_text(w+w1+a, 0*l, 84 ,32, "+", 0)
- self.contents.draw_text(w+w1+a, 1*l, 84 ,32, "+", 0)
- self.contents.draw_text(w+w1+a, 2*l, 84 ,32, "+", 0)
- self.contents.draw_text(w+w1+a, 3*l, 84 ,32, "+", 0)
- self.contents.draw_text(w+w1+a, 4*l, 84 ,32, "+", 0)
- self.contents.draw_text(w+w1+a, 5*l, 84 ,32, "+", 0)
- self.contents.draw_text(w+w1+a, 6*l, 84 ,32, "+", 0)
- # 增加属性值描绘
- self.contents.font.color = Color.new(255,0,0,255)
- self.contents.draw_text(w+w1+a+16, 0*l, 84 ,32, @n1.to_s, 0)
- self.contents.draw_text(w+w1+a+16, 1*l, 84 ,32, @n2.to_s, 0)
- self.contents.draw_text(w+w1+a+16, 2*l, 84 ,32, @n3.to_s, 0)
- self.contents.draw_text(w+w1+a+16, 3*l, 84 ,32, @n4.to_s, 0)
- self.contents.draw_text(w+w1+a+16, 4*l, 84 ,32, @n5.to_s, 0)
- self.contents.draw_text(w+w1+a+16, 5*l, 84 ,32, @n6.to_s, 0)
- self.contents.draw_text(w+w1+a+16, 6*l, 84 ,32, @n7.to_s, 0)
- # "=" 号描绘
- self.contents.font.color = Color.new(255,255,255,255)
- self.contents.draw_text(w+w1+a+48, 0*l, 84 ,32, "=", 0)
- self.contents.draw_text(w+w1+a+48, 1*l, 84 ,32, "=", 0)
- self.contents.draw_text(w+w1+a+48, 2*l, 84 ,32, "=", 0)
- self.contents.draw_text(w+w1+a+48, 3*l, 84 ,32, "=", 0)
- self.contents.draw_text(w+w1+a+48, 4*l, 84 ,32, "=", 0)
- self.contents.draw_text(w+w1+a+48, 5*l, 84 ,32, "=", 0)
- self.contents.draw_text(w+w1+a+48, 6*l, 84 ,32, "=", 0)
- # 描绘当前属性值
- self.contents.font.color = Color.new(0,255,0,255)
- self.contents.draw_text(w+w1+a+64, 0*l, 84 ,32, @my_actor.level.to_s, 0)
- self.contents.draw_text(w+w1+a+64, 1*l, 84 ,32, @my_actor.maxhp.to_s, 0)
- self.contents.draw_text(w+w1+a+64, 2*l, 84 ,32, @my_actor.maxsp.to_s, 0)
- self.contents.draw_text(w+w1+a+64, 3*l, 84 ,32, @my_actor.str.to_s, 0)
- self.contents.draw_text(w+w1+a+64, 4*l, 84 ,32, @my_actor.dex.to_s, 0)
- self.contents.draw_text(w+w1+a+64, 5*l, 84 ,32, @my_actor.agi.to_s, 0)
- self.contents.draw_text(w+w1+a+64, 6*l, 84 ,32, @my_actor.int.to_s, 0)
- # 新技能描绘
- if skill.size != 0
- for i in 0...skill.size
- now_skill = $data_skills[skill[i]]
- self.contents.font.color = text_color(5)
- self.contents.draw_text(0,(7+i)*l,188,32, "学会特技:"+now_skill.name,0)
- self.contents.font.color = text_color(6)
- self.contents.draw_text(0,(7+i)*l,188,32, " "+now_skill.name,0)
- end
- end
- end
- end
- #==============================================================================
- # ■ Window_Treasure
- #------------------------------------------------------------------------------
- # SLG中的宝物提示窗口。
- #==============================================================================
- class Window_Treasure < Window_Base
- def initialize(item)
- super(160, 208, 376, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size = 20
- self.contents.font.name = "楷体_GB2312"
- self.contents.font.color = system_color
- @item = item
- self.opacity = Wzj::OPACITY_IN_SLG
- refresh
- end
- def refresh
- self.contents.clear
- w1 = contents.text_size("从敌军处得到了:").width
- name = @item.name
- w2 = contents.text_size(name).width
- w3 = w1+w2+32
- bitmap = RPG::Cache.icon(@item.icon_name)
- self.contents.blt((344-w3)/2+w1+4, 2, bitmap, Rect.new(0, 0, 24, 24))
- self.contents.draw_text((344-w3)/2,0,w1,32,"从敌军处得到了:",0)
- self.contents.font.color = Color.new(255,0,0,255)
- self.contents.draw_text((344-w3)/2+w1+32,0,w1,32,name,0)
- end
- end
复制代码
我想要敌方根据事件而改变icon_name=图标 |
|