魔塔吧 关注:67,070贴子:2,181,239
  • 3回复贴,共1

大家帮我看看我写的24层脚本

取消只看楼主收藏回复

刷新时等待没用,显示不了窗口,请各位高手帮帮我,多谢啊
















$怪物生命变量=53
$窗口开关=53
$秒杀机会=10
#----------------------------------------------------------------------------
# ■ 战斗系统                                 by 魔塔Z剑
#----------------------------------------------------------------------------
#@zd = Window_zd.new            开  
#@zd .dispose                   关
#本脚本只支持本样板
#----------------------------------------------------------------------------
class Interpreter
  def vs
@zd = Window_zd.new
e=Enemy_property.new($game_variables[4])
$game_variables[$怪物生命变量]=e.ehp
loop do
if $game_actors[$game_variables[1]+1].weapon_id==0
av=1 #没有装备武器则用1号[空手]动画
else
av=$data_weapons[$game_actors[$game_variables[1]+1].weapon_id].animation1_id
av=1 if av==0#武器没有动画则用1号[空手]动画
end#if
#根据角色装备的武器决定动画
$game_map.events[@event_id].opacity=255
$game_map.events[@event_id].animation_id=av
e=Enemy_property.new($game_variables[4])
$game_variables[$怪物生命变量]-=e.mg
@wait_count=5
@zd .dispose
@zd = Window_zd.new
if $game_variables[$怪物生命变量]<=0
break
end#if
#勇士受伤害
@e=$game_variables[4]
@w=$data_enemies[@e].name.split(':')[1].to_i
@w=1 if @w==0
$game_player.animation_id=@w
e=Enemy_property.new($game_variables[4])
$game_actors[$game_variables[1]+1].hp-=e.eg
if $game_actors[$game_variables[1]+1].hp==0
$game_variables[19]=1
$game_temp.common_event_id=12
#[结局判定]
break
end#if
@wait_count=5
@zd .dispose
@zd = Window_zd.new
end#loop do
@zd .dispose
end#def
end#class
  
#----------------------------------------------------------------------------
# ■ 战斗窗口                                 by 魔塔Z剑
#----------------------------------------------------------------------------
class Window_zd < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化窗口
  #--------------------------------------------------------------------------
  def initialize
    super(192, 160, 416, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity=100
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    
    self.contents.font.color = system_color
    draw_actor_graphic($game_party.actors[0], 95, 32)
    self.contents.draw_text(70, 3, 70, 70, "勇士")
    return if $game_variables[4]==0#错误时中断
    bitmap = RPG::Cache.battler($data_enemies[$game_variables[4]].battler_name , $data_enemies[$game_variables[4]].battler_hue )
    src_rect = Rect.new(0, 0,bitmap.width, bitmap.height)
    self.contents.blt(300, 0, bitmap, src_rect)
    self.contents.draw_text(285, 0, 70, 70, $data_enemies[$game_variables[4]].name.split(':')[0].to_s)
#------------------------------------------------------------------------------
# ● 判断怪物类型
#------------------------------------------------------------------------------
    @orbatk=$game_variables[44]
    @orbdef=$game_variables[45]
    @orbhp=$game_variables[46]
    @ma=$game_actors[$game_variables[1]+1].str
    @md=$game_actors[$game_variables[1]+1].dex#勇防
    @mma=@ma
    @mmd=@md
    @ea=$data_enemies[$game_variables[4]].atk
    @ed=$data_enemies[$game_variables[4]].pdef
    @ehp=$data_enemies[$game_variables[4]].maxhp
    @ma=($game_actors[$game_variables[1]+1].str*@orbatk).to_i
    @md=($game_actors[$game_variables[1]+1].dex*@orbdef).to_i
    @mhp=$game_actors[$game_variables[1]+1].hp
    @pro="EXP:#{$data_enemies[$game_variables[4]].exp}   gold:#{$data_enemies[$game_variables[4]].gold}"
###############################################################################
#以下是属性
###############################################################################
    self.contents.draw_text(180, 83, 300, 70, @pro.to_s)
    self.contents.font.color = text_color(2)
    self.contents.draw_text(170, 0, 50, 30, "V S")
    self.contents.font.color = system_color
    self.contents.draw_text(3, 23, 70, 70, "生命"+@mhp.to_s)
    self.contents.draw_text(230, 23, 70, 70, "生命"+$game_variables[$怪物生命变量].to_s)
    self.contents.draw_text(3, 43, 70, 70, "攻击"+@mma.to_s+"+"+(@ma-@mma).to_s)
    self.contents.draw_text(230, 43, 70, 70, "攻击"+@ea.to_s)
    self.contents.draw_text(3, 63, 70, 70, "防御"+@mmd.to_s+"+"+(@md-@mmd).to_s)
    self.contents.draw_text(230, 63, 70, 70, "防御"+@ed.to_s)
  end
end 


1楼2008-01-06 13:43回复
    ...


    3楼2008-01-06 14:01
    回复
      2025-12-10 08:10:53
      广告
      不感兴趣
      开通SVIP免广告
      可以直接用事件,但是我不知道怎样用脚本刷新窗


      5楼2008-01-06 14:03
      回复
        多谢,我现在不用脚本运行战斗了


        7楼2008-01-06 14:08
        回复