| 
 
| 赞 | 1 |  
| VIP | 0 |  
| 好人卡 | 3 |  
| 积分 | 0 |  
| 经验 | 6939 |  
| 最后登录 | 2015-12-25 |  
| 在线时间 | 47 小时 |  
 Lv1.梦旅人 
	梦石0 星屑45 在线时间47 小时注册时间2009-6-1帖子127 | 
| 
本帖最后由 WildDagger 于 2012-2-25 23:07 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 基本上是讓擁有屬性的武器可以馬上被辨識出是哪個屬性,
 某程度上是仿雲之遙的屬性武器列表而做的。
 
 衝突可能:基本上是動到物品顏色的腳本穩衝,如果有動到特徵的腳本,說不定也有衝突的可能性。
 
 設定多個屬性的時候,以設置在特徵欄最上面的屬性為準(例如依序設置了火、風、土三屬性的話,採用火屬性設定的顏色),如果該屬性沒有設定顏色,就用通用顏色為準。
 執行圖(沒做過介面漢化,只是把文字改成標楷體)复制代码
# 屬性武器顏色專用腳本
# 可能衝突:
#   基本上是動到物品顏色的腳本穩衝
#===================================
#  ●設定區域
#===================================
module WD
module Weapon_Color
  #顏色的代號為文章表示使用的顏色代碼
  
  WEAPON_COLOR = [
    0,  #通用的顏色
    0,  #屬性1使用顏色
    10, #屬性2使用顏色
    12, #屬性3使用顏色
    31, #屬性4使用顏色,請依序追加
  ]  # 請勿刪除此括號!
  
  # 是否開啟角色名稱使用屬性顏色表示,以裝備在裝備欄的第一個武器為準。
  ELEMENT_NAME_COLOR = true
end
end
#===================================
#  ●設定結束
#===================================
class Window_Base < Window
  include WD::Weapon_Color
  
  def item_color(item)
    if item.is_a?(RPG::Skill)
      normal_color
    else
      if item.is_a?(RPG::Weapon)
        # 取得武器攻擊屬性
        weapon_color(weapon_attackelement(item))
      else
        # 非武器則用原本的顏色。
        normal_color
      end
    end
  end
  
  def weapon_attackelement(item)
    w_element = []
    item.features.each_with_index do |feature, i|
      if feature.code == 31
        w_element.push(feature.data_id)
      end
    end
    return w_element
  end
  
  def weapon_color(set)
    set_color = WEAPON_COLOR[set[0]]
    if set_color == nil
      set_color = WEAPON_COLOR[0]
    end
    text_color(set_color)
  end
  
  # 描繪物品顏色(再定義)
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, x, y, enabled)
    change_color(item_color(item), enabled)
    draw_text(x + 24, y, width, line_height, item.name)
    change_color(normal_color, enabled)
  end
  
  #--------------------------------------------------------------------------
  # ● 職業の描画
  #--------------------------------------------------------------------------
  def draw_actor_class(actor, x, y, width = 112)
    if ELEMENT_NAME_COLOR #判斷是否需要以顏色顯示職業。
      change_color(weapon_color(weapon_attackelement(actor.weapons[0])))
    else
      change_color(normal_color)
    end
    draw_text(x, y, width, line_height, actor.class.name)
  end
end
 
   | 
 评分
查看全部评分
 |