赞 | 0 |
VIP | 170 |
好人卡 | 5 |
积分 | 1 |
经验 | 15787 |
最后登录 | 2013-8-6 |
在线时间 | 285 小时 |
Lv1.梦旅人 垃圾死人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 285 小时
- 注册时间
- 2009-1-27
- 帖子
- 2420
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
叶子前辈的战棋系统的防具似乎设置了属性(移动啊,射程啊之类的)也是没用的。。。(我的构思时装备上个好点的马能多走一点格。。。)看了下脚本(我的脚本水准非常烂。。。)。。。我在module RPG项的312行开始的防具那按照上面武器的类型加上了脚本:
#防具+移动范围
def move_range
move = 0
for i in 0...DEFAULT_MOVE.size
if @guard_element_set.include?(DELAY_MOVE)
move += 2 ** i * 10
end
end
return move
end
但是进入游戏移动的时候依然没加到移动属性。。。。
请前辈们指导下我该怎么改。。。。谢谢。。。。
附上module rpg 项的脚本
- module RPG
- #--------------------------------------------------------------------------
- #
- # 数据属性系列(没办法,作为SLG,要设置的东西太多了)
- #
- #--------------------------------------------------------------------------
- # 默认射程为0,51-55号属性分别加1、2、4、8、16
- first = 51
- RANGE_ELEMENT = [first,first+1,first+2,first+3,first+4]
- #--------------------------------------------------------------------------
- # AOE范围属性,默认为0,56-60号属性分别加1、2、4、8、16
- first = 56
- AOE_ELEMENT = [first,first+1,first+2,first+3,first+4]
- # AOE类型属性(直线、十字、锥形,是否带地面障碍判断)(未制作)
- first = 61
- AOE_KIND_ELEMENT = [first,first+1,first+2,first+3,first+4]
- #--------------------------------------------------------------------------
- # 默认移动范围
- DEFAULT_MOVE = 0
- # 移动范围属性(最后一个保留作飞行/地面)
- first = 66
- MOVE_ELEMENT = [first,first+1,first+2,first+3,first+4]
- #--------------------------------------------------------------------------
- # 默认视野范围
- DEFAULT_VIEW = 5
- # 视野范围属性(最后一个保留作透视?)
- first = 71
- VIEW_ELEMENT = [first,first+1,first+2,first+3,first+4]
- #--------------------------------------------------------------------------
- # 默认自身延迟
- DEFAULT_DELAY = 0
- # 延迟属性
- first = 76
- DELAY_ELEMENT = [first,first+1,first+2,first+3,first+4,first+5,first+6,
- first+7,first+8,first+9]
- #--------------------------------------------------------------------------
- # 咏唱标志属性
- CASTING_FLAG_ELEMENT = 86
- # 咏唱时间属性
- first = 87
- CASTING_ELEMENT = [first,first+1,first+2,first+3,first+4,first+5,first+6,
- first+7,first+8,first+9]
- #--------------------------------------------------------------------------
- # 冷却标志属性
- COOLDOWN_FLAG_ELEMENT = 97
- # 冷却时间属性
- first = 98
- COOLDOWN_ELEMENT = [first,first+1,first+2,first+3,first+4,first+5,first+6,
- first+7,first+8,first+9]
- #--------------------------------------------------------------------------
- #
- # 标志属性系列
- #
- #--------------------------------------------------------------------------
- # 攻击用特技标志(作为“攻击”这一项的特技打上的标志,防止不能使用)
- FOR_ATTACK_ELEMENT = 109
- #--------------------------------------------------------------------------
- # 动作延迟套用使用者标志属性
- # 特技/物品造成的动作延迟为
- # 武器动作延迟(我方)或 0(敌方)+ 特技/物品的动作延迟
- USER_ACTION_DELAY_ELEMENT = 110
- #--------------------------------------------------------------------------
- # 附加状态套用使用者标志属性
- # 特技/物品的附加状态套用使用者攻击附加状态(我方的话是武器的附加状态)
- USER_STATES_PLUS_ELEMENT = 111
- #--------------------------------------------------------------------------
- # 附加属性套用使用者标志属性
- # 特技/物品的附加属性套用使用者攻击附加属性(我方的话是武器的附加属性)
- USER_ELEMENT_SET_ELEMENT = 112
- #--------------------------------------------------------------------------
- # 动画套用使用者标志属性
- # 特技/物品的动画(使用者动画和目标动画)套用使用者的
- USER_ANIMATION_ELEMENT = 113
- #--------------------------------------------------------------------------
- # 套用战斗者射程标志属性
- USER_RANGE_ELEMENT = 114
- #--------------------------------------------------------------------------
- # 套用战斗者范围标志属性
- USER_AOE_ELEMENT = 115
- #--------------------------------------------------------------------------
- # 不显示帮助窗口标志属性
- # 不显示使用特技或物品时上面那个写出名字的窗口
- NO_HELP_WINDOW_ELEMENT = 116
- #--------------------------------------------------------------------------
- # 取消自身行动延迟标志
- # 增加延迟时不增加motion_delay
- CANCEL_MOTION_DELAY_ELEMENT = 118
- #--------------------------------------------------------------------------
- # 锁定型技能标志(仅限于AOE=1的咏唱技能)
- # 咏唱时锁定目标,即使目标移动,咏唱完毕后照样攻击到
- LOCK_TARGET_ELEMENT = 119
- #--------------------------------------------------------------------------
- # 不干扰状态的特技标志
- # 回复类技能记得勾上这个标志
- # 增加这个的原因是觉得内置的要物理攻击才能干扰状态的设定太恶心了
- # 其实也是为了配合变羊术
- NO_REMOVE_STATES_ELEMENT = 120
- #--------------------------------------------------------------------------
- # DOT状态标志属性
- # 带有此标志状态,状态承受者每回合应用一次同ID的特技的效果
- # 可以带有多个DOT,会根据状态的定量,从大到小应用DOT效果
- DOT_ELEMENT = 122
- #--------------------------------------------------------------------------
- $ignore_elements += RANGE_ELEMENT + AOE_ELEMENT + AOE_KIND_ELEMENT +
- MOVE_ELEMENT + DELAY_ELEMENT + [FOR_ATTACK_ELEMENT, USER_ACTION_DELAY_ELEMENT,
- USER_STATES_PLUS_ELEMENT, USER_ELEMENT_SET_ELEMENT, USER_ANIMATION_ELEMENT,
- USER_RANGE_ELEMENT, USER_AOE_ELEMENT,NO_HELP_WINDOW_ELEMENT,
- CANCEL_MOTION_DELAY_ELEMENT, LOCK_TARGET_ELEMENT,
- NO_REMOVE_STATES_ELEMENT, DOT_ELEMENT]
- #--------------------------------------------------------------------------
- # ● 特技
- #--------------------------------------------------------------------------
- class Skill
- # ◎判断是否攻击用特技
- def for_attack?
- if @element_set.include?(FOR_ATTACK_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者动作延迟
- def user_action_delay?
- if @element_set.include?(USER_ACTION_DELAY_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者附加状态
- def user_states_plus?
- if @element_set.include?(USER_STATES_PLUS_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者附加属性
- def user_element_set?
- if @element_set.include?(USER_ELEMENT_SET_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者动画
- def user_animation?
- if @element_set.include?(USER_ANIMATION_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者射程
- def user_range?
- if @element_set.include?(USER_RANGE_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者范围
- def user_aoe?
- if @element_set.include?(USER_AOE_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否显示帮助窗口
- def help_window?
- if @element_set.include?(NO_HELP_WINDOW_ELEMENT)
- return false
- end
- return true
- end
- # ◎判断是否咏唱特技
- def cast?
- if @element_set.include?(CASTING_FLAG_ELEMENT)
- return true
- end
- return false
- end
- # ◎判断是否冷却特技
- def cooldown?
- if @element_set.include?(COOLDOWN_FLAG_ELEMENT)
- return true
- end
- return false
- end
- # ◎判断是否锁定型特技
- def lock_target?
- if @element_set.include?(LOCK_TARGET_ELEMENT) and aoe == 1 and cast?
- return true
- end
- return false
- end
- # ◎判断是否取消自身行动延迟
- def cancel_motion_delay?
- if @element_set.include?(CANCEL_MOTION_DELAY_ELEMENT)
- return true
- end
- return false
- end
- # ◎判断是否干扰状态
- def remove_states?
- if @element_set.include?(NO_REMOVE_STATES_ELEMENT)
- return false
- end
- return true
- end
- #--------------------------------------------------------------------------
- # ◎ 添加特技咏唱时间(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def casting_time
- cast = 0
- for i in 0...CASTING_ELEMENT.size
- if @element_set.include?(CASTING_ELEMENT[i])
- cast += 2 ** i * 10
- end
- end
- return cast
- end
- #--------------------------------------------------------------------------
- # ◎ 添加特技冷却时间(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def cooldown_time
- time = 0
- for i in 0...COOLDOWN_ELEMENT.size
- if @element_set.include?(COOLDOWN_ELEMENT[i])
- time += 2 ** i * 10
- end
- end
- return time
- end
- #--------------------------------------------------------------------------
- # ◎ 添加特技射程和范围
- #--------------------------------------------------------------------------
- # 射程
- def range
- range = 0
- for i in 0...RANGE_ELEMENT.size
- if @element_set.include?(RANGE_ELEMENT[i])
- range += 2 ** i
- end
- end
- return range
- end
- # 范围
- def aoe
- aoe = 0
- for i in 0...AOE_ELEMENT.size
- if @element_set.include?(AOE_ELEMENT[i])
- aoe += 2 ** i
- end
- end
- return aoe
- end
- #--------------------------------------------------------------------------
- # ◎ 添加特技延迟(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def action_delay
- delay = 0
- for i in 0...DELAY_ELEMENT.size
- if @element_set.include?(DELAY_ELEMENT[i])
- delay += 2 ** i * 10
- end
- end
- return delay
- end
- end
- #--------------------------------------------------------------------------
- # ● 武器
- #--------------------------------------------------------------------------
- class Weapon
- #--------------------------------------------------------------------------
- # ◎ 添加武器射程和范围
- #--------------------------------------------------------------------------
- # 射程
- def range
- range = 0
- for i in 0...RANGE_ELEMENT.size
- if @element_set.include?(RANGE_ELEMENT[i])
- range += 2 ** i
- end
- end
- return range
- end
- # 范围
- def aoe
- aoe = 0
- for i in 0...AOE_ELEMENT.size
- if @element_set.include?(AOE_ELEMENT[i])
- aoe += 2 ** i
- end
- end
- return aoe
- end
- #--------------------------------------------------------------------------
- # ◎ 添加武器动作延迟(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def action_delay
- delay = 0
- for i in 0...DELAY_ELEMENT.size
- if @element_set.include?(DELAY_ELEMENT[i])
- delay += 2 ** i * 10
- end
- end
- return delay
- end
- end
- #--------------------------------------------------------------------------
- # ● 防具
- #--------------------------------------------------------------------------
- class Armor
- #--------------------------------------------------------------------------
- # ◎ 添加防具行动延迟
- #--------------------------------------------------------------------------
- def motion_delay
- delay = 0
- for i in 0...DELAY_ELEMENT.size
- if @guard_element_set.include?(DELAY_ELEMENT[i])
- delay += 2 ** i * 10
- end
- end
- return delay
- end
- end
- #--------------------------------------------------------------------------
- # ● 物品
- #--------------------------------------------------------------------------
- class Item
- #--------------------------------------------------------------------------
- # ◎ 添加物品射程和范围
- #--------------------------------------------------------------------------
- # 射程
- def range
- range = 0
- for i in 0...RANGE_ELEMENT.size
- if @element_set.include?(RANGE_ELEMENT[i])
- range += 2 ** i
- end
- end
- return range
- end
- # 范围
- def aoe
- aoe = 0
- for i in 0...AOE_ELEMENT.size
- if @element_set.include?(AOE_ELEMENT[i])
- aoe += 2 ** i
- end
- end
- return aoe
- end
- # ◎判断是否套用使用者动作延迟
- def user_action_delay?
- if @element_set.include?(USER_ACTION_DELAY_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者附加状态
- def user_states_plus?
- if @element_set.include?(USER_STATES_PLUS_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者附加属性
- def user_element_set?
- if @element_set.include?(USER_ELEMENT_SET_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者动画
- def user_animation?
- if @element_set.include?(USER_ANIMATION_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者射程
- def user_range?
- if @element_set.include?(USER_RANGE_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否套用使用者范围
- def user_aoe?
- if @element_set.include?(USER_AOE_ELEMENT)
- return true
- else
- return false
- end
- end
- # ◎判断是否咏唱物品
- def cast?
- if @element_set.include?(CASTING_FLAG_ELEMENT)
- return true
- end
- return false
- end
- # ◎判断是否显示帮助窗口
- def help_window?
- if @element_set.include?(NO_HELP_WINDOW_ELEMENT)
- return false
- end
- return true
- end
- # ◎判断是否冷却物品
- def cooldown?
- # 有冷却标志及非消耗品
- if @element_set.include?(COOLDOWN_FLAG_ELEMENT) and !@consumable
- return true
- end
- return false
- end
- # ◎判断是否锁定型物品
- def lock_target?
- if @element_set.include?(LOCK_TARGET_ELEMENT) and aoe == 1 and cast?
- return true
- end
- return false
- end
- # ◎判断是否取消自身行动延迟
- def cancel_motion_delay?
- if @element_set.include?(CANCEL_MOTION_DELAY_ELEMENT)
- return true
- end
- return false
- end
- # ◎判断是否干扰状态
- def remove_states?
- if @element_set.include?(NO_REMOVE_STATES_ELEMENT)
- return false
- end
- return true
- end
- #--------------------------------------------------------------------------
- # ◎ 添加物品咏唱时间(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def casting_time
- cast = 0
- for i in 0...CASTING_ELEMENT.size
- if @element_set.include?(CASTING_ELEMENT[i])
- cast += 2 ** i * 10
- end
- end
- return cast
- end
- #--------------------------------------------------------------------------
- # ◎ 添加物品冷却时间(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def cooldown_time
- time = 0
- for i in 0...COOLDOWN_ELEMENT.size
- if @element_set.include?(COOLDOWN_ELEMENT[i])
- time += 2 ** i * 10
- end
- end
- return time
- end
- #--------------------------------------------------------------------------
- # ◎ 添加物品延迟(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def action_delay
- delay = 0
- for i in 0...DELAY_ELEMENT.size
- if @element_set.include?(DELAY_ELEMENT[i])
- delay += 2 ** i * 10
- end
- end
- return delay
- end
- end
- #--------------------------------------------------------------------------
- # ● 状态
- #--------------------------------------------------------------------------
- class State
- #--------------------------------------------------------------------------
- # ◎ 添加状态DOT效果
- #--------------------------------------------------------------------------
- def damage_over_time?
- if @guard_element_set.include?(DOT_ELEMENT)
- return true
- else
- return false
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 职业
- #--------------------------------------------------------------------------
- class Class
- #--------------------------------------------------------------------------
- # ◎ 添加职业移动范围
- #--------------------------------------------------------------------------
- def move_range
- move = DEFAULT_MOVE
- case @element_ranks[MOVE_ELEMENT[0]]
- when 2
- move += 1
- when 4
- move -= 1
- end
- case @element_ranks[MOVE_ELEMENT[1]]
- when 2
- move += 2
- when 4
- move -= 2
- end
- case @element_ranks[MOVE_ELEMENT[2]]
- when 2
- move += 4
- when 4
- move -= 4
- end
- case @element_ranks[MOVE_ELEMENT[3]]
- when 2
- move += 8
- when 4
- move -= 8
- end
- return [move, 0].max
- end
- #--------------------------------------------------------------------------
- # ◎ 添加职业基本行动延迟(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def motion_delay
- delay = DEFAULT_DELAY
- case @element_ranks[DELAY_ELEMENT[0]]
- when 2
- delay += 10
- when 4
- delay -= 10
- end
- case @element_ranks[DELAY_ELEMENT[1]]
- when 2
- delay += 20
- when 4
- delay -= 20
- end
- case @element_ranks[DELAY_ELEMENT[2]]
- when 2
- delay += 40
- when 4
- delay -= 40
- end
- case @element_ranks[DELAY_ELEMENT[3]]
- when 2
- delay += 80
- when 4
- delay -= 80
- end
- case @element_ranks[DELAY_ELEMENT[4]]
- when 2
- delay += 160
- when 4
- delay -= 160
- end
- case @element_ranks[DELAY_ELEMENT[5]]
- when 2
- delay += 320
- when 4
- delay -= 320
- end
- case @element_ranks[DELAY_ELEMENT[6]]
- when 2
- delay += 640
- when 4
- delay -= 640
- end
- case @element_ranks[DELAY_ELEMENT[7]]
- when 2
- delay += 1280
- when 4
- delay -= 1280
- end
- return [delay, 0].max
- end
- end
- #--------------------------------------------------------------------------
- # ● 敌人
- #--------------------------------------------------------------------------
- class Enemy
- #--------------------------------------------------------------------------
- # ◎ 添加敌人移动范围
- #--------------------------------------------------------------------------
- def move_range
- move = DEFAULT_MOVE
- case @element_ranks[MOVE_ELEMENT[0]]
- when 2
- move += 1
- when 4
- move -= 1
- end
- case @element_ranks[MOVE_ELEMENT[1]]
- when 2
- move += 2
- when 4
- move -= 2
- end
- case @element_ranks[MOVE_ELEMENT[2]]
- when 2
- move += 4
- when 4
- move -= 4
- end
- case @element_ranks[MOVE_ELEMENT[3]]
- when 2
- move += 8
- when 4
- move -= 8
- end
- return [move, 0].max
- end
- #--------------------------------------------------------------------------
- # ◎ 添加敌人视野范围
- #--------------------------------------------------------------------------
- def view_range
- view = DEFAULT_VIEW
- case @element_ranks[VIEW_ELEMENT[0]]
- when 2
- view += 1
- when 4
- view -= 1
- end
- case @element_ranks[VIEW_ELEMENT[1]]
- when 2
- view += 2
- when 4
- view -= 2
- end
- case @element_ranks[VIEW_ELEMENT[2]]
- when 2
- view += 4
- when 4
- view -= 4
- end
- case @element_ranks[VIEW_ELEMENT[3]]
- when 2
- view += 8
- when 4
- view -= 8
- end
- return [view, 0].max
- end
- #--------------------------------------------------------------------------
- # ◎ 添加敌人自身动作延迟(十个属性中,最后两个保留日后使用。)
- #--------------------------------------------------------------------------
- def action_delay
- delay = DEFAULT_DELAY
- case @element_ranks[DELAY_ELEMENT[0]]
- when 2
- delay += 10
- when 4
- delay -= 10
- end
- case @element_ranks[DELAY_ELEMENT[1]]
- when 2
- delay += 20
- when 4
- delay -= 20
- end
- case @element_ranks[DELAY_ELEMENT[2]]
- when 2
- delay += 40
- when 4
- delay -= 40
- end
- case @element_ranks[DELAY_ELEMENT[3]]
- when 2
- delay += 80
- when 4
- delay -= 80
- end
- case @element_ranks[DELAY_ELEMENT[4]]
- when 2
- delay += 160
- when 4
- delay -= 160
- end
- case @element_ranks[DELAY_ELEMENT[5]]
- when 2
- delay += 320
- when 4
- delay -= 320
- end
- case @element_ranks[DELAY_ELEMENT[6]]
- when 2
- delay += 640
- when 4
- delay -= 640
- end
- case @element_ranks[DELAY_ELEMENT[7]]
- when 2
- delay += 1280
- when 4
- delay -= 1280
- end
- return [delay, 0].max
- end
- #--------------------------------------------------------------------------
- # ◎ 添加敌人射程和范围
- #--------------------------------------------------------------------------
- # 射程
- def range
- range = 0
- for i in 0...RANGE_ELEMENT.size
- if @element_ranks[RANGE_ELEMENT[i]] == 2
- range += 2 ** i
- end
- end
- return range
- end
- # 范围
- def aoe
- aoe = 0
- for i in 0...AOE_ELEMENT.size
- if @element_ranks[AOE_ELEMENT[i]] == 2
- aoe += 2 ** i
- end
- end
- return aoe
- end
- end
- end
-
复制代码 |
|