Project1

标题: 想不战斗也在地图显示体力值 气力值,怎么弄? [打印本页]

作者: 惊天动地    时间: 2012-9-8 14:16
标题: 想不战斗也在地图显示体力值 气力值,怎么弄?
大侠们好

          我的是xp, 想在地图上显示体力值气力值,不战斗也显示,能做到吗,有的地图想显示有的不想显示,随时能调整吗?

谢谢
作者: 小夏坑面包    时间: 2012-9-8 14:20
我也是新手,总结出一条结论。 要当就当 SSD 【不是森手党 是搜索党】 哇咔咔 请LZ善用于搜索 地图上显示血条
作者: chd114    时间: 2012-9-8 14:33
  1. Playerdate_SWITCH = 1 # 当1号开关打开,本脚本才开始工作。
  2. Playerdate_magicdef =19
  3. Yellowkey_itemid=1
  4. Bluekey_itemid=2
  5. Redkey_itemid=3
  6. Greenkey_itemid=41

  7. #==============================================================================
  8. # ■ Window_PlayerDate
  9. #------------------------------------------------------------------------------
  10. #  显示玩家状态的窗口。
  11. #==============================================================================

  12. class Window_PlayerDate < Window_Base
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化窗口
  15.   #--------------------------------------------------------------------------
  16.   def initialize
  17.     super(0, 0, 800, 608)#395)#192,416
  18.     self.contents = Bitmap.new(width - 32, height - 32)
  19.     self.z =210
  20.     self.opacity=0
  21.     self.back_opacity =255
  22. #    self.contents_opacity = 255
  23.     self.visible = false
  24. #    self.contents.clear
  25.     refresh
  26. #    if $game_switches[XY_SWITCH]
  27. #      self.contents_opacity = 0
  28. #    else
  29. #      self.contents_opacity = 5
  30. #    end
  31.    
  32.   end
  33.   
  34.   def refresh
  35.     if $game_switches[50]#进入屏幕右侧状态栏换到左侧
  36.       self.x=0
  37.     else#进入屏幕左侧状态栏换到右侧
  38.       self.x=600
  39.     end

  40.     self.contents.clear
  41.     x=25
  42.     y=75
  43.     draw_actor_graphic($game_party.actors[0], 20, 40)
  44.     #勇士图形
  45.     self.contents.font.color = system_color
  46.     #t = Time.now
  47.     #@ty=Time.now.year
  48.     #@tm=Time.now.month
  49.     #@tw=Time.now.wday
  50.     #@th=Time.now.hour
  51.     #@tm=Time.now.min
  52.     #@ts=Time.now.sec
  53.     #self.contents.draw_text(0, 65+x*16, 200, 20, t.to_s, 0)
  54.     #self.contents.draw_text(0, 65+x*17, 200, 20, @ty.to_s+"年"[email protected]_s+"月"+"星期"[email protected]_s, 0)
  55.     #self.contents.draw_text(0, 65+x*18, 200, 20, @th.to_s+"时"[email protected]_s+"分"[email protected]_s+"秒", 0)
  56. #   bitmap = Bitmap.new("Graphics/Pictures/状态栏.png")
  57.   #  self.contents.blt(-30, -30, bitmap, Rect.new(0, 0, 192, 610))
  58.     if $game_switches[73]==false
  59.       self.contents.draw_text(35, 11, 50, 20, "魔塔", 0) if $game_switches[36]
  60.       self.contents.draw_text(85, 36, 25, 20, "层", 0)if $game_switches[36]
  61.     else
  62.       if $game_variables[37]==0
  63.         self.contents.draw_text(32, -28, 200, 100,  $data_mapname[1].name.split(":")[2].to_s, 0)
  64.       else
  65.         self.contents.draw_text(32, -28, 200, 100,  $data_mapname[$game_variables[37]].name.split(":")[2].to_s, 0)
  66.         #以上是判定地图名字显示
  67.       end
  68.     end
  69.     self.contents.draw_text(0, 50, 40, 20, "LV", 0)
  70.    
  71.     if $game_switches[1]
  72.     @data = []
  73.     @data.push($data_weapons[$game_party.actors[0].weapon_id])
  74.     @data.push($data_armors[$game_party.actors[0].armor1_id])
  75.     @data.push($data_armors[$game_party.actors[0].armor2_id])
  76.     @data.push($data_armors[$game_party.actors[0].armor3_id])
  77.     @data.push($data_armors[$game_party.actors[0].armor4_id])
  78.     @data.push($data_armors[$game_party.actors[0].armor5_id])
  79.     @data.push($data_armors[$game_party.actors[0].armor6_id])
  80.     @data.push($data_armors[$game_party.actors[0].armor7_id])
  81.     @data.push($data_armors[$game_party.actors[0].armor8_id])
  82.     @data.push($data_armors[$game_party.actors[0].armor9_id])
  83.     @data.push($data_armors[$game_party.actors[0].armor10_id])
  84.     @data.push($data_armors[$game_party.actors[0].armor11_id])
  85.     @data.push($data_armors[$game_party.actors[0].armor12_id])
  86.     @item_max = @data.size
  87.     draw_item_bitmap(@data[0], 0,  -25+x*15)
  88.     draw_item_bitmap(@data[1], 32, -25+x*15)
  89.     draw_item_bitmap(@data[2], 64, -25+x*15)
  90.     draw_item_bitmap(@data[3], 96, -25+x*15)
  91.     draw_item_bitmap(@data[4], 128,-25+x*15)
  92.     draw_item_bitmap(@data[5], 0, -25+x*16)
  93.     draw_item_bitmap(@data[6], 32, -25+x*16)
  94.     draw_item_bitmap(@data[7], 64, -25+x*16)
  95.     draw_item_bitmap(@data[8], 96, -25+x*16)
  96.     draw_item_bitmap(@data[9], 128,-25+x*16)
  97.     draw_item_bitmap(@data[10], 0, -25+x*17)
  98.     draw_item_bitmap(@data[11], 32, -25+x*17)
  99.     draw_item_bitmap(@data[12], 64, -25+x*17)
  100.     self.contents.font.color = system_color
  101.     #draw_item_bitmap($game_party.item_icon(item.id),32,60)
  102.     end     
  103.     draw_actor_graphic($game_party.actors[0], 20, 40)#角色正面图
  104.     self.contents.font.color = text_color(1)
  105.     self.contents.draw_text(0, 45+x, 40, 20, "HP", 0)
  106.     self.contents.font.color = text_color(8)
  107.     self.contents.draw_text(0, 40+x*2, 40, 20, "SP", 0)
  108.     if $game_switches[19]
  109.       self.contents.font.color = text_color(1)
  110.       self.contents.draw_text(0, 35+x*3, 40, 20,"魔攻", 0)
  111.       self.contents.font.color = text_color(8)
  112.       self.contents.draw_text(0, 30+x*4, 40, 20,"魔防", 0)
  113.     else
  114.       self.contents.font.color = text_color(4)
  115.       self.contents.draw_text(0, 35+x*3, 40, 20,"物攻", 0)
  116.       self.contents.font.color = text_color(6)
  117.       self.contents.draw_text(0, 30+x*4, 40, 20,"物防", 0)
  118.     end
  119.     self.contents.font.color = text_color(7)
  120.     self.contents.draw_text(0, 25+x*5, 40, 20, "科攻", 0)
  121.     self.contents.draw_text(0, 20+x*6, 40, 20, "科防", 0)
  122.     self.contents.font.color = text_color(11)
  123.     self.contents.draw_text(0, 15+x*7, 40, 20,"攻速", 0)
  124.     self.contents.draw_text(0, 10+x*8, 40, 20,"移速", 0)
  125.     self.contents.font.color = text_color(2)
  126.     self.contents.draw_text(0, 5+x*9, 40, 20, "吸血", 0)
  127.     self.contents.font.color = text_color(12)
  128.     self.contents.draw_text(0, x*10, 40, 20, "反弹", 0)
  129.     self.contents.font.color = text_color(2)
  130.     self.contents.draw_text(0, -5+x*11, 40, 20, "命中", 0)
  131.     self.contents.font.color = text_color(9)
  132.     self.contents.draw_text(0, -10+x*12, 40, 20, "闪避", 0)
  133.     self.contents.font.color = text_color(4)
  134.     self.contents.draw_text(0, -15+x*13, 40, 20, "ELY", 0)
  135.     self.contents.draw_text(0, -20+x*14, 40, 20, "EXP", 0)
  136.     @xx=$game_player.x
  137.     @xy=$game_player.y
  138.     self.contents.draw_text(0, -25+x*15, 40, 20, @xx.to_s+","[email protected]_s, 0)
  139.     @xgraphic=$game_party.actors[0]
  140.     if $game_switches[73]==false
  141.       @xmota=$game_variables[3]
  142.       @xfloor=$game_variables[2]
  143.     else
  144.       
  145.     end
  146.     @xlevel=$game_actors[$game_variables[1]+1].level
  147.     @xlife=$game_actors[$game_variables[1]+1].hp
  148.     @xmagic=$game_actors[$game_variables[1]+1].sp
  149.     if $game_switches[19]
  150.       @xattact=$game_actors[$game_variables[1]+1].agi
  151.       @xdefence=$game_actors[$game_variables[1]+1].int
  152.     else
  153.       @xattact=$game_actors[$game_variables[1]+1].str
  154.       @xdefence=$game_actors[$game_variables[1]+1].dex
  155.     end
  156.     @xmagicdef=$game_actors[$game_variables[1]+2].hp
  157.     @xspeed=$game_actors[$game_variables[1]+2].sp
  158.     @xgongsu=$game_actors[$game_variables[1]+2].level
  159.     @xyisu=$game_actors[$game_variables[1]+2].exp
  160.     @xxixue=$game_actors[$game_variables[1]+2].str
  161.     @xfantan=$game_actors[$game_variables[1]+2].dex
  162.     @xmingzhong=$game_actors[$game_variables[1]+2].agi
  163.     @xshanbi=$game_actors[$game_variables[1]+2].int
  164.     @xgold=$game_party.gold
  165.     @xexp= $game_actors[$game_variables[1]+1].exp
  166.     @xclass=$game_actors[$game_variables[1]+1].class_name
  167.     @xyellowkey=$game_party.item_number(1)
  168.     @xbluekey=$game_party.item_number(2)
  169.     @xredkey=$game_party.item_number(3)
  170.     @xgreenkey=$game_party.item_number(4)
  171.     @xhong=$game_switches[59]
  172.     @xcheng=$game_switches[15]
  173.     @xhuang=$game_switches[58]
  174.     @xlv=$game_switches[13]
  175.     @xqing=$game_switches[16]
  176.     @xlan=$game_switches[12]
  177.     @xzi=$game_switches[61]
  178.     @xfen=$game_switches[60]
  179.     @xhui=$game_switches[11]
  180.     @xhei=$game_switches[62]
  181.     @xbai=$game_switches[63]
  182.     @xchange=$game_switches[50]
  183.    
  184.     self.contents.font.color = normal_color
  185.     if $game_switches[73]==false
  186.       self.contents.draw_text(35, 0, 80, 45, @xmota.to_s, 2)
  187.       self.contents.draw_text(5, 25, 60, 45, @xfloor.to_s, 2) if $game_switches[36]
  188.       self.contents.draw_text(5, 25, 80, 45, @xfloor.to_s, 2) if !$game_switches[36]
  189.     else
  190.       
  191.     end
  192.     self.contents.draw_text(50, 40, 65, 30, @xlevel.to_s, 2)
  193.     self.contents.draw_text(43, 45+x, 72, 20,@xlife .to_s, 2)
  194.     self.contents.draw_text(43, 40+x*2, 72, 20,@xmagic .to_s, 2)
  195.     if $game_switches[19]
  196.       self.contents.draw_text(50, 35+x*3, 65, 20,@xattact .to_s, 2)
  197.       self.contents.draw_text(50, 30+x*4, 65, 20,@xdefence .to_s, 2)
  198.     else
  199.       self.contents.draw_text(50, 35+x*3, 65, 20,@xattact .to_s, 2)
  200.       self.contents.draw_text(50, 30+x*4, 65, 20,@xdefence .to_s, 2)
  201.     end
  202.     self.contents.draw_text(50, 25+x*5, 65, 20,@xmagicdef .to_s, 2)
  203.     self.contents.draw_text(50, 20+x*6, 65, 20,@xspeed .to_s, 2)
  204.     self.contents.draw_text(50, 15+x*7, 65, 20,@xgongsu.to_s, 2)
  205.     self.contents.draw_text(50, 10+x*8, 65, 20,@xyisu.to_s, 2)
  206.     self.contents.draw_text(50, 5+x*9, 65, 20,@xxixue.to_s+"%", 2)
  207.     self.contents.draw_text(50, x*10, 65, 20,@xfantan.to_s+"%", 2)
  208.     self.contents.draw_text(50, -5+x*11, 65, 20,@xmingzhong.to_s+"%", 2)
  209.     self.contents.draw_text(50, -10+x*12, 65, 20,@xshanbi.to_s+"%", 2)
  210.     self.contents.draw_text(50, -15+x*13, 65, 20, @xgold.to_s, 2)
  211.     self.contents.draw_text(50, -20+x*14, 65, 20,@xexp.to_s, 2)
  212.     self.contents.draw_text(96, -25+x*17, 65, 20,@xclass.to_s, 2)
  213.    
  214.     #bitmap = RPG::Cache.icon($data_items[1].icon_name)#黄钥匙)
  215.     self.contents.blt(0, x*18, RPG::Cache.icon($data_items[1].icon_name), Rect.new(0, 0, 32, 32))
  216.     #bitmap = RPG::Cache.icon($data_items[2].icon_name)#黄钥匙)
  217.     self.contents.blt(32, x*18, RPG::Cache.icon($data_items[2].icon_name), Rect.new(0, 0, 32, 32))
  218.     self.contents.font.color = text_color(6)
  219.     self.contents.draw_text(5, 10+x*18, 25, 20, @xyellowkey.to_s, 2)
  220.     self.contents.font.color = text_color(4)
  221.     self.contents.draw_text(37, 10+x*18, 25, 20, @xbluekey .to_s, 2)
  222.     self.contents.font.color = text_color(2)
  223.     self.contents.draw_text(69, 10+x*18, 25, 20, @xredkey.to_s, 2)
  224.     self.contents.font.color = text_color(3)
  225.     self.contents.draw_text(111, 10+x*18, 25, 20, @xgreenkey.to_s, 2)
  226.    
  227.     self.contents.font.color = text_color(1)
  228.     self.contents.draw_text(0,  5+x*17,20,20, "灼".to_s, 0) if $game_switches[59]
  229.     self.contents.font.color = text_color(3)
  230.     self.contents.draw_text(16, 5+x*17,20,20, "衰".to_s, 0) if $game_switches[15]
  231.     self.contents.font.color = text_color(4)
  232.     self.contents.draw_text(32, 5+x*17,20,20, "衰".to_s, 0) if $game_switches[58]
  233.     self.contents.font.color = text_color(6)
  234.     self.contents.draw_text(48, 5+x*17,20,20, "毒".to_s, 0) if $game_switches[13]
  235.     self.contents.font.color = text_color(7)
  236.     self.contents.draw_text(64, 5+x*17,20,20, "咒".to_s, 0) if $game_switches[16]
  237.     self.contents.font.color = text_color(8)
  238.     self.contents.draw_text(80, 5+x*17,20,20, "缓".to_s, 0) if $game_switches[12]
  239.     self.contents.font.color = text_color(10)
  240.     self.contents.draw_text(96, 5+x*17,20,20, "锁".to_s, 0) if $game_switches[61]
  241.     self.contents.font.color = text_color(11)
  242.     self.contents.draw_text(112,5+x*17,20,20, "怨".to_s, 0) if $game_switches[60]
  243.     self.contents.font.color = text_color(13)
  244.     self.contents.draw_text(128,5+x*17,20,20, "亡".to_s, 0) if $game_switches[11]
  245.     self.contents.font.color = text_color(14)
  246.     self.contents.draw_text(144,5+x*17,20,20, "引".to_s, 0) if $game_switches[62]
  247.     self.contents.font.color = text_color(0)
  248.     self.contents.draw_text(160,5+x*17,20,20, "反".to_s, 0) if $game_switches[63]   
  249.   end
  250.   
  251.   def judge#用于判断是否数据变更,节约内存
  252.     return true if @xgraphic!=$game_party.actors[0]
  253.     return true if @xmota!=$game_variables[3]
  254.     return true if @xfloor!=$game_variables[2]
  255.    # return true if @ty!=Time.now.year
  256.    # return true if @tm!=Time.now.month
  257.    # return true if @tw!=Time.now.wday
  258.    # return true if @th!=Time.now.hour
  259.    # return true if @tm!=Time.now.min
  260.    # return true if @ts!=Time.now.sec
  261.     return true if @xx!=$game_player.x
  262.     return true if @xy!=$game_player.y
  263.     return true if @xlevel!=$game_actors[$game_variables[1]+1].level
  264.     return true if @xlife!=$game_actors[$game_variables[1]+1].hp
  265.     return true if @xmagic!=$game_actors[$game_variables[1]+1].sp
  266.     if $game_switches[19]
  267.       return true if @xattact!=$game_actors[$game_variables[1]+1].agi
  268.       return true if @xdefence!=$game_actors[$game_variables[1]+1].int
  269.     else
  270.       return true if @xattact!=$game_actors[$game_variables[1]+1].str
  271.       return true if @xdefence!=$game_actors[$game_variables[1]+1].dex
  272.     end
  273.     return true if @xmagicdef!=$game_actors[$game_variables[1]+2].hp
  274.     return true if @xspeed!=$game_actors[$game_variables[1]+2].sp
  275.     return true if @xgongsu!=$game_actors[$game_variables[1]+2].level
  276.     return true if @xyisu!=$game_actors[$game_variables[1]+2].exp
  277.     return true if @xxixue!=$game_actors[$game_variables[1]+2].str
  278.     return true if @xfantan!=$game_actors[$game_variables[1]+2].dex
  279.     return true if @xmingzhong!=$game_actors[$game_variables[1]+2].agi
  280.     return true if @xshanbi!=$game_actors[$game_variables[1]+2].int
  281.     return true if @xgold!=$game_party.gold
  282.     return true if @xexp!= $game_actors[$game_variables[1]+1].exp
  283.     return true if @xyellowkey!=$game_party.item_number(Yellowkey_itemid)
  284.     return true if @xbluekey!=$game_party.item_number(Bluekey_itemid)
  285.     return true if @xredkey!=$game_party.item_number(Redkey_itemid)
  286.     return true if @xgreenkey!=$game_party.item_number(Greenkey_itemid)
  287.     return true if @xhong!=$game_switches[59]
  288.     return true if @xcheng!=$game_switches[15]
  289.     return true if @xhuang!=$game_switches[58]
  290.     return true if @xlv!=$game_switches[13]
  291.     return true if @xqing!=$game_switches[16]
  292.     return true if @xlan!=$game_switches[12]
  293.     return true if @xzi!=$game_switches[61]
  294.     return true if @xfen!=$game_switches[60]
  295.     return true if @xhui!=$game_switches[11]
  296.     return true if @xhei!=$game_switches[62]
  297.     return true if @xbai!=$game_switches[63]
  298.     return true if @xchange!=$game_switches[50]
  299.     return false
  300.   end

  301. end

  302. ###########################################################################
  303. #                           下面的东西不需要掌握~                         #
  304. ###########################################################################

  305. class Scene_Map
  306. alias xy_66rpg_main main
  307. def main
  308. $mapdamage.mapupdate
  309. @Playerdate_window = Window_PlayerDate.new
  310. @Playerdate_window.x = $game_variables[105]
  311. # @xy_window.y = 480 - 96
  312. # @xy_window.opacity = 0
  313. xy_66rpg_main
  314. @Playerdate_window .dispose
  315. $mapdamage.pic.bitmap.clear
  316. end
  317. #--------------------------------------------------------------------------
  318. # ● 刷新画面
  319. #--------------------------------------------------------------------------
  320. alias xy_66rpg_update update
  321. def update
  322. xy_66rpg_update
  323. if $game_switches[Playerdate_SWITCH]
  324. @Playerdate_window .visible = true
  325. if @Playerdate_window.judge
  326. @Playerdate_window .refresh
  327. $mapdamage.mapupdate
  328. end
  329. else
  330. @Playerdate_window .visible = false
  331. end
  332. end
  333. end

  334. #==========================================================================
  335. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  336. #==========================================================================
复制代码
不想到的部分直接去掉吧···




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1