szybd
发表于 2014-1-8 11:32:09
一晃又过了一天了。关于战斗,已经优化过了。因为原型系统已经调试完成了。
战斗系统已经修改成适合各个门派的id了。
同时原来的考虑忽略了自己化妆后id变成husi sengren 和敌人id一致的情况,一并修改。
szybd
发表于 2014-1-8 11:47:36
还是从cjgfight()开始吧,cjgfight()没有变化。变化的是cjgfightunbusydo(),把功夫都用函数封装了一下。
不同的ID,不同的功夫,只要更改功夫描述的数据结构就可以了。
function cjgfightunbusydo()
cjgfightstate = "fighting"
Execute("killall husi zhanglao")
Execute("killall husi sengren")
cjgaddbuffpfm("husi sengren")--加指定对象的状态
if cjgduishouid == "husi zhanglao" then--对于长老,先busy所有长老,再debuff第一个长老
local namelist = {}
for i = 1,cjgzhanglaonum do
namelist = "husi zhanglao "..i
end
cjgpfmbm(namelist)
cjgadddebuffpfm("husi zhanglao")
end
cjgpfmc(cjgduishouid)--先化学搞一下
if cjgduishouid == "husi zhanglao" then--有群伤的上
cjgpfmm({"husi zhanglao","husi sengren"})
else
cjgpfmm({"husi sengren"})
end
cjgpfmp(cjgduishouid)--再物理来一下
cjgpk()--喜欢平砍的现在动手
Execute("follow "..cjgduishouid)
end
szybd
发表于 2014-1-8 11:50:36
另外,走动前加的buff:"yunpowerup","yun qi"也封装了下:
function cjgaddbuff()
local i = 1
while cjgbuff ~= nil do
Execute(cjgbuff)
i = i + 1
end
end
---------------------------------
你需要加的状态由数组cjgbuff描述,你可以在里面做各种事情,唯一的要求就是不能执行后busy自己,否则就走不动了。
cigbuff的一个例子:
cjgbuff = {"yun powerup","yun qi","drink jiu"}
szybd
发表于 2014-1-8 11:52:33
接下来吧封装的招式一一讲解。
cjgpfmbusymul="yizhi-chan"--群busy功夫,只是针对一指禅
function cjgpfmbm(namelist)
if cjgpfmbusymul ~= "yizhi-chan" then
return
else
local i = 1
if namelist == nil then
return
else
if namelist == nil then
return
else
Execute("unwield all")
Execute("bei none")
Execute("enable finger yizhi-chan")
Execute("bei finger")
while namelist ~= nil and namelist ~= "" do
Execute("killall "..namelist)
Execute("perform finger.jingmo "..namelist)
i = i + 1
end
end
end
end
end
szybd
发表于 2014-1-8 11:54:26
cjgpfmbusy={basicskill = "",specialskill = "",perform = "",weapon = ""}--busy功夫
除了一指禅之外的其他busy功夫。一次只能针对一个对手,不指定的话就是当前对手。
在实际运用时,只对长老使用busy功夫,包括一指禅,僧兵攻击弱,用busy浪费
function cjgpfmb(nameid)
if cjgpfmbusy.basicskill == "" or cjgpfmbusy.basicskill == "none" or cjgpfmbusy.basicskill == nil then
return
else
Execute("unwield all")
if cjgpfmbusy.weapon == "none" then
Execute("bei none")
Execute("enable "..cjgpfmbusy.basicskill.." "..cjgpfmbusy.specialskill)
Execute("bei "..cjgpfmbusy.basicskill)
else
Execute("wbei none")
Execute("enable "..cjgpfmbusy.basicskill.." "..cjgpfmbusy.specialskill)
Execute("wield ".. cjgpfmbusy.weapon)
end
if nameid ~= nil and nameid ~= "" then
Execute("perform "..cjgpfmbusy.basicskill.."."..cjgpfmbusy.perform.." "..nameid)
else
Execute("perform "..cjgpfmbusy.basicskill.."."..cjgpfmbusy.perform)
end
if cjgpfmbusy.weapon ~= "none" then
Execute("unwield all")
end
end
end
szybd
发表于 2014-1-8 11:57:04
busy完了,如果有给敌人减状态的debuff功夫,可以针对长老使一下,对僧兵就忽略了,否则也浪费。
cjgdebuffpfm = {basicskill = "hand",specialskill = "qianye-shou",perform = "qianshou",weapon = "none"}
如果没有这类功夫,或不想使,basicskill = "",就可以了。
---------------------------------------------------------------------
cjgdebuffpfm = {basicskill = "hand",specialskill = "qianye-shou",perform = "qianshou",weapon = "none"}
szybd
发表于 2014-1-8 11:57:20
function cjgadddebuffpfm(nameid)
if cjgdebuffpfm.basicskill == "" or cjgdebuffpfm.basicskill == "none" or cjgdebuffpfm.basicskill == nil then
return
else
Execute("unwield all")
if cjgdebuffpfm.weapon == "none" then
Execute("bei none")
Execute("enable "..cjgdebuffpfm.basicskill.." "..cjgdebuffpfm.specialskill)
Execute("bei "..cjgdebuffpfm.basicskill)
else
Execute("wbei none")
Execute("enable "..cjgdebuffpfm.basicskill.." "..cjgdebuffpfm.specialskill)
Execute("wield ".. cjgdebuffpfm.weapon)
end
if nameid ~= nil and nameid ~= "" then
Execute("perform "..cjgdebuffpfm.basicskill.."."..cjgdebuffpfm.perform.." "..nameid)
else
Execute("perform "..cjgdebuffpfm.basicskill.."."..cjgdebuffpfm.perform)
end
if cjgdebuffpfm.weapon ~= "none" then
Execute("unwield all")
end
end
end
szybd
发表于 2014-1-8 12:04:33
接下来就是真刀实枪干了:优先用化学功夫,因为秃驴们可能会反弹。要防着点。
cjgpfmche = {basicskill = "blade",specialskill = "ranmu-daofa",perform = "fentian",weapon = "mu dao"}--化学功夫
-----------------------------------------------------------
function cjgpfmc(nameid)
if cjgpfmche.basicskill == "" or cjgpfmche.basicskill == "none" or cjgpfmche.basicskill == nil then
return
else
Execute("unwield all")
if cjgpfmche.weapon == "none" then
Execute("bei none")
Execute("enable "..cjgpfmche.basicskill.." "..cjgpfmche.specialskill)
Execute("bei "..cjgpfmche.basicskill)
else
Execute("wbei none")
Execute("enable "..cjgpfmche.basicskill.." "..cjgpfmche.specialskill)
Execute("wield ".. cjgpfmche.weapon)
end
if nameid ~= nil and nameid ~= "" then
Execute("perform "..cjgpfmche.basicskill.."."..cjgpfmche.perform.." "..nameid)
else
Execute("perform "..cjgpfmche.basicskill.."."..cjgpfmche.perform)
end
if cjgpfmche.weapon ~= "none" then
Execute("unwield all")
end
end
end
szybd
发表于 2014-1-8 12:05:12
化学完了物理,物流还有一个群伤的功夫,先群伤吧,目前群伤只支持胡家刀法
szybd
发表于 2014-1-8 12:06:47
cjgpfmmul ={skill="",weapon="my blade",specialparry = "yizhi-chan"}--群伤功夫
注意:胡家刀法要改parry。使完后,改回去
-----------------------------------------------------------
function cjgpfmm(namelist)
if cjgpfmmul.skill == "" or cjgpfmmul.skill == "none" or cjgpfmmul.skilll == nil then
return
elseif cjgpfmmul.skill == "hujia-daofa" then
Execute("unwield all")
Execute("wbei none")
Execute("enable blade hujia-daofa")
Execute("enable parry hujia-daofa")
if cjgpfmmul.weapon ~= nil and cjgpfmmul.weapon ~= "" and cjgpfmmul.weapon ~= "none" then
Execute("wield ".. cjgpfmmul.weapon)
else
Execute("wield blade")
end
if namelist ~= nil then
local i = 1
while namelist ~= nil do
Execute("killall "..namelist)
i = i + 1
end
end
Execute("perform "..cjgpfmmul.basicskill.."."..cjgpfmmul.perform)
Execute("enable parry "..cjgpfmmul.specialparry)
Execute("unwield all")
else
Note("系统暂时不支持此项群伤功夫")
end
end
页:
1
2
3
4
5
[6]
7
8
9
10