Project1
标题:
正在做一个游戏,一些技能的问题想请教
[打印本页]
作者:
atarry
时间:
2011-11-27 08:29
标题:
正在做一个游戏,一些技能的问题想请教
如何实现这样的技能:
1.使用攻击技能,该回合的回避率降低。我有一个被动技能脚本。可是那是被动技能,永久生效。
2.横版脚本问题。为什么我选择连续攻击,却没有连续攻击的效果,攻击依旧是一次。更不用说3体,4体了
3。如何设置暴击的概率比如增加10%,增加20%。也是不用被动技能的情况
dsu_plus_rewardpost_czw
作者:
月夜神音
时间:
2011-11-27 11:20
本帖最后由 月夜神音 于 2011-11-27 11:21 编辑
1.使用技能后,调用公共事件,使用角色添加状态,状态备注处写:EVA-[10]
#==============================================================================
# ** EVA/HIT/CRI States
#------------------------------------------------------------------------------
# Author : puppeto4 (
[email protected]
)
# Version : 2.0 revision 3
# Date : 25 / 06 / 2008
# Note : Ougi Lied,Rolo Died;_;
# Email me for request and support :)
#------------------------------------------------------------------------------
# Function : Enable you to create state that increase/decrease
# character's evasion rate/hit rate/critical rate.
# EVA+[#] = The state that contains this note will increase evasion by #% when inflicted
# EVA-[#] = The state that contains this note will decrease evasion by #% when inflicted
# HIT+[#] = The state that contains this note will increase hit rate by #% when inflicted
# HIT-[#] = The state that contains this note will decrease hit rate by #% when inflicted
# CRI+[#] = The state that contains this note will increase critical by #% when inflicted
# CRI-[#] = The state that contains this note will decrease critical by #% when inflicted
# Change Log :
# version 1.5(28/06/2008)
# - Added decrese evasion feature.
# version 2.0(18/08/2008)
# - Added increase/decrease hit & cri feature.
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
EVADE_TEXT = "EVA+"
DEVADE_TEXT = "EVA-"
HIT_TEXT = "HIT+"
DEHIT_TEXT = "HIT-"
CRI_TEXT = "CRI+"
DECRI_TEXT = "CRI-"
#--------------------------------------------------------------------------
# * Determine if hit bonus is included
#--------------------------------------------------------------------------
def extra_hit?
states.each do |state|
return true if state.note.include?(HIT_TEXT)
end
return false
end
#--------------------------------------------------------------------------
# * Determine if hit bonus is included
#--------------------------------------------------------------------------
def reduce_hit?
states.each do |state|
return true if state.note.include?(DEHIT_TEXT)
end
return false
end
#--------------------------------------------------------------------------
# * Get Hit Rate
#--------------------------------------------------------------------------
alias puppet_extra_hit hit
def hit
if extra_hit?
hit_bonus
elsif reduce_hit?
lower_hit
else
return puppet_extra_hit
end
end
#--------------------------------------------------------------------------
# * Give Hit Bonus
#--------------------------------------------------------------------------
def hit_bonus
states.each do |state|
if state.note[/#{Regexp.quote HIT_TEXT}\[(\d+)\]/].to_a[0]
if two_swords_style
n1 = weapons[0] == nil ? 95 : weapons[0].hit
n2 = weapons[1] == nil ? 95 : weapons[1].hit
n = [n1, n2].min + $1.to_i
else
n = weapons[0] == nil ? 95 + $1.to_i : weapons[0].hit + $1.to_i
end
return n
end
end
end
#--------------------------------------------------------------------------
# * Reduce hit rate
#--------------------------------------------------------------------------
def lower_hit
states.each do |state|
if state.note[/#{Regexp.quote DEHIT_TEXT}\[(\d+)\]/].to_a[0]
if two_swords_style
n1 = weapons[0] == nil ? 95 : weapons[0].hit
n2 = weapons[1] == nil ? 95 : weapons[1].hit
n = [n1, n2].min - $1.to_i
else
n = weapons[0] == nil ? 95 - $1.to_i : weapons[0].hit - $1.to_i
end
return n
end
end
end
#--------------------------------------------------------------------------
# * Determine if evade bonus is included
#--------------------------------------------------------------------------
def extra_evade?
states.each do |state|
return true if state.note.include?(EVADE_TEXT)
end
return false
end
#--------------------------------------------------------------------------
# * Determine if evade bonus is included
#--------------------------------------------------------------------------
def reduce_evade?
states.each do |state|
return true if state.note.include?(DEVADE_TEXT)
end
return false
end
#--------------------------------------------------------------------------
# * Get Evasion Rate
#--------------------------------------------------------------------------
alias puppet_extra_eva eva
def eva
if extra_evade?
evade_bonus
elsif reduce_evade?
lower_evade
else
return puppet_extra_eva
end
end
#--------------------------------------------------------------------------
# * Give Evasion Bonus
#--------------------------------------------------------------------------
def evade_bonus
states.each do |state|
if state.note[/#{Regexp.quote EVADE_TEXT}\[(\d+)\]/].to_a[0]
n = 5 + $1.to_i
for item in armors.compact do n += item.eva end
return n
end
end
end
#--------------------------------------------------------------------------
# * Reduce evasion rate
#--------------------------------------------------------------------------
def lower_evade
states.each do |state|
if state.note[/#{Regexp.quote DEVADE_TEXT}\[(\d+)\]/].to_a[0]
n = 5 - $1.to_i
for item in armors.compact do n += item.eva end
return n
end
end
end
#--------------------------------------------------------------------------
# * Determine if cri bonus is included
#--------------------------------------------------------------------------
def extra_cri?
states.each do |state|
return true if state.note.include?(CRI_TEXT)
end
return false
end
#--------------------------------------------------------------------------
# * Determine if cri bonus is included
#--------------------------------------------------------------------------
def reduce_cri?
states.each do |state|
return true if state.note.include?(DECRI_TEXT)
end
return false
end
#--------------------------------------------------------------------------
# * Get Cri Rate
#--------------------------------------------------------------------------
alias puppet_extra_cri cri
def cri
if extra_cri?
cri_bonus
elsif reduce_cri?
lower_cri
else
return puppet_extra_cri
end
end
#--------------------------------------------------------------------------
# * Give Cri Bonus
#--------------------------------------------------------------------------
def cri_bonus
states.each do |state|
if state.note[/#{Regexp.quote CRI_TEXT}\[(\d+)\]/].to_a[0]
n = 4
n += $1.to_i
n += 4 if actor.critical_bonus
for weapon in weapons.compact
n += 4 if weapon.critical_bonus
end
return n
end
end
end
#--------------------------------------------------------------------------
# * Reduce cri rate
#--------------------------------------------------------------------------
def lower_cri
states.each do |state|
if state.note[/#{Regexp.quote DECRI_TEXT}\[(\d+)\]/].to_a[0]
n = 4
n += 4 if actor.critical_bonus
for weapon in weapons.compact
n += 4 if weapon.critical_bonus
end
n -= $1.to_i
return n
end
end
end
end
#==============================================================================
# ** End of EVA/HIT/CRI States : Script
#==============================================================================
复制代码
2.全局搜索class Skill,修改def base_action下面即可
3.与第1一样,添加状态,备注写:CRI+[10]
作者:
atarry
时间:
2011-11-27 11:33
我刚才也想到了一个方法,和你这个差不多。设定一个暴击状态,这个状态持有的时候,习得被动技能暴击。我有个被动技能永久加暴击的脚本。状态消失,暴击效果消失。
不过还是很感谢,你这个方法简单多了
作者:
429259591
时间:
2011-11-27 11:36
记得67前辈做过一个
VX的状态增强的脚本
.....
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1