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

Project1

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

[已经解决] 請問如何更改message的顏色

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
102 小时
注册时间
2010-6-20
帖子
16
跳转到指定楼层
1
发表于 2012-4-5 10:27:21 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 np9915 于 2012-4-6 13:04 编辑

謝謝點進來為我解惑的人!!

事件裡的腳本,如下:
message = "早安"
$game_map.show_text($game_player,message)



但跑出來的顏色皆為預設的白色,請問要怎麼更改顏色呢?
煩請各位大大指教!

下圖為實際圖:

Lv4.逐梦者 (管理员)

砂上描绘的愿想

梦石
15
星屑
4125
在线时间
5076 小时
注册时间
2012-1-15
帖子
4618

开拓者贵宾短篇七成年组亚军剧作品鉴家

2
发表于 2012-4-5 11:02:13 | 只看该作者
你用了什么脚本啊? 默认脚本的Game_map里有show_text?
若后退就皆成谎言。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
102 小时
注册时间
2010-6-20
帖子
16
3
 楼主| 发表于 2012-4-5 12:24:01 | 只看该作者
本帖最后由 np9915 于 2012-4-5 12:25 编辑

Sapphire Action System IV的系統!
所以這是無法更改的囉@@...
謝謝大大的回覆!>"<
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (管理员)

砂上描绘的愿想

梦石
15
星屑
4125
在线时间
5076 小时
注册时间
2012-1-15
帖子
4618

开拓者贵宾短篇七成年组亚军剧作品鉴家

4
发表于 2012-4-5 12:37:06 | 只看该作者
np9915 发表于 2012-4-5 12:24
Sapphire Action System IV的系統!
所以這是無法更改的囉@@...
謝謝大大的回覆!>"<

你先把那什么系统放出来啊…… 至少把def show_text那一段贴出来
若后退就皆成谎言。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
102 小时
注册时间
2010-6-20
帖子
16
5
 楼主| 发表于 2012-4-5 12:47:19 | 只看该作者
