Project1
标题:
求套装技能脚本和敌人血槽脚本.
[打印本页]
作者:
704018922
时间:
2010-11-8 18:51
标题:
求套装技能脚本和敌人血槽脚本.
本帖最后由 fux2 于 2010-11-9 18:23 编辑
敌人血槽脚本要选择敌人时在上方能看见,而不是战斗的时候一个血条在敌人下方.
作者:
704018922
时间:
2010-11-9 18:10
求解啊(貌似连贴了..)
作者:
mythos
时间:
2010-11-9 18:22
血条的看看这个行不行~
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
# 重新定义的内容,可以显示敌人的HP\MP百分比
# 你可以改脚本的开头部分定义生命、精神描述词。只和敌人描述有关,可随意修改
#==============================================================================
class Window_Help < Window_Base
def set_enemy(actor)
#--------------------------------------------------------------------
# 在这里修改描述文字,比如@生命描述词="敌人生命"
#--------------------------------------------------------------------
@生命描述词 = $data_system.words.hp
@精神描述词 = $data_system.words.sp
#--------------------------------------------------------------------
#--------------------------------------------------------------------
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
carol3_draw_hp_bar(actor, 284, 12)
carol3_draw_sp_bar(actor, 460, 12)
@text = nil
self.visible = true
end
def carol3_draw_hp_bar(actor, x, y, width = 128, height = 14) #宽度可调
w = width * actor.hp / [actor.maxhp,1].max
hp_color_1 = Color.new(255, 0, 0, 192)
hp_color_2 = Color.new(255, 255, 0, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x+2,-3,128,32,@生命描述词,1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x,-4,128,32,@生命描述词,1)
end
def carol3_draw_sp_bar(actor, x, y, width = 128, height=14)
w = width * actor.sp / [actor.maxsp,1].max
hp_color_1 = Color.new( 0, 0, 255, 192)
hp_color_2 = Color.new( 0, 255, 255, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x+2,-3,128,32,@精神描述词,1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x,-4,128,32,@精神描述词,1)
end
#--------------------------------------------------------------------------
# ● ライン描画 by 桜雅 在土
#--------------------------------------------------------------------------
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
# 描写距離の計算。大きめに直角時の長さ。
distance = (start_x - end_x).abs + (start_y - end_y).abs
# 描写開始
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.contents.set_pixel(x, y, start_color)
else
self.contents.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.contents.set_pixel(x, y, Color.new(r, g, b, a))
else
self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
作者:
704018922
时间:
2010-11-11 20:37
过了三个小时我又来回复了...
作者:
qaz4633063
时间:
2010-11-11 21:22
提示:
作者被禁止或删除 内容自动屏蔽
作者:
704018922
时间:
2010-11-12 18:10
回复
qaz4633063
的帖子
技能.
作者:
qaz4633063
时间:
2010-11-13 00:10
提示:
作者被禁止或删除 内容自动屏蔽
作者:
seo117
时间:
2010-11-13 00:18
mythos的正解。
作者:
Wind2010
时间:
2010-11-13 00:50
#============新套装系统(支持装备扩展)============By 凌冰===================
module SUITS
#==============
#||初始化数组||
#==============
WEAPON = []
ARMORS = []
SKILLS = []
PAR_PLU = []
AUT_STA = []
GUA_ELE = []
GUA_STA = []
ELEMENT = []
PLU_STA = []
MIN_STA = []
#=============================================================================
#设置方法
#=============================================================================
#==============
#||第一套套装||
#==============
WEAPON[1] = [1,5]
#武器本套装的所有武器
#即一套套装里可以有多副武器
ARMORS[1] = [[1,2],[5],[13]]
#防具 |盾| |头| |体| |饰(缺省)|
#即一套套装里可以有多副同类防具
#支持装备扩展,可以继续往后写
#如果套装中不包含某类,前面的或者中间的要写成[]或nil,后面的可以缺省
SKILLS[1] = [43,80]
#技能
PAR_PLU[1] = [50,30,10,10,10,10,10,10,10,10]
# |血|灵|力|敏|速|魔|攻|防|御|敏|
AUT_STA[1] = [13,15]
#自动状态
GUA_ELE[1] = [1,2,3,4,5,6]
#属性防御
GUA_STA[1] = [3,5,6,7]
#状态防御
ELEMENT[1] = [3,5,7,10]
#攻击属性
PLU_STA[1] = [2,4,5]
#攻击附加状态
MIN_STA[1] = [1,7,9]
#攻击解除状态
#================设置完毕================
end
module RPG
#============================================================================
#补充设置 自定义角色初始扩展装备的ID
#============================================================================
ARMOR5 = [0,0,0,0]#按照角色的ID顺序输入即可
ARMOR6 = [0,0,0,0]
ARMOR7 = [0,0,0,0]
ARMOR8 = [0,0,0,0]
end
module RPG
class Suit
attr_reader :id
attr_reader :weapon_id
attr_reader :armors_id
attr_reader :skills_id
attr_reader :plus
attr_reader :state
attr_reader :guard_e
attr_reader :guard_s
attr_reader :element
attr_reader :state_p
attr_reader :state_m
def initialize(suit_id)
@id = suit_id
@weapon_id = SUITS::WEAPON[@id]
@armors_id = SUITS::ARMORS[@id]
@skills_id = SUITS::SKILLS[@id]
@plus = SUITS::PAR_PLU[@id]
@state = SUITS::AUT_STA[@id]
@guard_e = SUITS::GUA_ELE[@id]
@guard_s = SUITS::GUA_STA[@id]
@element = SUITS::ELEMENT[@id]
@state_p = SUITS::PLU_STA[@id]
@state_m = SUITS::MIN_STA[@id]
end
end
def self.create
all_suits = []
for i in 1...SUITS::WEAPON.size
s = Suit.new(i)
all_suits[i] = s
end
return all_suits
end
end
#=============以上貌似多此一举= =|||==================
class Game_Actor < Game_Battler
alias setup_suit setup
def setup(actor_id)
actor = $data_actors[actor_id]
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@armor5_id = actor.armor5_id if defined?(armor5_id) != nil
@armor6_id = actor.armor6_id if defined?(armor6_id) != nil
@armor7_id = actor.armor7_id if defined?(armor7_id) != nil
@armor8_id = actor.armor8_id if defined?(armor8_id) != nil
@all_suits = RPG::create
refresh_suit
setup_suit(actor_id)
for suit in 1...@all_suits.size
suit_skill_list = suits_plus(suit,16)
for i in suit_skill_list
learn_skill(i) if suit_whole?(suit)
end
state_id = suits_plus(suit,10)
for id in state_id
add_state(id, true) if suit_whole?(suit)
end
end
end
def refresh_suit
@all_armors_id = [@armor1_id,@armor2_id,@armor3_id,@armor4_id]
@all_armors_id.push(@armor5_id) if defined?(armor5_id) != nil
@all_armors_id.push(@armor6_id) if defined?(armor6_id) != nil
@all_armors_id.push(@armor7_id) if defined?(armor7_id) != nil
@all_armors_id.push(@armor8_id) if defined?(armor8_id) != nil
@suits_list = get_suits
if @suits_list == []
@suits_list.push(0)
end
end
def suit_whole?(suit_id)
suit = @all_suits[suit_id]
if suit == nil
return false
end
unless suit.weapon_id.include?(@weapon_id)
return false if !(suit.weapon_id == (nil or []))
end
for j in 0...suit.armors_id.size
if suit.armors_id[j] == (nil or [])
next
end
unless suit.armors_id[j].include?(@all_armors_id[j])
return false
end
end
return true
end
def get_suits
suits = []
for i in 1...@all_suits.size
if suit_whole?(i)
suits.push(i)
end
end
return suits
end
def suits_plus(id,parameter)
if id == 0
if parameter < 10
return 0
else
return []
end
end
suit = @all_suits[id]
if parameter < 10
return suit.plus[parameter]
else
case parameter
when 10
return suit.state
when 11
return suit.guard_e
when 12
return suit.guard_s
when 13
return suit.element
when 14
return suit.state_p
when 15
return suit.state_m
when 16
return suit.skills_id
else
return nil
end
end
end
alias base_maxhp_suit base_maxhp
def base_maxhp
n = base_maxhp_suit
for i in @suits_list
n += suits_plus(i,0)
end
return n
end
alias base_maxsp_suit base_maxsp
def base_maxsp
n = base_maxsp_suit
for i in @suits_list
n += suits_plus(i,1)
end
return n
end
alias base_str_suit base_str
def base_str
n = base_str_suit
for i in @suits_list
n += suits_plus(i,2)
end
return n
end
alias base_dex_suit base_dex
def base_dex
n = base_dex_suit
for i in @suits_list
n += suits_plus(i,3)
end
return n
end
alias base_agi_suit base_agi
def base_agi
n = base_agi_suit
for i in @suits_list
n += suits_plus(i,4)
end
return n
end
alias base_int_suit base_int
def base_int
n = base_int_suit
for i in @suits_list
n += suits_plus(i,5)
end
return n
end
alias base_atk_suit base_atk
def base_atk
n = base_atk_suit
for i in @suits_list
n += suits_plus(i,6)
end
return n
end
alias base_pdef_suit base_pdef
def base_pdef
n = base_pdef_suit
for i in @suits_list
n += suits_plus(i,7)
end
return n
end
alias base_mdef_suit base_mdef
def base_mdef
n = base_mdef_suit
for i in @suits_list
n += suits_plus(i,8)
end
return n
end
alias base_eva_suit base_eva
def base_eva
n = base_eva_suit
for i in @suits_list
n += suits_plus(i,9)
end
return n
end
alias suit_element_rate element_rate
def element_rate(element_id)
result = suit_element_rate(element_id)
for suit in @suits_list
suit_element_guard = suits_plus(suit,11)
result/= 2 if suit_element_guard.include?(element_id)
end
return result
end
alias suit_state_guard? state_guard?
def state_guard?(state_id)
result = suit_state_guard?(state_id)
for suit in @suits_list
suit_state_guard = suits_plus(suit,12)
result = suit_state_guard.include?(state_id)
end
return result
end
alias suit_element_set element_set
def element_set
result = suit_element_set
for suit in @suits_list
suit_element = suits_plus(suit,13)
for i in suit_element
result.push(i) if !result.include?(i)
end
end
return result
end
alias suit_plus_state_set plus_state_set
def plus_state_set
result = suit_plus_state_set
for suit in @suits_list
suit_plus_state = suits_plus(suit,14)
for i in suit_plus_state
result.push(i) if !result.include?(i)
end
end
return result
end
alias suit_minus_state_set minus_state_set
def minus_state_set
result = suit_minus_state_set
for suit in @suits_list
suit_minus_state = suits_plus(suit,15)
for i in suit_minus_state
result.push(i) if !result.include?(i)
end
end
return result
end
alias suit_equip equip
def equip(equip_type, id)
suit_equip(equip_type, id)
refresh_suit
for suit in 1...@all_suits.size
suit_skill_list = suits_plus(suit,16)
for i in suit_skill_list
learn_skill(i) if suit_whole?(suit)
forget_skill(i) if skill_learn?(i) and !suit_whole?(suit)
end
state_id = suits_plus(suit,10)
for id in state_id
add_state(id, true) if suit_whole?(suit)
remove_state(id, true) if state?(id) and !suit_whole?(suit)
end
end
end
end
module RPG
class Actor
def armor5_id
return (ARMOR5[@id-1] == nil ? 0 : ARMOR5[@id-1])
end
def armor6_id
return (ARMOR6[@id-1] == nil ? 0 : ARMOR6[@id-1])
end
def armor7_id
return (ARMOR7[@id-1] == nil ? 0 : ARMOR7[@id-1])
end
def armor8_id
return (ARMOR8[@id-1] == nil ? 0 : ARMOR8[@id-1])
end
end
end
复制代码
不但有技能的还有其他的功能
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1