|
复杂的法子,拷贝代码到diy执行,效果是主角集气两倍
本帖最后由 simonanddemon 于 2012-2-3 13:30 编辑
function GetJiqi()
local num,total=0,0
local function getnewmove(x,flag)
if not flag then
x=x*2
end
--if x>280 then
--return 8+(x-280)/100
if x>160 then
return 6+(x-160)/60
elseif x>80 then
return 4+(x-80)/40
elseif x>30 then
return 2+(x-30)/25
else
return x/15
end
end
local function getnewmove1(a,b,flag)
local x=(a*2+b)/3
if not flag then
x=x*2
end
if x>5600 then
return 8+math.min((x-5600)/1200,3)
elseif x>3600 then
return 6+(x-3600)/1000
elseif x>2000 then
return 4+(x-2000)/800
elseif x>800 then
return 2+(x-800)/600
else
return x/400
end
end
for i=0,WAR.PersonNum-1 do
if not WAR.Person['死亡'] then
local id=WAR.Person['人物编号']
local nsyxjq=0;--JY.Person[id]["受伤程度"]
if inteam(id) then
nsyxjq=math.modf(JY.Person[id]["受伤程度"]/10);
else
nsyxjq=math.modf(JY.Person[id]["受伤程度"]/25);
end
WAR.Person["TimeAdd"]=math.modf(getnewmove(WAR.Person["轻功"],inteam(id))+getnewmove1(JY.Person[id]["内力"],JY.Person[id]["内力最大值"],inteam(id))-JY.Person[id]["中毒程度"]/25-nsyxjq+JY.Person[id]["体力"]/30+5)
for ii=1,10 do
if JY.Person[id]["武功"..ii]==105 then
WAR.Person["TimeAdd"]=math.modf(WAR.Person["TimeAdd"]*1.2)
end
end
if WAR.Person["TimeAdd"]<5 then WAR.Person["TimeAdd"]=5 end
if id==27 or id==1 or id==57 or id==97 or id==516 then
WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+10
end
if id==29 then
WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+20
for j=0,WAR.PersonNum-1 do
if WAR.Person[j]["死亡"]==false and WAR.Person[j]["我方"]==WAR.Person["我方"] then
WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]-4
end
end
end
if GetS(4,5,5,5)==2 and id==0 then
local jsyx=0;
for i=1,10 do
if JY.Person[0]["武功"..i]==110 or (JY.Person[0]["武功"..i]<50 and JY.Person[0]["武功"..i]>26) then
if JY.Person[0]["武功等级"..i]==999 then
jsyx=jsyx+1
end
end
end
WAR.Person["TimeAdd"]=math.modf(WAR.Person["TimeAdd"]*(1+0.05*jsyx))
end
if id==55 then
local xz=0;
for j=0,WAR.PersonNum-1 do
if WAR.Person[j]["死亡"]==true and WAR.Person[j]["我方"]==WAR.Person["我方"] then
WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+3
end
end
end
if WAR.ZDDH==14 then
if id==173 or id==174 or id==175 then
local shz=0;
for j=0,WAR.PersonNum-1 do
if WAR.Person[j]["死亡"]==false and WAR.Person[j]["我方"]==WAR.Person["我方"] then
shz=shz+1
end
end
if shz==3 then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+20 end
end
end
if id==0 and WAR.LRZ==1 then
for j=0,WAR.PersonNum-1 do
if WAR.Person[j]["人物编号"]==92 and WAR.Person[j]["死亡"]==false then
if WE_JL(0,92,3) then
WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+5
end
break;
end
end
end
if id==50 then
WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+20
if JY.Thing[202][WZ7]==1 then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]-10 end
end
if WAR.FLHS2>20 then WAR.FLHS2=20 end
if id==18 then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+10 end
if id==0 then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+WAR.FLHS2 end
if id==97 then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+WAR.XDLZ end
if id==129 or id==65 then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+WAR.WCY*5 end
if id==553 then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+WAR.YZB2*4 end
if id==28 then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+WAR.PYZ*3 end
if not inteam(id) then
if JY.Thing[202][WZ7]==1 then
WAR.Person["TimeAdd"]=math.modf(WAR.Person["TimeAdd"]*0.6)
elseif JY.Thing[202][WZ7]==2 then
WAR.Person["TimeAdd"]=math.modf(WAR.Person["TimeAdd"]*1)+2
else
WAR.Person["TimeAdd"]=math.modf(WAR.Person["TimeAdd"]*1.1)+5
end
end
if WAR.ZDDH==128 then
if inteam(id)==false and id~=553 and JY.Thing[202][WZ7]>1 then
WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]+10
end
end
--if inteam(id) then WAR.Person["TimeAdd"]=WAR.Person["TimeAdd"]-math.modf(JY.Person[id]["受伤程度"]/20) end
if WAR.Person["TimeAdd"]<5 then WAR.Person["TimeAdd"]=5 end
if (id==445 or id==446) and WAR.ZDDH==226 then WAR.Person["TimeAdd"]=0 end
if JY.ZJSL==1 and (not inteam(id)) and WAR.Person["我方"]==false then WAR.Person["TimeAdd"]=0 end --DJQ0
--if WAR.Person["TimeAdd"]>60 then WAR.Person["TimeAdd"]=60 end
if id==0 then WAR.Person["TimeAdd"] = WAR.Person["TimeAdd"] * 2 end
--WAR.JQSDXS[id]=WAR.Person["TimeAdd"]
if WAR.LQZ[id]==100 then WAR.JQSDXS[id]=WAR.Person["TimeAdd"]*2 end
num=num+1
total=total+WAR.Person["TimeAdd"]
end
end
WAR.JQSD_WMM=0;
for i=0,WAR.PersonNum-1 do
local p=WAR.Person["人物编号"]
if p==76 and inteam(p) and WAR.Person["死亡"]==false then
WAR.JQSD_WMM=1
break;
end
end
WAR.LifeNum=num;
return math.modf(1.2*(total/num+num-2))
end |
|