本帖最后由 迷糊的安安 于 2012-4-6 11:06 编辑
  1. #-------------------------------------------------------------------------------
  2. # * [ACE] Sapphire Action System IV
  3. #-------------------------------------------------------------------------------
  4. # * By Khas Arcthunder - arcthunder.site40.net
  5. # * Version: 4.1 EN
  6. # * Released on: 13/02/2012
  7. #
  8. #-------------------------------------------------------------------------------
  9. # * Terms of Use
  10. #-------------------------------------------------------------------------------
  11. # When using any Khas script, you agree with the following terms:
  12. # 1. You must give credit to Khas;
  13. # 2. All Khas scripts are licensed under a Creative Commons license;
  14. # 3. All Khas scripts are for non-commercial projects. If you need some script
  15. #    for your commercial project (I accept requests for this type of project),
  16. #    send an email to [email][email protected][/email] with your request;
  17. # 4. All Khas scripts are for personal use, you can use or edit for your own
  18. #    project, but you are not allowed to post any modified version;
  19. # 5. You can’t give credit to yourself for posting any Khas script;
  20. # 6. If you want to share a Khas script, don’t post the script or the direct
  21. #    download link, please redirect the user to arcthunder.site40.net
  22. # 7. You are not allowed to convert any of Khas scripts to another engine,
  23. #    such converting a RGSS3 script to RGSS2 or something of that nature.
  24. #
  25. # Check all the terms at [url]http://arcthunder.site40.net/terms/[/url]
  26. #
  27. #-------------------------------------------------------------------------------
  28. # * Features
  29. #-------------------------------------------------------------------------------
  30. # The Sapphire Action System IV includes the following features:
  31. # - Pixel Movement
  32. # - Khas Particle Engine powered
  33. # - Realistic collisions
  34. # - Awesome jogability
  35. # - High customization level
  36. # - Weapon Icon
  37. # - Easy to use
  38. # - Skill support
  39. # - Lag free
  40. # - Damage Sprite system
  41. # - Optimized HUD
  42. # - Voice support
  43. # - And more...
  44. #
  45. #-------------------------------------------------------------------------------
  46. # * Instructions
  47. #-------------------------------------------------------------------------------
  48. # All the instructions are on SAS IV guide. Please read them carefully.
  49. #
  50. #-------------------------------------------------------------------------------
  51. # * How to use
  52. #-------------------------------------------------------------------------------
  53. # 1. Physics System
  54. # In order to run this script with the best performance, there's a system
  55. # called "Physics". This system will load each map between the transitions,
  56. # so you may experience little loadings. The Khas Pixel Movement is not
  57. # recommended for huge maps.
  58. #
  59. # 2. Event Commands (place a comment)
  60. # There are two special commands for events, you may add a comment with
  61. # the following sintax:
  62. #
  63. # a. [collision_x A]
  64. # This command sets the x collision to A (A must be an integer)
  65. #
  66. # b. [collision_y B]
  67. # This command sets the y collision to B (B must be an integer)
  68. #
  69. # Please check the demo to understand how the collision system works!
  70. #
  71. # 3. Event Commands (call script)
  72. # You can call the following commands for the player or the events
  73. #
  74. # character.px
  75. # This command returns the pixel coordinate X (4 px = 1 tile)
  76. #
  77. # character.py
  78. # This command returns the pixel coordinate Y (4 py = 1 tile)
  79. #
  80. # character.pixel_passable?(px,py,d)
  81. # This command checks the pixel passability from (px, py) to the direction d.
  82. #
  83. # 4. Map Commands
  84. # You can call a special command to update the passability of the current
  85. # map. You MUST run this command if the option "Auto_Refresh_Tile_Events"
  86. # is set to false.
  87. #
  88. # "But when do I need to use this command?"
  89. # Well, if you change a event graphic to a tileset graphic, or if you remove
  90. # this event graphic, then your map need to be updated!
  91. #
  92. # $game_map.refresh_table(start_x,start_y,end_x,end_y)
  93. #
  94. # Where:
  95. # start_x => Initial X
  96. # start_y => Initial Y
  97. # end_x => End X
  98. # end_y => End Y
  99. #
  100. #-------------------------------------------------------------------------------
  101. # * Warning!
  102. #-------------------------------------------------------------------------------
  103. # Check your tileset directions. If any direction is set as unpassable, the
  104. # system will set the whole tile as unpassable. Setup your tilesets before
  105. # using them!
  106. #
  107. #-------------------------------------------------------------------------------
  108. # * Setup Part (Sapphire Engine)
  109. #-------------------------------------------------------------------------------
  110. module Sapphire_Core
  111.   
  112.   # Enable voice?
  113.   Enable_Voice = true
  114.   
  115.   # Voice files (separated by commas)
  116.   Voice_Files = ["hero_voice_1","hero_voice_2","hero_voice_3","hero_voice_4","hero_voice_5","hero_voice_6"]
  117.   
  118.   # Voice volume
  119.   Voice_Volume = 80
  120.   
  121.   # Disarmed animation
  122.   Default_Animation = 1
  123.   
  124.   # Default recover time
  125.   Default_Recover = 60
  126.   
  127.   # Switch that will be activated when player dies
  128.   Kill_Switch = 3
  129.   
  130.   # Random factor
  131.   Damage_Random = 0.1
  132.   
  133.   # Enable weapon icon drawing?
  134.   Enable_Weapon_Graphics = true
  135.   
  136.   # Default skill speed
  137.   Default_Skill_Speed = 5
  138.   
  139.   # Default skill recover time
  140.   Default_Skill_Recover = 30
  141.   
  142.   # Skill volume
  143.   Skill_Volume = 80
  144.   
  145.   # Default skill blend type
  146.   Default_Particle_Blend = 1
  147.   
  148.   # Default enemy view range, in virtual pixels (1 tile = 4 virtual pixels)
  149.   Enemy_View = 20
  150.   
  151.   # Enemies' default nature
  152.   # 0 -> Only attack
  153.   # 1 -> Attack and cast skills
  154.   # 2 -> Only cast skills
  155.   Enemy_Nature = 1
  156.   
  157.   # Default enemies' recover time
  158.   Enemy_Recover = 60
  159.   
  160.   # Enable animation when player is seen
  161.   Enemy_Exclamation = true
  162.   
  163.   # Minimal distance to use skills, in virtual pixels (1 tile = 4 virtual pixels)
  164.   Enemy_Skill_Distance = 6
  165.   
  166.   
  167.   # System constant - DO NOT CHANGE!
  168.   Local_Switch = ["A","B","C","D"]
  169.   
  170.   # System constant - DO NOT CHANGE!
  171.   Weapon_Range = {2=>[0,2],4=>[-2,0],6=>[2,0],8=>[0,-2]}
  172. end
  173. #-------------------------------------------------------------------------------
  174. # * Setup Part (Pixel Movement)
  175. #-------------------------------------------------------------------------------
  176. module Pixel_Core
  177.   
  178.   # Auto Update events with tileset graphics?
  179.   Auto_Refresh_Tile_Events = true
  180.   
  181.   # Auto Update range
  182.   TileEvent_Range = 3
  183.   
  184.   # Auto Multiply event commands?
  185.   # (this option will multiply the event commands by 4 if set to true)
  186.   Multiply_Commands = true
  187.   
  188.   # Commands to multiply (ID)
  189.   Commands = [1,2,3,4,5,6,7,8,9,10,11,12,13]
  190.   
  191. #-------------------------------------------------------------------------------
  192. # * Constants - Do not modify!
  193. #-------------------------------------------------------------------------------
  194.   Pixel = 4
  195.   Tile = 0.25
  196.   Default_Collision_X = 3
  197.   Default_Collision_Y = 3
  198.   Body_Axis = [0.25,0.25,0.5,0.75]
  199.   Bush_Axis = [0.5,0.75]
  200.   Counter_Axis = [0.25,0.25,0.25,0.25]
  201.   Ladder_Axis = [0.25,0.25]
  202.   Pixel_Range = {2=>[0,0.25],4=>[-0.25,0],6=>[0.25,0],8=>[0,-0.25]}
  203.   Tile_Range = {2=>[0,1],4=>[-1,0],6=>[1,0],8=>[0,-1]}
  204.   Water_Range = {2=>[0,3],4=>[-3,0],6=>[3,0],8=>[0,-3]}
  205.   Trigger_Range = {2=>[0,2],4=>[-2,0],6=>[2,0],8=>[0,-2]}
  206.   Counter_Range = {2=>[0,3],4=>[-3,0],6=>[3,0],8=>[0,-3]}
  207.   Chase_Axis = {2=>[0,1],4=>[1,0],6=>[1,0],8=>[0,1]}
  208. end
  209. #-------------------------------------------------------------------------------
  210. # * Register
  211. #-------------------------------------------------------------------------------
  212. if $khas_awesome.nil?
  213.   $khas_awesome = []
  214. else
  215.   scripts = []
  216.   $khas_awesome.each { |script| scripts << script[0] }
  217.   if scripts.include?("Pixel Movement")
  218.     error = Sprite.new
  219.     error.bitmap = Bitmap.new(544,416)
  220.     error.bitmap.draw_text(0,208,544,32,"Please remove the script Khas Pixel Movement",1)
  221.     continue = Sprite.new
  222.     continue.bitmap = Bitmap.new(544,416)
  223.     continue.bitmap.font.color = Color.new(0,255,0)
  224.     continue.bitmap.font.size = error.bitmap.font.size - 3
  225.     continue.bitmap.draw_text(0,384,544,32,"Press Enter to exit",1)
  226.     add = Math::PI/80; max = 2*Math::PI; angle = 0
  227.     loop do
  228.       Graphics.update; Input.update
  229.       angle += add; angle %= max
  230.       continue.opacity = 185 + 70* Math.cos(angle)
  231.       break if Input.trigger?(Input::C)
  232.     end
  233.     error.bitmap.dispose; continue.bitmap.dispose
  234.     error.bitmap = nil; continue.bitmap = nil
  235.     error.dispose; continue.dispose
  236.     error = nil; continue = nil
  237.     exit
  238.   end
  239. end

  240. $khas_awesome << ["Sapphire Action System",4.1]

  241. #-------------------------------------------------------------------------------
  242. # * Sapphire Enemy
  243. #-------------------------------------------------------------------------------

  244. class Sapphire_Enemy
  245.   attr_accessor :event
  246.   attr_accessor :id
  247.   attr_accessor :char_file
  248.   attr_accessor :char_index
  249.   attr_accessor :animation
  250.   attr_accessor :skills
  251.   attr_accessor :object
  252.   attr_accessor :view
  253.   attr_accessor :recover
  254.   attr_accessor :step_anime
  255.   attr_accessor :nature
  256.   attr_accessor :auto_attack
  257.   attr_accessor :attack
  258.   attr_accessor :defence
  259.   attr_accessor :exp
  260.   attr_accessor :hp
  261.   attr_accessor :atk_invincible
  262.   attr_accessor :skl_invincible
  263.   attr_accessor :die_switch
  264.   attr_accessor :die_variable
  265.   attr_accessor :die_localsw
  266.   attr_accessor :die_erase
  267.   attr_accessor :magic
  268.   attr_accessor :mdefence
  269.   attr_accessor :static
  270.   def initialize(event,id)
  271.     @event = event
  272.     @id = id
  273.     @game_enemy = Game_Enemy.new(0,@id)
  274.     setup_enemy
  275.     setup_skills
  276.     setup_nature
  277.     @attack = @game_enemy.atk
  278.     @defence = @game_enemy.def
  279.     @magic = @game_enemy.mat
  280.     @mdefence = @game_enemy.mdf
  281.     @exp = @game_enemy.exp
  282.     @hp = @game_enemy.mhp
  283.     @atk_invincible = false
  284.     @skl_invincible = false
  285.     @die_switch = nil
  286.     @die_variable = nil
  287.     @die_localsw = nil
  288.     @die_erase = false
  289.   end
  290.   def setup_nature
  291.     @nature = 0 if @skills.empty?
  292.   end
  293.   def setup_enemy
  294.     @animation = @game_enemy.enemy.animation
  295.     @char_file = @game_enemy.enemy.char_file
  296.     @char_index = @game_enemy.enemy.char_index
  297.     @object = @game_enemy.enemy.object?
  298.     @view = @game_enemy.enemy.view
  299.     @recover = @game_enemy.enemy.recover
  300.     @step_anime = @game_enemy.enemy.step_anime?
  301.     @nature = @game_enemy.enemy.nature
  302.     @auto_attack = @game_enemy.enemy.auto_attack
  303.     @static = @game_enemy.enemy.static
  304.   end
  305.   def setup_skills
  306.     ids = @game_enemy.enemy.skills
  307.     @skills = []
  308.     ids.each { |i|;
  309.     skill = $data_skills[i];
  310.     skills << [skill,skill.particle] unless skill.particle.nil?}
  311.   end
  312. end

  313. #-------------------------------------------------------------------------------
  314. # * Sapphire Particle
  315. #-------------------------------------------------------------------------------

  316. class Sapphire_Particle < Sprite
  317.   attr_accessor :done
  318.   def initialize(key,char)
  319.     super(nil)
  320.     @key = key
  321.     self.bitmap = Sapphire_Bitcore[@key]
  322.     self.ox = self.bitmap.width/2
  323.     self.oy = self.bitmap.height/2
  324.     self.z = 200
  325.     self.angle = rand(360)
  326.     @add = rand(10)
  327.     @done = false
  328.     @rx = char.real_x
  329.     @ry = char.real_y
  330.     self.blend_type = char.blend
  331.   end
  332.   def update
  333.     self.x = $game_map.adjust_unlx(@rx) * 32 + 16
  334.     self.y = $game_map.adjust_unly(@ry) * 32 + 16
  335.     self.angle += @add
  336.     self.opacity <= 0 ? dispose : self.opacity -= 30
  337.   end
  338.   def release
  339.     return Virtual_Particle.new(self.x,self.y,@rx,@ry,@key,self.z,self.angle,@add,self.blend_type,self.opacity)
  340.   end
  341.   def dispose
  342.     self.bitmap = nil
  343.     super
  344.     @done = true
  345.   end
  346. end

  347. #-------------------------------------------------------------------------------
  348. # * Sapphire Restored Particle
  349. #-------------------------------------------------------------------------------

  350. class Sapphire_Restored_Particle < Sprite
  351.   attr_accessor :done
  352.   def initialize(vp)
  353.     super(nil)
  354.     @key = vp.key
  355.     self.bitmap = Sapphire_Bitcore[@key]
  356.     self.ox = self.bitmap.width/2
  357.     self.oy = self.bitmap.height/2
  358.     self.z = vp.z
  359.     self.angle = vp.angle
  360.     @add = vp.add
  361.     @done = false
  362.     @rx = vp.rx
  363.     @ry = vp.ry
  364.     self.blend_type = vp.blend
  365.     self.opacity = vp.opacity
  366.   end
  367.   def update
  368.     self.x = $game_map.adjust_unlx(@rx) * 32 + 16
  369.     self.y = $game_map.adjust_unly(@ry) * 32 + 16
  370.     self.angle += @add
  371.     self.opacity <= 0 ? dispose : self.opacity -= 30
  372.   end
  373.   def release
  374.     return Virtual_Particle.new(self.x,self.y,@rx,@ry,@key,self.z,self.angle,@add,self.blend_type,self.opacity)
  375.   end
  376.   def dispose
  377.     self.bitmap = nil
  378.     super
  379.     @done = true
  380.   end
  381. end

  382. #-------------------------------------------------------------------------------
  383. # * Virtual Particle
  384. #-------------------------------------------------------------------------------

  385. class Virtual_Particle
  386.   attr_reader :x
  387.   attr_reader :y
  388.   attr_reader :rx
  389.   attr_reader :ry
  390.   attr_reader :key
  391.   attr_reader :z
  392.   attr_reader :angle
  393.   attr_reader :add
  394.   attr_reader :blend
  395.   attr_reader :opacity
  396.   def initialize(x,y,rx,ry,key,z,angle,add,blend,opacity)
  397.     @x = x
  398.     @y = y
  399.     @rx = rx
  400.     @ry = ry
  401.     @key = key
  402.     @z = z
  403.     @angle = angle
  404.     @add = add
  405.     @blend = blend
  406.     @opacity = opacity
  407.   end
  408. end

  409. #-------------------------------------------------------------------------------
  410. # * Sapphire Skill
  411. #-------------------------------------------------------------------------------

  412. class Sapphire_Skill
  413.   include Pixel_Core
  414.   attr_accessor :px
  415.   attr_accessor :py
  416.   attr_accessor :cx
  417.   attr_accessor :cy
  418.   attr_reader :x
  419.   attr_reader :y
  420.   attr_reader :real_x
  421.   attr_reader :real_y
  422.   attr_reader :move_speed
  423.   attr_reader :move_frequency
  424.   attr_reader :direction
  425.   attr_reader :priority_type
  426.   attr_reader :skill
  427.   attr_reader :done
  428.   attr_reader :blend
  429.   def initialize(char)
  430.     @char = char
  431.     if @char.is_a?(Game_Event)
  432.       skills = char.enemy.skills
  433.       select = skills[rand(skills.size)]
  434.       @skill = select[0]
  435.       @bitmap = select[1]
  436.       @power = @char.enemy.magic
  437.       @cast_by_enemy = true
  438.     else
  439.       @skill = $game_player.current_skill[0]
  440.       @bitmap = $game_player.current_skill[1]
  441.       @power = $game_party.members[0].mat
  442.       @cast_by_enemy = false
  443.     end
  444.     @real_x = @char.x
  445.     @real_y = @char.y
  446.     @x = @char.x.to_f
  447.     @y = @char.y.to_f
  448.     @px = @char.px
  449.     @py = @char.py
  450.     @move_speed = @skill.speed
  451.     @move_frequency = 6
  452.     @direction = @char.direction
  453.     @cx = 3
  454.     @cy = 3
  455.     @done = false
  456.     @last_move = false
  457.     @remaining = 0
  458.     @blend = @skill.blend
  459.     @water_remaining = 0
  460.     RPG::SE.new(@skill.cast_se,Sapphire_Core::Skill_Volume).play unless @skill.cast_se.nil?
  461.   end
  462.   def perform_damage(char)
  463.     if @cast_by_enemy
  464.       char.animation_id = @skill.animation_id
  465.       char.set_direction(10-@direction)
  466.       3.times do; char.move_backward; end
  467.       char.do_step
  468.       damage = @power + @skill.power
  469.       damage += rand(damage*Sapphire_Core::Damage_Random).to_i
  470.       $game_player.damage_hero(damage)
  471.     else
  472.       char.animation_id = @skill.animation_id
  473.       unless char.enemy.object
  474.         char.set_direction(10-@direction)
  475.         3.times do; char.move_backward; end
  476.         char.do_step
  477.       end
  478.       damage = @power + @skill.power
  479.       damage += rand(damage*Sapphire_Core::Damage_Random).to_i
  480.       char.damage_enemy(damage,true) unless char.enemy.skl_invincible
  481.     end
  482.   end
  483.   def moving?
  484.     @real_x != @x || @real_y != @y
  485.   end
  486.   def distance_per_frame
  487.     2 ** @move_speed / 256.0
  488.   end
  489.   def screen_x
  490.     $game_map.adjust_unlx(@real_x) * 32 + 16
  491.   end
  492.   def screen_y
  493.     $game_map.adjust_unly(@real_y) * 32 + 16
  494.   end
  495.   def update
  496.     cast_particle
  497.     move unless moving?
  498.     return update_move if moving?
  499.   end
  500.   def move
  501.     @last_move ? move_last : move_pixel
  502.   end
  503.   def move_last
  504.     if @remaining > 0
  505.       @px += Tile_Range[@direction][0]
  506.       @py += Tile_Range[@direction][1]
  507.       @real_x = @x
  508.       @real_y = @y
  509.       @x += Pixel_Range[@direction][0]
  510.       @y += Pixel_Range[@direction][1]
  511.       @remaining -= 1
  512.     else
  513.       destroy
  514.     end
  515.   end
  516.   def destroy
  517.     @done = true
  518.   end
  519.   def cast_particle
  520.     $game_map.particles << Sapphire_Particle.new(@bitmap,self)
  521.   end
  522.   def update_move
  523.     @real_x = [@real_x - distance_per_frame, @x].max if @x < @real_x
  524.     @real_x = [@real_x + distance_per_frame, @x].min if @x > @real_x
  525.     @real_y = [@real_y - distance_per_frame, @y].max if @y < @real_y
  526.     @real_y = [@real_y + distance_per_frame, @y].min if @y > @real_y
  527.   end
  528.   def pixel_range?(px,py)
  529.     return (@px - px).abs <= @cx && (@py - py).abs <= @cy
  530.   end
  531.   def pixel_passable?(px,py,d)
  532.     nx = px+Tile_Range[d][0]
  533.     ny = py+Tile_Range[d][1]
  534.     return false unless $game_map.pixel_valid?(nx,ny)
  535.     return false if $game_map.pixel_table[px+Tile_Range[d][0],py+Tile_Range[d][1],1] == 0
  536.     return false if collision?(nx,ny)
  537.     return true
  538.   end
  539.   def collision?(px,py)
  540.     if @cast_by_enemy
  541.       for event in $game_map.events.values
  542.         if (event.px - px).abs < event.cx && (event.py - py).abs < event.cy
  543.           next if event.through || event == @char
  544.           return true if event.priority_type == 1
  545.         end
  546.       end
  547.       return ($game_player.px - px).abs <= @cx && ($game_player.py - py).abs <= @cy
  548.     else
  549.       for event in $game_map.events.values
  550.         if (event.px - px).abs < event.cx && (event.py - py).abs < event.cy
  551.           next if event.through
  552.           return true if event.priority_type == 1
  553.         end
  554.       end
  555.       return false
  556.     end
  557.   end
  558.   def move_pixel
  559.     if pixel_passable?(@px,@py,@direction)
  560.       @px += Tile_Range[@direction][0]
  561.       @py += Tile_Range[@direction][1]
  562.       @real_x = @x
  563.       @real_y = @y
  564.       @x += Pixel_Range[@direction][0]
  565.       @y += Pixel_Range[@direction][1]
  566.     else
  567.       front_pixel_touch?(@px + Tile_Range[@direction][0],@py + Tile_Range[@direction][1])
  568.       @last_move = true
  569.       @remaining = 3
  570.     end
  571.   end
  572.   def front_pixel_touch?(px,py)
  573.     if @cast_by_enemy
  574.       perform_damage($game_player) if ($game_player.px - px).abs <= @cx && ($game_player.py - py).abs <= @cy
  575.     else
  576.       for event in $game_map.enemies
  577.         if (event.px - px).abs < event.cx && (event.py - py).abs < event.cy
  578.           next if event.enemy.static
  579.           perform_damage(event)
  580.         end
  581.       end
  582.     end
  583.   end
  584. end

  585. #-------------------------------------------------------------------------------
  586. # * Sapphire HUD
  587. #-------------------------------------------------------------------------------

  588. class Sapphire_Hud
  589.   def refresh_bars(arg=nil)
  590.   end
  591.   def refresh_base
  592.   end
  593.   def hide(arg=nil)
  594.   end
  595.   def show(arg=nil)
  596.   end
  597. end

  598. #-------------------------------------------------------------------------------
  599. # * RGSS3 Object
  600. #-------------------------------------------------------------------------------

  601. class Object
  602.   def check(string)
  603.     self.each_line { |i| return true if i =~ /#{string}/i }
  604.     return false
  605.   end
  606.   def get(string,default=nil)   
  607.     self.each_line { |i| return i.gsub("#{string} = ", "").chomp if i =~ /#{string} = /i }
  608.     return default
  609.   end
  610. end

  611. #-------------------------------------------------------------------------------
  612. # * Cache
  613. #-------------------------------------------------------------------------------

  614. module Cache
  615.   def self.particle(filename)
  616.     load_bitmap("Graphics/Particles/", filename)
  617.   end
  618. end

  619. #-------------------------------------------------------------------------------
  620. # * RPG::Enemy
  621. #-------------------------------------------------------------------------------

  622. class RPG::Enemy < RPG::BaseItem
  623.   def skills
  624.     value = self.note.get("Skills","")
  625.     return eval("[#{value}]")
  626.   end
  627.   def object?
  628.     self.note.check("Object")
  629.   end
  630.   def view
  631.     self.note.get("View", Sapphire_Core::Enemy_View).to_i
  632.   end
  633.   def recover
  634.     self.note.get("Recover", Sapphire_Core::Enemy_Recover).to_i
  635.   end
  636.   def step_anime?
  637.     self.note.check("StepAnime")
  638.   end
  639.   def nature
  640.     self.note.get("Nature", Sapphire_Core::Enemy_Nature).to_i
  641.   end
  642.   def char_file
  643.     self.note.get("Char",nil)
  644.   end
  645.   def char_index
  646.     self.note.get("Char_index",0).to_i
  647.   end
  648.   def animation
  649.     self.note.get("Animation",0).to_i
  650.   end
  651.   def auto_attack
  652.     self.note.check("Auto_Attack")
  653.   end
  654.   def static
  655.     self.note.check("Static")
  656.   end
  657. end

  658. #-------------------------------------------------------------------------------
  659. # * RPG::Skill
  660. #-------------------------------------------------------------------------------

  661. class RPG::Skill < RPG::UsableItem
  662.   attr_reader :recover
  663.   def particle
  664.     self.note.get("Particle", nil)
  665.   end
  666.   def speed
  667.     self.note.get("Speed", Sapphire_Core::Default_Skill_Speed).to_i
  668.   end
  669.   def blend
  670.     self.note.get("Blend", Sapphire_Core::Default_Particle_Blend).to_i
  671.   end
  672.   def set_recover
  673.     @recover = self.note.get("Recover", Sapphire_Core::Default_Skill_Recover).to_i
  674.   end
  675.   def power
  676.     self.note.get("Power", 0).to_i
  677.   end
  678.   def cast_se
  679.     self.note.get("Sound", nil)
  680.   end
  681. end

  682. #-------------------------------------------------------------------------------
  683. # * Scene Map
  684. #-------------------------------------------------------------------------------

  685. class Scene_Map < Scene_Base
  686.   attr_accessor :spriteset
  687. end

  688. #-------------------------------------------------------------------------------
  689. # * Sprite Base
  690. #-------------------------------------------------------------------------------

  691. class Sprite_Base
  692.   Reduce = 3
  693.   def animation_set_sprites(frame)
  694.     cell_data = frame.cell_data
  695.     @ani_sprites.each_with_index do |sprite, i|
  696.       next unless sprite
  697.       pattern = cell_data[i, 0]
  698.       if !pattern || pattern < 0
  699.         sprite.visible = false
  700.         next
  701.       end
  702.       sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  703.       sprite.visible = true
  704.       sprite.src_rect.set(pattern % 5 * 192,
  705.         pattern % 100 / 5 * 192, 192, 192)
  706.       if @ani_mirror
  707.         sprite.x = @ani_ox - cell_data[i, 1] / Reduce
  708.         sprite.y = @ani_oy + cell_data[i, 2] / Reduce
  709.         sprite.angle = (360 - cell_data[i, 4])
  710.         sprite.mirror = (cell_data[i, 5] == 0)
  711.       else
  712.         sprite.x = @ani_ox + cell_data[i, 1] / Reduce
  713.         sprite.y = @ani_oy + cell_data[i, 2] / Reduce
  714.         sprite.angle = cell_data[i, 4]
  715.         sprite.mirror = (cell_data[i, 5] == 1)
  716.       end
  717.       sprite.z = self.z + 300 + i
  718.       sprite.ox = 96
  719.       sprite.oy = 96
  720.       sprite.zoom_x = cell_data[i, 3] / (100.0 * Reduce)
  721.       sprite.zoom_y = cell_data[i, 3] / (100.0 * Reduce)
  722.       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  723.       sprite.blend_type = cell_data[i, 7]
  724.     end
  725.   end
  726. end

  727. #-------------------------------------------------------------------------------
  728. # * Spriteset Map
  729. #-------------------------------------------------------------------------------

  730. class Spriteset_Map
  731.   alias sas_update update
  732.   alias sas_initialize initialize
  733.   alias sas_dispose dispose
  734.   def initialize
  735.     @trash = []
  736.     $game_map.show_particles
  737.     $game_map.show_damage_sprites
  738.     $game_map.sas_hud.show
  739.     sas_initialize
  740.     index = ($game_party.members[0].weapons[0].icon_index rescue nil)
  741.     @weapon_graphic = Sprite.new(@viewport1)
  742.     @weapon_graphic.ox = 22
  743.     @weapon_graphic.oy = 22
  744.     @attacking = false
  745.     @attack_timer = 0
  746.     @angles = {2=>[80,110,140,170],4=>[340,10,40,70],6=>[290,260,230,200],8=>[290,320,350,20]}
  747.     @correction = {2=>[-8,-10],4=>[0,-10],6=>[0,-4],8=>[4,-10]}
  748.     @z_values = {2=>120,4=>50,6=>120,8=>50}
  749.     if index == nil
  750.       @weapon_bitmap = nil
  751.     else
  752.       temp = Cache.system("Iconset")
  753.       @weapon_bitmap = Bitmap.new(24,24)
  754.       @weapon_bitmap.blt(0,0,temp,Rect.new(index%16*24,index/16*24,24,24))
  755.       temp.dispose
  756.       temp = nil
  757.     end
  758.   end
  759.   def dispose
  760.     sas_dispose
  761.     $game_map.sas_hud.hide
  762.     $game_map.hide_particles
  763.     $game_map.hide_damage_sprites
  764.     @weapon_graphic.bitmap = nil
  765.     unless @weapon_bitmap.nil?
  766.       @weapon_bitmap.dispose
  767.       @weapon_bitmap = nil
  768.     end
  769.     @weapon_graphic.dispose
  770.     @weapon_graphic = nil
  771.   end
  772.   def update
  773.     sas_update
  774.     update_particles
  775.     update_damage_sprites
  776.     update_weapon_graphic if @attacking
  777.   end
  778.   def update_damage_sprites
  779.   end
  780.   def update_particles
  781.     $game_map.particles.each { |particle| particle.update; @trash << particle if particle.done }
  782.     @trash.each { |item| $game_map.particles.delete(item) }
  783.     @trash.clear
  784.   end
  785.   def update_weapon_graphic
  786.     @weapon_graphic.x = $game_player.screen_x + @correction[$game_player.direction][0]
  787.     @weapon_graphic.y = $game_player.screen_y + @correction[$game_player.direction][1]
  788.     case @attack_timer
  789.     when 12
  790.       @weapon_graphic.angle = @angles[$game_player.direction][0]
  791.       @weapon_graphic.z = @z_values[$game_player.direction]
  792.     when 9
  793.       @weapon_graphic.angle = @angles[$game_player.direction][1]
  794.       @weapon_graphic.z = @z_values[$game_player.direction]
  795.     when 6
  796.       @weapon_graphic.angle = @angles[$game_player.direction][2]
  797.       @weapon_graphic.z = @z_values[$game_player.direction]
  798.     when 3
  799.       @weapon_graphic.angle = @angles[$game_player.direction][3]
  800.       @weapon_graphic.z = @z_values[$game_player.direction]
  801.     when 0
  802.       @attacking = false
  803.       @weapon_graphic.bitmap = nil
  804.     end
  805.     @weapon_graphic.update
  806.     @attack_timer -= 1
  807.   end
  808.   def weapon_animation
  809.     return if @weapon_bitmap.nil?
  810.     @weapon_graphic.bitmap = @weapon_bitmap
  811.     @attacking = true
  812.     @attack_timer = 12
  813.   end
  814. end

  815. #-------------------------------------------------------------------------------
  816. # * Game Map
  817. #-------------------------------------------------------------------------------

  818. class Game_Map
  819.   include Pixel_Core
  820.   attr_accessor :enemies
  821.   attr_reader :sas_active
  822.   attr_accessor :particles
  823.   attr_accessor :skills
  824.   attr_accessor :sas_hud
  825.   attr_accessor :damage_sprites
  826.   attr_reader :pixel_table
  827.   alias kp_referesh_vehicles referesh_vehicles
  828.   alias sas_update update
  829.   alias sas_setup_events setup_events
  830.   alias sas_initialize initialize
  831.   def initialize
  832.     sas_initialize
  833.     @sas_hud = Sapphire_Hud.new
  834.     @trash = []
  835.   end
  836.   def damage(target,value)
  837.   end
  838.   def level_up
  839.   end
  840.   def hide_damage_sprites
  841.   end
  842.   def show_damage_sprites
  843.   end
  844.   def setup_events
  845.     @enemies = []
  846.     sas_setup_events
  847.   end
  848.   def update(arg=false)
  849.     sas_update(arg)
  850.     update_skills
  851.     update_action_system if @sas_active && arg
  852.   end
  853.   def update_action_system
  854.     if Input.trigger?(Input::X)
  855.       $game_player.attack
  856.     elsif Input.trigger?(Input::Y)
  857.       $game_player.cast_skill
  858.     elsif Input.trigger?(Input::Z)
  859.       $game_player.next_skill
  860.     end
  861.   end
  862.   def start_sas
  863.     @sas_active = true
  864.   end
  865.   def pause_sas
  866.     @sas_active = false
  867.   end
  868.   def hide_particles
  869.     virtual_particles = []
  870.     @particles.each { |particle| virtual_particles << particle.release; particle.dispose }
  871.     @particles = virtual_particles
  872.   end
  873.   def show_particles
  874.     virtual_particles = @particles
  875.     @particles = []
  876.     virtual_particles.each { |vp| @particles << Sapphire_Restored_Particle.new(vp)}
  877.     virtual_particles.clear
  878.   end
  879.   def delete_particles
  880.     if @particles.nil?
  881.       @particles = []
  882.     else
  883.       @particles.each { |particle| particle.dispose }
  884.       @particles.clear
  885.     end
  886.   end
  887.   def delete_skills
  888.     if @skills.nil?
  889.       @skills = []
  890.     else
  891.       @skills.each { |skill| skill.destroy }
  892.       @skills.clear
  893.     end
  894.   end
  895.   def delete_damage_sprites
  896.   end
  897.   def adjust_unlx(x)
  898.     return x - @display_x
  899.   end
  900.   def adjust_unly(y)
  901.     return y - @display_y
  902.   end
  903.   def update_skills
  904.     @skills.each { |skill| skill.update; @trash << skill if skill.done }
  905.     @trash.each { |item| @skills.delete(item) }
  906.     @trash.clear
  907.   end
  908.   def pixel_valid?(x, y)
  909.     x >= 0 && x <= @pixel_wm && y >= 0 && y <= @pixel_hm
  910.   end
  911.   def referesh_vehicles
  912.     setup_table
  913.     delete_particles
  914.     delete_skills
  915.     delete_damage_sprites
  916.     kp_referesh_vehicles
  917.   end
  918.   def setup_table
  919.     @pixel_table = Table.new(width*Pixel, height*Pixel,6)
  920.     for x in 0...(width*Pixel)
  921.       for y in 0...(height*Pixel)
  922.         @pixel_table[x,y,0] = table_player_collision(x*Tile,y*Tile)
  923.         @pixel_table[x,y,1] = table_skill_collision(x*Tile,y*Tile)
  924.         @pixel_table[x,y,3] = table_ladder(x*Tile,y*Tile)
  925.         @pixel_table[x,y,4] = table_bush(x*Tile+Bush_Axis[0],y*Tile+Bush_Axis[1])
  926.         @pixel_table[x,y,5] = table_counter(x*Tile+Counter_Axis[0],y*Tile+Counter_Axis[1])
  927.       end
  928.     end
  929.     @pixel_wm = (width-1)*Pixel
  930.     @pixel_hm = (height-1)*Pixel
  931.   end
  932.   def table_player_collision(x,y)
  933.     return 0 unless table_pp((x+Body_Axis[0]).to_i,(y+Body_Axis[1]).to_i)
  934.     return 0 unless table_pp((x+Body_Axis[2]).to_i,(y+Body_Axis[1]).to_i)
  935.     return 0 unless table_pp((x+Body_Axis[0]).to_i,(y+Body_Axis[3]).to_i)
  936.     return 0 unless table_pp((x+Body_Axis[2]).to_i,(y+Body_Axis[3]).to_i)
  937.     return 1
  938.   end
  939.   def table_skill_collision(x,y)
  940.     return 0 unless table_ps((x+Body_Axis[0]).to_i,(y+Body_Axis[1]).to_i)
  941.     return 0 unless table_ps((x+Body_Axis[2]).to_i,(y+Body_Axis[1]).to_i)
  942.     return 0 unless table_ps((x+Body_Axis[0]).to_i,(y+Body_Axis[3]).to_i)
  943.     return 0 unless table_ps((x+Body_Axis[2]).to_i,(y+Body_Axis[3]).to_i)
  944.     return 1
  945.   end
  946.   def refresh_table(start_x,start_y,end_x,end_y)
  947.     for x in (start_x*Pixel)..(end_x*Pixel)
  948.       for y in (start_y*Pixel)..(end_y*Pixel)
  949.         @pixel_table[x,y,0] = table_pcrf(x*Tile,y*Tile)
  950.         @pixel_table[x,y,1] = table_scrf(x*Tile,y*Tile)
  951.       end
  952.     end
  953.   end
  954.   def refresh_table_px(start_px,start_py,end_px,end_py)
  955.     for x in start_px..end_px
  956.       for y in start_py..end_py
  957.         @pixel_table[x,y,0] = table_pcrf(x*Tile,y*Tile)
  958.         @pixel_table[x,y,1] = table_scrf(x*Tile,y*Tile)
  959.       end
  960.     end
  961.   end
  962.   def table_pcrf(x,y)
  963.     return 0 unless table_pprf((x+Body_Axis[0]).to_i,(y+Body_Axis[1]).to_i)
  964.     return 0 unless table_pprf((x+Body_Axis[2]).to_i,(y+Body_Axis[1]).to_i)
  965.     return 0 unless table_pprf((x+Body_Axis[0]).to_i,(y+Body_Axis[3]).to_i)
  966.     return 0 unless table_pprf((x+Body_Axis[2]).to_i,(y+Body_Axis[3]).to_i)
  967.     return 1
  968.   end
  969.   def table_scrf(x,y)
  970.     return 0 unless table_psrf((x+Body_Axis[0]).to_i,(y+Body_Axis[1]).to_i)
  971.     return 0 unless table_psrf((x+Body_Axis[2]).to_i,(y+Body_Axis[1]).to_i)
  972.     return 0 unless table_psrf((x+Body_Axis[0]).to_i,(y+Body_Axis[3]).to_i)
  973.     return 0 unless table_psrf((x+Body_Axis[2]).to_i,(y+Body_Axis[3]).to_i)
  974.     return 1
  975.   end
  976.   def table_p(x,y,bit)
  977.     layered_tiles(x,y).each do |tile_id|
  978.       flag = tileset.flags[tile_id]
  979.       next if flag & 0x10 != 0
  980.       return true  if flag & bit == 0
  981.       return false if flag & bit == bit
  982.     end
  983.     return false
  984.   end
  985.   def table_pp(x,y)
  986.     layered_tiles(x,y).each do |tile_id|
  987.       flag = tileset.flags[tile_id]
  988.       next if flag & 0x10 != 0
  989.       return true if flag & 0x0f == 0
  990.       return false if flag & 0x0f == 0x0f
  991.     end
  992.     return false
  993.   end
  994.   def table_ps(x,y)
  995.     layered_tiles(x,y).each do |tile_id|
  996.       flag = tileset.flags[tile_id]
  997.       next if flag & 0x10 != 0
  998.       return true if flag & 0x0400 == 0
  999.       return true if flag & 0x0f == 0
  1000.       return false if flag & 0x0f == 0x0f
  1001.     end
  1002.     return false
  1003.   end
  1004.   def table_pprf(x,y)
  1005.     all_tiles(x, y).each do |tile_id|
  1006.       flag = tileset.flags[tile_id]
  1007.       next if flag & 0x10 != 0
  1008.       return true if flag & 0x0f == 0
  1009.       return false if flag & 0x0f == 0x0f
  1010.     end
  1011.     return false
  1012.   end
  1013.   def table_psrf(x,y)
  1014.     all_tiles(x,y).each do |tile_id|
  1015.       flag = tileset.flags[tile_id]
  1016.       next if flag & 0x10 != 0
  1017.       return true if flag & 0x0400 == 0
  1018.       return true if flag & 0x0f == 0
  1019.       return false if flag & 0x0f == 0x0f
  1020.     end
  1021.     return false
  1022.   end
  1023.   def table_bush(x,y)
  1024.     return layered_tiles_flag?(x.to_i, y.to_i, 0x40) ? 1 : 0
  1025.   end
  1026.   def table_ladder(x,y)
  1027.     return 1 if layered_tiles_flag?(x.to_i,(y+Ladder_Axis[1]).to_i, 0x20)
  1028.     return 1 if layered_tiles_flag?((x+Ladder_Axis[0]).to_i, (y+Ladder_Axis[1]).to_i, 0x20)
  1029.     return 0
  1030.   end
  1031.   def table_counter(x,y)
  1032.     return 1 if layered_tiles_flag?(x.to_i,y.to_i, 0x80)
  1033.     return 1 if layered_tiles_flag?((x+Counter_Axis[2]).to_i,y.to_i, 0x80)
  1034.     return 1 if layered_tiles_flag?(x.to_i,(y+Counter_Axis[3]).to_i, 0x80)
  1035.     return 1 if layered_tiles_flag?((x+Counter_Axis[2]).to_i,(y+Counter_Axis[3]).to_i, 0x80)
  1036.     return 0
  1037.   end
  1038. end

  1039. if Pixel_Core::Auto_Refresh_Tile_Events
  1040.   class Game_Map
  1041.     def refresh_tile_events
  1042.       @tile_events = @events.values.select {|event| event.tile? }
  1043.       @tile_events.each { |event| refresh_table_px(event.px-TileEvent_Range,event.py-TileEvent_Range,event.px+TileEvent_Range,event.py+TileEvent_Range)}
  1044.     end
  1045.   end
  1046. end

  1047. #-------------------------------------------------------------------------------
  1048. # * Game CharacterBase
  1049. #-------------------------------------------------------------------------------

  1050. class Game_CharacterBase
  1051.   include Pixel_Core
  1052.   attr_accessor :px
  1053.   attr_accessor :py
  1054.   attr_accessor :cx
  1055.   attr_accessor :cy
  1056.   alias kp_moveto moveto
  1057.   alias kp_move_straight move_straight
  1058.   alias kp_move_diagonal move_diagonal
  1059.   alias kp_bush? bush?
  1060.   alias kp_ladder? ladder?
  1061.   alias kp_terrain_tag terrain_tag
  1062.   alias kp_region_id region_id
  1063.   alias sas_update update
  1064.   alias sas_public_members init_public_members
  1065.   alias sas_straighten straighten
  1066.   def pixel_range?(px,py)
  1067.     return (@px - px).abs <= @cx && (@py - py).abs <= @cy
  1068.   end
  1069.   def update
  1070.     sas_update
  1071.     update_step_action if @step_action
  1072.   end
  1073.   def straighten
  1074.     sas_straighten
  1075.     @step_action = false
  1076.     @step_timer = 0
  1077.   end
  1078.   def update_step_action
  1079.     case @step_timer
  1080.     when 12; @pattern = 0
  1081.     when 8; @pattern = 1
  1082.     when 4; @pattern = 2
  1083.     when 0
  1084.       @step_action = false
  1085.       @pattern = 1
  1086.       return
  1087.     end
  1088.     @step_timer -= 1
  1089.   end
  1090.   def do_step
  1091.     @step_action = true
  1092.     @step_timer = 12
  1093.   end
  1094.   def init_public_members
  1095.     sas_public_members
  1096.     @x = @x.to_f
  1097.     @y = @y.to_f
  1098.     @px = (@x*Pixel).to_i
  1099.     @py = (@y*Pixel).to_i
  1100.     @cx = Default_Collision_X
  1101.     @cy = Default_Collision_Y
  1102.     @step_action = false
  1103.     @step_timer = 0
  1104.   end
  1105.   def moveto(x,y)
  1106.     kp_moveto(x,y)
  1107.     @x = @x.to_f
  1108.     @y = @y.to_f
  1109.     @px = (@x*Pixel).to_i
  1110.     @py = (@y*Pixel).to_i
  1111.   end
  1112.   def pixel_passable?(px,py,d)
  1113.     nx = px+Tile_Range[d][0]
  1114.     ny = py+Tile_Range[d][1]
  1115.     return false unless $game_map.pixel_valid?(nx,ny)
  1116.     return true if @through || debug_through?
  1117.     return false if $game_map.pixel_table[nx,ny,0] == 0
  1118.     return false if collision?(nx,ny)
  1119.     return true
  1120.   end
  1121.   def collision?(px,py)
  1122.     for event in $game_map.events.values
  1123.       if (event.px - px).abs <= event.cx && (event.py - py).abs <= event.cy
  1124.         next if event.through || event == self
  1125.         return true if event.priority_type == 1
  1126.       end
  1127.     end
  1128.     if @priority_type == 1
  1129.       return true if ($game_player.px - px).abs <= @cx && ($game_player.py - py).abs <= @cy
  1130.     end
  1131.     return false
  1132.   end
  1133.   def move_straight(d,turn_ok = true)
  1134.     move_pixel(d,turn_ok)
  1135.   end
  1136.   def move_diagonal(horz, vert)
  1137.     move_dpixel(horz,vert)
  1138.   end
  1139.   def move_pixel(d,t)
  1140.     @move_succeed = pixel_passable?(@px,@py,d)
  1141.     if @move_succeed
  1142.       set_direction(d)
  1143.       @px += Tile_Range[d][0]
  1144.       @py += Tile_Range[d][1]
  1145.       @real_x = @x
  1146.       @real_y = @y
  1147.       @x += Pixel_Range[d][0]
  1148.       @y += Pixel_Range[d][1]
  1149.       increase_steps
  1150.     elsif t
  1151.       set_direction(d)
  1152.       front_pixel_touch?(@px + Tile_Range[d][0],@py + Tile_Range[d][1])
  1153.     end
  1154.   end
  1155.   def move_dpixel(h,v)
  1156.     @move_succeed = false
  1157.     if pixel_passable?(@px,@py,v)
  1158.       @move_succeed = true
  1159.       @real_x = @x
  1160.       @real_y = @y
  1161.       set_direction(v)
  1162.       @px += Tile_Range[v][0]
  1163.       @py += Tile_Range[v][1]
  1164.       @x += Pixel_Range[v][0]
  1165.       @y += Pixel_Range[v][1]
  1166.       increase_steps
  1167.     else
  1168.       set_direction(v)
  1169.       front_pixel_touch?(@px + Tile_Range[v][0],@py + Tile_Range[v][1])
  1170.     end
  1171.     if pixel_passable?(@px,@py,h)
  1172.       unless @move_succeed
  1173.         @real_x = @x
  1174.         @real_y = @y
  1175.         @move_succeed = true
  1176.       end
  1177.       set_direction(h)
  1178.       @px += Tile_Range[h][0]
  1179.       @py += Tile_Range[h][1]
  1180.       @x += Pixel_Range[h][0]
  1181.       @y += Pixel_Range[h][1]
  1182.       increase_steps
  1183.     else
  1184.       set_direction(h)
  1185.       front_pixel_touch?(@px + Tile_Range[h][0],@py + Tile_Range[h][1])
  1186.     end
  1187.   end
  1188.   def bush?
  1189.     return $game_map.pixel_table[@px, @py, 4] == 1
  1190.   end
  1191.   def ladder?
  1192.     return $game_map.pixel_table[@px, @py, 3] == 1
  1193.   end
  1194.   def terrain_tag
  1195.     rx = ((@px % Pixel) > 1 ? @x.to_i + 1 : @x.to_i)
  1196.     ry = ((@py % Pixel) > 1 ? @y.to_i + 1 : @y.to_i)
  1197.     return $game_map.terrain_tag(rx,ry)
  1198.   end
  1199.   def region_id
  1200.     rx = ((@px % Pixel) > 1 ? @x.to_i + 1 : @x.to_i)
  1201.     ry = ((@py % Pixel) > 1 ? @y.to_i + 1 : @y.to_i)
  1202.     return $game_map.region_id(rx, ry)
  1203.   end
  1204.   def front_pixel_touch?(x,y)
  1205.   end
  1206. end

  1207. #-------------------------------------------------------------------------------
  1208. # * Game FakeFollowers
  1209. #-------------------------------------------------------------------------------

  1210. class Game_FakeFollowers
  1211.   attr_accessor :visible
  1212.   def initialize
  1213.     @visible = true
  1214.   end
  1215.   def refresh
  1216.   end
  1217.   def update
  1218.   end
  1219.   def gathering?
  1220.     return false
  1221.   end
  1222.   def synchronize(x,y,d)
  1223.   end
  1224.   def collide?(x,y)
  1225.     return false
  1226.   end
  1227.   def gather
  1228.   end
  1229.   def gather?
  1230.     return true
  1231.   end
  1232.   def reverse_each
  1233.     return []
  1234.   end
  1235.   def each
  1236.     return []
  1237.   end
  1238. end

  1239. #-------------------------------------------------------------------------------
  1240. # * Game Character
  1241. #-------------------------------------------------------------------------------

  1242. class Game_Character < Game_CharacterBase
  1243.   attr_accessor :pattern
  1244.   alias kp_force_move_route force_move_route
  1245.   alias kp_move_toward_character move_toward_character
  1246.   alias kp_move_away_from_character move_away_from_character
  1247.   alias kp_jump jump
  1248.   def force_move_route(route)
  1249.     kp_force_move_route(route.clone)
  1250.     multiply_commands
  1251.   end
  1252.   def multiply_commands
  1253.     return unless Multiply_Commands
  1254.     return if @move_route.list.empty?
  1255.     new_route = []
  1256.     for cmd in @move_route.list
  1257.       if Commands.include?(cmd.code)
  1258.         Pixel.times do
  1259.           new_route << cmd
  1260.         end
  1261.       else
  1262.         new_route << cmd
  1263.       end
  1264.     end
  1265.     @move_route.list = new_route
  1266.   end
  1267.   def move_toward_character(character)
  1268.     dx = @px - character.px
  1269.     dy = @py - character.py
  1270.     if dx.abs < character.cx
  1271.       unless dy.abs < character.cy
  1272.         move_pixel(dy < 0 ? 2 : 8,true)
  1273.         unless @move_succeed
  1274.           return if dx.abs - Chase_Axis[@direction][0] <= @cx && dy.abs - Chase_Axis[@direction][1] <= @cy
  1275.           move_dpixel(dx < 0 ? 6 : 4, dy < 0 ? 2 : 8)
  1276.         end
  1277.       end
  1278.     else
  1279.       if dy.abs < character.cy
  1280.         move_pixel(dx < 0 ? 6 : 4,true)
  1281.         unless @move_succeed
  1282.           return if dx.abs - Chase_Axis[@direction][0] <= @cx && dy.abs - Chase_Axis[@direction][1] <= @cy
  1283.           move_dpixel(dx < 0 ? 6 : 4, dy < 0 ? 2 : 8)
  1284.         end
  1285.       else
  1286.         move_dpixel(dx < 0 ? 6 : 4, dy < 0 ? 2 : 8)
  1287.       end
  1288.     end
  1289.   end
  1290.   def move_away_from_character(character)
  1291.     dx = @px - character.px
  1292.     dy = @py - character.py
  1293.     if dx == 0
  1294.       move_pixel(dy > 0 ? 2 : 8,true)
  1295.     else
  1296.       if dy == 0
  1297.         move_pixel(dx > 0 ? 6 : 4,true)
  1298.       else
  1299.         move_dpixel(dx > 0 ? 6 : 4, dy > 0 ? 2 : 8)
  1300.       end
  1301.     end
  1302.   end
  1303.   def jump(xp,yp)
  1304.     kp_jump(xp,yp)
  1305.     @px = @x*Pixel
  1306.     @py = @y*Pixel
  1307.   end
  1308. end

  1309. #-------------------------------------------------------------------------------
  1310. # * Game Player
  1311. #-------------------------------------------------------------------------------

  1312. class Game_Player < Game_Character
  1313.   attr_accessor :recover
  1314.   attr_accessor :current_skill
  1315.   alias sas_initialize initialize
  1316.   alias sas_player_update update
  1317.   def update
  1318.     sas_player_update
  1319.     @recover -= 1 if @recover > 0
  1320.   end
  1321.   def straighten
  1322.     super
  1323.     refresh_weapon_stats
  1324.     @recover = 0
  1325.   end
  1326.   def initialize
  1327.     sas_initialize
  1328.     @followers = Game_FakeFollowers.new
  1329.     @current_skill = [nil,nil]
  1330.   end
  1331.   def update_vehicle
  1332.   end
  1333.   def cast_skill
  1334.     return if @current_skill[0].nil? || @recover > 0
  1335.     return if $game_party.members[0].mp < @current_skill[0].mp_cost
  1336.     $game_map.skills << Sapphire_Skill.new(self)
  1337.     $game_party.members[0].mp -= @current_skill[0].mp_cost
  1338.     $game_map.sas_hud.refresh_bars
  1339.     @recover = @current_skill[0].recover
  1340.   end
  1341.   def next_skill
  1342.     unless @current_skill[1].nil?
  1343.       @current_skill[1] = nil
  1344.     end
  1345.     skills = $game_party.members[0].skills
  1346.     if skills.empty?
  1347.       @current_skill = [nil,nil]
  1348.     else
  1349.       ns = 0
  1350.       unless @current_skill[0].nil?
  1351.         max = skills.size-1
  1352.         for id in 0..max
  1353.           ns = (id == max ? 0 : id + 1) if skills[id] == @current_skill[0]
  1354.         end
  1355.       end
  1356.       skills[ns].set_recover
  1357.       @current_skill = [skills[ns],skills[ns].particle]
  1358.       $game_map.sas_hud.refresh_base
  1359.     end
  1360.   end
  1361.   def damage_hero(value)
  1362.     actor = $game_party.members[0]
  1363.     value -= actor.def
  1364.     value = 0 if value < 0
  1365.     $game_map.show_text(self,value)
  1366.     if actor.hp <= value
  1367.       actor.hp = 1
  1368.       $game_map.sas_hud.refresh_bars(0)
  1369.       kill_player
  1370.     else
  1371.       actor.hp -= value
  1372.       $game_map.sas_hud.refresh_bars
  1373.     end
  1374.   end
  1375.   def skill_damage_hero(value)
  1376.     actor = $game_party.members[0]
  1377.     value -= actor.mdf
  1378.     value = 0 if value < 0
  1379.     $game_map.show_text(self,value)
  1380.     if actor.hp <= value
  1381.       actor.hp = 1
  1382.       $game_map.sas_hud.refresh_bars(0)
  1383.       kill_player
  1384.     else
  1385.       actor.hp -= value
  1386.       $game_map.sas_hud.refresh_bars
  1387.     end
  1388.   end
  1389.   def kill_player
  1390.     $game_map.pause_sas
  1391.     $game_switches[Sapphire_Core::Kill_Switch] = true
  1392.     $game_map.need_refresh = true
  1393.   end
  1394.   def attack
  1395.     return if @recover > 0 || $game_map.interpreter.running?
  1396.     can_move = true
  1397.     @recover = @max_recover
  1398.     SceneManager.scene.spriteset.weapon_animation if Sapphire_Core::Enable_Weapon_Graphics
  1399.     play_voice if Sapphire_Core::Enable_Voice
  1400.     tx = @px + Sapphire_Core::Weapon_Range[@direction][0]
  1401.     ty = @py + Sapphire_Core::Weapon_Range[@direction][1]
  1402.     for char in $game_map.enemies
  1403.       if char.pixel_range?(tx,ty)
  1404.         next if char.enemy.static
  1405.         char.animation_id = @weapon_animation
  1406.         unless char.enemy.object
  1407.           char.turn_toward_character(self)
  1408.           3.times do; char.move_backward; end
  1409.           char.do_step
  1410.         else
  1411.           can_move = false
  1412.         end
  1413.         damage = $game_party.members[0].atk
  1414.         damage += rand(damage*Sapphire_Core::Damage_Random).to_i
  1415.         char.damage_enemy(damage,true) unless char.enemy.atk_invincible
  1416.       end
  1417.     end
  1418.     return unless can_move
  1419.     do_step
  1420.     move_forward
  1421.   end
  1422.   def get_weapon_recover(actor)
  1423.     for feature in actor.weapons[0].features
  1424.       return feature.value if feature.code == 33
  1425.     end
  1426.     return Sapphire_Core::Default_Recover
  1427.   end
  1428.   def refresh_weapon_stats
  1429.     hero = $game_party.members[0]
  1430.     if hero.weapons[0].nil?
  1431.       @max_recover = Sapphire_Core::Default_Recover
  1432.       @weapon_animation = Sapphire_Core::Default_Animation
  1433.     else
  1434.       @max_recover = get_weapon_recover(hero)
  1435.       @weapon_animation = hero.weapons[0].animation_id
  1436.     end
  1437.   end
  1438.   def play_voice
  1439.     RPG::SE.new(Sapphire_Core::Voice_Files[rand(Sapphire_Core::Voice_Files.size)],Sapphire_Core::Voice_Volume).play
  1440.   end
  1441.   def encounter_progress_value
  1442.     return 1
  1443.   end
  1444.   def get_on_off_vehicle
  1445.     return false
  1446.   end
  1447.   def check_event_trigger_here(triggers)
  1448.     for event in $game_map.events.values
  1449.       if (event.px - @px).abs <= event.cx && (event.py - @py).abs <= event.cy
  1450.         event.start if triggers.include?(event.trigger) && event.priority_type != 1
  1451.       end
  1452.     end
  1453.   end
  1454.   def check_event_trigger_there(triggers)
  1455.     fx = @px+Trigger_Range[@direction][0]
  1456.     fy = @py+Trigger_Range[@direction][1]
  1457.     for event in $game_map.events.values
  1458.       if (event.px - fx).abs <= event.cx && (event.py - fy).abs <= event.cy
  1459.         if triggers.include?(event.trigger) && event.normal_priority?
  1460.           event.start
  1461.           return
  1462.         end
  1463.       end
  1464.     end
  1465.     if $game_map.pixel_table[fx,fy,5] == 1
  1466.       fx += Counter_Range[@direction][0]
  1467.       fy += Counter_Range[@direction][1]
  1468.       for event in $game_map.events.values
  1469.         if (event.px - fx).abs <= event.cx && (event.py - fy).abs <= event.cy
  1470.           if triggers.include?(event.trigger) && event.normal_priority?
  1471.             event.start
  1472.             return
  1473.           end
  1474.         end
  1475.       end
  1476.     end
  1477.   end
  1478.   def front_pixel_touch?(px,py)
  1479.     return if $game_map.interpreter.running?
  1480.     for event in $game_map.events.values
  1481.       if (event.px - px).abs <= event.cx && (event.py - py).abs <= event.cy
  1482.         if [1,2].include?(event.trigger) && event.normal_priority?
  1483.           event.start
  1484.           result = true
  1485.         end
  1486.       end
  1487.     end
  1488.   end
  1489.   def pixel_passable?(px,py,d)
  1490.     nx = px+Tile_Range[d][0]
  1491.     ny = py+Tile_Range[d][1]
  1492.     return false unless $game_map.pixel_valid?(nx,ny)
  1493.     return true if @through || debug_through?
  1494.     return false if $game_map.pixel_table[nx,ny,0] == 0
  1495.     return false if collision?(nx,ny)
  1496.     return true
  1497.   end
  1498.   def move_by_input
  1499.     return if !movable? || $game_map.interpreter.running?
  1500.     case Input.dir8
  1501.       when 1; move_dpixel(4,2)
  1502.       when 2; move_pixel(2,true)
  1503.       when 3; move_dpixel(6,2)
  1504.       when 4; move_pixel(4,true)
  1505.       when 6; move_pixel(6,true)
  1506.       when 7; move_dpixel(4,8)
  1507.       when 8; move_pixel(8,true)
  1508.       when 9; move_dpixel(6,8)
  1509.     end
  1510.   end
  1511.   def on_damage_floor?
  1512.     return false
  1513.   end
  1514.   def collision?(px,py)
  1515.     for event in $game_map.events.values
  1516.       if (event.px - px).abs <= event.cx && (event.py - py).abs <= event.cy
  1517.         next if event.through
  1518.         return true if event.priority_type == 1
  1519.       end
  1520.     end
  1521.     return false
  1522.   end
  1523.   def move_straight(d, turn_ok = true)
  1524.     super(d, turn_ok)
  1525.   end
  1526.   def move_diagonal(horz, vert)
  1527.     super(horz, vert)
  1528.   end
  1529. end

  1530. #-------------------------------------------------------------------------------
  1531. # * Game Event
  1532. #-------------------------------------------------------------------------------

  1533. class Game_Event < Game_Character
  1534.   attr_accessor :enemy
  1535.   alias sas_setup_page setup_page
  1536.   alias sas_initialize initialize
  1537.   alias sas_event_update update
  1538.   alias kp_move_type_toward_player move_type_toward_player
  1539.   alias kp_setup_page_settings setup_page_settings
  1540.   def initialize(m,e)
  1541.     @enemy = nil
  1542.     @recover = 0
  1543.     @request_view = false
  1544.     sas_initialize(m,e)
  1545.     setup_collision
  1546.   end
  1547.   def update
  1548.     if $game_map.sas_active && @enemy != nil
  1549.       @request_view ? update_view : update_skills
  1550.       @recover -= 1 if @recover > 0
  1551.     end
  1552.     sas_event_update
  1553.   end
  1554.   def update_skills
  1555.     return if @recover > 0 || @enemy.nature == 0
  1556.     if @enemy.auto_attack
  1557.       $game_map.skills << Sapphire_Skill.new(self)
  1558.       @recover = @enemy.recover
  1559.     else
  1560.       update_cast
  1561.     end
  1562.   end
  1563.   def damage_enemy(value,by_player=false)
  1564.     value -= @enemy.defence
  1565.     value = 0 if value < 0
  1566.     @enemy.hp -= value
  1567.     $game_map.show_text(self,value) unless @enemy.object
  1568.     if @enemy.hp <= 0
  1569.       kill_enemy(by_player)
  1570.     elsif by_player && @request_view
  1571.       @balloon_id = 1 if Sapphire_Core::Enemy_Exclamation
  1572.       @move_type = 2
  1573.       @move_frequency = 6
  1574.       @request_view = false
  1575.     end
  1576.   end
  1577.   def skill_damage_enemy(value,by_player=false)
  1578.     value -= @enemy.mdefence
  1579.     value = 0 if value < 0
  1580.     @enemy.hp -= value
  1581.     $game_map.show_text(self,value) unless @enemy.object
  1582.     if @enemy.hp <= 0
  1583.       kill_enemy(by_player)
  1584.     elsif by_player && @request_view
  1585.       @balloon_id = 1 if Sapphire_Core::Enemy_Exclamation
  1586.       @move_type = 2
  1587.       @move_frequency = 6
  1588.       @request_view = false
  1589.     end
  1590.   end
  1591.   def attack
  1592.     @recover = @enemy.recover
  1593.     tx = @px + Sapphire_Core::Weapon_Range[@direction][0]
  1594.     ty = @py + Sapphire_Core::Weapon_Range[@direction][1]
  1595.     if $game_player.pixel_range?(tx,ty)
  1596.       $game_player.animation_id = @enemy.animation
  1597.       $game_player.turn_toward_character(self)
  1598.       3.times do; $game_player.move_backward; end
  1599.       $game_player.do_step
  1600.       damage = @enemy.attack
  1601.       damage += rand(damage*Sapphire_Core::Damage_Random).to_i
  1602.       $game_player.damage_hero(damage)
  1603.     end
  1604.     do_step
  1605.     move_forward
  1606.   end
  1607.   def kill_enemy(by_player)
  1608.     @direction = 2
  1609.     moveto(@x,@y)
  1610.     @request_view = false
  1611.     @step_anime = false
  1612.     @move_type = 0
  1613.     @character_name = ""
  1614.     @tile_id = 0
  1615.     @priority_type = 0
  1616.     @opacity = 255
  1617.     if by_player
  1618.       actor = $game_party.members[0]
  1619.       current_level = actor.level
  1620.       actor.change_exp(actor.exp + @enemy.exp,false)
  1621.       if current_level != actor.level
  1622.         $game_map.sas_hud.refresh_base
  1623.         $game_map.level_up
  1624.       end
  1625.       $game_map.sas_hud.refresh_bars
  1626.     end
  1627.     run_enemy_commands
  1628.   end
  1629.   def update_view
  1630.     case @direction
  1631.     when 2
  1632.       distance = ($game_player.py - @py)
  1633.       if ($game_player.px - @px).abs <= @cx && distance <= @enemy.view && distance >= 0
  1634.         @balloon_id = 1 if Sapphire_Core::Enemy_Exclamation
  1635.         @move_type = 2
  1636.         @move_frequency = 6
  1637.         @request_view = false
  1638.       end
  1639.     when 4
  1640.       distance = (@px - $game_player.px)
  1641.       if ($game_player.py - @py).abs <= @cx && distance <= @enemy.view && distance >= 0
  1642.         @balloon_id = 1 if Sapphire_Core::Enemy_Exclamation
  1643.         @move_type = 2
  1644.         @move_frequency = 6
  1645.         @request_view = false
  1646.       end
  1647.     when 6
  1648.       distance = ($game_player.px - @px)
  1649.       if ($game_player.py - @py).abs <= @cx && distance <= @enemy.view && distance >= 0
  1650.         @balloon_id = 1 if Sapphire_Core::Enemy_Exclamation
  1651.         @move_type = 2
  1652.         @move_frequency = 6
  1653.         @request_view = false
  1654.       end
  1655.     when 8
  1656.       distance = (@py - $game_player.py)
  1657.       if ($game_player.px - @px).abs <= @cx && distance <= @enemy.view && distance >= 0
  1658.         @balloon_id = 1 if Sapphire_Core::Enemy_Exclamation
  1659.         @move_type = 2
  1660.         @move_frequency = 6
  1661.         @request_view = false
  1662.       end
  1663.     end
  1664.   end
  1665.   def update_cast
  1666.     case @direction
  1667.     when 2
  1668.       distance = ($game_player.py - @py)
  1669.       if ($game_player.px - @px).abs <= @cx && distance <= @enemy.view && distance >= Sapphire_Core::Enemy_Skill_Distance
  1670.         $game_map.skills << Sapphire_Skill.new(self)
  1671.         @recover = @enemy.recover
  1672.       end
  1673.     when 4
  1674.       distance = (@px - $game_player.px)
  1675.       if ($game_player.py - @py).abs <= @cx && distance <= @enemy.view && distance >= Sapphire_Core::Enemy_Skill_Distance
  1676.         $game_map.skills << Sapphire_Skill.new(self)
  1677.         @recover = @enemy.recover
  1678.       end
  1679.     when 6
  1680.       distance = ($game_player.px - @px)
  1681.       if ($game_player.py - @py).abs <= @cx && distance <= @enemy.view && distance >= Sapphire_Core::Enemy_Skill_Distance
  1682.         $game_map.skills << Sapphire_Skill.new(self)
  1683.         @recover = @enemy.recover
  1684.       end
  1685.     when 8
  1686.       distance = (@py - $game_player.py)
  1687.       if ($game_player.px - @px).abs <= @cx && distance <= @enemy.view && distance >= Sapphire_Core::Enemy_Skill_Distance
  1688.         $game_map.skills << Sapphire_Skill.new(self)
  1689.         @recover = @enemy.recover
  1690.       end
  1691.     end
  1692.   end
  1693.   def setup_page(np)
  1694.     sas_setup_page(np)
  1695.     setup_enemy(np.nil?)
  1696.   end
  1697.   def setup_enemy(dispose_enemy)
  1698.     unless @enemy.nil?
  1699.       $game_map.enemies.delete(self)
  1700.       @enemy = nil
  1701.     end
  1702.     unless dispose_enemy && @list.nil?
  1703.       for command in @list
  1704.         if command.code == 108 && command.parameters[0].include?("[enemy")
  1705.           command.parameters[0].scan(/\[enemy ([0.0-9.9]+)\]/)
  1706.           spawn_enemy($1.to_i)
  1707.           return
  1708.         end
  1709.       end
  1710.     end
  1711.   end
  1712.   def spawn_enemy(id)
  1713.     $game_map.enemies << self if @enemy.nil?
  1714.     @enemy = Sapphire_Enemy.new(self,id)
  1715.     @recover = 0
  1716.     @step_anime = @enemy.step_anime
  1717.     @request_view = true unless @enemy.object
  1718.     @character_name = @enemy.char_file unless @enemy.char_file.nil?
  1719.     @character_index = @enemy.char_index unless @enemy.char_file.nil?
  1720.     @priority_type = 1
  1721.     setup_parameters
  1722.   end
  1723.   def setup_parameters
  1724.     return if @list.nil?
  1725.     for value in [email][email protected][/email]
  1726.       next if @list[value].code != 108 && @list[value].code != 408
  1727.       @enemy.atk_invincible = true if @list[value].parameters[0] == "[attack_invincible]"
  1728.       @enemy.skl_invincible = true if @list[value].parameters[0] == "[skill_invincible]"
  1729.       @enemy.die_erase = true if @list[value].parameters[0] == "[erase]"
  1730.       if @list[value].parameters[0].include?("[localsw")
  1731.         @list[value].parameters[0].scan(/\[localsw ([0.0-9.9]+)\]/)
  1732.         @enemy.die_localsw = $1.to_i
  1733.       end
  1734.       if @list[value].parameters[0].include?("[switch")
  1735.         @list[value].parameters[0].scan(/\[switch ([0.0-9.9]+)\]/)
  1736.         @enemy.die_switch = $1.to_i
  1737.       end
  1738.       if @list[value].parameters[0].include?("[variable")
  1739.         @list[value].parameters[0].scan(/\[variable ([0.0-9.9]+)\]/)
  1740.         @enemy.die_variable = $1.to_i
  1741.       end
  1742.     end
  1743.   end
  1744.   def run_enemy_commands
  1745.     ers = @enemy.die_erase
  1746.     $game_map.enemies.delete(self)
  1747.     unless @enemy.die_localsw.nil?
  1748.       key = [$game_map.map_id,@id,Sapphire_Core::Local_Switch[@enemy.die_localsw]]
  1749.       $game_self_switches[key] = true
  1750.       $game_map.need_refresh = true
  1751.     end
  1752.     unless @enemy.die_variable.nil?
  1753.       $game_variables[@enemy.die_variable] += 1
  1754.       $game_map.need_refresh = true
  1755.     end
  1756.     unless @enemy.die_switch.nil?
  1757.       $game_switches[@enemy.die_switch] = true
  1758.       $game_map.need_refresh = true
  1759.     end
  1760.     @enemy = nil
  1761.     erase if ers
  1762.   end
  1763.   def move_type_toward_player
  1764.     move_toward_player if near_the_player?
  1765.   end
  1766.   def setup_page_settings
  1767.     kp_setup_page_settings
  1768.     setup_collision
  1769.     multiply_commands
  1770.   end
  1771.   def collision?(px,py)
  1772.     for event in $game_map.events.values
  1773.       if (event.px - px).abs <= event.cx && (event.py - py).abs <= event.cy
  1774.         next if event.through || event == self
  1775.         return true if event.priority_type == 1
  1776.       end
  1777.     end
  1778.     if @priority_type == 1
  1779.       return true if ($game_player.px - px).abs <= @cx && ($game_player.py - py).abs <= @cy
  1780.     end
  1781.     return false
  1782.   end
  1783.   def setup_collision
  1784.     @cx = Default_Collision_X
  1785.     @cy = Default_Collision_Y
  1786.     unless @list.nil?
  1787.       for value in [email][email protected][/email]
  1788.         next if @list[value].code != 108 && @list[value].code != 408
  1789.         if @list[value].parameters[0].include?("[collision_x ")
  1790.           @list[value].parameters[0].scan(/\[collision_x ([0.0-9.9]+)\]/)
  1791.           @cx = $1.to_i
  1792.         end
  1793.         if @list[value].parameters[0].include?("[collision_y ")
  1794.           @list[value].parameters[0].scan(/\[collision_y ([0.0-9.9]+)\]/)
  1795.           @cy = $1.to_i
  1796.         end
  1797.       end
  1798.     end
  1799.   end
  1800.   def front_pixel_touch?(px,py)
  1801.     return if $game_map.interpreter.running?
  1802.     if @enemy.nil?
  1803.       if @trigger == 2 && ($game_player.px - px).abs <= @cx && ($game_player.py - py).abs <= @cy
  1804.         start if !jumping? && normal_priority?
  1805.       end
  1806.     else
  1807.       return if jumping? || @recover > 0 || @enemy.nature == 2 || @enemy.object
  1808.       attack if $game_map.sas_active && ($game_player.px - px).abs <= @cx && ($game_player.py - py).abs <= @cy
  1809.     end
  1810.   end
  1811. end

  1812. #-------------------------------------------------------------------------------
  1813. # * Game Interpreter
  1814. #-------------------------------------------------------------------------------

  1815. class Game_Interpreter
  1816.   def self_event
  1817.     return $game_map.events[@event_id]
  1818.   end
  1819. end

  1820. #-------------------------------------------------------------------------------
  1821. # * Sapphire Bitcore
  1822. #-------------------------------------------------------------------------------

  1823. module Sapphire_Bitcore
  1824.   def self.initialize
  1825.     @@buffer = {}
  1826.     for skill in load_data("Data/Skills.rvdata2")
  1827.       next if skill.nil? || skill.particle.nil?
  1828.       Sapphire_Bitcore.push(skill.particle)
  1829.     end
  1830.   end
  1831.   def self::[](key)
  1832.     return @@buffer[key]
  1833.   end
  1834.   def self.push(key)
  1835.     return if @@buffer.keys.include?(key)
  1836.     @@buffer[key] = Cache.particle(key)
  1837.   end
  1838. end

  1839. Sapphire_Bitcore.initialize

  1840. #-------------------------------------------------------------------------------
  1841. # * Sapphire Action System IV - Script End
  1842. #-------------------------------------------------------------------------------
复制代码
小妹我無能,請各位鞭小力點..
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
108
在线时间
1006 小时
注册时间
2008-11-9
帖子
1658
6
发表于 2012-4-5 21:47:50 | 只看该作者
本帖最后由 判约之轮 于 2012-4-5 21:49 编辑

PHP 代码复制
  1. #-------------------------------------------------------------------------------
  2. # * Register
  3. #-------------------------------------------------------------------------------
  4. if $khas_awesome.nil?
  5.   $khas_awesome = []
  6. else
  7.   scripts = []
  8.   $khas_awesome.each { |script| scripts << script[0] }
  9.   if scripts.include?("Pixel Movement")
  10.     error = Sprite.new
  11.     error.bitmap = Bitmap.new(544,416)
  12.     error.bitmap.draw_text(0,208,544,32,"Please remove the script Khas Pixel Movement",1)
  13.     continue = Sprite.new
  14.     continue.bitmap = Bitmap.new(544,416)
  15.     continue.bitmap.font.color = Color.new(0,255,0)
  16.     continue.bitmap.font.size = error.bitmap.font.size - 3
  17.     continue.bitmap.draw_text(0,384,544,32,"Press Enter to exit",1)
  18.     add = Math::PI/80; max = 2*Math::PI; angle = 0
  19.     loop do
  20.       Graphics.update; Input.update
  21.       angle += add; angle %= max
  22.       continue.opacity = 185 + 70* Math.cos(angle)
  23.       break if Input.trigger?(Input::C)
  24.     end
  25.     error.bitmap.dispose; continue.bitmap.dispose
  26.     error.bitmap = nil; continue.bitmap = nil
  27.     error.dispose; continue.dispose
  28.     error = nil; continue = nil
  29.     exit
  30.   end
  31. end
  32.  
  33. $khas_awesome << ["Sapphire Action System",4.1]


目测在这段中可以修改~

continue.bitmap.font.color = Color.new(0,255,0)
这是字符颜色初始化的参数~

找到RMVA的F1帮助文档,找到相关段落:
Color.new(red, green, blue[, alpha])
生成色彩对象。alpha 值省略时使用 255。


所以修改后面的参数吧,至于三个参数的具体数值,请百度“RGB比色板”就可以了~

@np9915

评分

参与人数 1星屑 +200 梦石 +2 收起 理由
迷糊的安安 + 200 + 2 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
102 小时
注册时间
2010-6-20
帖子
16
7
 楼主| 发表于 2012-4-6 13:06:11 | 只看该作者
謝謝你!
我知道找到方法解決了,真的很感謝!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-25 11:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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