设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1304|回复: 1
打印 上一主题 下一主题

[已经解决] 为什么在这个脚本显示地图名称只会显示1

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
5 小时
注册时间
2012-7-16
帖子
33
跳转到指定楼层
1
发表于 2012-7-16 12:17:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

  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.   
  35.   def refresh
  36.     if $game_switches[50]#进入屏幕右侧状态栏换到左侧
  37.       self.x=0
  38.     else#进入屏幕左侧状态栏换到右侧
  39.       self.x=600
  40.     end

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

  288. end

  289. ###########################################################################
  290. #                           下面的东西不需要掌握~                         #
  291. ###########################################################################

  292. class Scene_Map
  293. alias xy_66rpg_main main
  294. def main
  295. $mapdamage.mapupdate
  296. @Playerdate_window = Window_PlayerDate.new
  297. @Playerdate_window.x = $game_variables[105]
  298. # @xy_window.y = 480 - 96
  299. # @xy_window.opacity = 0
  300. xy_66rpg_main
  301. @Playerdate_window .dispose
  302. $mapdamage.pic.bitmap.clear
  303. end
  304. #--------------------------------------------------------------------------
  305. # ● 刷新画面
  306. #--------------------------------------------------------------------------
  307. alias xy_66rpg_update update
  308. def update
  309. xy_66rpg_update
  310. if $game_switches[Playerdate_SWITCH]
  311. @Playerdate_window .visible = true
  312. if @Playerdate_window.judge
  313. @Playerdate_window .refresh
  314. $mapdamage.mapupdate
  315. end
  316. else
  317. @Playerdate_window .visible = false
  318. end
  319. end
  320. end

  321. #==========================================================================
  322. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以逃脱哦
  323. #==========================================================================
复制代码
我把地图名字设置为“1:35:神殿“,p出来的是”1:35:神殿“,在状态栏里面显示的是1,但是我只想在这个状态栏脚本里面显示神殿二字该怎么做?


Lv5.捕梦者

梦石
0
星屑
39016
在线时间
5717 小时
注册时间
2006-11-10
帖子
6619
2
发表于 2012-7-16 14:12:26 | 只看该作者


if $game_switches[73]==false#73号开关打开的话就像VX的AMTT魔塔样板一样显示另外的地图名字

这里作者不是提供了一个显示另外名字的方法了么

评分

参与人数 1梦石 +2 收起 理由
hcm + 2 认可答案

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-23 05:02

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表