12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330 |
- // import * as Xys from "./Xys";
- // import Gamecfg from "./gameCfg";
- // import { SeedRand, gameMethod } from "./gameMethod";
- // //辅助函数 - 添加属性值
- // interface skbuff_add_cs {
- // fiid: string; //添加对象
- // key: string; //属性key
- // minZhen: number; //开始帧
- // maxZhen: number; //结束帧
- // overlayType: number; // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: number; //增加层数
- // eps: { [key: string]: number }; //属性
- // }
- // interface Gzhit {
- // pghit: number; //普攻伤害
- // skhit: number; //技能伤害
- // bjhit: number; //暴击伤害
- // gdhit: number; //格挡伤害
- // fjhit: number; //反击伤害
- // ljhit: number; //连击伤害
- // jshit: number; //溅射伤害(没有折损比例系数)
- // xxhit: number; //吸血值
- // xxRate: number; //吸血概率
- // jsRate: number; //溅射概率
- // fjsRate: number; //反击溅射概率
- // }
- // interface timer_add_cs {
- // iid: string; //触发者
- // fiids: string[]; //触发对象
- // key: string; //定时器标识
- // type: number[]; //执行触发点
- // func: "sk_effect" | "sk_action"; //执行的函数名
- // lzhen: number; //轮询执行时间
- // ezhen: number; //结束时间
- // skid: string; //技能ID
- // aeid: string; //效果ID|行为ID
- // cs: { [key: string]: number }; //参数
- // overlayType: number; // 1:叠加 2:不叠加替换
- // }
- // export class Fight {
- // teams: { [iid: string]: Xys.FightTeam } = {}; //战斗成员列表
- // seedRand: SeedRand; //随机种子函数
- // from: string; //战斗类型
- // timerId: number = 1; //定时计数器
- // uuids: {
- // [iid: string]: {
- // drain_sk: number; // 是否带有灵力术法
- // last: number; //最后一次出手帧
- // last2: number; //真正出手的帧
- // cons: number[]; //攻击次数 (普通+技能,被动不算) [攻击次数,连击次数,反击次数]
- // fcons: number[]; //被攻击次数 (普通+技能,被动不算) [攻击次数,连击次数,反击次数]
- // dzhen: number; //死亡的帧数
- // fpk: string; //最后一次伤害我的对象
- // ipk: string; //我打的最后一个
- // ipks: { [zhen: number]: string[] }; //我打的最后一个
- // podun: string[]; //盾没有了需要清除buff
- // skbuff: {
- // [key: string]: {
- // szhen: number; //开始帧
- // ezhen: number; //结束帧
- // eps: { [key: string]: number }; //属性值
- // }[];
- // };
- // skbase: {
- // //技能触发
- // [base_id: string]: {
- // last: number; //技能最后一次出手帧
- // count: number;
- // action: {
- // [action_id: string]: {};
- // };
- // effect: {
- // [effect_id: string]: {
- // effectZhen: number; //触发效果的帧(有时候同时一个攻击 好几个人触发效果分开计算的 会导致第一个人有触发 后面的没有触发)
- // effectEndZhen: number; //效果结束帧率(持续x秒,冷却x秒用的)
- // nextcd: number; //下一次冷却完成时间
- // count: number; //执行次数
- // f: number; //执行次数
- // };
- // };
- // };
- // };
- // //定时执行 [执行触发点,执行的函数名,轮询执行时间,技能ID, 效果ID|行为ID]
- // timer: {
- // [key: string]: {
- // [timerId: string]: {
- // fiids: string[]; //触发对象
- // type: number[]; //执行触发点
- // func: "sk_effect" | "sk_action"; //执行的函数名
- // szhen: number; //触发的帧
- // lzhen: number; //轮询执行时间
- // ezhen: number; //结束时间帧
- // skid: string; //技能ID
- // aeid: string; //效果ID|行为ID
- // cs: { [key: string]: number }; //
- // };
- // };
- // };
- // //执行触发点=>
- // //1:每帧开始执行 2:扣血执行 3:攻击后触发 4攻击前触发 5护体罡气破碎时触发
- // //6 :己方单位施加击退时 7 :普通攻击触发 8自身受到超过当前气血10%以上伤害时
- // //9:暴击触发
- // };
- // } = {}; //存放身份
- // objects: {
- // [len: string]: {
- // [type: string]: {
- // // 作用对象 1主角 2弟子 3兽灵
- // [skid: string]: {
- // //技能触发
- // cd: number; // 技能触发cd
- // sklv: number; // 技能等级
- // iids: {
- // [iid: string]: {
- // next: number; //技能最后一次出手帧
- // };
- // };
- // };
- // };
- // };
- // } = {}; //存放uid类型触发技能
- // zhen: number = 0; //初始帧
- // //单次出手临时记录
- // oneAtk: {
- // [iid: string]: {
- // [fiid: string]: {
- // aType: Xys.ActionType; //战斗动作类型
- // aSkid: ""; //使用的技能ID
- // effect: [string, number][]; //触发效果 [ [属性key,层数]]
- // buff: [string, number][]; //触发效果 [ [属性key,数值]]
- // };
- // };
- // } = {};
- // oneAtkiids: string[] = []; //日志顺序
- // //单帧出手对象
- // oneFiids: { [iid: string]: { [key: string]: string[] } } = {};
- // oneHit: {
- // [iid: string]: {
- // [fiid: string]: Gzhit;
- // };
- // } = {};
- // oneBuff: { [iid: string]: number } = {}; //存储当前帧 有改变buff的角色ID
- // mpfiids: { [iid: string]: [number, number] } = {}; // 单帧MP指回复一次
- // jsFiids: { [iid: string]: { [fiid: string]: number } } = {}; //溅射
- // //存储所有战场日志
- // outf: Xys.OverBack = {
- // win: 0, //0失败 1胜利
- // start: {
- // //初始阵容
- // from: "", //战斗类型
- // seed: 0, //随机种子
- // teams: {},
- // power: 0,
- // fPower: 0,
- // },
- // log: {}, //战斗日志列表
- // hurt: 0,
- // hp: 0, //战斗结束 对手剩余血量
- // tongji: {},
- // xhid:""
- // };
- // //血量变化相关字段
- // xueku: string[] = ["hp", "baoji", "lianji", "fanji", "canbeatback"];
- // // 减益buff
- // bateBuff: string[] = ["effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_6", "effect_i_7"];
- // teamFiids: string[] = [];
- // skBuff: {
- // [iid: string]: {
- // key: any;
- // value: any;
- // buff: {
- // [key: string]: {
- // key: any;
- // value: any;
- // };
- // };
- // };
- // } = {};
- // skTimer: {
- // [iid: string]: {
- // key: any;
- // value: any;
- // timer: {
- // [key: string]: {
- // key: any;
- // value: any;
- // };
- // };
- // };
- // } = {};
- // damage: {
- // [iid: string]: {
- // [fiid: string]: number;
- // };
- // } = {};
- // constructor(fightStart: Xys.ActFightStart) {
- // this.powerDisparity("1000", "100", fightStart.power, fightStart.fPower);
- // this.outf.start = gameMethod.objCopy(fightStart);
- // this.teams = gameMethod.objCopy(fightStart.teams); //战斗成员列表
- // this.seedRand = new SeedRand(fightStart.seed); //随机种子
- // this.from = fightStart.from; //战斗类型
- // this.teamFiids = Object.keys(this.teams);
- // this.war_init();
- // this.war_loop();
- // }
- // /*
- // * 技能buff
- // * this.uuids[cs.fiid].skbuff[cs.key]
- // * */
- // private changeSkBuff(sType: number, iid?: string | null, key?: string | null, type: number = 1, data?: any) {
- // switch (sType) {
- // case 1: // 查询 type:1.keys 2.values
- // if (iid) {
- // return this.getSkBuff(type, iid, key);
- // }
- // break;
- // case 2: // 更新/新增 type:1.替换 2.叠加
- // if (data) {
- // this.setSkBuff(data, iid, key, type);
- // }
- // break;
- // case 3: // 删除
- // if (iid) {
- // this.delSkBuff(iid, key);
- // }
- // break;
- // }
- // }
- // private setSkBuff(data: any, iid?: string | null, key?: string | null, type: number = 1) {
- // if (iid && key) {
- // if (type == 1) {
- // this.uuids[iid].skbuff[key] = data;
- // } else {
- // if (this.uuids[iid].skbuff[key] == null) {
- // this.uuids[iid].skbuff[key] = [];
- // }
- // this.uuids[iid].skbuff[key].push(...data);
- // }
- // if (this.skBuff[iid] == null) {
- // this.skBuff[iid] = { key: [], value: [], buff: {} };
- // }
- // if (this.skBuff[iid].buff[key] == null) {
- // this.skBuff[iid].buff[key] = { key: [], value: [] };
- // }
- // let keys2 = Object.keys(this.uuids[iid].skbuff);
- // let values2 = Object.values(this.uuids[iid].skbuff);
- // this.skBuff[iid].key = keys2;
- // this.skBuff[iid].value = values2;
- // this.skBuff[iid].buff[key].key = Object.keys(this.uuids[iid].skbuff[key]);
- // this.skBuff[iid].buff[key].value = Object.values(this.uuids[iid].skbuff[key]);
- // } else if (iid && !key) {
- // if (type == 1) {
- // this.uuids[iid].skbuff = data;
- // this.skBuff[iid] = { key: [], value: [], buff: {} };
- // } else {
- // this.uuids[iid].skbuff = Object.assign(this.uuids[iid].skbuff, data);
- // }
- // if (this.skBuff[iid] == null) {
- // this.skBuff[iid] = { key: [], value: [], buff: {} };
- // }
- // let keys2 = Object.keys(this.uuids[iid].skbuff);
- // let values2 = Object.values(this.uuids[iid].skbuff);
- // this.skBuff[iid].key = keys2;
- // this.skBuff[iid].value = values2;
- // for (let k = 0; k < keys2.length; k++) {
- // if (this.skBuff[iid].buff[keys2[k]] == null) {
- // this.skBuff[iid].buff[keys2[k]] = { key: [], value: [] };
- // }
- // this.skBuff[iid].buff[keys2[k]].key = Object.keys(this.uuids[iid].skbuff[keys2[k]]);
- // this.skBuff[iid].buff[keys2[k]].value = Object.values(this.uuids[iid].skbuff[keys2[k]]);
- // }
- // } else if (!iid && !key && data) {
- // let keys = this.teamFiids;
- // for (let i = 0; i < keys.length; i++) {
- // let keys2 = Object.keys(this.uuids[keys[i]].skbuff);
- // let values2 = Object.values(this.uuids[keys[i]].skbuff);
- // if (this.skBuff[keys[i]] == null) {
- // this.skBuff[keys[i]] = { key: [], value: [], buff: {} };
- // }
- // this.skBuff[keys[i]].key = keys2;
- // this.skBuff[keys[i]].value = values2;
- // for (let k = 0; k < keys2.length; k++) {
- // if (this.skBuff[keys[i]].buff[keys2[k]] == null) {
- // this.skBuff[keys[i]].buff[keys2[k]] = { key: [], value: [] };
- // }
- // this.skBuff[keys[i]].buff[keys2[k]].key = Object.keys(this.uuids[keys[i]].skbuff[keys2[k]]);
- // this.skBuff[keys[i]].buff[keys2[k]].value = Object.values(this.uuids[keys[i]].skbuff[keys2[k]]);
- // }
- // }
- // }
- // }
- // private delSkBuff(iid: string, key?: string | null) {
- // if (iid && key) {
- // delete this.uuids[iid].skbuff[key];
- // if (this.skBuff[iid] == null) {
- // this.skBuff[iid] = { key: [], value: [], buff: {} };
- // }
- // delete this.skBuff[iid].buff[key];
- // this.skBuff[iid].key = Object.keys(this.uuids[iid].skbuff);
- // this.skBuff[iid].value = Object.values(this.uuids[iid].skbuff);
- // } else if (iid && !key) {
- // if (this.skBuff[iid] == null) {
- // this.skBuff[iid] = { key: [], value: [], buff: {} };
- // }
- // this.uuids[iid].skbuff = {};
- // this.skBuff[iid].buff = {};
- // this.skBuff[iid].key = [];
- // this.skBuff[iid].value = [];
- // }
- // }
- // private getSkBuff(type: number, iid: string, key?: string | null) {
- // if (type == 1) {
- // if (iid && key) {
- // if (this.skBuff[iid] && this.skBuff[iid].buff[key]) {
- // return this.skBuff[iid].buff[key].key;
- // } else {
- // return [];
- // }
- // } else if (iid) {
- // if (this.skBuff[iid]) {
- // return this.skBuff[iid].key;
- // } else {
- // return [];
- // }
- // }
- // } else {
- // if (iid && key) {
- // if (this.skBuff[iid] && this.skBuff[iid].buff[key]) {
- // return this.skBuff[iid].buff[key].value;
- // } else {
- // return [];
- // }
- // } else if (iid) {
- // if (this.skBuff[iid]) {
- // return this.skBuff[iid].value;
- // } else {
- // return [];
- // }
- // }
- // }
- // }
- // /*
- // * 定时器timer
- // * this.uuids[iid].timer[key]
- // * */
- // private changeTimer(sType: number, iid?: string | null, key?: string | null, type: number = 1, data?: any) {
- // switch (sType) {
- // case 1: // 查询 type:1.keys 2.values
- // if (iid) {
- // return this.getTimer(type, iid, key);
- // }
- // break;
- // case 2: // 更新/新增 type:1.替换 2.叠加
- // if (data) {
- // this.setTimer(data, iid, key, type);
- // }
- // break;
- // case 3: // 删除
- // if (iid) {
- // this.delTimer(iid, key);
- // }
- // break;
- // }
- // }
- // private setTimer(data: any, iid?: string | null, key?: string | null, type: number = 1) {
- // if (iid && key) {
- // if (type == 1) {
- // this.uuids[iid].timer[key] = data;
- // } else {
- // if (this.uuids[iid].timer[key] == null) {
- // this.uuids[iid].timer[key] = {};
- // }
- // this.uuids[iid].timer[key] = Object.assign(this.uuids[iid].timer[key], data);
- // }
- // if (this.skTimer[iid] == null) {
- // this.skTimer[iid] = { key: [], value: [], timer: {} };
- // }
- // if (this.skTimer[iid].timer[key] == null) {
- // this.skTimer[iid].timer[key] = { key: [], value: [] };
- // }
- // let keys2 = Object.keys(this.uuids[iid].timer);
- // let values2 = Object.values(this.uuids[iid].timer);
- // this.skTimer[iid].key = keys2;
- // this.skTimer[iid].value = values2;
- // this.skTimer[iid].timer[key].key = Object.keys(this.uuids[iid].timer[key]);
- // this.skTimer[iid].timer[key].value = Object.values(this.uuids[iid].timer[key]);
- // } else if (iid && !key) {
- // if (type == 1) {
- // this.uuids[iid].timer = data;
- // this.skTimer[iid] = { key: [], value: [], timer: {} };
- // } else {
- // this.uuids[iid].timer = Object.assign(this.uuids[iid].timer, data);
- // }
- // if (this.skTimer[iid] == null) {
- // this.skTimer[iid] = { key: [], value: [], timer: {} };
- // }
- // let keys2 = Object.keys(this.uuids[iid].timer);
- // let values2 = Object.values(this.uuids[iid].timer);
- // this.skTimer[iid].key = keys2;
- // this.skTimer[iid].value = values2;
- // for (let k = 0; k < keys2.length; k++) {
- // if (this.skTimer[iid].timer[keys2[k]] == null) {
- // this.skTimer[iid].timer[keys2[k]] = { key: [], value: [] };
- // }
- // this.skTimer[iid].timer[keys2[k]].key = Object.keys(this.uuids[iid].timer[keys2[k]]);
- // this.skTimer[iid].timer[keys2[k]].value = Object.values(this.uuids[iid].timer[keys2[k]]);
- // }
- // } else if (!iid && !key && data) {
- // let keys = this.teamFiids;
- // for (let i = 0; i < keys.length; i++) {
- // let keys2 = Object.keys(this.uuids[keys[i]].timer);
- // let values2 = Object.values(this.uuids[keys[i]].timer);
- // if (this.skTimer[keys[i]] == null) {
- // this.skTimer[keys[i]] = { key: [], value: [], timer: {} };
- // }
- // this.skTimer[keys[i]].key = keys2;
- // this.skTimer[keys[i]].value = values2;
- // for (let k = 0; k < keys2.length; k++) {
- // if (this.skTimer[keys[i]].timer[keys2[k]] == null) {
- // this.skTimer[keys[i]].timer[keys2[k]] = { key: [], value: [] };
- // }
- // this.skTimer[keys[i]].timer[keys2[k]].key = Object.keys(this.uuids[keys[i]].timer[keys2[k]]);
- // this.skTimer[keys[i]].timer[keys2[k]].value = Object.values(this.uuids[keys[i]].timer[keys2[k]]);
- // }
- // }
- // }
- // }
- // private delTimer(iid: string, key?: string | null) {
- // if (iid && key) {
- // delete this.uuids[iid].timer[key];
- // if (this.skTimer[iid] == null) {
- // this.skTimer[iid] = { key: [], value: [], timer: {} };
- // }
- // if (this.skTimer[iid] && this.skTimer[iid].timer[key]) {
- // delete this.skTimer[iid].timer[key];
- // }
- // this.skTimer[iid].key = Object.keys(this.uuids[iid].timer);
- // this.skTimer[iid].value = Object.values(this.uuids[iid].timer);
- // } else if (iid && !key) {
- // if (this.skTimer[iid] == null) {
- // this.skTimer[iid] = { key: [], value: [], timer: {} };
- // }
- // this.uuids[iid].timer = {};
- // this.skTimer[iid].timer = {};
- // this.skTimer[iid].key = [];
- // this.skTimer[iid].value = [];
- // }
- // }
- // private getTimer(type: number, iid: string, key?: string | null) {
- // if (type == 1) {
- // if (iid && key) {
- // if (this.skTimer[iid] && this.skTimer[iid].timer[key]) {
- // return this.skTimer[iid].timer[key].key;
- // } else {
- // return [];
- // }
- // } else if (iid) {
- // if (this.skTimer[iid]) {
- // return this.skTimer[iid].key;
- // } else {
- // return [];
- // }
- // }
- // } else {
- // if (iid && key) {
- // if (this.skTimer[iid] && this.skTimer[iid].timer[key]) {
- // return this.skTimer[iid].timer[key].value;
- // } else {
- // return [];
- // }
- // } else if (iid) {
- // if (this.skTimer[iid]) {
- // return this.skTimer[iid].value;
- // } else {
- // return [];
- // }
- // }
- // }
- // }
- // /**
- // * 初始化战斗
- // */
- // private war_init() {
- // this.zhen = 1;
- // let minLast: number = 99999;
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // //初始化 这里in没关系
- // let last = Math.ceil(30 / (this.teams[fiid].eps.speed / 10000));
- // minLast = Math.min(minLast, last);
- // }
- // minLast = -1 * (minLast - 5); // 最快的那个人从第五帧开始打
- // //初始化存储
- // let drain_sk: number = 0;
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // if (drain_sk == 0 && ["100", "1000"].includes(fiid)) {
- // drain_sk = 1; // 直接都可以加
- // /*let skids: string[] = Object.keys(this.teams[fiid].sk);
- // for (let index = 0; index < skids.length; index++) {
- // let sk_base = Gamecfg.skillBase.getItem(skids[index], "1");
- // if (sk_base && sk_base.drain > 0) {
- // drain_sk = 1;
- // break;
- // }
- // }*/
- // }
- // //初始化 这里in没关系
- // this.uuids[fiid] = {
- // drain_sk: drain_sk,
- // last: minLast,
- // last2: 0,
- // cons: [0, 0, 0],
- // fcons: [0, 0, 0],
- // podun: [],
- // skbuff: {},
- // skbase: {},
- // fpk: "",
- // ipk: "", //我打的最后一个
- // ipks: {}, //我打的最后一个
- // dzhen: 0,
- // timer: {},
- // };
- // }
- // }
- // /**
- // * 开始战斗
- // */
- // private war_loop() {
- // this.outf.win = 0;
- // while (this.zhen < 1350) {
- // this.outf.log[this.zhen] = [];
- // this.oneAtkiids = [];
- // this.oneAtk = {};
- // this.mpfiids = {};
- // this.oneFiids = {}; //上一帧的对手清空
- // this.oneHit = {}; //上一帧的伤害清空
- // this.oneBuff = {}; //清除上一帧的变动buff的fiid
- // this.jsFiids = {};
- // if (this.zhen == 1) {
- // //触发进入战斗技能
- // for (let i = 0; i < this.teamFiids.length; i++) {
- // this.sk_baseObjRun4(this.teamFiids[i]); //技能转换
- // }
- // for (let i = 0; i < this.teamFiids.length; i++) {
- // this.sk_base(this.teamFiids[i], 4); //技能触发
- // }
- // //灵力满怒时释放
- // if (this.teams["100"] != null && this.teams["100"].eps.mp >= 10000) {
- // let result = this.sk_base("100", 3); //技能触发
- // if (result){ // 技能释放成功才扣怒气
- // this.add_mp("100", -10000, 2);
- // }
- // }
- // if (this.teams["1000"] != null && this.teams["1000"].eps.mp >= 10000) {
- // let result = this.sk_base("1000", 3); //技能触发
- // if (result){ // 技能释放成功才扣怒气
- // this.add_mp("1000", -10000, 2);
- // }
- // }
- // }
- // if (this.zhen == 2){
- // for (let i = 0; i < this.teamFiids.length; i++) {
- // if(this.teams[this.teamFiids[i]].type == 4 || this.teams[this.teamFiids[i]].type == 5){
- // this.sk_base(this.teamFiids[i], 1); //boss和秘境怪优先出手一次
- // }
- // }
- // }
- // this.pk_zhen_buff(); //一帧前
- // // if(this.zhen == 150 && this.teams["1002"] != null){
- // // this.jiesuo_hide("1002")
- // // this.teams["1002"].isHide = 0
- // // }
- // this.pk_zhen_atk(); //一帧中
- // this.pk_zhen_over(); //一帧后
- // this.jueSuanOneAtk();
- // //输出buff
- // this.skbuff_outf();
- // this.jueSuanOneAtk();
- // //删除空白日志
- // if (this.outf.log[this.zhen].length == 0) {
- // delete this.outf.log[this.zhen];
- // }
- // //判断胜负
- // let mfcount: number = 0; //我方活着的人数
- // let fcount: number = 0; //我方活着的人数
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // //这里用in 没关系
- // if (this.teams[fiid].type == 3) {
- // continue; //兽灵不计入胜负计算
- // }
- // if (this.teams[fiid].type == 4 && Number(fiid) % 100 == 0 && this.teams[fiid].eps.hp <= 0) {
- // fcount = 0; // 如果是打boss的 boss死了战斗结束 胜利
- // break;
- // }
- // if (Math.floor(Number(fiid) / 100) >= 10 && (this.teams[fiid].eps.hp > 0 || this.skbuff_get(fiid,"effect_i_63",2) > 0)) {// 还可以复活
- // mfcount += 1;
- // }
- // if (Math.floor(Number(fiid) / 100) < 10 && (this.teams[fiid].eps.hp > 0 || this.skbuff_get(fiid,"effect_i_63",2) > 0)) { // 还可以复活
- // fcount += 1;
- // }
- // }
- // if (mfcount < 1) {
- // return; //输了
- // }
- // if (fcount < 1) {
- // this.outf.win = 1; //赢了
- // return;
- // }
- // this.zhen++;
- // }
- // }
- // /**
- // * 出手(前)
- // */
- // private pk_zhen_buff() {
- // //定时执行
- // for (let i = 0; i < this.teamFiids.length; i++) {
- // if (gameMethod.isEmpty(this.teams[this.teamFiids[i]].isHide) == false) {
- // continue; //隐藏
- // }
- // this.timer_do(601, { do_iid: Number(this.teamFiids[i]) }); //每帧检测
- // this.timer_do(602, { do_iid: Number(this.teamFiids[i]) }); //每帧检测
- // }
- // for (let i = 0; i < this.teamFiids.length; i++) {
- // if (gameMethod.isEmpty(this.teams[this.teamFiids[i]].isHide) == false) {
- // continue; //隐藏
- // }
- // if (this.teams[this.teamFiids[i]].eps.hp <= 0) {
- // continue; //还没活
- // }
- // this.oneFiids[this.teamFiids[i]] = {}; //初始化各个iid
- // }
- // }
- // /**
- // * 出手(中)
- // */
- // private pk_zhen_atk() {
- // let iid: string;
- // for (let i = 0; i < this.teamFiids.length; i++) {
- // iid = this.teamFiids[i];
- // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
- // continue; //隐藏
- // }
- // this.pk_zhen_atk_one(iid);
- // this.skbuff_sub_all(iid, "effect_i_75");
- // // 快剑印记去除
- // let eff_i_19 = this.skbuff_get(iid, "effect_i_19", 2);
- // if (eff_i_19 > 0 && this.uuids[iid].last2 + 7 * 30 <= this.zhen) {
- // // 拥有印记 并且已经7秒没有出手
- // this.skbuff_sub_all(iid, "effect_i_19");
- // this.skbuff_sub_all(iid, "effect_i_23");
- // }
- // // 复活buff
- // let eff_i_36 = this.skbuff_get(iid, "effect_i_36", 2);
- // if (eff_i_36 > 0 && this.skbuff_get(iid, "i_36_nZhen") <= this.zhen) {
- // // 复活
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, iid, "effect", ["hp", this.skbuff_get(iid, "i_36")]);
- // this.skbuff_sub_all(iid, "effect_i_36");
- // }
- // this.jueSuanOneAtk();
- // }
- // }
- // /**
- // * 出手(中) - 一个人出手
- // * @param iid 出手人
- // */
- // private pk_zhen_atk_one(iid: string) {
- // if (this.skbuff_get(iid, "hp") <= 0) {
- // return; //还没活
- // }
- // if (!this.checkHit(iid)) {
- // return; // 乙方都死了 兽灵不能攻击
- // }
- // let i_speed: number = this.skbuff_get(iid, "speed");
- // i_speed = i_speed > 50000 ? 50000 : i_speed;
- // let last = Math.ceil(30 / (i_speed / 10000));
- // if (this.uuids[iid].last + last > this.zhen) {
- // return; //不是当前帧
- // }
- // // this.uuids[iid].last += last; todo 这里不要打开 攻击频率会有问题
- // this.sk_base(iid, 1); //技能触发
- // //灵力满怒时释放
- // if (this.teams["100"] != null && this.teams["100"].eps.mp >= 10000) {
- // let result = this.sk_base("100", 3); //技能触发
- // if (result){ // 技能释放成功才扣怒气
- // this.jueSuanOneAtk()
- // this.add_mp("100", -10000, 2);
- // }
- // }
- // if (this.teams["1000"] != null && this.teams["1000"].eps.mp >= 10000) {
- // let result = this.sk_base("1000", 3); //技能触发
- // if (result){ // 技能释放成功才扣怒气
- // this.jueSuanOneAtk()
- // this.add_mp("1000", -10000, 2);
- // }
- // }
- // }
- // /*
- // * 主角弟子都死了 兽灵不能攻击
- // * */
- // private checkHit(iid: string) {
- // if (parseInt(iid) % 100 != 10) {
- // return true;
- // }
- // let count = 0;
- // for (let i = 0; i < this.teamFiids.length; i++) {
- // if (this.teamFiids[i] != iid && this.teamFiids[i].length == iid.length && !this.uuids[this.teamFiids[i]].dzhen) {
- // count++;
- // break;
- // }
- // }
- // if (!count) {
- // return false;
- // } else {
- // return true;
- // }
- // }
- // /**
- // * 触发一次伤害
- // * @param iid 攻击者
- // * @param fiid 被打者
- // */
- // private sk_action_type_1(iid: string, fiid: string, skid: string, acId: string): { [key: string]: number } {
- // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
- // return {}; //隐藏
- // }
- // let cfgAc = Gamecfg.skillAction.getItem(acId);
- // if (cfgAc == null) {
- // return {};
- // }
- // if (this.oneHit[iid] == null || this.oneHit[iid][fiid] == null) {
- // return {};
- // }
- // let cfgSk = Gamecfg.skillBase.getItem(skid, "1");
- // if (cfgSk == null) {
- // return {}; //没有这个技能 或者 这个技能的触发时机不对
- // }
- // let jituiarr: (string | number)[] = []; //击退
- // if (cfgAc.args["s"] != null && this.seedRand.rand(1, 10000) <= cfgAc.args["p"] * 10000) {
- // jituiarr = ["jitui", cfgAc.args["s"]];
- // }
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.atk);
- // this.addOneAtk(iid, iid, "aSkid", skid);
- // this.uuids[fiid].fpk = iid; //记录最后一次打伤我的人
- // this.uuids[iid].ipk = fiid;
- // if (this.uuids[iid].ipks[this.zhen] == null) {
- // this.uuids[iid].ipks[this.zhen] = [];
- // }
- // this.uuids[iid].ipks[this.zhen].push(fiid);
- // this.uuids[iid].last2 = this.zhen;
- // let main_iid = iid.length > 3 ? "1000" : "100";
- // if (Number(iid) % 100 < 10 && this.uuids[main_iid] && this.uuids[main_iid].drain_sk > 0) {
- // let cfgMath = Gamecfg.mathInfo.getItem("battle_lingli");
- // if (cfgMath != null && cfgMath.pram.items != null) {
- // let llmin = cfgMath.pram.items[1][0];
- // let llMax = cfgMath.pram.items[1][1];
- // this.add_mp(main_iid, this.seedRand.rand(llmin, llMax), 2);
- // }
- // }
- // this.timer_do(106, { do_iid: Number(fiid) }); //被打前触发
- // this.timer_do(209, { do_iid: Number(iid) }); //攻击结算前触发
- // //各种伤害计算
- // let gzhit = this.oneHit[iid][fiid];
- // let hit: number = gzhit.pghit; //总伤害
- // if (cfgSk.skillType == 3) {
- // hit = gzhit.skhit;
- // }
- // if (cfgSk.drain > 0) {
- // // 术法伤害增加
- // let i_73 = this.skbuff_get(iid, "i_73");
- // let i_qhmifa = this.skbuff_get(iid, "qhmifa");
- // let f_rhmifa = this.skbuff_get(fiid, "rhmifa");
- // hit += Math.floor(hit * ((i_73 + i_qhmifa - f_rhmifa) / 10000));
- // }
- // let result = { do_iid: Number(fiid), hit: 0 };
- // // 攻击 =》
- // // 》 判定连击(需要判定有没有触发暴击) | 判定溅射(需要判定有没有触发暴击)
- // // 》没用连击 没用溅射 =》 判定暴击
- // // 》 如果没有暴击 才是 普通攻击
- // // | 吸血
- // // 》被打 格挡 | 反击(溅射(需要判定有没有触发暴击) 如果没有溅射才判定暴击 ) 没有暴击 就是普通攻击 + 吸血
- // // 反击被打的也要判定 格挡
- // // 结束了
- // // 是否连击
- // let islj: number = this.isLianji(iid, fiid);
- // let isNext: number = 0; //0默认 1停止 2已经触发暴击
- // if (islj) {
- // isNext = 1;
- // this.uuids[iid].cons[1] += 1; //记录攻击次数
- // this.uuids[fiid].fcons[1] += 1; //记录攻击次数
- // // 是否暴击
- // let isBj: number = this.isBaoji(iid, fiid);
- // if (isBj) {
- // isNext = 2;
- // } else {
- // let isGd = this.isGedang(iid, fiid); // 连击格挡
- // hit = gzhit.ljhit;
- // if (isGd) {
- // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
- // hit -= gzhit.gdhit;
- // }
- // hit = this.hit_last(iid, fiid, hit);
- // this.addOneAtk(iid, fiid, "effect", ["lianji", -1 * hit].concat(jituiarr), skid);
- // result.hit += hit;
- // }
- // }
- // //是否溅射
- // let isJs = this.seedRand.rand(1, 10000) <= gzhit.jsRate;
- // if (isJs) {
- // isNext = 1;
- // let isBj: number = this.isBaoji(iid, fiid);
- // if (isBj) {
- // isNext = 2;
- // } else {
- // // 溅射伤害增加
- // let i_81 = this.skbuff_get(iid, "i_81");
- // if (i_81 != 0) {
- // hit = Math.floor(hit * (i_81 / 10000 + 1));
- // }
- // let isGd = this.isGedang(iid, fiid); // 连击格挡
- // if (isGd) {
- // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
- // hit -= gzhit.gdhit;
- // }
- // hit = this.hit_last(iid, fiid, hit);
- // this.addOneAtk(iid, fiid, "effect", ["hp", -1 * hit], skid);
- // let jsxishu: number[] = [1, 0.75, 0.7, 0.58, 0.5];
- // let jsfiids = this.find_jianse_fiid(fiid, cfgAc.distance);
- // let allHit: number = 0;
- // let maxLen = Math.min(jsfiids.length, jsxishu.length);
- // for (let index = 0; index < maxLen; index++) {
- // if (jsfiids[index] == null) {
- // break;
- // }
- // if (i_81 != 0) {
- // hit = Math.floor(hit * (i_81 / 10000 + 1));
- // }
- // hit = Math.floor(gzhit.jshit * jsxishu[maxLen - 1]);
- // let isGd = this.isGedang(iid, jsfiids[index]); // 连击格挡
- // if (isGd) {
- // this.addOneAtk(iid, jsfiids[index], "effect", ["block", 1]);
- // hit -= gzhit.gdhit;
- // }
- // hit = this.hit_last(iid, jsfiids[index], hit);
- // this.addOneAtk(iid, jsfiids[index], "effect", ["jianshe", -1 * hit].concat(jituiarr));
- // this.sk_base(jsfiids[index], 2, { hit: hit }); //被攻击
- // allHit += hit;
- // }
- // this.timer_do(205, { do_iid: Number(iid), hit: allHit }); //溅射触发
- // }
- // }
- // //判定是否暴击
- // if (isNext == 0) {
- // let isBj: number = this.isBaoji(iid, fiid);
- // if (isBj) {
- // isNext = 2;
- // }
- // }
- // //暴击
- // if (isNext == 2) {
- // this.uuids[iid].cons[0] += 1; //记录攻击次数
- // this.uuids[fiid].fcons[0] += 1; //记录攻击次数
- // let isGd = this.isGedang(iid, fiid); // 连击格挡
- // if (isGd) {
- // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
- // hit -= gzhit.gdhit;
- // }
- // hit = this.hit_last(iid, fiid, gzhit.bjhit);
- // this.addOneAtk(iid, fiid, "effect", ["baoji", -1 * hit].concat(jituiarr), skid);
- // this.timer_do(203, { do_iid: Number(iid), hit: hit, isBj: hit }); //暴击触发
- // result.hit += hit;
- // }
- // //普通攻击
- // if (isNext == 0) {
- // this.uuids[iid].cons[0] += 1; //记录攻击次数
- // this.uuids[fiid].fcons[0] += 1; //记录攻击次数
- // let isGd = this.isGedang(iid, fiid); // 连击格挡
- // if (isGd) {
- // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
- // hit -= gzhit.gdhit;
- // }
- // hit = this.hit_last(iid, fiid, gzhit.pghit);
- // this.addOneAtk(iid, fiid, "effect", ["hp", -1 * hit].concat(jituiarr), skid);
- // //this.timer_do(203, { do_iid: Number(iid), hit: hit, isBj: hit }); //暴击触发
- // result.hit += hit;
- // }
- // //是否吸血
- // if (gzhit.xxhit > 0) {
- // this.addOneAtk(iid, iid, "effect", ["hp", gzhit.xxhit]);
- // }
- // if (cfgSk.skillType == 3) {
- // this.timer_do(207, { do_iid: Number(iid), hit: result.hit }); //技能触发
- // this.timer_do(102, { do_iid: Number(fiid), hit: result.hit }); //被打触发(技能)
- // } else {
- // this.timer_do(201, { do_iid: Number(iid), hit: result.hit }); //普通攻击触发
- // this.timer_do(103, { do_iid: Number(fiid), hit: result.hit }); //被打触发(普通)
- // }
- // if (cfgSk.drain > 0) {
- // this.timer_do(208, { do_iid: Number(iid), hit: result.hit }); //术法触发
- // }
- // // 触发连击buff
- // if (islj) {
- // this.timer_do(202, { do_iid: Number(iid), hit: result.hit }); //连击触发
- // this.timer_do(101, { do_iid: Number(fiid), hit: result.hit }); //连击触发 被打
- // this.sk_base(iid, 9, { hit: result.hit });
- // }
- // // 触发暴击buff
- // if (isNext == 2) {
- // this.sk_base(iid, 10, { hit: result.hit });
- // }
- // this.sk_base(fiid, 2, { hit: result.hit }); //被攻击
- // //反击
- // this.sk_action_type_1_fanji(fiid, iid, gzhit);
- // return result;
- // }
- // /**
- // * 触发一次反击
- // * @param iid 攻击者
- // * @param fiid 被打者
- // * @param hit
- // * @param cs
- // */
- // private sk_action_type_1_fanji(iid: string, fiid: string, gzhit: Gzhit) {
- // if (this.teams[iid].type == 3 || this.teams[fiid].type == 3) {
- // return;
- // }
- // if (this.jueFiidHp(fiid)<=0){ // 死了不能反击
- // return;
- // }
- // // 被打的是否被冰冻
- // let eff_i_3 = this.skbuff_get(iid, "effect_i_3", 2);
- // if (eff_i_3 > 0) {
- // return; //晕眩
- // }
- // let eff_i_5 = this.skbuff_get(iid, "effect_i_5", 2);
- // if (eff_i_5 > 0) {
- // return; //冰冻
- // }
- // let isNext: number = 0; //0停止 1继续 2暴击
- // //技能反击
- // let cbback = this.skbuff_get(iid, "canbeatback", 2);
- // if (cbback > 0) {
- // isNext = 1;
- // this.skbuff_sub(iid, "canbeatback");
- // }
- // let isEpfj: number = 0;
- // if (isNext == 0) {
- // //触发反击
- // let isfj: number = this.isFanji(iid, fiid);
- // if (isfj) {
- // isNext = 1;
- // isEpfj = 1;
- // }
- // }
- // if (isNext == 0) {
- // return;
- // }
- // //找出反击者的普通攻击
- // let pskid: string = "";
- // let ackid: number = 0;
- // let skids: string[] = Object.keys(this.teams[iid].sk);
- // for (let index = 0; index < skids.length; index++) {
- // let cfgSk = Gamecfg.skillBase.getItem(skids[index], "1");
- // if (cfgSk != null && cfgSk.skillType == 1) {
- // pskid = skids[index];
- // ackid = cfgSk.actions[0];
- // break;
- // }
- // }
- // if (pskid == "") {
- // return;
- // }
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.fanji);
- // this.addOneAtk(iid, iid, "aSkid", pskid);
- // this.uuids[iid].cons[2] += 1;
- // this.uuids[fiid].fcons[2] += 1;
- // //伤害
- // let hit = gzhit.fjhit;
- // let i_rhblock: number = this.skbuff_get(iid, "rhblock");
- // //是否溅射
- // let isJs = this.seedRand.rand(1, 10000) <= gzhit.fjsRate;
- // if (isJs) {
- // let isBj: number = this.isBaoji(iid, fiid);
- // if (isBj) {
- // isNext = 2;
- // } else {
- // // 溅射伤害增加
- // let i_81 = this.skbuff_get(iid, "i_81");
- // if (i_81 != 0) {
- // hit = Math.floor(hit * (i_81 / 10000 + 1));
- // }
- // let isGd = this.isGedang(iid, fiid); // 连击格挡
- // if (isGd) {
- // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
- // //格挡伤害= MIN(技能伤害*(MAX(敌方格挡增强-我方格挡减弱,0.12)),技能伤害*0.9)
- // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
- // let fgd_hit: number = Math.min(gzhit.fjhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), gzhit.fjhit * 0.9);
- // hit -= Math.floor(fgd_hit);
- // }
- // hit = this.hit_last(iid, fiid, hit);
- // this.addOneAtk(iid, fiid, "effect", ["fanji", -1 * hit], pskid);
- // let jsxishu: number[] = [1, 0.75, 0.7, 0.58, 0.5];
- // let distance = 0;
- // if (ackid != 0) {
- // let cfgAc = Gamecfg.skillAction.getItem(ackid.toString());
- // if (cfgAc != null) {
- // distance = cfgAc.distance;
- // }
- // }
- // let jsfiids = this.find_jianse_fiid(fiid, distance);
- // let allHit: number = 0;
- // let maxLen = Math.min(jsfiids.length, jsxishu.length);
- // for (let index = 0; index < maxLen; index++) {
- // if (jsfiids[index] == null) {
- // break;
- // }
- // if (i_81 != 0) {
- // hit = Math.floor(hit * (i_81 / 10000 + 1));
- // }
- // hit = Math.floor(gzhit.jshit * jsxishu[maxLen - 1]);
- // let isGd = this.isGedang(iid, jsfiids[index]); // 连击格挡
- // if (isGd) {
- // this.addOneAtk(iid, jsfiids[index], "effect", ["block", 1]);
- // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
- // let fgd_hit: number = Math.min(gzhit.fjhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), gzhit.fjhit * 0.9);
- // hit -= Math.floor(fgd_hit);
- // }
- // hit = this.hit_last(iid, jsfiids[index], hit);
- // this.addOneAtk(iid, jsfiids[index], "effect", ["fanji", -1 * hit]);
- // this.sk_base(jsfiids[index], 2, { hit: hit }); //被攻击
- // allHit += hit;
- // }
- // this.timer_do(205, { do_iid: Number(iid), hit: allHit }); //溅射触发
- // }
- // }
- // //判定是否暴击
- // if (isNext == 1) {
- // let isBj: number = this.isBaoji(iid, fiid);
- // if (isBj) {
- // isNext = 2;
- // }
- // }
- // //暴击
- // if (isNext == 2) {
- // this.uuids[iid].cons[0] += 1; //记录攻击次数
- // this.uuids[fiid].fcons[0] += 1; //记录攻击次数
- // let isGd = this.isGedang(iid, fiid); // 连击格挡
- // if (isGd) {
- // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
- // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
- // let fgd_hit: number = Math.min(gzhit.fjhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), gzhit.fjhit * 0.9);
- // hit -= fgd_hit;
- // }
- // hit = this.hit_last(iid, fiid, gzhit.bjhit);
- // this.addOneAtk(iid, fiid, "effect", ["baoji", -1 * hit]);
- // this.timer_do(203, { do_iid: Number(iid), hit: hit, isBj: hit }); //暴击触发
- // }
- // //普通攻击
- // if (isNext == 1) {
- // let isGd = this.isGedang(iid, fiid); // 格挡
- // if (isGd) {
- // this.addOneAtk(iid, fiid, "effect", ["block", 1]);
- // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
- // let fgd_hit: number = Math.min(gzhit.fjhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), gzhit.fjhit * 0.9);
- // hit -= fgd_hit;
- // }
- // hit = this.hit_last(iid, fiid, hit);
- // this.addOneAtk(iid, fiid, "effect", ["fanji", -1 * hit]);
- // this.timer_do(203, { do_iid: Number(iid), hit: hit, isBj: hit }); //暴击触发
- // }
- // //吸血率=max((我方吸血-敌方抗吸血),吸血保底参数)
- // //吸血值= 最终伤害值*max(我方吸血增强-敌方吸血减弱,1)*吸血率
- // let i_xixue: number = this.skbuff_get(iid, "xixue");
- // let f_hsxixue: number = this.skbuff_get(fiid, "hsxixue");
- // let bdxixue: number = 0; //保底吸血
- // let cfg = Gamecfg.userEp.getItem("xixue");
- // if (cfg != null) {
- // bdxixue = cfg.initEp;
- // }
- // let xxRate: number = Math.max(i_xixue - f_hsxixue, bdxixue);
- // let i_qhxixue: number = this.skbuff_get(iid, "qhxixue");
- // let f_rhxixue: number = this.skbuff_get(fiid, "rhxixue");
- // let xx_hit: number = Math.floor((gzhit.fjhit * Math.max((i_qhxixue - f_rhxixue) / 10000 + 1, 1) * xxRate) / 10000);
- // //是否吸血
- // if (xx_hit>0) {
- // this.addOneAtk(iid, iid, "effect", ["hp", xx_hit]);
- // }
- // this.timer_do(204, { do_iid: Number(iid), hit: hit }); //反击触发
- // if (isEpfj) {
- // // 反击获得buff
- // let skids: string[] = Object.keys(this.teams[iid].sk);
- // for (let index = 0; index < skids.length; index++) {
- // let cfgSk = Gamecfg.skillBase.getItem(skids[index], "1");
- // if (cfgSk && cfgSk.runStatus === 7) {
- // for (let index = 0; index < cfgSk.effect.length; index++) {
- // let effectId = cfgSk.effect[index];
- // this.sk_effect(fiid, skids[index], effectId.toString(), "", { hit: hit });
- // }
- // }
- // }
- // }
- // }
- // /**
- // * 出手(后)
- // */
- // private pk_zhen_over() {
- // //死亡触发
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // if (this.teams[fiid].eps.hp > 0) {
- // continue; //还活着
- // }
- // if (this.uuids[fiid].dzhen > 0) {
- // continue; //之前已经死了
- // }
- // this.uuids[fiid].dzhen = this.zhen; //那一帧死了
- // this.teams[fiid].eps.hp = 0;
- // this.timer_do(402, { do_iid: Number(fiid) }); //死亡触发
- // this.jiesuo_hide(fiid);
- // }
- // //清除过期buff
- // this.skbuff_clear();
- // }
- // /**
- // * 单次出手临时存储信息 - 记录
- // */
- // addOneAtk(iid: string, fiid: string, key: string, val: any, skid: string = "") {
- // if (!this.oneAtkiids.includes(iid)) {
- // this.oneAtkiids.push(iid);
- // }
- // //初始化
- // if (this.oneAtk[iid] == null) {
- // this.oneAtk[iid] = {};
- // }
- // if (this.uuids[iid].dzhen > 0 && this.uuids[iid].dzhen < this.zhen) {
- // return; //已经死了 ,不要在折腾了
- // }
- // if (this.uuids[fiid].dzhen > 0 && this.uuids[fiid].dzhen < this.zhen) {
- // return; //已经死了 ,不要在折腾了
- // }
- // if (this.oneAtk[iid][fiid] == null) {
- // this.oneAtk[iid][fiid] = {
- // aType: Xys.ActionType.default, //动作类型
- // aSkid: "", //使用的技能ID
- // effect: [],
- // buff: [],
- // };
- // }
- // //目标治疗效果降低/增加
- // if (val[0] == "hp" && val[1] > 0 && this.skbuff_get(fiid, "effect_i_62", 2) > 0) {
- // let f_i_62 = this.skbuff_get(fiid, "i_62");
- // val[1] += Math.floor((val[1] * f_i_62) / 10000);
- // val[1] = Math.max(0, val[1]);
- // }
- // //单次伤害不超过自身最大生命值的x%
- // if (this.xueku.includes(val[0]) && val[1] < 0) {
- // let f_i_71 = this.skbuff_get(fiid, "max_i_71");
- // if (f_i_71 > 0 && Math.abs(val[1]) > f_i_71 && this.skbuff_get(fiid, "max_i_71_nZhen") <= this.zhen) {
- // let max_i_71_cd = this.skbuff_get(fiid, "max_i_71_cd");
- // if (max_i_71_cd > 0) {
- // this.skbuff_update(fiid, { max_i_71_nZhen: this.zhen + max_i_71_cd * 30 });
- // }
- // val[1] = -f_i_71;
- // }
- // }
- // //统计
- // if (this.outf.tongji[fiid] == null) {
- // this.outf.tongji[fiid] = {
- // shuchu: 0, //输出
- // zhiliao: 0, //治疗
- // chengshang: 0, //承伤
- // };
- // }
- // if (this.outf.tongji[iid] == null) {
- // this.outf.tongji[iid] = {
- // shuchu: 0, //输出
- // zhiliao: 0, //治疗
- // chengshang: 0, //承伤
- // };
- // }
- // switch (key) {
- // case "aType": //动作类型
- // //已经是攻击类型, 就不要再改了
- // if (this.oneAtk[iid][fiid].aType != Xys.ActionType.atk) {
- // this.oneAtk[iid][fiid].aType = val;
- // }
- // break;
- // case "aSkid": //使用的技能ID
- // this.oneAtk[iid][fiid].aSkid = val;
- // break;
- // case "effect": //特效
- // this.oneAtk[iid][fiid].effect.push(val);
- // if (this.xueku.includes(val[0]) && val[1] < 0) {
- // //统计
- // this.outf.tongji[iid].shuchu += Math.abs(val[1]);
- // this.outf.tongji[fiid].chengshang += Math.abs(val[1]);
- // let main_iid = fiid.length > 3 ? "1000" : "100";
- // if (Number(fiid) % 100 < 10 && this.uuids[main_iid] && this.uuids[main_iid].drain_sk > 0) {
- // let cfgMath = Gamecfg.mathInfo.getItem("battle_lingli");
- // if (cfgMath != null && cfgMath.pram.items != null) {
- // let llmin = cfgMath.pram.items[0][0];
- // let llMax = cfgMath.pram.items[0][1];
- // this.add_mp(main_iid, this.seedRand.rand(llmin, llMax), 2);
- // }
- // }
- // }
- // if (this.xueku.includes(val[0]) && val[1] > 0) {
- // //统计
- // this.outf.tongji[fiid].zhiliao += Math.abs(val[1]);
- // //回血触发(治疗触发/吸血触发--这3个是一个意思)
- // this.timer_do(403, { do_iid: Number(fiid) });
- // }
- // break;
- // case "buff": //buff
- // this.oneAtk[iid][fiid].buff.push(val);
- // break;
- // }
- // }
- // /**
- // * 当前剩余血量
- // */
- // jueFiidHp(fiid: string) {
- // let lsf_hp: number = this.teams[fiid].eps.hp;
- // let iids = Object.keys(this.oneAtk);
- // for (let i = 0; i < iids.length; i++) {
- // if (this.oneAtk[iids[i]][fiid] == null) {
- // continue;
- // }
- // for (let k = 0; k < this.oneAtk[iids[i]][fiid].effect.length; k++) {
- // if (this.xueku.includes(this.oneAtk[iids[i]][fiid].effect[k][0])) {
- // lsf_hp += this.oneAtk[iids[i]][fiid].effect[k][1];
- // }
- // }
- // }
- // lsf_hp = Math.min(lsf_hp, this.skbuff_get(fiid, "hp_max"));
- // return lsf_hp;
- // }
- // /**
- // * 单次出手临时存储信息 - 结算
- // */
- // jueSuanOneAtk() {
- // if (gameMethod.isEmpty(this.oneAtk) == true) {
- // return;
- // }
- // // 结算前判定主角是否死亡 并且是否拥有复活buff 复活buff触发帧是否生效
- // let iids = ["100","1000"];
- // for (let i=0;i<iids.length;i++){
- // let iid = iids[i];
- // let hp = this.skbuff_get(iid, "hp");
- // if (hp <= 0 && this.skbuff_get(iid, "effect_i_63", 2) > 0) {
- // let i_63_cd = this.skbuff_get(iid, "i_63_cd")
- // if (i_63_cd > 0){ // 死亡后延迟x帧复活
- // //this.skbuff_update(iid, { "i_63_cd":-i_63_cd,"i_63_nZhen": this.zhen + i_63_cd });
- // }else if (this.skbuff_get(iid, "i_63_nZhen") <= this.zhen){
- // let addHp = this.skbuff_get(iid, "i_63_hp");
- // if (addHp > 0) {
- // this.skbuff_sub_all(iid,"effect_i_63")
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, iid, "effect", ["hp", addHp - hp]);
- // }
- // }
- // }
- // }
- // //攻打方
- // for (let i = 0; i < this.oneAtkiids.length; i++) {
- // let i_buff: [string, number][] = [];
- // let i_effect: [string, number][] = [];
- // let target: Xys.LogOneData[] = [];
- // let fiids = Object.keys(this.oneAtk[this.oneAtkiids[i]]);
- // for (let k = 0; k < fiids.length; k++) {
- // let chahp: number = 0;
- // //计算血量和伤害
- // for (let j = 0; j < this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect.length; j++) {
- // let effect = this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect[j];
- // if (this.xueku.includes(effect[0])) {
- // if (Number(fiids[k]) < 1000 && effect[1] < 0) {
- // this.outf.hurt += Math.abs(effect[1]); //计算伤害
- // }
- // if (effect[1] < 0) {
- // //扣血执行
- // this.timer_do(401, { do_iid: Number(fiids[k]), hit: Math.abs(effect[1]) });
- // this.timer_do(404, { do_iid: Number(fiids[k]), hit: Math.abs(effect[1]) });
- // this.timer_do(405, { do_iid: Number(this.oneAtkiids[i]), hit: Math.abs(effect[1]) }); //敌方扣血 我方加buff
- // }
- // if (this.teams[fiids[k]].eps.hp + chahp + effect[1] < 0) {
- // // 最后一下 如果对方被打死了 伤害不能超过对方血量
- // effect[1] = -(this.teams[fiids[k]].eps.hp + chahp);
- // }
- // if (effect[1] == 0 && this.teams[fiids[k]].eps.hp + chahp == 0) {
- // // 如果已经被打死了 删掉这个影响
- // this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect.splice(j, 1);
- // j--;
- // }
- // chahp += effect[1];
- // }
- // }
- // this.teams[fiids[k]].eps.hp += chahp;
- // this.teams[fiids[k]].eps.hp = Math.min(this.skbuff_get(fiids[k], "hp_max"), this.teams[fiids[k]].eps.hp);
- // if (this.oneAtkiids[i] == fiids[k]) {
- // i_buff = this.oneAtk[this.oneAtkiids[i]][fiids[k]].buff;
- // i_effect = this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect;
- // } else {
- // target.push({
- // fid: this.teams[fiids[k]].fid, //出手方Id
- // iid: fiids[k], //阵容下标
- // hp: this.teams[fiids[k]].eps.hp, //剩余血量
- // mp: this.teams[fiids[k]].eps.mp, //剩余怒气
- // buff: this.oneAtk[this.oneAtkiids[i]][fiids[k]].buff, //[ [生效帧开始,生效帧结束,buffKEY,触发的人]]
- // effect: this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect, //触发效果 [ [属性key,数值]]
- // tongji:Math.abs(this.outf.tongji[fiids[k]]?.shuchu | 0),
- // zonji:0
- // });
- // }
- // this.oneAtk[this.oneAtkiids[i]][fiids[k]].effect = [];
- // }
- // this.teams[this.oneAtkiids[i]].eps.hp = Math.min(this.teams[this.oneAtkiids[i]].eps.hp, this.skbuff_get(this.oneAtkiids[i], "hp_max"));
- // // 把回血合并
- // let i_effect2:[string, number][] = []
- // let jisuan:{[key:string]:number} = {}
- // for (let item of i_effect){
- // if (this.xueku.includes(item[0]) && item[1] > 0){ //属于回血字段并且值大于0
- // if (jisuan[item[0]] == null){
- // jisuan[item[0]] = item[1]
- // }else {
- // jisuan[item[0]] += item[1]
- // }
- // }else{
- // i_effect2.push(item)
- // }
- // }
- // for (let key in jisuan){
- // i_effect2.push([key,jisuan[key]])
- // }
- // //初始化
- // let atker: Xys.LogOneData = {
- // fid: this.teams[this.oneAtkiids[i]].fid, //出手方Id
- // iid: this.oneAtkiids[i], //阵容下标
- // hp: this.teams[this.oneAtkiids[i]].eps.hp, //剩余血量
- // mp: this.teams[this.oneAtkiids[i]].eps.mp, //剩余怒气
- // buff: i_buff, //[ [生效帧开始,生效帧结束,buffKEY,触发的人]]
- // effect: i_effect2, //触发效果 [ [属性key,数值]]
- // tongji:Math.abs(this.outf.tongji[this.oneAtkiids[i]]?.shuchu | 0),
- // zonji:0
- // };
- // if (
- // this.oneAtk[this.oneAtkiids[i]][this.oneAtkiids[i]] != null &&
- // this.oneAtk[this.oneAtkiids[i]][this.oneAtkiids[i]].aType != Xys.ActionType.default
- // ) {
- // //添加日志
- // this.addOneLog({
- // aType: this.oneAtk[this.oneAtkiids[i]][this.oneAtkiids[i]].aType, //战斗动作类型
- // aSkid: this.oneAtk[this.oneAtkiids[i]][this.oneAtkiids[i]].aSkid, //使用的技能ID
- // fhp: 0,
- // atker: atker, //出手方
- // target: target, //目标
- // });
- // }
- // }
- // this.oneAtk = {};
- // this.oneAtkiids = [];
- // }
- // /**
- // * 战斗日志
- // */
- // addOneLog(log: Xys.fightLogOne) {
- // log.fhp = 0;
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // //统计对方剩余总血量 in没关系
- // if (Number(fiid) >= 1000) {
- // continue; //自己人
- // }
- // if (this.teams[fiid].isHide != 0) {
- // continue; //隐藏不管
- // }
- // if (this.teams[fiid].type == 3) {
- // continue; //兽灵不管
- // }
- // if (this.teams[fiid].eps.hp < 1) {
- // continue; //死了不管
- // }
- // log.fhp += this.teams[fiid].eps.hp;
- // }
- // this.outf.log[this.zhen].push(log);
- // }
- // /**
- // * 战斗日志
- // */
- // over_back(): Xys.OverBack {
- // this.outf.hp = 0;
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // if (fiid.length <= 3 && this.teams[fiid].eps.hp > 0 && this.teams[fiid].isHide == 0) {
- // this.outf.hp += this.teams[fiid].eps.hp;
- // }
- // }
- // this.outf.start.teams = this.teams;
- // return this.outf;
- // }
- // //***********************************************
- // /**
- // * 辅助函数 - 获取对手
- // * @param key 标识key
- // * @param iid 出手方
- // * @param ttype (1敌方全体,2前排敌方,3中排敌方,4后排敌方,5敌方随机,6自己,7已方全体,8已方随机)
- // * @param targetType 目标数量
- // */
- // private find_fiids(key: string, iid: string, ttype: number[], targetType: number, distance: number = 0) {
- // if (ttype.length <= 0) {
- // return; //沿用上一次的 可能没有上一次
- // }
- // if (this.oneFiids[iid] == null) {
- // this.oneFiids[iid] = {};
- // }
- // let fiids: string[] = [];
- // this.oneFiids[iid][key] = []; //重置 重新获取
- // //目标打击顺序
- // const mblist: { [mubiao: string]: { [yu: string]: number[] } } = {
- // "1": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "2": {
- // //2前排敌方
- // "0": [2, 1, 3, 13, 14],
- // "2": [2, 1, 3, 13, 14],
- // "5": [2, 1, 3, 13, 14],
- // "8": [2, 1, 3, 13, 14],
- // "1": [3, 2, 14, 1, 13],
- // "4": [3, 2, 14, 1, 13],
- // "7": [3, 2, 14, 1, 13],
- // "3": [1, 13, 2, 3, 14],
- // "6": [1, 13, 2, 3, 14],
- // "9": [1, 13, 2, 3, 14],
- // "10": [3, 2, 14, 1, 13],
- // "11": [2, 1, 3, 13, 14],
- // "12": [1, 13, 2, 3, 14],
- // "13": [14, 3, 2, 1, 13],
- // "15": [14, 3, 2, 1, 13],
- // "17": [14, 3, 2, 1, 13],
- // "14": [13, 1, 2, 3, 14],
- // "16": [13, 1, 2, 3, 14],
- // "18": [13, 1, 2, 3, 14],
- // },
- // "3": {
- // //3中排敌方
- // "0": [5, 4, 6, 15, 16],
- // "2": [5, 4, 6, 15, 16],
- // "5": [5, 4, 6, 15, 16],
- // "8": [5, 4, 6, 15, 16],
- // "1": [6, 5, 16, 4, 15],
- // "4": [6, 5, 16, 4, 15],
- // "7": [6, 5, 16, 4, 15],
- // "3": [4, 15, 5, 6, 16],
- // "6": [4, 15, 5, 6, 16],
- // "9": [4, 15, 5, 6, 16],
- // "10": [6, 5, 16, 4, 15],
- // "11": [5, 4, 6, 15, 16],
- // "12": [4, 15, 5, 6, 16],
- // "13": [16, 6, 5, 4, 15],
- // "15": [16, 6, 5, 4, 15],
- // "17": [16, 6, 5, 4, 15],
- // "14": [15, 4, 5, 6, 16],
- // "16": [15, 4, 5, 6, 16],
- // "18": [15, 4, 5, 6, 16],
- // },
- // "4": {
- // //4后排敌方
- // "0": [8, 7, 9, 17, 18],
- // "2": [8, 7, 9, 17, 18],
- // "5": [8, 7, 9, 17, 18],
- // "8": [8, 7, 9, 17, 18],
- // "1": [9, 8, 18, 7, 17],
- // "4": [9, 8, 18, 7, 17],
- // "7": [9, 8, 18, 7, 17],
- // "3": [7, 8, 17, 9, 18],
- // "6": [7, 8, 17, 9, 18],
- // "9": [7, 8, 17, 9, 18],
- // "10": [9, 8, 18, 7, 17],
- // "11": [8, 7, 9, 17, 18],
- // "12": [7, 8, 17, 9, 18],
- // "13": [18, 9, 8, 7, 17],
- // "15": [18, 9, 8, 7, 17],
- // "17": [18, 9, 8, 7, 17],
- // "14": [17, 7, 8, 9, 18],
- // "16": [17, 7, 8, 9, 18],
- // "18": [17, 7, 8, 9, 18],
- // },
- // "5": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "7": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "8": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "10": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "11": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "12": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "13": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "16": {
- // //1敌方全体 5敌方随机 7已方全体 8已方随机
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "17": {
- // //主角自己
- // "0": [0],
- // },
- // "18": {
- // //我方弟子
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18],
- // },
- // "20": {
- // //我方弟子
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18],
- // },
- // "22": {
- // //敌方全体异常
- // "0": [1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18, 0],
- // },
- // "23": {
- // "0": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
- // "2": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
- // "5": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
- // "8": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
- // "11": [2, 5, 1, 3, 8, 13, 14, 4, 6, 15, 16, 7, 9, 17, 18, 0],
- // "1": [3, 6, 2, 14, 9, 1, 5, 16, 14, 4, 8, 18, 15, 7, 17, 0],
- // "4": [3, 6, 2, 14, 9, 1, 5, 16, 14, 4, 8, 18, 15, 7, 17, 0],
- // "7": [3, 6, 2, 14, 9, 1, 5, 16, 14, 4, 8, 18, 15, 7, 17, 0],
- // "10": [3, 6, 2, 14, 9, 1, 5, 16, 14, 4, 8, 18, 15, 7, 17, 0],
- // "3": [1, 4, 13, 2, 7, 3, 15, 5, 14, 6, 17, 8, 16, 9, 18, 0],
- // "6": [1, 4, 13, 2, 7, 3, 15, 5, 14, 6, 17, 8, 16, 9, 18, 0],
- // "9": [1, 4, 13, 2, 7, 3, 15, 5, 14, 6, 17, 8, 16, 9, 18, 0],
- // "12": [1, 4, 13, 2, 7, 3, 15, 5, 14, 6, 17, 8, 16, 9, 18, 0],
- // "13": [14, 16, 3, 18, 2, 6, 1, 5, 9, 13, 4, 8, 15, 7, 17, 0],
- // "15": [14, 16, 3, 18, 2, 6, 1, 5, 9, 13, 4, 8, 15, 7, 17, 0],
- // "17": [14, 16, 3, 18, 2, 6, 1, 5, 9, 13, 4, 8, 15, 7, 17, 0],
- // "14": [13, 15, 1, 17, 2, 4, 3, 5, 7, 14, 6, 8, 16, 9, 18, 0],
- // "16": [13, 15, 1, 17, 2, 4, 3, 5, 7, 14, 6, 8, 16, 9, 18, 0],
- // "18": [13, 15, 1, 17, 2, 4, 3, 5, 7, 14, 6, 8, 16, 9, 18, 0],
- // },
- // };
- // let yu = Math.floor(Number(iid) % 100).toString();
- // let iqz: number = 100; //我方前缀
- // let fqz: number = 1000; //对方前缀
- // if (Number(iid) >= 1000) {
- // fqz = 100;
- // iqz = 1000;
- // }
- // for (let i = 0; i < ttype.length; i++) {
- // if (fiids.length >= targetType) {
- // break; //已经找到了
- // }
- // let mubiao = ttype[i];
- // switch (mubiao) {
- // case 1: //1敌方全体
- // if (distance > 0) {
- // let fiid = (fqz + 5).toString();
- // fiids = this.find_jianse_fiid(fiid, distance);
- // if (this.teams[fiid] != null && this.uuids[fiid].dzhen == 0 && gameMethod.isEmpty(this.teams[fiid].isHide)) {
- // fiids.push((fqz + 5).toString());
- // }
- // } else {
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // fiids.push(fiid);
- // }
- // }
- // break;
- // case 2: //2前排敌方
- // case 3: //3中排敌方
- // case 4: //4后排敌方
- // let count = 0;
- // for (let k = 0; k < mblist[mubiao.toString()][yu].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()][yu][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // count += 1;
- // if (count > targetType) {
- // continue;
- // }
- // fiids.push(fiid);
- // }
- // break;
- // case 5: // 5敌方随机(不能随机同一个目标)
- // let cqlist5: string[] = [];
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // cqlist5.push(fiid);
- // }
- // fiids = this.seedRand.getRandArr(cqlist5, Math.min(cqlist5.length, targetType));
- // break;
- // case 6: //自己
- // fiids = [iid];
- // break;
- // case 7: //7已方全体
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (iqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // fiids.push(fiid);
- // }
- // break;
- // case 8: // 8已方随机(除自己外)(不可以随机同一个目标)
- // let cqlist8: string[] = [];
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (iqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // if (fiid == iid) {
- // //(除自己外)
- // continue;
- // }
- // cqlist8.push(fiid);
- // }
- // fiids = this.seedRand.getRandArr(cqlist8, Math.min(cqlist8.length, targetType));
- // break;
- // case 9: // 9上次攻击我的对象
- // if (!this.uuids[iid]) {
- // continue;
- // }
- // if (this.uuids[iid].fpk != "") {
- // fiids.push(this.uuids[iid].fpk);
- // }
- // break;
- // case 10: // 10敌方攻击力最高单位
- // let fMaxatk10: number = 0;
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // let fAtk = this.skbuff_get(fiid, "atk");
- // if (fAtk <= fMaxatk10) {
- // continue;
- // }
- // fMaxatk10 = fAtk;
- // fiids = [fiid];
- // }
- // break;
- // case 11: // 11敌方攻击力最低单位,
- // let fMinatk11: number = 999999999;
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // let fAtk = this.skbuff_get(fiid, "atk");
- // if (fAtk >= fMinatk11) {
- // continue;
- // }
- // fMinatk11 = fAtk;
- // fiids = [fiid];
- // }
- // break;
- // case 12: // 12敌方当前血量最低单位
- // let fMinhp12: number = 999999999;
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // let fAtk = this.skbuff_get(fiid, "hp");
- // if (fAtk >= fMinhp12) {
- // continue;
- // }
- // fMinhp12 = fAtk;
- // fiids = [fiid];
- // }
- // break;
- // case 13: // 13敌方当前血量最高单位,
- // let fMaxhp13: number = 0;
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // let fAtk = this.skbuff_get(fiid, "hp");
- // if (fAtk <= fMaxhp13) {
- // continue;
- // }
- // fMaxhp13 = fAtk;
- // fiids = [fiid];
- // }
- // break;
- // case 15: // 15 我打的最后一个
- // if (this.uuids[iid].ipk != "") {
- // fiids = [this.uuids[iid].ipk];
- // }
- // break;
- // case 16: //16生命值最低的已方单位)
- // let minHp: number = 0;
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (iqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // if (minHp == 0) {
- // fiids = [fiid];
- // minHp = fHp;
- // } else {
- // if (minHp > fHp) {
- // minHp = fHp;
- // fiids = [fiid];
- // }
- // }
- // }
- // break;
- // case 17: //17 我方主角
- // if (iqz.toString().length > 3) {
- // fiids = ["1000"];
- // } else {
- // fiids = ["100"];
- // }
- // break;
- // case 18: //18己方全体弟子
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // fiids.push(fiid);
- // }
- // break;
- // case 19: // 19 上次我攻击的对象
- // if (this.uuids[iid].ipks[this.zhen] != null) {
- // fiids = this.uuids[iid].ipks[this.zhen];
- // } else {
- // fiids = [];
- // }
- // break;
- // case 20: // 20 随机己方x个弟子
- // let cqlist20: string[] = [];
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // cqlist20.push(fiid);
- // }
- // fiids = this.seedRand.getRandArr(cqlist20, Math.min(cqlist20.length, targetType));
- // break;
- // case 21: // 21 敌方主角
- // if (iqz.toString().length > 3) {
- // fiids = ["100"];
- // } else {
- // fiids = ["1000"];
- // }
- // break;
- // case 22: // 22 敌方异常状态敌人
- // let cqlist22: string[] = [];
- // for (let k = 0; k < mblist[mubiao.toString()]["0"].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()]["0"][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // let buffs = ["effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_7"];
- // for (let index = 0; index < buffs.length; index++) {
- // let buff = buffs[index];
- // if (this.skbuff_get(fiid, buff, 2) > 0) {
- // cqlist22.push(fiid);
- // break;
- // }
- // }
- // }
- // fiids = this.seedRand.getRandArr(cqlist22, Math.min(cqlist22.length, targetType));
- // break;
- // case 23: // 23 攻击最近目标
- // let cqlist23: string[] = [];
- // for (let k = 0; k < mblist[mubiao.toString()][yu].length; k++) {
- // let fiid = (fqz + mblist[mubiao.toString()][yu][k]).toString();
- // let fHp = this.skbuff_get(fiid, "hp");
- // if (this.teams[fiid] == null || fHp <= 0) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.teams[fiid].isHide) == false) {
- // continue; //隐藏
- // }
- // cqlist23.push(fiid);
- // if (cqlist23.length == targetType) {
- // break;
- // }
- // }
- // fiids = cqlist23;
- // break;
- // }
- // for (let i = 0; i < fiids.length; i++) {
- // if (this.oneFiids[iid][key].length >= targetType) {
- // continue;
- // }
- // if (this.oneFiids[iid][key].includes(fiids[i])) {
- // continue;
- // }
- // this.oneFiids[iid][key].push(fiids[i]);
- // }
- // }
- // }
- // /**
- // * 辅助函数 - 获取对手
- // * @param key 标识key
- // * @param iid 出手方
- // * @param distance 范围大小(半径)
- // */
- // private find_jianse_fiid(fiid: string, distance: number): string[] {
- // if (gameMethod.isEmpty(distance) == true) {
- // return [];
- // }
- // let fiids: string[] = [];
- // //是不是范围触发
- // let fwlist: { [wxid: string]: { [fw: string]: number[] } } = {
- // 1: { 1: [2, 4, 5, 13, 15], 2: [3, 6, 7, 8, 9, 17], 3: [14, 16, 18, 0] },
- // 2: { 1: [1, 3, 4, 5, 6], 2: [7, 8, 9, 14, 16, 18, 13, 15, 17], 3: [0] },
- // 3: { 1: [2, 5, 6, 14, 16], 2: [1, 4, 7, 8, 9, 18], 3: [13, 15, 17, 0] },
- // 4: { 1: [1, 2, 5, 7, 8, 13, 15, 17], 2: [3, 6, 9, 0], 3: [14, 16, 18] },
- // 5: { 1: [1, 2, 3, 4, 6, 7, 8, 9], 2: [13, 15, 17, 14, 16, 18, 0] },
- // 6: { 1: [2, 3, 5, 8, 9, 14, 16, 18], 2: [1, 4, 7, 0], 3: [13, 15, 17] },
- // 7: { 1: [4, 5, 8, 0, 15, 17], 2: [1, 2, 3, 6, 9, 13], 3: [14, 16, 18] },
- // 8: { 1: [0, 4, 5, 6, 7, 9], 2: [1, 2, 3, 14, 16, 18, 13, 15, 17] },
- // 9: { 1: [0, 5, 6, 8, 16, 18], 2: [1, 2, 3, 4, 7, 14], 3: [13, 15, 17] },
- // 0: { 1: [7, 8, 9], 2: [4, 5, 6, 15, 16, 17, 18], 3: [1, 2, 3, 13, 14] },
- // };
- // let wxid = Number(fiid) % 100;
- // let qz: string = "10"; //前缀
- // if (fiid.length == 4) {
- // qz = "100";
- // }
- // for (let index = 1; index <= Math.floor(distance / 100); index++) {
- // if (fwlist[wxid] == null || fwlist[wxid][index] == null) {
- // continue;
- // }
- // for (let k = 0; k < fwlist[wxid][index].length; k++) {
- // if (this.teams[qz + fwlist[wxid][index][k]] == null) {
- // continue;
- // }
- // if (this.teams[qz + fwlist[wxid][index][k]].eps.hp <= 0) {
- // continue;
- // }
- // if (fiids.includes(qz + fwlist[wxid][index][k])) {
- // continue;
- // }
- // if (!gameMethod.isEmpty(this.teams[qz + fwlist[wxid][index][k]].isHide)) {
- // continue; // 隐藏
- // }
- // fiids.push(qz + fwlist[wxid][index][k]);
- // }
- // }
- // return fiids;
- // }
- // /**
- // * 结算各种伤害
- // * @param iid 攻击方
- // * @param fiid 被攻击方
- // * @param a 伤害系数
- // * @param skid 触发技能
- // */
- // private js_hits(iid: string, fiid: string, a: number, skid: string) {
- // //兽灵攻击
- // if (this.teams[iid].type == 3 || Number(iid) % 100 == 10) {
- // let mzid: number = 100;
- // let fzid: number = 1000;
- // if (iid.length > 3) {
- // mzid = 1000;
- // fzid = 100;
- // }
- // let i_z_atk = this.skbuff_get(mzid.toString(), "atk");
- // let i_z_qhshouling = this.skbuff_get(mzid.toString(), "qhshouling");
- // let f_z_rhshouling = this.skbuff_get(fzid.toString(), "rhshouling");
- // let slhit = ((i_z_atk * a) / 10000) * Math.max(1, 1 + (i_z_qhshouling - f_z_rhshouling) / 10000);
- // //输出伤害fjsRate
- // if (this.oneHit[iid] == null) {
- // this.oneHit[iid] = {};
- // }
- // this.oneHit[iid][fiid] = {
- // pghit: Math.floor(slhit), //普攻伤害
- // skhit: Math.floor(slhit), //技能伤害
- // bjhit: 0, //暴击伤害
- // gdhit: 0, //格挡伤害
- // fjhit: 0, //反击伤害
- // ljhit: 0, //连击伤害
- // jshit: 0, //溅射伤害(没有折损比例系数)
- // xxhit: 0, //吸血值
- // xxRate: 0, //吸血值
- // jsRate: 0, //吸血值
- // fjsRate: 0, //吸血值
- // };
- // return;
- // }
- // //伤害公式:我方攻击>敌方防御 如果这个条件成立,普攻伤害走下面公式
- // //普通伤害=max((我方攻击-敌方防御)*(1+我方伤害增强-敌方伤害减弱),我方攻击*0.15)*RANDBETWEEN(0.97,1.03)
- // //否则
- // //普通伤害=max(0,0.85*pow(我方攻击,0.8))
- // let i_atk: number = this.skbuff_get(iid, "atk");
- // let f_def: number = this.skbuff_get(fiid, "def");
- // let base_hit: number = 0; //普通伤害
- // if (i_atk > f_def) {
- // let i_zengshang: number = this.skbuff_get(iid, "zengshang");
- // let f_jianshang: number = this.skbuff_get(fiid, "jianshang");
- // base_hit = (Math.max(((i_atk - f_def) * (10000 + i_zengshang - f_jianshang)) / 10000, i_atk * 0.15) * this.seedRand.rand(97, 103)) / 100;
- // } else {
- // base_hit = Math.max(0, 0.85 * Math.pow(i_atk, 0.8));
- // }
- // let i_a = this.skbuff_get(iid, "a"); //效果加成
- // let i_75 = this.skbuff_get(iid, "i_75"); //效果加成
- // if (i_75 != 0) {
- // // 一次加成的效果 用完清空
- // this.skbuff_sub_all(iid, "effect_i_75");
- // }
- // // let f_a = this.skbuff_get(fiid,"i_30") //伤害加深
- // //对最终伤害有概率造成N倍伤害
- // let i_a_per = this.skbuff_get(iid, "a_per"); //效果加成
- // if (i_a_per != 0) {
- // // 一次加成的效果 用完清空
- // this.skbuff_sub_all(iid, "effect_i_67");
- // }
- // i_a_per = i_a_per ? i_a_per : 1;
- // let i_sk_a = this.skbuff_get(iid, "sk_a"); //技能伤害加成
- // //普功伤害
- // let pg_hit = (base_hit * (a + i_a + i_75) * i_a_per) / 10000;
- // //技能伤害=普通伤害 *(0+技能系数)
- // let sk_hit: number = (base_hit * (a + i_a + i_75 + i_sk_a) * i_a_per) / 10000;
- // //普通攻击 + 额外伤害
- // let cfgSk = Gamecfg.skillBase.getItem(skid, "1");
- // let zzhit = pg_hit; //最终伤害
- // if (cfgSk != null && cfgSk.skillType == 3) {
- // zzhit = sk_hit;
- // }
- // //暴击伤害= 技能伤害*max(我方强化暴伤-敌方忽视暴伤,1)
- // let i_baonue: number = this.skbuff_get(iid, "baonue");
- // let f_renai: number = this.skbuff_get(fiid, "renai");
- // let bj_hit: number = zzhit * Math.max(1, (i_baonue - f_renai) / 10000);
- // //格挡伤害= MIN(技能伤害*(MAX(敌方格挡增强-我方格挡减弱,0.12)),技能伤害*0.9)
- // let f_qhblock: number = this.skbuff_get(fiid, "qhblock");
- // let i_rhblock: number = this.skbuff_get(iid, "rhblock");
- // let gd_hit: number = Math.min(zzhit * Math.max(0.12, (f_qhblock - i_rhblock) / 10000), zzhit * 0.9);
- // //反击伤害= MIN(技能伤害*MAX(敌方反击增强-我方反击减弱,1),我方生命*0.85)
- // let f_qhfanji: number = this.skbuff_get(fiid, "qhfanji");
- // let i_rhfanji: number = this.skbuff_get(iid, "rhfanji");
- // let i_hp: number = this.skbuff_get(iid, "hp");
- // let fj_hit: number = Math.min(zzhit * Math.max(1, (f_qhfanji - i_rhfanji) / 10000), i_hp * 0.9);
- // //连击伤害 = 技能伤害*MAX(我方连击增强-敌方连击减弱,1)
- // let i_qhlianji: number = this.skbuff_get(iid, "qhlianji");
- // let f_rhlianji: number = this.skbuff_get(fiid, "rhlianji");
- // let lj_hit: number = zzhit * Math.max((i_qhlianji - f_rhlianji) / 10000 + 1, 1);
- // //溅射伤害= 最终伤害*折损比例系数*MAX(我方溅射增强-敌方溅射减弱,0.12)
- // //折损比例系数 这个这边不计算
- // let i_jianshe: number = this.skbuff_get(iid, "jianshe");
- // let f_hsjianshe: number = this.skbuff_get(fiid, "hsjianshe");
- // let bdjianshe: number = 0; //保底吸血
- // let cfgjs = Gamecfg.userEp.getItem("jianshe");
- // if (cfgjs != null) {
- // bdjianshe = cfgjs.initEp;
- // }
- // let jsRate: number = Math.max(i_jianshe - f_hsjianshe, bdjianshe);
- // let fjsRate: number = Math.max(f_hsjianshe - i_jianshe, bdjianshe);
- // let i_qhjianshe: number = this.skbuff_get(iid, "qhjianshe");
- // let f_rhjianshe: number = this.skbuff_get(fiid, "rhjianshe");
- // let js_hit: number = zzhit * Math.max((i_qhjianshe - f_rhjianshe) / 10000, 0.12);
- // //吸血率=max((我方吸血-敌方抗吸血),吸血保底参数)
- // //吸血值= 最终伤害值*max(我方吸血增强-敌方吸血减弱,1)*吸血率
- // let i_xixue: number = this.skbuff_get(iid, "xixue");
- // let f_hsxixue: number = this.skbuff_get(fiid, "hsxixue");
- // let bdxixue: number = 0; //保底吸血
- // let cfg = Gamecfg.userEp.getItem("xixue");
- // if (cfg != null) {
- // bdxixue = cfg.initEp;
- // }
- // let xxRate: number = Math.max(i_xixue - f_hsxixue, bdxixue);
- // let i_qhxixue: number = this.skbuff_get(iid, "qhxixue");
- // let f_rhxixue: number = this.skbuff_get(fiid, "rhxixue");
- // let xx_hit: number = (zzhit * Math.max((i_qhxixue - f_rhxixue) / 10000 + 1, 1) * xxRate) / 10000;
- // if (this.oneHit[iid] == null) {
- // this.oneHit[iid] = {};
- // }
- // if (cfgSk != null && cfgSk.skillType == 1) {
- // //指计算普攻
- // let pg_hit_per: number = 0;
- // //普攻施加buff
- // let i_19_a = this.skbuff_get(iid, "i_19_a");
- // let i_19_i = this.skbuff_get(iid, "i_19_i");
- // if (i_19_a > 0 && i_19_i > 0) {
- // let ef_i_19_i = this.skbuff_get(iid, "effect_i_" + i_19_i, 2);
- // pg_hit_per += i_19_a * ef_i_19_i;
- // }
- // let i_39_a = this.skbuff_get(iid, "i_39_a");
- // pg_hit_per += i_39_a;
- // pg_hit += (pg_hit_per / 10000) * pg_hit;
- // }
- // //输出伤害
- // this.oneHit[iid][fiid] = {
- // pghit: Math.floor(pg_hit), //普攻伤害
- // skhit: Math.floor(sk_hit), //技能伤害
- // bjhit: Math.floor(bj_hit), //暴击伤害
- // gdhit: Math.floor(gd_hit), //格挡伤害
- // fjhit: Math.floor(fj_hit), //反击伤害
- // ljhit: Math.floor(lj_hit), //连击伤害
- // jshit: Math.floor(js_hit), //溅射伤害(没有折损比例系数)
- // xxhit: Math.floor(xx_hit), //吸血值
- // xxRate: xxRate, //吸血概率
- // jsRate: jsRate, //溅射概率
- // fjsRate: fjsRate, //反击溅射概率
- // };
- // //伤害加深
- // if (this.skbuff_get(iid, "effect_i_53", 2) > 0) {
- // let hit53 = this.skbuff_get(iid, "i_53");
- // this.oneHit[iid][fiid] = {
- // pghit: hit53, //普攻伤害
- // skhit: hit53, //技能伤害
- // bjhit: hit53, //暴击伤害
- // gdhit: Math.floor(gd_hit), //格挡伤害
- // fjhit: Math.floor(fj_hit), //反击伤害
- // ljhit: hit53, //连击伤害
- // jshit: hit53, //溅射伤害(没有折损比例系数)
- // xxhit: Math.floor(xx_hit), //吸血值
- // xxRate: xxRate, //吸血概率
- // jsRate: jsRate, //溅射概率
- // fjsRate: fjsRate, //反击溅射概率
- // };
- // }
- // if (Number(iid) % 100 < 10 && Number(iid) % 100 > 0 && this.skbuff_get(iid, "effect_i_64", 2) > 0) {
- // // 是弟子 首次增伤
- // let i_64_a = this.skbuff_get(iid, "i_64_a");
- // let i_64_nZhen = this.skbuff_get(iid, "i_64_nZhen");
- // if (i_64_a > 0 && i_64_nZhen <= this.zhen) {
- // // 只加一次
- // this.skbuff_sub_all(iid, "effect_i_64");
- // this.oneHit[iid][fiid].skhit = Math.floor(this.oneHit[iid][fiid].skhit * (i_64_a / 10000 + 1));
- // this.oneHit[iid][fiid].pghit = Math.floor(this.oneHit[iid][fiid].pghit * (i_64_a / 10000 + 1));
- // }
- // }
- // }
- // private sk_base2(iid: string, runStatus: number, cs: { [key: string]: number } = {}) {
- // let type = Number(iid) % 100 == 0 ? 1 : Number(iid) % 100 > 0 && Number(iid) % 100 < 10 ? 2 : 3;
- // if (this.objects[iid.length] == null || this.objects[iid.length][type] == null) {
- // return;
- // }
- // let cf_sk: { [skillType: string]: [string, { [key: string]: number }, number][] } = {}; //当前要触发的技能库
- // let skids: string[] = Object.keys(this.objects[iid.length][type]);
- // for (let index = skids.length - 1; index >= 0; index--) {
- // let skid = skids[index];
- // let sklv = this.objects[iid.length][type][skid].sklv;
- // let sklvCd = 100;
- // let cfgSk = Gamecfg.skillBase.getItem(skid, sklv.toString());
- // if (cfgSk == null) {
- // continue; //没有这个技能 或者 这个技能的触发时机不对
- // }
- // if (cfgSk.runStatus != runStatus) {
- // continue; //没有这个技能 或者 这个技能的触发时机不对
- // }
- // if (cfgSk.runStatus === 4 && !cfgSk.cd && this.zhen != 1) {
- // // 没有cd的 runStatus=4的只在战斗开始时加一次
- // continue;
- // }
- // //受到攻击后触发
- // if (cfgSk.runStatus == 2) {
- // //被打次数
- // let bdcons = this.uuids[iid].fcons[0] + this.uuids[iid].fcons[1] + this.uuids[iid].fcons[2];
- // if (bdcons == 0) {
- // continue; //还没被打
- // }
- // if (gameMethod.isEmpty(cfgSk.hitNumber) == false && bdcons % cfgSk.hitNumber > 0) {
- // continue; //未累计到次数
- // }
- // }
- // let eff_i_3 = this.skbuff_get(iid, "effect_i_3", 2);
- // if (eff_i_3 > 0) {
- // continue; //晕眩
- // }
- // let eff_i_5 = this.skbuff_get(iid, "effect_i_5", 2);
- // if (eff_i_5 > 0) {
- // continue; //晕眩
- // }
- // let eff_i_6 = this.skbuff_get(iid, "effect_i_6", 2);
- // if (eff_i_6 > 0) {
- // continue; //击退
- // }
- // let eff_i_16 = this.skbuff_get(iid, "effect_i_16", 2);
- // if (eff_i_16 > 0) {
- // continue; //入定状态
- // }
- // //(1普攻,2 被动,3技能)
- // if (cfgSk.skillType != 1) {
- // let eff_i_1 = this.skbuff_get(iid, "effect_i_1", 2);
- // if (eff_i_1 > 0) {
- // //沉默
- // continue;
- // }
- // }
- // //初始化技能
- // if (this.uuids[iid].skbase[skid] == null) {
- // this.uuids[iid].skbase[skid] = {
- // last: 0, //最后一次出手帧
- // count: 0,
- // action: {},
- // effect: {},
- // };
- // }
- // //技能cd
- // let cs2:{[key:string]:number} = gameMethod.objCopy(cs)
- // cs2["cd"] = gameMethod.isEmpty(cfgSk.cd) ? 0 : cfgSk.cd * 30;
- // cs2["cd2"] = gameMethod.isEmpty(cfgSk.cd2) ? 0 : (parseInt(iid) % 100 == 10 ? (cfgSk.cd2 * 30 * sklvCd) / 100 : cfgSk.cd2 * 30);
- // if (this.uuids[iid].skbase[skid].last + cs["cd"] > this.zhen) {
- // continue; //冷却时间还没到
- // }
- // //次数判定
- // if (gameMethod.isEmpty(cfgSk.count) == false && this.uuids[iid].skbase[skid].count >= cfgSk.count) {
- // continue; //没有次数了
- // }
- // if (gameMethod.isEmpty(cfgSk.chance) == false && this.seedRand.rand(1, 10000) > cfgSk.chance * 10000) {
- // continue; //没有触发这个技能
- // }
- // if (cfgSk.skillType == 2) {
- // //被动
- // } else if (cfgSk.skillType == 3) {
- // //特殊技能
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.atk);
- // this.addOneAtk(iid, iid, "aSkid", skid);
- // }
- // //先找出触发的技能ID
- // if (cf_sk[cfgSk.skillType] == null) {
- // cf_sk[cfgSk.skillType] = [];
- // }
- // cf_sk[cfgSk.skillType].push([skid, cs2, sklv]);
- // }
- // return cf_sk;
- // }
- // private sk_baseObjRun4(iid: string) {
- // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
- // return; //隐藏
- // }
- // let skids: string[] = Object.keys(this.teams[iid].sk);
- // let type = Number(iid) % 100 == 0 ? 1 : Number(iid) % 100 > 0 && Number(iid) % 100 < 10 ? 2 : 3;
- // for (let index = skids.length - 1; index >= 0; index--) {
- // let skid = skids[index];
- // let sklv = this.teams[iid].sk[skid][0];
- // let cfgSk = Gamecfg.skillBase.getItem(skid, sklv.toString());
- // if (cfgSk && cfgSk.object && type != cfgSk.object) {
- // // 非给自己加的技能 在战斗前初始化
- // if (this.objects[iid.length] == null) {
- // this.objects[iid.length] = {};
- // }
- // if (this.objects[iid.length][cfgSk.object] == null) {
- // this.objects[iid.length][cfgSk.object] = {};
- // }
- // if (this.objects[iid.length][cfgSk.object][cfgSk.id] == null) {
- // this.objects[iid.length][cfgSk.object][cfgSk.id] = {
- // cd: cfgSk.cd ? cfgSk.cd : 0,
- // sklv: sklv,
- // iids: {},
- // };
- // }
- // }
- // }
- // }
- // /**
- // * 辅助函数 - 技能触发
- // * @param iid 触发者
- // * @param runStatus 技能触发时机
- // * 1:攻击时造成伤害
- // * 2:受到攻击时
- // * 3:灵力满怒时释放
- // * 4:进入战斗后,还没攻击前
- // * 5:进入战斗后,x秒内
- // * 6:攻击时造成伤害,并且目标成功格挡(注意和1类型是不同的)
- // * 7.反击时
- // * 8.自身格挡时。和6类型不同,6类型是敌方格挡
- // *
- // */
- // private sk_base(iid: string, runStatus: number, cs: { [key: string]: number } = {}) {
- // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
- // return false; //隐藏
- // }
- // let skids: string[] = Object.keys(this.teams[iid].sk);
- // let type = Number(iid) % 100 == 0 ? 1 : Number(iid) % 100 > 0 && Number(iid) % 100 < 10 ? 2 : 3;
- // let cf_sk: { [skillType: string]: [string, { [key: string]: number }, number][] } = {}; //当前要触发的技能库
- // for (let index = skids.length - 1; index >= 0; index--) {
- // let skid = skids[index];
- // let sklv = this.teams[iid].sk[skid][0];
- // let sklvCd = this.teams[iid].sk[skid][1];
- // let cfgSk = Gamecfg.skillBase.getItem(skid, sklv.toString());
- // if (cfgSk == null) {
- // continue; //没有这个技能 或者 这个技能的触发时机不对
- // }
- // if (cfgSk.object && type != cfgSk.object) {
- // // 不是加给自己的技能
- // continue;
- // } else if (cfgSk.runStatus != runStatus) {
- // continue; //没有这个技能 或者 这个技能的触发时机不对
- // }
- // //受到攻击后触发
- // if (cfgSk.runStatus == 2) {
- // //被打次数
- // let bdcons = this.uuids[iid].fcons[0] + this.uuids[iid].fcons[1] + this.uuids[iid].fcons[2];
- // if (bdcons == 0) {
- // continue; //还没被打
- // }
- // if (gameMethod.isEmpty(cfgSk.hitNumber) == false && bdcons % cfgSk.hitNumber > 0) {
- // continue; //未累计到次数
- // }
- // }
- // let eff_i_3 = this.skbuff_get(iid, "effect_i_3", 2);
- // if (eff_i_3 > 0) {
- // continue; //晕眩
- // }
- // let eff_i_5 = this.skbuff_get(iid, "effect_i_5", 2);
- // if (eff_i_5 > 0) {
- // continue; //晕眩
- // }
- // let eff_i_6 = this.skbuff_get(iid, "effect_i_6", 2);
- // if (eff_i_6 > 0) {
- // continue; //击退
- // }
- // let eff_i_16 = this.skbuff_get(iid, "effect_i_16", 2);
- // if (eff_i_16 > 0) {
- // continue; //入定状态
- // }
- // //(1普攻,2 被动,3技能)
- // if (cfgSk.skillType != 1) {
- // let eff_i_1 = this.skbuff_get(iid, "effect_i_1", 2);
- // if (eff_i_1 > 0) {
- // //沉默
- // continue;
- // }
- // }
- // //初始化技能
- // if (this.uuids[iid].skbase[skid] == null) {
- // this.uuids[iid].skbase[skid] = {
- // last: 0, //最后一次出手帧
- // count: 0,
- // action: {},
- // effect: {},
- // };
- // }
- // //技能cd
- // let cs2:{[key:string]:number} = gameMethod.objCopy(cs)
- // cs2["cd"] = gameMethod.isEmpty(cfgSk.cd) ? 0 : (parseInt(iid) % 100 == 10 ? (cfgSk.cd * 30 * sklvCd) / 100 : cfgSk.cd * 30);
- // cs2["cd2"] = gameMethod.isEmpty(cfgSk.cd2) ? 0 : (parseInt(iid) % 100 == 10 ? (cfgSk.cd2 * 30 * sklvCd) / 100 : cfgSk.cd2 * 30);
- // if (this.uuids[iid].skbase[skid].last + cs2["cd"] > this.zhen) {
- // continue; //冷却时间还没到
- // }
- // //次数判定
- // if (gameMethod.isEmpty(cfgSk.count) == false && this.uuids[iid].skbase[skid].count >= cfgSk.count) {
- // continue; //没有次数了
- // }
- // if (gameMethod.isEmpty(cfgSk.chance) == false && this.seedRand.rand(1, 10000) > cfgSk.chance * 10000) {
- // continue; //没有触发这个技能
- // }
- // if (cfgSk.skillType == 2) {
- // //被动
- // } else if (cfgSk.skillType == 3) {
- // //特殊技能
- // this.sk_base(iid, 5, cs2);
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.atk);
- // this.addOneAtk(iid, iid, "aSkid", skid);
- // }
- // //先找出触发的技能ID
- // if (cf_sk[cfgSk.skillType] == null) {
- // cf_sk[cfgSk.skillType] = [];
- // }
- // cf_sk[cfgSk.skillType].push([skid, cs2, sklv]);
- // }
- // // 获取共享技能
- // let cf_sk2 = this.sk_base2(iid, runStatus, cs);
- // if (cf_sk2 != null) {
- // let keys = Object.keys(cf_sk2);
- // for (let i = 0; i < keys.length; i++) {
- // let keys2 = Object.keys(cf_sk2[keys[i]]);
- // for (let k = 0; k < keys2.length; k++) {
- // if (cf_sk[keys[i]] == null) {
- // cf_sk[keys[i]] = [];
- // }
- // cf_sk[keys[i]].push(cf_sk2[keys[i]][k]);
- // }
- // }
- // }
- // //触发的技能列表
- // let cfids: [string, { [key: string]: number }, number][] = [];
- // if (cf_sk[3] != null) {
- // //只要触发高级技能 就不触发普通攻击技能
- // cfids = gameMethod.addArr(cfids, cf_sk[3]);
- // } else if (cf_sk[1] != null) {
- // cfids = gameMethod.addArr(cfids, cf_sk[1]);
- // }
- // if (cf_sk[2] != null) {
- // //被动技能
- // cfids = gameMethod.addArr(cfids, cf_sk[2]);
- // }
- // if (cfids.length <= 0) {
- // return false;
- // }
- // // 这里才是真正出手了的地方
- // if (runStatus != 4 && runStatus != 2 && runStatus != 7 && runStatus != 8) {
- // // 战斗前触发的特性/被动 不算
- // this.uuids[iid].last = this.zhen;
- // }
- // let values = Object.values(cfids);
- // for (let i = 0; i < values.length; i++) {
- // if (values[i][1]["do_iid"] == null) {
- // values[i][1]["do_iid"] = Number(iid);
- // }
- // let cs2 = values[i][1]
- // if (cs2["hit"] != null) {
- // values[i][1]["hit"] = cs2["hit"];
- // }
- // let skid = values[i][0];
- // let sklv = values[i][2];
- // let cfgSk = Gamecfg.skillBase.getItem(values[i][0], sklv.toString());
- // if (cfgSk == null) {
- // continue; //没有这个技能 或者 这个技能的触发时机不对
- // }
- // if (cfgSk.type == "3"){
- // // 术法触发
- // this.addOneAtk(iid, iid, "effect", ["shufa",skid]);
- // }
- // this.uuids[iid].skbase[skid].last = this.zhen + (cs2["cd2"]>0&&cs2["cd"]==0?cs2["cd2"]:0);
- // this.uuids[iid].skbase[skid].count += 1;
- // if (cfgSk.sequence == 2) {
- // //效果列表
- // if (gameMethod.isEmpty(cfgSk.effect) == false) {
- // let lastId = "";
- // for (let k = 0; k < cfgSk.effect.length; k++) {
- // this.sk_effect(iid, values[i][0], cfgSk.effect[k].toString(), lastId, values[i][1]);
- // lastId = "effect_id_" + cfgSk.effect[k];
- // }
- // }
- // //行为列表
- // if (gameMethod.isEmpty(cfgSk.actions) == false) {
- // let lastId = "";
- // for (let index = 0; index < cfgSk.actions.length; index++) {
- // let acId = cfgSk.actions[index];
- // this.sk_action(iid, values[i][0], acId.toString(), lastId);
- // lastId = "action_id_" + acId;
- // }
- // }
- // } else {
- // //行为列表
- // if (gameMethod.isEmpty(cfgSk.actions) == false) {
- // let lastId = "";
- // for (let index = 0; index < cfgSk.actions.length; index++) {
- // let acId = cfgSk.actions[index];
- // this.sk_action(iid, values[i][0], acId.toString(), lastId);
- // lastId = "action_id_" + acId;
- // }
- // }
- // //效果列表
- // if (gameMethod.isEmpty(cfgSk.effect) == false) {
- // let lastId = "";
- // for (let k = 0; k < cfgSk.effect.length; k++) {
- // this.sk_effect(iid, values[i][0], cfgSk.effect[k].toString(), lastId, values[i][1]);
- // lastId = "effect_id_" + cfgSk.effect[k];
- // }
- // }
- // }
- // }
- // return true;
- // }
- // /**
- // * 辅助函数 - 技能行为
- // * @param iid 触发者
- // * @param runStatus 技能触发时机
- // * 1:攻击时造成伤害
- // * 2:受到攻击时
- // * 3:灵力满怒时释放
- // * 4:进入战斗后,还没攻击前
- // */
- // private sk_action(iid: string, skid: string, acId: string, extend: string = "") {
- // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
- // return; //隐藏
- // }
- // let cfgAc = Gamecfg.skillAction.getItem(acId);
- // if (cfgAc == null) {
- // return;
- // }
- // if (this.oneFiids[iid] == null) {
- // this.oneFiids[iid] = {};
- // }
- // let ac_ttype = "action_id_" + acId; //对手标识
- // //继承上一次的目标
- // if (extend != "") {
- // //这里可以先继承
- // this.oneFiids[iid][ac_ttype] = this.oneFiids[iid][extend];
- // }
- // let targetType: number = 0; //目标数量
- // //目标数量
- // if (gameMethod.isEmpty(cfgAc.targetType) == true) {
- // targetType = 10;
- // } else if (gameMethod.isEmpty(cfgAc.targetType[1]) == true) {
- // targetType = cfgAc.targetType[0];
- // } else {
- // targetType = this.seedRand.rand(cfgAc.targetType[0], cfgAc.targetType[1]);
- // }
- // this.find_fiids(ac_ttype, iid, cfgAc.ttype, targetType, cfgAc.distance); //选择对手
- // let cs: { [key: string]: number } = { do_iid: Number(iid) };
- // //造成伤害
- // if (cfgAc.args["a"] != null) {
- // this.timer_do(301, { do_iid: Number(iid) }); //攻击前触发
- // for (let i = 0; i < this.oneFiids[iid][ac_ttype].length; i++) {
- // this.js_hits(iid, this.oneFiids[iid][ac_ttype][i], cfgAc.args["a"] * 10000, skid); //计算伤害
- // let cs2 = this.sk_action_type_1(iid, this.oneFiids[iid][ac_ttype][i], skid, acId);
- // cs = Object.assign(cs, cs2);
- // cs[this.oneFiids[iid][ac_ttype][i]] = cs2["hit"];
- // }
- // }
- // //造成伤害 - 术法
- // if (cfgAc.args["atk"] != null) {
- // this.timer_do(301, { do_iid: Number(iid) }); //攻击前触发
- // for (let i = 0; i < this.oneFiids[iid][ac_ttype].length; i++) {
- // this.js_hits(iid, this.oneFiids[iid][ac_ttype][i], cfgAc.args["atk"], skid); //计算伤害
- // let cs2 = this.sk_action_type_1(iid, this.oneFiids[iid][ac_ttype][i], skid, acId);
- // cs = Object.assign(cs, cs2);
- // cs[this.oneFiids[iid][ac_ttype][i]] = cs2["hit"];
- // }
- // }
- // //触发effect
- // if (cfgAc.args["id"] != null) {
- // let p = 0; //buff触发概率
- // if (cfgAc.args["p"] != null) {
- // p = cfgAc.args["p"] * 10000; //buff触发概率
- // }
- // if (this.seedRand.rand(1, 10000) <= p) {
- // for (let i = 0; i < cfgAc.args.id.length; i++) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgAc.args.id[i].toString(), ac_ttype, cs);
- // }
- // }
- // }
- // //有概率给我方弟子挂一个反击buff
- // if (gameMethod.isEmpty(cfgAc.canbeatback) == false) {
- // let p = 0; //buff触发概率
- // if (cfgAc.args["p"] != null) {
- // p = cfgAc.args["p"] * 10000; //buff触发概率
- // }
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // if (this.teams[fiid].type != 2) {
- // continue; //不是弟子
- // }
- // if (this.teams[fiid].eps.hp <= 0) {
- // continue; //
- // }
- // if (iid.length != fiid.length) {
- // continue; //不是同阵营的
- // }
- // if (this.seedRand.rand(1, 10000) <= p) {
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: "canbeatback", //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + 30 * 45, //结束帧
- // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: {}, //属性
- // });
- // }
- // }
- // }
- // }
- // /**
- // * 辅助函数 - 技能效果
- // * @param iid 触发者
- // * @param skid 技能ID
- // * @param effectId 效果ID
- // * @param extend 继承目标key
- // */
- // private sk_effect(iid: string, skid: string, effectId: string, extend: string = "", cs: { [key: string]: number } = {}) {
- // if (gameMethod.isEmpty(this.teams[iid].isHide) == false) {
- // return; //隐藏
- // }
- // let cfgBase = Gamecfg.skillBase.getItem(skid, "1");
- // let cfgEf = Gamecfg.skillEffect.getItem(effectId);
- // if (cfgEf == null || cfgBase == null) {
- // return;
- // }
- // //次数判定
- // if (
- // gameMethod.isEmpty(cfgEf.count) == false &&
- // this.uuids[iid].skbase[skid] &&
- // this.uuids[iid].skbase[skid].effect[effectId] &&
- // this.uuids[iid].skbase[skid].effect[effectId].count >= cfgEf.count
- // ) {
- // return; //没有次数了
- // }
- // if (this.oneFiids[iid] == null) {
- // this.oneFiids[iid] = {};
- // }
- // let ef_ttype = "effect_id_" + effectId;
- // //继承上一次的目标
- // if (extend != "") {
- // //这里可以先继承
- // this.oneFiids[iid][ef_ttype] = this.oneFiids[iid][extend];
- // }
- // //持续多少针
- // let maxzhen: number = gameMethod.isEmpty(cfgEf.args["t"]) == false ? cfgEf.args["t"] * 30 : 45 * 30;
- // //m增加层数
- // let e_m: number = gameMethod.isEmpty(cfgEf.args["m"]) == false ? cfgEf.args["m"] : 1;
- // //n表示层数上限
- // let e_n: number = gameMethod.isEmpty(cfgEf.args["n"]) == false ? cfgEf.args["n"] : 9999;
- // //1.叠加 2.不叠加替换,默认不填值就是不叠加
- // let overlayType: number = gameMethod.isEmpty(cfgEf.overlayType) ? 2 : cfgEf.overlayType;
- // //效果标识
- // let e_i: number = gameMethod.isEmpty(cfgEf.args["i"]) == false ? cfgEf.args["i"] : 0;
- // //效果标识
- // let interval: number = gameMethod.isEmpty(cfgEf.interval) == false ? cfgEf.interval * 30 : 0; //效果标识
- // if (this.uuids[iid].skbase[skid] == null) {
- // this.uuids[iid].skbase[skid] = {
- // last: 0, //最后一次出手帧
- // count: 0,
- // action: {},
- // effect: {},
- // };
- // }
- // if (this.uuids[iid].skbase[skid].effect[effectId] == null) {
- // this.uuids[iid].skbase[skid].effect[effectId] = {
- // effectZhen: 0, //触发帧
- // effectEndZhen: 0, //触发结束帧
- // nextcd: 0, //下一次出手时间
- // count: 0,
- // f: 0,
- // };
- // }
- // //效果cd
- // if (
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd > this.zhen &&
- // (this.zhen != this.uuids[iid].skbase[skid].effect[effectId].effectZhen || (cfgEf.targetType.length == 1 && cfgEf.targetType[0] == 1)) &&
- // !(this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen >= this.zhen && cs["isTimer"] == 1)
- // ) {
- // return;
- // }
- // //cs["isTimer"] = 0; // 定时器来的 不参与cd效果判定
- // let ef_buff = "effect_i_" + e_i; //效果i标识
- // if (gameMethod.isEmpty(cfgEf.ttype) == false && cs["isTimer"] != 1) {
- // let targetType: number = 0; //目标数量
- // //目标数量
- // if (gameMethod.isEmpty(cfgEf.targetType) == true) {
- // targetType = 10;
- // } else if (gameMethod.isEmpty(cfgEf.targetType[1]) == true) {
- // targetType = cfgEf.targetType[0];
- // } else {
- // targetType = this.seedRand.rand(cfgEf.targetType[1], cfgEf.targetType[0]);
- // }
- // this.find_fiids(ef_ttype, iid, cfgEf.ttype, targetType);
- // }
- // //buff效果
- // if (this.oneFiids[iid] && this.oneFiids[iid][ef_ttype]) {
- // for (let i = 0; i < this.oneFiids[iid][ef_ttype].length; i++) {
- // let eff_i_m = this.skbuff_get(this.oneFiids[iid][ef_ttype][i], ef_buff, 2);
- // if (eff_i_m >= e_n) {
- // continue; //超过层数
- // }
- // e_m = Math.min(e_m, e_n - eff_i_m);
- // }
- // }
- // //添加定时执行 - 之后在触发效果
- // if (gameMethod.isEmpty(cfgEf.triggerTime) == false && this.uuids[iid].timer[ef_ttype] == null) {
- // this.timer_add({
- // iid: iid, //触发者
- // fiids: this.oneFiids[iid][ef_ttype], //触发者
- // key: ef_ttype, //定时器标识
- // type: cfgEf.triggerTime ? cfgEf.triggerTime : [601], //执行触发点
- // func: "sk_effect", //执行的函数名
- // lzhen: interval, //轮询执行时间
- // ezhen: 45 * 30,
- // skid: skid, //技能ID
- // aeid: effectId, //效果ID|行为ID
- // cs: cs, //参数
- // overlayType: overlayType,
- // });
- // if (cfgEf.triggerTime[0] == 301) {
- // for (let i = 0; i < this.oneFiids[iid][ef_ttype].length; i++) {
- // this.timer_do(301, { do_iid: Number(this.oneFiids[iid][ef_ttype][i]) });
- // }
- // if (gameMethod.isEmpty(cfgEf.count) == false && this.zhen != 1) {
- // this.uuids[iid].skbase[skid].effect[effectId].count += 1;
- // if (this.uuids[iid].skbase[skid].effect[effectId].count >= cfgEf.count) {
- // if (gameMethod.isEmpty(cfgEf.cd) == false) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // this.uuids[iid].skbase[skid].effect[effectId].count = 0;
- // this.uuids[iid].timer[ef_ttype][cs["timerId"].toString()].szhen = this.zhen + cfgEf.cd * 30;
- // } else {
- // }
- // }
- // }
- // if (gameMethod.isEmpty(cfgEf.cd) == false && this.zhen != 1) {
- // if (this.uuids[iid].skbase[skid].effect[effectId].count == 0) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
- // if (cfgEf.args["t"]) {
- // if (this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen < this.zhen) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen = this.zhen + cfgEf.args["t"] * 30; // buff持续增加效果结束帧
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // }
- // } else {
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // }
- // }
- // }
- // }
- // return; //cd后再触发
- // }
- // //1.附加属性(万分比)
- // if (cfgEf.type == 1) {
- // for (let i = 0; i < this.oneFiids[iid][ef_ttype].length; i++) {
- // let fiid = this.oneFiids[iid][ef_ttype][i];
- // let cf508: number = 0;
- // let eff_1_ep: { [key: string]: number } = {};
- // let keys = Object.keys(cfgEf.args);
- // for (let k = 0; k < keys.length; k++) {
- // // 加属性 这边in没关系
- // if (this.teams[fiid].eps[keys[k]] == null) {
- // continue;
- // }
- // if (this.teams[fiid].eps[keys[k]] != null) {
- // eff_1_ep[keys[k]] = cfgEf.args[keys[k]];
- // if (cfgEf.args[keys[k]] < 0) {
- // cf508 = 1;
- // break;
- // }
- // }
- // if (cf508 != 0) {
- // break;
- // }
- // }
- // if (overlayType === 2 || this.skbuff_get(fiid, ef_buff + "_" + effectId, 2) + e_m <= e_n) {
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff + "_" + effectId, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: eff_1_ep, //属性
- // });
- // }
- // this.teams[fiid].eps.hp = this.skbuff_get(fiid, "hp");
- // // this.teams[fiid].eps.hp_max = this.skbuff_get(fiid, "hp_max");
- // if (cf508 == 1) {
- // this.timer_do(508, { do_iid: Number(fiid) });
- // }
- // }
- // //cd
- // if (this.oneFiids[iid][ef_ttype].length > 0) {
- // if (gameMethod.isEmpty(cfgEf.count) == false && this.zhen != 1) {
- // this.uuids[iid].skbase[skid].effect[effectId].count += 1;
- // if (this.uuids[iid].skbase[skid].effect[effectId].count >= cfgEf.count) {
- // if (gameMethod.isEmpty(cfgEf.cd) == false) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // this.uuids[iid].skbase[skid].effect[effectId].count = 0;
- // this.uuids[iid].timer[ef_ttype][cs["timerId"].toString()].szhen = this.zhen + cfgEf.cd * 30;
- // } else {
- // }
- // }
- // }
- // if (gameMethod.isEmpty(cfgEf.cd) == false && this.zhen != 1) {
- // if (this.uuids[iid].skbase[skid].effect[effectId].count == 0) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
- // if (cfgEf.args["t"]) {
- // if (this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen < this.zhen) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen = this.zhen + cfgEf.args["t"] * 30; // buff持续增加效果结束帧
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // }
- // } else {
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // }
- // }
- // }
- // }
- // }
- // //2.附加状态
- // if (cfgEf.type == 2) {
- // this.sk_effect_type_2(skid, effectId, iid, this.oneFiids[iid][ef_ttype], cs);
- // }
- // }
- // /**
- // * 触发效果
- // * @param effectId 效果ID
- // * @param iid 触发者
- // * @param fiids 触发对象
- // * @returns
- // */
- // private sk_effect_type_2(skid: string, effectId: string, iid: string, fiids: string[], cs: { [key: string]: number } = {}) {
- // let cfgBase = Gamecfg.skillBase.getItem(skid, "1");
- // let cfgEf = Gamecfg.skillEffect.getItem(effectId);
- // if (cfgEf == null || cfgEf.args["i"] == null || cfgBase == null) {
- // return;
- // }
- // //持续多少针
- // let maxzhen: number = cfgEf.args["t"] != null ? cfgEf.args["t"] * 30 : 45 * 30;
- // //a填小数:每秒持续收到最终伤害的百分比
- // let e_a: number = gameMethod.isEmpty(cfgEf.args["a"]) == false ? cfgEf.args["a"] * 10000 : 0;
- // //m增加层数
- // let e_m: number = gameMethod.isEmpty(cfgEf.args["m"]) == false ? cfgEf.args["m"] : 1;
- // //n表示层数上限
- // let e_n: number = gameMethod.isEmpty(cfgEf.args["n"]) == false ? cfgEf.args["n"] : 9999;
- // //id引发下一个effect_ID
- // let e_id: string = gameMethod.isEmpty(cfgEf.args["id"]) == false ? cfgEf.args["id"].toString() : "";
- // //1.叠加 2.不叠加替换,默认不填值就是不叠加
- // let overlayType: number = gameMethod.isEmpty(cfgEf.overlayType) ? 2 : cfgEf.overlayType;
- // //效果标识
- // let e_i: number = gameMethod.isEmpty(cfgEf.args["i"]) == false ? cfgEf.args["i"] : 0;
- // let ef_ttype = "effect_id_" + effectId; //效果ID标识
- // let ef_buff = "effect_i_" + e_i; //效果i标识
- // let lsOne: number = 0; //临时自己只操作一次的
- // let pass: boolean = true;
- // for (let i = 0; i < fiids.length; i++) {
- // let fiid = fiids[i];
- // let eff_i_m = this.skbuff_get(fiid, ef_buff, 2);
- // if (eff_i_m >= e_n) {
- // continue; //超过层数
- // }
- // e_m = Math.min(e_m, e_n - eff_i_m);
- // switch (cfgEf.args["i"]) {
- // case 1: //沉默 无法释放技能(可以放普攻),不可叠加,持续4秒
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // this.timer_do(508, { do_iid: Number(fiid) });
- // break;
- // case 2: //2 回血 按最终伤害值百分比进行回血
- // if (cs["do_iid"] != Number(iid)) {
- // continue;
- // }
- // if (cs["hit"] == null) {
- // if (cfgEf.args["a"] != null) {
- // if (!this.oneHit[iid]) {
- // let hit_fiid = this.uuids[iid].ipk;
- // this.js_hits(iid, hit_fiid, cfgEf.args["a"] * 10000, skid); //计算伤害
- // let gzhit = this.oneHit[iid][hit_fiid];
- // cs["hit"] = gzhit.skhit;
- // } else {
- // let keys = Object.keys(this.oneHit[iid]);
- // for (let k = 0; k < keys.length; k++) {
- // cs["hit"] = this.oneHit[iid][keys[k]].ljhit;
- // }
- // }
- // }
- // if (cs["hit"] == null) {
- // continue;
- // }
- // }
- // if (cs["next_cx"] != null && cs["next_cx"] < this.zhen && cs["isTimer"] == 1) {
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, fiid, "effect", ["hp", Math.floor((cs["hit"] * e_a) / 10000)]);
- // } else {
- // if (cfgEf.args["if"] == 1) {
- // // 有if=1的直接回血一次
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, fiid, "effect", ["hp", Math.floor((cs["hit"] * e_a) / 10000)]);
- // } else {
- // // pass = false; // 加定时器回血 不加cd
- // cs["next_cx"] = this.zhen;
- // cs["do_iid"] = Number(fiid);
- // this.timer_add({
- // iid: iid, //触发者
- // fiids: [fiid], //触发对象
- // key: ef_ttype + "_" + e_i, //定时器标识
- // type: [601], //执行触发点
- // func: "sk_effect", //执行的函数名
- // lzhen: 30, //轮询执行时间
- // ezhen: this.zhen + maxzhen,
- // skid: skid, //技能ID
- // aeid: effectId, //效果ID|行为ID
- // cs: cs, //参数
- // overlayType: overlayType,
- // });
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: { e_a: e_a }, //属性
- // });
- // }
- // //delete cs["next_cx"]
- // }
- // break;
- // case 3: //晕眩 无法移动、攻击和释放技能,不可叠加,持续3秒
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // this.timer_do(508, { do_iid: Number(fiid) });
- // break;
- // case 4: //火焰 每秒受到30%持续伤害,最高叠加10层,持续5秒
- // if (cfgEf.args["p"] && this.seedRand.rand(1, 10000) > cfgEf.args["p"] * 10000) {
- // continue;
- // }
- // if (cs["nextid"] == null || cs["i_59"] == null) {
- // let hit = cs[fiid] ? cs[fiid] : cs["hit"];
- // let csCpoy = gameMethod.objCopy(cs);
- // csCpoy["nextid"] = 1;
- // csCpoy["i_59"] = 0;
- // for (let index = 0; index < e_m; index++) {
- // this.timer_add({
- // iid: iid, //触发者
- // fiids: [fiid], //触发对象
- // key: ef_ttype, //定时器标识
- // type: [601], //执行触发点
- // func: "sk_effect", //执行的函数名
- // lzhen: 30, //轮询执行时间
- // ezhen: this.zhen + maxzhen,
- // skid: skid, //技能ID
- // aeid: effectId, //效果ID|行为ID
- // cs: csCpoy, //参数
- // overlayType: overlayType,
- // });
- // this.skbuff_add({
- // //添加buff 用于展示
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: {
- // i_59_hit: hit,
- // }, //属性
- // });
- // this.timer_do(505, { do_iid: Number(fiid) });
- // this.timer_do(508, { do_iid: Number(fiid) });
- // }
- // } else {
- // if (cs["do_iid"].toString() != iid) {
- // continue;
- // }
- // cs["i_59"] = this.skbuff_get(fiid, "i_59");
- // cs["hit"] = this.skbuff_get(fiid, "i_59_hit");
- // if (!cs["hit"]) {
- // if (cfgEf.args["a"] != null) {
- // this.js_hits(iid, fiid, 10000, skid); //计算伤害
- // let gzhit = this.oneHit[iid][fiid];
- // cs["hit"] = gzhit.skhit;
- // }
- // if (cs["hit"] == null) {
- // continue;
- // }
- // }
- // let hit = Math.floor(cs["hit"] * (e_a / 10000 + cs["i_59"]));
- // this.addOneAtk(fiid, fiid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(fiid, fiid, "effect", ["hp", -1 * hit]);
- // }
- // break;
- // case 5: //冰冻 无法移动、不能普攻攻击和释放技能,无法叠加,持续4秒。作用期间无法被施加寒意
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // this.timer_do(507, { do_iid: Number(fiid) });
- // this.timer_do(508, { do_iid: Number(fiid) });
- // break;
- // case 6: //击退 无法移动、不能普攻攻击、不能被攻击和释放技能,持续0.5秒
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // this.timer_do(508, { do_iid: Number(fiid) });
- // if (lsOne == 0) {
- // lsOne = 1;
- // this.timer_do(206, { do_iid: Number(iid) });
- // }
- // break;
- // case 7: //寒意 攻击降低5%,持续10秒,叠加至5层时转化为冰冻
- // let eff_i_5 = this.skbuff_get(fiid, "effect_i_5", 2);
- // if (eff_i_5 == 0) {
- // let eff_i_ep: { [key: string]: number } = Object.assign(cfgEf.args);
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: eff_i_ep, //属性
- // });
- // this.timer_do(506, { do_iid: Number(iid) });
- // }
- // let eff_i_7 = this.skbuff_get(fiid, ef_buff, 2);
- // if (eff_i_7 >= 5) {
- // this.skbuff_sub_all(fiid, ef_buff);
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, e_id, ef_ttype, cs);
- // }
- // break;
- // case 8: //真意 技能伤害增加3%,最高叠加10层,持续10秒
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: { sk_a: e_a }, //属性
- // });
- // this.timer_do(504, { do_iid: Number(iid) });
- // break;
- // case 9: //护体罡气 受到伤害时,优先抵消护体罡气(表现上需要加护盾特效)
- // let value9 = Math.floor((this.teams[fiid].eps["hp_max"] * cfgEf.args["hp_max"]) / 10000);
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_9: value9,
- // i_9_id: cfgEf.args["id"] ? cfgEf.args["id"] : 0,
- // i_9_skin: Number(skid),
- // }, //属性
- // });
- // this.timer_do(501, { do_iid: Number(iid) });
- // break;
- // case 10: //异常状态 包括:属性降低、流血、冰冻、击飞、沉默,眩晕
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // this.timer_do(508, { do_iid: Number(fiid) });
- // break;
- // case 12: //异常免疫 免疫属性降低、流血、冰冻、击飞、沉默,眩晕
- // if (maxzhen > 0) {
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // }
- // if (this.uuids[fiid] == null) {
- // continue;
- // }
- // if (gameMethod.isEmpty(this.uuids[fiid].skbuff) == true) {
- // continue;
- // }
- // // let keys2 = Object.keys(this.uuids[fiid].skbuff)
- // let keys2 = this.changeSkBuff(1, fiid, null, 1);
- // for (let k = 0; k < keys2.length; k++) {
- // let key = keys2[k];
- // if (gameMethod.isEmpty(this.uuids[fiid].skbuff[key])) {
- // continue;
- // }
- // if (["effect_i_10", "effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_6"].includes(key)) {
- // delete this.uuids[fiid].skbuff[key];
- // this.oneBuff[fiid] = 1;
- // continue;
- // }
- // //let copy10 = gameMethod.objCopy(this.uuids[fiid].skbuff[key]);
- // this.uuids[fiid].skbuff[key] = [];
- // let values = this.changeSkBuff(1, fiid, key, 2);
- // for (let j = 0; j < values.length; j++) {
- // let pass = false;
- // let keys3 = Object.keys(values[j].eps);
- // for (let l = 0; l < keys3.length; l++) {
- // if (this.teams[iid].eps[keys3[l]] == null) {
- // continue;
- // }
- // if (values[j].eps[keys3[l]] < 0) {
- // pass = true;
- // this.oneBuff[fiid] = 1;
- // break;
- // }
- // }
- // if (pass == false) {
- // this.uuids[fiid].skbuff[key].push(values[j]);
- // }
- // }
- // }
- // // 更新缓存
- // this.changeSkBuff(2, fiid, null, 1, this.uuids[fiid].skbuff);
- // break;
- // case 13: //最终伤害降低xx%
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_13: e_a,
- // i_13_cd: 0, // 持续性的 不加cd
- // i_13_nZhen: this.zhen,
- // }, //属性
- // });
- // break;
- // case 14: //当前生命首次低于x%, xx属性增加x%
- // let f_hp14 = this.skbuff_get(fiid, "hp");
- // let f_hp_max14 = this.skbuff_get(fiid, "hp_max");
- // if ((f_hp14 * 10000) / f_hp_max14 < Math.abs(cfgEf.args["hp"])) {
- // let eff_i_ep: { [key: string]: number } = {};
- // let keys = Object.keys(cfgEf.args);
- // for (let k = 0; k < keys.length; k++) {
- // if (keys[k] == "hp") {
- // continue;
- // }
- // if (this.teams[fiid].eps[keys[k]] == null) {
- // continue;
- // }
- // eff_i_ep[keys[k]] = cfgEf.args[keys[k]];
- // }
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: eff_i_ep, //属性
- // });
- // this.timer_sub(iid, ef_ttype);
- // }
- // break;
- // case 15: //触发暴击后,给自身加效果
- // cs["nextid"] = 1;
- // let id1 = cfgEf.args["id1"];
- // if (id1 > 0) {
- // this.sk_effect(iid, skid, id1, ef_ttype, cs);
- // }
- // this.sk_effect(iid, skid, e_id, ef_ttype, cs);
- // break;
- // case 16: //自身首次生命低于15%时进入入定状态,之后每秒恢复自身攻击200%的气血,期间自身无法行动。自身气血恢复至60%时解除入定状态,并对周围敌人造成200%技能伤害
- // if (cs["do_iid"].toString() != iid) {
- // continue;
- // }
- // let f_hp16 = this.skbuff_get(fiid, "hp");
- // let f_hp_max16 = this.skbuff_get(fiid, "hp_max");
- // if ((f_hp16 * 10000) / f_hp_max16 < Math.abs(cfgEf.args["hp"])) {
- // if (cs["nextid"] != 1) {
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // cs["nextid"] = 1;
- // this.timer_add({
- // iid: iid, //触发者
- // fiids: fiids, //触发对象
- // key: ef_ttype, //定时器标识
- // type: [601], //执行触发点
- // func: "sk_effect", //执行的函数名
- // lzhen: 30, //轮询执行时间
- // ezhen: this.zhen + maxzhen,
- // skid: skid, //技能ID
- // aeid: effectId, //效果ID|行为ID
- // cs: cs, //参数
- // overlayType: overlayType,
- // });
- // }
- // }
- // if (cs["nextid"] == 1) {
- // let f_atk: number = this.skbuff_get(iid, "atk");
- // let addHp16: number = Math.floor((f_atk * cfgEf.args["atk_per"]) / 10000);
- // let addHpMax16: number = Math.floor((f_hp_max16 * Math.abs(cfgEf.args["hp2"])) / 10000);
- // addHp16 = Math.min(addHp16, addHpMax16 - f_hp16);
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, iid, "effect", ["hp", addHp16]);
- // f_hp16 = this.skbuff_get(fiid, "hp");
- // if ((f_hp16 * 10000) / f_hp_max16 >= Math.abs(cfgEf.args["hp2"])) {
- // this.skbuff_sub(fiid, ef_buff);
- // this.timer_sub(iid, ef_ttype);
- // cs["nextid"] = 1;
- // this.sk_effect(fiid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // }
- // break;
- // case 17: //记录自身处于某种状态buff,被攻击有概率给自身加效果
- // let eff_i_buff: number = 0;
- // if (cfgEf.args["buff"] != 10) {
- // // 10需要判断各种异常状态
- // eff_i_buff = this.skbuff_get(iid, "effect_i_" + cfgEf.args["buff"], 2);
- // } else {
- // let list: string[] = ["effect_i_1", "effect_i_3", "effect_i_6", "effect_i_4", "effect_i_5"];
- // for (let k = 0; k < list.length; k++) {
- // eff_i_buff += this.skbuff_get(fiid, list[k], 2);
- // }
- // }
- // if (eff_i_buff > 0) {
- // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // } else {
- // pass = false; // 没触发 不要进入冷却时间
- // continue;
- // }
- // break;
- // case 18: //每3次攻击消耗一层真意,之后额外造成目标当前气血3%的伤害(最多造成自身攻击500%的伤害)
- // //备注:这里的攻击包括普攻和技能和连击,不包括反击,被动技能是不计算次数的
- // if (cs["do_iid"].toString() != iid) {
- // continue;
- // }
- // let bdcons18 = this.uuids[fiid].cons[0] + this.uuids[fiid].cons[1];
- // if (bdcons18 >= cfgEf.args["count"] && bdcons18 % cfgEf.args["count"] == 0) {
- // this.skbuff_sub(iid, "effect_i_" + cfgEf.args["buff"]);
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // break;
- // case 19: //普攻施加快剑印记,持续7秒,最多叠加10层。目标每层快剑印记,使自身攻击附加30%额外伤害。若7秒内目标未受到自身伤害,则快剑印记全部消失
- // let cfgEf19 = Gamecfg.skillEffect.getItem(cfgEf.args["id"]);
- // if (cfgEf19 != null) {
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: {
- // //属性
- // i_19_a: cfgEf.args["a"] * 10000,
- // i_19_i: cfgEf19.args["i"],
- // },
- // });
- // let ceng19 = this.skbuff_get(fiid, "effect_i_" + cfgEf19.args["i"], 2);
- // let cfgEf19_m = Math.min(cfgEf19.args["m"], cfgEf19.args["n"] - ceng19);
- // if (cfgEf19_m > 0) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // //let keys = Object.keys(this.uuids[fiid].skbuff["effect_i_" + cfgEf19.args["i"]]);
- // let keys = this.changeSkBuff(1, fiid, "effect_i_" + cfgEf19.args["i"], 1);
- // for (let k = 0; k < keys.length; k++) {
- // this.uuids[fiid].skbuff["effect_i_" + cfgEf19.args["i"]][Number(keys[k])].szhen = this.zhen;
- // this.uuids[fiid].skbuff["effect_i_" + cfgEf19.args["i"]][Number(keys[k])].ezhen = this.zhen + maxzhen;
- // }
- // this.changeSkBuff(2, fiid, "effect_i_" + cfgEf19.args["i"], 1, this.uuids[fiid].skbuff["effect_i_" + cfgEf19.args["i"]]);
- // }
- // break;
- // case 20: //每x秒清除自身异常状态
- // if (cs["do_iid"].toString() != iid) {
- // continue;
- // }
- // this.skbuff_sub(fiid, "effect_i_" + cfgEf.args["buff"]);
- // if (cfgEf.args["buff"] == 10) {
- // // let keys = Object.keys(this.uuids[fiid].skbuff)
- // let keys = this.changeSkBuff(1, fiid, null, 1);
- // for (let k = 0; k < keys.length; k++) {
- // let key = keys[k];
- // if (gameMethod.isEmpty(this.uuids[fiid].skbuff[key]) == true) {
- // continue;
- // }
- // if (["effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_6"].includes(key)) {
- // delete this.uuids[fiid].skbuff[key];
- // this.oneBuff[fiid] = 1;
- // continue;
- // }
- // if (!key.includes("effect_i_0")) {
- // continue;
- // }
- // //let copy10 = gameMethod.objCopy(this.uuids[fiid].skbuff[key]);
- // this.uuids[fiid].skbuff[key] = [];
- // //let values = Object.values(copy10);
- // let values = this.changeSkBuff(1, fiid, key, 2);
- // for (let j = 0; j < values.length; j++) {
- // let pass = false;
- // let keys3 = Object.keys(values[j].eps);
- // for (let l = 0; l < keys3.length; l++) {
- // if (this.teams[iid].eps[keys3[l]] == null) {
- // continue;
- // }
- // if (values[j].eps[keys3[l]] < 0) {
- // pass = true;
- // this.oneBuff[fiid] = 1;
- // break;
- // }
- // }
- // if (pass == false) {
- // this.uuids[fiid].skbuff[key].push(values[j]);
- // }
- // }
- // }
- // this.changeSkBuff(2, fiid, null, 1, this.uuids[fiid].skbuff);
- // }
- // break;
- // case 21: //自身持有护体罡气时,执向一个effectID的效果
- // //这边只管触发 外层有脚本在跑
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, e_id, ef_ttype, cs);
- // let cfgEf21 = Gamecfg.skillEffect.getItem(e_id);
- // if (cfgEf21 != null) {
- // if (cfgEf21.type == 1) {
- // this.uuids[iid].podun.push("effect_i_0_" + e_id);
- // } else {
- // this.uuids[iid].podun.push("effect_i_" + cfgEf21.args["i"]);
- // }
- // }
- // break;
- // case 22: //血量低于X%时给自身添加buff
- // if (iid.length != fiid.length && this.oneHit[iid]) {
- // // 获取攻击对象
- // let hitiid: string = "";
- // let keys = Object.keys(this.oneHit[iid]);
- // for (let k = 0; k < keys.length; k++) {
- // hitiid = keys[k];
- // let hp_max22 = this.skbuff_get(hitiid, "hp_max");
- // let newHp22 = this.skbuff_get(hitiid, "hp");
- // if (this.uuids[iid].skbase[skid].effect[effectId].f == 0 && (newHp22 * 10000) / hp_max22 <= Math.abs(cfgEf.args["hp"])) {
- // let keys = Object.keys(cfgEf.args);
- // for (let i = 0; i < keys.length; i++) {
- // let key = keys[i];
- // if (!key.includes("id")) {
- // continue;
- // }
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args[key], ef_ttype, cs);
- // }
- // if (cfgEf.args["if"] == 1) {
- // this.uuids[iid].skbase[skid].effect[effectId].f = 1;
- // this.timer_sub(fiid, ef_ttype);
- // }
- // return;
- // }
- // }
- // } else {
- // let hp_max22 = this.skbuff_get(fiid, "hp_max");
- // let newHp22 = this.skbuff_get(fiid, "hp");
- // if (this.uuids[iid].skbase[skid].effect[effectId].f == 0 && (newHp22 * 10000) / hp_max22 <= Math.abs(cfgEf.args["hp"])) {
- // let keys = Object.keys(cfgEf.args);
- // for (let k = 0; k < keys.length; k++) {
- // if (!keys[k].includes("id")) {
- // continue;
- // }
- // cs["nextid"] = 1;
- // this.sk_effect(fiid, skid, cfgEf.args[keys[k]], ef_ttype, cs);
- // }
- // if (cfgEf.args["if"] == 1) {
- // this.uuids[iid].skbase[skid].effect[effectId].f = 1;
- // this.timer_sub(fiid, ef_ttype);
- // }
- // return;
- // } else {
- // pass = false;
- // }
- // }
- // break;
- // case 23: //记录快剑印记状态
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // break;
- // case 24: //必定暴击
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // break;
- // case 25: //灵力值获取
- // if (gameMethod.isEmpty(cfgEf.args["lingli"]) == false) {
- // this.add_mp(fiid, cfgEf.args["lingli"], 2);
- // }
- // if (gameMethod.isEmpty(cfgEf.args["lingli2"]) == false) {
- // this.add_mp(fiid, 10000 * cfgEf.args["lingli2"], 2);
- // }
- // break;
- // case 26: //每x次攻击,会使下一次攻击的目标增加buff(备注:攻击包括连击,不包括反击)
- // if (cs["do_iid"].toString() != iid) {
- // continue;
- // }
- // let bdcons26 = this.uuids[fiid].cons[0] + this.uuids[fiid].cons[1];
- // cs["limit"] = cs["limit"] == null ? cfgEf.args["count"] : cs["limit"];
- // let yu26 = 1;
- // if (cfgEf.args["if"] == 1) {
- // yu26 = 0;
- // }
- // if (bdcons26 >= cs["limit"] && bdcons26 % cfgEf.args["count"] == yu26) {
- // cs["limit"] += 1; //下一次才能在触发
- // let keys = Object.keys(cfgEf.args);
- // for (let k = 0; k < keys.length; k++) {
- // if (!keys[k].includes("id")) {
- // continue;
- // }
- // cs["nextid"] = 1;
- // this.sk_effect(fiid, skid, cfgEf.args[keys[k]], ef_ttype, cs);
- // this.uuids[iid].timer[ef_ttype][cs["timerId"].toString()].cs = cs;
- // }
- // } else {
- // continue;
- // }
- // break;
- // case 27: //记录目标某种状态,然后施加一个buff效果
- // if (!this.oneFiids[iid][ef_ttype]) {
- // continue;
- // }
- // if (this.oneFiids[iid][ef_ttype][0] === fiid) {
- // let eff_i_buff27 = 0;
- // if (cfgEf.args["if"] == 1) {
- // if (!this.oneHit[iid]) {
- // continue;
- // }
- // // 有配置的效果是加自身的 iid和fiid是一样的 要找攻击的目标
- // let keys = Object.keys(this.oneHit[iid]);
- // for (let k = 0; k < keys.length; k++) {
- // if (cfgEf.args["buff"] != 10) {
- // // 10需要判断各种异常状态
- // eff_i_buff27 = this.skbuff_get(keys[k], "effect_i_" + cfgEf.args["buff"], 2);
- // } else {
- // let list: string[] = ["effect_i_1", "effect_i_3", "effect_i_6", "effect_i_4", "effect_i_5"];
- // for (let j = 0; j < list.length; j++) {
- // eff_i_buff27 += this.skbuff_get(keys[k], list[j], 2);
- // }
- // }
- // }
- // } else {
- // if (cfgEf.args["buff"] != 10) {
- // // 10需要判断各种异常状态
- // eff_i_buff27 = this.skbuff_get(fiid, "effect_i_" + cfgEf.args["buff"], 2);
- // } else {
- // let list: string[] = ["effect_i_1", "effect_i_3", "effect_i_6", "effect_i_4", "effect_i_5"];
- // for (let j = 0; j < list.length; j++) {
- // eff_i_buff27 += this.skbuff_get(fiid, list[j], 2);
- // }
- // }
- // }
- // if (eff_i_buff27 > 0) {
- // cs["nextid"] = 1;
- // cs["i_59"] = 0; // todo 增伤用火焰增伤 可能有问题
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // if (cfgEf.args["id1"]) {
- // this.sk_effect(iid, skid, cfgEf.args["id1"], ef_ttype, cs);
- // }
- // } else {
- // pass = false; // 没有触发 不要加cd
- // }
- // } else {
- // pass = false; // 没有触发 不要加cd
- // }
- // break;
- // case 28: //对某种属性低于自己的敌人造成额外xx%伤害
- // let i_ep = this.skbuff_get(iid, cfgEf.args["ep"]);
- // let f_ep = this.skbuff_get(fiid, cfgEf.args["ep"]);
- // if (i_ep > f_ep) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // break;
- // case 29: //自身或者敌方死亡后,获的某种状态
- // let f_ep29 = this.skbuff_get(fiid, "hp");
- // if (f_ep29 <= 0) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // break;
- // case 30: //伤害加深
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: { a: cfgEf.args["a"] * 10000 }, //属性
- // });
- // break;
- // case 31: //按自身xx%攻击力进行治疗
- // // 是否有增强治疗效果 addOneAtk里面有处理了
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // let i_atk: number = this.skbuff_get(fiid, "atk");
- // let addHp31: number = Math.floor((i_atk * cfgEf.args["atk_per"]) / 10000);
- // this.addOneAtk(iid, fiid, "effect", ["hp", addHp31]);
- // break;
- // case 32: //技能每命中X个单位,给自身获取某种BUFF
- // if (cs["do_iid"].toString() != iid) {
- // continue;
- // }
- // let len = this.oneFiids[iid][ef_ttype].length;
- // if (this.oneFiids[iid][ef_ttype][len - 1] == fiid) {
- // // 最后一个攻击对象结算命中
- // let bdcons32 = this.oneFiids[iid][ef_ttype].length;
- // if (bdcons32 >= cfgEf.args["count"] && bdcons32 % cfgEf.args["count"] == 0) {
- // for (let i = 0; i < Math.floor(bdcons32 / cfgEf.args["count"]); i++) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // }
- // } else {
- // continue;
- // }
- // break;
- // case 33: //触发暴击后,附加额外x%伤害
- // // 由于isBj是按skid来的 上一个技能的暴击 这里获取不到 所以需要遍历一下
- // if (cs["isBj"] == null && this.oneAtk[iid][fiid]) {
- // for (let k = 0; k < this.oneAtk[iid][fiid].effect.length; k++) {
- // if (this.oneAtk[iid][fiid].effect[k][0] === "baoji") {
- // cs["isBj"] = this.oneAtk[iid][fiid].effect[k][1];
- // break;
- // }
- // }
- // }
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: { i_33_a: cfgEf.args["a"] * 10000 }, //属性
- // });
- // if (cs["isBj"] != null) {
- // // 暴击并且拥有易伤状态
- // let a = this.skbuff_get(fiid, "i_33_a");
- // let subHp33: number = Math.floor(Math.abs(cs["isBj"] * (a / 10000)));
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, fiid, "effect", ["hp", -subHp33]);
- // this.skbuff_sub_all(fiid, ef_buff);
- // }
- // break;
- // case 34: //敌方生命低于x%,给自身指定某种状态(首次低于) 血量变化检测
- // if (cs["do_iid"].toString() != fiid) {
- // pass = false;
- // continue; //自己降低的不触发
- // }
- // let chaHp34: number = Math.abs(cfgEf.args["hp"]);
- // let f_hp34 = this.skbuff_get(fiid, "hp");
- // let f_hp_max34 = this.skbuff_get(fiid, "hp_max");
- // if ((f_hp34 * 10000) / f_hp_max34 < chaHp34) {
- // cs[fiid] = this.zhen;
- // let ef_ttype_1 = "effect_id_" + cfgEf.args["id"].toString();
- // if (this.oneFiids[iid] == null) {
- // this.oneFiids[iid] = {};
- // }
- // this.oneFiids[iid][ef_ttype_1] = [fiid];
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), "", cs);
- // } else {
- // pass = false;
- // continue;
- // }
- // break;
- // case 35: //攻击时,对血量低于30%的敌人施加一层寒意
- // if (cs["do_iid"].toString() != iid) {
- // continue;
- // }
- // let chaHp35: number = Math.abs(cfgEf.args["hp"]);
- // let f_hp35 = this.skbuff_get(fiid, "hp");
- // let f_hp_max35 = this.skbuff_get(fiid, "hp_max");
- // if ((f_hp35 * 10000) / f_hp_max35 < chaHp35) {
- // // 再下去 找不到加伤害的fiid了
- // if (cfgEf.args["id"]) {
- // let cfgEf2 = Gamecfg.skillEffect.getItem(cfgEf.args["id"]);
- // if (cfgEf2 && cfgEf2.args && cfgEf2.args["i"] == 53) {
- // let i_53_atk = this.skbuff_get(iid, "atk");
- // for (let k = 0; k < this.oneAtk[iid][fiid].effect.length; k++) {
- // if (this.oneAtk[iid][fiid].effect[k][0] === "hp" && this.oneAtk[iid][fiid].effect[k][1] < 0) {
- // this.oneAtk[iid][fiid].effect[k][1] = -Math.floor((i_53_atk * cfgEf2.args["atk"]) / 10000);
- // break;
- // }
- // }
- // } else {
- // cs["nextid"] = 1;
- // cs["fiid"] = Number(fiid); // 做个标识
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // }
- // }
- // }
- // break;
- // case 36: //自身第一次重伤(死亡)时,恢复一半气血
- // if (cs["do_iid"].toString() != iid) {
- // continue; //不是自己
- // }
- // let chaHp36: number = Math.abs(cfgEf.args["hp"]);
- // let f_hp_max36 = this.skbuff_get(fiid, "hp_max");
- // let subHp36: number = Math.floor(chaHp36 * f_hp_max36);
- // this.uuids[fiid].dzhen = 0;
- // this.uuids[fiid].skbuff = {};
- // this.timer_sub_by_fiid(fiid);
- // this.oneBuff[fiid] = 1;
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: 1350, //结束帧
- // overlayType: 2, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: {
- // i_36: subHp36,
- // i_36_nZhen: this.zhen + 30,
- // }, //属性
- // });
- // //this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // //this.addOneAtk(iid, fiid, "effect", ["hp", subHp36]);
- // break;
- // case 37: //己方任何一个单位护体罡气破碎时,然后指定一个BUFF效果,比如击退敌人
- // if (cs["do_iid"].toString().length != fiid.length) {
- // continue;
- // }
- // cs["nextid"] = 1;
- // this.sk_effect(fiid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // break;
- // case 38: //触发连击时,给自身增加效果
- // if (cs["do_iid"].toString() != iid) {
- // continue;
- // }
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // break;
- // case 39: //己方单位施加击退时,使其获得50%气血值护体罡气,并提高其5%普攻伤害,持续至战斗结束,最多叠加20层,冷却12秒
- // if (cs["do_iid"].toString() != fiid) {
- // continue;
- // }
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: { i_39_a: cfgEf.args["a"] * 10000 }, //属性
- // });
- // //加护体罡气
- // let value39 = Math.floor((this.teams[fiid].eps["hp"] * cfgEf.args["hp"]) / 10000);
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: "effect_i_9", //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: { i_9: value39 }, //属性
- // });
- // break;
- // case 40: //自身气血高于xx%时,有概率给自身增加效果
- // let f_hp40 = this.skbuff_get(fiid, "hp");
- // let f_hp_max40 = this.skbuff_get(fiid, "hp_max");
- // if ((f_hp40 * 10000) / f_hp_max40 > Math.abs(cfgEf.args["hp"])) {
- // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // }
- // } else {
- // continue;
- // }
- // break;
- // case 41: //回血,取自身生命值上限x%进行回血,
- // if (cs["next_cx"] != null && cs["next_cx"] < this.zhen) {
- // let f_hp_max41 = this.skbuff_get(fiid, "hp_max");
- // let chaHp41: number = Math.abs(cfgEf.args["hp"]);
- // let addHp: number = Math.floor(f_hp_max41 * chaHp41);
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, fiid, "effect", ["hp", addHp]);
- // } else {
- // cs["next_cx"] = this.zhen;
- // this.timer_add({
- // iid: iid, //触发者
- // fiids: [fiid], //触发对象
- // key: ef_ttype + "_" + e_i, //定时器标识
- // type: [601], //执行触发点
- // func: "sk_effect", //执行的函数名
- // lzhen: 30, //轮询执行时间
- // ezhen: this.zhen + maxzhen,
- // skid: skid, //技能ID
- // aeid: effectId, //效果ID|行为ID
- // cs: cs, //参数
- // overlayType: overlayType,
- // });
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: {}, //属性
- // });
- // delete cs["next_cx"];
- // }
- // break;
- // case 42: //自身气血每降低xxxx%,造成伤害提升5%
- // let f_hp42: number = this.skbuff_get(fiid, "hp");
- // f_hp42 = Math.max(0, f_hp42);
- // let f_hp_max42 = this.skbuff_get(fiid, "hp_max");
- // let hpRate: number = Math.abs(cfgEf.args["hp"] * 100);
- // let newRate: number = Math.ceil((f_hp42 * 100) / f_hp_max42);
- // for (let index = 100 - hpRate; index >= newRate; index -= hpRate) {
- // if (cs[index.toString()] != null) {
- // continue;
- // }
- // cs[index.toString()] = 1;
- // this.timer_add({
- // iid: iid, //触发者
- // fiids: [fiid], //触发对象
- // key: ef_ttype, //定时器标识
- // type: [401], //执行触发点
- // func: "sk_effect", //执行的函数名
- // lzhen: 30, //轮询执行时间
- // ezhen: this.zhen + maxzhen,
- // skid: skid, //技能ID
- // aeid: effectId, //效果ID|行为ID
- // cs: cs, //参数
- // overlayType: overlayType,
- // });
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // }
- // break;
- // case 43: //自身气血高于60%时,普通攻击有40%概率沉默目标
- // let chaHp43: number = Math.abs(cfgEf.args["hp"]);
- // let f_hp43 = this.skbuff_get(fiid, "hp");
- // let f_hp_max43 = this.skbuff_get(fiid, "hp_max");
- // if ((f_hp43 * 10000) / f_hp_max43 > chaHp43) {
- // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // }
- // } else {
- // continue;
- // }
- // break;
- // case 44: //护盾消失时,直接造成自身周围全体目标120%技能伤害
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // break;
- // case 45: //自身受到超过当前气血10%以上伤害时,获的某种效果
- // let f_hp46 = this.skbuff_get(fiid, "hp");
- // let f_hp46_old = this.teams[fiid].eps.hp;
- // let f_hp_max46 = this.skbuff_get(fiid, "hp_max");
- // if ((f_hp46 - f_hp46_old) / f_hp_max46 > cfgEf.args["hp"]) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // } else {
- // continue;
- // }
- // break;
- // case 46: //牺牲自己xxx%当前气血,对目标造成xxx%伤害
- // let i_hp = this.skbuff_get(iid, "hp");
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, iid, "effect", ["hp", -1 * Math.floor(i_hp * cfgEf.args["hp"])]);
- // for (let k = 0; k < this.oneFiids[iid][ef_ttype].length; k++) {
- // this.js_hits(iid, this.oneFiids[iid][ef_ttype][k], cfgEf.args["a"] * 10000, skid); //计算伤害
- // let gzhit = this.oneHit[iid][this.oneFiids[iid][ef_ttype][k]];
- // this.addOneAtk(iid, this.oneFiids[iid][ef_ttype][k], "effect", ["hp", -1 * Math.floor(gzhit.skhit)]);
- // }
- // break;
- // case 47: //给BOSS挂了某种BUFF,BOSS就免疫这个效果。
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: cfgEf.args, //属性
- // });
- // break;
- // case 48: //BOSS抵抗真意/火焰的时间减少
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + 45 * 30, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: cfgEf.args, //属性
- // });
- // break;
- // case 51: //回血
- // if (cfgEf.args["if"] == 1) {
- // if (cs["nextid"] == null) {
- // cs["nextid"] = 1;
- // this.timer_add({
- // iid: iid, //触发者
- // fiids: fiids, //触发对象
- // key: ef_ttype, //定时器标识
- // type: cfgEf.triggerTime ? cfgEf.triggerTime : [601], //执行触发点
- // func: "sk_effect", //执行的函数名
- // lzhen: 30, //轮询执行时间
- // ezhen: this.zhen + maxzhen,
- // skid: skid, //技能ID
- // aeid: effectId, //效果ID|行为ID
- // cs: cs, //参数
- // overlayType: overlayType,
- // });
- // return;
- // } else {
- // this.timer_sub(iid, ef_ttype);
- // }
- // } else if (cfgEf.args["if"] == 2) {
- // if (cs["nextid"] == null) {
- // cs["nextid"] = 1;
- // this.timer_add({
- // iid: iid, //触发者
- // fiids: fiids, //触发对象
- // key: ef_ttype, //定时器标识
- // type: cfgEf.triggerTime ? cfgEf.triggerTime : [601], //执行触发点
- // func: "sk_effect", //执行的函数名
- // lzhen: cfgEf.interval * 30, //轮询执行时间
- // ezhen: this.zhen + maxzhen,
- // skid: skid, //技能ID
- // aeid: effectId, //效果ID|行为ID
- // cs: cs, //参数
- // overlayType: overlayType,
- // });
- // } else {
- // // 定时后加血
- // let i_51_atk = this.skbuff_get(iid, "atk");
- // let i_51_hp = Math.floor((cfgEf.args["atk_per"] * i_51_atk) / 10000);
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, fiid, "effect", ["hp", i_51_hp]);
- // }
- // return;
- // }
- // // cs["nextid"] = 1
- // if (cfgEf.args["id"] != null) {
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // let i_51_atk = this.skbuff_get(iid, "atk");
- // let i_51_hp = Math.floor((cfgEf.args["atk_per"] * i_51_atk) / 10000);
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, fiid, "effect", ["hp", i_51_hp]);
- // // 有附加id
- // break;
- // case 52: //强制对有寒意状态目标转化为冰冻,每层寒意冰冻x秒(转化完成后,需要清空目标寒意状态)
- // let hitiids = Object.keys(this.oneHit[iid]);
- // for (let k = 0; k < hitiids.length; k++) {
- // let hitiid = hitiids[k];
- // let f_eff_i_7 = this.skbuff_get(hitiid, "effect_i_7", 2);
- // if (f_eff_i_7 == 0) {
- // continue;
- // }
- // let maxZhen = Math.floor(this.zhen + f_eff_i_7 * cfgEf.args["t"] * 30);
- // this.skbuff_add({
- // fiid: hitiid, //添加对象
- // key: "effect_i_5", //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: maxZhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {}, //属性
- // });
- // this.skbuff_sub_all(hitiid, "effect_i_7");
- // }
- // break;
- // case 53: //伤害加深(计算攻击力倍数) 这里的伤害相当于是直接用攻击力的倍数作为伤害值
- // // 本次攻击加成的 下一帧不能再加伤害要本次加!!!
- // if (!this.oneAtk[fiid]) {
- // return;
- // }
- // let i_53_atk = this.skbuff_get(iid, "atk");
- // let hitiids2 = Object.keys(this.oneHit[iid]);
- // for (let k = 0; k < hitiids2.length; k++) {
- // for (let j = 0; j < this.oneAtk[fiid][hitiids2[k]].effect.length; j++) {
- // if (this.oneAtk[fiid][hitiids2[k]].effect[j][0] === "hp" && this.oneAtk[fiid][hitiids2[k]].effect[j][1] < 0) {
- // this.oneAtk[fiid][hitiids2[k]].effect[j][1] = -Math.floor((i_53_atk * cfgEf.args["atk"]) / 10000);
- // break;
- // }
- // }
- // }
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + 1, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_53: Math.floor((i_53_atk * cfgEf.args["atk"]) / 10000),
- // },
- // });
- // break;
- // case 54: //直接对有真意状态的目标进行引爆,每层真意额外造成xx%伤害
- // let hits = Object.keys(this.oneHit[iid]);
- // let i_atk54 = this.skbuff_get(iid, "atk");
- // for (let k = 0; k < hits.length; k++) {
- // let eff_i_8_54 = this.skbuff_get(hits[k], "effect_i_8", 2);
- // let hit54 = Math.floor(i_atk54 * cfgEf.args["a"] * eff_i_8_54);
- // if (hit54 > 0) {
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, hits[k], "effect", ["hp", -1 * hit54]);
- // this.skbuff_sub_all(hits[k], "effect_i_8");
- // }
- // }
- // break;
- // case 56: //引爆我方所有真意,每层真意额外造成20%的伤害
- // let eff_i_4_56 = 0;
- // // 清除我方所有真意
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let uid = this.teamFiids[index];
- // if (iid.length != uid.length) {
- // continue;
- // }
- // let count = this.skbuff_get(uid, "effect_i_8", 2);
- // if (count > 0) {
- // eff_i_4_56 += count;
- // this.skbuff_sub_all(uid, "effect_i_8");
- // }
- // }
- // if (eff_i_4_56 > 0) {
- // let hits = Object.keys(this.oneHit[iid]);
- // let i_atk56 = this.skbuff_get(iid, "atk");
- // for (let k = 0; k < hits.length; k++) {
- // let hit56 = Math.floor(i_atk56 * cfgEf.args["a"] * eff_i_4_56);
- // if (hit56 > 0) {
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, hits[k], "effect", ["hp", -1 * hit56]);
- // }
- // }
- // } else {
- // continue;
- // }
- // break;
- // case 57: //清除我方所有火焰状态,每层火焰额外造成x%的伤害
- // let eff_i_4_57 = 0;
- // // 清除我方火焰
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let uid = this.teamFiids[index];
- // if (iid.length != uid.length) {
- // continue;
- // }
- // let count = this.skbuff_get(uid, "effect_i_4", 2);
- // if (count > 0) {
- // eff_i_4_57 += count;
- // this.skbuff_sub_all(uid, "effect_i_4");
- // }
- // }
- // if (eff_i_4_57 > 0) {
- // let hits = Object.keys(this.oneHit[iid]);
- // let i_atk57 = this.skbuff_get(iid, "atk");
- // for (let k = 0; k < hits.length; k++) {
- // let hit57 = Math.floor(i_atk57 * cfgEf.args["a"] * eff_i_4_57);
- // if (hit57 > 0) {
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, hits[k], "effect", ["hp", -1 * hit57]);
- // }
- // }
- // } else {
- // continue;
- // }
- // break;
- // case 58: //回血(按已损失生命的%去计算回血值)
- // if (cfgEf.args["if"] == 1) {
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_58: cfgEf.args["hp"],
- // i_58_cd: cfgEf.cd,
- // i_58_nZhen: this.zhen,
- // },
- // });
- // } else {
- // let fpk = this.uuids[iid]?.fpk;
- // let f_hp58 = this.skbuff_get(fiid, "hp");
- // let f_hp_max58 = this.skbuff_get(fiid, "hp_max");
- // let addHp58: number = Math.floor(((f_hp_max58 - f_hp58) * cfgEf.args["hp"]) / 10000);
- // if (fpk && cfgEf.triggerTime == null) {
- // this.addOneAtk(fpk, fpk, "aType", Xys.ActionType.effect);
- // this.addOneAtk(fpk, fiid, "effect", ["hp", addHp58]);
- // } else {
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, fiid, "effect", ["hp", addHp58]);
- // }
- // }
- // break;
- // case 59: //有概率将火焰每秒持续伤害增加xx%
- // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
- // let effect_i_4 = this.skbuff_get(fiid, "effect_i_4", 2);
- // if (effect_i_4 > 0) {
- // let i_59 = this.skbuff_get(fiid, "i_59");
- // //this.skbuff_update(fiid, { i_59: i_59 + cfgEf.args["a"] });
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_59: cfgEf.args["a"],
- // },
- // });
- // } else {
- // pass = false;
- // }
- // } else {
- // pass = false;
- // }
- // break;
- // case 60: //移除对手等量的属性值
- // let eff_i_ep: { [key: string]: number } = {};
- // let keys60 = Object.keys(cfgEf.args);
- // for (let k = 0; k < keys60.length; k++) {
- // if (this.teams[fiid].eps[keys60[k]] == null) {
- // continue;
- // }
- // eff_i_ep[keys60[k]] = -1 * Math.abs(cfgEf.args[keys60[k]]);
- // }
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: eff_i_ep,
- // });
- // break;
- // case 61: //护体罡气的承伤减少/增加xxx%
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_61: cfgEf.args["hp_max"],
- // },
- // });
- // break;
- // case 62: //目标治疗效果降低/增加,持续X秒
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_62: cfgEf.args["hp"],
- // },
- // });
- // break;
- // case 63: //主角阵亡后,弟子会复活主角并恢复19.56%生命,每场战斗生效1次(秘法和法器的复活只能生效1个)
- // if (cs["do_iid"] % 100 != 0) {
- // continue;
- // }
- // let f_hp_max63 = this.skbuff_get(fiid, "hp_max");
- // let addHp62: number = Math.floor((f_hp_max63 * cfgEf.args["hp"]) / 10000);
- // this.skbuff_add({
- // fiid: cs["do_iid"].toString(), //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_63_hp: addHp62,
- // i_63_nZhen: this.zhen,
- // i_63_cd: 0,
- // },
- // });
- // break;
- // case 64: //弟子首次攻击伤害额外提升x%
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_64_a: cfgEf.args["a"] * 10000,
- // i_64_cd: cfgEf.cd ? cfgEf.cd : 0,
- // i_64_nZhen: this.zhen,
- // },
- // });
- // break;
- // case 65: //附加被攻击目标的当前生命值X%伤害,最高伤害不超过攻击力x%
- // let f_atk: number = this.skbuff_get(iid, "atk");
- // let keys65 = Object.keys(this.oneAtk[iid]);
- // for (let k = 0; k < keys65.length; k++) {
- // if (iid.length != keys65[k].length) {
- // let add_65: number = 0;
- // let f_hp = this.skbuff_get(keys65[k], "hp_max");
- // add_65 = (cfgEf.args["hp"] * f_hp) / 10000;
- // add_65 = Math.min(add_65, (cfgEf.args["max_atk"] * f_atk) / 10000);
- // add_65 = Math.max(0, Math.floor(add_65));
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, keys65[k], "effect", ["hp", -1 * add_65]);
- // }
- // }
- // break;
- // case 66: //随机一个弟子 偷取目标主角x%的攻击力,每层最高不超过x%自身攻击力 与 79配合使用
- // if (cfgEf.args["id"] != null) {
- // this.sk_effect(fiid, skid, cfgEf.args["id"].toString(), "", cs);
- // }
- // break;
- // case 79: //偷取目标x%的攻击力,每层最高不超过x%自身攻击力
- // let keys: { [key: string]: string } = { atk_per: "atk", def_per: "def", hp_max_per: "hp_max", hp_per: "hp" };
- // let eps_66: { [key: string]: number } = {};
- // let feps_66: { [key: string]: number } = {};
- // let keys79 = Object.keys(cfgEf.args);
- // for (let k = 0; k < keys79.length; k++) {
- // if (this.teams[iid].eps[keys79[k]] == null) {
- // continue;
- // }
- // let i_key = this.skbuff_get(iid, keys[keys79[k]] ? keys[keys79[k]] : keys79[k]);
- // let f_key = this.skbuff_get(fiid, keys[keys79[k]] ? keys[keys79[k]] : keys79[k]);
- // let f_val = Math.floor((f_key * cfgEf.args[keys79[k]]) / 10000);
- // let max_val = Math.floor((i_key * cfgEf.args["max_atk"]) / 10000);
- // let i_f_val = keys79[k] == "atk_per" ? Math.min(f_val, max_val) : f_val; // 这个值是攻击力
- // if (keys79[k] == "atk_per") {
- // // atk_per 算的是攻击力 直接加在atk上面
- // eps_66[keys[keys79[k]]] = i_f_val;
- // feps_66[keys[keys79[k]]] = -1 * f_val;
- // } else {
- // eps_66[keys79[k]] = i_f_val;
- // feps_66[keys79[k]] = -1 * f_val;
- // }
- // }
- // this.skbuff_add({
- // fiid: iid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: eps_66,
- // });
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: feps_66,
- // });
- // break;
- // case 67: //对最终伤害有概率造成N倍伤害
- // let a_per: number = 0;
- // if (this.seedRand.rand(1, 10000) <= cfgEf.args["p1"] * 10000) {
- // a_per = cfgEf.args["a1"];
- // } else if (this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
- // a_per = cfgEf.args["a"];
- // }
- // if (a_per > 0) {
- // this.skbuff_add({
- // fiid: iid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: { a_per: a_per },
- // });
- // }
- // break;
- // case 68: //攻击时,消耗自身x%当前生命值,扣除敌方等额生命值,最高不超过自身x%攻击
- // let i_hp68 = this.skbuff_get(iid, "hp");
- // let i_atk68 = this.skbuff_get(iid, "atk");
- // let max = Math.floor((i_atk68 * cfgEf.args["atk_per"]) / 10000);
- // let subHp68 = Math.floor((i_hp68 * Math.abs(cfgEf.args["hp"])) / 10000);
- // subHp68 = Math.min(subHp68, max);
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // if (lsOne == 0) {
- // //只扣除一次
- // lsOne += 1;
- // this.addOneAtk(iid, iid, "effect", ["hp", -1 * subHp68]);
- // }
- // this.addOneAtk(iid, fiid, "effect", ["hp", -1 * subHp68]);
- // break;
- // case 69: //每次进行反击,获得51%强化兽灵,最大不超过自身攻击力30%,持续2秒,冷却10秒
- // let f_atk69 = this.skbuff_get(fiid, "atk");
- // let m_qhshouling = Math.floor((f_atk69 * cfgEf.args["atk_per"]) / 10000);
- // let qhshouling = Math.min(cfgEf.args["qhshouling"], m_qhshouling);
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // qhshouling: qhshouling,
- // //max_add_hit: Math.floor((f_atk69 * cfgEf.args["atk"]) / 10000),
- // },
- // });
- // break;
- // case 70: //反弹xx%的伤害给敌方,最大不超过自身攻击力2倍
- // // 获取上次攻击自己的人
- // let hit_fiid = this.uuids[iid]?.fpk;
- // let hit70: number = cs["hit"] * cfgEf.args["a"];
- // let max70 = (this.skbuff_get(iid, "atk") * cfgEf.args["atk_per"]) / 10000;
- // hit70 = Math.floor(Math.min(hit70, max70));
- // //this.addOneAtk(hit_fiid,hit_fiid,"aType",Xys.ActionType.effect)
- // if (hit_fiid) {
- // this.addOneAtk(hit_fiid, hit_fiid, "effect", ["hp", -1 * hit70]);
- // }
- // break;
- // case 71: //单次伤害不超过自身最大生命值的x%
- // if (cs["do_iid"] != Number(fiid)) {
- // pass = false;
- // continue;
- // }
- // let f_hp_max71 = this.skbuff_get(iid, "hp_max");
- // let max_hit_71 = Math.floor((f_hp_max71 * cfgEf.args["hp_max"]) / 10000);
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: {
- // max_i_71: max_hit_71,
- // max_i_71_cd: cfgEf.cd ? cfgEf.cd : 0,
- // max_i_71_nZhen: this.zhen,
- // },
- // });
- // break;
- // case 72: //目标处于某种状态,然后延长此状态的时间
- // let f_i_buff = this.skbuff_get(fiid, "effect_i_" + cfgEf.args["buff"], 2);
- // if (f_i_buff > 0) {
- // //let keys72 = Object.keys(this.uuids[fiid].skbuff["effect_i_" + cfgEf.args["buff"]])
- // let keys72 = this.changeSkBuff(1, fiid, "effect_i_" + cfgEf.args["buff"], 1);
- // for (let k = 0; k < keys72.length; k++) {
- // this.uuids[fiid].skbuff["effect_i_" + cfgEf.args["buff"]][Number(keys72[k])].ezhen += 30 * cfgEf.args["t"];
- // }
- // this.changeSkBuff(2, fiid, "effect_i_" + cfgEf.args["buff"], 1, this.uuids[fiid].skbuff["effect_i_" + cfgEf.args["buff"]]);
- // } else {
- // continue;
- // }
- // break;
- // case 73: //每次释放术法,术法伤害增加7.5%,最高叠加到15%
- // let qhmifa73 = this.skbuff_get(fiid, "i_73");
- // qhmifa73 += cfgEf.args["qhmifa"];
- // qhmifa73 = Math.min(qhmifa73, cfgEf.args["max_qhmifa"]);
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: 2, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: { i_73: qhmifa73 },
- // });
- // break;
- // case 74: //给被溅射的目标增加一个BUFF效果
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"].toString(), ef_ttype, cs);
- // break;
- // case 75: //技能系数增加,生效1次后清空
- // if (cfgEf.args["a"] == null) {
- // continue;
- // }
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: 2, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: { i_75: cfgEf.args["a"] * 10000 },
- // });
- // break;
- // case 76: //存在buff时,造成技能伤害
- // if (gameMethod.isEmpty(cfgEf.args["buff"]) == false) {
- // if (this.skbuff_get(iid, "effect_i_" + cfgEf.args["buff"], 2) <= 0) {
- // continue;
- // }
- // }
- // this.js_hits(iid, fiid, e_a, skid); //计算伤害
- // let gzhit = this.oneHit[iid][fiid];
- // let hit = gzhit.skhit;
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, fiid, "effect", ["hp", -1 * hit]);
- // if (cfgEf.args["p"] != null && this.seedRand.rand(1, 10000) <= cfgEf.args["p"] * 10000) {
- // cs["nextid"] = 1;
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // break;
- // case 77: // 造成伤害(额外伤害)
- // cs["hit"] = this.skbuff_get(iid, "atk");
- // if (cs["hit"] == null) {
- // continue;
- // }
- // let hit_77 = Math.floor((cs["hit"] * cfgEf.args["atk"]) / 10000);
- // let effect = [];
- // effect = ["hp", -1 * hit_77];
- // if (cfgEf.args["s"] != null) {
- // effect = ["hp", -1 * hit_77, "jitui", cfgEf.args["s"]];
- // }
- // this.addOneAtk(iid, fiid, "effect", effect);
- // break;
- // case 78: // 释放技能后 造成某种效果 id对应释放技能后效果
- // if (cfgEf.args["id"] != null) {
- // this.sk_effect(iid, skid, cfgEf.args["id"], ef_ttype, cs);
- // }
- // break;
- // case 80: // 给自身加buff,攻击目标带有某个buff时,必定暴击
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: 1, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: 1, //增加层数
- // eps: {
- // i_80_buff: cfgEf.args["buff"],
- // },
- // });
- // break;
- // case 81: // 溅射伤害增加/减少
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_81: e_a,
- // i_81_cd: 0, // 持续性的 不加cd
- // i_81_nZhen: this.zhen,
- // }, //属性
- // });
- // break;
- // case 82: //攻击带有护体罡气的承伤减少/增加xxx%
- // this.skbuff_add({
- // fiid: fiid, //添加对象
- // key: ef_buff, //属性key
- // minZhen: this.zhen, //开始帧
- // maxZhen: this.zhen + maxzhen, //结束帧
- // overlayType: overlayType, // 1.叠加 2.不叠加替换,默认不填值就是不叠加
- // ceng: e_m, //增加层数
- // eps: {
- // i_82: cfgEf.args["hp_max"],
- // },
- // });
- // break;
- // }
- // }
- // if (!pass) {
- // return;
- // }
- // //cd
- // if (fiids.length > 0) {
- // if (gameMethod.isEmpty(cfgEf.count) == false && this.zhen != 1) {
- // this.uuids[iid].skbase[skid].effect[effectId].count += 1;
- // if (this.uuids[iid].skbase[skid].effect[effectId].count >= cfgEf.count) {
- // if (gameMethod.isEmpty(cfgEf.cd) == false) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen;
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // this.uuids[iid].skbase[skid].effect[effectId].count = 0;
- // this.uuids[iid].timer[ef_ttype][cs["timerId"].toString()].szhen = this.zhen + cfgEf.cd * 30;
- // } else {
- // }
- // }
- // }
- // if (gameMethod.isEmpty(cfgEf.cd) == false && this.zhen != 1) {
- // if (this.uuids[iid].skbase[skid].effect[effectId].count == 0) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectZhen = this.zhen; // 上次加状态的帧
- // if (cfgEf.args["t"]) {
- // if (this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen < this.zhen) {
- // this.uuids[iid].skbase[skid].effect[effectId].effectEndZhen = this.zhen + cfgEf.args["t"] * 30; // buff持续增加效果结束帧
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // }
- // } else {
- // this.uuids[iid].skbase[skid].effect[effectId].nextcd = this.zhen + cfgEf.cd * 30;
- // }
- // }
- // }
- // }
- // // 判定是否是弟子技能 触发弟子释放技能主角加血
- // if (cfgBase.type === "1" && cfgBase.skillType === 3) {
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let uid = this.teamFiids[index];
- // if (uid.length === iid.length) {
- // let i_58 = this.skbuff_get(uid, "effect_i_58", 2);
- // if (i_58 > 0) {
- // if (this.zhen >= this.skbuff_get(uid, "i_58_nZhen")) {
- // // 有cd的 加完一次要更新cd
- // let cd = this.skbuff_get(uid, "i_58_cd");
- // this.skbuff_update(uid, { i_58_nZhen: cd * 30 + this.zhen });
- // let addPer = this.skbuff_get(uid, "i_58"); // 恢复已损失生命的x%
- // let hp = this.skbuff_get(uid, "hp");
- // let hpMax = this.skbuff_get(uid, "hp_max");
- // let hit = Math.floor(((hpMax - hp) * addPer) / 10000);
- // this.addOneAtk(iid, iid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(iid, uid, "effect", ["hp", hit]);
- // }
- // }
- // }
- // }
- // }
- // }
- // /**
- // * 辅助函数 - 获取值总和
- // * gType = 2 叠加的层数
- // */
- // private skbuff_get(iid: string, key: string, gType: number = 0): number {
- // let epVal: number = 0;
- // if (this.teams[iid] == null) {
- // return 0;
- // }
- // //层数
- // if (gType == 2) {
- // let ceng: number = 0;
- // if (key == "effect_i_10") {
- // if (this.uuids[iid].skbuff["effect_i_1"] != null) {
- // ceng += this.uuids[iid].skbuff["effect_i_1"].length;
- // }
- // if (this.uuids[iid].skbuff["effect_i_3"] != null) {
- // ceng += this.uuids[iid].skbuff["effect_i_3"].length;
- // }
- // if (this.uuids[iid].skbuff["effect_i_4"] != null) {
- // ceng += this.uuids[iid].skbuff["effect_i_4"].length;
- // }
- // if (this.uuids[iid].skbuff["effect_i_5"] != null) {
- // ceng += this.uuids[iid].skbuff["effect_i_5"].length;
- // }
- // if (this.uuids[iid].skbuff["effect_i_6"] != null) {
- // ceng += this.uuids[iid].skbuff["effect_i_6"].length;
- // }
- // //let keys = Object.keys(this.uuids[iid].skbuff)
- // let keys = this.changeSkBuff(1, iid, null, 1);
- // for (let k = 0; k < keys.length; k++) {
- // if (keys[k].includes("effect_i_0")) {
- // // let values = Object.values(this.uuids[iid].skbuff[keys[k]])
- // let values = this.changeSkBuff(1, iid, keys[k], 2);
- // for (let j = 0; j < values.length; j++) {
- // //计算属性 这里in没关系
- // let keys2 = Object.keys(values[j].eps);
- // for (let l = 0; l < keys2.length; l++) {
- // if (this.teams[iid].eps[keys2[l]] == null) {
- // continue;
- // }
- // if (values[j].eps[keys2[l]] < 0) {
- // ceng += 1;
- // break;
- // }
- // }
- // }
- // }
- // }
- // return ceng;
- // }
- // if (this.uuids[iid].skbuff[key] == null) {
- // return 0;
- // }
- // return this.uuids[iid].skbuff[key].length;
- // }
- // //属性
- // if (this.teams[iid].eps[key] != null) {
- // epVal = this.teams[iid].eps[key];
- // if (key == "hp") {
- // //剩余血量
- // epVal = this.jueFiidHp(iid);
- // }
- // }
- // // let values = Object.values(this.uuids[iid].skbuff);
- // let values = this.changeSkBuff(1, iid, null, 2);
- // for (let k = 0; k < values.length; k++) {
- // for (let j = 0; j < values[k].length; j++) {
- // //计算属性 这里in没关系
- // if (values[k][j].eps[key] == null) {
- // continue;
- // }
- // epVal += values[k][j].eps[key];
- // }
- // }
- // //攻击
- // if (key == "atk") {
- // let atk_per = this.skbuff_get(iid, "atk_per");
- // epVal += Math.floor((epVal * atk_per) / 10000);
- // }
- // //防御
- // if (key == "def") {
- // let def_per = this.skbuff_get(iid, "def_per");
- // epVal += Math.floor((epVal * def_per) / 10000);
- // }
- // //生命百分比
- // if (key == "hp_max") {
- // let hp_max_per = this.skbuff_get(iid, "hp_max_per");
- // epVal += Math.floor((epVal * hp_max_per) / 10000);
- // }
- // //生命百分比
- // if (key == "hp") {
- // let hp_per = this.skbuff_get(iid, "hp_per");
- // epVal += Math.floor((epVal * hp_per) / 10000);
- // }
- // return Math.floor(epVal);
- // }
- // /**
- // * 辅助函数 - 清除buff
- // */
- // private skbuff_clear() {
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // if (this.teams[fiid].eps.hp <= 0) {
- // this.uuids[fiid].skbuff = {};
- // }
- // //let skbuffCopy = gameMethod.objCopy(this.uuids[fiid].skbuff);
- // this.uuids[fiid].skbuff = {};
- // // let keys = Object.keys(skbuffCopy)
- // let keys = this.changeSkBuff(1, fiid, null, 1);
- // for (let k = 0; k < keys.length; k++) {
- // //计算属性 这里in没关系
- // // let values = Object.values(skbuffCopy[keys[k]])
- // let values = this.changeSkBuff(1, fiid, keys[k], 2);
- // for (let j = 0; j < values.length; j++) {
- // if (this.zhen >= values[j].ezhen) {
- // this.oneBuff[fiid] = 1;
- // if (gameMethod.isEmpty(values[j].eps["i_9_id"]) == false) {
- // this.sk_effect(fiid, values[j].eps["i_9_skin"].toString(), values[j].eps["i_9_id"].toString(), "", {
- // do_iid: Number(fiid),
- // nextid: 1,
- // });
- // }
- // continue;
- // }
- // if (this.uuids[fiid].skbuff[keys[k]] == null) {
- // this.uuids[fiid].skbuff[keys[k]] = [];
- // }
- // this.uuids[fiid].skbuff[keys[k]].push(values[j]);
- // }
- // }
- // this.changeSkBuff(2, fiid, null, 1, this.uuids[fiid].skbuff);
- // if (this.skbuff_get(fiid, "effect_i_9", 2) <= 0) {
- // let values = Object.values(this.uuids[fiid].podun);
- // for (let k = 0; k < values.length; k++) {
- // this.skbuff_sub_all(fiid, values[k]);
- // }
- // }
- // if (this.skbuff_get(fiid, "effect_i_4", 2) <= 0) {
- // this.skbuff_sub_all(fiid, "effect_i_59");
- // }
- // }
- // }
- // /**
- // * 辅助函数 - 输出BUFF
- // */
- // private skbuff_outf() {
- // let keys = Object.keys(this.oneBuff);
- // for (let k = 0; k < keys.length; k++) {
- // this.addOneAtk(keys[k], keys[k], "aType", Xys.ActionType.buff);
- // // let keys2 = Object.keys(this.uuids[keys[k]].skbuff)
- // let keys2 = this.changeSkBuff(1, keys[k], null, 1);
- // for (let j = 0; j < keys2.length; j++) {
- // this.addOneAtk(keys[k], keys[k], "buff", [keys2[j], this.uuids[keys[k]].skbuff[keys2[j]].length]);
- // }
- // }
- // }
- // /**
- // * 辅助函数 - 添加属性值
- // */
- // private skbuff_add(cs: skbuff_add_cs) {
- // let eff_i_12 = this.skbuff_get(cs.fiid, "effect_i_12", 2);
- // if (eff_i_12 > 0) {
- // if (["effect_i_1", "effect_i_3", "effect_i_4", "effect_i_5", "effect_i_6"].includes(cs.key)) {
- // return;
- // }
- // if (cs.key.includes("effect_i_0")) {
- // let keys = Object.keys(cs.eps);
- // for (let k = 0; k < keys.length; k++) {
- // if (this.teams[cs.fiid].eps[keys[k]] == null) {
- // continue;
- // }
- // if (cs.eps[keys[k]] < 0) {
- // return;
- // }
- // }
- // }
- // }
- // if (cs.overlayType == 1) {
- // //1.叠加 2.不叠加替换,默认不填值就是不叠加
- // if (this.uuids[cs.fiid].skbuff[cs.key] == null) {
- // this.uuids[cs.fiid].skbuff[cs.key] = [];
- // }
- // for (let index = 0; index < cs.ceng; index++) {
- // this.uuids[cs.fiid].skbuff[cs.key].push({
- // szhen: cs.minZhen, //开始帧
- // ezhen: cs.maxZhen, //结束帧
- // eps: cs.eps, //属性值
- // });
- // }
- // } else {
- // this.uuids[cs.fiid].skbuff[cs.key] = [];
- // for (let index = 0; index < cs.ceng; index++) {
- // this.uuids[cs.fiid].skbuff[cs.key].push({
- // szhen: cs.minZhen, //开始帧
- // ezhen: cs.maxZhen, //结束帧
- // eps: cs.eps, //属性值
- // });
- // }
- // }
- // this.changeSkBuff(2, cs.fiid, cs.key, 1, this.uuids[cs.fiid].skbuff[cs.key]);
- // this.oneBuff[cs.fiid] = 1;
- // }
- // /**
- // * 辅助函数 - 修改属性值
- // */
- // private skbuff_update(iid: string, eps: { [p: string]: number }, type: number = 0) {
- // if (this.teams[iid] == null) {
- // return;
- // }
- // if (type === 1) {
- // this.teams[iid].eps = eps;
- // } else {
- // let keys = Object.keys(eps);
- // for (let k = 0; k < keys.length; k++) {
- // this.teams[iid].eps[keys[k]] = eps[keys[k]];
- // }
- // }
- // }
- // /**
- // * 辅助函数 - 删除属性值 (1个)
- // */
- // private skbuff_sub(fiid: string, key: string) {
- // if (this.uuids[fiid] == null) {
- // return;
- // }
- // if (gameMethod.isEmpty(this.uuids[fiid].skbuff[key]) == true) {
- // return;
- // }
- // this.uuids[fiid].skbuff[key].splice(0, 1);
- // this.changeSkBuff(2, fiid, key, 1, this.uuids[fiid].skbuff[key]);
- // this.oneBuff[fiid] = 1;
- // }
- // /**
- // * 辅助函数 - 删除属性值 (所有)
- // */
- // private skbuff_sub_all(fiid: string, key: string) {
- // if (this.uuids[fiid] == null) {
- // return;
- // }
- // if (gameMethod.isEmpty(this.uuids[fiid].skbuff[key]) == true) {
- // return;
- // }
- // //delete this.uuids[fiid].skbuff[key];
- // this.changeSkBuff(3, fiid, key);
- // if (key == "effect_i_4" && this.uuids[fiid].skbuff["effect_i_59"]) {
- // // 火焰清除时 对应的火焰增伤也清除
- // //delete this.uuids[fiid].skbuff["effect_i_59"]
- // this.changeSkBuff(3, fiid, "effect_i_59");
- // }
- // this.oneBuff[fiid] = 1;
- // }
- // /**
- // * 辅助函数 - 最终伤害增减
- // * @param iid 打人
- // * @param fiid 被打人
- // * @param hit 造成的伤害
- // */
- // private hit_last(iid: string, fiid: string, hit: number, isfj: number = 0): number {
- // if (hit <= 0) {
- // return 0;
- // }
- // let add_per: number = 0;
- // //最终伤害降低xx%
- // let i_13_nZhen = this.skbuff_get(fiid, "i_13_nZhen");
- // if (this.skbuff_get(fiid, "effect_i_13", 2) > 0 && this.zhen >= i_13_nZhen) {
- // add_per += this.skbuff_get(fiid, "i_13");
- // let cd = this.skbuff_get(fiid, "i_13_cd");
- // if (cd > 0) {
- // this.skbuff_update(fiid, { i_13_nZhen: cd * 30 + this.zhen });
- // }
- // }
- // hit += Math.floor((hit * add_per) / 10000);
- // // 计算个人战力差 系数
- // hit = Math.floor(this.powerDisparity(iid, fiid) * hit);
- // hit = Math.max(0, hit);
- // let f_i_9 = this.skbuff_get(fiid, "i_9");
- // if (f_i_9 > 0) {
- // //有护盾
- // let f_i_61 = this.skbuff_get(fiid, "i_61") / 10000;
- // let i_i_82 = this.skbuff_get(iid, "i_82") / 10000;
- // //let copy = gameMethod.objCopy(this.uuids[fiid].skbuff["effect_i_9"]);
- // this.uuids[fiid].skbuff["effect_i_9"] = [];
- // // let values = Object.values(copy)
- // let values = this.changeSkBuff(1, fiid, "effect_i_9", 2);
- // for (let k = 0; k < values.length; k++) {
- // let skbuff = values[k];
- // //计算属性 这里in没关系
- // let i_9_add = Math.floor(skbuff.eps["i_9"] * (f_i_61 - i_i_82));
- // if (hit >= skbuff.eps["i_9"] + i_9_add) {
- // hit -= skbuff.eps["i_9"] + i_9_add;
- // skbuff.eps["i_9"] = 0;
- // if (gameMethod.isEmpty(skbuff.eps["i_9_id"]) == false) {
- // this.sk_effect(fiid, skbuff.eps["i_9_skin"].toString(), skbuff.eps["i_9_id"].toString(), "", {
- // do_iid: Number(fiid),
- // nextid: 1,
- // });
- // }
- // this.timer_do(105, { do_iid: Number(fiid) }); //护体罡气破碎时触发
- // this.oneBuff[fiid] = 1;
- // } else {
- // skbuff.eps["i_9"] -= hit - i_9_add;
- // hit = 0;
- // this.uuids[fiid].skbuff["effect_i_9"].push(skbuff);
- // }
- // if (isfj === 1) {
- // this.addOneAtk(fiid, fiid, "effect", ["i_9", skbuff.eps["i_9"]]);
- // } else {
- // this.addOneAtk(iid, fiid, "effect", ["i_9", skbuff.eps["i_9"]]);
- // }
- // }
- // this.changeSkBuff(2, fiid, "effect_i_9", 1, this.uuids[fiid].skbuff["effect_i_9"]);
- // }
- // return Math.floor(hit);
- // }
- // // 个人战力差
- // private powerDisparity(iid: string, fiid: string, power?: number, fPower?: number): number {
- // let pct1 = 1;
- // let pct2 = 1;
- // let ilen = iid.length;
- // let flen = fiid.length;
- // if (this.damage[ilen] && this.damage[ilen][flen]) {
- // return this.damage[ilen][flen];
- // }
- // if (this.damage[ilen] == null) {
- // this.damage[ilen] = {};
- // }
- // if (this.damage[flen] == null) {
- // this.damage[flen] = {};
- // }
- // this.damage[ilen][flen] = pct1;
- // this.damage[flen][ilen] = pct2;
- // if (power != null && fPower != null) {
- // if (power == 0 || fPower == 0) {
- // return pct1;
- // }
- // // 战力差
- // let powerC = Math.abs(power - fPower);
- // // 战力比
- // let powerB = Math.min(power, fPower) / Math.max(power, fPower);
- // let index = 1;
- // while (index > 0) {
- // let damage = Gamecfg.userDamage.getItem(index.toString());
- // if (damage != null) {
- // if (
- // damage.zhanlirange[0] <= powerC &&
- // ((damage.zhanlirange.length == 2 && powerC <= damage.zhanlirange[1]) || damage.zhanlirange.length == 1) &&
- // damage.ratio[0] <= powerB &&
- // powerB <= damage.ratio[1]
- // ) {
- // if (power > fPower) {
- // pct1 += damage.xishua;
- // pct2 -= damage.xishub;
- // } else {
- // pct1 -= damage.xishub;
- // pct2 += damage.xishua;
- // }
- // index = -1;
- // } else {
- // index++;
- // }
- // } else {
- // index = -1;
- // }
- // }
- // this.damage[ilen][flen] = pct1;
- // this.damage[flen][ilen] = pct2;
- // }
- // return pct1;
- // }
- // /**
- // * 是否暴击
- // * @param iid
- // * @param fiid
- // * 暴击率=max((我方暴击-敌方抗暴击),暴击保底参数)
- // */
- // private isBaoji(iid: string, fiid: string): number {
- // if (this.teams[iid].type == 3) {
- // return 0;
- // }
- // let isBj: number = 0;
- // let ef_i_24 = this.skbuff_get(iid, "effect_i_24", 2);
- // if (ef_i_24 > 0) {
- // //必定暴击
- // this.skbuff_sub_all(iid, "effect_i_24");
- // isBj = 1;
- // return isBj;
- // }
- // let ef_i_80 = this.skbuff_get(iid, "effect_i_80", 2);
- // let ef_i_80_buff = this.skbuff_get(iid, "i_80_buff");
- // if (ef_i_80 > 0 && this.skbuff_get(fiid, "effect_i_" + ef_i_80_buff, 2) > 0) {
- // //必定暴击
- // this.skbuff_sub_all(iid, "effect_i_80");
- // isBj = 1;
- // return isBj;
- // }
- // let i_baoji: number = this.skbuff_get(iid, "baoji");
- // let f_hsbaoji: number = this.skbuff_get(fiid, "hsbaoji");
- // let bdbaoji: number = 0; //保底暴击
- // let cfg = Gamecfg.userEp.getItem("baoji");
- // if (cfg != null) {
- // bdbaoji = cfg.initEp;
- // }
- // if (this.seedRand.rand(1, 10000) <= Math.max(i_baoji - f_hsbaoji, bdbaoji)) {
- // isBj = 1;
- // }
- // return isBj;
- // }
- // /**
- // * 是否连击 只打一次
- // * @param iid
- // * @param fiid
- // */
- // private isLianji(iid: string, fiid: string): number {
- // if (this.jueFiidHp(iid) <= 0 || this.jueFiidHp(fiid) <= 0) {
- // return 0; //其中一个死了
- // }
- // if (this.teams[iid].type == 3) {
- // return 0;
- // }
- // let isLj: number = 0;
- // let i_lianji: number = this.skbuff_get(iid, "lianji");
- // let f_hslianji: number = this.skbuff_get(fiid, "hslianji");
- // let bdlianji: number = 0; //保底暴击
- // let cfg = Gamecfg.userEp.getItem("lianji");
- // if (cfg != null) {
- // bdlianji = cfg.initEp;
- // }
- // if (this.seedRand.rand(1, 10000) <= i_lianji - f_hslianji) {
- // isLj = 1;
- // }
- // return isLj;
- // }
- // /**
- // * 是否格挡
- // * 敌方格挡率=max((敌方格挡-我方抗格挡),格挡保底参数)
- // * @param iid
- // * @param fiid
- // * 1.敌人如果处于晕眩、冰冻中,则直接不触发格挡,跳过格挡率计算过程
- // * 2.如果敌人处于非晕眩、冰冻中,则按格挡率判断
- // */
- // private isGedang(iid: string, fiid: string): number {
- // if (this.teams[iid].type == 3) {
- // return 0;
- // }
- // let isGd: number = 0;
- // let f_i_3: number = this.skbuff_get(fiid, "effect_i_3", 2);
- // if (f_i_3 > 0) {
- // return isGd;
- // }
- // let f_i_5: number = this.skbuff_get(fiid, "effect_i_5", 2);
- // if (f_i_5 > 0) {
- // return isGd;
- // }
- // let f_block: number = this.skbuff_get(fiid, "block");
- // let i_hsblock: number = this.skbuff_get(iid, "hsblock");
- // let bdGedang: number = 0; //保底格挡
- // let cfg = Gamecfg.userEp.getItem("block");
- // if (cfg != null) {
- // bdGedang = cfg.initEp;
- // }
- // if (this.seedRand.rand(1, 10000) <= Math.max(f_block - i_hsblock, bdGedang)) {
- // isGd = 1;
- // }
- // return isGd;
- // }
- // /**
- // * 是否反击
- // * @param iid
- // * @param fiid
- // * 敌方反击率=max((敌方反击-我方抗反击),反击保底参数)
- // * 1.触犯反击时攻击不能被敌人格挡,必须百分百命中,(也就是说不会被敌人格挡)
- // * 2.触犯反击时攻击不会继续判断是否触发暴击(也就是不会触发暴击)
- // * 3.触发反击时不会触发眩晕、连击、溅射
- // * 4.反击后不能再触发反击
- // */
- // private isFanji(iid: string, fiid: string): number {
- // if (this.jueFiidHp(iid) <= 0 || this.jueFiidHp(fiid) <= 0) {
- // return 0; //其中一个死了
- // }
- // if (this.teams[iid].type == 3 || this.teams[fiid].type == 3) {
- // return 0;
- // }
- // let isfj: number = 0;
- // let i_fanji: number = this.skbuff_get(iid, "fanji");
- // let f_hsfanji: number = this.skbuff_get(fiid, "hsfanji");
- // let bdfanji: number = 0; //保底反击
- // let cfg = Gamecfg.userEp.getItem("fanji");
- // if (cfg != null) {
- // bdfanji = cfg.initEp;
- // }
- // if (this.seedRand.rand(1, 10000) <= Math.max(i_fanji - f_hsfanji, bdfanji)) {
- // isfj = 1;
- // }
- // return isfj;
- // }
- // /**
- // * 增减蓝条
- // * @param fiid
- // * @param num
- // * @returns
- // */
- // private add_mp(fiid: string, num: number, wz: 0 | 1 | 2) {
- // if (this.teams[fiid] == null) {
- // return;
- // }
- // if (Number(fiid) % 100 != 0) {
- // return;
- // }
- // if (this.mpfiids[fiid] == null) {
- // this.mpfiids[fiid] = [0, 0];
- // }
- // if (wz == 0 || wz == 1) {
- // if (this.mpfiids[fiid][wz] == 1) {
- // return;
- // }
- // this.mpfiids[fiid][wz] = 1;
- // }
- // this.teams[fiid].eps["mp"] = Math.max(this.teams[fiid].eps["mp"], 0);
- // this.teams[fiid].eps["mp"] += Math.floor(num);
- // this.teams[fiid].eps["mp"] = Math.min(this.teams[fiid].eps["mp"], 10000);
- // this.addOneAtk(fiid, fiid, "aType", Xys.ActionType.effect);
- // this.addOneAtk(fiid, fiid, "effect", ["mp", num]);
- // }
- // /**
- // * 添加轮询执行脚本
- // */
- // private timer_add(addTimer: timer_add_cs) {
- // if (this.uuids[addTimer.iid] == null) {
- // return; //兼容不存在的人
- // }
- // let cs = gameMethod.objCopy(addTimer.cs);
- // if (cs["timerId"] == null) {
- // cs["timerId"] = this.timerId;
- // }
- // if (addTimer.type[0] == 602) {
- // if (this.uuids[addTimer.iid].timer[addTimer.key] == null) {
- // this.uuids[addTimer.iid].timer[addTimer.key] = {};
- // }
- // if (addTimer.overlayType == 2) {
- // this.uuids[addTimer.iid].timer[addTimer.key] = {}; //换掉原来的
- // }
- // addTimer.key = addTimer.key + "_" + 602;
- // if (this.uuids[addTimer.iid].timer[addTimer.key] == null) {
- // this.uuids[addTimer.iid].timer[addTimer.key] = {};
- // }
- // if (addTimer.overlayType == 2) {
- // this.uuids[addTimer.iid].timer[addTimer.key] = {}; //换掉原来的
- // }
- // this.uuids[addTimer.iid].timer[addTimer.key][cs["timerId"].toString()] = {
- // fiids: addTimer.fiids, //执行触发点
- // type: addTimer.type, //执行触发点
- // func: addTimer.func, //执行的函数名
- // szhen: this.zhen, //触发的帧
- // lzhen: addTimer.lzhen, //轮询执行时间
- // ezhen: addTimer.ezhen, //结束时间
- // skid: addTimer.skid, //技能ID
- // aeid: addTimer.aeid, //效果ID|行为ID
- // cs: cs,
- // };
- // } else {
- // if (this.uuids[addTimer.iid].timer[addTimer.key] == null) {
- // this.uuids[addTimer.iid].timer[addTimer.key] = {};
- // }
- // if (addTimer.overlayType == 2) {
- // this.uuids[addTimer.iid].timer[addTimer.key] = {}; //换掉原来的
- // }
- // this.uuids[addTimer.iid].timer[addTimer.key][cs["timerId"].toString()] = {
- // fiids: addTimer.fiids, //执行触发点
- // type: addTimer.type, //执行触发点
- // func: addTimer.func, //执行的函数名
- // szhen: this.zhen, //触发的帧
- // lzhen: addTimer.lzhen, //轮询执行时间
- // ezhen: addTimer.ezhen, //结束时间
- // skid: addTimer.skid, //技能ID
- // aeid: addTimer.aeid, //效果ID|行为ID
- // cs: cs,
- // };
- // }
- // this.changeTimer(2, addTimer.iid, addTimer.key, 1, this.uuids[addTimer.iid].timer[addTimer.key]);
- // this.timerId += 1;
- // }
- // /**
- // * 删除轮询执行脚本
- // */
- // private timer_sub(fiid: string, key: string) {
- // if (this.uuids[fiid] == null) {
- // return;
- // }
- // this.changeTimer(3, fiid, key);
- // //delete this.uuids[fiid].timer[key];
- // }
- // /**
- // * 删除轮询执行脚本 - 删除某个人的(关于他的定时器)
- // */
- // private timer_sub_by_fiid(fiid: string) {
- // if (this.uuids[fiid] == null) {
- // return;
- // }
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let iid = this.teamFiids[index];
- // // let keys = Object.keys(this.uuids[iid].timer);
- // let keys = this.changeTimer(1, iid, null, 1);
- // for (let k = 0; k < keys.length; k++) {
- // // let keys2 = Object.keys(this.uuids[iid].timer[keys[k]])
- // let keys2 = this.changeTimer(1, iid, keys[k], 1);
- // for (let j = 0; j < keys2.length; j++) {
- // if (this.uuids[iid].timer[keys[k]][keys2[j]] && this.uuids[iid].timer[keys[k]][keys2[j]].fiids) {
- // let copyFiids: string[] = gameMethod.objCopy(this.uuids[iid].timer[keys[k]][keys2[j]].fiids);
- // this.uuids[iid].timer[keys[k]][keys2[j]].fiids = [];
- // let values = copyFiids;
- // for (let l = 0; l < values.length; l++) {
- // if (values[l] != fiid) {
- // this.uuids[iid].timer[keys[k]][keys2[j]].fiids.push(values[l]);
- // }
- // }
- // if (this.uuids[iid].timer[keys[k]][keys2[j]].fiids.length == 0) {
- // delete this.uuids[iid].timer[keys[k]][keys2[j]];
- // }
- // }
- // }
- // }
- // }
- // this.changeTimer(2, null, null, 1);
- // }
- // /**
- // * 执行轮询执行脚本
- // * @param fiid 执行人
- // * @param type 执行点
- // */
- // private timer_do(_type: number, cs: { [key: string]: number } = {}) {
- // for (let i = 0; i < this.teamFiids.length; i++) {
- // if (this.uuids[this.teamFiids[i]].dzhen > 0 && this.uuids[this.teamFiids[i]].dzhen < this.zhen) {
- // continue; //死了 不应该在触发了
- // }
- // // let keys: string[] = Object.keys(this.uuids[this.teamFiids[i]].timer);
- // let keys: string[] = this.changeTimer(1, this.teamFiids[i], null, 1);
- // for (let k = 0; k < keys.length; k++) {
- // // let timers = Object.values(this.uuids[this.teamFiids[i]].timer[keys[k]]);
- // let timers = this.changeTimer(1, this.teamFiids[i], keys[k], 2);
- // for (let j = 0; j < timers.length; j++) {
- // if (_type != 0 && !timers[j].type.includes(_type)) {
- // continue; //不是这个执行类型的
- // }
- // if (this.zhen < timers[j].szhen || this.zhen > timers[j].ezhen) {
- // continue; //未开始或者过期了
- // }
- // if (this.zhen < timers[j].lzhen || (this.zhen - timers[j].szhen) % timers[j].lzhen > 0) {
- // continue; //没有到当前帧触发
- // }
- // if (timers[j].func == "sk_effect") {
- // if (cs["do_iid"] != Number(this.teamFiids[i])) {
- // let pass: boolean = false;
- // if (pass == false && _type == 404 && cs["do_iid"].toString().length != this.teamFiids[i].length) {
- // pass = true;
- // }
- // if (pass == false && _type == 106 && timers[j].fiids.includes(cs["do_iid"].toString())) {
- // pass = true;
- // }
- // if (pass == false && _type == 206 && cs["do_iid"].toString().length == this.teamFiids[i].length) {
- // pass = true;
- // }
- // if (pass == false) {
- // continue;
- // }
- // }
- // if (this.oneFiids[this.teamFiids[i]] == null) {
- // this.oneFiids[this.teamFiids[i]] = {};
- // }
- // let timer_fiids: string[] = [];
- // let fiids = timers[j].fiids;
- // for (let l = 0; l < fiids.length; l++) {
- // if (this.uuids[fiids[l]]==null ){
- // console.log("fiids===:",fiids)
- // continue;
- // }
- // if (this.uuids[fiids[l]].dzhen > 0 && this.uuids[fiids[l]].dzhen < this.zhen) {
- // continue; //死了 不应该在触发了
- // }
- // timer_fiids.push(fiids[l]);
- // }
- // if (timer_fiids.length <= 0 && timers[j].fiids.length != 0) {
- // // 本身没有目标的定时器 不要跳过
- // continue;
- // }
- // if (_type == 602) {
- // keys[k] = keys[k].slice(0, keys[k].length - 4);
- // }
- // this.oneFiids[this.teamFiids[i]][keys[k]] = timer_fiids;
- // let csCopy = gameMethod.objCopy(timers[j].cs);
- // csCopy = Object.assign(csCopy, cs);
- // if (_type === 601 || _type === 602) {
- // csCopy["isTimer"] = 1;
- // }
- // this.sk_effect(this.teamFiids[i], timers[j].skid, timers[j].aeid, keys[k], csCopy);
- // }
- // }
- // }
- // }
- // }
- // /**
- // * 解锁隐藏
- // */
- // private jiesuo_hide(iid: string) {
- // let minLv: number = 999;
- // let minfiid: string = "";
- // let iidList: string[] = []
- // for (let index = 0; index < this.teamFiids.length; index++) {
- // let fiid = this.teamFiids[index];
- // if (fiid.length != iid.length) {
- // iidList.push(fiid);
- // continue;
- // }
- // if (this.teams[fiid].isHide == 0) {
- // continue;
- // }
- // if (this.teams[fiid].isHide < minLv) {
- // if (minfiid != "") {
- // this.teams[fiid].isHide = minLv;
- // }
- // minLv = this.teams[fiid].isHide;
- // minfiid = fiid;
- // }
- // }
- // if (minfiid != "") {
- // // 清空上一只boss的异常状态
- // for (let i=0;i<iidList.length;i++){
- // for (let k=0;k<this.bateBuff.length;k++){
- // this.skbuff_sub_all(iidList[i],this.bateBuff[k])
- // }
- // }
- // this.teams[minfiid].isHide = 0;
- // this.addOneAtk(minfiid, minfiid, "aType", Xys.ActionType.hide);
- // this.addOneAtk(minfiid, minfiid, "effect", ["isHide", 0]);
- // }
- // }
- // }
|