fight.ts 258 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330
  1. // import * as Xys from "./Xys";
  2. // import Gamecfg from "./gameCfg";
  3. // import { SeedRand, gameMethod } from "./gameMethod";
  4. // //辅助函数 - 添加属性值
  5. // interface skbuff_add_cs {
  6. // fiid: string; //添加对象
  7. // key: string; //属性key
  8. // minZhen: number; //开始帧
  9. // maxZhen: number; //结束帧
  10. // overlayType: number; // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  11. // ceng: number; //增加层数
  12. // eps: { [key: string]: number }; //属性
  13. // }
  14. // interface Gzhit {
  15. // pghit: number; //普攻伤害
  16. // skhit: number; //技能伤害
  17. // bjhit: number; //暴击伤害
  18. // gdhit: number; //格挡伤害
  19. // fjhit: number; //反击伤害
  20. // ljhit: number; //连击伤害
  21. // jshit: number; //溅射伤害(没有折损比例系数)
  22. // xxhit: number; //吸血值
  23. // xxRate: number; //吸血概率
  24. // jsRate: number; //溅射概率
  25. // fjsRate: number; //反击溅射概率
  26. // }
  27. // interface timer_add_cs {
  28. // iid: string; //触发者
  29. // fiids: string[]; //触发对象
  30. // key: string; //定时器标识
  31. // type: number[]; //执行触发点
  32. // func: "sk_effect" | "sk_action"; //执行的函数名
  33. // lzhen: number; //轮询执行时间
  34. // ezhen: number; //结束时间
  35. // skid: string; //技能ID
  36. // aeid: string; //效果ID|行为ID
  37. // cs: { [key: string]: number }; //参数
  38. // overlayType: number; // 1:叠加 2:不叠加替换
  39. // }
  40. // export class Fight {
  41. // teams: { [iid: string]: Xys.FightTeam } = {}; //战斗成员列表
  42. // seedRand: SeedRand; //随机种子函数
  43. // from: string; //战斗类型
  44. // timerId: number = 1; //定时计数器
  45. // uuids: {
  46. // [iid: string]: {
  47. // drain_sk: number; // 是否带有灵力术法
  48. // last: number; //最后一次出手帧
  49. // last2: number; //真正出手的帧
  50. // cons: number[]; //攻击次数 (普通+技能,被动不算) [攻击次数,连击次数,反击次数]
  51. // fcons: number[]; //被攻击次数 (普通+技能,被动不算) [攻击次数,连击次数,反击次数]
  52. // dzhen: number; //死亡的帧数
  53. // fpk: string; //最后一次伤害我的对象
  54. // ipk: string; //我打的最后一个
  55. // ipks: { [zhen: number]: string[] }; //我打的最后一个
  56. // podun: string[]; //盾没有了需要清除buff
  57. // skbuff: {
  58. // [key: string]: {
  59. // szhen: number; //开始帧
  60. // ezhen: number; //结束帧
  61. // eps: { [key: string]: number }; //属性值
  62. // }[];
  63. // };
  64. // skbase: {
  65. // //技能触发
  66. // [base_id: string]: {
  67. // last: number; //技能最后一次出手帧
  68. // count: number;
  69. // action: {
  70. // [action_id: string]: {};
  71. // };
  72. // effect: {
  73. // [effect_id: string]: {
  74. // effectZhen: number; //触发效果的帧(有时候同时一个攻击 好几个人触发效果分开计算的 会导致第一个人有触发 后面的没有触发)
  75. // effectEndZhen: number; //效果结束帧率(持续x秒,冷却x秒用的)
  76. // nextcd: number; //下一次冷却完成时间
  77. // count: number; //执行次数
  78. // f: number; //执行次数
  79. // };
  80. // };
  81. // };
  82. // };
  83. // //定时执行 [执行触发点,执行的函数名,轮询执行时间,技能ID, 效果ID|行为ID]
  84. // timer: {
  85. // [key: string]: {
  86. // [timerId: string]: {
  87. // fiids: string[]; //触发对象
  88. // type: number[]; //执行触发点
  89. // func: "sk_effect" | "sk_action"; //执行的函数名
  90. // szhen: number; //触发的帧
  91. // lzhen: number; //轮询执行时间
  92. // ezhen: number; //结束时间帧
  93. // skid: string; //技能ID
  94. // aeid: string; //效果ID|行为ID
  95. // cs: { [key: string]: number }; //
  96. // };
  97. // };
  98. // };
  99. // //执行触发点=>
  100. // //1:每帧开始执行 2:扣血执行 3:攻击后触发 4攻击前触发 5护体罡气破碎时触发
  101. // //6 :己方单位施加击退时 7 :普通攻击触发 8自身受到超过当前气血10%以上伤害时
  102. // //9:暴击触发
  103. // };
  104. // } = {}; //存放身份
  105. // objects: {
  106. // [len: string]: {
  107. // [type: string]: {
  108. // // 作用对象 1主角 2弟子 3兽灵
  109. // [skid: string]: {
  110. // //技能触发
  111. // cd: number; // 技能触发cd
  112. // sklv: number; // 技能等级
  113. // iids: {
  114. // [iid: string]: {
  115. // next: number; //技能最后一次出手帧
  116. // };
  117. // };
  118. // };
  119. // };
  120. // };
  121. // } = {}; //存放uid类型触发技能
  122. // zhen: number = 0; //初始帧
  123. // //单次出手临时记录
  124. // oneAtk: {
  125. // [iid: string]: {
  126. // [fiid: string]: {
  127. // aType: Xys.ActionType; //战斗动作类型
  128. // aSkid: ""; //使用的技能ID
  129. // effect: [string, number][]; //触发效果 [ [属性key,层数]]
  130. // buff: [string, number][]; //触发效果 [ [属性key,数值]]
  131. // };
  132. // };
  133. // } = {};
  134. // oneAtkiids: string[] = []; //日志顺序
  135. // //单帧出手对象
  136. // oneFiids: { [iid: string]: { [key: string]: string[] } } = {};
  137. // oneHit: {
  138. // [iid: string]: {
  139. // [fiid: string]: Gzhit;
  140. // };
  141. // } = {};
  142. // oneBuff: { [iid: string]: number } = {}; //存储当前帧 有改变buff的角色ID
  143. // mpfiids: { [iid: string]: [number, number] } = {}; // 单帧MP指回复一次
  144. // jsFiids: { [iid: string]: { [fiid: string]: number } } = {}; //溅射
  145. // //存储所有战场日志
  146. // outf: Xys.OverBack = {
  147. // win: 0, //0失败 1胜利
  148. // start: {
  149. // //初始阵容
  150. // from: "", //战斗类型
  151. // seed: 0, //随机种子
  152. // teams: {},
  153. // power: 0,
  154. // fPower: 0,
  155. // },
  156. // log: {}, //战斗日志列表
  157. // hurt: 0,
  158. // hp: 0, //战斗结束 对手剩余血量
  159. // tongji: {},
  160. // xhid:""
  161. // };
  162. // //血量变化相关字段
  163. // xueku: string[] = ["hp", "baoji", "lianji", "fanji", "canbeatback"];
  164. // // 减益buff
  165. // bateBuff: string[] = ["effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_6", "effect_i_7"];
  166. // teamFiids: string[] = [];
  167. // skBuff: {
  168. // [iid: string]: {
  169. // key: any;
  170. // value: any;
  171. // buff: {
  172. // [key: string]: {
  173. // key: any;
  174. // value: any;
  175. // };
  176. // };
  177. // };
  178. // } = {};
  179. // skTimer: {
  180. // [iid: string]: {
  181. // key: any;
  182. // value: any;
  183. // timer: {
  184. // [key: string]: {
  185. // key: any;
  186. // value: any;
  187. // };
  188. // };
  189. // };
  190. // } = {};
  191. // damage: {
  192. // [iid: string]: {
  193. // [fiid: string]: number;
  194. // };
  195. // } = {};
  196. // constructor(fightStart: Xys.ActFightStart) {
  197. // this.powerDisparity("1000", "100", fightStart.power, fightStart.fPower);
  198. // this.outf.start = gameMethod.objCopy(fightStart);
  199. // this.teams = gameMethod.objCopy(fightStart.teams); //战斗成员列表
  200. // this.seedRand = new SeedRand(fightStart.seed); //随机种子
  201. // this.from = fightStart.from; //战斗类型
  202. // this.teamFiids = Object.keys(this.teams);
  203. // this.war_init();
  204. // this.war_loop();
  205. // }
  206. // /*
  207. // * 技能buff
  208. // * this.uuids[cs.fiid].skbuff[cs.key]
  209. // * */
  210. // private changeSkBuff(sType: number, iid?: string | null, key?: string | null, type: number = 1, data?: any) {
  211. // switch (sType) {
  212. // case 1: // 查询 type:1.keys 2.values
  213. // if (iid) {
  214. // return this.getSkBuff(type, iid, key);
  215. // }
  216. // break;
  217. // case 2: // 更新/新增 type:1.替换 2.叠加
  218. // if (data) {
  219. // this.setSkBuff(data, iid, key, type);
  220. // }
  221. // break;
  222. // case 3: // 删除
  223. // if (iid) {
  224. // this.delSkBuff(iid, key);
  225. // }
  226. // break;
  227. // }
  228. // }
  229. // private setSkBuff(data: any, iid?: string | null, key?: string | null, type: number = 1) {
  230. // if (iid && key) {
  231. // if (type == 1) {
  232. // this.uuids[iid].skbuff[key] = data;
  233. // } else {
  234. // if (this.uuids[iid].skbuff[key] == null) {
  235. // this.uuids[iid].skbuff[key] = [];
  236. // }
  237. // this.uuids[iid].skbuff[key].push(...data);
  238. // }
  239. // if (this.skBuff[iid] == null) {
  240. // this.skBuff[iid] = { key: [], value: [], buff: {} };
  241. // }
  242. // if (this.skBuff[iid].buff[key] == null) {
  243. // this.skBuff[iid].buff[key] = { key: [], value: [] };
  244. // }
  245. // let keys2 = Object.keys(this.uuids[iid].skbuff);
  246. // let values2 = Object.values(this.uuids[iid].skbuff);
  247. // this.skBuff[iid].key = keys2;
  248. // this.skBuff[iid].value = values2;
  249. // this.skBuff[iid].buff[key].key = Object.keys(this.uuids[iid].skbuff[key]);
  250. // this.skBuff[iid].buff[key].value = Object.values(this.uuids[iid].skbuff[key]);
  251. // } else if (iid && !key) {
  252. // if (type == 1) {
  253. // this.uuids[iid].skbuff = data;
  254. // this.skBuff[iid] = { key: [], value: [], buff: {} };
  255. // } else {
  256. // this.uuids[iid].skbuff = Object.assign(this.uuids[iid].skbuff, data);
  257. // }
  258. // if (this.skBuff[iid] == null) {
  259. // this.skBuff[iid] = { key: [], value: [], buff: {} };
  260. // }
  261. // let keys2 = Object.keys(this.uuids[iid].skbuff);
  262. // let values2 = Object.values(this.uuids[iid].skbuff);
  263. // this.skBuff[iid].key = keys2;
  264. // this.skBuff[iid].value = values2;
  265. // for (let k = 0; k < keys2.length; k++) {
  266. // if (this.skBuff[iid].buff[keys2[k]] == null) {
  267. // this.skBuff[iid].buff[keys2[k]] = { key: [], value: [] };
  268. // }
  269. // this.skBuff[iid].buff[keys2[k]].key = Object.keys(this.uuids[iid].skbuff[keys2[k]]);
  270. // this.skBuff[iid].buff[keys2[k]].value = Object.values(this.uuids[iid].skbuff[keys2[k]]);
  271. // }
  272. // } else if (!iid && !key && data) {
  273. // let keys = this.teamFiids;
  274. // for (let i = 0; i < keys.length; i++) {
  275. // let keys2 = Object.keys(this.uuids[keys[i]].skbuff);
  276. // let values2 = Object.values(this.uuids[keys[i]].skbuff);
  277. // if (this.skBuff[keys[i]] == null) {
  278. // this.skBuff[keys[i]] = { key: [], value: [], buff: {} };
  279. // }
  280. // this.skBuff[keys[i]].key = keys2;
  281. // this.skBuff[keys[i]].value = values2;
  282. // for (let k = 0; k < keys2.length; k++) {
  283. // if (this.skBuff[keys[i]].buff[keys2[k]] == null) {
  284. // this.skBuff[keys[i]].buff[keys2[k]] = { key: [], value: [] };
  285. // }
  286. // this.skBuff[keys[i]].buff[keys2[k]].key = Object.keys(this.uuids[keys[i]].skbuff[keys2[k]]);
  287. // this.skBuff[keys[i]].buff[keys2[k]].value = Object.values(this.uuids[keys[i]].skbuff[keys2[k]]);
  288. // }
  289. // }
  290. // }
  291. // }
  292. // private delSkBuff(iid: string, key?: string | null) {
  293. // if (iid && key) {
  294. // delete this.uuids[iid].skbuff[key];
  295. // if (this.skBuff[iid] == null) {
  296. // this.skBuff[iid] = { key: [], value: [], buff: {} };
  297. // }
  298. // delete this.skBuff[iid].buff[key];
  299. // this.skBuff[iid].key = Object.keys(this.uuids[iid].skbuff);
  300. // this.skBuff[iid].value = Object.values(this.uuids[iid].skbuff);
  301. // } else if (iid && !key) {
  302. // if (this.skBuff[iid] == null) {
  303. // this.skBuff[iid] = { key: [], value: [], buff: {} };
  304. // }
  305. // this.uuids[iid].skbuff = {};
  306. // this.skBuff[iid].buff = {};
  307. // this.skBuff[iid].key = [];
  308. // this.skBuff[iid].value = [];
  309. // }
  310. // }
  311. // private getSkBuff(type: number, iid: string, key?: string | null) {
  312. // if (type == 1) {
  313. // if (iid && key) {
  314. // if (this.skBuff[iid] && this.skBuff[iid].buff[key]) {
  315. // return this.skBuff[iid].buff[key].key;
  316. // } else {
  317. // return [];
  318. // }
  319. // } else if (iid) {
  320. // if (this.skBuff[iid]) {
  321. // return this.skBuff[iid].key;
  322. // } else {
  323. // return [];
  324. // }
  325. // }
  326. // } else {
  327. // if (iid && key) {
  328. // if (this.skBuff[iid] && this.skBuff[iid].buff[key]) {
  329. // return this.skBuff[iid].buff[key].value;
  330. // } else {
  331. // return [];
  332. // }
  333. // } else if (iid) {
  334. // if (this.skBuff[iid]) {
  335. // return this.skBuff[iid].value;
  336. // } else {
  337. // return [];
  338. // }
  339. // }
  340. // }
  341. // }
  342. // /*
  343. // * 定时器timer
  344. // * this.uuids[iid].timer[key]
  345. // * */
  346. // private changeTimer(sType: number, iid?: string | null, key?: string | null, type: number = 1, data?: any) {
  347. // switch (sType) {
  348. // case 1: // 查询 type:1.keys 2.values
  349. // if (iid) {
  350. // return this.getTimer(type, iid, key);
  351. // }
  352. // break;
  353. // case 2: // 更新/新增 type:1.替换 2.叠加
  354. // if (data) {
  355. // this.setTimer(data, iid, key, type);
  356. // }
  357. // break;
  358. // case 3: // 删除
  359. // if (iid) {
  360. // this.delTimer(iid, key);
  361. // }
  362. // break;
  363. // }
  364. // }
  365. // private setTimer(data: any, iid?: string | null, key?: string | null, type: number = 1) {
  366. // if (iid && key) {
  367. // if (type == 1) {
  368. // this.uuids[iid].timer[key] = data;
  369. // } else {
  370. // if (this.uuids[iid].timer[key] == null) {
  371. // this.uuids[iid].timer[key] = {};
  372. // }
  373. // this.uuids[iid].timer[key] = Object.assign(this.uuids[iid].timer[key], data);
  374. // }
  375. // if (this.skTimer[iid] == null) {
  376. // this.skTimer[iid] = { key: [], value: [], timer: {} };
  377. // }
  378. // if (this.skTimer[iid].timer[key] == null) {
  379. // this.skTimer[iid].timer[key] = { key: [], value: [] };
  380. // }
  381. // let keys2 = Object.keys(this.uuids[iid].timer);
  382. // let values2 = Object.values(this.uuids[iid].timer);
  383. // this.skTimer[iid].key = keys2;
  384. // this.skTimer[iid].value = values2;
  385. // this.skTimer[iid].timer[key].key = Object.keys(this.uuids[iid].timer[key]);
  386. // this.skTimer[iid].timer[key].value = Object.values(this.uuids[iid].timer[key]);
  387. // } else if (iid && !key) {
  388. // if (type == 1) {
  389. // this.uuids[iid].timer = data;
  390. // this.skTimer[iid] = { key: [], value: [], timer: {} };
  391. // } else {
  392. // this.uuids[iid].timer = Object.assign(this.uuids[iid].timer, data);
  393. // }
  394. // if (this.skTimer[iid] == null) {
  395. // this.skTimer[iid] = { key: [], value: [], timer: {} };
  396. // }
  397. // let keys2 = Object.keys(this.uuids[iid].timer);
  398. // let values2 = Object.values(this.uuids[iid].timer);
  399. // this.skTimer[iid].key = keys2;
  400. // this.skTimer[iid].value = values2;
  401. // for (let k = 0; k < keys2.length; k++) {
  402. // if (this.skTimer[iid].timer[keys2[k]] == null) {
  403. // this.skTimer[iid].timer[keys2[k]] = { key: [], value: [] };
  404. // }
  405. // this.skTimer[iid].timer[keys2[k]].key = Object.keys(this.uuids[iid].timer[keys2[k]]);
  406. // this.skTimer[iid].timer[keys2[k]].value = Object.values(this.uuids[iid].timer[keys2[k]]);
  407. // }
  408. // } else if (!iid && !key && data) {
  409. // let keys = this.teamFiids;
  410. // for (let i = 0; i < keys.length; i++) {
  411. // let keys2 = Object.keys(this.uuids[keys[i]].timer);
  412. // let values2 = Object.values(this.uuids[keys[i]].timer);
  413. // if (this.skTimer[keys[i]] == null) {
  414. // this.skTimer[keys[i]] = { key: [], value: [], timer: {} };
  415. // }
  416. // this.skTimer[keys[i]].key = keys2;
  417. // this.skTimer[keys[i]].value = values2;
  418. // for (let k = 0; k < keys2.length; k++) {
  419. // if (this.skTimer[keys[i]].timer[keys2[k]] == null) {
  420. // this.skTimer[keys[i]].timer[keys2[k]] = { key: [], value: [] };
  421. // }
  422. // this.skTimer[keys[i]].timer[keys2[k]].key = Object.keys(this.uuids[keys[i]].timer[keys2[k]]);
  423. // this.skTimer[keys[i]].timer[keys2[k]].value = Object.values(this.uuids[keys[i]].timer[keys2[k]]);
  424. // }
  425. // }
  426. // }
  427. // }
  428. // private delTimer(iid: string, key?: string | null) {
  429. // if (iid && key) {
  430. // delete this.uuids[iid].timer[key];
  431. // if (this.skTimer[iid] == null) {
  432. // this.skTimer[iid] = { key: [], value: [], timer: {} };
  433. // }
  434. // if (this.skTimer[iid] && this.skTimer[iid].timer[key]) {
  435. // delete this.skTimer[iid].timer[key];
  436. // }
  437. // this.skTimer[iid].key = Object.keys(this.uuids[iid].timer);
  438. // this.skTimer[iid].value = Object.values(this.uuids[iid].timer);
  439. // } else if (iid && !key) {
  440. // if (this.skTimer[iid] == null) {
  441. // this.skTimer[iid] = { key: [], value: [], timer: {} };
  442. // }
  443. // this.uuids[iid].timer = {};
  444. // this.skTimer[iid].timer = {};
  445. // this.skTimer[iid].key = [];
  446. // this.skTimer[iid].value = [];
  447. // }
  448. // }
  449. // private getTimer(type: number, iid: string, key?: string | null) {
  450. // if (type == 1) {
  451. // if (iid && key) {
  452. // if (this.skTimer[iid] && this.skTimer[iid].timer[key]) {
  453. // return this.skTimer[iid].timer[key].key;
  454. // } else {
  455. // return [];
  456. // }
  457. // } else if (iid) {
  458. // if (this.skTimer[iid]) {
  459. // return this.skTimer[iid].key;
  460. // } else {
  461. // return [];
  462. // }
  463. // }
  464. // } else {
  465. // if (iid && key) {
  466. // if (this.skTimer[iid] && this.skTimer[iid].timer[key]) {
  467. // return this.skTimer[iid].timer[key].value;
  468. // } else {
  469. // return [];
  470. // }
  471. // } else if (iid) {
  472. // if (this.skTimer[iid]) {
  473. // return this.skTimer[iid].value;
  474. // } else {
  475. // return [];
  476. // }
  477. // }
  478. // }
  479. // }
  480. // /**
  481. // * 初始化战斗
  482. // */
  483. // private war_init() {
  484. // this.zhen = 1;
  485. // let minLast: number = 99999;
  486. // for (let index = 0; index < this.teamFiids.length; index++) {
  487. // let fiid = this.teamFiids[index];
  488. // //初始化 这里in没关系
  489. // let last = Math.ceil(30 / (this.teams[fiid].eps.speed / 10000));
  490. // minLast = Math.min(minLast, last);
  491. // }
  492. // minLast = -1 * (minLast - 5); // 最快的那个人从第五帧开始打
  493. // //初始化存储
  494. // let drain_sk: number = 0;
  495. // for (let index = 0; index < this.teamFiids.length; index++) {
  496. // let fiid = this.teamFiids[index];
  497. // if (drain_sk == 0 && ["100", "1000"].includes(fiid)) {
  498. // drain_sk = 1; // 直接都可以加
  499. // /*let skids: string[] = Object.keys(this.teams[fiid].sk);
  500. // for (let index = 0; index < skids.length; index++) {
  501. // let sk_base = Gamecfg.skillBase.getItem(skids[index], "1");
  502. // if (sk_base && sk_base.drain > 0) {
  503. // drain_sk = 1;
  504. // break;
  505. // }
  506. // }*/
  507. // }
  508. // //初始化 这里in没关系
  509. // this.uuids[fiid] = {
  510. // drain_sk: drain_sk,
  511. // last: minLast,
  512. // last2: 0,
  513. // cons: [0, 0, 0],
  514. // fcons: [0, 0, 0],
  515. // podun: [],
  516. // skbuff: {},
  517. // skbase: {},
  518. // fpk: "",
  519. // ipk: "", //我打的最后一个
  520. // ipks: {}, //我打的最后一个
  521. // dzhen: 0,
  522. // timer: {},
  523. // };
  524. // }
  525. // }
  526. // /**
  527. // * 开始战斗
  528. // */
  529. // private war_loop() {
  530. // this.outf.win = 0;
  531. // while (this.zhen < 1350) {
  532. // this.outf.log[this.zhen] = [];
  533. // this.oneAtkiids = [];
  534. // this.oneAtk = {};
  535. // this.mpfiids = {};
  536. // this.oneFiids = {}; //上一帧的对手清空
  537. // this.oneHit = {}; //上一帧的伤害清空
  538. // this.oneBuff = {}; //清除上一帧的变动buff的fiid
  539. // this.jsFiids = {};
  540. // if (this.zhen == 1) {
  541. // //触发进入战斗技能
  542. // for (let i = 0; i < this.teamFiids.length; i++) {
  543. // this.sk_baseObjRun4(this.teamFiids[i]); //技能转换
  544. // }
  545. // for (let i = 0; i < this.teamFiids.length; i++) {
  546. // this.sk_base(this.teamFiids[i], 4); //技能触发
  547. // }
  548. // //灵力满怒时释放
  549. // if (this.teams["100"] != null && this.teams["100"].eps.mp >= 10000) {
  550. // let result = this.sk_base("100", 3); //技能触发
  551. // if (result){ // 技能释放成功才扣怒气
  552. // this.add_mp("100", -10000, 2);
  553. // }
  554. // }
  555. // if (this.teams["1000"] != null && this.teams["1000"].eps.mp >= 10000) {
  556. // let result = this.sk_base("1000", 3); //技能触发
  557. // if (result){ // 技能释放成功才扣怒气
  558. // this.add_mp("1000", -10000, 2);
  559. // }
  560. // }
  561. // }
  562. // if (this.zhen == 2){
  563. // for (let i = 0; i < this.teamFiids.length; i++) {
  564. // if(this.teams[this.teamFiids[i]].type == 4 || this.teams[this.teamFiids[i]].type == 5){
  565. // this.sk_base(this.teamFiids[i], 1); //boss和秘境怪优先出手一次
  566. // }
  567. // }
  568. // }
  569. // this.pk_zhen_buff(); //一帧前
  570. // // if(this.zhen == 150 && this.teams["1002"] != null){
  571. // // this.jiesuo_hide("1002")
  572. // // this.teams["1002"].isHide = 0
  573. // // }
  574. // this.pk_zhen_atk(); //一帧中
  575. // this.pk_zhen_over(); //一帧后
  576. // this.jueSuanOneAtk();
  577. // //输出buff
  578. // this.skbuff_outf();
  579. // this.jueSuanOneAtk();
  580. // //删除空白日志
  581. // if (this.outf.log[this.zhen].length == 0) {
  582. // delete this.outf.log[this.zhen];
  583. // }
  584. // //判断胜负
  585. // let mfcount: number = 0; //我方活着的人数
  586. // let fcount: number = 0; //我方活着的人数
  587. // for (let index = 0; index < this.teamFiids.length; index++) {
  588. // let fiid = this.teamFiids[index];
  589. // //这里用in 没关系
  590. // if (this.teams[fiid].type == 3) {
  591. // continue; //兽灵不计入胜负计算
  592. // }
  593. // if (this.teams[fiid].type == 4 && Number(fiid) % 100 == 0 && this.teams[fiid].eps.hp <= 0) {
  594. // fcount = 0; // 如果是打boss的 boss死了战斗结束 胜利
  595. // break;
  596. // }
  597. // if (Math.floor(Number(fiid) / 100) >= 10 && (this.teams[fiid].eps.hp > 0 || this.skbuff_get(fiid,"effect_i_63",2) > 0)) {// 还可以复活
  598. // mfcount += 1;
  599. // }
  600. // if (Math.floor(Number(fiid) / 100) < 10 && (this.teams[fiid].eps.hp > 0 || this.skbuff_get(fiid,"effect_i_63",2) > 0)) { // 还可以复活
  601. // fcount += 1;
  602. // }
  603. // }
  604. // if (mfcount < 1) {
  605. // return; //输了
  606. // }
  607. // if (fcount < 1) {
  608. // this.outf.win = 1; //赢了
  609. // return;
  610. // }
  611. // this.zhen++;
  612. // }
  613. // }
  614. // /**
  615. // * 出手(前)
  616. // */
  617. // private pk_zhen_buff() {
  618. // //定时执行
  619. // for (let i = 0; i < this.teamFiids.length; i++) {
  620. // if (gameMethod.isEmpty(this.teams[this.teamFiids[i]].isHide) == false) {
  621. // continue; //隐藏
  622. // }
  623. // this.timer_do(601, { do_iid: Number(this.teamFiids[i]) }); //每帧检测
  624. // this.timer_do(602, { do_iid: Number(this.teamFiids[i]) }); //每帧检测
  625. // }
  626. // for (let i = 0; i < this.teamFiids.length; i++) {
  627. // if (gameMethod.isEmpty(this.teams[this.teamFiids[i]].isHide) == false) {
  628. // continue; //隐藏
  629. // }
  630. // if (this.teams[this.teamFiids[i]].eps.hp <= 0) {
  631. // continue; //还没活
  632. // }
  633. // this.oneFiids[this.teamFiids[i]] = {}; //初始化各个iid
  634. // }
  635. // }
  636. // /**
  637. // * 出手(中)
  638. // */
  639. // private pk_zhen_atk() {
  640. // let iid: string;
  641. // for (let i = 0; i < this.teamFiids.length; i++) {
  642. // iid = this.teamFiids[i];
  643. // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
  644. // continue; //隐藏
  645. // }
  646. // this.pk_zhen_atk_one(iid);
  647. // this.skbuff_sub_all(iid, "effect_i_75");
  648. // // 快剑印记去除
  649. // let eff_i_19 = this.skbuff_get(iid, "effect_i_19", 2);
  650. // if (eff_i_19 > 0 && this.uuids[iid].last2 + 7 * 30 <= this.zhen) {
  651. // // 拥有印记 并且已经7秒没有出手
  652. // this.skbuff_sub_all(iid, "effect_i_19");
  653. // this.skbuff_sub_all(iid, "effect_i_23");
  654. // }
  655. // // 复活buff
  656. // let eff_i_36 = this.skbuff_get(iid, "effect_i_36", 2);
  657. // if (eff_i_36 > 0 && this.skbuff_get(iid, "i_36_nZhen") <= this.zhen) {
  658. // // 复活
  659. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  660. // this.addOneAtk(iid, iid, "effect", ["hp", this.skbuff_get(iid, "i_36")]);
  661. // this.skbuff_sub_all(iid, "effect_i_36");
  662. // }
  663. // this.jueSuanOneAtk();
  664. // }
  665. // }
  666. // /**
  667. // * 出手(中) - 一个人出手
  668. // * @param iid 出手人
  669. // */
  670. // private pk_zhen_atk_one(iid: string) {
  671. // if (this.skbuff_get(iid, "hp") <= 0) {
  672. // return; //还没活
  673. // }
  674. // if (!this.checkHit(iid)) {
  675. // return; // 乙方都死了 兽灵不能攻击
  676. // }
  677. // let i_speed: number = this.skbuff_get(iid, "speed");
  678. // i_speed = i_speed > 50000 ? 50000 : i_speed;
  679. // let last = Math.ceil(30 / (i_speed / 10000));
  680. // if (this.uuids[iid].last + last > this.zhen) {
  681. // return; //不是当前帧
  682. // }
  683. // // this.uuids[iid].last += last; todo 这里不要打开 攻击频率会有问题
  684. // this.sk_base(iid, 1); //技能触发
  685. // //灵力满怒时释放
  686. // if (this.teams["100"] != null && this.teams["100"].eps.mp >= 10000) {
  687. // let result = this.sk_base("100", 3); //技能触发
  688. // if (result){ // 技能释放成功才扣怒气
  689. // this.jueSuanOneAtk()
  690. // this.add_mp("100", -10000, 2);
  691. // }
  692. // }
  693. // if (this.teams["1000"] != null && this.teams["1000"].eps.mp >= 10000) {
  694. // let result = this.sk_base("1000", 3); //技能触发
  695. // if (result){ // 技能释放成功才扣怒气
  696. // this.jueSuanOneAtk()
  697. // this.add_mp("1000", -10000, 2);
  698. // }
  699. // }
  700. // }
  701. // /*
  702. // * 主角弟子都死了 兽灵不能攻击
  703. // * */
  704. // private checkHit(iid: string) {
  705. // if (parseInt(iid) % 100 != 10) {
  706. // return true;
  707. // }
  708. // let count = 0;
  709. // for (let i = 0; i < this.teamFiids.length; i++) {
  710. // if (this.teamFiids[i] != iid && this.teamFiids[i].length == iid.length && !this.uuids[this.teamFiids[i]].dzhen) {
  711. // count++;
  712. // break;
  713. // }
  714. // }
  715. // if (!count) {
  716. // return false;
  717. // } else {
  718. // return true;
  719. // }
  720. // }
  721. // /**
  722. // * 触发一次伤害
  723. // * @param iid 攻击者
  724. // * @param fiid 被打者
  725. // */
  726. // private sk_action_type_1(iid: string, fiid: string, skid: string, acId: string): { [key: string]: number } {
  727. // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
  728. // return {}; //隐藏
  729. // }
  730. // let cfgAc = Gamecfg.skillAction.getItem(acId);
  731. // if (cfgAc == null) {
  732. // return {};
  733. // }
  734. // if (this.oneHit[iid] == null || this.oneHit[iid][fiid] == null) {
  735. // return {};
  736. // }
  737. // let cfgSk = Gamecfg.skillBase.getItem(skid, "1");
  738. // if (cfgSk == null) {
  739. // return {}; //没有这个技能 或者 这个技能的触发时机不对
  740. // }
  741. // let jituiarr: (string | number)[] = []; //击退
  742. // if (cfgAc.args["s"] != null && this.seedRand.rand(1, 10000) <= cfgAc.args["p"] * 10000) {
  743. // jituiarr = ["jitui", cfgAc.args["s"]];
  744. // }
  745. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.atk);
  746. // this.addOneAtk(iid, iid, "aSkid", skid);
  747. // this.uuids[fiid].fpk = iid; //记录最后一次打伤我的人
  748. // this.uuids[iid].ipk = fiid;
  749. // if (this.uuids[iid].ipks[this.zhen] == null) {
  750. // this.uuids[iid].ipks[this.zhen] = [];
  751. // }
  752. // this.uuids[iid].ipks[this.zhen].push(fiid);
  753. // this.uuids[iid].last2 = this.zhen;
  754. // let main_iid = iid.length > 3 ? "1000" : "100";
  755. // if (Number(iid) % 100 < 10 && this.uuids[main_iid] && this.uuids[main_iid].drain_sk > 0) {
  756. // let cfgMath = Gamecfg.mathInfo.getItem("battle_lingli");
  757. // if (cfgMath != null && cfgMath.pram.items != null) {
  758. // let llmin = cfgMath.pram.items[1][0];
  759. // let llMax = cfgMath.pram.items[1][1];
  760. // this.add_mp(main_iid, this.seedRand.rand(llmin, llMax), 2);
  761. // }
  762. // }
  763. // this.timer_do(106, { do_iid: Number(fiid) }); //被打前触发
  764. // this.timer_do(209, { do_iid: Number(iid) }); //攻击结算前触发
  765. // //各种伤害计算
  766. // let gzhit = this.oneHit[iid][fiid];
  767. // let hit: number = gzhit.pghit; //总伤害
  768. // if (cfgSk.skillType == 3) {
  769. // hit = gzhit.skhit;
  770. // }
  771. // if (cfgSk.drain > 0) {
  772. // // 术法伤害增加
  773. // let i_73 = this.skbuff_get(iid, "i_73");
  774. // let i_qhmifa = this.skbuff_get(iid, "qhmifa");
  775. // let f_rhmifa = this.skbuff_get(fiid, "rhmifa");
  776. // hit += Math.floor(hit * ((i_73 + i_qhmifa - f_rhmifa) / 10000));
  777. // }
  778. // let result = { do_iid: Number(fiid), hit: 0 };
  779. // // 攻击 =》
  780. // // 》 判定连击(需要判定有没有触发暴击) | 判定溅射(需要判定有没有触发暴击)
  781. // // 》没用连击 没用溅射 =》 判定暴击
  782. // // 》 如果没有暴击 才是 普通攻击
  783. // // | 吸血
  784. // // 》被打 格挡 | 反击(溅射(需要判定有没有触发暴击) 如果没有溅射才判定暴击 ) 没有暴击 就是普通攻击 + 吸血
  785. // // 反击被打的也要判定 格挡
  786. // // 结束了
  787. // // 是否连击
  788. // let islj: number = this.isLianji(iid, fiid);
  789. // let isNext: number = 0; //0默认 1停止 2已经触发暴击
  790. // if (islj) {
  791. // isNext = 1;
  792. // this.uuids[iid].cons[1] += 1; //记录攻击次数
  793. // this.uuids[fiid].fcons[1] += 1; //记录攻击次数
  794. // // 是否暴击
  795. // let isBj: number = this.isBaoji(iid, fiid);
  796. // if (isBj) {
  797. // isNext = 2;
  798. // } else {
  799. // let isGd = this.isGedang(iid, fiid); // 连击格挡
  800. // hit = gzhit.ljhit;
  801. // if (isGd) {
  802. // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
  803. // hit -= gzhit.gdhit;
  804. // }
  805. // hit = this.hit_last(iid, fiid, hit);
  806. // this.addOneAtk(iid, fiid, "effect", ["lianji", -1 * hit].concat(jituiarr), skid);
  807. // result.hit += hit;
  808. // }
  809. // }
  810. // //是否溅射
  811. // let isJs = this.seedRand.rand(1, 10000) <= gzhit.jsRate;
  812. // if (isJs) {
  813. // isNext = 1;
  814. // let isBj: number = this.isBaoji(iid, fiid);
  815. // if (isBj) {
  816. // isNext = 2;
  817. // } else {
  818. // // 溅射伤害增加
  819. // let i_81 = this.skbuff_get(iid, "i_81");
  820. // if (i_81 != 0) {
  821. // hit = Math.floor(hit * (i_81 / 10000 + 1));
  822. // }
  823. // let isGd = this.isGedang(iid, fiid); // 连击格挡
  824. // if (isGd) {
  825. // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
  826. // hit -= gzhit.gdhit;
  827. // }
  828. // hit = this.hit_last(iid, fiid, hit);
  829. // this.addOneAtk(iid, fiid, "effect", ["hp", -1 * hit], skid);
  830. // let jsxishu: number[] = [1, 0.75, 0.7, 0.58, 0.5];
  831. // let jsfiids = this.find_jianse_fiid(fiid, cfgAc.distance);
  832. // let allHit: number = 0;
  833. // let maxLen = Math.min(jsfiids.length, jsxishu.length);
  834. // for (let index = 0; index < maxLen; index++) {
  835. // if (jsfiids[index] == null) {
  836. // break;
  837. // }
  838. // if (i_81 != 0) {
  839. // hit = Math.floor(hit * (i_81 / 10000 + 1));
  840. // }
  841. // hit = Math.floor(gzhit.jshit * jsxishu[maxLen - 1]);
  842. // let isGd = this.isGedang(iid, jsfiids[index]); // 连击格挡
  843. // if (isGd) {
  844. // this.addOneAtk(iid, jsfiids[index], "effect", ["block", 1]);
  845. // hit -= gzhit.gdhit;
  846. // }
  847. // hit = this.hit_last(iid, jsfiids[index], hit);
  848. // this.addOneAtk(iid, jsfiids[index], "effect", ["jianshe", -1 * hit].concat(jituiarr));
  849. // this.sk_base(jsfiids[index], 2, { hit: hit }); //被攻击
  850. // allHit += hit;
  851. // }
  852. // this.timer_do(205, { do_iid: Number(iid), hit: allHit }); //溅射触发
  853. // }
  854. // }
  855. // //判定是否暴击
  856. // if (isNext == 0) {
  857. // let isBj: number = this.isBaoji(iid, fiid);
  858. // if (isBj) {
  859. // isNext = 2;
  860. // }
  861. // }
  862. // //暴击
  863. // if (isNext == 2) {
  864. // this.uuids[iid].cons[0] += 1; //记录攻击次数
  865. // this.uuids[fiid].fcons[0] += 1; //记录攻击次数
  866. // let isGd = this.isGedang(iid, fiid); // 连击格挡
  867. // if (isGd) {
  868. // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
  869. // hit -= gzhit.gdhit;
  870. // }
  871. // hit = this.hit_last(iid, fiid, gzhit.bjhit);
  872. // this.addOneAtk(iid, fiid, "effect", ["baoji", -1 * hit].concat(jituiarr), skid);
  873. // this.timer_do(203, { do_iid: Number(iid), hit: hit, isBj: hit }); //暴击触发
  874. // result.hit += hit;
  875. // }
  876. // //普通攻击
  877. // if (isNext == 0) {
  878. // this.uuids[iid].cons[0] += 1; //记录攻击次数
  879. // this.uuids[fiid].fcons[0] += 1; //记录攻击次数
  880. // let isGd = this.isGedang(iid, fiid); // 连击格挡
  881. // if (isGd) {
  882. // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
  883. // hit -= gzhit.gdhit;
  884. // }
  885. // hit = this.hit_last(iid, fiid, gzhit.pghit);
  886. // this.addOneAtk(iid, fiid, "effect", ["hp", -1 * hit].concat(jituiarr), skid);
  887. // //this.timer_do(203, { do_iid: Number(iid), hit: hit, isBj: hit }); //暴击触发
  888. // result.hit += hit;
  889. // }
  890. // //是否吸血
  891. // if (gzhit.xxhit > 0) {
  892. // this.addOneAtk(iid, iid, "effect", ["hp", gzhit.xxhit]);
  893. // }
  894. // if (cfgSk.skillType == 3) {
  895. // this.timer_do(207, { do_iid: Number(iid), hit: result.hit }); //技能触发
  896. // this.timer_do(102, { do_iid: Number(fiid), hit: result.hit }); //被打触发(技能)
  897. // } else {
  898. // this.timer_do(201, { do_iid: Number(iid), hit: result.hit }); //普通攻击触发
  899. // this.timer_do(103, { do_iid: Number(fiid), hit: result.hit }); //被打触发(普通)
  900. // }
  901. // if (cfgSk.drain > 0) {
  902. // this.timer_do(208, { do_iid: Number(iid), hit: result.hit }); //术法触发
  903. // }
  904. // // 触发连击buff
  905. // if (islj) {
  906. // this.timer_do(202, { do_iid: Number(iid), hit: result.hit }); //连击触发
  907. // this.timer_do(101, { do_iid: Number(fiid), hit: result.hit }); //连击触发 被打
  908. // this.sk_base(iid, 9, { hit: result.hit });
  909. // }
  910. // // 触发暴击buff
  911. // if (isNext == 2) {
  912. // this.sk_base(iid, 10, { hit: result.hit });
  913. // }
  914. // this.sk_base(fiid, 2, { hit: result.hit }); //被攻击
  915. // //反击
  916. // this.sk_action_type_1_fanji(fiid, iid, gzhit);
  917. // return result;
  918. // }
  919. // /**
  920. // * 触发一次反击
  921. // * @param iid 攻击者
  922. // * @param fiid 被打者
  923. // * @param hit
  924. // * @param cs
  925. // */
  926. // private sk_action_type_1_fanji(iid: string, fiid: string, gzhit: Gzhit) {
  927. // if (this.teams[iid].type == 3 || this.teams[fiid].type == 3) {
  928. // return;
  929. // }
  930. // if (this.jueFiidHp(fiid)<=0){ // 死了不能反击
  931. // return;
  932. // }
  933. // // 被打的是否被冰冻
  934. // let eff_i_3 = this.skbuff_get(iid, "effect_i_3", 2);
  935. // if (eff_i_3 > 0) {
  936. // return; //晕眩
  937. // }
  938. // let eff_i_5 = this.skbuff_get(iid, "effect_i_5", 2);
  939. // if (eff_i_5 > 0) {
  940. // return; //冰冻
  941. // }
  942. // let isNext: number = 0; //0停止 1继续 2暴击
  943. // //技能反击
  944. // let cbback = this.skbuff_get(iid, "canbeatback", 2);
  945. // if (cbback > 0) {
  946. // isNext = 1;
  947. // this.skbuff_sub(iid, "canbeatback");
  948. // }
  949. // let isEpfj: number = 0;
  950. // if (isNext == 0) {
  951. // //触发反击
  952. // let isfj: number = this.isFanji(iid, fiid);
  953. // if (isfj) {
  954. // isNext = 1;
  955. // isEpfj = 1;
  956. // }
  957. // }
  958. // if (isNext == 0) {
  959. // return;
  960. // }
  961. // //找出反击者的普通攻击
  962. // let pskid: string = "";
  963. // let ackid: number = 0;
  964. // let skids: string[] = Object.keys(this.teams[iid].sk);
  965. // for (let index = 0; index < skids.length; index++) {
  966. // let cfgSk = Gamecfg.skillBase.getItem(skids[index], "1");
  967. // if (cfgSk != null && cfgSk.skillType == 1) {
  968. // pskid = skids[index];
  969. // ackid = cfgSk.actions[0];
  970. // break;
  971. // }
  972. // }
  973. // if (pskid == "") {
  974. // return;
  975. // }
  976. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.fanji);
  977. // this.addOneAtk(iid, iid, "aSkid", pskid);
  978. // this.uuids[iid].cons[2] += 1;
  979. // this.uuids[fiid].fcons[2] += 1;
  980. // //伤害
  981. // let hit = gzhit.fjhit;
  982. // let i_rhblock: number = this.skbuff_get(iid, "rhblock");
  983. // //是否溅射
  984. // let isJs = this.seedRand.rand(1, 10000) <= gzhit.fjsRate;
  985. // if (isJs) {
  986. // let isBj: number = this.isBaoji(iid, fiid);
  987. // if (isBj) {
  988. // isNext = 2;
  989. // } else {
  990. // // 溅射伤害增加
  991. // let i_81 = this.skbuff_get(iid, "i_81");
  992. // if (i_81 != 0) {
  993. // hit = Math.floor(hit * (i_81 / 10000 + 1));
  994. // }
  995. // let isGd = this.isGedang(iid, fiid); // 连击格挡
  996. // if (isGd) {
  997. // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
  998. // //格挡伤害= MIN(技能伤害*(MAX(敌方格挡增强-我方格挡减弱,0.12)),技能伤害*0.9)
  999. // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
  1000. // let fgd_hit: number = Math.min(gzhit.fjhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), gzhit.fjhit * 0.9);
  1001. // hit -= Math.floor(fgd_hit);
  1002. // }
  1003. // hit = this.hit_last(iid, fiid, hit);
  1004. // this.addOneAtk(iid, fiid, "effect", ["fanji", -1 * hit], pskid);
  1005. // let jsxishu: number[] = [1, 0.75, 0.7, 0.58, 0.5];
  1006. // let distance = 0;
  1007. // if (ackid != 0) {
  1008. // let cfgAc = Gamecfg.skillAction.getItem(ackid.toString());
  1009. // if (cfgAc != null) {
  1010. // distance = cfgAc.distance;
  1011. // }
  1012. // }
  1013. // let jsfiids = this.find_jianse_fiid(fiid, distance);
  1014. // let allHit: number = 0;
  1015. // let maxLen = Math.min(jsfiids.length, jsxishu.length);
  1016. // for (let index = 0; index < maxLen; index++) {
  1017. // if (jsfiids[index] == null) {
  1018. // break;
  1019. // }
  1020. // if (i_81 != 0) {
  1021. // hit = Math.floor(hit * (i_81 / 10000 + 1));
  1022. // }
  1023. // hit = Math.floor(gzhit.jshit * jsxishu[maxLen - 1]);
  1024. // let isGd = this.isGedang(iid, jsfiids[index]); // 连击格挡
  1025. // if (isGd) {
  1026. // this.addOneAtk(iid, jsfiids[index], "effect", ["block", 1]);
  1027. // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
  1028. // let fgd_hit: number = Math.min(gzhit.fjhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), gzhit.fjhit * 0.9);
  1029. // hit -= Math.floor(fgd_hit);
  1030. // }
  1031. // hit = this.hit_last(iid, jsfiids[index], hit);
  1032. // this.addOneAtk(iid, jsfiids[index], "effect", ["fanji", -1 * hit]);
  1033. // this.sk_base(jsfiids[index], 2, { hit: hit }); //被攻击
  1034. // allHit += hit;
  1035. // }
  1036. // this.timer_do(205, { do_iid: Number(iid), hit: allHit }); //溅射触发
  1037. // }
  1038. // }
  1039. // //判定是否暴击
  1040. // if (isNext == 1) {
  1041. // let isBj: number = this.isBaoji(iid, fiid);
  1042. // if (isBj) {
  1043. // isNext = 2;
  1044. // }
  1045. // }
  1046. // //暴击
  1047. // if (isNext == 2) {
  1048. // this.uuids[iid].cons[0] += 1; //记录攻击次数
  1049. // this.uuids[fiid].fcons[0] += 1; //记录攻击次数
  1050. // let isGd = this.isGedang(iid, fiid); // 连击格挡
  1051. // if (isGd) {
  1052. // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
  1053. // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
  1054. // let fgd_hit: number = Math.min(gzhit.fjhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), gzhit.fjhit * 0.9);
  1055. // hit -= fgd_hit;
  1056. // }
  1057. // hit = this.hit_last(iid, fiid, gzhit.bjhit);
  1058. // this.addOneAtk(iid, fiid, "effect", ["baoji", -1 * hit]);
  1059. // this.timer_do(203, { do_iid: Number(iid), hit: hit, isBj: hit }); //暴击触发
  1060. // }
  1061. // //普通攻击
  1062. // if (isNext == 1) {
  1063. // let isGd = this.isGedang(iid, fiid); // 格挡
  1064. // if (isGd) {
  1065. // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
  1066. // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
  1067. // let fgd_hit: number = Math.min(gzhit.fjhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), gzhit.fjhit * 0.9);
  1068. // hit -= fgd_hit;
  1069. // }
  1070. // hit = this.hit_last(iid, fiid, hit);
  1071. // this.addOneAtk(iid, fiid, "effect", ["fanji", -1 * hit]);
  1072. // this.timer_do(203, { do_iid: Number(iid), hit: hit, isBj: hit }); //暴击触发
  1073. // }
  1074. // //吸血率=max((我方吸血-敌方抗吸血),吸血保底参数)
  1075. // //吸血值= 最终伤害值*max(我方吸血增强-敌方吸血减弱,1)*吸血率
  1076. // let i_xixue: number = this.skbuff_get(iid, "xixue");
  1077. // let f_hsxixue: number = this.skbuff_get(fiid, "hsxixue");
  1078. // let bdxixue: number = 0; //保底吸血
  1079. // let cfg = Gamecfg.userEp.getItem("xixue");
  1080. // if (cfg != null) {
  1081. // bdxixue = cfg.initEp;
  1082. // }
  1083. // let xxRate: number = Math.max(i_xixue - f_hsxixue, bdxixue);
  1084. // let i_qhxixue: number = this.skbuff_get(iid, "qhxixue");
  1085. // let f_rhxixue: number = this.skbuff_get(fiid, "rhxixue");
  1086. // let xx_hit: number = Math.floor((gzhit.fjhit * Math.max((i_qhxixue - f_rhxixue) / 10000 + 1, 1) * xxRate) / 10000);
  1087. // //是否吸血
  1088. // if (xx_hit>0) {
  1089. // this.addOneAtk(iid, iid, "effect", ["hp", xx_hit]);
  1090. // }
  1091. // this.timer_do(204, { do_iid: Number(iid), hit: hit }); //反击触发
  1092. // if (isEpfj) {
  1093. // // 反击获得buff
  1094. // let skids: string[] = Object.keys(this.teams[iid].sk);
  1095. // for (let index = 0; index < skids.length; index++) {
  1096. // let cfgSk = Gamecfg.skillBase.getItem(skids[index], "1");
  1097. // if (cfgSk && cfgSk.runStatus === 7) {
  1098. // for (let index = 0; index < cfgSk.effect.length; index++) {
  1099. // let effectId = cfgSk.effect[index];
  1100. // this.sk_effect(fiid, skids[index], effectId.toString(), "", { hit: hit });
  1101. // }
  1102. // }
  1103. // }
  1104. // }
  1105. // }
  1106. // /**
  1107. // * 出手(后)
  1108. // */
  1109. // private pk_zhen_over() {
  1110. // //死亡触发
  1111. // for (let index = 0; index < this.teamFiids.length; index++) {
  1112. // let fiid = this.teamFiids[index];
  1113. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1114. // continue; //隐藏
  1115. // }
  1116. // if (this.teams[fiid].eps.hp > 0) {
  1117. // continue; //还活着
  1118. // }
  1119. // if (this.uuids[fiid].dzhen > 0) {
  1120. // continue; //之前已经死了
  1121. // }
  1122. // this.uuids[fiid].dzhen = this.zhen; //那一帧死了
  1123. // this.teams[fiid].eps.hp = 0;
  1124. // this.timer_do(402, { do_iid: Number(fiid) }); //死亡触发
  1125. // this.jiesuo_hide(fiid);
  1126. // }
  1127. // //清除过期buff
  1128. // this.skbuff_clear();
  1129. // }
  1130. // /**
  1131. // * 单次出手临时存储信息 - 记录
  1132. // */
  1133. // addOneAtk(iid: string, fiid: string, key: string, val: any, skid: string = "") {
  1134. // if (!this.oneAtkiids.includes(iid)) {
  1135. // this.oneAtkiids.push(iid);
  1136. // }
  1137. // //初始化
  1138. // if (this.oneAtk[iid] == null) {
  1139. // this.oneAtk[iid] = {};
  1140. // }
  1141. // if (this.uuids[iid].dzhen > 0 && this.uuids[iid].dzhen < this.zhen) {
  1142. // return; //已经死了 ,不要在折腾了
  1143. // }
  1144. // if (this.uuids[fiid].dzhen > 0 && this.uuids[fiid].dzhen < this.zhen) {
  1145. // return; //已经死了 ,不要在折腾了
  1146. // }
  1147. // if (this.oneAtk[iid][fiid] == null) {
  1148. // this.oneAtk[iid][fiid] = {
  1149. // aType: Xys.ActionType.default, //动作类型
  1150. // aSkid: "", //使用的技能ID
  1151. // effect: [],
  1152. // buff: [],
  1153. // };
  1154. // }
  1155. // //目标治疗效果降低/增加
  1156. // if (val[0] == "hp" && val[1] > 0 && this.skbuff_get(fiid, "effect_i_62", 2) > 0) {
  1157. // let f_i_62 = this.skbuff_get(fiid, "i_62");
  1158. // val[1] += Math.floor((val[1] * f_i_62) / 10000);
  1159. // val[1] = Math.max(0, val[1]);
  1160. // }
  1161. // //单次伤害不超过自身最大生命值的x%
  1162. // if (this.xueku.includes(val[0]) && val[1] < 0) {
  1163. // let f_i_71 = this.skbuff_get(fiid, "max_i_71");
  1164. // if (f_i_71 > 0 && Math.abs(val[1]) > f_i_71 && this.skbuff_get(fiid, "max_i_71_nZhen") <= this.zhen) {
  1165. // let max_i_71_cd = this.skbuff_get(fiid, "max_i_71_cd");
  1166. // if (max_i_71_cd > 0) {
  1167. // this.skbuff_update(fiid, { max_i_71_nZhen: this.zhen + max_i_71_cd * 30 });
  1168. // }
  1169. // val[1] = -f_i_71;
  1170. // }
  1171. // }
  1172. // //统计
  1173. // if (this.outf.tongji[fiid] == null) {
  1174. // this.outf.tongji[fiid] = {
  1175. // shuchu: 0, //输出
  1176. // zhiliao: 0, //治疗
  1177. // chengshang: 0, //承伤
  1178. // };
  1179. // }
  1180. // if (this.outf.tongji[iid] == null) {
  1181. // this.outf.tongji[iid] = {
  1182. // shuchu: 0, //输出
  1183. // zhiliao: 0, //治疗
  1184. // chengshang: 0, //承伤
  1185. // };
  1186. // }
  1187. // switch (key) {
  1188. // case "aType": //动作类型
  1189. // //已经是攻击类型, 就不要再改了
  1190. // if (this.oneAtk[iid][fiid].aType != Xys.ActionType.atk) {
  1191. // this.oneAtk[iid][fiid].aType = val;
  1192. // }
  1193. // break;
  1194. // case "aSkid": //使用的技能ID
  1195. // this.oneAtk[iid][fiid].aSkid = val;
  1196. // break;
  1197. // case "effect": //特效
  1198. // this.oneAtk[iid][fiid].effect.push(val);
  1199. // if (this.xueku.includes(val[0]) && val[1] < 0) {
  1200. // //统计
  1201. // this.outf.tongji[iid].shuchu += Math.abs(val[1]);
  1202. // this.outf.tongji[fiid].chengshang += Math.abs(val[1]);
  1203. // let main_iid = fiid.length > 3 ? "1000" : "100";
  1204. // if (Number(fiid) % 100 < 10 && this.uuids[main_iid] && this.uuids[main_iid].drain_sk > 0) {
  1205. // let cfgMath = Gamecfg.mathInfo.getItem("battle_lingli");
  1206. // if (cfgMath != null && cfgMath.pram.items != null) {
  1207. // let llmin = cfgMath.pram.items[0][0];
  1208. // let llMax = cfgMath.pram.items[0][1];
  1209. // this.add_mp(main_iid, this.seedRand.rand(llmin, llMax), 2);
  1210. // }
  1211. // }
  1212. // }
  1213. // if (this.xueku.includes(val[0]) && val[1] > 0) {
  1214. // //统计
  1215. // this.outf.tongji[fiid].zhiliao += Math.abs(val[1]);
  1216. // //回血触发(治疗触发/吸血触发--这3个是一个意思)
  1217. // this.timer_do(403, { do_iid: Number(fiid) });
  1218. // }
  1219. // break;
  1220. // case "buff": //buff
  1221. // this.oneAtk[iid][fiid].buff.push(val);
  1222. // break;
  1223. // }
  1224. // }
  1225. // /**
  1226. // * 当前剩余血量
  1227. // */
  1228. // jueFiidHp(fiid: string) {
  1229. // let lsf_hp: number = this.teams[fiid].eps.hp;
  1230. // let iids = Object.keys(this.oneAtk);
  1231. // for (let i = 0; i < iids.length; i++) {
  1232. // if (this.oneAtk[iids[i]][fiid] == null) {
  1233. // continue;
  1234. // }
  1235. // for (let k = 0; k < this.oneAtk[iids[i]][fiid].effect.length; k++) {
  1236. // if (this.xueku.includes(this.oneAtk[iids[i]][fiid].effect[k][0])) {
  1237. // lsf_hp += this.oneAtk[iids[i]][fiid].effect[k][1];
  1238. // }
  1239. // }
  1240. // }
  1241. // lsf_hp = Math.min(lsf_hp, this.skbuff_get(fiid, "hp_max"));
  1242. // return lsf_hp;
  1243. // }
  1244. // /**
  1245. // * 单次出手临时存储信息 - 结算
  1246. // */
  1247. // jueSuanOneAtk() {
  1248. // if (gameMethod.isEmpty(this.oneAtk) == true) {
  1249. // return;
  1250. // }
  1251. // // 结算前判定主角是否死亡 并且是否拥有复活buff 复活buff触发帧是否生效
  1252. // let iids = ["100","1000"];
  1253. // for (let i=0;i<iids.length;i++){
  1254. // let iid = iids[i];
  1255. // let hp = this.skbuff_get(iid, "hp");
  1256. // if (hp <= 0 && this.skbuff_get(iid, "effect_i_63", 2) > 0) {
  1257. // let i_63_cd = this.skbuff_get(iid, "i_63_cd")
  1258. // if (i_63_cd > 0){ // 死亡后延迟x帧复活
  1259. // //this.skbuff_update(iid, { "i_63_cd":-i_63_cd,"i_63_nZhen": this.zhen + i_63_cd });
  1260. // }else if (this.skbuff_get(iid, "i_63_nZhen") <= this.zhen){
  1261. // let addHp = this.skbuff_get(iid, "i_63_hp");
  1262. // if (addHp > 0) {
  1263. // this.skbuff_sub_all(iid,"effect_i_63")
  1264. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  1265. // this.addOneAtk(iid, iid, "effect", ["hp", addHp - hp]);
  1266. // }
  1267. // }
  1268. // }
  1269. // }
  1270. // //攻打方
  1271. // for (let i = 0; i < this.oneAtkiids.length; i++) {
  1272. // let i_buff: [string, number][] = [];
  1273. // let i_effect: [string, number][] = [];
  1274. // let target: Xys.LogOneData[] = [];
  1275. // let fiids = Object.keys(this.oneAtk[this.oneAtkiids[i]]);
  1276. // for (let k = 0; k < fiids.length; k++) {
  1277. // let chahp: number = 0;
  1278. // //计算血量和伤害
  1279. // for (let j = 0; j < this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect.length; j++) {
  1280. // let effect = this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect[j];
  1281. // if (this.xueku.includes(effect[0])) {
  1282. // if (Number(fiids[k]) < 1000 && effect[1] < 0) {
  1283. // this.outf.hurt += Math.abs(effect[1]); //计算伤害
  1284. // }
  1285. // if (effect[1] < 0) {
  1286. // //扣血执行
  1287. // this.timer_do(401, { do_iid: Number(fiids[k]), hit: Math.abs(effect[1]) });
  1288. // this.timer_do(404, { do_iid: Number(fiids[k]), hit: Math.abs(effect[1]) });
  1289. // this.timer_do(405, { do_iid: Number(this.oneAtkiids[i]), hit: Math.abs(effect[1]) }); //敌方扣血 我方加buff
  1290. // }
  1291. // if (this.teams[fiids[k]].eps.hp + chahp + effect[1] < 0) {
  1292. // // 最后一下 如果对方被打死了 伤害不能超过对方血量
  1293. // effect[1] = -(this.teams[fiids[k]].eps.hp + chahp);
  1294. // }
  1295. // if (effect[1] == 0 && this.teams[fiids[k]].eps.hp + chahp == 0) {
  1296. // // 如果已经被打死了 删掉这个影响
  1297. // this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect.splice(j, 1);
  1298. // j--;
  1299. // }
  1300. // chahp += effect[1];
  1301. // }
  1302. // }
  1303. // this.teams[fiids[k]].eps.hp += chahp;
  1304. // this.teams[fiids[k]].eps.hp = Math.min(this.skbuff_get(fiids[k], "hp_max"), this.teams[fiids[k]].eps.hp);
  1305. // if (this.oneAtkiids[i] == fiids[k]) {
  1306. // i_buff = this.oneAtk[this.oneAtkiids[i]][fiids[k]].buff;
  1307. // i_effect = this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect;
  1308. // } else {
  1309. // target.push({
  1310. // fid: this.teams[fiids[k]].fid, //出手方Id
  1311. // iid: fiids[k], //阵容下标
  1312. // hp: this.teams[fiids[k]].eps.hp, //剩余血量
  1313. // mp: this.teams[fiids[k]].eps.mp, //剩余怒气
  1314. // buff: this.oneAtk[this.oneAtkiids[i]][fiids[k]].buff, //[ [生效帧开始,生效帧结束,buffKEY,触发的人]]
  1315. // effect: this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect, //触发效果 [ [属性key,数值]]
  1316. // tongji:Math.abs(this.outf.tongji[fiids[k]]?.shuchu | 0),
  1317. // zonji:0
  1318. // });
  1319. // }
  1320. // this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect = [];
  1321. // }
  1322. // this.teams[this.oneAtkiids[i]].eps.hp = Math.min(this.teams[this.oneAtkiids[i]].eps.hp, this.skbuff_get(this.oneAtkiids[i], "hp_max"));
  1323. // // 把回血合并
  1324. // let i_effect2:[string, number][] = []
  1325. // let jisuan:{[key:string]:number} = {}
  1326. // for (let item of i_effect){
  1327. // if (this.xueku.includes(item[0]) && item[1] > 0){ //属于回血字段并且值大于0
  1328. // if (jisuan[item[0]] == null){
  1329. // jisuan[item[0]] = item[1]
  1330. // }else {
  1331. // jisuan[item[0]] += item[1]
  1332. // }
  1333. // }else{
  1334. // i_effect2.push(item)
  1335. // }
  1336. // }
  1337. // for (let key in jisuan){
  1338. // i_effect2.push([key,jisuan[key]])
  1339. // }
  1340. // //初始化
  1341. // let atker: Xys.LogOneData = {
  1342. // fid: this.teams[this.oneAtkiids[i]].fid, //出手方Id
  1343. // iid: this.oneAtkiids[i], //阵容下标
  1344. // hp: this.teams[this.oneAtkiids[i]].eps.hp, //剩余血量
  1345. // mp: this.teams[this.oneAtkiids[i]].eps.mp, //剩余怒气
  1346. // buff: i_buff, //[ [生效帧开始,生效帧结束,buffKEY,触发的人]]
  1347. // effect: i_effect2, //触发效果 [ [属性key,数值]]
  1348. // tongji:Math.abs(this.outf.tongji[this.oneAtkiids[i]]?.shuchu | 0),
  1349. // zonji:0
  1350. // };
  1351. // if (
  1352. // this.oneAtk[this.oneAtkiids[i]][this.oneAtkiids[i]] != null &&
  1353. // this.oneAtk[this.oneAtkiids[i]][this.oneAtkiids[i]].aType != Xys.ActionType.default
  1354. // ) {
  1355. // //添加日志
  1356. // this.addOneLog({
  1357. // aType: this.oneAtk[this.oneAtkiids[i]][this.oneAtkiids[i]].aType, //战斗动作类型
  1358. // aSkid: this.oneAtk[this.oneAtkiids[i]][this.oneAtkiids[i]].aSkid, //使用的技能ID
  1359. // fhp: 0,
  1360. // atker: atker, //出手方
  1361. // target: target, //目标
  1362. // });
  1363. // }
  1364. // }
  1365. // this.oneAtk = {};
  1366. // this.oneAtkiids = [];
  1367. // }
  1368. // /**
  1369. // * 战斗日志
  1370. // */
  1371. // addOneLog(log: Xys.fightLogOne) {
  1372. // log.fhp = 0;
  1373. // for (let index = 0; index < this.teamFiids.length; index++) {
  1374. // let fiid = this.teamFiids[index];
  1375. // //统计对方剩余总血量 in没关系
  1376. // if (Number(fiid) >= 1000) {
  1377. // continue; //自己人
  1378. // }
  1379. // if (this.teams[fiid].isHide != 0) {
  1380. // continue; //隐藏不管
  1381. // }
  1382. // if (this.teams[fiid].type == 3) {
  1383. // continue; //兽灵不管
  1384. // }
  1385. // if (this.teams[fiid].eps.hp < 1) {
  1386. // continue; //死了不管
  1387. // }
  1388. // log.fhp += this.teams[fiid].eps.hp;
  1389. // }
  1390. // this.outf.log[this.zhen].push(log);
  1391. // }
  1392. // /**
  1393. // * 战斗日志
  1394. // */
  1395. // over_back(): Xys.OverBack {
  1396. // this.outf.hp = 0;
  1397. // for (let index = 0; index < this.teamFiids.length; index++) {
  1398. // let fiid = this.teamFiids[index];
  1399. // if (fiid.length <= 3 && this.teams[fiid].eps.hp > 0 && this.teams[fiid].isHide == 0) {
  1400. // this.outf.hp += this.teams[fiid].eps.hp;
  1401. // }
  1402. // }
  1403. // this.outf.start.teams = this.teams;
  1404. // return this.outf;
  1405. // }
  1406. // //***********************************************
  1407. // /**
  1408. // * 辅助函数 - 获取对手
  1409. // * @param key 标识key
  1410. // * @param iid 出手方
  1411. // * @param ttype (1敌方全体,2前排敌方,3中排敌方,4后排敌方,5敌方随机,6自己,7已方全体,8已方随机)
  1412. // * @param targetType 目标数量
  1413. // */
  1414. // private find_fiids(key: string, iid: string, ttype: number[], targetType: number, distance: number = 0) {
  1415. // if (ttype.length <= 0) {
  1416. // return; //沿用上一次的 可能没有上一次
  1417. // }
  1418. // if (this.oneFiids[iid] == null) {
  1419. // this.oneFiids[iid] = {};
  1420. // }
  1421. // let fiids: string[] = [];
  1422. // this.oneFiids[iid][key] = []; //重置 重新获取
  1423. // //目标打击顺序
  1424. // const mblist: { [mubiao: string]: { [yu: string]: number[] } } = {
  1425. // "1": {
  1426. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1427. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1428. // },
  1429. // "2": {
  1430. // //2前排敌方
  1431. // "0": [2, 1, 3, 13, 14],
  1432. // "2": [2, 1, 3, 13, 14],
  1433. // "5": [2, 1, 3, 13, 14],
  1434. // "8": [2, 1, 3, 13, 14],
  1435. // "1": [3, 2, 14, 1, 13],
  1436. // "4": [3, 2, 14, 1, 13],
  1437. // "7": [3, 2, 14, 1, 13],
  1438. // "3": [1, 13, 2, 3, 14],
  1439. // "6": [1, 13, 2, 3, 14],
  1440. // "9": [1, 13, 2, 3, 14],
  1441. // "10": [3, 2, 14, 1, 13],
  1442. // "11": [2, 1, 3, 13, 14],
  1443. // "12": [1, 13, 2, 3, 14],
  1444. // "13": [14, 3, 2, 1, 13],
  1445. // "15": [14, 3, 2, 1, 13],
  1446. // "17": [14, 3, 2, 1, 13],
  1447. // "14": [13, 1, 2, 3, 14],
  1448. // "16": [13, 1, 2, 3, 14],
  1449. // "18": [13, 1, 2, 3, 14],
  1450. // },
  1451. // "3": {
  1452. // //3中排敌方
  1453. // "0": [5, 4, 6, 15, 16],
  1454. // "2": [5, 4, 6, 15, 16],
  1455. // "5": [5, 4, 6, 15, 16],
  1456. // "8": [5, 4, 6, 15, 16],
  1457. // "1": [6, 5, 16, 4, 15],
  1458. // "4": [6, 5, 16, 4, 15],
  1459. // "7": [6, 5, 16, 4, 15],
  1460. // "3": [4, 15, 5, 6, 16],
  1461. // "6": [4, 15, 5, 6, 16],
  1462. // "9": [4, 15, 5, 6, 16],
  1463. // "10": [6, 5, 16, 4, 15],
  1464. // "11": [5, 4, 6, 15, 16],
  1465. // "12": [4, 15, 5, 6, 16],
  1466. // "13": [16, 6, 5, 4, 15],
  1467. // "15": [16, 6, 5, 4, 15],
  1468. // "17": [16, 6, 5, 4, 15],
  1469. // "14": [15, 4, 5, 6, 16],
  1470. // "16": [15, 4, 5, 6, 16],
  1471. // "18": [15, 4, 5, 6, 16],
  1472. // },
  1473. // "4": {
  1474. // //4后排敌方
  1475. // "0": [8, 7, 9, 17, 18],
  1476. // "2": [8, 7, 9, 17, 18],
  1477. // "5": [8, 7, 9, 17, 18],
  1478. // "8": [8, 7, 9, 17, 18],
  1479. // "1": [9, 8, 18, 7, 17],
  1480. // "4": [9, 8, 18, 7, 17],
  1481. // "7": [9, 8, 18, 7, 17],
  1482. // "3": [7, 8, 17, 9, 18],
  1483. // "6": [7, 8, 17, 9, 18],
  1484. // "9": [7, 8, 17, 9, 18],
  1485. // "10": [9, 8, 18, 7, 17],
  1486. // "11": [8, 7, 9, 17, 18],
  1487. // "12": [7, 8, 17, 9, 18],
  1488. // "13": [18, 9, 8, 7, 17],
  1489. // "15": [18, 9, 8, 7, 17],
  1490. // "17": [18, 9, 8, 7, 17],
  1491. // "14": [17, 7, 8, 9, 18],
  1492. // "16": [17, 7, 8, 9, 18],
  1493. // "18": [17, 7, 8, 9, 18],
  1494. // },
  1495. // "5": {
  1496. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1497. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1498. // },
  1499. // "7": {
  1500. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1501. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1502. // },
  1503. // "8": {
  1504. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1505. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1506. // },
  1507. // "10": {
  1508. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1509. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1510. // },
  1511. // "11": {
  1512. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1513. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1514. // },
  1515. // "12": {
  1516. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1517. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1518. // },
  1519. // "13": {
  1520. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1521. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1522. // },
  1523. // "16": {
  1524. // //1敌方全体 5敌方随机 7已方全体 8已方随机
  1525. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1526. // },
  1527. // "17": {
  1528. // //主角自己
  1529. // "0": [0],
  1530. // },
  1531. // "18": {
  1532. // //我方弟子
  1533. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18],
  1534. // },
  1535. // "20": {
  1536. // //我方弟子
  1537. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18],
  1538. // },
  1539. // "22": {
  1540. // //敌方全体异常
  1541. // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
  1542. // },
  1543. // "23": {
  1544. // "0": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
  1545. // "2": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
  1546. // "5": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
  1547. // "8": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
  1548. // "11": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
  1549. // "1": [3, 6, 2, 14, 9, 1, 5, 16, 14, 4, 8, 18, 15, 7, 17, 0],
  1550. // "4": [3, 6, 2, 14, 9, 1, 5, 16, 14, 4, 8, 18, 15, 7, 17, 0],
  1551. // "7": [3, 6, 2, 14, 9, 1, 5, 16, 14, 4, 8, 18, 15, 7, 17, 0],
  1552. // "10": [3, 6, 2, 14, 9, 1, 5, 16, 14, 4, 8, 18, 15, 7, 17, 0],
  1553. // "3": [1, 4, 13, 2, 7, 3, 15, 5, 14, 6, 17, 8, 16, 9, 18, 0],
  1554. // "6": [1, 4, 13, 2, 7, 3, 15, 5, 14, 6, 17, 8, 16, 9, 18, 0],
  1555. // "9": [1, 4, 13, 2, 7, 3, 15, 5, 14, 6, 17, 8, 16, 9, 18, 0],
  1556. // "12": [1, 4, 13, 2, 7, 3, 15, 5, 14, 6, 17, 8, 16, 9, 18, 0],
  1557. // "13": [14, 16, 3, 18, 2, 6, 1, 5, 9, 13, 4, 8, 15, 7, 17, 0],
  1558. // "15": [14, 16, 3, 18, 2, 6, 1, 5, 9, 13, 4, 8, 15, 7, 17, 0],
  1559. // "17": [14, 16, 3, 18, 2, 6, 1, 5, 9, 13, 4, 8, 15, 7, 17, 0],
  1560. // "14": [13, 15, 1, 17, 2, 4, 3, 5, 7, 14, 6, 8, 16, 9, 18, 0],
  1561. // "16": [13, 15, 1, 17, 2, 4, 3, 5, 7, 14, 6, 8, 16, 9, 18, 0],
  1562. // "18": [13, 15, 1, 17, 2, 4, 3, 5, 7, 14, 6, 8, 16, 9, 18, 0],
  1563. // },
  1564. // };
  1565. // let yu = Math.floor(Number(iid) % 100).toString();
  1566. // let iqz: number = 100; //我方前缀
  1567. // let fqz: number = 1000; //对方前缀
  1568. // if (Number(iid) >= 1000) {
  1569. // fqz = 100;
  1570. // iqz = 1000;
  1571. // }
  1572. // for (let i = 0; i < ttype.length; i++) {
  1573. // if (fiids.length >= targetType) {
  1574. // break; //已经找到了
  1575. // }
  1576. // let mubiao = ttype[i];
  1577. // switch (mubiao) {
  1578. // case 1: //1敌方全体
  1579. // if (distance > 0) {
  1580. // let fiid = (fqz + 5).toString();
  1581. // fiids = this.find_jianse_fiid(fiid, distance);
  1582. // if (this.teams[fiid] != null && this.uuids[fiid].dzhen == 0 && gameMethod.isEmpty(this.teams[fiid].isHide)) {
  1583. // fiids.push((fqz + 5).toString());
  1584. // }
  1585. // } else {
  1586. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1587. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1588. // let fHp = this.skbuff_get(fiid, "hp");
  1589. // if (this.teams[fiid] == null || fHp <= 0) {
  1590. // continue;
  1591. // }
  1592. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1593. // continue; //隐藏
  1594. // }
  1595. // fiids.push(fiid);
  1596. // }
  1597. // }
  1598. // break;
  1599. // case 2: //2前排敌方
  1600. // case 3: //3中排敌方
  1601. // case 4: //4后排敌方
  1602. // let count = 0;
  1603. // for (let k = 0; k < mblist[mubiao.toString()][yu].length; k++) {
  1604. // let fiid = (fqz + mblist[mubiao.toString()][yu][k]).toString();
  1605. // let fHp = this.skbuff_get(fiid, "hp");
  1606. // if (this.teams[fiid] == null || fHp <= 0) {
  1607. // continue;
  1608. // }
  1609. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1610. // continue; //隐藏
  1611. // }
  1612. // count += 1;
  1613. // if (count > targetType) {
  1614. // continue;
  1615. // }
  1616. // fiids.push(fiid);
  1617. // }
  1618. // break;
  1619. // case 5: // 5敌方随机(不能随机同一个目标)
  1620. // let cqlist5: string[] = [];
  1621. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1622. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1623. // let fHp = this.skbuff_get(fiid, "hp");
  1624. // if (this.teams[fiid] == null || fHp <= 0) {
  1625. // continue;
  1626. // }
  1627. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1628. // continue; //隐藏
  1629. // }
  1630. // cqlist5.push(fiid);
  1631. // }
  1632. // fiids = this.seedRand.getRandArr(cqlist5, Math.min(cqlist5.length, targetType));
  1633. // break;
  1634. // case 6: //自己
  1635. // fiids = [iid];
  1636. // break;
  1637. // case 7: //7已方全体
  1638. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1639. // let fiid = (iqz + mblist[mubiao.toString()]["0"][k]).toString();
  1640. // let fHp = this.skbuff_get(fiid, "hp");
  1641. // if (this.teams[fiid] == null || fHp <= 0) {
  1642. // continue;
  1643. // }
  1644. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1645. // continue; //隐藏
  1646. // }
  1647. // fiids.push(fiid);
  1648. // }
  1649. // break;
  1650. // case 8: // 8已方随机(除自己外)(不可以随机同一个目标)
  1651. // let cqlist8: string[] = [];
  1652. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1653. // let fiid = (iqz + mblist[mubiao.toString()]["0"][k]).toString();
  1654. // let fHp = this.skbuff_get(fiid, "hp");
  1655. // if (this.teams[fiid] == null || fHp <= 0) {
  1656. // continue;
  1657. // }
  1658. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1659. // continue; //隐藏
  1660. // }
  1661. // if (fiid == iid) {
  1662. // //(除自己外)
  1663. // continue;
  1664. // }
  1665. // cqlist8.push(fiid);
  1666. // }
  1667. // fiids = this.seedRand.getRandArr(cqlist8, Math.min(cqlist8.length, targetType));
  1668. // break;
  1669. // case 9: // 9上次攻击我的对象
  1670. // if (!this.uuids[iid]) {
  1671. // continue;
  1672. // }
  1673. // if (this.uuids[iid].fpk != "") {
  1674. // fiids.push(this.uuids[iid].fpk);
  1675. // }
  1676. // break;
  1677. // case 10: // 10敌方攻击力最高单位
  1678. // let fMaxatk10: number = 0;
  1679. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1680. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1681. // let fHp = this.skbuff_get(fiid, "hp");
  1682. // if (this.teams[fiid] == null || fHp <= 0) {
  1683. // continue;
  1684. // }
  1685. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1686. // continue; //隐藏
  1687. // }
  1688. // let fAtk = this.skbuff_get(fiid, "atk");
  1689. // if (fAtk <= fMaxatk10) {
  1690. // continue;
  1691. // }
  1692. // fMaxatk10 = fAtk;
  1693. // fiids = [fiid];
  1694. // }
  1695. // break;
  1696. // case 11: // 11敌方攻击力最低单位,
  1697. // let fMinatk11: number = 999999999;
  1698. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1699. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1700. // let fHp = this.skbuff_get(fiid, "hp");
  1701. // if (this.teams[fiid] == null || fHp <= 0) {
  1702. // continue;
  1703. // }
  1704. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1705. // continue; //隐藏
  1706. // }
  1707. // let fAtk = this.skbuff_get(fiid, "atk");
  1708. // if (fAtk >= fMinatk11) {
  1709. // continue;
  1710. // }
  1711. // fMinatk11 = fAtk;
  1712. // fiids = [fiid];
  1713. // }
  1714. // break;
  1715. // case 12: // 12敌方当前血量最低单位
  1716. // let fMinhp12: number = 999999999;
  1717. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1718. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1719. // let fHp = this.skbuff_get(fiid, "hp");
  1720. // if (this.teams[fiid] == null || fHp <= 0) {
  1721. // continue;
  1722. // }
  1723. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1724. // continue; //隐藏
  1725. // }
  1726. // let fAtk = this.skbuff_get(fiid, "hp");
  1727. // if (fAtk >= fMinhp12) {
  1728. // continue;
  1729. // }
  1730. // fMinhp12 = fAtk;
  1731. // fiids = [fiid];
  1732. // }
  1733. // break;
  1734. // case 13: // 13敌方当前血量最高单位,
  1735. // let fMaxhp13: number = 0;
  1736. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1737. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1738. // let fHp = this.skbuff_get(fiid, "hp");
  1739. // if (this.teams[fiid] == null || fHp <= 0) {
  1740. // continue;
  1741. // }
  1742. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1743. // continue; //隐藏
  1744. // }
  1745. // let fAtk = this.skbuff_get(fiid, "hp");
  1746. // if (fAtk <= fMaxhp13) {
  1747. // continue;
  1748. // }
  1749. // fMaxhp13 = fAtk;
  1750. // fiids = [fiid];
  1751. // }
  1752. // break;
  1753. // case 15: // 15 我打的最后一个
  1754. // if (this.uuids[iid].ipk != "") {
  1755. // fiids = [this.uuids[iid].ipk];
  1756. // }
  1757. // break;
  1758. // case 16: //16生命值最低的已方单位)
  1759. // let minHp: number = 0;
  1760. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1761. // let fiid = (iqz + mblist[mubiao.toString()]["0"][k]).toString();
  1762. // let fHp = this.skbuff_get(fiid, "hp");
  1763. // if (this.teams[fiid] == null || fHp <= 0) {
  1764. // continue;
  1765. // }
  1766. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1767. // continue; //隐藏
  1768. // }
  1769. // if (minHp == 0) {
  1770. // fiids = [fiid];
  1771. // minHp = fHp;
  1772. // } else {
  1773. // if (minHp > fHp) {
  1774. // minHp = fHp;
  1775. // fiids = [fiid];
  1776. // }
  1777. // }
  1778. // }
  1779. // break;
  1780. // case 17: //17 我方主角
  1781. // if (iqz.toString().length > 3) {
  1782. // fiids = ["1000"];
  1783. // } else {
  1784. // fiids = ["100"];
  1785. // }
  1786. // break;
  1787. // case 18: //18己方全体弟子
  1788. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1789. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1790. // let fHp = this.skbuff_get(fiid, "hp");
  1791. // if (this.teams[fiid] == null || fHp <= 0) {
  1792. // continue;
  1793. // }
  1794. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1795. // continue; //隐藏
  1796. // }
  1797. // fiids.push(fiid);
  1798. // }
  1799. // break;
  1800. // case 19: // 19 上次我攻击的对象
  1801. // if (this.uuids[iid].ipks[this.zhen] != null) {
  1802. // fiids = this.uuids[iid].ipks[this.zhen];
  1803. // } else {
  1804. // fiids = [];
  1805. // }
  1806. // break;
  1807. // case 20: // 20 随机己方x个弟子
  1808. // let cqlist20: string[] = [];
  1809. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1810. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1811. // let fHp = this.skbuff_get(fiid, "hp");
  1812. // if (this.teams[fiid] == null || fHp <= 0) {
  1813. // continue;
  1814. // }
  1815. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1816. // continue; //隐藏
  1817. // }
  1818. // cqlist20.push(fiid);
  1819. // }
  1820. // fiids = this.seedRand.getRandArr(cqlist20, Math.min(cqlist20.length, targetType));
  1821. // break;
  1822. // case 21: // 21 敌方主角
  1823. // if (iqz.toString().length > 3) {
  1824. // fiids = ["100"];
  1825. // } else {
  1826. // fiids = ["1000"];
  1827. // }
  1828. // break;
  1829. // case 22: // 22 敌方异常状态敌人
  1830. // let cqlist22: string[] = [];
  1831. // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
  1832. // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
  1833. // let fHp = this.skbuff_get(fiid, "hp");
  1834. // if (this.teams[fiid] == null || fHp <= 0) {
  1835. // continue;
  1836. // }
  1837. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1838. // continue; //隐藏
  1839. // }
  1840. // let buffs = ["effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_7"];
  1841. // for (let index = 0; index < buffs.length; index++) {
  1842. // let buff = buffs[index];
  1843. // if (this.skbuff_get(fiid, buff, 2) > 0) {
  1844. // cqlist22.push(fiid);
  1845. // break;
  1846. // }
  1847. // }
  1848. // }
  1849. // fiids = this.seedRand.getRandArr(cqlist22, Math.min(cqlist22.length, targetType));
  1850. // break;
  1851. // case 23: // 23 攻击最近目标
  1852. // let cqlist23: string[] = [];
  1853. // for (let k = 0; k < mblist[mubiao.toString()][yu].length; k++) {
  1854. // let fiid = (fqz + mblist[mubiao.toString()][yu][k]).toString();
  1855. // let fHp = this.skbuff_get(fiid, "hp");
  1856. // if (this.teams[fiid] == null || fHp <= 0) {
  1857. // continue;
  1858. // }
  1859. // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
  1860. // continue; //隐藏
  1861. // }
  1862. // cqlist23.push(fiid);
  1863. // if (cqlist23.length == targetType) {
  1864. // break;
  1865. // }
  1866. // }
  1867. // fiids = cqlist23;
  1868. // break;
  1869. // }
  1870. // for (let i = 0; i < fiids.length; i++) {
  1871. // if (this.oneFiids[iid][key].length >= targetType) {
  1872. // continue;
  1873. // }
  1874. // if (this.oneFiids[iid][key].includes(fiids[i])) {
  1875. // continue;
  1876. // }
  1877. // this.oneFiids[iid][key].push(fiids[i]);
  1878. // }
  1879. // }
  1880. // }
  1881. // /**
  1882. // * 辅助函数 - 获取对手
  1883. // * @param key 标识key
  1884. // * @param iid 出手方
  1885. // * @param distance 范围大小(半径)
  1886. // */
  1887. // private find_jianse_fiid(fiid: string, distance: number): string[] {
  1888. // if (gameMethod.isEmpty(distance) == true) {
  1889. // return [];
  1890. // }
  1891. // let fiids: string[] = [];
  1892. // //是不是范围触发
  1893. // let fwlist: { [wxid: string]: { [fw: string]: number[] } } = {
  1894. // 1: { 1: [2, 4, 5, 13, 15], 2: [3, 6, 7, 8, 9, 17], 3: [14, 16, 18, 0] },
  1895. // 2: { 1: [1, 3, 4, 5, 6], 2: [7, 8, 9, 14, 16, 18, 13, 15, 17], 3: [0] },
  1896. // 3: { 1: [2, 5, 6, 14, 16], 2: [1, 4, 7, 8, 9, 18], 3: [13, 15, 17, 0] },
  1897. // 4: { 1: [1, 2, 5, 7, 8, 13, 15, 17], 2: [3, 6, 9, 0], 3: [14, 16, 18] },
  1898. // 5: { 1: [1, 2, 3, 4, 6, 7, 8, 9], 2: [13, 15, 17, 14, 16, 18, 0] },
  1899. // 6: { 1: [2, 3, 5, 8, 9, 14, 16, 18], 2: [1, 4, 7, 0], 3: [13, 15, 17] },
  1900. // 7: { 1: [4, 5, 8, 0, 15, 17], 2: [1, 2, 3, 6, 9, 13], 3: [14, 16, 18] },
  1901. // 8: { 1: [0, 4, 5, 6, 7, 9], 2: [1, 2, 3, 14, 16, 18, 13, 15, 17] },
  1902. // 9: { 1: [0, 5, 6, 8, 16, 18], 2: [1, 2, 3, 4, 7, 14], 3: [13, 15, 17] },
  1903. // 0: { 1: [7, 8, 9], 2: [4, 5, 6, 15, 16, 17, 18], 3: [1, 2, 3, 13, 14] },
  1904. // };
  1905. // let wxid = Number(fiid) % 100;
  1906. // let qz: string = "10"; //前缀
  1907. // if (fiid.length == 4) {
  1908. // qz = "100";
  1909. // }
  1910. // for (let index = 1; index <= Math.floor(distance / 100); index++) {
  1911. // if (fwlist[wxid] == null || fwlist[wxid][index] == null) {
  1912. // continue;
  1913. // }
  1914. // for (let k = 0; k < fwlist[wxid][index].length; k++) {
  1915. // if (this.teams[qz + fwlist[wxid][index][k]] == null) {
  1916. // continue;
  1917. // }
  1918. // if (this.teams[qz + fwlist[wxid][index][k]].eps.hp <= 0) {
  1919. // continue;
  1920. // }
  1921. // if (fiids.includes(qz + fwlist[wxid][index][k])) {
  1922. // continue;
  1923. // }
  1924. // if (!gameMethod.isEmpty(this.teams[qz + fwlist[wxid][index][k]].isHide)) {
  1925. // continue; // 隐藏
  1926. // }
  1927. // fiids.push(qz + fwlist[wxid][index][k]);
  1928. // }
  1929. // }
  1930. // return fiids;
  1931. // }
  1932. // /**
  1933. // * 结算各种伤害
  1934. // * @param iid 攻击方
  1935. // * @param fiid 被攻击方
  1936. // * @param a 伤害系数
  1937. // * @param skid 触发技能
  1938. // */
  1939. // private js_hits(iid: string, fiid: string, a: number, skid: string) {
  1940. // //兽灵攻击
  1941. // if (this.teams[iid].type == 3 || Number(iid) % 100 == 10) {
  1942. // let mzid: number = 100;
  1943. // let fzid: number = 1000;
  1944. // if (iid.length > 3) {
  1945. // mzid = 1000;
  1946. // fzid = 100;
  1947. // }
  1948. // let i_z_atk = this.skbuff_get(mzid.toString(), "atk");
  1949. // let i_z_qhshouling = this.skbuff_get(mzid.toString(), "qhshouling");
  1950. // let f_z_rhshouling = this.skbuff_get(fzid.toString(), "rhshouling");
  1951. // let slhit = ((i_z_atk * a) / 10000) * Math.max(1, 1 + (i_z_qhshouling - f_z_rhshouling) / 10000);
  1952. // //输出伤害fjsRate
  1953. // if (this.oneHit[iid] == null) {
  1954. // this.oneHit[iid] = {};
  1955. // }
  1956. // this.oneHit[iid][fiid] = {
  1957. // pghit: Math.floor(slhit), //普攻伤害
  1958. // skhit: Math.floor(slhit), //技能伤害
  1959. // bjhit: 0, //暴击伤害
  1960. // gdhit: 0, //格挡伤害
  1961. // fjhit: 0, //反击伤害
  1962. // ljhit: 0, //连击伤害
  1963. // jshit: 0, //溅射伤害(没有折损比例系数)
  1964. // xxhit: 0, //吸血值
  1965. // xxRate: 0, //吸血值
  1966. // jsRate: 0, //吸血值
  1967. // fjsRate: 0, //吸血值
  1968. // };
  1969. // return;
  1970. // }
  1971. // //伤害公式:我方攻击>敌方防御 如果这个条件成立,普攻伤害走下面公式
  1972. // //普通伤害=max((我方攻击-敌方防御)*(1+我方伤害增强-敌方伤害减弱),我方攻击*0.15)*RANDBETWEEN(0.97,1.03)
  1973. // //否则
  1974. // //普通伤害=max(0,0.85*pow(我方攻击,0.8))
  1975. // let i_atk: number = this.skbuff_get(iid, "atk");
  1976. // let f_def: number = this.skbuff_get(fiid, "def");
  1977. // let base_hit: number = 0; //普通伤害
  1978. // if (i_atk > f_def) {
  1979. // let i_zengshang: number = this.skbuff_get(iid, "zengshang");
  1980. // let f_jianshang: number = this.skbuff_get(fiid, "jianshang");
  1981. // base_hit = (Math.max(((i_atk - f_def) * (10000 + i_zengshang - f_jianshang)) / 10000, i_atk * 0.15) * this.seedRand.rand(97, 103)) / 100;
  1982. // } else {
  1983. // base_hit = Math.max(0, 0.85 * Math.pow(i_atk, 0.8));
  1984. // }
  1985. // let i_a = this.skbuff_get(iid, "a"); //效果加成
  1986. // let i_75 = this.skbuff_get(iid, "i_75"); //效果加成
  1987. // if (i_75 != 0) {
  1988. // // 一次加成的效果 用完清空
  1989. // this.skbuff_sub_all(iid, "effect_i_75");
  1990. // }
  1991. // // let f_a = this.skbuff_get(fiid,"i_30") //伤害加深
  1992. // //对最终伤害有概率造成N倍伤害
  1993. // let i_a_per = this.skbuff_get(iid, "a_per"); //效果加成
  1994. // if (i_a_per != 0) {
  1995. // // 一次加成的效果 用完清空
  1996. // this.skbuff_sub_all(iid, "effect_i_67");
  1997. // }
  1998. // i_a_per = i_a_per ? i_a_per : 1;
  1999. // let i_sk_a = this.skbuff_get(iid, "sk_a"); //技能伤害加成
  2000. // //普功伤害
  2001. // let pg_hit = (base_hit * (a + i_a + i_75) * i_a_per) / 10000;
  2002. // //技能伤害=普通伤害 *(0+技能系数)
  2003. // let sk_hit: number = (base_hit * (a + i_a + i_75 + i_sk_a) * i_a_per) / 10000;
  2004. // //普通攻击 + 额外伤害
  2005. // let cfgSk = Gamecfg.skillBase.getItem(skid, "1");
  2006. // let zzhit = pg_hit; //最终伤害
  2007. // if (cfgSk != null && cfgSk.skillType == 3) {
  2008. // zzhit = sk_hit;
  2009. // }
  2010. // //暴击伤害= 技能伤害*max(我方强化暴伤-敌方忽视暴伤,1)
  2011. // let i_baonue: number = this.skbuff_get(iid, "baonue");
  2012. // let f_renai: number = this.skbuff_get(fiid, "renai");
  2013. // let bj_hit: number = zzhit * Math.max(1, (i_baonue - f_renai) / 10000);
  2014. // //格挡伤害= MIN(技能伤害*(MAX(敌方格挡增强-我方格挡减弱,0.12)),技能伤害*0.9)
  2015. // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
  2016. // let i_rhblock: number = this.skbuff_get(iid, "rhblock");
  2017. // let gd_hit: number = Math.min(zzhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), zzhit * 0.9);
  2018. // //反击伤害= MIN(技能伤害*MAX(敌方反击增强-我方反击减弱,1),我方生命*0.85)
  2019. // let f_qhfanji: number = this.skbuff_get(fiid, "qhfanji");
  2020. // let i_rhfanji: number = this.skbuff_get(iid, "rhfanji");
  2021. // let i_hp: number = this.skbuff_get(iid, "hp");
  2022. // let fj_hit: number = Math.min(zzhit * Math.max(1, (f_qhfanji - i_rhfanji) / 10000), i_hp * 0.9);
  2023. // //连击伤害 = 技能伤害*MAX(我方连击增强-敌方连击减弱,1)
  2024. // let i_qhlianji: number = this.skbuff_get(iid, "qhlianji");
  2025. // let f_rhlianji: number = this.skbuff_get(fiid, "rhlianji");
  2026. // let lj_hit: number = zzhit * Math.max((i_qhlianji - f_rhlianji) / 10000 + 1, 1);
  2027. // //溅射伤害= 最终伤害*折损比例系数*MAX(我方溅射增强-敌方溅射减弱,0.12)
  2028. // //折损比例系数 这个这边不计算
  2029. // let i_jianshe: number = this.skbuff_get(iid, "jianshe");
  2030. // let f_hsjianshe: number = this.skbuff_get(fiid, "hsjianshe");
  2031. // let bdjianshe: number = 0; //保底吸血
  2032. // let cfgjs = Gamecfg.userEp.getItem("jianshe");
  2033. // if (cfgjs != null) {
  2034. // bdjianshe = cfgjs.initEp;
  2035. // }
  2036. // let jsRate: number = Math.max(i_jianshe - f_hsjianshe, bdjianshe);
  2037. // let fjsRate: number = Math.max(f_hsjianshe - i_jianshe, bdjianshe);
  2038. // let i_qhjianshe: number = this.skbuff_get(iid, "qhjianshe");
  2039. // let f_rhjianshe: number = this.skbuff_get(fiid, "rhjianshe");
  2040. // let js_hit: number = zzhit * Math.max((i_qhjianshe - f_rhjianshe) / 10000, 0.12);
  2041. // //吸血率=max((我方吸血-敌方抗吸血),吸血保底参数)
  2042. // //吸血值= 最终伤害值*max(我方吸血增强-敌方吸血减弱,1)*吸血率
  2043. // let i_xixue: number = this.skbuff_get(iid, "xixue");
  2044. // let f_hsxixue: number = this.skbuff_get(fiid, "hsxixue");
  2045. // let bdxixue: number = 0; //保底吸血
  2046. // let cfg = Gamecfg.userEp.getItem("xixue");
  2047. // if (cfg != null) {
  2048. // bdxixue = cfg.initEp;
  2049. // }
  2050. // let xxRate: number = Math.max(i_xixue - f_hsxixue, bdxixue);
  2051. // let i_qhxixue: number = this.skbuff_get(iid, "qhxixue");
  2052. // let f_rhxixue: number = this.skbuff_get(fiid, "rhxixue");
  2053. // let xx_hit: number = (zzhit * Math.max((i_qhxixue - f_rhxixue) / 10000 + 1, 1) * xxRate) / 10000;
  2054. // if (this.oneHit[iid] == null) {
  2055. // this.oneHit[iid] = {};
  2056. // }
  2057. // if (cfgSk != null && cfgSk.skillType == 1) {
  2058. // //指计算普攻
  2059. // let pg_hit_per: number = 0;
  2060. // //普攻施加buff
  2061. // let i_19_a = this.skbuff_get(iid, "i_19_a");
  2062. // let i_19_i = this.skbuff_get(iid, "i_19_i");
  2063. // if (i_19_a > 0 && i_19_i > 0) {
  2064. // let ef_i_19_i = this.skbuff_get(iid, "effect_i_" + i_19_i, 2);
  2065. // pg_hit_per += i_19_a * ef_i_19_i;
  2066. // }
  2067. // let i_39_a = this.skbuff_get(iid, "i_39_a");
  2068. // pg_hit_per += i_39_a;
  2069. // pg_hit += (pg_hit_per / 10000) * pg_hit;
  2070. // }
  2071. // //输出伤害
  2072. // this.oneHit[iid][fiid] = {
  2073. // pghit: Math.floor(pg_hit), //普攻伤害
  2074. // skhit: Math.floor(sk_hit), //技能伤害
  2075. // bjhit: Math.floor(bj_hit), //暴击伤害
  2076. // gdhit: Math.floor(gd_hit), //格挡伤害
  2077. // fjhit: Math.floor(fj_hit), //反击伤害
  2078. // ljhit: Math.floor(lj_hit), //连击伤害
  2079. // jshit: Math.floor(js_hit), //溅射伤害(没有折损比例系数)
  2080. // xxhit: Math.floor(xx_hit), //吸血值
  2081. // xxRate: xxRate, //吸血概率
  2082. // jsRate: jsRate, //溅射概率
  2083. // fjsRate: fjsRate, //反击溅射概率
  2084. // };
  2085. // //伤害加深
  2086. // if (this.skbuff_get(iid, "effect_i_53", 2) > 0) {
  2087. // let hit53 = this.skbuff_get(iid, "i_53");
  2088. // this.oneHit[iid][fiid] = {
  2089. // pghit: hit53, //普攻伤害
  2090. // skhit: hit53, //技能伤害
  2091. // bjhit: hit53, //暴击伤害
  2092. // gdhit: Math.floor(gd_hit), //格挡伤害
  2093. // fjhit: Math.floor(fj_hit), //反击伤害
  2094. // ljhit: hit53, //连击伤害
  2095. // jshit: hit53, //溅射伤害(没有折损比例系数)
  2096. // xxhit: Math.floor(xx_hit), //吸血值
  2097. // xxRate: xxRate, //吸血概率
  2098. // jsRate: jsRate, //溅射概率
  2099. // fjsRate: fjsRate, //反击溅射概率
  2100. // };
  2101. // }
  2102. // if (Number(iid) % 100 < 10 && Number(iid) % 100 > 0 && this.skbuff_get(iid, "effect_i_64", 2) > 0) {
  2103. // // 是弟子 首次增伤
  2104. // let i_64_a = this.skbuff_get(iid, "i_64_a");
  2105. // let i_64_nZhen = this.skbuff_get(iid, "i_64_nZhen");
  2106. // if (i_64_a > 0 && i_64_nZhen <= this.zhen) {
  2107. // // 只加一次
  2108. // this.skbuff_sub_all(iid, "effect_i_64");
  2109. // this.oneHit[iid][fiid].skhit = Math.floor(this.oneHit[iid][fiid].skhit * (i_64_a / 10000 + 1));
  2110. // this.oneHit[iid][fiid].pghit = Math.floor(this.oneHit[iid][fiid].pghit * (i_64_a / 10000 + 1));
  2111. // }
  2112. // }
  2113. // }
  2114. // private sk_base2(iid: string, runStatus: number, cs: { [key: string]: number } = {}) {
  2115. // let type = Number(iid) % 100 == 0 ? 1 : Number(iid) % 100 > 0 && Number(iid) % 100 < 10 ? 2 : 3;
  2116. // if (this.objects[iid.length] == null || this.objects[iid.length][type] == null) {
  2117. // return;
  2118. // }
  2119. // let cf_sk: { [skillType: string]: [string, { [key: string]: number }, number][] } = {}; //当前要触发的技能库
  2120. // let skids: string[] = Object.keys(this.objects[iid.length][type]);
  2121. // for (let index = skids.length - 1; index >= 0; index--) {
  2122. // let skid = skids[index];
  2123. // let sklv = this.objects[iid.length][type][skid].sklv;
  2124. // let sklvCd = 100;
  2125. // let cfgSk = Gamecfg.skillBase.getItem(skid, sklv.toString());
  2126. // if (cfgSk == null) {
  2127. // continue; //没有这个技能 或者 这个技能的触发时机不对
  2128. // }
  2129. // if (cfgSk.runStatus != runStatus) {
  2130. // continue; //没有这个技能 或者 这个技能的触发时机不对
  2131. // }
  2132. // if (cfgSk.runStatus === 4 && !cfgSk.cd && this.zhen != 1) {
  2133. // // 没有cd的 runStatus=4的只在战斗开始时加一次
  2134. // continue;
  2135. // }
  2136. // //受到攻击后触发
  2137. // if (cfgSk.runStatus == 2) {
  2138. // //被打次数
  2139. // let bdcons = this.uuids[iid].fcons[0] + this.uuids[iid].fcons[1] + this.uuids[iid].fcons[2];
  2140. // if (bdcons == 0) {
  2141. // continue; //还没被打
  2142. // }
  2143. // if (gameMethod.isEmpty(cfgSk.hitNumber) == false && bdcons % cfgSk.hitNumber > 0) {
  2144. // continue; //未累计到次数
  2145. // }
  2146. // }
  2147. // let eff_i_3 = this.skbuff_get(iid, "effect_i_3", 2);
  2148. // if (eff_i_3 > 0) {
  2149. // continue; //晕眩
  2150. // }
  2151. // let eff_i_5 = this.skbuff_get(iid, "effect_i_5", 2);
  2152. // if (eff_i_5 > 0) {
  2153. // continue; //晕眩
  2154. // }
  2155. // let eff_i_6 = this.skbuff_get(iid, "effect_i_6", 2);
  2156. // if (eff_i_6 > 0) {
  2157. // continue; //击退
  2158. // }
  2159. // let eff_i_16 = this.skbuff_get(iid, "effect_i_16", 2);
  2160. // if (eff_i_16 > 0) {
  2161. // continue; //入定状态
  2162. // }
  2163. // //(1普攻,2 被动,3技能)
  2164. // if (cfgSk.skillType != 1) {
  2165. // let eff_i_1 = this.skbuff_get(iid, "effect_i_1", 2);
  2166. // if (eff_i_1 > 0) {
  2167. // //沉默
  2168. // continue;
  2169. // }
  2170. // }
  2171. // //初始化技能
  2172. // if (this.uuids[iid].skbase[skid] == null) {
  2173. // this.uuids[iid].skbase[skid] = {
  2174. // last: 0, //最后一次出手帧
  2175. // count: 0,
  2176. // action: {},
  2177. // effect: {},
  2178. // };
  2179. // }
  2180. // //技能cd
  2181. // let cs2:{[key:string]:number} = gameMethod.objCopy(cs)
  2182. // cs2["cd"] = gameMethod.isEmpty(cfgSk.cd) ? 0 : cfgSk.cd * 30;
  2183. // cs2["cd2"] = gameMethod.isEmpty(cfgSk.cd2) ? 0 : (parseInt(iid) % 100 == 10 ? (cfgSk.cd2 * 30 * sklvCd) / 100 : cfgSk.cd2 * 30);
  2184. // if (this.uuids[iid].skbase[skid].last + cs["cd"] > this.zhen) {
  2185. // continue; //冷却时间还没到
  2186. // }
  2187. // //次数判定
  2188. // if (gameMethod.isEmpty(cfgSk.count) == false && this.uuids[iid].skbase[skid].count >= cfgSk.count) {
  2189. // continue; //没有次数了
  2190. // }
  2191. // if (gameMethod.isEmpty(cfgSk.chance) == false && this.seedRand.rand(1, 10000) > cfgSk.chance * 10000) {
  2192. // continue; //没有触发这个技能
  2193. // }
  2194. // if (cfgSk.skillType == 2) {
  2195. // //被动
  2196. // } else if (cfgSk.skillType == 3) {
  2197. // //特殊技能
  2198. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.atk);
  2199. // this.addOneAtk(iid, iid, "aSkid", skid);
  2200. // }
  2201. // //先找出触发的技能ID
  2202. // if (cf_sk[cfgSk.skillType] == null) {
  2203. // cf_sk[cfgSk.skillType] = [];
  2204. // }
  2205. // cf_sk[cfgSk.skillType].push([skid, cs2, sklv]);
  2206. // }
  2207. // return cf_sk;
  2208. // }
  2209. // private sk_baseObjRun4(iid: string) {
  2210. // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
  2211. // return; //隐藏
  2212. // }
  2213. // let skids: string[] = Object.keys(this.teams[iid].sk);
  2214. // let type = Number(iid) % 100 == 0 ? 1 : Number(iid) % 100 > 0 && Number(iid) % 100 < 10 ? 2 : 3;
  2215. // for (let index = skids.length - 1; index >= 0; index--) {
  2216. // let skid = skids[index];
  2217. // let sklv = this.teams[iid].sk[skid][0];
  2218. // let cfgSk = Gamecfg.skillBase.getItem(skid, sklv.toString());
  2219. // if (cfgSk && cfgSk.object && type != cfgSk.object) {
  2220. // // 非给自己加的技能 在战斗前初始化
  2221. // if (this.objects[iid.length] == null) {
  2222. // this.objects[iid.length] = {};
  2223. // }
  2224. // if (this.objects[iid.length][cfgSk.object] == null) {
  2225. // this.objects[iid.length][cfgSk.object] = {};
  2226. // }
  2227. // if (this.objects[iid.length][cfgSk.object][cfgSk.id] == null) {
  2228. // this.objects[iid.length][cfgSk.object][cfgSk.id] = {
  2229. // cd: cfgSk.cd ? cfgSk.cd : 0,
  2230. // sklv: sklv,
  2231. // iids: {},
  2232. // };
  2233. // }
  2234. // }
  2235. // }
  2236. // }
  2237. // /**
  2238. // * 辅助函数 - 技能触发
  2239. // * @param iid 触发者
  2240. // * @param runStatus 技能触发时机
  2241. // * 1:攻击时造成伤害
  2242. // * 2:受到攻击时
  2243. // * 3:灵力满怒时释放
  2244. // * 4:进入战斗后,还没攻击前
  2245. // * 5:进入战斗后,x秒内
  2246. // * 6:攻击时造成伤害,并且目标成功格挡(注意和1类型是不同的)
  2247. // * 7.反击时
  2248. // * 8.自身格挡时。和6类型不同,6类型是敌方格挡
  2249. // *
  2250. // */
  2251. // private sk_base(iid: string, runStatus: number, cs: { [key: string]: number } = {}) {
  2252. // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
  2253. // return false; //隐藏
  2254. // }
  2255. // let skids: string[] = Object.keys(this.teams[iid].sk);
  2256. // let type = Number(iid) % 100 == 0 ? 1 : Number(iid) % 100 > 0 && Number(iid) % 100 < 10 ? 2 : 3;
  2257. // let cf_sk: { [skillType: string]: [string, { [key: string]: number }, number][] } = {}; //当前要触发的技能库
  2258. // for (let index = skids.length - 1; index >= 0; index--) {
  2259. // let skid = skids[index];
  2260. // let sklv = this.teams[iid].sk[skid][0];
  2261. // let sklvCd = this.teams[iid].sk[skid][1];
  2262. // let cfgSk = Gamecfg.skillBase.getItem(skid, sklv.toString());
  2263. // if (cfgSk == null) {
  2264. // continue; //没有这个技能 或者 这个技能的触发时机不对
  2265. // }
  2266. // if (cfgSk.object && type != cfgSk.object) {
  2267. // // 不是加给自己的技能
  2268. // continue;
  2269. // } else if (cfgSk.runStatus != runStatus) {
  2270. // continue; //没有这个技能 或者 这个技能的触发时机不对
  2271. // }
  2272. // //受到攻击后触发
  2273. // if (cfgSk.runStatus == 2) {
  2274. // //被打次数
  2275. // let bdcons = this.uuids[iid].fcons[0] + this.uuids[iid].fcons[1] + this.uuids[iid].fcons[2];
  2276. // if (bdcons == 0) {
  2277. // continue; //还没被打
  2278. // }
  2279. // if (gameMethod.isEmpty(cfgSk.hitNumber) == false && bdcons % cfgSk.hitNumber > 0) {
  2280. // continue; //未累计到次数
  2281. // }
  2282. // }
  2283. // let eff_i_3 = this.skbuff_get(iid, "effect_i_3", 2);
  2284. // if (eff_i_3 > 0) {
  2285. // continue; //晕眩
  2286. // }
  2287. // let eff_i_5 = this.skbuff_get(iid, "effect_i_5", 2);
  2288. // if (eff_i_5 > 0) {
  2289. // continue; //晕眩
  2290. // }
  2291. // let eff_i_6 = this.skbuff_get(iid, "effect_i_6", 2);
  2292. // if (eff_i_6 > 0) {
  2293. // continue; //击退
  2294. // }
  2295. // let eff_i_16 = this.skbuff_get(iid, "effect_i_16", 2);
  2296. // if (eff_i_16 > 0) {
  2297. // continue; //入定状态
  2298. // }
  2299. // //(1普攻,2 被动,3技能)
  2300. // if (cfgSk.skillType != 1) {
  2301. // let eff_i_1 = this.skbuff_get(iid, "effect_i_1", 2);
  2302. // if (eff_i_1 > 0) {
  2303. // //沉默
  2304. // continue;
  2305. // }
  2306. // }
  2307. // //初始化技能
  2308. // if (this.uuids[iid].skbase[skid] == null) {
  2309. // this.uuids[iid].skbase[skid] = {
  2310. // last: 0, //最后一次出手帧
  2311. // count: 0,
  2312. // action: {},
  2313. // effect: {},
  2314. // };
  2315. // }
  2316. // //技能cd
  2317. // let cs2:{[key:string]:number} = gameMethod.objCopy(cs)
  2318. // cs2["cd"] = gameMethod.isEmpty(cfgSk.cd) ? 0 : (parseInt(iid) % 100 == 10 ? (cfgSk.cd * 30 * sklvCd) / 100 : cfgSk.cd * 30);
  2319. // cs2["cd2"] = gameMethod.isEmpty(cfgSk.cd2) ? 0 : (parseInt(iid) % 100 == 10 ? (cfgSk.cd2 * 30 * sklvCd) / 100 : cfgSk.cd2 * 30);
  2320. // if (this.uuids[iid].skbase[skid].last + cs2["cd"] > this.zhen) {
  2321. // continue; //冷却时间还没到
  2322. // }
  2323. // //次数判定
  2324. // if (gameMethod.isEmpty(cfgSk.count) == false && this.uuids[iid].skbase[skid].count >= cfgSk.count) {
  2325. // continue; //没有次数了
  2326. // }
  2327. // if (gameMethod.isEmpty(cfgSk.chance) == false && this.seedRand.rand(1, 10000) > cfgSk.chance * 10000) {
  2328. // continue; //没有触发这个技能
  2329. // }
  2330. // if (cfgSk.skillType == 2) {
  2331. // //被动
  2332. // } else if (cfgSk.skillType == 3) {
  2333. // //特殊技能
  2334. // this.sk_base(iid, 5, cs2);
  2335. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.atk);
  2336. // this.addOneAtk(iid, iid, "aSkid", skid);
  2337. // }
  2338. // //先找出触发的技能ID
  2339. // if (cf_sk[cfgSk.skillType] == null) {
  2340. // cf_sk[cfgSk.skillType] = [];
  2341. // }
  2342. // cf_sk[cfgSk.skillType].push([skid, cs2, sklv]);
  2343. // }
  2344. // // 获取共享技能
  2345. // let cf_sk2 = this.sk_base2(iid, runStatus, cs);
  2346. // if (cf_sk2 != null) {
  2347. // let keys = Object.keys(cf_sk2);
  2348. // for (let i = 0; i < keys.length; i++) {
  2349. // let keys2 = Object.keys(cf_sk2[keys[i]]);
  2350. // for (let k = 0; k < keys2.length; k++) {
  2351. // if (cf_sk[keys[i]] == null) {
  2352. // cf_sk[keys[i]] = [];
  2353. // }
  2354. // cf_sk[keys[i]].push(cf_sk2[keys[i]][k]);
  2355. // }
  2356. // }
  2357. // }
  2358. // //触发的技能列表
  2359. // let cfids: [string, { [key: string]: number }, number][] = [];
  2360. // if (cf_sk[3] != null) {
  2361. // //只要触发高级技能 就不触发普通攻击技能
  2362. // cfids = gameMethod.addArr(cfids, cf_sk[3]);
  2363. // } else if (cf_sk[1] != null) {
  2364. // cfids = gameMethod.addArr(cfids, cf_sk[1]);
  2365. // }
  2366. // if (cf_sk[2] != null) {
  2367. // //被动技能
  2368. // cfids = gameMethod.addArr(cfids, cf_sk[2]);
  2369. // }
  2370. // if (cfids.length <= 0) {
  2371. // return false;
  2372. // }
  2373. // // 这里才是真正出手了的地方
  2374. // if (runStatus != 4 && runStatus != 2 && runStatus != 7 && runStatus != 8) {
  2375. // // 战斗前触发的特性/被动 不算
  2376. // this.uuids[iid].last = this.zhen;
  2377. // }
  2378. // let values = Object.values(cfids);
  2379. // for (let i = 0; i < values.length; i++) {
  2380. // if (values[i][1]["do_iid"] == null) {
  2381. // values[i][1]["do_iid"] = Number(iid);
  2382. // }
  2383. // let cs2 = values[i][1]
  2384. // if (cs2["hit"] != null) {
  2385. // values[i][1]["hit"] = cs2["hit"];
  2386. // }
  2387. // let skid = values[i][0];
  2388. // let sklv = values[i][2];
  2389. // let cfgSk = Gamecfg.skillBase.getItem(values[i][0], sklv.toString());
  2390. // if (cfgSk == null) {
  2391. // continue; //没有这个技能 或者 这个技能的触发时机不对
  2392. // }
  2393. // if (cfgSk.type == "3"){
  2394. // // 术法触发
  2395. // this.addOneAtk(iid, iid, "effect", ["shufa",skid]);
  2396. // }
  2397. // this.uuids[iid].skbase[skid].last = this.zhen + (cs2["cd2"]>0&&cs2["cd"]==0?cs2["cd2"]:0);
  2398. // this.uuids[iid].skbase[skid].count += 1;
  2399. // if (cfgSk.sequence == 2) {
  2400. // //效果列表
  2401. // if (gameMethod.isEmpty(cfgSk.effect) == false) {
  2402. // let lastId = "";
  2403. // for (let k = 0; k < cfgSk.effect.length; k++) {
  2404. // this.sk_effect(iid, values[i][0], cfgSk.effect[k].toString(), lastId, values[i][1]);
  2405. // lastId = "effect_id_" + cfgSk.effect[k];
  2406. // }
  2407. // }
  2408. // //行为列表
  2409. // if (gameMethod.isEmpty(cfgSk.actions) == false) {
  2410. // let lastId = "";
  2411. // for (let index = 0; index < cfgSk.actions.length; index++) {
  2412. // let acId = cfgSk.actions[index];
  2413. // this.sk_action(iid, values[i][0], acId.toString(), lastId);
  2414. // lastId = "action_id_" + acId;
  2415. // }
  2416. // }
  2417. // } else {
  2418. // //行为列表
  2419. // if (gameMethod.isEmpty(cfgSk.actions) == false) {
  2420. // let lastId = "";
  2421. // for (let index = 0; index < cfgSk.actions.length; index++) {
  2422. // let acId = cfgSk.actions[index];
  2423. // this.sk_action(iid, values[i][0], acId.toString(), lastId);
  2424. // lastId = "action_id_" + acId;
  2425. // }
  2426. // }
  2427. // //效果列表
  2428. // if (gameMethod.isEmpty(cfgSk.effect) == false) {
  2429. // let lastId = "";
  2430. // for (let k = 0; k < cfgSk.effect.length; k++) {
  2431. // this.sk_effect(iid, values[i][0], cfgSk.effect[k].toString(), lastId, values[i][1]);
  2432. // lastId = "effect_id_" + cfgSk.effect[k];
  2433. // }
  2434. // }
  2435. // }
  2436. // }
  2437. // return true;
  2438. // }
  2439. // /**
  2440. // * 辅助函数 - 技能行为
  2441. // * @param iid 触发者
  2442. // * @param runStatus 技能触发时机
  2443. // * 1:攻击时造成伤害
  2444. // * 2:受到攻击时
  2445. // * 3:灵力满怒时释放
  2446. // * 4:进入战斗后,还没攻击前
  2447. // */
  2448. // private sk_action(iid: string, skid: string, acId: string, extend: string = "") {
  2449. // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
  2450. // return; //隐藏
  2451. // }
  2452. // let cfgAc = Gamecfg.skillAction.getItem(acId);
  2453. // if (cfgAc == null) {
  2454. // return;
  2455. // }
  2456. // if (this.oneFiids[iid] == null) {
  2457. // this.oneFiids[iid] = {};
  2458. // }
  2459. // let ac_ttype = "action_id_" + acId; //对手标识
  2460. // //继承上一次的目标
  2461. // if (extend != "") {
  2462. // //这里可以先继承
  2463. // this.oneFiids[iid][ac_ttype] = this.oneFiids[iid][extend];
  2464. // }
  2465. // let targetType: number = 0; //目标数量
  2466. // //目标数量
  2467. // if (gameMethod.isEmpty(cfgAc.targetType) == true) {
  2468. // targetType = 10;
  2469. // } else if (gameMethod.isEmpty(cfgAc.targetType[1]) == true) {
  2470. // targetType = cfgAc.targetType[0];
  2471. // } else {
  2472. // targetType = this.seedRand.rand(cfgAc.targetType[0], cfgAc.targetType[1]);
  2473. // }
  2474. // this.find_fiids(ac_ttype, iid, cfgAc.ttype, targetType, cfgAc.distance); //选择对手
  2475. // let cs: { [key: string]: number } = { do_iid: Number(iid) };
  2476. // //造成伤害
  2477. // if (cfgAc.args["a"] != null) {
  2478. // this.timer_do(301, { do_iid: Number(iid) }); //攻击前触发
  2479. // for (let i = 0; i < this.oneFiids[iid][ac_ttype].length; i++) {
  2480. // this.js_hits(iid, this.oneFiids[iid][ac_ttype][i], cfgAc.args["a"] * 10000, skid); //计算伤害
  2481. // let cs2 = this.sk_action_type_1(iid, this.oneFiids[iid][ac_ttype][i], skid, acId);
  2482. // cs = Object.assign(cs, cs2);
  2483. // cs[this.oneFiids[iid][ac_ttype][i]] = cs2["hit"];
  2484. // }
  2485. // }
  2486. // //造成伤害 - 术法
  2487. // if (cfgAc.args["atk"] != null) {
  2488. // this.timer_do(301, { do_iid: Number(iid) }); //攻击前触发
  2489. // for (let i = 0; i < this.oneFiids[iid][ac_ttype].length; i++) {
  2490. // this.js_hits(iid, this.oneFiids[iid][ac_ttype][i], cfgAc.args["atk"], skid); //计算伤害
  2491. // let cs2 = this.sk_action_type_1(iid, this.oneFiids[iid][ac_ttype][i], skid, acId);
  2492. // cs = Object.assign(cs, cs2);
  2493. // cs[this.oneFiids[iid][ac_ttype][i]] = cs2["hit"];
  2494. // }
  2495. // }
  2496. // //触发effect
  2497. // if (cfgAc.args["id"] != null) {
  2498. // let p = 0; //buff触发概率
  2499. // if (cfgAc.args["p"] != null) {
  2500. // p = cfgAc.args["p"] * 10000; //buff触发概率
  2501. // }
  2502. // if (this.seedRand.rand(1, 10000) <= p) {
  2503. // for (let i = 0; i < cfgAc.args.id.length; i++) {
  2504. // cs["nextid"] = 1;
  2505. // this.sk_effect(iid, skid, cfgAc.args.id[i].toString(), ac_ttype, cs);
  2506. // }
  2507. // }
  2508. // }
  2509. // //有概率给我方弟子挂一个反击buff
  2510. // if (gameMethod.isEmpty(cfgAc.canbeatback) == false) {
  2511. // let p = 0; //buff触发概率
  2512. // if (cfgAc.args["p"] != null) {
  2513. // p = cfgAc.args["p"] * 10000; //buff触发概率
  2514. // }
  2515. // for (let index = 0; index < this.teamFiids.length; index++) {
  2516. // let fiid = this.teamFiids[index];
  2517. // if (this.teams[fiid].type != 2) {
  2518. // continue; //不是弟子
  2519. // }
  2520. // if (this.teams[fiid].eps.hp <= 0) {
  2521. // continue; //
  2522. // }
  2523. // if (iid.length != fiid.length) {
  2524. // continue; //不是同阵营的
  2525. // }
  2526. // if (this.seedRand.rand(1, 10000) <= p) {
  2527. // this.skbuff_add({
  2528. // fiid: fiid, //添加对象
  2529. // key: "canbeatback", //属性key
  2530. // minZhen: this.zhen, //开始帧
  2531. // maxZhen: this.zhen + 30 * 45, //结束帧
  2532. // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2533. // ceng: 1, //增加层数
  2534. // eps: {}, //属性
  2535. // });
  2536. // }
  2537. // }
  2538. // }
  2539. // }
  2540. // /**
  2541. // * 辅助函数 - 技能效果
  2542. // * @param iid 触发者
  2543. // * @param skid 技能ID
  2544. // * @param effectId 效果ID
  2545. // * @param extend 继承目标key
  2546. // */
  2547. // private sk_effect(iid: string, skid: string, effectId: string, extend: string = "", cs: { [key: string]: number } = {}) {
  2548. // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
  2549. // return; //隐藏
  2550. // }
  2551. // let cfgBase = Gamecfg.skillBase.getItem(skid, "1");
  2552. // let cfgEf = Gamecfg.skillEffect.getItem(effectId);
  2553. // if (cfgEf == null || cfgBase == null) {
  2554. // return;
  2555. // }
  2556. // //次数判定
  2557. // if (
  2558. // gameMethod.isEmpty(cfgEf.count) == false &&
  2559. // this.uuids[iid].skbase[skid] &&
  2560. // this.uuids[iid].skbase[skid].effect[effectId] &&
  2561. // this.uuids[iid].skbase[skid].effect[effectId].count >= cfgEf.count
  2562. // ) {
  2563. // return; //没有次数了
  2564. // }
  2565. // if (this.oneFiids[iid] == null) {
  2566. // this.oneFiids[iid] = {};
  2567. // }
  2568. // let ef_ttype = "effect_id_" + effectId;
  2569. // //继承上一次的目标
  2570. // if (extend != "") {
  2571. // //这里可以先继承
  2572. // this.oneFiids[iid][ef_ttype] = this.oneFiids[iid][extend];
  2573. // }
  2574. // //持续多少针
  2575. // let maxzhen: number = gameMethod.isEmpty(cfgEf.args["t"]) == false ? cfgEf.args["t"] * 30 : 45 * 30;
  2576. // //m增加层数
  2577. // let e_m: number = gameMethod.isEmpty(cfgEf.args["m"]) == false ? cfgEf.args["m"] : 1;
  2578. // //n表示层数上限
  2579. // let e_n: number = gameMethod.isEmpty(cfgEf.args["n"]) == false ? cfgEf.args["n"] : 9999;
  2580. // //1.叠加 2.不叠加替换,默认不填值就是不叠加
  2581. // let overlayType: number = gameMethod.isEmpty(cfgEf.overlayType) ? 2 : cfgEf.overlayType;
  2582. // //效果标识
  2583. // let e_i: number = gameMethod.isEmpty(cfgEf.args["i"]) == false ? cfgEf.args["i"] : 0;
  2584. // //效果标识
  2585. // let interval: number = gameMethod.isEmpty(cfgEf.interval) == false ? cfgEf.interval * 30 : 0; //效果标识
  2586. // if (this.uuids[iid].skbase[skid] == null) {
  2587. // this.uuids[iid].skbase[skid] = {
  2588. // last: 0, //最后一次出手帧
  2589. // count: 0,
  2590. // action: {},
  2591. // effect: {},
  2592. // };
  2593. // }
  2594. // if (this.uuids[iid].skbase[skid].effect[effectId] == null) {
  2595. // this.uuids[iid].skbase[skid].effect[effectId] = {
  2596. // effectZhen: 0, //触发帧
  2597. // effectEndZhen: 0, //触发结束帧
  2598. // nextcd: 0, //下一次出手时间
  2599. // count: 0,
  2600. // f: 0,
  2601. // };
  2602. // }
  2603. // //效果cd
  2604. // if (
  2605. // this.uuids[iid].skbase[skid].effect[effectId].nextcd > this.zhen &&
  2606. // (this.zhen != this.uuids[iid].skbase[skid].effect[effectId].effectZhen || (cfgEf.targetType.length == 1 && cfgEf.targetType[0] == 1)) &&
  2607. // !(this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen >= this.zhen && cs["isTimer"] == 1)
  2608. // ) {
  2609. // return;
  2610. // }
  2611. // //cs["isTimer"] = 0; // 定时器来的 不参与cd效果判定
  2612. // let ef_buff = "effect_i_" + e_i; //效果i标识
  2613. // if (gameMethod.isEmpty(cfgEf.ttype) == false && cs["isTimer"] != 1) {
  2614. // let targetType: number = 0; //目标数量
  2615. // //目标数量
  2616. // if (gameMethod.isEmpty(cfgEf.targetType) == true) {
  2617. // targetType = 10;
  2618. // } else if (gameMethod.isEmpty(cfgEf.targetType[1]) == true) {
  2619. // targetType = cfgEf.targetType[0];
  2620. // } else {
  2621. // targetType = this.seedRand.rand(cfgEf.targetType[1], cfgEf.targetType[0]);
  2622. // }
  2623. // this.find_fiids(ef_ttype, iid, cfgEf.ttype, targetType);
  2624. // }
  2625. // //buff效果
  2626. // if (this.oneFiids[iid] && this.oneFiids[iid][ef_ttype]) {
  2627. // for (let i = 0; i < this.oneFiids[iid][ef_ttype].length; i++) {
  2628. // let eff_i_m = this.skbuff_get(this.oneFiids[iid][ef_ttype][i], ef_buff, 2);
  2629. // if (eff_i_m >= e_n) {
  2630. // continue; //超过层数
  2631. // }
  2632. // e_m = Math.min(e_m, e_n - eff_i_m);
  2633. // }
  2634. // }
  2635. // //添加定时执行 - 之后在触发效果
  2636. // if (gameMethod.isEmpty(cfgEf.triggerTime) == false && this.uuids[iid].timer[ef_ttype] == null) {
  2637. // this.timer_add({
  2638. // iid: iid, //触发者
  2639. // fiids: this.oneFiids[iid][ef_ttype], //触发者
  2640. // key: ef_ttype, //定时器标识
  2641. // type: cfgEf.triggerTime ? cfgEf.triggerTime : [601], //执行触发点
  2642. // func: "sk_effect", //执行的函数名
  2643. // lzhen: interval, //轮询执行时间
  2644. // ezhen: 45 * 30,
  2645. // skid: skid, //技能ID
  2646. // aeid: effectId, //效果ID|行为ID
  2647. // cs: cs, //参数
  2648. // overlayType: overlayType,
  2649. // });
  2650. // if (cfgEf.triggerTime[0] == 301) {
  2651. // for (let i = 0; i < this.oneFiids[iid][ef_ttype].length; i++) {
  2652. // this.timer_do(301, { do_iid: Number(this.oneFiids[iid][ef_ttype][i]) });
  2653. // }
  2654. // if (gameMethod.isEmpty(cfgEf.count) == false && this.zhen != 1) {
  2655. // this.uuids[iid].skbase[skid].effect[effectId].count += 1;
  2656. // if (this.uuids[iid].skbase[skid].effect[effectId].count >= cfgEf.count) {
  2657. // if (gameMethod.isEmpty(cfgEf.cd) == false) {
  2658. // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
  2659. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  2660. // this.uuids[iid].skbase[skid].effect[effectId].count = 0;
  2661. // this.uuids[iid].timer[ef_ttype][cs["timerId"].toString()].szhen = this.zhen + cfgEf.cd * 30;
  2662. // } else {
  2663. // }
  2664. // }
  2665. // }
  2666. // if (gameMethod.isEmpty(cfgEf.cd) == false && this.zhen != 1) {
  2667. // if (this.uuids[iid].skbase[skid].effect[effectId].count == 0) {
  2668. // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
  2669. // if (cfgEf.args["t"]) {
  2670. // if (this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen < this.zhen) {
  2671. // this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen = this.zhen + cfgEf.args["t"] * 30; // buff持续增加效果结束帧
  2672. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  2673. // }
  2674. // } else {
  2675. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  2676. // }
  2677. // }
  2678. // }
  2679. // }
  2680. // return; //cd后再触发
  2681. // }
  2682. // //1.附加属性(万分比)
  2683. // if (cfgEf.type == 1) {
  2684. // for (let i = 0; i < this.oneFiids[iid][ef_ttype].length; i++) {
  2685. // let fiid = this.oneFiids[iid][ef_ttype][i];
  2686. // let cf508: number = 0;
  2687. // let eff_1_ep: { [key: string]: number } = {};
  2688. // let keys = Object.keys(cfgEf.args);
  2689. // for (let k = 0; k < keys.length; k++) {
  2690. // // 加属性 这边in没关系
  2691. // if (this.teams[fiid].eps[keys[k]] == null) {
  2692. // continue;
  2693. // }
  2694. // if (this.teams[fiid].eps[keys[k]] != null) {
  2695. // eff_1_ep[keys[k]] = cfgEf.args[keys[k]];
  2696. // if (cfgEf.args[keys[k]] < 0) {
  2697. // cf508 = 1;
  2698. // break;
  2699. // }
  2700. // }
  2701. // if (cf508 != 0) {
  2702. // break;
  2703. // }
  2704. // }
  2705. // if (overlayType === 2 || this.skbuff_get(fiid, ef_buff + "_" + effectId, 2) + e_m <= e_n) {
  2706. // this.skbuff_add({
  2707. // fiid: fiid, //添加对象
  2708. // key: ef_buff + "_" + effectId, //属性key
  2709. // minZhen: this.zhen, //开始帧
  2710. // maxZhen: this.zhen + maxzhen, //结束帧
  2711. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2712. // ceng: e_m, //增加层数
  2713. // eps: eff_1_ep, //属性
  2714. // });
  2715. // }
  2716. // this.teams[fiid].eps.hp = this.skbuff_get(fiid, "hp");
  2717. // // this.teams[fiid].eps.hp_max = this.skbuff_get(fiid, "hp_max");
  2718. // if (cf508 == 1) {
  2719. // this.timer_do(508, { do_iid: Number(fiid) });
  2720. // }
  2721. // }
  2722. // //cd
  2723. // if (this.oneFiids[iid][ef_ttype].length > 0) {
  2724. // if (gameMethod.isEmpty(cfgEf.count) == false && this.zhen != 1) {
  2725. // this.uuids[iid].skbase[skid].effect[effectId].count += 1;
  2726. // if (this.uuids[iid].skbase[skid].effect[effectId].count >= cfgEf.count) {
  2727. // if (gameMethod.isEmpty(cfgEf.cd) == false) {
  2728. // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
  2729. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  2730. // this.uuids[iid].skbase[skid].effect[effectId].count = 0;
  2731. // this.uuids[iid].timer[ef_ttype][cs["timerId"].toString()].szhen = this.zhen + cfgEf.cd * 30;
  2732. // } else {
  2733. // }
  2734. // }
  2735. // }
  2736. // if (gameMethod.isEmpty(cfgEf.cd) == false && this.zhen != 1) {
  2737. // if (this.uuids[iid].skbase[skid].effect[effectId].count == 0) {
  2738. // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
  2739. // if (cfgEf.args["t"]) {
  2740. // if (this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen < this.zhen) {
  2741. // this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen = this.zhen + cfgEf.args["t"] * 30; // buff持续增加效果结束帧
  2742. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  2743. // }
  2744. // } else {
  2745. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  2746. // }
  2747. // }
  2748. // }
  2749. // }
  2750. // }
  2751. // //2.附加状态
  2752. // if (cfgEf.type == 2) {
  2753. // this.sk_effect_type_2(skid, effectId, iid, this.oneFiids[iid][ef_ttype], cs);
  2754. // }
  2755. // }
  2756. // /**
  2757. // * 触发效果
  2758. // * @param effectId 效果ID
  2759. // * @param iid 触发者
  2760. // * @param fiids 触发对象
  2761. // * @returns
  2762. // */
  2763. // private sk_effect_type_2(skid: string, effectId: string, iid: string, fiids: string[], cs: { [key: string]: number } = {}) {
  2764. // let cfgBase = Gamecfg.skillBase.getItem(skid, "1");
  2765. // let cfgEf = Gamecfg.skillEffect.getItem(effectId);
  2766. // if (cfgEf == null || cfgEf.args["i"] == null || cfgBase == null) {
  2767. // return;
  2768. // }
  2769. // //持续多少针
  2770. // let maxzhen: number = cfgEf.args["t"] != null ? cfgEf.args["t"] * 30 : 45 * 30;
  2771. // //a填小数:每秒持续收到最终伤害的百分比
  2772. // let e_a: number = gameMethod.isEmpty(cfgEf.args["a"]) == false ? cfgEf.args["a"] * 10000 : 0;
  2773. // //m增加层数
  2774. // let e_m: number = gameMethod.isEmpty(cfgEf.args["m"]) == false ? cfgEf.args["m"] : 1;
  2775. // //n表示层数上限
  2776. // let e_n: number = gameMethod.isEmpty(cfgEf.args["n"]) == false ? cfgEf.args["n"] : 9999;
  2777. // //id引发下一个effect_ID
  2778. // let e_id: string = gameMethod.isEmpty(cfgEf.args["id"]) == false ? cfgEf.args["id"].toString() : "";
  2779. // //1.叠加 2.不叠加替换,默认不填值就是不叠加
  2780. // let overlayType: number = gameMethod.isEmpty(cfgEf.overlayType) ? 2 : cfgEf.overlayType;
  2781. // //效果标识
  2782. // let e_i: number = gameMethod.isEmpty(cfgEf.args["i"]) == false ? cfgEf.args["i"] : 0;
  2783. // let ef_ttype = "effect_id_" + effectId; //效果ID标识
  2784. // let ef_buff = "effect_i_" + e_i; //效果i标识
  2785. // let lsOne: number = 0; //临时自己只操作一次的
  2786. // let pass: boolean = true;
  2787. // for (let i = 0; i < fiids.length; i++) {
  2788. // let fiid = fiids[i];
  2789. // let eff_i_m = this.skbuff_get(fiid, ef_buff, 2);
  2790. // if (eff_i_m >= e_n) {
  2791. // continue; //超过层数
  2792. // }
  2793. // e_m = Math.min(e_m, e_n - eff_i_m);
  2794. // switch (cfgEf.args["i"]) {
  2795. // case 1: //沉默 无法释放技能(可以放普攻),不可叠加,持续4秒
  2796. // this.skbuff_add({
  2797. // fiid: fiid, //添加对象
  2798. // key: ef_buff, //属性key
  2799. // minZhen: this.zhen, //开始帧
  2800. // maxZhen: this.zhen + maxzhen, //结束帧
  2801. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2802. // ceng: e_m, //增加层数
  2803. // eps: {}, //属性
  2804. // });
  2805. // this.timer_do(508, { do_iid: Number(fiid) });
  2806. // break;
  2807. // case 2: //2 回血 按最终伤害值百分比进行回血
  2808. // if (cs["do_iid"] != Number(iid)) {
  2809. // continue;
  2810. // }
  2811. // if (cs["hit"] == null) {
  2812. // if (cfgEf.args["a"] != null) {
  2813. // if (!this.oneHit[iid]) {
  2814. // let hit_fiid = this.uuids[iid].ipk;
  2815. // this.js_hits(iid, hit_fiid, cfgEf.args["a"] * 10000, skid); //计算伤害
  2816. // let gzhit = this.oneHit[iid][hit_fiid];
  2817. // cs["hit"] = gzhit.skhit;
  2818. // } else {
  2819. // let keys = Object.keys(this.oneHit[iid]);
  2820. // for (let k = 0; k < keys.length; k++) {
  2821. // cs["hit"] = this.oneHit[iid][keys[k]].ljhit;
  2822. // }
  2823. // }
  2824. // }
  2825. // if (cs["hit"] == null) {
  2826. // continue;
  2827. // }
  2828. // }
  2829. // if (cs["next_cx"] != null && cs["next_cx"] < this.zhen && cs["isTimer"] == 1) {
  2830. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  2831. // this.addOneAtk(iid, fiid, "effect", ["hp", Math.floor((cs["hit"] * e_a) / 10000)]);
  2832. // } else {
  2833. // if (cfgEf.args["if"] == 1) {
  2834. // // 有if=1的直接回血一次
  2835. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  2836. // this.addOneAtk(iid, fiid, "effect", ["hp", Math.floor((cs["hit"] * e_a) / 10000)]);
  2837. // } else {
  2838. // // pass = false; // 加定时器回血 不加cd
  2839. // cs["next_cx"] = this.zhen;
  2840. // cs["do_iid"] = Number(fiid);
  2841. // this.timer_add({
  2842. // iid: iid, //触发者
  2843. // fiids: [fiid], //触发对象
  2844. // key: ef_ttype + "_" + e_i, //定时器标识
  2845. // type: [601], //执行触发点
  2846. // func: "sk_effect", //执行的函数名
  2847. // lzhen: 30, //轮询执行时间
  2848. // ezhen: this.zhen + maxzhen,
  2849. // skid: skid, //技能ID
  2850. // aeid: effectId, //效果ID|行为ID
  2851. // cs: cs, //参数
  2852. // overlayType: overlayType,
  2853. // });
  2854. // this.skbuff_add({
  2855. // fiid: fiid, //添加对象
  2856. // key: ef_buff, //属性key
  2857. // minZhen: this.zhen, //开始帧
  2858. // maxZhen: this.zhen + maxzhen, //结束帧
  2859. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2860. // ceng: 1, //增加层数
  2861. // eps: { e_a: e_a }, //属性
  2862. // });
  2863. // }
  2864. // //delete cs["next_cx"]
  2865. // }
  2866. // break;
  2867. // case 3: //晕眩 无法移动、攻击和释放技能,不可叠加,持续3秒
  2868. // this.skbuff_add({
  2869. // fiid: fiid, //添加对象
  2870. // key: ef_buff, //属性key
  2871. // minZhen: this.zhen, //开始帧
  2872. // maxZhen: this.zhen + maxzhen, //结束帧
  2873. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2874. // ceng: e_m, //增加层数
  2875. // eps: {}, //属性
  2876. // });
  2877. // this.timer_do(508, { do_iid: Number(fiid) });
  2878. // break;
  2879. // case 4: //火焰 每秒受到30%持续伤害,最高叠加10层,持续5秒
  2880. // if (cfgEf.args["p"] && this.seedRand.rand(1, 10000) > cfgEf.args["p"] * 10000) {
  2881. // continue;
  2882. // }
  2883. // if (cs["nextid"] == null || cs["i_59"] == null) {
  2884. // let hit = cs[fiid] ? cs[fiid] : cs["hit"];
  2885. // let csCpoy = gameMethod.objCopy(cs);
  2886. // csCpoy["nextid"] = 1;
  2887. // csCpoy["i_59"] = 0;
  2888. // for (let index = 0; index < e_m; index++) {
  2889. // this.timer_add({
  2890. // iid: iid, //触发者
  2891. // fiids: [fiid], //触发对象
  2892. // key: ef_ttype, //定时器标识
  2893. // type: [601], //执行触发点
  2894. // func: "sk_effect", //执行的函数名
  2895. // lzhen: 30, //轮询执行时间
  2896. // ezhen: this.zhen + maxzhen,
  2897. // skid: skid, //技能ID
  2898. // aeid: effectId, //效果ID|行为ID
  2899. // cs: csCpoy, //参数
  2900. // overlayType: overlayType,
  2901. // });
  2902. // this.skbuff_add({
  2903. // //添加buff 用于展示
  2904. // fiid: fiid, //添加对象
  2905. // key: ef_buff, //属性key
  2906. // minZhen: this.zhen, //开始帧
  2907. // maxZhen: this.zhen + maxzhen, //结束帧
  2908. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2909. // ceng: 1, //增加层数
  2910. // eps: {
  2911. // i_59_hit: hit,
  2912. // }, //属性
  2913. // });
  2914. // this.timer_do(505, { do_iid: Number(fiid) });
  2915. // this.timer_do(508, { do_iid: Number(fiid) });
  2916. // }
  2917. // } else {
  2918. // if (cs["do_iid"].toString() != iid) {
  2919. // continue;
  2920. // }
  2921. // cs["i_59"] = this.skbuff_get(fiid, "i_59");
  2922. // cs["hit"] = this.skbuff_get(fiid, "i_59_hit");
  2923. // if (!cs["hit"]) {
  2924. // if (cfgEf.args["a"] != null) {
  2925. // this.js_hits(iid, fiid, 10000, skid); //计算伤害
  2926. // let gzhit = this.oneHit[iid][fiid];
  2927. // cs["hit"] = gzhit.skhit;
  2928. // }
  2929. // if (cs["hit"] == null) {
  2930. // continue;
  2931. // }
  2932. // }
  2933. // let hit = Math.floor(cs["hit"] * (e_a / 10000 + cs["i_59"]));
  2934. // this.addOneAtk(fiid, fiid, "aType", Xys.ActionType.effect);
  2935. // this.addOneAtk(fiid, fiid, "effect", ["hp", -1 * hit]);
  2936. // }
  2937. // break;
  2938. // case 5: //冰冻 无法移动、不能普攻攻击和释放技能,无法叠加,持续4秒。作用期间无法被施加寒意
  2939. // this.skbuff_add({
  2940. // fiid: fiid, //添加对象
  2941. // key: ef_buff, //属性key
  2942. // minZhen: this.zhen, //开始帧
  2943. // maxZhen: this.zhen + maxzhen, //结束帧
  2944. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2945. // ceng: e_m, //增加层数
  2946. // eps: {}, //属性
  2947. // });
  2948. // this.timer_do(507, { do_iid: Number(fiid) });
  2949. // this.timer_do(508, { do_iid: Number(fiid) });
  2950. // break;
  2951. // case 6: //击退 无法移动、不能普攻攻击、不能被攻击和释放技能,持续0.5秒
  2952. // this.skbuff_add({
  2953. // fiid: fiid, //添加对象
  2954. // key: ef_buff, //属性key
  2955. // minZhen: this.zhen, //开始帧
  2956. // maxZhen: this.zhen + maxzhen, //结束帧
  2957. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2958. // ceng: e_m, //增加层数
  2959. // eps: {}, //属性
  2960. // });
  2961. // this.timer_do(508, { do_iid: Number(fiid) });
  2962. // if (lsOne == 0) {
  2963. // lsOne = 1;
  2964. // this.timer_do(206, { do_iid: Number(iid) });
  2965. // }
  2966. // break;
  2967. // case 7: //寒意 攻击降低5%,持续10秒,叠加至5层时转化为冰冻
  2968. // let eff_i_5 = this.skbuff_get(fiid, "effect_i_5", 2);
  2969. // if (eff_i_5 == 0) {
  2970. // let eff_i_ep: { [key: string]: number } = Object.assign(cfgEf.args);
  2971. // this.skbuff_add({
  2972. // fiid: fiid, //添加对象
  2973. // key: ef_buff, //属性key
  2974. // minZhen: this.zhen, //开始帧
  2975. // maxZhen: this.zhen + maxzhen, //结束帧
  2976. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2977. // ceng: e_m, //增加层数
  2978. // eps: eff_i_ep, //属性
  2979. // });
  2980. // this.timer_do(506, { do_iid: Number(iid) });
  2981. // }
  2982. // let eff_i_7 = this.skbuff_get(fiid, ef_buff, 2);
  2983. // if (eff_i_7 >= 5) {
  2984. // this.skbuff_sub_all(fiid, ef_buff);
  2985. // cs["nextid"] = 1;
  2986. // this.sk_effect(iid, skid, e_id, ef_ttype, cs);
  2987. // }
  2988. // break;
  2989. // case 8: //真意 技能伤害增加3%,最高叠加10层,持续10秒
  2990. // this.skbuff_add({
  2991. // fiid: fiid, //添加对象
  2992. // key: ef_buff, //属性key
  2993. // minZhen: this.zhen, //开始帧
  2994. // maxZhen: this.zhen + maxzhen, //结束帧
  2995. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  2996. // ceng: e_m, //增加层数
  2997. // eps: { sk_a: e_a }, //属性
  2998. // });
  2999. // this.timer_do(504, { do_iid: Number(iid) });
  3000. // break;
  3001. // case 9: //护体罡气 受到伤害时,优先抵消护体罡气(表现上需要加护盾特效)
  3002. // let value9 = Math.floor((this.teams[fiid].eps["hp_max"] * cfgEf.args["hp_max"]) / 10000);
  3003. // this.skbuff_add({
  3004. // fiid: fiid, //添加对象
  3005. // key: ef_buff, //属性key
  3006. // minZhen: this.zhen, //开始帧
  3007. // maxZhen: this.zhen + maxzhen, //结束帧
  3008. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3009. // ceng: e_m, //增加层数
  3010. // eps: {
  3011. // i_9: value9,
  3012. // i_9_id: cfgEf.args["id"] ? cfgEf.args["id"] : 0,
  3013. // i_9_skin: Number(skid),
  3014. // }, //属性
  3015. // });
  3016. // this.timer_do(501, { do_iid: Number(iid) });
  3017. // break;
  3018. // case 10: //异常状态 包括:属性降低、流血、冰冻、击飞、沉默,眩晕
  3019. // this.skbuff_add({
  3020. // fiid: fiid, //添加对象
  3021. // key: ef_buff, //属性key
  3022. // minZhen: this.zhen, //开始帧
  3023. // maxZhen: this.zhen + maxzhen, //结束帧
  3024. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3025. // ceng: e_m, //增加层数
  3026. // eps: {}, //属性
  3027. // });
  3028. // this.timer_do(508, { do_iid: Number(fiid) });
  3029. // break;
  3030. // case 12: //异常免疫 免疫属性降低、流血、冰冻、击飞、沉默,眩晕
  3031. // if (maxzhen > 0) {
  3032. // this.skbuff_add({
  3033. // fiid: fiid, //添加对象
  3034. // key: ef_buff, //属性key
  3035. // minZhen: this.zhen, //开始帧
  3036. // maxZhen: this.zhen + maxzhen, //结束帧
  3037. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3038. // ceng: e_m, //增加层数
  3039. // eps: {}, //属性
  3040. // });
  3041. // }
  3042. // if (this.uuids[fiid] == null) {
  3043. // continue;
  3044. // }
  3045. // if (gameMethod.isEmpty(this.uuids[fiid].skbuff) == true) {
  3046. // continue;
  3047. // }
  3048. // // let keys2 = Object.keys(this.uuids[fiid].skbuff)
  3049. // let keys2 = this.changeSkBuff(1, fiid, null, 1);
  3050. // for (let k = 0; k < keys2.length; k++) {
  3051. // let key = keys2[k];
  3052. // if (gameMethod.isEmpty(this.uuids[fiid].skbuff[key])) {
  3053. // continue;
  3054. // }
  3055. // if (["effect_i_10", "effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_6"].includes(key)) {
  3056. // delete this.uuids[fiid].skbuff[key];
  3057. // this.oneBuff[fiid] = 1;
  3058. // continue;
  3059. // }
  3060. // //let copy10 = gameMethod.objCopy(this.uuids[fiid].skbuff[key]);
  3061. // this.uuids[fiid].skbuff[key] = [];
  3062. // let values = this.changeSkBuff(1, fiid, key, 2);
  3063. // for (let j = 0; j < values.length; j++) {
  3064. // let pass = false;
  3065. // let keys3 = Object.keys(values[j].eps);
  3066. // for (let l = 0; l < keys3.length; l++) {
  3067. // if (this.teams[iid].eps[keys3[l]] == null) {
  3068. // continue;
  3069. // }
  3070. // if (values[j].eps[keys3[l]] < 0) {
  3071. // pass = true;
  3072. // this.oneBuff[fiid] = 1;
  3073. // break;
  3074. // }
  3075. // }
  3076. // if (pass == false) {
  3077. // this.uuids[fiid].skbuff[key].push(values[j]);
  3078. // }
  3079. // }
  3080. // }
  3081. // // 更新缓存
  3082. // this.changeSkBuff(2, fiid, null, 1, this.uuids[fiid].skbuff);
  3083. // break;
  3084. // case 13: //最终伤害降低xx%
  3085. // this.skbuff_add({
  3086. // fiid: fiid, //添加对象
  3087. // key: ef_buff, //属性key
  3088. // minZhen: this.zhen, //开始帧
  3089. // maxZhen: this.zhen + maxzhen, //结束帧
  3090. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3091. // ceng: e_m, //增加层数
  3092. // eps: {
  3093. // i_13: e_a,
  3094. // i_13_cd: 0, // 持续性的 不加cd
  3095. // i_13_nZhen: this.zhen,
  3096. // }, //属性
  3097. // });
  3098. // break;
  3099. // case 14: //当前生命首次低于x%, xx属性增加x%
  3100. // let f_hp14 = this.skbuff_get(fiid, "hp");
  3101. // let f_hp_max14 = this.skbuff_get(fiid, "hp_max");
  3102. // if ((f_hp14 * 10000) / f_hp_max14 < Math.abs(cfgEf.args["hp"])) {
  3103. // let eff_i_ep: { [key: string]: number } = {};
  3104. // let keys = Object.keys(cfgEf.args);
  3105. // for (let k = 0; k < keys.length; k++) {
  3106. // if (keys[k] == "hp") {
  3107. // continue;
  3108. // }
  3109. // if (this.teams[fiid].eps[keys[k]] == null) {
  3110. // continue;
  3111. // }
  3112. // eff_i_ep[keys[k]] = cfgEf.args[keys[k]];
  3113. // }
  3114. // this.skbuff_add({
  3115. // fiid: fiid, //添加对象
  3116. // key: ef_buff, //属性key
  3117. // minZhen: this.zhen, //开始帧
  3118. // maxZhen: this.zhen + maxzhen, //结束帧
  3119. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3120. // ceng: e_m, //增加层数
  3121. // eps: eff_i_ep, //属性
  3122. // });
  3123. // this.timer_sub(iid, ef_ttype);
  3124. // }
  3125. // break;
  3126. // case 15: //触发暴击后,给自身加效果
  3127. // cs["nextid"] = 1;
  3128. // let id1 = cfgEf.args["id1"];
  3129. // if (id1 > 0) {
  3130. // this.sk_effect(iid, skid, id1, ef_ttype, cs);
  3131. // }
  3132. // this.sk_effect(iid, skid, e_id, ef_ttype, cs);
  3133. // break;
  3134. // case 16: //自身首次生命低于15%时进入入定状态,之后每秒恢复自身攻击200%的气血,期间自身无法行动。自身气血恢复至60%时解除入定状态,并对周围敌人造成200%技能伤害
  3135. // if (cs["do_iid"].toString() != iid) {
  3136. // continue;
  3137. // }
  3138. // let f_hp16 = this.skbuff_get(fiid, "hp");
  3139. // let f_hp_max16 = this.skbuff_get(fiid, "hp_max");
  3140. // if ((f_hp16 * 10000) / f_hp_max16 < Math.abs(cfgEf.args["hp"])) {
  3141. // if (cs["nextid"] != 1) {
  3142. // this.skbuff_add({
  3143. // fiid: fiid, //添加对象
  3144. // key: ef_buff, //属性key
  3145. // minZhen: this.zhen, //开始帧
  3146. // maxZhen: this.zhen + maxzhen, //结束帧
  3147. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3148. // ceng: e_m, //增加层数
  3149. // eps: {}, //属性
  3150. // });
  3151. // cs["nextid"] = 1;
  3152. // this.timer_add({
  3153. // iid: iid, //触发者
  3154. // fiids: fiids, //触发对象
  3155. // key: ef_ttype, //定时器标识
  3156. // type: [601], //执行触发点
  3157. // func: "sk_effect", //执行的函数名
  3158. // lzhen: 30, //轮询执行时间
  3159. // ezhen: this.zhen + maxzhen,
  3160. // skid: skid, //技能ID
  3161. // aeid: effectId, //效果ID|行为ID
  3162. // cs: cs, //参数
  3163. // overlayType: overlayType,
  3164. // });
  3165. // }
  3166. // }
  3167. // if (cs["nextid"] == 1) {
  3168. // let f_atk: number = this.skbuff_get(iid, "atk");
  3169. // let addHp16: number = Math.floor((f_atk * cfgEf.args["atk_per"]) / 10000);
  3170. // let addHpMax16: number = Math.floor((f_hp_max16 * Math.abs(cfgEf.args["hp2"])) / 10000);
  3171. // addHp16 = Math.min(addHp16, addHpMax16 - f_hp16);
  3172. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3173. // this.addOneAtk(iid, iid, "effect", ["hp", addHp16]);
  3174. // f_hp16 = this.skbuff_get(fiid, "hp");
  3175. // if ((f_hp16 * 10000) / f_hp_max16 >= Math.abs(cfgEf.args["hp2"])) {
  3176. // this.skbuff_sub(fiid, ef_buff);
  3177. // this.timer_sub(iid, ef_ttype);
  3178. // cs["nextid"] = 1;
  3179. // this.sk_effect(fiid, skid, cfgEf.args["id"], ef_ttype, cs);
  3180. // }
  3181. // }
  3182. // break;
  3183. // case 17: //记录自身处于某种状态buff,被攻击有概率给自身加效果
  3184. // let eff_i_buff: number = 0;
  3185. // if (cfgEf.args["buff"] != 10) {
  3186. // // 10需要判断各种异常状态
  3187. // eff_i_buff = this.skbuff_get(iid, "effect_i_" + cfgEf.args["buff"], 2);
  3188. // } else {
  3189. // let list: string[] = ["effect_i_1", "effect_i_3", "effect_i_6", "effect_i_4", "effect_i_5"];
  3190. // for (let k = 0; k < list.length; k++) {
  3191. // eff_i_buff += this.skbuff_get(fiid, list[k], 2);
  3192. // }
  3193. // }
  3194. // if (eff_i_buff > 0) {
  3195. // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
  3196. // cs["nextid"] = 1;
  3197. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  3198. // }
  3199. // } else {
  3200. // pass = false; // 没触发 不要进入冷却时间
  3201. // continue;
  3202. // }
  3203. // break;
  3204. // case 18: //每3次攻击消耗一层真意,之后额外造成目标当前气血3%的伤害(最多造成自身攻击500%的伤害)
  3205. // //备注:这里的攻击包括普攻和技能和连击,不包括反击,被动技能是不计算次数的
  3206. // if (cs["do_iid"].toString() != iid) {
  3207. // continue;
  3208. // }
  3209. // let bdcons18 = this.uuids[fiid].cons[0] + this.uuids[fiid].cons[1];
  3210. // if (bdcons18 >= cfgEf.args["count"] && bdcons18 % cfgEf.args["count"] == 0) {
  3211. // this.skbuff_sub(iid, "effect_i_" + cfgEf.args["buff"]);
  3212. // cs["nextid"] = 1;
  3213. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  3214. // }
  3215. // break;
  3216. // case 19: //普攻施加快剑印记,持续7秒,最多叠加10层。目标每层快剑印记,使自身攻击附加30%额外伤害。若7秒内目标未受到自身伤害,则快剑印记全部消失
  3217. // let cfgEf19 = Gamecfg.skillEffect.getItem(cfgEf.args["id"]);
  3218. // if (cfgEf19 != null) {
  3219. // this.skbuff_add({
  3220. // fiid: fiid, //添加对象
  3221. // key: ef_buff, //属性key
  3222. // minZhen: this.zhen, //开始帧
  3223. // maxZhen: this.zhen + maxzhen, //结束帧
  3224. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3225. // ceng: 1, //增加层数
  3226. // eps: {
  3227. // //属性
  3228. // i_19_a: cfgEf.args["a"] * 10000,
  3229. // i_19_i: cfgEf19.args["i"],
  3230. // },
  3231. // });
  3232. // let ceng19 = this.skbuff_get(fiid, "effect_i_" + cfgEf19.args["i"], 2);
  3233. // let cfgEf19_m = Math.min(cfgEf19.args["m"], cfgEf19.args["n"] - ceng19);
  3234. // if (cfgEf19_m > 0) {
  3235. // cs["nextid"] = 1;
  3236. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  3237. // }
  3238. // //let keys = Object.keys(this.uuids[fiid].skbuff["effect_i_" + cfgEf19.args["i"]]);
  3239. // let keys = this.changeSkBuff(1, fiid, "effect_i_" + cfgEf19.args["i"], 1);
  3240. // for (let k = 0; k < keys.length; k++) {
  3241. // this.uuids[fiid].skbuff["effect_i_" + cfgEf19.args["i"]][Number(keys[k])].szhen = this.zhen;
  3242. // this.uuids[fiid].skbuff["effect_i_" + cfgEf19.args["i"]][Number(keys[k])].ezhen = this.zhen + maxzhen;
  3243. // }
  3244. // this.changeSkBuff(2, fiid, "effect_i_" + cfgEf19.args["i"], 1, this.uuids[fiid].skbuff["effect_i_" + cfgEf19.args["i"]]);
  3245. // }
  3246. // break;
  3247. // case 20: //每x秒清除自身异常状态
  3248. // if (cs["do_iid"].toString() != iid) {
  3249. // continue;
  3250. // }
  3251. // this.skbuff_sub(fiid, "effect_i_" + cfgEf.args["buff"]);
  3252. // if (cfgEf.args["buff"] == 10) {
  3253. // // let keys = Object.keys(this.uuids[fiid].skbuff)
  3254. // let keys = this.changeSkBuff(1, fiid, null, 1);
  3255. // for (let k = 0; k < keys.length; k++) {
  3256. // let key = keys[k];
  3257. // if (gameMethod.isEmpty(this.uuids[fiid].skbuff[key]) == true) {
  3258. // continue;
  3259. // }
  3260. // if (["effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_6"].includes(key)) {
  3261. // delete this.uuids[fiid].skbuff[key];
  3262. // this.oneBuff[fiid] = 1;
  3263. // continue;
  3264. // }
  3265. // if (!key.includes("effect_i_0")) {
  3266. // continue;
  3267. // }
  3268. // //let copy10 = gameMethod.objCopy(this.uuids[fiid].skbuff[key]);
  3269. // this.uuids[fiid].skbuff[key] = [];
  3270. // //let values = Object.values(copy10);
  3271. // let values = this.changeSkBuff(1, fiid, key, 2);
  3272. // for (let j = 0; j < values.length; j++) {
  3273. // let pass = false;
  3274. // let keys3 = Object.keys(values[j].eps);
  3275. // for (let l = 0; l < keys3.length; l++) {
  3276. // if (this.teams[iid].eps[keys3[l]] == null) {
  3277. // continue;
  3278. // }
  3279. // if (values[j].eps[keys3[l]] < 0) {
  3280. // pass = true;
  3281. // this.oneBuff[fiid] = 1;
  3282. // break;
  3283. // }
  3284. // }
  3285. // if (pass == false) {
  3286. // this.uuids[fiid].skbuff[key].push(values[j]);
  3287. // }
  3288. // }
  3289. // }
  3290. // this.changeSkBuff(2, fiid, null, 1, this.uuids[fiid].skbuff);
  3291. // }
  3292. // break;
  3293. // case 21: //自身持有护体罡气时,执向一个effectID的效果
  3294. // //这边只管触发 外层有脚本在跑
  3295. // cs["nextid"] = 1;
  3296. // this.sk_effect(iid, skid, e_id, ef_ttype, cs);
  3297. // let cfgEf21 = Gamecfg.skillEffect.getItem(e_id);
  3298. // if (cfgEf21 != null) {
  3299. // if (cfgEf21.type == 1) {
  3300. // this.uuids[iid].podun.push("effect_i_0_" + e_id);
  3301. // } else {
  3302. // this.uuids[iid].podun.push("effect_i_" + cfgEf21.args["i"]);
  3303. // }
  3304. // }
  3305. // break;
  3306. // case 22: //血量低于X%时给自身添加buff
  3307. // if (iid.length != fiid.length && this.oneHit[iid]) {
  3308. // // 获取攻击对象
  3309. // let hitiid: string = "";
  3310. // let keys = Object.keys(this.oneHit[iid]);
  3311. // for (let k = 0; k < keys.length; k++) {
  3312. // hitiid = keys[k];
  3313. // let hp_max22 = this.skbuff_get(hitiid, "hp_max");
  3314. // let newHp22 = this.skbuff_get(hitiid, "hp");
  3315. // if (this.uuids[iid].skbase[skid].effect[effectId].f == 0 && (newHp22 * 10000) / hp_max22 <= Math.abs(cfgEf.args["hp"])) {
  3316. // let keys = Object.keys(cfgEf.args);
  3317. // for (let i = 0; i < keys.length; i++) {
  3318. // let key = keys[i];
  3319. // if (!key.includes("id")) {
  3320. // continue;
  3321. // }
  3322. // cs["nextid"] = 1;
  3323. // this.sk_effect(iid, skid, cfgEf.args[key], ef_ttype, cs);
  3324. // }
  3325. // if (cfgEf.args["if"] == 1) {
  3326. // this.uuids[iid].skbase[skid].effect[effectId].f = 1;
  3327. // this.timer_sub(fiid, ef_ttype);
  3328. // }
  3329. // return;
  3330. // }
  3331. // }
  3332. // } else {
  3333. // let hp_max22 = this.skbuff_get(fiid, "hp_max");
  3334. // let newHp22 = this.skbuff_get(fiid, "hp");
  3335. // if (this.uuids[iid].skbase[skid].effect[effectId].f == 0 && (newHp22 * 10000) / hp_max22 <= Math.abs(cfgEf.args["hp"])) {
  3336. // let keys = Object.keys(cfgEf.args);
  3337. // for (let k = 0; k < keys.length; k++) {
  3338. // if (!keys[k].includes("id")) {
  3339. // continue;
  3340. // }
  3341. // cs["nextid"] = 1;
  3342. // this.sk_effect(fiid, skid, cfgEf.args[keys[k]], ef_ttype, cs);
  3343. // }
  3344. // if (cfgEf.args["if"] == 1) {
  3345. // this.uuids[iid].skbase[skid].effect[effectId].f = 1;
  3346. // this.timer_sub(fiid, ef_ttype);
  3347. // }
  3348. // return;
  3349. // } else {
  3350. // pass = false;
  3351. // }
  3352. // }
  3353. // break;
  3354. // case 23: //记录快剑印记状态
  3355. // this.skbuff_add({
  3356. // fiid: fiid, //添加对象
  3357. // key: ef_buff, //属性key
  3358. // minZhen: this.zhen, //开始帧
  3359. // maxZhen: this.zhen + maxzhen, //结束帧
  3360. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3361. // ceng: e_m, //增加层数
  3362. // eps: {}, //属性
  3363. // });
  3364. // break;
  3365. // case 24: //必定暴击
  3366. // this.skbuff_add({
  3367. // fiid: fiid, //添加对象
  3368. // key: ef_buff, //属性key
  3369. // minZhen: this.zhen, //开始帧
  3370. // maxZhen: this.zhen + maxzhen, //结束帧
  3371. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3372. // ceng: e_m, //增加层数
  3373. // eps: {}, //属性
  3374. // });
  3375. // break;
  3376. // case 25: //灵力值获取
  3377. // if (gameMethod.isEmpty(cfgEf.args["lingli"]) == false) {
  3378. // this.add_mp(fiid, cfgEf.args["lingli"], 2);
  3379. // }
  3380. // if (gameMethod.isEmpty(cfgEf.args["lingli2"]) == false) {
  3381. // this.add_mp(fiid, 10000 * cfgEf.args["lingli2"], 2);
  3382. // }
  3383. // break;
  3384. // case 26: //每x次攻击,会使下一次攻击的目标增加buff(备注:攻击包括连击,不包括反击)
  3385. // if (cs["do_iid"].toString() != iid) {
  3386. // continue;
  3387. // }
  3388. // let bdcons26 = this.uuids[fiid].cons[0] + this.uuids[fiid].cons[1];
  3389. // cs["limit"] = cs["limit"] == null ? cfgEf.args["count"] : cs["limit"];
  3390. // let yu26 = 1;
  3391. // if (cfgEf.args["if"] == 1) {
  3392. // yu26 = 0;
  3393. // }
  3394. // if (bdcons26 >= cs["limit"] && bdcons26 % cfgEf.args["count"] == yu26) {
  3395. // cs["limit"] += 1; //下一次才能在触发
  3396. // let keys = Object.keys(cfgEf.args);
  3397. // for (let k = 0; k < keys.length; k++) {
  3398. // if (!keys[k].includes("id")) {
  3399. // continue;
  3400. // }
  3401. // cs["nextid"] = 1;
  3402. // this.sk_effect(fiid, skid, cfgEf.args[keys[k]], ef_ttype, cs);
  3403. // this.uuids[iid].timer[ef_ttype][cs["timerId"].toString()].cs = cs;
  3404. // }
  3405. // } else {
  3406. // continue;
  3407. // }
  3408. // break;
  3409. // case 27: //记录目标某种状态,然后施加一个buff效果
  3410. // if (!this.oneFiids[iid][ef_ttype]) {
  3411. // continue;
  3412. // }
  3413. // if (this.oneFiids[iid][ef_ttype][0] === fiid) {
  3414. // let eff_i_buff27 = 0;
  3415. // if (cfgEf.args["if"] == 1) {
  3416. // if (!this.oneHit[iid]) {
  3417. // continue;
  3418. // }
  3419. // // 有配置的效果是加自身的 iid和fiid是一样的 要找攻击的目标
  3420. // let keys = Object.keys(this.oneHit[iid]);
  3421. // for (let k = 0; k < keys.length; k++) {
  3422. // if (cfgEf.args["buff"] != 10) {
  3423. // // 10需要判断各种异常状态
  3424. // eff_i_buff27 = this.skbuff_get(keys[k], "effect_i_" + cfgEf.args["buff"], 2);
  3425. // } else {
  3426. // let list: string[] = ["effect_i_1", "effect_i_3", "effect_i_6", "effect_i_4", "effect_i_5"];
  3427. // for (let j = 0; j < list.length; j++) {
  3428. // eff_i_buff27 += this.skbuff_get(keys[k], list[j], 2);
  3429. // }
  3430. // }
  3431. // }
  3432. // } else {
  3433. // if (cfgEf.args["buff"] != 10) {
  3434. // // 10需要判断各种异常状态
  3435. // eff_i_buff27 = this.skbuff_get(fiid, "effect_i_" + cfgEf.args["buff"], 2);
  3436. // } else {
  3437. // let list: string[] = ["effect_i_1", "effect_i_3", "effect_i_6", "effect_i_4", "effect_i_5"];
  3438. // for (let j = 0; j < list.length; j++) {
  3439. // eff_i_buff27 += this.skbuff_get(fiid, list[j], 2);
  3440. // }
  3441. // }
  3442. // }
  3443. // if (eff_i_buff27 > 0) {
  3444. // cs["nextid"] = 1;
  3445. // cs["i_59"] = 0; // todo 增伤用火焰增伤 可能有问题
  3446. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  3447. // if (cfgEf.args["id1"]) {
  3448. // this.sk_effect(iid, skid, cfgEf.args["id1"], ef_ttype, cs);
  3449. // }
  3450. // } else {
  3451. // pass = false; // 没有触发 不要加cd
  3452. // }
  3453. // } else {
  3454. // pass = false; // 没有触发 不要加cd
  3455. // }
  3456. // break;
  3457. // case 28: //对某种属性低于自己的敌人造成额外xx%伤害
  3458. // let i_ep = this.skbuff_get(iid, cfgEf.args["ep"]);
  3459. // let f_ep = this.skbuff_get(fiid, cfgEf.args["ep"]);
  3460. // if (i_ep > f_ep) {
  3461. // cs["nextid"] = 1;
  3462. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  3463. // }
  3464. // break;
  3465. // case 29: //自身或者敌方死亡后,获的某种状态
  3466. // let f_ep29 = this.skbuff_get(fiid, "hp");
  3467. // if (f_ep29 <= 0) {
  3468. // cs["nextid"] = 1;
  3469. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  3470. // }
  3471. // break;
  3472. // case 30: //伤害加深
  3473. // this.skbuff_add({
  3474. // fiid: fiid, //添加对象
  3475. // key: ef_buff, //属性key
  3476. // minZhen: this.zhen, //开始帧
  3477. // maxZhen: this.zhen + maxzhen, //结束帧
  3478. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3479. // ceng: e_m, //增加层数
  3480. // eps: { a: cfgEf.args["a"] * 10000 }, //属性
  3481. // });
  3482. // break;
  3483. // case 31: //按自身xx%攻击力进行治疗
  3484. // // 是否有增强治疗效果 addOneAtk里面有处理了
  3485. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3486. // let i_atk: number = this.skbuff_get(fiid, "atk");
  3487. // let addHp31: number = Math.floor((i_atk * cfgEf.args["atk_per"]) / 10000);
  3488. // this.addOneAtk(iid, fiid, "effect", ["hp", addHp31]);
  3489. // break;
  3490. // case 32: //技能每命中X个单位,给自身获取某种BUFF
  3491. // if (cs["do_iid"].toString() != iid) {
  3492. // continue;
  3493. // }
  3494. // let len = this.oneFiids[iid][ef_ttype].length;
  3495. // if (this.oneFiids[iid][ef_ttype][len - 1] == fiid) {
  3496. // // 最后一个攻击对象结算命中
  3497. // let bdcons32 = this.oneFiids[iid][ef_ttype].length;
  3498. // if (bdcons32 >= cfgEf.args["count"] && bdcons32 % cfgEf.args["count"] == 0) {
  3499. // for (let i = 0; i < Math.floor(bdcons32 / cfgEf.args["count"]); i++) {
  3500. // cs["nextid"] = 1;
  3501. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  3502. // }
  3503. // }
  3504. // } else {
  3505. // continue;
  3506. // }
  3507. // break;
  3508. // case 33: //触发暴击后,附加额外x%伤害
  3509. // // 由于isBj是按skid来的 上一个技能的暴击 这里获取不到 所以需要遍历一下
  3510. // if (cs["isBj"] == null && this.oneAtk[iid][fiid]) {
  3511. // for (let k = 0; k < this.oneAtk[iid][fiid].effect.length; k++) {
  3512. // if (this.oneAtk[iid][fiid].effect[k][0] === "baoji") {
  3513. // cs["isBj"] = this.oneAtk[iid][fiid].effect[k][1];
  3514. // break;
  3515. // }
  3516. // }
  3517. // }
  3518. // this.skbuff_add({
  3519. // fiid: fiid, //添加对象
  3520. // key: ef_buff, //属性key
  3521. // minZhen: this.zhen, //开始帧
  3522. // maxZhen: this.zhen + maxzhen, //结束帧
  3523. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3524. // ceng: e_m, //增加层数
  3525. // eps: { i_33_a: cfgEf.args["a"] * 10000 }, //属性
  3526. // });
  3527. // if (cs["isBj"] != null) {
  3528. // // 暴击并且拥有易伤状态
  3529. // let a = this.skbuff_get(fiid, "i_33_a");
  3530. // let subHp33: number = Math.floor(Math.abs(cs["isBj"] * (a / 10000)));
  3531. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3532. // this.addOneAtk(iid, fiid, "effect", ["hp", -subHp33]);
  3533. // this.skbuff_sub_all(fiid, ef_buff);
  3534. // }
  3535. // break;
  3536. // case 34: //敌方生命低于x%,给自身指定某种状态(首次低于) 血量变化检测
  3537. // if (cs["do_iid"].toString() != fiid) {
  3538. // pass = false;
  3539. // continue; //自己降低的不触发
  3540. // }
  3541. // let chaHp34: number = Math.abs(cfgEf.args["hp"]);
  3542. // let f_hp34 = this.skbuff_get(fiid, "hp");
  3543. // let f_hp_max34 = this.skbuff_get(fiid, "hp_max");
  3544. // if ((f_hp34 * 10000) / f_hp_max34 < chaHp34) {
  3545. // cs[fiid] = this.zhen;
  3546. // let ef_ttype_1 = "effect_id_" + cfgEf.args["id"].toString();
  3547. // if (this.oneFiids[iid] == null) {
  3548. // this.oneFiids[iid] = {};
  3549. // }
  3550. // this.oneFiids[iid][ef_ttype_1] = [fiid];
  3551. // cs["nextid"] = 1;
  3552. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), "", cs);
  3553. // } else {
  3554. // pass = false;
  3555. // continue;
  3556. // }
  3557. // break;
  3558. // case 35: //攻击时,对血量低于30%的敌人施加一层寒意
  3559. // if (cs["do_iid"].toString() != iid) {
  3560. // continue;
  3561. // }
  3562. // let chaHp35: number = Math.abs(cfgEf.args["hp"]);
  3563. // let f_hp35 = this.skbuff_get(fiid, "hp");
  3564. // let f_hp_max35 = this.skbuff_get(fiid, "hp_max");
  3565. // if ((f_hp35 * 10000) / f_hp_max35 < chaHp35) {
  3566. // // 再下去 找不到加伤害的fiid了
  3567. // if (cfgEf.args["id"]) {
  3568. // let cfgEf2 = Gamecfg.skillEffect.getItem(cfgEf.args["id"]);
  3569. // if (cfgEf2 && cfgEf2.args && cfgEf2.args["i"] == 53) {
  3570. // let i_53_atk = this.skbuff_get(iid, "atk");
  3571. // for (let k = 0; k < this.oneAtk[iid][fiid].effect.length; k++) {
  3572. // if (this.oneAtk[iid][fiid].effect[k][0] === "hp" && this.oneAtk[iid][fiid].effect[k][1] < 0) {
  3573. // this.oneAtk[iid][fiid].effect[k][1] = -Math.floor((i_53_atk * cfgEf2.args["atk"]) / 10000);
  3574. // break;
  3575. // }
  3576. // }
  3577. // } else {
  3578. // cs["nextid"] = 1;
  3579. // cs["fiid"] = Number(fiid); // 做个标识
  3580. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  3581. // }
  3582. // }
  3583. // }
  3584. // break;
  3585. // case 36: //自身第一次重伤(死亡)时,恢复一半气血
  3586. // if (cs["do_iid"].toString() != iid) {
  3587. // continue; //不是自己
  3588. // }
  3589. // let chaHp36: number = Math.abs(cfgEf.args["hp"]);
  3590. // let f_hp_max36 = this.skbuff_get(fiid, "hp_max");
  3591. // let subHp36: number = Math.floor(chaHp36 * f_hp_max36);
  3592. // this.uuids[fiid].dzhen = 0;
  3593. // this.uuids[fiid].skbuff = {};
  3594. // this.timer_sub_by_fiid(fiid);
  3595. // this.oneBuff[fiid] = 1;
  3596. // this.skbuff_add({
  3597. // fiid: fiid, //添加对象
  3598. // key: ef_buff, //属性key
  3599. // minZhen: this.zhen, //开始帧
  3600. // maxZhen: 1350, //结束帧
  3601. // overlayType: 2, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3602. // ceng: 1, //增加层数
  3603. // eps: {
  3604. // i_36: subHp36,
  3605. // i_36_nZhen: this.zhen + 30,
  3606. // }, //属性
  3607. // });
  3608. // //this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3609. // //this.addOneAtk(iid, fiid, "effect", ["hp", subHp36]);
  3610. // break;
  3611. // case 37: //己方任何一个单位护体罡气破碎时,然后指定一个BUFF效果,比如击退敌人
  3612. // if (cs["do_iid"].toString().length != fiid.length) {
  3613. // continue;
  3614. // }
  3615. // cs["nextid"] = 1;
  3616. // this.sk_effect(fiid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  3617. // break;
  3618. // case 38: //触发连击时,给自身增加效果
  3619. // if (cs["do_iid"].toString() != iid) {
  3620. // continue;
  3621. // }
  3622. // cs["nextid"] = 1;
  3623. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  3624. // break;
  3625. // case 39: //己方单位施加击退时,使其获得50%气血值护体罡气,并提高其5%普攻伤害,持续至战斗结束,最多叠加20层,冷却12秒
  3626. // if (cs["do_iid"].toString() != fiid) {
  3627. // continue;
  3628. // }
  3629. // this.skbuff_add({
  3630. // fiid: fiid, //添加对象
  3631. // key: ef_buff, //属性key
  3632. // minZhen: this.zhen, //开始帧
  3633. // maxZhen: this.zhen + maxzhen, //结束帧
  3634. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3635. // ceng: 1, //增加层数
  3636. // eps: { i_39_a: cfgEf.args["a"] * 10000 }, //属性
  3637. // });
  3638. // //加护体罡气
  3639. // let value39 = Math.floor((this.teams[fiid].eps["hp"] * cfgEf.args["hp"]) / 10000);
  3640. // this.skbuff_add({
  3641. // fiid: fiid, //添加对象
  3642. // key: "effect_i_9", //属性key
  3643. // minZhen: this.zhen, //开始帧
  3644. // maxZhen: this.zhen + maxzhen, //结束帧
  3645. // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3646. // ceng: 1, //增加层数
  3647. // eps: { i_9: value39 }, //属性
  3648. // });
  3649. // break;
  3650. // case 40: //自身气血高于xx%时,有概率给自身增加效果
  3651. // let f_hp40 = this.skbuff_get(fiid, "hp");
  3652. // let f_hp_max40 = this.skbuff_get(fiid, "hp_max");
  3653. // if ((f_hp40 * 10000) / f_hp_max40 > Math.abs(cfgEf.args["hp"])) {
  3654. // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
  3655. // cs["nextid"] = 1;
  3656. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  3657. // }
  3658. // } else {
  3659. // continue;
  3660. // }
  3661. // break;
  3662. // case 41: //回血,取自身生命值上限x%进行回血,
  3663. // if (cs["next_cx"] != null && cs["next_cx"] < this.zhen) {
  3664. // let f_hp_max41 = this.skbuff_get(fiid, "hp_max");
  3665. // let chaHp41: number = Math.abs(cfgEf.args["hp"]);
  3666. // let addHp: number = Math.floor(f_hp_max41 * chaHp41);
  3667. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3668. // this.addOneAtk(iid, fiid, "effect", ["hp", addHp]);
  3669. // } else {
  3670. // cs["next_cx"] = this.zhen;
  3671. // this.timer_add({
  3672. // iid: iid, //触发者
  3673. // fiids: [fiid], //触发对象
  3674. // key: ef_ttype + "_" + e_i, //定时器标识
  3675. // type: [601], //执行触发点
  3676. // func: "sk_effect", //执行的函数名
  3677. // lzhen: 30, //轮询执行时间
  3678. // ezhen: this.zhen + maxzhen,
  3679. // skid: skid, //技能ID
  3680. // aeid: effectId, //效果ID|行为ID
  3681. // cs: cs, //参数
  3682. // overlayType: overlayType,
  3683. // });
  3684. // this.skbuff_add({
  3685. // fiid: fiid, //添加对象
  3686. // key: ef_buff, //属性key
  3687. // minZhen: this.zhen, //开始帧
  3688. // maxZhen: this.zhen + maxzhen, //结束帧
  3689. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3690. // ceng: 1, //增加层数
  3691. // eps: {}, //属性
  3692. // });
  3693. // delete cs["next_cx"];
  3694. // }
  3695. // break;
  3696. // case 42: //自身气血每降低xxxx%,造成伤害提升5%
  3697. // let f_hp42: number = this.skbuff_get(fiid, "hp");
  3698. // f_hp42 = Math.max(0, f_hp42);
  3699. // let f_hp_max42 = this.skbuff_get(fiid, "hp_max");
  3700. // let hpRate: number = Math.abs(cfgEf.args["hp"] * 100);
  3701. // let newRate: number = Math.ceil((f_hp42 * 100) / f_hp_max42);
  3702. // for (let index = 100 - hpRate; index >= newRate; index -= hpRate) {
  3703. // if (cs[index.toString()] != null) {
  3704. // continue;
  3705. // }
  3706. // cs[index.toString()] = 1;
  3707. // this.timer_add({
  3708. // iid: iid, //触发者
  3709. // fiids: [fiid], //触发对象
  3710. // key: ef_ttype, //定时器标识
  3711. // type: [401], //执行触发点
  3712. // func: "sk_effect", //执行的函数名
  3713. // lzhen: 30, //轮询执行时间
  3714. // ezhen: this.zhen + maxzhen,
  3715. // skid: skid, //技能ID
  3716. // aeid: effectId, //效果ID|行为ID
  3717. // cs: cs, //参数
  3718. // overlayType: overlayType,
  3719. // });
  3720. // cs["nextid"] = 1;
  3721. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  3722. // }
  3723. // break;
  3724. // case 43: //自身气血高于60%时,普通攻击有40%概率沉默目标
  3725. // let chaHp43: number = Math.abs(cfgEf.args["hp"]);
  3726. // let f_hp43 = this.skbuff_get(fiid, "hp");
  3727. // let f_hp_max43 = this.skbuff_get(fiid, "hp_max");
  3728. // if ((f_hp43 * 10000) / f_hp_max43 > chaHp43) {
  3729. // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
  3730. // cs["nextid"] = 1;
  3731. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  3732. // }
  3733. // } else {
  3734. // continue;
  3735. // }
  3736. // break;
  3737. // case 44: //护盾消失时,直接造成自身周围全体目标120%技能伤害
  3738. // cs["nextid"] = 1;
  3739. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  3740. // break;
  3741. // case 45: //自身受到超过当前气血10%以上伤害时,获的某种效果
  3742. // let f_hp46 = this.skbuff_get(fiid, "hp");
  3743. // let f_hp46_old = this.teams[fiid].eps.hp;
  3744. // let f_hp_max46 = this.skbuff_get(fiid, "hp_max");
  3745. // if ((f_hp46 - f_hp46_old) / f_hp_max46 > cfgEf.args["hp"]) {
  3746. // cs["nextid"] = 1;
  3747. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  3748. // } else {
  3749. // continue;
  3750. // }
  3751. // break;
  3752. // case 46: //牺牲自己xxx%当前气血,对目标造成xxx%伤害
  3753. // let i_hp = this.skbuff_get(iid, "hp");
  3754. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3755. // this.addOneAtk(iid, iid, "effect", ["hp", -1 * Math.floor(i_hp * cfgEf.args["hp"])]);
  3756. // for (let k = 0; k < this.oneFiids[iid][ef_ttype].length; k++) {
  3757. // this.js_hits(iid, this.oneFiids[iid][ef_ttype][k], cfgEf.args["a"] * 10000, skid); //计算伤害
  3758. // let gzhit = this.oneHit[iid][this.oneFiids[iid][ef_ttype][k]];
  3759. // this.addOneAtk(iid, this.oneFiids[iid][ef_ttype][k], "effect", ["hp", -1 * Math.floor(gzhit.skhit)]);
  3760. // }
  3761. // break;
  3762. // case 47: //给BOSS挂了某种BUFF,BOSS就免疫这个效果。
  3763. // this.skbuff_add({
  3764. // fiid: fiid, //添加对象
  3765. // key: ef_buff, //属性key
  3766. // minZhen: this.zhen, //开始帧
  3767. // maxZhen: this.zhen + maxzhen, //结束帧
  3768. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3769. // ceng: e_m, //增加层数
  3770. // eps: cfgEf.args, //属性
  3771. // });
  3772. // break;
  3773. // case 48: //BOSS抵抗真意/火焰的时间减少
  3774. // this.skbuff_add({
  3775. // fiid: fiid, //添加对象
  3776. // key: ef_buff, //属性key
  3777. // minZhen: this.zhen, //开始帧
  3778. // maxZhen: this.zhen + 45 * 30, //结束帧
  3779. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3780. // ceng: e_m, //增加层数
  3781. // eps: cfgEf.args, //属性
  3782. // });
  3783. // break;
  3784. // case 51: //回血
  3785. // if (cfgEf.args["if"] == 1) {
  3786. // if (cs["nextid"] == null) {
  3787. // cs["nextid"] = 1;
  3788. // this.timer_add({
  3789. // iid: iid, //触发者
  3790. // fiids: fiids, //触发对象
  3791. // key: ef_ttype, //定时器标识
  3792. // type: cfgEf.triggerTime ? cfgEf.triggerTime : [601], //执行触发点
  3793. // func: "sk_effect", //执行的函数名
  3794. // lzhen: 30, //轮询执行时间
  3795. // ezhen: this.zhen + maxzhen,
  3796. // skid: skid, //技能ID
  3797. // aeid: effectId, //效果ID|行为ID
  3798. // cs: cs, //参数
  3799. // overlayType: overlayType,
  3800. // });
  3801. // return;
  3802. // } else {
  3803. // this.timer_sub(iid, ef_ttype);
  3804. // }
  3805. // } else if (cfgEf.args["if"] == 2) {
  3806. // if (cs["nextid"] == null) {
  3807. // cs["nextid"] = 1;
  3808. // this.timer_add({
  3809. // iid: iid, //触发者
  3810. // fiids: fiids, //触发对象
  3811. // key: ef_ttype, //定时器标识
  3812. // type: cfgEf.triggerTime ? cfgEf.triggerTime : [601], //执行触发点
  3813. // func: "sk_effect", //执行的函数名
  3814. // lzhen: cfgEf.interval * 30, //轮询执行时间
  3815. // ezhen: this.zhen + maxzhen,
  3816. // skid: skid, //技能ID
  3817. // aeid: effectId, //效果ID|行为ID
  3818. // cs: cs, //参数
  3819. // overlayType: overlayType,
  3820. // });
  3821. // } else {
  3822. // // 定时后加血
  3823. // let i_51_atk = this.skbuff_get(iid, "atk");
  3824. // let i_51_hp = Math.floor((cfgEf.args["atk_per"] * i_51_atk) / 10000);
  3825. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3826. // this.addOneAtk(iid, fiid, "effect", ["hp", i_51_hp]);
  3827. // }
  3828. // return;
  3829. // }
  3830. // // cs["nextid"] = 1
  3831. // if (cfgEf.args["id"] != null) {
  3832. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  3833. // }
  3834. // let i_51_atk = this.skbuff_get(iid, "atk");
  3835. // let i_51_hp = Math.floor((cfgEf.args["atk_per"] * i_51_atk) / 10000);
  3836. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3837. // this.addOneAtk(iid, fiid, "effect", ["hp", i_51_hp]);
  3838. // // 有附加id
  3839. // break;
  3840. // case 52: //强制对有寒意状态目标转化为冰冻,每层寒意冰冻x秒(转化完成后,需要清空目标寒意状态)
  3841. // let hitiids = Object.keys(this.oneHit[iid]);
  3842. // for (let k = 0; k < hitiids.length; k++) {
  3843. // let hitiid = hitiids[k];
  3844. // let f_eff_i_7 = this.skbuff_get(hitiid, "effect_i_7", 2);
  3845. // if (f_eff_i_7 == 0) {
  3846. // continue;
  3847. // }
  3848. // let maxZhen = Math.floor(this.zhen + f_eff_i_7 * cfgEf.args["t"] * 30);
  3849. // this.skbuff_add({
  3850. // fiid: hitiid, //添加对象
  3851. // key: "effect_i_5", //属性key
  3852. // minZhen: this.zhen, //开始帧
  3853. // maxZhen: maxZhen, //结束帧
  3854. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3855. // ceng: e_m, //增加层数
  3856. // eps: {}, //属性
  3857. // });
  3858. // this.skbuff_sub_all(hitiid, "effect_i_7");
  3859. // }
  3860. // break;
  3861. // case 53: //伤害加深(计算攻击力倍数) 这里的伤害相当于是直接用攻击力的倍数作为伤害值
  3862. // // 本次攻击加成的 下一帧不能再加伤害要本次加!!!
  3863. // if (!this.oneAtk[fiid]) {
  3864. // return;
  3865. // }
  3866. // let i_53_atk = this.skbuff_get(iid, "atk");
  3867. // let hitiids2 = Object.keys(this.oneHit[iid]);
  3868. // for (let k = 0; k < hitiids2.length; k++) {
  3869. // for (let j = 0; j < this.oneAtk[fiid][hitiids2[k]].effect.length; j++) {
  3870. // if (this.oneAtk[fiid][hitiids2[k]].effect[j][0] === "hp" && this.oneAtk[fiid][hitiids2[k]].effect[j][1] < 0) {
  3871. // this.oneAtk[fiid][hitiids2[k]].effect[j][1] = -Math.floor((i_53_atk * cfgEf.args["atk"]) / 10000);
  3872. // break;
  3873. // }
  3874. // }
  3875. // }
  3876. // this.skbuff_add({
  3877. // fiid: fiid, //添加对象
  3878. // key: ef_buff, //属性key
  3879. // minZhen: this.zhen, //开始帧
  3880. // maxZhen: this.zhen + 1, //结束帧
  3881. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3882. // ceng: e_m, //增加层数
  3883. // eps: {
  3884. // i_53: Math.floor((i_53_atk * cfgEf.args["atk"]) / 10000),
  3885. // },
  3886. // });
  3887. // break;
  3888. // case 54: //直接对有真意状态的目标进行引爆,每层真意额外造成xx%伤害
  3889. // let hits = Object.keys(this.oneHit[iid]);
  3890. // let i_atk54 = this.skbuff_get(iid, "atk");
  3891. // for (let k = 0; k < hits.length; k++) {
  3892. // let eff_i_8_54 = this.skbuff_get(hits[k], "effect_i_8", 2);
  3893. // let hit54 = Math.floor(i_atk54 * cfgEf.args["a"] * eff_i_8_54);
  3894. // if (hit54 > 0) {
  3895. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3896. // this.addOneAtk(iid, hits[k], "effect", ["hp", -1 * hit54]);
  3897. // this.skbuff_sub_all(hits[k], "effect_i_8");
  3898. // }
  3899. // }
  3900. // break;
  3901. // case 56: //引爆我方所有真意,每层真意额外造成20%的伤害
  3902. // let eff_i_4_56 = 0;
  3903. // // 清除我方所有真意
  3904. // for (let index = 0; index < this.teamFiids.length; index++) {
  3905. // let uid = this.teamFiids[index];
  3906. // if (iid.length != uid.length) {
  3907. // continue;
  3908. // }
  3909. // let count = this.skbuff_get(uid, "effect_i_8", 2);
  3910. // if (count > 0) {
  3911. // eff_i_4_56 += count;
  3912. // this.skbuff_sub_all(uid, "effect_i_8");
  3913. // }
  3914. // }
  3915. // if (eff_i_4_56 > 0) {
  3916. // let hits = Object.keys(this.oneHit[iid]);
  3917. // let i_atk56 = this.skbuff_get(iid, "atk");
  3918. // for (let k = 0; k < hits.length; k++) {
  3919. // let hit56 = Math.floor(i_atk56 * cfgEf.args["a"] * eff_i_4_56);
  3920. // if (hit56 > 0) {
  3921. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3922. // this.addOneAtk(iid, hits[k], "effect", ["hp", -1 * hit56]);
  3923. // }
  3924. // }
  3925. // } else {
  3926. // continue;
  3927. // }
  3928. // break;
  3929. // case 57: //清除我方所有火焰状态,每层火焰额外造成x%的伤害
  3930. // let eff_i_4_57 = 0;
  3931. // // 清除我方火焰
  3932. // for (let index = 0; index < this.teamFiids.length; index++) {
  3933. // let uid = this.teamFiids[index];
  3934. // if (iid.length != uid.length) {
  3935. // continue;
  3936. // }
  3937. // let count = this.skbuff_get(uid, "effect_i_4", 2);
  3938. // if (count > 0) {
  3939. // eff_i_4_57 += count;
  3940. // this.skbuff_sub_all(uid, "effect_i_4");
  3941. // }
  3942. // }
  3943. // if (eff_i_4_57 > 0) {
  3944. // let hits = Object.keys(this.oneHit[iid]);
  3945. // let i_atk57 = this.skbuff_get(iid, "atk");
  3946. // for (let k = 0; k < hits.length; k++) {
  3947. // let hit57 = Math.floor(i_atk57 * cfgEf.args["a"] * eff_i_4_57);
  3948. // if (hit57 > 0) {
  3949. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3950. // this.addOneAtk(iid, hits[k], "effect", ["hp", -1 * hit57]);
  3951. // }
  3952. // }
  3953. // } else {
  3954. // continue;
  3955. // }
  3956. // break;
  3957. // case 58: //回血(按已损失生命的%去计算回血值)
  3958. // if (cfgEf.args["if"] == 1) {
  3959. // this.skbuff_add({
  3960. // fiid: fiid, //添加对象
  3961. // key: ef_buff, //属性key
  3962. // minZhen: this.zhen, //开始帧
  3963. // maxZhen: this.zhen + maxzhen, //结束帧
  3964. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3965. // ceng: e_m, //增加层数
  3966. // eps: {
  3967. // i_58: cfgEf.args["hp"],
  3968. // i_58_cd: cfgEf.cd,
  3969. // i_58_nZhen: this.zhen,
  3970. // },
  3971. // });
  3972. // } else {
  3973. // let fpk = this.uuids[iid]?.fpk;
  3974. // let f_hp58 = this.skbuff_get(fiid, "hp");
  3975. // let f_hp_max58 = this.skbuff_get(fiid, "hp_max");
  3976. // let addHp58: number = Math.floor(((f_hp_max58 - f_hp58) * cfgEf.args["hp"]) / 10000);
  3977. // if (fpk && cfgEf.triggerTime == null) {
  3978. // this.addOneAtk(fpk, fpk, "aType", Xys.ActionType.effect);
  3979. // this.addOneAtk(fpk, fiid, "effect", ["hp", addHp58]);
  3980. // } else {
  3981. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  3982. // this.addOneAtk(iid, fiid, "effect", ["hp", addHp58]);
  3983. // }
  3984. // }
  3985. // break;
  3986. // case 59: //有概率将火焰每秒持续伤害增加xx%
  3987. // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
  3988. // let effect_i_4 = this.skbuff_get(fiid, "effect_i_4", 2);
  3989. // if (effect_i_4 > 0) {
  3990. // let i_59 = this.skbuff_get(fiid, "i_59");
  3991. // //this.skbuff_update(fiid, { i_59: i_59 + cfgEf.args["a"] });
  3992. // this.skbuff_add({
  3993. // fiid: fiid, //添加对象
  3994. // key: ef_buff, //属性key
  3995. // minZhen: this.zhen, //开始帧
  3996. // maxZhen: this.zhen + maxzhen, //结束帧
  3997. // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  3998. // ceng: e_m, //增加层数
  3999. // eps: {
  4000. // i_59: cfgEf.args["a"],
  4001. // },
  4002. // });
  4003. // } else {
  4004. // pass = false;
  4005. // }
  4006. // } else {
  4007. // pass = false;
  4008. // }
  4009. // break;
  4010. // case 60: //移除对手等量的属性值
  4011. // let eff_i_ep: { [key: string]: number } = {};
  4012. // let keys60 = Object.keys(cfgEf.args);
  4013. // for (let k = 0; k < keys60.length; k++) {
  4014. // if (this.teams[fiid].eps[keys60[k]] == null) {
  4015. // continue;
  4016. // }
  4017. // eff_i_ep[keys60[k]] = -1 * Math.abs(cfgEf.args[keys60[k]]);
  4018. // }
  4019. // this.skbuff_add({
  4020. // fiid: fiid, //添加对象
  4021. // key: ef_buff, //属性key
  4022. // minZhen: this.zhen, //开始帧
  4023. // maxZhen: this.zhen + maxzhen, //结束帧
  4024. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4025. // ceng: e_m, //增加层数
  4026. // eps: eff_i_ep,
  4027. // });
  4028. // break;
  4029. // case 61: //护体罡气的承伤减少/增加xxx%
  4030. // this.skbuff_add({
  4031. // fiid: fiid, //添加对象
  4032. // key: ef_buff, //属性key
  4033. // minZhen: this.zhen, //开始帧
  4034. // maxZhen: this.zhen + maxzhen, //结束帧
  4035. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4036. // ceng: e_m, //增加层数
  4037. // eps: {
  4038. // i_61: cfgEf.args["hp_max"],
  4039. // },
  4040. // });
  4041. // break;
  4042. // case 62: //目标治疗效果降低/增加,持续X秒
  4043. // this.skbuff_add({
  4044. // fiid: fiid, //添加对象
  4045. // key: ef_buff, //属性key
  4046. // minZhen: this.zhen, //开始帧
  4047. // maxZhen: this.zhen + maxzhen, //结束帧
  4048. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4049. // ceng: e_m, //增加层数
  4050. // eps: {
  4051. // i_62: cfgEf.args["hp"],
  4052. // },
  4053. // });
  4054. // break;
  4055. // case 63: //主角阵亡后,弟子会复活主角并恢复19.56%生命,每场战斗生效1次(秘法和法器的复活只能生效1个)
  4056. // if (cs["do_iid"] % 100 != 0) {
  4057. // continue;
  4058. // }
  4059. // let f_hp_max63 = this.skbuff_get(fiid, "hp_max");
  4060. // let addHp62: number = Math.floor((f_hp_max63 * cfgEf.args["hp"]) / 10000);
  4061. // this.skbuff_add({
  4062. // fiid: cs["do_iid"].toString(), //添加对象
  4063. // key: ef_buff, //属性key
  4064. // minZhen: this.zhen, //开始帧
  4065. // maxZhen: this.zhen + maxzhen, //结束帧
  4066. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4067. // ceng: e_m, //增加层数
  4068. // eps: {
  4069. // i_63_hp: addHp62,
  4070. // i_63_nZhen: this.zhen,
  4071. // i_63_cd: 0,
  4072. // },
  4073. // });
  4074. // break;
  4075. // case 64: //弟子首次攻击伤害额外提升x%
  4076. // this.skbuff_add({
  4077. // fiid: fiid, //添加对象
  4078. // key: ef_buff, //属性key
  4079. // minZhen: this.zhen, //开始帧
  4080. // maxZhen: this.zhen + maxzhen, //结束帧
  4081. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4082. // ceng: e_m, //增加层数
  4083. // eps: {
  4084. // i_64_a: cfgEf.args["a"] * 10000,
  4085. // i_64_cd: cfgEf.cd ? cfgEf.cd : 0,
  4086. // i_64_nZhen: this.zhen,
  4087. // },
  4088. // });
  4089. // break;
  4090. // case 65: //附加被攻击目标的当前生命值X%伤害,最高伤害不超过攻击力x%
  4091. // let f_atk: number = this.skbuff_get(iid, "atk");
  4092. // let keys65 = Object.keys(this.oneAtk[iid]);
  4093. // for (let k = 0; k < keys65.length; k++) {
  4094. // if (iid.length != keys65[k].length) {
  4095. // let add_65: number = 0;
  4096. // let f_hp = this.skbuff_get(keys65[k], "hp_max");
  4097. // add_65 = (cfgEf.args["hp"] * f_hp) / 10000;
  4098. // add_65 = Math.min(add_65, (cfgEf.args["max_atk"] * f_atk) / 10000);
  4099. // add_65 = Math.max(0, Math.floor(add_65));
  4100. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  4101. // this.addOneAtk(iid, keys65[k], "effect", ["hp", -1 * add_65]);
  4102. // }
  4103. // }
  4104. // break;
  4105. // case 66: //随机一个弟子 偷取目标主角x%的攻击力,每层最高不超过x%自身攻击力 与 79配合使用
  4106. // if (cfgEf.args["id"] != null) {
  4107. // this.sk_effect(fiid, skid, cfgEf.args["id"].toString(), "", cs);
  4108. // }
  4109. // break;
  4110. // case 79: //偷取目标x%的攻击力,每层最高不超过x%自身攻击力
  4111. // let keys: { [key: string]: string } = { atk_per: "atk", def_per: "def", hp_max_per: "hp_max", hp_per: "hp" };
  4112. // let eps_66: { [key: string]: number } = {};
  4113. // let feps_66: { [key: string]: number } = {};
  4114. // let keys79 = Object.keys(cfgEf.args);
  4115. // for (let k = 0; k < keys79.length; k++) {
  4116. // if (this.teams[iid].eps[keys79[k]] == null) {
  4117. // continue;
  4118. // }
  4119. // let i_key = this.skbuff_get(iid, keys[keys79[k]] ? keys[keys79[k]] : keys79[k]);
  4120. // let f_key = this.skbuff_get(fiid, keys[keys79[k]] ? keys[keys79[k]] : keys79[k]);
  4121. // let f_val = Math.floor((f_key * cfgEf.args[keys79[k]]) / 10000);
  4122. // let max_val = Math.floor((i_key * cfgEf.args["max_atk"]) / 10000);
  4123. // let i_f_val = keys79[k] == "atk_per" ? Math.min(f_val, max_val) : f_val; // 这个值是攻击力
  4124. // if (keys79[k] == "atk_per") {
  4125. // // atk_per 算的是攻击力 直接加在atk上面
  4126. // eps_66[keys[keys79[k]]] = i_f_val;
  4127. // feps_66[keys[keys79[k]]] = -1 * f_val;
  4128. // } else {
  4129. // eps_66[keys79[k]] = i_f_val;
  4130. // feps_66[keys79[k]] = -1 * f_val;
  4131. // }
  4132. // }
  4133. // this.skbuff_add({
  4134. // fiid: iid, //添加对象
  4135. // key: ef_buff, //属性key
  4136. // minZhen: this.zhen, //开始帧
  4137. // maxZhen: this.zhen + maxzhen, //结束帧
  4138. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4139. // ceng: e_m, //增加层数
  4140. // eps: eps_66,
  4141. // });
  4142. // this.skbuff_add({
  4143. // fiid: fiid, //添加对象
  4144. // key: ef_buff, //属性key
  4145. // minZhen: this.zhen, //开始帧
  4146. // maxZhen: this.zhen + maxzhen, //结束帧
  4147. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4148. // ceng: e_m, //增加层数
  4149. // eps: feps_66,
  4150. // });
  4151. // break;
  4152. // case 67: //对最终伤害有概率造成N倍伤害
  4153. // let a_per: number = 0;
  4154. // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p1"] * 10000) {
  4155. // a_per = cfgEf.args["a1"];
  4156. // } else if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
  4157. // a_per = cfgEf.args["a"];
  4158. // }
  4159. // if (a_per > 0) {
  4160. // this.skbuff_add({
  4161. // fiid: iid, //添加对象
  4162. // key: ef_buff, //属性key
  4163. // minZhen: this.zhen, //开始帧
  4164. // maxZhen: this.zhen + maxzhen, //结束帧
  4165. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4166. // ceng: e_m, //增加层数
  4167. // eps: { a_per: a_per },
  4168. // });
  4169. // }
  4170. // break;
  4171. // case 68: //攻击时,消耗自身x%当前生命值,扣除敌方等额生命值,最高不超过自身x%攻击
  4172. // let i_hp68 = this.skbuff_get(iid, "hp");
  4173. // let i_atk68 = this.skbuff_get(iid, "atk");
  4174. // let max = Math.floor((i_atk68 * cfgEf.args["atk_per"]) / 10000);
  4175. // let subHp68 = Math.floor((i_hp68 * Math.abs(cfgEf.args["hp"])) / 10000);
  4176. // subHp68 = Math.min(subHp68, max);
  4177. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  4178. // if (lsOne == 0) {
  4179. // //只扣除一次
  4180. // lsOne += 1;
  4181. // this.addOneAtk(iid, iid, "effect", ["hp", -1 * subHp68]);
  4182. // }
  4183. // this.addOneAtk(iid, fiid, "effect", ["hp", -1 * subHp68]);
  4184. // break;
  4185. // case 69: //每次进行反击,获得51%强化兽灵,最大不超过自身攻击力30%,持续2秒,冷却10秒
  4186. // let f_atk69 = this.skbuff_get(fiid, "atk");
  4187. // let m_qhshouling = Math.floor((f_atk69 * cfgEf.args["atk_per"]) / 10000);
  4188. // let qhshouling = Math.min(cfgEf.args["qhshouling"], m_qhshouling);
  4189. // this.skbuff_add({
  4190. // fiid: fiid, //添加对象
  4191. // key: ef_buff, //属性key
  4192. // minZhen: this.zhen, //开始帧
  4193. // maxZhen: this.zhen + maxzhen, //结束帧
  4194. // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4195. // ceng: e_m, //增加层数
  4196. // eps: {
  4197. // qhshouling: qhshouling,
  4198. // //max_add_hit: Math.floor((f_atk69 * cfgEf.args["atk"]) / 10000),
  4199. // },
  4200. // });
  4201. // break;
  4202. // case 70: //反弹xx%的伤害给敌方,最大不超过自身攻击力2倍
  4203. // // 获取上次攻击自己的人
  4204. // let hit_fiid = this.uuids[iid]?.fpk;
  4205. // let hit70: number = cs["hit"] * cfgEf.args["a"];
  4206. // let max70 = (this.skbuff_get(iid, "atk") * cfgEf.args["atk_per"]) / 10000;
  4207. // hit70 = Math.floor(Math.min(hit70, max70));
  4208. // //this.addOneAtk(hit_fiid,hit_fiid,"aType",Xys.ActionType.effect)
  4209. // if (hit_fiid) {
  4210. // this.addOneAtk(hit_fiid, hit_fiid, "effect", ["hp", -1 * hit70]);
  4211. // }
  4212. // break;
  4213. // case 71: //单次伤害不超过自身最大生命值的x%
  4214. // if (cs["do_iid"] != Number(fiid)) {
  4215. // pass = false;
  4216. // continue;
  4217. // }
  4218. // let f_hp_max71 = this.skbuff_get(iid, "hp_max");
  4219. // let max_hit_71 = Math.floor((f_hp_max71 * cfgEf.args["hp_max"]) / 10000);
  4220. // this.skbuff_add({
  4221. // fiid: fiid, //添加对象
  4222. // key: ef_buff, //属性key
  4223. // minZhen: this.zhen, //开始帧
  4224. // maxZhen: this.zhen + maxzhen, //结束帧
  4225. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4226. // ceng: 1, //增加层数
  4227. // eps: {
  4228. // max_i_71: max_hit_71,
  4229. // max_i_71_cd: cfgEf.cd ? cfgEf.cd : 0,
  4230. // max_i_71_nZhen: this.zhen,
  4231. // },
  4232. // });
  4233. // break;
  4234. // case 72: //目标处于某种状态,然后延长此状态的时间
  4235. // let f_i_buff = this.skbuff_get(fiid, "effect_i_" + cfgEf.args["buff"], 2);
  4236. // if (f_i_buff > 0) {
  4237. // //let keys72 = Object.keys(this.uuids[fiid].skbuff["effect_i_" + cfgEf.args["buff"]])
  4238. // let keys72 = this.changeSkBuff(1, fiid, "effect_i_" + cfgEf.args["buff"], 1);
  4239. // for (let k = 0; k < keys72.length; k++) {
  4240. // this.uuids[fiid].skbuff["effect_i_" + cfgEf.args["buff"]][Number(keys72[k])].ezhen += 30 * cfgEf.args["t"];
  4241. // }
  4242. // this.changeSkBuff(2, fiid, "effect_i_" + cfgEf.args["buff"], 1, this.uuids[fiid].skbuff["effect_i_" + cfgEf.args["buff"]]);
  4243. // } else {
  4244. // continue;
  4245. // }
  4246. // break;
  4247. // case 73: //每次释放术法,术法伤害增加7.5%,最高叠加到15%
  4248. // let qhmifa73 = this.skbuff_get(fiid, "i_73");
  4249. // qhmifa73 += cfgEf.args["qhmifa"];
  4250. // qhmifa73 = Math.min(qhmifa73, cfgEf.args["max_qhmifa"]);
  4251. // this.skbuff_add({
  4252. // fiid: fiid, //添加对象
  4253. // key: ef_buff, //属性key
  4254. // minZhen: this.zhen, //开始帧
  4255. // maxZhen: this.zhen + maxzhen, //结束帧
  4256. // overlayType: 2, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4257. // ceng: 1, //增加层数
  4258. // eps: { i_73: qhmifa73 },
  4259. // });
  4260. // break;
  4261. // case 74: //给被溅射的目标增加一个BUFF效果
  4262. // cs["nextid"] = 1;
  4263. // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
  4264. // break;
  4265. // case 75: //技能系数增加,生效1次后清空
  4266. // if (cfgEf.args["a"] == null) {
  4267. // continue;
  4268. // }
  4269. // this.skbuff_add({
  4270. // fiid: fiid, //添加对象
  4271. // key: ef_buff, //属性key
  4272. // minZhen: this.zhen, //开始帧
  4273. // maxZhen: this.zhen + maxzhen, //结束帧
  4274. // overlayType: 2, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4275. // ceng: 1, //增加层数
  4276. // eps: { i_75: cfgEf.args["a"] * 10000 },
  4277. // });
  4278. // break;
  4279. // case 76: //存在buff时,造成技能伤害
  4280. // if (gameMethod.isEmpty(cfgEf.args["buff"]) == false) {
  4281. // if (this.skbuff_get(iid, "effect_i_" + cfgEf.args["buff"], 2) <= 0) {
  4282. // continue;
  4283. // }
  4284. // }
  4285. // this.js_hits(iid, fiid, e_a, skid); //计算伤害
  4286. // let gzhit = this.oneHit[iid][fiid];
  4287. // let hit = gzhit.skhit;
  4288. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  4289. // this.addOneAtk(iid, fiid, "effect", ["hp", -1 * hit]);
  4290. // if (cfgEf.args["p"] != null && this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
  4291. // cs["nextid"] = 1;
  4292. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  4293. // }
  4294. // break;
  4295. // case 77: // 造成伤害(额外伤害)
  4296. // cs["hit"] = this.skbuff_get(iid, "atk");
  4297. // if (cs["hit"] == null) {
  4298. // continue;
  4299. // }
  4300. // let hit_77 = Math.floor((cs["hit"] * cfgEf.args["atk"]) / 10000);
  4301. // let effect = [];
  4302. // effect = ["hp", -1 * hit_77];
  4303. // if (cfgEf.args["s"] != null) {
  4304. // effect = ["hp", -1 * hit_77, "jitui", cfgEf.args["s"]];
  4305. // }
  4306. // this.addOneAtk(iid, fiid, "effect", effect);
  4307. // break;
  4308. // case 78: // 释放技能后 造成某种效果 id对应释放技能后效果
  4309. // if (cfgEf.args["id"] != null) {
  4310. // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
  4311. // }
  4312. // break;
  4313. // case 80: // 给自身加buff,攻击目标带有某个buff时,必定暴击
  4314. // this.skbuff_add({
  4315. // fiid: fiid, //添加对象
  4316. // key: ef_buff, //属性key
  4317. // minZhen: this.zhen, //开始帧
  4318. // maxZhen: this.zhen + maxzhen, //结束帧
  4319. // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4320. // ceng: 1, //增加层数
  4321. // eps: {
  4322. // i_80_buff: cfgEf.args["buff"],
  4323. // },
  4324. // });
  4325. // break;
  4326. // case 81: // 溅射伤害增加/减少
  4327. // this.skbuff_add({
  4328. // fiid: fiid, //添加对象
  4329. // key: ef_buff, //属性key
  4330. // minZhen: this.zhen, //开始帧
  4331. // maxZhen: this.zhen + maxzhen, //结束帧
  4332. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4333. // ceng: e_m, //增加层数
  4334. // eps: {
  4335. // i_81: e_a,
  4336. // i_81_cd: 0, // 持续性的 不加cd
  4337. // i_81_nZhen: this.zhen,
  4338. // }, //属性
  4339. // });
  4340. // break;
  4341. // case 82: //攻击带有护体罡气的承伤减少/增加xxx%
  4342. // this.skbuff_add({
  4343. // fiid: fiid, //添加对象
  4344. // key: ef_buff, //属性key
  4345. // minZhen: this.zhen, //开始帧
  4346. // maxZhen: this.zhen + maxzhen, //结束帧
  4347. // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
  4348. // ceng: e_m, //增加层数
  4349. // eps: {
  4350. // i_82: cfgEf.args["hp_max"],
  4351. // },
  4352. // });
  4353. // break;
  4354. // }
  4355. // }
  4356. // if (!pass) {
  4357. // return;
  4358. // }
  4359. // //cd
  4360. // if (fiids.length > 0) {
  4361. // if (gameMethod.isEmpty(cfgEf.count) == false && this.zhen != 1) {
  4362. // this.uuids[iid].skbase[skid].effect[effectId].count += 1;
  4363. // if (this.uuids[iid].skbase[skid].effect[effectId].count >= cfgEf.count) {
  4364. // if (gameMethod.isEmpty(cfgEf.cd) == false) {
  4365. // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
  4366. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  4367. // this.uuids[iid].skbase[skid].effect[effectId].count = 0;
  4368. // this.uuids[iid].timer[ef_ttype][cs["timerId"].toString()].szhen = this.zhen + cfgEf.cd * 30;
  4369. // } else {
  4370. // }
  4371. // }
  4372. // }
  4373. // if (gameMethod.isEmpty(cfgEf.cd) == false && this.zhen != 1) {
  4374. // if (this.uuids[iid].skbase[skid].effect[effectId].count == 0) {
  4375. // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen; // 上次加状态的帧
  4376. // if (cfgEf.args["t"]) {
  4377. // if (this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen < this.zhen) {
  4378. // this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen = this.zhen + cfgEf.args["t"] * 30; // buff持续增加效果结束帧
  4379. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  4380. // }
  4381. // } else {
  4382. // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
  4383. // }
  4384. // }
  4385. // }
  4386. // }
  4387. // // 判定是否是弟子技能 触发弟子释放技能主角加血
  4388. // if (cfgBase.type === "1" && cfgBase.skillType === 3) {
  4389. // for (let index = 0; index < this.teamFiids.length; index++) {
  4390. // let uid = this.teamFiids[index];
  4391. // if (uid.length === iid.length) {
  4392. // let i_58 = this.skbuff_get(uid, "effect_i_58", 2);
  4393. // if (i_58 > 0) {
  4394. // if (this.zhen >= this.skbuff_get(uid, "i_58_nZhen")) {
  4395. // // 有cd的 加完一次要更新cd
  4396. // let cd = this.skbuff_get(uid, "i_58_cd");
  4397. // this.skbuff_update(uid, { i_58_nZhen: cd * 30 + this.zhen });
  4398. // let addPer = this.skbuff_get(uid, "i_58"); // 恢复已损失生命的x%
  4399. // let hp = this.skbuff_get(uid, "hp");
  4400. // let hpMax = this.skbuff_get(uid, "hp_max");
  4401. // let hit = Math.floor(((hpMax - hp) * addPer) / 10000);
  4402. // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
  4403. // this.addOneAtk(iid, uid, "effect", ["hp", hit]);
  4404. // }
  4405. // }
  4406. // }
  4407. // }
  4408. // }
  4409. // }
  4410. // /**
  4411. // * 辅助函数 - 获取值总和
  4412. // * gType = 2 叠加的层数
  4413. // */
  4414. // private skbuff_get(iid: string, key: string, gType: number = 0): number {
  4415. // let epVal: number = 0;
  4416. // if (this.teams[iid] == null) {
  4417. // return 0;
  4418. // }
  4419. // //层数
  4420. // if (gType == 2) {
  4421. // let ceng: number = 0;
  4422. // if (key == "effect_i_10") {
  4423. // if (this.uuids[iid].skbuff["effect_i_1"] != null) {
  4424. // ceng += this.uuids[iid].skbuff["effect_i_1"].length;
  4425. // }
  4426. // if (this.uuids[iid].skbuff["effect_i_3"] != null) {
  4427. // ceng += this.uuids[iid].skbuff["effect_i_3"].length;
  4428. // }
  4429. // if (this.uuids[iid].skbuff["effect_i_4"] != null) {
  4430. // ceng += this.uuids[iid].skbuff["effect_i_4"].length;
  4431. // }
  4432. // if (this.uuids[iid].skbuff["effect_i_5"] != null) {
  4433. // ceng += this.uuids[iid].skbuff["effect_i_5"].length;
  4434. // }
  4435. // if (this.uuids[iid].skbuff["effect_i_6"] != null) {
  4436. // ceng += this.uuids[iid].skbuff["effect_i_6"].length;
  4437. // }
  4438. // //let keys = Object.keys(this.uuids[iid].skbuff)
  4439. // let keys = this.changeSkBuff(1, iid, null, 1);
  4440. // for (let k = 0; k < keys.length; k++) {
  4441. // if (keys[k].includes("effect_i_0")) {
  4442. // // let values = Object.values(this.uuids[iid].skbuff[keys[k]])
  4443. // let values = this.changeSkBuff(1, iid, keys[k], 2);
  4444. // for (let j = 0; j < values.length; j++) {
  4445. // //计算属性 这里in没关系
  4446. // let keys2 = Object.keys(values[j].eps);
  4447. // for (let l = 0; l < keys2.length; l++) {
  4448. // if (this.teams[iid].eps[keys2[l]] == null) {
  4449. // continue;
  4450. // }
  4451. // if (values[j].eps[keys2[l]] < 0) {
  4452. // ceng += 1;
  4453. // break;
  4454. // }
  4455. // }
  4456. // }
  4457. // }
  4458. // }
  4459. // return ceng;
  4460. // }
  4461. // if (this.uuids[iid].skbuff[key] == null) {
  4462. // return 0;
  4463. // }
  4464. // return this.uuids[iid].skbuff[key].length;
  4465. // }
  4466. // //属性
  4467. // if (this.teams[iid].eps[key] != null) {
  4468. // epVal = this.teams[iid].eps[key];
  4469. // if (key == "hp") {
  4470. // //剩余血量
  4471. // epVal = this.jueFiidHp(iid);
  4472. // }
  4473. // }
  4474. // // let values = Object.values(this.uuids[iid].skbuff);
  4475. // let values = this.changeSkBuff(1, iid, null, 2);
  4476. // for (let k = 0; k < values.length; k++) {
  4477. // for (let j = 0; j < values[k].length; j++) {
  4478. // //计算属性 这里in没关系
  4479. // if (values[k][j].eps[key] == null) {
  4480. // continue;
  4481. // }
  4482. // epVal += values[k][j].eps[key];
  4483. // }
  4484. // }
  4485. // //攻击
  4486. // if (key == "atk") {
  4487. // let atk_per = this.skbuff_get(iid, "atk_per");
  4488. // epVal += Math.floor((epVal * atk_per) / 10000);
  4489. // }
  4490. // //防御
  4491. // if (key == "def") {
  4492. // let def_per = this.skbuff_get(iid, "def_per");
  4493. // epVal += Math.floor((epVal * def_per) / 10000);
  4494. // }
  4495. // //生命百分比
  4496. // if (key == "hp_max") {
  4497. // let hp_max_per = this.skbuff_get(iid, "hp_max_per");
  4498. // epVal += Math.floor((epVal * hp_max_per) / 10000);
  4499. // }
  4500. // //生命百分比
  4501. // if (key == "hp") {
  4502. // let hp_per = this.skbuff_get(iid, "hp_per");
  4503. // epVal += Math.floor((epVal * hp_per) / 10000);
  4504. // }
  4505. // return Math.floor(epVal);
  4506. // }
  4507. // /**
  4508. // * 辅助函数 - 清除buff
  4509. // */
  4510. // private skbuff_clear() {
  4511. // for (let index = 0; index < this.teamFiids.length; index++) {
  4512. // let fiid = this.teamFiids[index];
  4513. // if (this.teams[fiid].eps.hp <= 0) {
  4514. // this.uuids[fiid].skbuff = {};
  4515. // }
  4516. // //let skbuffCopy = gameMethod.objCopy(this.uuids[fiid].skbuff);
  4517. // this.uuids[fiid].skbuff = {};
  4518. // // let keys = Object.keys(skbuffCopy)
  4519. // let keys = this.changeSkBuff(1, fiid, null, 1);
  4520. // for (let k = 0; k < keys.length; k++) {
  4521. // //计算属性 这里in没关系
  4522. // // let values = Object.values(skbuffCopy[keys[k]])
  4523. // let values = this.changeSkBuff(1, fiid, keys[k], 2);
  4524. // for (let j = 0; j < values.length; j++) {
  4525. // if (this.zhen >= values[j].ezhen) {
  4526. // this.oneBuff[fiid] = 1;
  4527. // if (gameMethod.isEmpty(values[j].eps["i_9_id"]) == false) {
  4528. // this.sk_effect(fiid, values[j].eps["i_9_skin"].toString(), values[j].eps["i_9_id"].toString(), "", {
  4529. // do_iid: Number(fiid),
  4530. // nextid: 1,
  4531. // });
  4532. // }
  4533. // continue;
  4534. // }
  4535. // if (this.uuids[fiid].skbuff[keys[k]] == null) {
  4536. // this.uuids[fiid].skbuff[keys[k]] = [];
  4537. // }
  4538. // this.uuids[fiid].skbuff[keys[k]].push(values[j]);
  4539. // }
  4540. // }
  4541. // this.changeSkBuff(2, fiid, null, 1, this.uuids[fiid].skbuff);
  4542. // if (this.skbuff_get(fiid, "effect_i_9", 2) <= 0) {
  4543. // let values = Object.values(this.uuids[fiid].podun);
  4544. // for (let k = 0; k < values.length; k++) {
  4545. // this.skbuff_sub_all(fiid, values[k]);
  4546. // }
  4547. // }
  4548. // if (this.skbuff_get(fiid, "effect_i_4", 2) <= 0) {
  4549. // this.skbuff_sub_all(fiid, "effect_i_59");
  4550. // }
  4551. // }
  4552. // }
  4553. // /**
  4554. // * 辅助函数 - 输出BUFF
  4555. // */
  4556. // private skbuff_outf() {
  4557. // let keys = Object.keys(this.oneBuff);
  4558. // for (let k = 0; k < keys.length; k++) {
  4559. // this.addOneAtk(keys[k], keys[k], "aType", Xys.ActionType.buff);
  4560. // // let keys2 = Object.keys(this.uuids[keys[k]].skbuff)
  4561. // let keys2 = this.changeSkBuff(1, keys[k], null, 1);
  4562. // for (let j = 0; j < keys2.length; j++) {
  4563. // this.addOneAtk(keys[k], keys[k], "buff", [keys2[j], this.uuids[keys[k]].skbuff[keys2[j]].length]);
  4564. // }
  4565. // }
  4566. // }
  4567. // /**
  4568. // * 辅助函数 - 添加属性值
  4569. // */
  4570. // private skbuff_add(cs: skbuff_add_cs) {
  4571. // let eff_i_12 = this.skbuff_get(cs.fiid, "effect_i_12", 2);
  4572. // if (eff_i_12 > 0) {
  4573. // if (["effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_6"].includes(cs.key)) {
  4574. // return;
  4575. // }
  4576. // if (cs.key.includes("effect_i_0")) {
  4577. // let keys = Object.keys(cs.eps);
  4578. // for (let k = 0; k < keys.length; k++) {
  4579. // if (this.teams[cs.fiid].eps[keys[k]] == null) {
  4580. // continue;
  4581. // }
  4582. // if (cs.eps[keys[k]] < 0) {
  4583. // return;
  4584. // }
  4585. // }
  4586. // }
  4587. // }
  4588. // if (cs.overlayType == 1) {
  4589. // //1.叠加 2.不叠加替换,默认不填值就是不叠加
  4590. // if (this.uuids[cs.fiid].skbuff[cs.key] == null) {
  4591. // this.uuids[cs.fiid].skbuff[cs.key] = [];
  4592. // }
  4593. // for (let index = 0; index < cs.ceng; index++) {
  4594. // this.uuids[cs.fiid].skbuff[cs.key].push({
  4595. // szhen: cs.minZhen, //开始帧
  4596. // ezhen: cs.maxZhen, //结束帧
  4597. // eps: cs.eps, //属性值
  4598. // });
  4599. // }
  4600. // } else {
  4601. // this.uuids[cs.fiid].skbuff[cs.key] = [];
  4602. // for (let index = 0; index < cs.ceng; index++) {
  4603. // this.uuids[cs.fiid].skbuff[cs.key].push({
  4604. // szhen: cs.minZhen, //开始帧
  4605. // ezhen: cs.maxZhen, //结束帧
  4606. // eps: cs.eps, //属性值
  4607. // });
  4608. // }
  4609. // }
  4610. // this.changeSkBuff(2, cs.fiid, cs.key, 1, this.uuids[cs.fiid].skbuff[cs.key]);
  4611. // this.oneBuff[cs.fiid] = 1;
  4612. // }
  4613. // /**
  4614. // * 辅助函数 - 修改属性值
  4615. // */
  4616. // private skbuff_update(iid: string, eps: { [p: string]: number }, type: number = 0) {
  4617. // if (this.teams[iid] == null) {
  4618. // return;
  4619. // }
  4620. // if (type === 1) {
  4621. // this.teams[iid].eps = eps;
  4622. // } else {
  4623. // let keys = Object.keys(eps);
  4624. // for (let k = 0; k < keys.length; k++) {
  4625. // this.teams[iid].eps[keys[k]] = eps[keys[k]];
  4626. // }
  4627. // }
  4628. // }
  4629. // /**
  4630. // * 辅助函数 - 删除属性值 (1个)
  4631. // */
  4632. // private skbuff_sub(fiid: string, key: string) {
  4633. // if (this.uuids[fiid] == null) {
  4634. // return;
  4635. // }
  4636. // if (gameMethod.isEmpty(this.uuids[fiid].skbuff[key]) == true) {
  4637. // return;
  4638. // }
  4639. // this.uuids[fiid].skbuff[key].splice(0, 1);
  4640. // this.changeSkBuff(2, fiid, key, 1, this.uuids[fiid].skbuff[key]);
  4641. // this.oneBuff[fiid] = 1;
  4642. // }
  4643. // /**
  4644. // * 辅助函数 - 删除属性值 (所有)
  4645. // */
  4646. // private skbuff_sub_all(fiid: string, key: string) {
  4647. // if (this.uuids[fiid] == null) {
  4648. // return;
  4649. // }
  4650. // if (gameMethod.isEmpty(this.uuids[fiid].skbuff[key]) == true) {
  4651. // return;
  4652. // }
  4653. // //delete this.uuids[fiid].skbuff[key];
  4654. // this.changeSkBuff(3, fiid, key);
  4655. // if (key == "effect_i_4" && this.uuids[fiid].skbuff["effect_i_59"]) {
  4656. // // 火焰清除时 对应的火焰增伤也清除
  4657. // //delete this.uuids[fiid].skbuff["effect_i_59"]
  4658. // this.changeSkBuff(3, fiid, "effect_i_59");
  4659. // }
  4660. // this.oneBuff[fiid] = 1;
  4661. // }
  4662. // /**
  4663. // * 辅助函数 - 最终伤害增减
  4664. // * @param iid 打人
  4665. // * @param fiid 被打人
  4666. // * @param hit 造成的伤害
  4667. // */
  4668. // private hit_last(iid: string, fiid: string, hit: number, isfj: number = 0): number {
  4669. // if (hit <= 0) {
  4670. // return 0;
  4671. // }
  4672. // let add_per: number = 0;
  4673. // //最终伤害降低xx%
  4674. // let i_13_nZhen = this.skbuff_get(fiid, "i_13_nZhen");
  4675. // if (this.skbuff_get(fiid, "effect_i_13", 2) > 0 && this.zhen >= i_13_nZhen) {
  4676. // add_per += this.skbuff_get(fiid, "i_13");
  4677. // let cd = this.skbuff_get(fiid, "i_13_cd");
  4678. // if (cd > 0) {
  4679. // this.skbuff_update(fiid, { i_13_nZhen: cd * 30 + this.zhen });
  4680. // }
  4681. // }
  4682. // hit += Math.floor((hit * add_per) / 10000);
  4683. // // 计算个人战力差 系数
  4684. // hit = Math.floor(this.powerDisparity(iid, fiid) * hit);
  4685. // hit = Math.max(0, hit);
  4686. // let f_i_9 = this.skbuff_get(fiid, "i_9");
  4687. // if (f_i_9 > 0) {
  4688. // //有护盾
  4689. // let f_i_61 = this.skbuff_get(fiid, "i_61") / 10000;
  4690. // let i_i_82 = this.skbuff_get(iid, "i_82") / 10000;
  4691. // //let copy = gameMethod.objCopy(this.uuids[fiid].skbuff["effect_i_9"]);
  4692. // this.uuids[fiid].skbuff["effect_i_9"] = [];
  4693. // // let values = Object.values(copy)
  4694. // let values = this.changeSkBuff(1, fiid, "effect_i_9", 2);
  4695. // for (let k = 0; k < values.length; k++) {
  4696. // let skbuff = values[k];
  4697. // //计算属性 这里in没关系
  4698. // let i_9_add = Math.floor(skbuff.eps["i_9"] * (f_i_61 - i_i_82));
  4699. // if (hit >= skbuff.eps["i_9"] + i_9_add) {
  4700. // hit -= skbuff.eps["i_9"] + i_9_add;
  4701. // skbuff.eps["i_9"] = 0;
  4702. // if (gameMethod.isEmpty(skbuff.eps["i_9_id"]) == false) {
  4703. // this.sk_effect(fiid, skbuff.eps["i_9_skin"].toString(), skbuff.eps["i_9_id"].toString(), "", {
  4704. // do_iid: Number(fiid),
  4705. // nextid: 1,
  4706. // });
  4707. // }
  4708. // this.timer_do(105, { do_iid: Number(fiid) }); //护体罡气破碎时触发
  4709. // this.oneBuff[fiid] = 1;
  4710. // } else {
  4711. // skbuff.eps["i_9"] -= hit - i_9_add;
  4712. // hit = 0;
  4713. // this.uuids[fiid].skbuff["effect_i_9"].push(skbuff);
  4714. // }
  4715. // if (isfj === 1) {
  4716. // this.addOneAtk(fiid, fiid, "effect", ["i_9", skbuff.eps["i_9"]]);
  4717. // } else {
  4718. // this.addOneAtk(iid, fiid, "effect", ["i_9", skbuff.eps["i_9"]]);
  4719. // }
  4720. // }
  4721. // this.changeSkBuff(2, fiid, "effect_i_9", 1, this.uuids[fiid].skbuff["effect_i_9"]);
  4722. // }
  4723. // return Math.floor(hit);
  4724. // }
  4725. // // 个人战力差
  4726. // private powerDisparity(iid: string, fiid: string, power?: number, fPower?: number): number {
  4727. // let pct1 = 1;
  4728. // let pct2 = 1;
  4729. // let ilen = iid.length;
  4730. // let flen = fiid.length;
  4731. // if (this.damage[ilen] && this.damage[ilen][flen]) {
  4732. // return this.damage[ilen][flen];
  4733. // }
  4734. // if (this.damage[ilen] == null) {
  4735. // this.damage[ilen] = {};
  4736. // }
  4737. // if (this.damage[flen] == null) {
  4738. // this.damage[flen] = {};
  4739. // }
  4740. // this.damage[ilen][flen] = pct1;
  4741. // this.damage[flen][ilen] = pct2;
  4742. // if (power != null && fPower != null) {
  4743. // if (power == 0 || fPower == 0) {
  4744. // return pct1;
  4745. // }
  4746. // // 战力差
  4747. // let powerC = Math.abs(power - fPower);
  4748. // // 战力比
  4749. // let powerB = Math.min(power, fPower) / Math.max(power, fPower);
  4750. // let index = 1;
  4751. // while (index > 0) {
  4752. // let damage = Gamecfg.userDamage.getItem(index.toString());
  4753. // if (damage != null) {
  4754. // if (
  4755. // damage.zhanlirange[0] <= powerC &&
  4756. // ((damage.zhanlirange.length == 2 && powerC <= damage.zhanlirange[1]) || damage.zhanlirange.length == 1) &&
  4757. // damage.ratio[0] <= powerB &&
  4758. // powerB <= damage.ratio[1]
  4759. // ) {
  4760. // if (power > fPower) {
  4761. // pct1 += damage.xishua;
  4762. // pct2 -= damage.xishub;
  4763. // } else {
  4764. // pct1 -= damage.xishub;
  4765. // pct2 += damage.xishua;
  4766. // }
  4767. // index = -1;
  4768. // } else {
  4769. // index++;
  4770. // }
  4771. // } else {
  4772. // index = -1;
  4773. // }
  4774. // }
  4775. // this.damage[ilen][flen] = pct1;
  4776. // this.damage[flen][ilen] = pct2;
  4777. // }
  4778. // return pct1;
  4779. // }
  4780. // /**
  4781. // * 是否暴击
  4782. // * @param iid
  4783. // * @param fiid
  4784. // * 暴击率=max((我方暴击-敌方抗暴击),暴击保底参数)
  4785. // */
  4786. // private isBaoji(iid: string, fiid: string): number {
  4787. // if (this.teams[iid].type == 3) {
  4788. // return 0;
  4789. // }
  4790. // let isBj: number = 0;
  4791. // let ef_i_24 = this.skbuff_get(iid, "effect_i_24", 2);
  4792. // if (ef_i_24 > 0) {
  4793. // //必定暴击
  4794. // this.skbuff_sub_all(iid, "effect_i_24");
  4795. // isBj = 1;
  4796. // return isBj;
  4797. // }
  4798. // let ef_i_80 = this.skbuff_get(iid, "effect_i_80", 2);
  4799. // let ef_i_80_buff = this.skbuff_get(iid, "i_80_buff");
  4800. // if (ef_i_80 > 0 && this.skbuff_get(fiid, "effect_i_" + ef_i_80_buff, 2) > 0) {
  4801. // //必定暴击
  4802. // this.skbuff_sub_all(iid, "effect_i_80");
  4803. // isBj = 1;
  4804. // return isBj;
  4805. // }
  4806. // let i_baoji: number = this.skbuff_get(iid, "baoji");
  4807. // let f_hsbaoji: number = this.skbuff_get(fiid, "hsbaoji");
  4808. // let bdbaoji: number = 0; //保底暴击
  4809. // let cfg = Gamecfg.userEp.getItem("baoji");
  4810. // if (cfg != null) {
  4811. // bdbaoji = cfg.initEp;
  4812. // }
  4813. // if (this.seedRand.rand(1, 10000) <= Math.max(i_baoji - f_hsbaoji, bdbaoji)) {
  4814. // isBj = 1;
  4815. // }
  4816. // return isBj;
  4817. // }
  4818. // /**
  4819. // * 是否连击 只打一次
  4820. // * @param iid
  4821. // * @param fiid
  4822. // */
  4823. // private isLianji(iid: string, fiid: string): number {
  4824. // if (this.jueFiidHp(iid) <= 0 || this.jueFiidHp(fiid) <= 0) {
  4825. // return 0; //其中一个死了
  4826. // }
  4827. // if (this.teams[iid].type == 3) {
  4828. // return 0;
  4829. // }
  4830. // let isLj: number = 0;
  4831. // let i_lianji: number = this.skbuff_get(iid, "lianji");
  4832. // let f_hslianji: number = this.skbuff_get(fiid, "hslianji");
  4833. // let bdlianji: number = 0; //保底暴击
  4834. // let cfg = Gamecfg.userEp.getItem("lianji");
  4835. // if (cfg != null) {
  4836. // bdlianji = cfg.initEp;
  4837. // }
  4838. // if (this.seedRand.rand(1, 10000) <= i_lianji - f_hslianji) {
  4839. // isLj = 1;
  4840. // }
  4841. // return isLj;
  4842. // }
  4843. // /**
  4844. // * 是否格挡
  4845. // * 敌方格挡率=max((敌方格挡-我方抗格挡),格挡保底参数)
  4846. // * @param iid
  4847. // * @param fiid
  4848. // * 1.敌人如果处于晕眩、冰冻中,则直接不触发格挡,跳过格挡率计算过程
  4849. // * 2.如果敌人处于非晕眩、冰冻中,则按格挡率判断
  4850. // */
  4851. // private isGedang(iid: string, fiid: string): number {
  4852. // if (this.teams[iid].type == 3) {
  4853. // return 0;
  4854. // }
  4855. // let isGd: number = 0;
  4856. // let f_i_3: number = this.skbuff_get(fiid, "effect_i_3", 2);
  4857. // if (f_i_3 > 0) {
  4858. // return isGd;
  4859. // }
  4860. // let f_i_5: number = this.skbuff_get(fiid, "effect_i_5", 2);
  4861. // if (f_i_5 > 0) {
  4862. // return isGd;
  4863. // }
  4864. // let f_block: number = this.skbuff_get(fiid, "block");
  4865. // let i_hsblock: number = this.skbuff_get(iid, "hsblock");
  4866. // let bdGedang: number = 0; //保底格挡
  4867. // let cfg = Gamecfg.userEp.getItem("block");
  4868. // if (cfg != null) {
  4869. // bdGedang = cfg.initEp;
  4870. // }
  4871. // if (this.seedRand.rand(1, 10000) <= Math.max(f_block - i_hsblock, bdGedang)) {
  4872. // isGd = 1;
  4873. // }
  4874. // return isGd;
  4875. // }
  4876. // /**
  4877. // * 是否反击
  4878. // * @param iid
  4879. // * @param fiid
  4880. // * 敌方反击率=max((敌方反击-我方抗反击),反击保底参数)
  4881. // * 1.触犯反击时攻击不能被敌人格挡,必须百分百命中,(也就是说不会被敌人格挡)
  4882. // * 2.触犯反击时攻击不会继续判断是否触发暴击(也就是不会触发暴击)
  4883. // * 3.触发反击时不会触发眩晕、连击、溅射
  4884. // * 4.反击后不能再触发反击
  4885. // */
  4886. // private isFanji(iid: string, fiid: string): number {
  4887. // if (this.jueFiidHp(iid) <= 0 || this.jueFiidHp(fiid) <= 0) {
  4888. // return 0; //其中一个死了
  4889. // }
  4890. // if (this.teams[iid].type == 3 || this.teams[fiid].type == 3) {
  4891. // return 0;
  4892. // }
  4893. // let isfj: number = 0;
  4894. // let i_fanji: number = this.skbuff_get(iid, "fanji");
  4895. // let f_hsfanji: number = this.skbuff_get(fiid, "hsfanji");
  4896. // let bdfanji: number = 0; //保底反击
  4897. // let cfg = Gamecfg.userEp.getItem("fanji");
  4898. // if (cfg != null) {
  4899. // bdfanji = cfg.initEp;
  4900. // }
  4901. // if (this.seedRand.rand(1, 10000) <= Math.max(i_fanji - f_hsfanji, bdfanji)) {
  4902. // isfj = 1;
  4903. // }
  4904. // return isfj;
  4905. // }
  4906. // /**
  4907. // * 增减蓝条
  4908. // * @param fiid
  4909. // * @param num
  4910. // * @returns
  4911. // */
  4912. // private add_mp(fiid: string, num: number, wz: 0 | 1 | 2) {
  4913. // if (this.teams[fiid] == null) {
  4914. // return;
  4915. // }
  4916. // if (Number(fiid) % 100 != 0) {
  4917. // return;
  4918. // }
  4919. // if (this.mpfiids[fiid] == null) {
  4920. // this.mpfiids[fiid] = [0, 0];
  4921. // }
  4922. // if (wz == 0 || wz == 1) {
  4923. // if (this.mpfiids[fiid][wz] == 1) {
  4924. // return;
  4925. // }
  4926. // this.mpfiids[fiid][wz] = 1;
  4927. // }
  4928. // this.teams[fiid].eps["mp"] = Math.max(this.teams[fiid].eps["mp"], 0);
  4929. // this.teams[fiid].eps["mp"] += Math.floor(num);
  4930. // this.teams[fiid].eps["mp"] = Math.min(this.teams[fiid].eps["mp"], 10000);
  4931. // this.addOneAtk(fiid, fiid, "aType", Xys.ActionType.effect);
  4932. // this.addOneAtk(fiid, fiid, "effect", ["mp", num]);
  4933. // }
  4934. // /**
  4935. // * 添加轮询执行脚本
  4936. // */
  4937. // private timer_add(addTimer: timer_add_cs) {
  4938. // if (this.uuids[addTimer.iid] == null) {
  4939. // return; //兼容不存在的人
  4940. // }
  4941. // let cs = gameMethod.objCopy(addTimer.cs);
  4942. // if (cs["timerId"] == null) {
  4943. // cs["timerId"] = this.timerId;
  4944. // }
  4945. // if (addTimer.type[0] == 602) {
  4946. // if (this.uuids[addTimer.iid].timer[addTimer.key] == null) {
  4947. // this.uuids[addTimer.iid].timer[addTimer.key] = {};
  4948. // }
  4949. // if (addTimer.overlayType == 2) {
  4950. // this.uuids[addTimer.iid].timer[addTimer.key] = {}; //换掉原来的
  4951. // }
  4952. // addTimer.key = addTimer.key + "_" + 602;
  4953. // if (this.uuids[addTimer.iid].timer[addTimer.key] == null) {
  4954. // this.uuids[addTimer.iid].timer[addTimer.key] = {};
  4955. // }
  4956. // if (addTimer.overlayType == 2) {
  4957. // this.uuids[addTimer.iid].timer[addTimer.key] = {}; //换掉原来的
  4958. // }
  4959. // this.uuids[addTimer.iid].timer[addTimer.key][cs["timerId"].toString()] = {
  4960. // fiids: addTimer.fiids, //执行触发点
  4961. // type: addTimer.type, //执行触发点
  4962. // func: addTimer.func, //执行的函数名
  4963. // szhen: this.zhen, //触发的帧
  4964. // lzhen: addTimer.lzhen, //轮询执行时间
  4965. // ezhen: addTimer.ezhen, //结束时间
  4966. // skid: addTimer.skid, //技能ID
  4967. // aeid: addTimer.aeid, //效果ID|行为ID
  4968. // cs: cs,
  4969. // };
  4970. // } else {
  4971. // if (this.uuids[addTimer.iid].timer[addTimer.key] == null) {
  4972. // this.uuids[addTimer.iid].timer[addTimer.key] = {};
  4973. // }
  4974. // if (addTimer.overlayType == 2) {
  4975. // this.uuids[addTimer.iid].timer[addTimer.key] = {}; //换掉原来的
  4976. // }
  4977. // this.uuids[addTimer.iid].timer[addTimer.key][cs["timerId"].toString()] = {
  4978. // fiids: addTimer.fiids, //执行触发点
  4979. // type: addTimer.type, //执行触发点
  4980. // func: addTimer.func, //执行的函数名
  4981. // szhen: this.zhen, //触发的帧
  4982. // lzhen: addTimer.lzhen, //轮询执行时间
  4983. // ezhen: addTimer.ezhen, //结束时间
  4984. // skid: addTimer.skid, //技能ID
  4985. // aeid: addTimer.aeid, //效果ID|行为ID
  4986. // cs: cs,
  4987. // };
  4988. // }
  4989. // this.changeTimer(2, addTimer.iid, addTimer.key, 1, this.uuids[addTimer.iid].timer[addTimer.key]);
  4990. // this.timerId += 1;
  4991. // }
  4992. // /**
  4993. // * 删除轮询执行脚本
  4994. // */
  4995. // private timer_sub(fiid: string, key: string) {
  4996. // if (this.uuids[fiid] == null) {
  4997. // return;
  4998. // }
  4999. // this.changeTimer(3, fiid, key);
  5000. // //delete this.uuids[fiid].timer[key];
  5001. // }
  5002. // /**
  5003. // * 删除轮询执行脚本 - 删除某个人的(关于他的定时器)
  5004. // */
  5005. // private timer_sub_by_fiid(fiid: string) {
  5006. // if (this.uuids[fiid] == null) {
  5007. // return;
  5008. // }
  5009. // for (let index = 0; index < this.teamFiids.length; index++) {
  5010. // let iid = this.teamFiids[index];
  5011. // // let keys = Object.keys(this.uuids[iid].timer);
  5012. // let keys = this.changeTimer(1, iid, null, 1);
  5013. // for (let k = 0; k < keys.length; k++) {
  5014. // // let keys2 = Object.keys(this.uuids[iid].timer[keys[k]])
  5015. // let keys2 = this.changeTimer(1, iid, keys[k], 1);
  5016. // for (let j = 0; j < keys2.length; j++) {
  5017. // if (this.uuids[iid].timer[keys[k]][keys2[j]] && this.uuids[iid].timer[keys[k]][keys2[j]].fiids) {
  5018. // let copyFiids: string[] = gameMethod.objCopy(this.uuids[iid].timer[keys[k]][keys2[j]].fiids);
  5019. // this.uuids[iid].timer[keys[k]][keys2[j]].fiids = [];
  5020. // let values = copyFiids;
  5021. // for (let l = 0; l < values.length; l++) {
  5022. // if (values[l] != fiid) {
  5023. // this.uuids[iid].timer[keys[k]][keys2[j]].fiids.push(values[l]);
  5024. // }
  5025. // }
  5026. // if (this.uuids[iid].timer[keys[k]][keys2[j]].fiids.length == 0) {
  5027. // delete this.uuids[iid].timer[keys[k]][keys2[j]];
  5028. // }
  5029. // }
  5030. // }
  5031. // }
  5032. // }
  5033. // this.changeTimer(2, null, null, 1);
  5034. // }
  5035. // /**
  5036. // * 执行轮询执行脚本
  5037. // * @param fiid 执行人
  5038. // * @param type 执行点
  5039. // */
  5040. // private timer_do(_type: number, cs: { [key: string]: number } = {}) {
  5041. // for (let i = 0; i < this.teamFiids.length; i++) {
  5042. // if (this.uuids[this.teamFiids[i]].dzhen > 0 && this.uuids[this.teamFiids[i]].dzhen < this.zhen) {
  5043. // continue; //死了 不应该在触发了
  5044. // }
  5045. // // let keys: string[] = Object.keys(this.uuids[this.teamFiids[i]].timer);
  5046. // let keys: string[] = this.changeTimer(1, this.teamFiids[i], null, 1);
  5047. // for (let k = 0; k < keys.length; k++) {
  5048. // // let timers = Object.values(this.uuids[this.teamFiids[i]].timer[keys[k]]);
  5049. // let timers = this.changeTimer(1, this.teamFiids[i], keys[k], 2);
  5050. // for (let j = 0; j < timers.length; j++) {
  5051. // if (_type != 0 && !timers[j].type.includes(_type)) {
  5052. // continue; //不是这个执行类型的
  5053. // }
  5054. // if (this.zhen < timers[j].szhen || this.zhen > timers[j].ezhen) {
  5055. // continue; //未开始或者过期了
  5056. // }
  5057. // if (this.zhen < timers[j].lzhen || (this.zhen - timers[j].szhen) % timers[j].lzhen > 0) {
  5058. // continue; //没有到当前帧触发
  5059. // }
  5060. // if (timers[j].func == "sk_effect") {
  5061. // if (cs["do_iid"] != Number(this.teamFiids[i])) {
  5062. // let pass: boolean = false;
  5063. // if (pass == false && _type == 404 && cs["do_iid"].toString().length != this.teamFiids[i].length) {
  5064. // pass = true;
  5065. // }
  5066. // if (pass == false && _type == 106 && timers[j].fiids.includes(cs["do_iid"].toString())) {
  5067. // pass = true;
  5068. // }
  5069. // if (pass == false && _type == 206 && cs["do_iid"].toString().length == this.teamFiids[i].length) {
  5070. // pass = true;
  5071. // }
  5072. // if (pass == false) {
  5073. // continue;
  5074. // }
  5075. // }
  5076. // if (this.oneFiids[this.teamFiids[i]] == null) {
  5077. // this.oneFiids[this.teamFiids[i]] = {};
  5078. // }
  5079. // let timer_fiids: string[] = [];
  5080. // let fiids = timers[j].fiids;
  5081. // for (let l = 0; l < fiids.length; l++) {
  5082. // if (this.uuids[fiids[l]]==null ){
  5083. // console.log("fiids===:",fiids)
  5084. // continue;
  5085. // }
  5086. // if (this.uuids[fiids[l]].dzhen > 0 && this.uuids[fiids[l]].dzhen < this.zhen) {
  5087. // continue; //死了 不应该在触发了
  5088. // }
  5089. // timer_fiids.push(fiids[l]);
  5090. // }
  5091. // if (timer_fiids.length <= 0 && timers[j].fiids.length != 0) {
  5092. // // 本身没有目标的定时器 不要跳过
  5093. // continue;
  5094. // }
  5095. // if (_type == 602) {
  5096. // keys[k] = keys[k].slice(0, keys[k].length - 4);
  5097. // }
  5098. // this.oneFiids[this.teamFiids[i]][keys[k]] = timer_fiids;
  5099. // let csCopy = gameMethod.objCopy(timers[j].cs);
  5100. // csCopy = Object.assign(csCopy, cs);
  5101. // if (_type === 601 || _type === 602) {
  5102. // csCopy["isTimer"] = 1;
  5103. // }
  5104. // this.sk_effect(this.teamFiids[i], timers[j].skid, timers[j].aeid, keys[k], csCopy);
  5105. // }
  5106. // }
  5107. // }
  5108. // }
  5109. // }
  5110. // /**
  5111. // * 解锁隐藏
  5112. // */
  5113. // private jiesuo_hide(iid: string) {
  5114. // let minLv: number = 999;
  5115. // let minfiid: string = "";
  5116. // let iidList: string[] = []
  5117. // for (let index = 0; index < this.teamFiids.length; index++) {
  5118. // let fiid = this.teamFiids[index];
  5119. // if (fiid.length != iid.length) {
  5120. // iidList.push(fiid);
  5121. // continue;
  5122. // }
  5123. // if (this.teams[fiid].isHide == 0) {
  5124. // continue;
  5125. // }
  5126. // if (this.teams[fiid].isHide < minLv) {
  5127. // if (minfiid != "") {
  5128. // this.teams[fiid].isHide = minLv;
  5129. // }
  5130. // minLv = this.teams[fiid].isHide;
  5131. // minfiid = fiid;
  5132. // }
  5133. // }
  5134. // if (minfiid != "") {
  5135. // // 清空上一只boss的异常状态
  5136. // for (let i=0;i<iidList.length;i++){
  5137. // for (let k=0;k<this.bateBuff.length;k++){
  5138. // this.skbuff_sub_all(iidList[i],this.bateBuff[k])
  5139. // }
  5140. // }
  5141. // this.teams[minfiid].isHide = 0;
  5142. // this.addOneAtk(minfiid, minfiid, "aType", Xys.ActionType.hide);
  5143. // this.addOneAtk(minfiid, minfiid, "effect", ["isHide", 0]);
  5144. // }
  5145. // }
  5146. // }