Project1
标题:
帮忙修改下脚本```
[打印本页]
作者:
koalli
时间:
2007-6-28 16:48
标题:
帮忙修改下脚本```
class Scene_Battle_CP
include SetCP
attr_accessor :stop
attr_accessor :ttbar
attr_accessor :refresh
BATTLE_SPEED = 0.8
def initialize
# 刷新标志
@refresh = Hash.new(false)
@stop = false
@all_agi = 0
@v = Viewport.new(150-64, 32, 14, 172)
@v.z = 60
@cpbar = Sprite.new(@v)
@cpbar.bitmap = RPG::Cache.system("atb")
@ttbar = {}
for battler in $game_party.actors + $game_troop.enemies
@all_agi += battler.agi
@ttbar[battler] = CPSprite.new
if battler.is_a?(Game_Actor)
@ttbar[battler].bitmap = RPG::Cache.system("actor").dup
bitmap = RPG::Cache.system(Bar[battler.type][0])
@ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
@ttbar[battler].x = 150-64-27
else
@ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
bitmap = RPG::Cache.system(Bar[battler.type][0])
@ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
@ttbar[battler].x = 150 - 63
end
@ttbar[battler].z = 101
@ttbar[battler].visible = false
end
end
def update
@ttbar.each{|key, value|
if value.disposed?
@ttbar.delete(key)
next
end
value.update}
return if @stop
for battler in $game_party.actors + $game_troop.enemies
if battler.dead?
if @ttbar.include?(battler)
@ttbar[battler].collapse
#@ttbar[battler].dispose
#@ttbar.delete(battler)
end
battler.cp = 0
next
end
battler.cp = [[battler.cp + BATTLE_SPEED * 10 * battler.agi / @all_agi, 0].max,100].min
if battler.cp == battler.maxcp
@refresh[battler] = false
case battler
when Game_Actor
@ttbar[battler].bitmap = RPG::Cache.system("actor_active").dup
bitmap = RPG::Cache.system(Bar[battler.type][1])
@ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
when Game_Enemy
@ttbar[battler].bitmap = RPG::Cache.system("enemy_active").dup
bitmap = RPG::Cache.system(Bar[battler.type][1])
@ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
end
@ttbar[battler].z = 200
elsif battler.cp != battler.maxcp and @refresh[battler] == true
@refresh[battler] = false
case battler
when Game_Actor
@ttbar[battler].bitmap = RPG::Cache.system("actor").dup
bitmap = RPG::Cache.system(Bar[battler.type][0])
@ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
when Game_Enemy
@ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
bitmap = RPG::Cache.system(Bar[battler.type][0])
@ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
end
@ttbar[battler].z = 100
end
@ttbar[battler].visible = true if @ttbar[battler].visible == false
@ttbar[battler].y = (142 - (battler.cp * 135 / battler.maxcp)) + 32-7
end
end
def dispose
@v.dispose
@cpbar.dispose
for v in @ttbar.values
v.dispose
end
end
class CPSprite < ::Sprite
def initialize(v=nil)
super
@_collapse_duration = 0
end
def collapse
self.blend_type = 1
self.color.set(255, 64, 64, 255)
self.opacity = 255
@_collapse_duration = 30
end
def update
super
if @_collapse_duration > 0
@_collapse_duration -= 1
self.opacity = 256 - (30 - @_collapse_duration) * 9
end
if self.opacity == 0
self.dispose
end
end
end
end
复制代码
这个是从战斗真位移里面弄下来的。我想把Y调大点。可是修改了好多地方都是错的。
会变成攻击打到后Y先下降再上升(图标先升上去又掉下来。。。)
本来应该是打到后图标直接下降。实在是改不出来这个效果。。。
会的或作者进来帮忙下。。。
作者:
koalli
时间:
2007-6-28 16:48
标题:
帮忙修改下脚本```
class Scene_Battle_CP
include SetCP
attr_accessor :stop
attr_accessor :ttbar
attr_accessor :refresh
BATTLE_SPEED = 0.8
def initialize
# 刷新标志
@refresh = Hash.new(false)
@stop = false
@all_agi = 0
@v = Viewport.new(150-64, 32, 14, 172)
@v.z = 60
@cpbar = Sprite.new(@v)
@cpbar.bitmap = RPG::Cache.system("atb")
@ttbar = {}
for battler in $game_party.actors + $game_troop.enemies
@all_agi += battler.agi
@ttbar[battler] = CPSprite.new
if battler.is_a?(Game_Actor)
@ttbar[battler].bitmap = RPG::Cache.system("actor").dup
bitmap = RPG::Cache.system(Bar[battler.type][0])
@ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
@ttbar[battler].x = 150-64-27
else
@ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
bitmap = RPG::Cache.system(Bar[battler.type][0])
@ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
@ttbar[battler].x = 150 - 63
end
@ttbar[battler].z = 101
@ttbar[battler].visible = false
end
end
def update
@ttbar.each{|key, value|
if value.disposed?
@ttbar.delete(key)
next
end
value.update}
return if @stop
for battler in $game_party.actors + $game_troop.enemies
if battler.dead?
if @ttbar.include?(battler)
@ttbar[battler].collapse
#@ttbar[battler].dispose
#@ttbar.delete(battler)
end
battler.cp = 0
next
end
battler.cp = [[battler.cp + BATTLE_SPEED * 10 * battler.agi / @all_agi, 0].max,100].min
if battler.cp == battler.maxcp
@refresh[battler] = false
case battler
when Game_Actor
@ttbar[battler].bitmap = RPG::Cache.system("actor_active").dup
bitmap = RPG::Cache.system(Bar[battler.type][1])
@ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
when Game_Enemy
@ttbar[battler].bitmap = RPG::Cache.system("enemy_active").dup
bitmap = RPG::Cache.system(Bar[battler.type][1])
@ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
end
@ttbar[battler].z = 200
elsif battler.cp != battler.maxcp and @refresh[battler] == true
@refresh[battler] = false
case battler
when Game_Actor
@ttbar[battler].bitmap = RPG::Cache.system("actor").dup
bitmap = RPG::Cache.system(Bar[battler.type][0])
@ttbar[battler].bitmap.blt(0,2,bitmap,bitmap.rect)
when Game_Enemy
@ttbar[battler].bitmap = RPG::Cache.system("enemy").dup
bitmap = RPG::Cache.system(Bar[battler.type][0])
@ttbar[battler].bitmap.blt(12,0,bitmap,bitmap.rect)
end
@ttbar[battler].z = 100
end
@ttbar[battler].visible = true if @ttbar[battler].visible == false
@ttbar[battler].y = (142 - (battler.cp * 135 / battler.maxcp)) + 32-7
end
end
def dispose
@v.dispose
@cpbar.dispose
for v in @ttbar.values
v.dispose
end
end
class CPSprite < ::Sprite
def initialize(v=nil)
super
@_collapse_duration = 0
end
def collapse
self.blend_type = 1
self.color.set(255, 64, 64, 255)
self.opacity = 255
@_collapse_duration = 30
end
def update
super
if @_collapse_duration > 0
@_collapse_duration -= 1
self.opacity = 256 - (30 - @_collapse_duration) * 9
end
if self.opacity == 0
self.dispose
end
end
end
end
复制代码
这个是从战斗真位移里面弄下来的。我想把Y调大点。可是修改了好多地方都是错的。
会变成攻击打到后Y先下降再上升(图标先升上去又掉下来。。。)
本来应该是打到后图标直接下降。实在是改不出来这个效果。。。
会的或作者进来帮忙下。。。
作者:
神思
时间:
2007-6-28 18:37
在Scene_Battle 4里面也有2句更改坐标的东西`````
作者:
koalli
时间:
2007-6-28 18:43
def move(active_battler, target, ox, oy, 返回标记 = false)
ta_x = target[0]
ta_y = target[1]
if 返回标记
active_battler.movex = (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox) / @_move_duration
active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy) / @_move_duration
else
if @active_battler.is_a?(Game_Enemy)
active_battler.movex = (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox - (active_battler.width / 2.5)) / @_move_duration
active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy - (active_battler.height / 5.5)) / @_move_duration
else
active_battler.movex = (active_battler.movex * (@_move_duration - 1) + ta_x.to_f - ox + (active_battler.width / 2.5)) / @_move_duration
active_battler.movey = (active_battler.movey * (@_move_duration - 1) + ta_y.to_f - oy + (active_battler.height / 5.5)) / @_move_duration
end
end
end
复制代码
是这个吗。。。该怎么改?我那个汗```
例如我想把Y改成100。需要修改到哪几个位置的东西?
作者:
神思
时间:
2007-6-28 18:45
{/gg}{/gg}
你试下搜索@battler_cp.ttbar[target].y =
- -``另外``你能不能把LS的那段脚本给XX了```
{/gg}写的自己都没眼看了`
作者:
koalli
时间:
2007-6-28 18:49
汗。。。原来还藏了两个```
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1