Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 00326 00327 00328 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 00351 00352 00353 00354 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 00380 00381 00382 00383 00384 00385 00386 00387 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 00399 00400 00401 00402 00403 00404 00405 00406 00407 00408 00409 00410 00411 00412 00413 00414 00415 00416 00417 00418 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433 00434 00435 00436 00437 00438 00439 00440 00441 00442 00443 00444 00445 00446 00447 00448 00449 00450 00451 00452 00453 00454 00455 00456 00457 00458 00459 00460 00461 00462 00463 00464 00465 00466 00467 00468 00469 00470 00471 00472 00473 00474 00475 00476 00477 00478 00479 00480 00481 00482 00483 00484 00485 00486 00487 00488 00489 00490 00491 00492 00493 00494 00495 00496 00497 00498 00499 00500 00501 00502 00503 00504 00505 00506 00507 00508 00509 00510 00511 00512 00513 00514 00515 00516 00517 00518 00519 00520 00521 00522 00523 00524 00525 00526 00527 00528 00529 00530 00531 00532 00533 00534 00535 00536 00537 00538 00539 00540 00541 00542 00543 00544 00545 00546 00547 00548 00549 00550 00551 00552 00553 00554 00555 00556 00557 00558 00559 00560 00561 00562 00563 00564 00565 00566 00567 00568 00569 00570 00571 00572 00573 00574 00575 00576 00577 00578 00579 00580 00581 00582 00583 00584 00585 00586 00587 00588 00589 00590 00591 00592 00593 00594 00595 00596 00597 00598 00599 00600 00601 00602 00603 00604 00605 00606 00607 00608 00609 00610 00611 00612 00613 00614 00615 00616 00617 00618 00619 00620 00621 00622 00623 00624 00625 00626 00627 00628 00629 00630 00631 00632 00633 00634 00635 00636 00637 00638 00639 00640 00641 00642 00643 00644 00645 00646 00647 00648 00649 00650 00651 00652 00653 00654 00655 00656 00657 00658 00659 00660 00661 00662 00663 00664 00665 00666 00667 00668 00669 00670 00671 00672 00673 00674 00675 00676 00677 00678 00679 00680 00681 00682 00683 00684 00685 00686 00687 00688 00689 00690 00691 00692 00693 00694 00695 00696 00697 00698 00699 00700 00701 00702 00703 00704 00705 00706 00707 00708 00709 00710 00711 00712 00713 00714 00715 00716 00717 00718 00719 00720 00721 00722 00723 00724 00725 00726 00727 00728 00729 00730 00731 00732 00733 00734 00735 00736 00737 00738 00739 00740 00741 00742 00743 00744 00745 00746 00747 00748 00749 00750 00751 00752 00753 00754 00755 00756 00757 00758 00759 00760 00761 00762 00763 00764 00765 00766 00767 00768 00769 00770 00771 00772 00773 00774 00775 00776 00777 00778 00779 00780 00781 00782 00783 00784 00785 00786 00787 00788 00789 00790 00791 00792 00793 00794 00795 00796 00797 00798 00799 00800 00801 00802 00803 00804 00805 00806 00807 00808 00809 00810 00811 00812 00813 00814 00815 00816 00817 00818 00819 00820 00821 00822 00823 00824 00825 00826 00827 00828 00829 00830 00831 00832 00833 00834 00835 00836 00837 00838 00839 00840 00841 00842 00843 00844 00845 00846 00847 00848 00849 00850 00851 00852 00853 00854 00855 00856 00857 00858 00859 00860 00861 00862 00863 00864 00865 00866 00867 00868 00869 00870 00871 00872 00873 00874 00875 00876 00877 00878 00879 00880 00881 00882 00883 00884 00885 00886 00887 00888 00889 00890 00891 00892 00893 00894 00895 00896 00897 00898 00899 00900 00901 00902 00903 00904 00905 00906 00907 00908 00909 00910 00911 00912 00913 00914 00915 00916 00917 00918 00919 00920 00921 00922 00923 00924 00925 00926 00927 00928 00929 00930 00931 00932 00933 00934 00935 00936 00937 00938 00939 00940 00941 00942 00943 00944 00945 00946 00947 00948 00949 00950 00951 00952 00953 00954 00955 00956 00957 00958 00959 00960 00961 00962 00963 00964 00965 00966 00967 00968 00969 00970 00971 00972 00973 00974 00975 00976 00977 00978 00979 00980 00981 00982 00983 00984 00985 00986 00987 00988 00989 00990 00991 00992 00993 00994 00995 00996 00997 00998 00999 01000 01001 01002 01003 01004 01005 01006 01007 01008 01009 01010 01011 01012 01013 01014 01015 01016 01017 01018 01019 01020 01021 01022 01023 01024 01025 01026 01027 01028 01029 01030 01031 01032 01033 01034 01035 01036 01037 01038 01039 01040 01041 01042 01043 01044 01045 01046 01047 01048 01049 01050 01051 01052 01053 01054 01055 01056 01057 01058 01059 01060 01061 01062 01063 01064 01065 01066 01067 01068 01069 01070 01071 01072 01073 01074 01075 01076 01077 01078 01079 01080 01081 01082 01083 01084 01085 01086 01087 01088 01089 01090 01091 01092 01093 01094 01095 01096 01097 01098 01099 01100 01101 01102 01103 01104 01105 01106 01107 01108 01109 01110 01111 01112 01113 01114 01115 01116 01117 01118 01119 01120 01121 01122 01123 01124 01125 01126 01127 01128 01129 01130 01131 01132 01133 01134 01135 01136 01137 01138 01139 01140 01141 01142 01143 01144 01145 01146 01147 01148 01149 01150 01151 01152 01153 01154 01155 01156 01157 01158 01159 01160 01161 01162 01163 01164 01165 01166 01167 01168 01169 01170 01171 01172 01173 01174 01175 01176 01177 01178 01179 01180 01181 01182 01183 01184 01185 01186 01187 01188 01189 01190 01191 01192 01193 01194 01195 01196 01197 01198 01199 01200 01201 01202 01203 01204 01205 01206 01207 01208 01209 01210 01211 01212 01213 01214 01215 01216 01217 01218 01219 01220 01221 01222 01223 01224 01225 01226 01227 01228 01229 01230 01231 01232 01233 01234 01235 01236 01237 01238 01239 01240 01241 01242 01243 01244 01245 01246 01247 01248 01249 01250 01251 01252 01253 01254 01255 01256 01257 01258 01259 01260 01261 01262 01263 01264 01265 01266 01267 01268 01269 01270 01271 01272 01273 01274 01275 01276 01277 01278 01279 01280 01281 01282 01283 01284 01285 01286 01287 01288 01289 01290 01291 01292 01293 01294 01295 01296 01297 01298 01299 01300 01301 01302 01303 01304 01305 01306 01307 01308 01309 01310 01311 01312 01313 01314 01315 01316 01317 01318 01319 01320 01321 01322 01323 01324 01325 01326 01327 01328 01329 01330 01331 01332 01333 01334 01335 01336 01337 01338 01339 01340 01341 01342 01343 01344 01345 01346 01347 01348 01349 01350 01351 01352 01353 01354 01355 01356 01357 01358 01359 01360 01361 01362 01363 01364 01365 01366 01367 01368 01369 01370 01371 01372 01373 01374 01375 01376 01377 01378 01379 01380 01381 01382 01383 01384 01385 01386 01387 01388 01389 01390 01391 01392 01393 01394 01395 01396 01397 01398 01399 01400 01401 01402 01403 01404 01405 01406 01407 01408 01409 01410 01411 01412 01413 01414 01415 01416 01417 01418 01419 01420 01421 01422 01423 01424 01425 01426 01427 01428 01429 01430 01431 01432 01433 01434 01435 01436 01437 01438 01439 01440 01441 01442 01443 01444 01445 01446 01447 01448 01449 01450 01451 01452 01453 01454 01455 01456 01457 01458 01459 01460 01461 01462 01463 01464 01465 01466 01467 01468 01469 01470 01471 01472 01473 01474 01475 01476 01477 01478 01479 01480 01481 01482 01483 01484 01485 01486 01487 01488 01489 01490 01491 01492 01493 01494 01495 01496 01497 01498 01499 01500 01501 01502 01503 01504 01505 01506 01507 01508 01509 01510 01511 01512 01513 01514 01515 01516 01517 01518 01519 01520 01521 01522 01523 01524 01525 01526 01527 01528 01529 01530 01531 01532 01533 01534 01535 01536 01537 01538 01539 01540 01541 01542 01543 01544 01545 01546 01547 01548 01549 01550 01551 01552 01553 01554 01555 01556 01557 01558 01559 01560 01561 01562 01563 01564 01565 01566 01567 01568 01569 01570 01571 01572 01573 01574 01575 01576 01577 01578 01579 01580 01581 01582 01583 01584 01585 01586 01587 01588 01589 01590 01591 01592 01593 01594 01595 01596 01597 01598 01599 01600 01601 01602 01603 01604 01605 01606 01607 01608 01609 01610 01611 01612 01613 01614 01615 01616 01617 01618 01619 01620 01621 01622 01623 01624 01625 01626 01627 01628 01629 01630 01631 01632 01633 01634 01635 01636 01637 01638 01639 01640 01641 01642 01643 01644 01645 01646 01647 01648 01649 01650 01651 01652 01653 01654 01655 01656 01657 01658 01659 01660 01661 01662 01663 01664 01665 01666 01667 01668 01669 01670 01671 01672 01673 01674 01675 01676 01677 01678 01679 01680 01681 01682 01683 01684 01685 01686 01687 01688 01689 01690 01691 01692 01693 01694 01695 01696 01697 01698 01699 01700 01701 01702 01703 01704 01705 01706 01707 01708 01709 01710 01711 01712 01713 01714 01715 01716 01717 01718 01719 01720 01721 01722 01723 01724 01725 01726 01727 01728 01729 01730 01731 01732 01733 01734 01735 01736 01737 01738 01739 01740 01741 01742 01743 01744 01745 01746 01747 01748 01749 01750 01751 01752 01753 01754 01755 01756 01757 01758 01759 01760 01761 01762 01763 01764 01765 01766 01767 01768 01769 01770 01771 01772 01773 01774 01775 01776 01777 01778 01779 01780 01781 01782 01783 01784 01785 01786 01787 01788 01789 01790 01791 01792 01793 01794 01795 01796 01797 01798 01799 01800 01801 01802 01803 01804 01805 01806 01807 01808 01809 01810 01811 01812 01813 01814 01815 01816 01817 01818 01819 01820 01821 01822 01823 01824 01825 01826 01827 01828 01829 01830 01831 01832 01833 01834 01835 01836 01837 01838 01839 01840 01841 01842 01843 01844 01845 01846 01847 01848 01849 01850 01851 01852 01853 01854 01855 01856 01857 01858 01859 01860 01861 01862 01863 01864 01865 01866 01867 01868 01869 01870 01871 01872 01873 01874 01875 01876 01877 01878 01879 01880 01881 01882 01883 01884 01885 01886 01887 01888 01889 01890 01891 01892 01893 01894 01895 01896 01897 01898 01899 01900 01901 01902 01903 01904 01905 01906 01907 01908 01909 01910 01911 01912 01913 01914 01915 01916 01917 01918 01919 01920 01921 01922 01923 01924 01925 01926 01927 01928 01929 01930 01931 01932 01933 01934 01935 01936 01937 01938 01939 01940 01941 01942 01943 01944 01945 01946 01947 01948 01949 01950 01951 01952 01953 01954 01955 01956 01957 01958 01959 01960 01961 01962 01963 01964 01965 01966 01967 01968 01969 01970 01971 01972 01973 01974 01975 01976 01977 01978 01979 01980 01981 01982 01983 01984 01985 01986 01987 01988 01989 01990 01991 01992 01993 01994 01995 01996 01997 01998 01999 02000 02001 02002 02003 02004 02005 02006 02007 02008 02009 02010 02011 02012 02013 02014 02015 02016 02017 02018 02019 02020 02021 02022 02023 02024 02025 02026 02027 02028 02029 02030 02031 02032 02033 02034 02035 02036 02037 02038 02039 02040 02041 02042 02043 02044 02045 02046 02047 02048 02049 02050 02051 02052 02053 02054 02055 02056 02057 02058 02059 02060 02061 02062 02063 02064 02065 02066 02067 02068 02069 02070 02071 02072 02073 02074 02075 02076 02077 02078 02079 02080 02081 02082 02083 02084 02085 02086 02087 02088 02089 02090 02091 02092 02093 02094 02095 02096 02097 02098 02099 02100 02101 02102 02103 02104 02105 02106 02107 02108 02109 02110 02111 02112 02113 02114 02115 02116 02117 02118 02119 02120 02121 02122 02123 02124 02125 02126 02127 02128 02129 02130 02131 02132 02133 02134 02135 02136 02137 02138 02139 02140 02141 02142 02143 02144 02145 02146 02147 02148 02149 02150 02151 02152 02153 02154 02155 02156 02157 02158 02159 02160 02161 02162 02163 02164 02165 02166 02167 02168 02169 02170 02171 02172 02173 02174 02175 02176 02177 02178 02179 02180 02181 02182 02183 02184 02185 02186 02187 02188 02189 02190 02191 02192 02193 02194 02195 02196 02197 02198 02199 02200 02201 02202 02203 02204 02205 02206 02207 02208 02209 02210 02211 02212 02213 02214 02215 02216 02217 02218 02219 02220 02221 02222 02223 02224 02225 02226 02227 02228 02229 02230 02231 02232 02233 02234 02235 02236 02237 02238 02239 02240 02241 02242 02243 02244 02245 02246 02247 02248 02249 02250 02251 02252 02253 02254 02255 02256 02257 02258 02259 02260 02261 02262 02263 02264 02265 02266 02267 02268 02269 02270 02271 02272 02273 02274 02275 02276 02277 02278 02279 02280 02281 02282 02283 02284 02285 02286 02287 02288 02289 02290 02291 02292 02293 02294 02295 02296 02297 02298 02299 02300 02301 02302 02303 02304 02305 02306 02307 02308 02309 02310 02311 02312 02313 02314 02315 02316 02317 02318 02319 02320 02321 02322 02323 02324 02325 02326 02327 02328 02329 02330 02331 02332 02333 02334 02335 02336 02337 02338 02339 02340 02341 02342 02343 02344 02345 02346 02347 02348 02349 02350 02351 02352 02353 02354 02355 02356 02357 02358 02359 02360 02361 02362 02363 02364 02365 02366 02367 02368 02369 02370 02371 02372 02373 02374 02375 02376 02377 02378 02379 02380 02381 02382 02383 02384 02385 02386 02387 02388 02389 02390 02391 02392 02393 02394 02395 02396 02397 02398 02399 02400 02401 02402 02403 02404 02405 02406 02407 02408 02409 02410 02411 02412 02413 02414 02415 02416 02417 02418 02419 02420 02421 02422 02423 02424 02425 02426 02427 02428 02429 02430 02431 02432 02433 02434 02435 02436 02437 02438 02439 02440 02441 02442 02443 02444 02445 02446 02447 02448 02449 02450 02451 02452 02453 02454 02455 02456 02457 02458 02459 02460 02461 02462 02463 02464 02465 02466 02467 02468 02469 02470 02471 02472 02473 02474 02475 02476 02477 02478 02479 02480 02481 02482 02483 02484 02485 02486 02487 02488 02489 02490 02491 02492 02493 02494 02495 02496 02497 02498 02499 02500 02501 02502 02503 02504 02505 02506 02507 02508 02509 02510 02511 02512 02513 02514 02515 02516 02517 02518 02519 02520 02521 02522 02523 02524 02525 02526 02527 02528 02529 02530 02531 02532 02533 02534 02535 02536 02537 02538 02539 02540 02541 02542 02543 02544 02545 02546 02547 02548 02549 02550 02551 02552 02553 02554 02555 02556 02557 02558 02559 02560 02561 02562 02563 02564 02565 02566 02567 02568 02569 02570 02571 02572 02573 02574 02575 02576 02577 02578 02579 02580 02581 02582 02583 02584 02585 02586 02587 02588 02589 02590 02591 |
class xPawn extends UnrealPawn config(User) dependsOn(xUtil) dependsOn(xPawnSoundGroup) dependsOn(xPawnGibGroup); #exec OBJ LOAD FILE=GameSounds.uax #exec OBJ LOAD FILE=PlayerSounds.uax #exec OBJ LOAD FILE=PlayerFootSteps.uax #exec OBJ LOAD FILE=DanFX.utx #exec OBJ LOAD FILE=GeneralAmbience.uax #exec OBJ LOAD FILE=GeneralImpacts.uax #exec OBJ LOAD FILE=DeRez.utx #exec OBJ LOAD FILE=WeaponSounds.uax var int RepeaterDeathCount; var Combo CurrentCombo; var bool bBerserk; var bool bInvis; var bool bOldInvis; var bool bGibbed; var bool bCanDodgeDoubleJump; var bool bCanBoostDodge; var bool bAlreadySetup; var bool bSpawnIn; var bool bSpawnDone; var bool bFrozenBody; var bool bFlaming; var bool bRubbery; var bool bClearWeaponOffsets; // for certain custom player models var(UDamage) Material UDamageWeaponMaterial; // Weapon overlay material var(UDamage) Sound UDamageSound; var UDamageTimer UDamageTimer; var float UDamageTime; var float LastUDamageSoundTime; var Material InvisMaterial; var(Shield) float ShieldStrengthMax; // max strength var float SmallShieldStrength; // for preventing shieldstacking var(Shield) Material ShieldHitMat; var(Shield) float ShieldHitMatTime; var class<SpeciesType> Species; var(Sounds) float GruntVolume; var(Sounds) float FootstepVolume; var transient int SimHitFxTicker; var(Gib) class<xPawnGibGroup> GibGroupClass; var(Gib) int GibCountCalf; var(Gib) int GibCountForearm; var(Gib) int GibCountHead; var(Gib) int GibCountTorso; var(Gib) int GibCountUpperArm; var float MinTimeBetweenPainSounds; var localized string HeadShotMessage; // Common sounds var(Sounds) Sound SoundFootsteps[11]; // Indexed by ESurfaceTypes (sorry about the literal). var(Sounds) class<xPawnSoundGroup> SoundGroupClass; var class<Actor> TeleportFXClass; var class<Actor> TransEffects[2]; var xWeaponAttachment WeaponAttachment; var ShadowProjector PlayerShadow; var int MultiJumpRemaining; var int MaxMultiJump; var int MultiJumpBoost; // depends on the tolerance (100) var name WallDodgeAnims[4]; var name IdleHeavyAnim; var name IdleRifleAnim; var name FireHeavyRapidAnim; var name FireHeavyBurstAnim; var name FireRifleRapidAnim; var name FireRifleBurstAnim; var name FireRootBone; var enum EFireAnimState { FS_None, FS_PlayOnce, FS_Looping, FS_Ready } FireState; var Mesh SkeletonMesh; var bool bSkeletized; var bool bDeRes; var float DeResTime; var Emitter DeResFX; var Material DeResMat0, DeResMat1; var(DeRes) InterpCurve DeResLiftVel; // speed (over time) at which body rises var(DeRes) InterpCurve DeResLiftSoftness; // vertical 'sprinyness' (over time) of bone lifters var(DeRes) float DeResGravScale; // reduce gravity on corpse during de-res var(DeRes) float DeResLateralFriction; // sideways friction while lifting var(Karma) float RagdollLifeSpan; // MAXIMUM time the ragdoll will be around. De-res's early if it comes to rest. var(Karma) float RagInvInertia; // Use to work out how much 'spin' ragdoll gets on death. var(Karma) float RagDeathVel; // How fast ragdoll moves upon death var(Karma) float RagShootStrength; // How much effect shooting ragdolls has. Be careful! var(Karma) float RagSpinScale; // Increase propensity to spin around Z (up). var(Karma) float RagDeathUpKick; // Amount of upwards kick ragdolls get when they die var(Karma) float RagGravScale; var(Karma) material RagConvulseMaterial; // Ragdoll impact sounds. var(Karma) array<sound> RagImpactSounds; var(Karma) float RagImpactSoundInterval; var(Karma) float RagImpactVolume; var transient float RagLastSoundTime; var string RagdollOverride; // translocate effect var class<Actor> TransOutEffect[2]; var Controller OldController; var Material RealSkins[4]; var class<TeamVoicePack> VoiceClass; var(AI) globalconfig string PlacedCharacterName; var globalconfig string PlacedFemaleCharacterName; var byte TeamSkin; // what team's skin is currently set replication { reliable if( Role==ROLE_Authority ) bInvis; reliable if( bNetOwner && (Role==ROLE_Authority) ) bBerserk, MaxMultiJump, MultiJumpBoost, bCanDodgeDoubleJump, bCanBoostDodge; reliable if( Role==ROLE_Authority ) ClientSetUDamageTime; } simulated function Fire( optional float F ) { if ( (Weapon != None) && (Weapon.bBerserk != bBerserk) ) { if ( bBerserk ) Weapon.StartBerserk(); else Weapon.StopBerserk(); } Super.Fire(F); } simulated function AltFire( optional float F ) { if ( (Weapon != None) && (Weapon.bBerserk != bBerserk) ) { if ( bBerserk ) Weapon.StartBerserk(); else Weapon.StopBerserk(); } Super.AltFire(F); } simulated function PlayWaiting() {} function RosterEntry GetPlacedRoster() { PlayerReplicationInfo.CharacterName = PlacedCharacterName; return class'xRosterEntry'.static.CreateRosterEntryCharacter(PlacedCharacterName); } function PossessedBy(Controller C) { Super.PossessedBy(C); if ( Controller != None ) OldController = Controller; } // return true if was controlled by a Player (AI or human) simulated function bool WasPlayerPawn() { return ( (OldController != None) && OldController.bIsPlayer ); } function DoTranslocateOut(Vector PrevLocation) { if ( (PlayerReplicationInfo == None) || (PlayerReplicationInfo.Team == None) || (PlayerReplicationInfo.Team.TeamIndex == 0) ) Spawn(TransOutEffect[0], self,, PrevLocation, rotator(Location - PrevLocation)); else Spawn(TransOutEffect[1], self,, PrevLocation, rotator(Location - PrevLocation)); } // Set up default blending parameters and pose. Ensures the mesh doesn't have only a T-pose whenever it first springs into view. simulated function AssignInitialPose() { if ( DrivenVehicle != None ) { if ( HasAnim(DrivenVehicle.DriveAnim) ) LoopAnim(DrivenVehicle.DriveAnim,, 0.1); else LoopAnim('Vehicle_Driving',, 0.1); } else TweenAnim(MovementAnims[0],0.0); AnimBlendParams(1, 1.0, 0.2, 0.2, 'Bip01 Spine1'); BoneRefresh(); } simulated function Destroyed() { if( PlayerShadow != None ) PlayerShadow.Destroy(); if( DeResFX != None ) { DeResFX.Emitters[0].SkeletalMeshActor = None; DeResFX.Kill(); } Super.Destroyed(); } simulated function RemoveFlamingEffects() { local int i; if( Level.NetMode == NM_DedicatedServer ) return; for( i=0; i<Attached.length; i++ ) { if( Attached[i].IsA('xEmitter') && !Attached[i].IsA('BloodJet')) { xEmitter(Attached[i]).mRegen = false; } } } simulated event PhysicsVolumeChange( PhysicsVolume NewVolume ) { if ( NewVolume.bWaterVolume ) RemoveFlamingEffects(); Super.PhysicsVolumeChange(NewVolume); } /* return a value (typically 0 to 1) adjusting pawn's perceived strength if under some special influence (like berserk) */ function float AdjustedStrength() { if ( bBerserk ) return 1.0; return 0; } function DeactivateSpawnProtection() { if ( bSpawnDone ) return; bSpawnDone = true; if ( Level.TimeSeconds - SpawnTime < DeathMatch(Level.Game).SpawnProtectionTime ) { bSpawnIn = true; if ( OverlayMaterial == ShieldHitMat ) SetOverlayMaterial(None,0,true); SpawnTime = Level.TimeSeconds - DeathMatch(Level.Game).SpawnProtectionTime - 1; } } function PlayTeleportEffect( bool bOut, bool bSound) { if ( !bSpawnIn && (Level.TimeSeconds - SpawnTime < DeathMatch(Level.Game).SpawnProtectionTime) ) { bSpawnIn = true; SetOverlayMaterial( ShieldHitMat, DeathMatch(Level.Game).SpawnProtectionTime, false ); if ( (PlayerReplicationInfo == None) || (PlayerReplicationInfo.Team == None) || (PlayerReplicationInfo.Team.TeamIndex == 0) ) Spawn(TransEffects[0],,,Location + CollisionHeight * vect(0,0,0.75)); else Spawn(TransEffects[1],,,Location + CollisionHeight * vect(0,0,0.75)); } else if ( bOut ) DoTranslocateOut(Location); else if ( (PlayerReplicationInfo == None) || (PlayerReplicationInfo.Team == None) || (PlayerReplicationInfo.Team.TeamIndex == 0) ) Spawn(TransEffects[0],self,,Location + CollisionHeight * vect(0,0,0.75)); else Spawn(TransEffects[1],self,,Location + CollisionHeight * vect(0,0,0.75)); Super.PlayTeleportEffect( bOut, bSound ); } function PlayMoverHitSound() { PlaySound(SoundGroupClass.static.GetHitSound(), SLOT_Interact); } function PlayDyingSound() { // Dont play dying sound if a skeleton. Tricky without vocal chords. if ( bSkeletized ) return; if ( bGibbed ) { PlaySound(GibGroupClass.static.GibSound(), SLOT_Pain,3.5*TransientSoundVolume,true,500); return; } if ( HeadVolume.bWaterVolume ) { PlaySound(GetSound(EST_Drown), SLOT_Pain,2.5*TransientSoundVolume,true,500); return; } PlaySound(SoundGroupClass.static.GetDeathSound(), SLOT_Pain,2.5*TransientSoundVolume, true,500); } function Gasp() { if ( Role != ROLE_Authority ) return; if ( BreathTime < 2 ) PlaySound(GetSound(EST_Gasp), SLOT_Interact); else PlaySound(GetSound(EST_BreatheAgain), SLOT_Interact); } function Controller GetKillerController() { if ( Controller != None ) return Controller; if ( OldController != None ) return OldController; return None; } simulated function int GetTeamNum() { if ( Controller != None ) return Controller.GetTeamNum(); if ( (DrivenVehicle != None) && (DrivenVehicle.Controller != None) ) return DrivenVehicle.Controller.GetTeamNum(); if ( OldController != None ) return OldController.GetTeamNum(); if ( (PlayerReplicationInfo == None) || (PlayerReplicationInfo.Team == None) ) return 255; return PlayerReplicationInfo.Team.TeamIndex; } function TeamInfo GetTeam() { if ( PlayerReplicationInfo != None ) return PlayerReplicationInfo.Team; if ( (DrivenVehicle != None) && (DrivenVehicle.PlayerReplicationInfo != None) ) return DrivenVehicle.PlayerReplicationInfo.Team; if ( (OldController != None) && (OldController.PlayerReplicationInfo != None) ) return OldController.PlayerReplicationInfo.Team; return None; } function RemovePowerups() { if (CurrentCombo != None) { CurrentCombo.Destroy(); if ( Controller != None ) Controller.Adrenaline = 0; } if ( UDamageTimer != None ) { UDamageTimer.Destroy(); DisableUDamage(); } Super.RemovePowerups(); } simulated function TickFX(float DeltaTime) { local int i,NumSkins; if ( SimHitFxTicker != HitFxTicker ) { ProcessHitFX(); } if(bInvis && !bOldInvis) // Going invisible { if ( Left(string(Skins[0]),21) ~= "UT2004PlayerSkins.Xan" ) Skins[2] = Material(DynamicLoadObject("UT2004PlayerSkins.XanMk3V2_abdomen", class'Material')); // Save the 'real' non-invis skin NumSkins = Clamp(Skins.Length,2,4); for ( i=0; i<NumSkins; i++ ) { RealSkins[i] = Skins[i]; Skins[i] = InvisMaterial; } // Remove/disallow projectors on invisible people Projectors.Remove(0, Projectors.Length); bAcceptsProjectors = false; // Invisible - no shadow if(PlayerShadow != None) PlayerShadow.bShadowActive = false; // No giveaway flames either RemoveFlamingEffects(); } else if(!bInvis && bOldInvis) // Going visible { NumSkins = Clamp(Skins.Length,2,4); for ( i=0; i<NumSkins; i++ ) Skins[i] = RealSkins[i]; bAcceptsProjectors = Default.bAcceptsProjectors; if(PlayerShadow != None) PlayerShadow.bShadowActive = true; } bOldInvis = bInvis; bDrawCorona = ( !bNoCoronas && !bInvis && (Level.NetMode != NM_DedicatedServer) && !bPlayedDeath && (Level.GRI != None) && Level.GRI.bAllowPlayerLights && (PlayerReplicationInfo != None) ); if ( bDrawCorona && (PlayerReplicationInfo.Team != None) ) { if ( PlayerReplicationInfo.Team.TeamIndex == 0 ) Texture = Texture'RedMarker_t'; else Texture = Texture'BlueMarker_t'; } } simulated function StartDriving(Vehicle V) { local int i; Super.StartDriving(V); if( PlayerShadow != None ) PlayerShadow.bShadowActive = false; if ( WeaponAttachment != None ) WeaponAttachment.Hide(true); //hack for sticky grenades for (i = 0; i < Attached.Length; i++) if (Projectile(Attached[i]) != None) Attached[i].SetBase(None); } simulated function StopDriving(Vehicle V) { Super.StopDriving(V); if( PlayerShadow != None ) PlayerShadow.bShadowActive = !bInvis; if ( WeaponAttachment != None ) WeaponAttachment.Hide(false); } simulated function AttachEffect( class<xEmitter> EmitterClass, Name BoneName, Vector Location, Rotator Rotation ) { local Actor a; local int i; if( bSkeletized || (BoneName == 'None') ) return; for( i = 0; i < Attached.Length; i++ ) { if( Attached[i] == None ) continue; if( Attached[i].AttachmentBone != BoneName ) continue; if( ClassIsChildOf( EmitterClass, Attached[i].Class ) ) return; } a = Spawn( EmitterClass,,, Location, Rotation ); if( !AttachToBone( a, BoneName ) ) { log( "Couldn't attach "$EmitterClass$" to "$BoneName, 'Error' ); a.Destroy(); return; } for( i = 0; i < Attached.length; i++ ) { if( Attached[i] == a ) break; } a.SetRelativeRotation( Rotation ); } simulated event SetHeadScale(float NewScale) { HeadScale = NewScale; SetBoneScale(4,HeadScale,'head'); } simulated function SpawnGiblet( class<Gib> GibClass, Vector Location, Rotator Rotation, float GibPerterbation ) { local Gib Giblet; local Vector Direction, Dummy; if( (GibClass == None) || class'GameInfo'.static.UseLowGore() ) return; Instigator = self; Giblet = Spawn( GibClass,,, Location, Rotation ); if( Giblet == None ) return; Giblet.bFlaming = bFlaming; Giblet.SpawnTrail(); GibPerterbation *= 32768.0; Rotation.Pitch += ( FRand() * 2.0 * GibPerterbation ) - GibPerterbation; Rotation.Yaw += ( FRand() * 2.0 * GibPerterbation ) - GibPerterbation; Rotation.Roll += ( FRand() * 2.0 * GibPerterbation ) - GibPerterbation; GetAxes( Rotation, Dummy, Dummy, Direction ); Giblet.Velocity = Velocity + Normal(Direction) * (250 + 260 * FRand()); Giblet.LifeSpan = Giblet.LifeSpan + 2 * FRand() - 1; } simulated function ProcessHitFX() { local Coords boneCoords; local class<xEmitter> HitEffects[4]; local int i,j; local float GibPerterbation; if( (Level.NetMode == NM_DedicatedServer) || bSkeletized || (Mesh == SkeletonMesh) ) { SimHitFxTicker = HitFxTicker; return; } for ( SimHitFxTicker = SimHitFxTicker; SimHitFxTicker != HitFxTicker; SimHitFxTicker = (SimHitFxTicker + 1) % ArrayCount(HitFX) ) { j++; if ( j > 30 ) { SimHitFxTicker = HitFxTicker; return; } if( (HitFX[SimHitFxTicker].damtype == None) || (Level.bDropDetail && (Level.TimeSeconds - LastRenderTime > 3) && !IsHumanControlled()) ) continue; boneCoords = GetBoneCoords( HitFX[SimHitFxTicker].bone ); if ( !Level.bDropDetail && !bSkeletized ) { AttachEffect( GibGroupClass.static.GetBloodEmitClass(), HitFX[SimHitFxTicker].bone, boneCoords.Origin, HitFX[SimHitFxTicker].rotDir ); HitFX[SimHitFxTicker].damtype.static.GetHitEffects( HitEffects, Health ); if( !PhysicsVolume.bWaterVolume ) // don't attach effects under water { for( i = 0; i < ArrayCount(HitEffects); i++ ) { if( HitEffects[i] == None ) continue; AttachEffect( HitEffects[i], HitFX[SimHitFxTicker].bone, boneCoords.Origin, HitFX[SimHitFxTicker].rotDir ); } } } if ( class'GameInfo'.static.UseLowGore() ) HitFX[SimHitFxTicker].bSever = false; if( HitFX[SimHitFxTicker].bSever ) { GibPerterbation = HitFX[SimHitFxTicker].damtype.default.GibPerterbation; bFlaming = HitFX[SimHitFxTicker].DamType.Default.bFlaming; switch( HitFX[SimHitFxTicker].bone ) { case 'lthigh': case 'rthigh': SpawnGiblet( GetGibClass(EGT_Calf), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); SpawnGiblet( GetGibClass(EGT_Calf), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); GibCountCalf -= 2; break; case 'rfarm': case 'lfarm': SpawnGiblet( GetGibClass(EGT_UpperArm), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); SpawnGiblet( GetGibClass(EGT_Forearm), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); GibCountForearm--; GibCountUpperArm--; break; case 'head': SpawnGiblet( GetGibClass(EGT_Head), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); GibCountTorso--; break; case 'spine': case 'none': SpawnGiblet( GetGibClass(EGT_Torso), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); GibCountTorso--; bGibbed = true; while( GibCountHead-- > 0 ) SpawnGiblet( GetGibClass(EGT_Head), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); while( GibCountForearm-- > 0 ) SpawnGiblet( GetGibClass(EGT_UpperArm), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); while( GibCountUpperArm-- > 0 ) SpawnGiblet( GetGibClass(EGT_Forearm), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); if ( !bFlaming && !Level.bDropDetail && (Level.DetailMode != DM_Low) && PlayerCanSeeMe() ) { // extra gibs!!! GibPerterbation = FMin(1.0, 1.5 * GibPerterbation); SpawnGiblet( GetGibClass(EGT_Calf), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); SpawnGiblet( GetGibClass(EGT_Calf), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); SpawnGiblet( GetGibClass(EGT_UpperArm), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); SpawnGiblet( GetGibClass(EGT_Forearm), boneCoords.Origin, HitFX[SimHitFxTicker].rotDir, GibPerterbation ); } break; } HideBone(HitFX[SimHitFxTicker].bone); } } } simulated function HideBone(name boneName) { local int BoneScaleSlot; if( boneName == 'lthigh' ) boneScaleSlot = 0; else if ( boneName == 'rthigh' ) boneScaleSlot = 1; else if( boneName == 'rfarm' ) boneScaleSlot = 2; else if ( boneName == 'lfarm' ) boneScaleSlot = 3; else if ( boneName == 'head' ) boneScaleSlot = 4; else if ( boneName == 'spine' ) boneScaleSlot = 5; SetBoneScale(BoneScaleSlot, 0.0, BoneName); } function CalcHitLoc( Vector hitLoc, Vector hitRay, out Name boneName, out float dist ) { boneName = GetClosestBone( hitLoc, hitRay, dist ); } function DoDamageFX( Name boneName, int Damage, class<DamageType> DamageType, Rotator r ) { local float DismemberProbability; local bool bExtraGib; if ( FRand() > 0.3f || Damage > 30 || Health <= 0 ) { HitFX[HitFxTicker].damtype = DamageType; if( Health <= 0 ) { switch( boneName ) { case 'lfoot': boneName = 'lthigh'; break; case 'rfoot': boneName = 'rthigh'; break; case 'rhand': boneName = 'rfarm'; break; case 'lhand': boneName = 'lfarm'; break; case 'rshoulder': case 'lshoulder': boneName = 'spine'; break; } if( DamageType.default.bAlwaysSevers || (Damage == 1000) ) { HitFX[HitFxTicker].bSever = true; if ( boneName == 'None' ) { boneName = 'spine'; bExtraGib = true; } } else if( (Damage*DamageType.Default.GibModifier > 50+120*FRand()) && (Damage + Health > 0) ) // total gib prob { HitFX[HitFxTicker].bSever = true; boneName = 'spine'; bExtraGib = true; } else { DismemberProbability = Abs( (Health - Damage*DamageType.Default.GibModifier) / 130.0f ); switch( boneName ) { case 'lthigh': case 'rthigh': case 'rfarm': case 'lfarm': case 'head': if( FRand() < DismemberProbability ) HitFX[HitFxTicker].bSever = true; break; case 'None': boneName = 'spine'; case 'spine': if( FRand() < DismemberProbability * 0.3 ) { HitFX[HitFxTicker].bSever = true; if ( FRand() < 0.65 ) bExtraGib = true; } break; } } } if ( DamageType.default.bNeverSevers || class'GameInfo'.static.UseLowGore() || (Level.Game != None && Level.Game.PreventSever(self, boneName, Damage, DamageType)) ) { HitFX[HitFxTicker].bSever = false; bExtraGib = false; } HitFX[HitFxTicker].bone = boneName; HitFX[HitFxTicker].rotDir = r; HitFxTicker = HitFxTicker + 1; if( HitFxTicker > ArrayCount(HitFX)-1 ) HitFxTicker = 0; if ( bExtraGib ) { if ( FRand() < 0.25 ) { DoDamageFX('lthigh',1000,DamageType,r); DoDamageFX('rthigh',1000,DamageType,r); } else if ( FRand() < 0.35 ) DoDamageFX('lthigh',1000,DamageType,r); else if ( FRand() < 0.5 ) DoDamageFX('rthigh',1000,DamageType,r); } } } simulated function StartDeRes() { local KarmaParamsSkel skelParams; local int i; if( Level.NetMode == NM_DedicatedServer ) return; AmbientGlow=254; MaxLights=0; DeResFX = Spawn(class'DeResPart', self, , Location); if ( DeResFX != None ) { DeResFX.Emitters[0].SkeletalMeshActor = self; DeResFX.SetBase(self); } Skins[0] = DeResMat0; Skins[1] = DeResMat1; if ( Skins.Length > 2 ) { for ( i=2; i<Skins.Length; i++ ) Skins[i] = DeResMat0; } if( Physics == PHYS_KarmaRagdoll ) { // Attach bone lifter to raise body KAddBoneLifter('bip01 Spine', DeResLiftVel, DeResLateralFriction, DeResLiftSoftness); KAddBoneLifter('bip01 Spine2', DeResLiftVel, DeResLateralFriction, DeResLiftSoftness); // Turn off gravity while de-res-ing KSetActorGravScale(DeResGravScale); // Turn off collision with the world for the ragdoll. KSetBlockKarma(false); // Turn off convulsions during de-res skelParams = KarmaParamsSkel(KParams); skelParams.bKDoConvulsions = false; } AmbientSound = Sound'GeneralAmbience.Texture19'; SoundRadius = 40.0; // Turn off collision when we de-res (avoids rockets etc. hitting corpse!) SetCollision(false, false, false); // Remove/disallow projectors Projectors.Remove(0, Projectors.Length); bAcceptsProjectors = false; // Remove shadow if(PlayerShadow != None) PlayerShadow.bShadowActive = false; // Remove flames RemoveFlamingEffects(); // Turn off any overlays SetOverlayMaterial(None, 0.0f, true); bDeRes = true; } simulated function SetOverlayMaterial( Material mat, float time, bool bOverride ) { if ( Level.bDropDetail || Level.DetailMode == DM_Low ) time *= 0.75; Super.SetOverlayMaterial(mat,time,bOverride); } simulated function TickDeRes(float DeltaTime) { if(LifeSpan < 3.0) { AmbientGlow = BYTE(254.0 * (LifeSpan / 3.0)); // Scale down over time. //ScaleGlow = 1.0 * (LifeSpan / 3.0); // Scale down over time. //Log("SG:"$ScaleGlow$" AG:"$AmbientGlow); } } simulated function Tick(float DeltaTime) { if ( Level.NetMode == NM_DedicatedServer ) return; if ( Controller != None ) OldController = Controller; TickFX(DeltaTime); if ( bDeRes ) TickDeRes(DeltaTime); } simulated function PostBeginPlay() { Super.PostBeginPlay(); AssignInitialPose(); if(bActorShadows && bPlayerShadows && (Level.NetMode != NM_DedicatedServer)) { PlayerShadow = Spawn(class'ShadowProjector',Self,'',Location); PlayerShadow.ShadowActor = self; PlayerShadow.bBlobShadow = bBlobShadow; PlayerShadow.LightDirection = Normal(vect(1,1,3)); PlayerShadow.LightDistance = 320; PlayerShadow.MaxTraceDistance = 350; PlayerShadow.InitShadow(); } } simulated function PostNetBeginPlay() { Super.PostNetBeginPlay(); MultiJumpRemaining = MaxMultiJump; bCanDoubleJump = CanMultiJump(); } function int ShieldAbsorb( int dam ) { local float Interval, damage, Remaining; damage = dam; if ( ShieldStrength == 0 ) { return damage; } SetOverlayMaterial( ShieldHitMat, ShieldHitMatTime, false ); PlaySound(sound'WeaponSounds.ArmorHit', SLOT_Pain,2*TransientSoundVolume,,400); if ( ShieldStrength > 100 ) { Interval = ShieldStrength - 100; if ( Interval >= damage ) { ShieldStrength -= damage; return 0; } else { ShieldStrength = 100; damage -= Interval; } } if ( ShieldStrength > SmallShieldStrength ) { Interval = ShieldStrength - SmallShieldStrength; if ( Interval >= 0.75 * damage ) { ShieldStrength -= 0.75 * damage; if ( ShieldStrength < SmallShieldStrength ) SmallShieldStrength = ShieldStrength; return (0.25 * Damage); } else { ShieldStrength = SmallShieldStrength; damage -= Interval; Remaining = 0.33 * Interval; if ( Remaining <= damage ) return damage; damage -= Remaining; } } if ( ShieldStrength >= 0.5 * damage ) { ShieldStrength -= 0.5 * damage; SmallShieldStrength = ShieldStrength; return Remaining + (0.5 * damage); } else { damage -= ShieldStrength; ShieldStrength = 0; SmallShieldStrength = 0; } return damage + Remaining; } function PlayHit(float Damage, Pawn InstigatedBy, vector HitLocation, class<DamageType> damageType, vector Momentum) { local Vector HitNormal; local Vector HitRay; local Name HitBone; local float HitBoneDist; local PlayerController PC; local bool bShowEffects, bRecentHit; local BloodSpurt BloodHit; bRecentHit = Level.TimeSeconds - LastPainTime < 0.5; Super.PlayHit(Damage,InstigatedBy,HitLocation,DamageType,Momentum); if ( Damage <= 0 ) return; PC = PlayerController(Controller); bShowEffects = ( (Level.NetMode != NM_Standalone) || (Level.TimeSeconds - LastRenderTime < 2.5) || ((InstigatedBy != None) && (PlayerController(InstigatedBy.Controller) != None)) || (PC != None) ); if ( !bShowEffects ) return; HitRay = vect(0,0,0); if( InstigatedBy != None ) HitRay = Normal(HitLocation-(InstigatedBy.Location+(vect(0,0,1)*InstigatedBy.EyeHeight))); if( DamageType.default.bLocationalHit ) CalcHitLoc( HitLocation, HitRay, HitBone, HitBoneDist ); else { HitLocation = Location; HitBone = 'None'; HitBoneDist = 0.0f; } if( DamageType.default.bAlwaysSevers && DamageType.default.bSpecial ) HitBone = 'head'; if( InstigatedBy != None ) HitNormal = Normal( Normal(InstigatedBy.Location-HitLocation) + VRand() * 0.2 + vect(0,0,2.8) ); else HitNormal = Normal( Vect(0,0,1) + VRand() * 0.2 + vect(0,0,2.8) ); if ( DamageType.Default.bCausesBlood ) { if ( class'GameInfo'.static.UseLowGore() ) { if ( class'GameInfo'.static.NoBlood() ) BloodHit = BloodSpurt(Spawn( GibGroupClass.default.NoBloodHitClass,InstigatedBy,, HitLocation )); else BloodHit = BloodSpurt(Spawn( GibGroupClass.default.LowGoreBloodHitClass,InstigatedBy,, HitLocation )); } else BloodHit = BloodSpurt(Spawn(GibGroupClass.default.BloodHitClass,InstigatedBy,, HitLocation, Rotator(HitNormal))); if ( BloodHit != None ) { BloodHit.bMustShow = !bRecentHit; if ( Momentum != vect(0,0,0) ) BloodHit.HitDir = Momentum; else { if ( InstigatedBy != None ) BloodHit.HitDir = Location - InstigatedBy.Location; else BloodHit.HitDir = Location - HitLocation; BloodHit.HitDir.Z = 0; } } } // hack for flak cannon gibbing if ( (DamageType.name == 'DamTypeFlakChunk') && (Health < 0) && (InstigatedBy != None) && (VSize(InstigatedBy.Location - Location) < 350) ) DoDamageFX( HitBone, 8*Damage, DamageType, Rotator(HitNormal) ); else DoDamageFX( HitBone, Damage, DamageType, Rotator(HitNormal) ); if (DamageType.default.DamageOverlayMaterial != None && Damage > 0 ) // additional check in case shield absorbed SetOverlayMaterial( DamageType.default.DamageOverlayMaterial, DamageType.default.DamageOverlayTime, false ); } function bool CheckReflect( Vector HitLocation, out Vector RefNormal, int Damage ) { if (Weapon != None) return Weapon.CheckReflect( HitLocation, RefNormal, Damage ); else return false; } function name GetWeaponBoneFor(Inventory I) { return 'righthand'; } function name GetOffhandBoneFor(Inventory I) { return 'bip01 l hand'; } event Landed(vector HitNormal) { super.Landed( HitNormal ); MultiJumpRemaining = MaxMultiJump; if ( (Health > 0) && !bHidden && (Level.TimeSeconds - SplashTime > 0.25) ) PlayOwnedSound(GetSound(EST_Land), SLOT_Interact, FMin(1,-0.3 * Velocity.Z/JumpZ)); } // ----- animation ----- // simulated function name GetAnimSequence() { local name anim; local float frame, rate; GetAnimParams(0, anim, frame, rate); return anim; } simulated function PlayDoubleJump() { local name Anim; Anim = DoubleJumpAnims[Get4WayDirection()]; if ( PlayAnim(Anim, 1.0, 0.1) ) bWaitForAnim = true; AnimAction = Anim; } simulated function bool FindValidTaunt( out name Sequence ) { local int i,j; for( i=0; i<TauntAnims.Length; i++ ) { if( Sequence == TauntAnims[i] ) return true; } // see if a valid alias exists j = class'SpeciesType'.static.GetOffsetForSequence(Sequence); if ( (j < 0) || (j >= TauntAnims.Length) ) return false; Sequence = TauntAnims[j]; return (Sequence != '' ); } simulated event SetAnimAction(name NewAction) { if (!bWaitForAnim) { AnimAction = NewAction; if ( AnimAction == 'Weapon_Switch' ) { AnimBlendParams(1, 1.0, 0.0, 0.2, FireRootBone); PlayAnim(NewAction,, 0.0, 1); } else if ( ((Physics == PHYS_None)|| ((Level.Game != None) && Level.Game.IsInState('MatchOver'))) && (DrivenVehicle == None) ) { PlayAnim(AnimAction,,0.1); AnimBlendToAlpha(1,0.0,0.05); } else if ( (DrivenVehicle != None) || (Physics == PHYS_Falling) || ((Physics == PHYS_Walking) && (Velocity.Z != 0)) ) { if ( CheckTauntValid(AnimAction) ) { if (FireState == FS_None || FireState == FS_Ready) { AnimBlendParams(1, 1.0, 0.0, 0.2, FireRootBone); PlayAnim(NewAction,, 0.1, 1); FireState = FS_Ready; } } else if ( PlayAnim(AnimAction) ) { if ( Physics != PHYS_None ) bWaitForAnim = true; } else AnimAction = ''; } else if (bIsIdle && !bIsCrouched && (Bot(Controller) == None) ) // standing taunt { PlayAnim(AnimAction,,0.1); AnimBlendToAlpha(1,0.0,0.05); } else // running taunt { if (FireState == FS_None || FireState == FS_Ready) { AnimBlendParams(1, 1.0, 0.0, 0.2, FireRootBone); PlayAnim(NewAction,, 0.1, 1); FireState = FS_Ready; } } } } simulated function StartFiring(bool bHeavy, bool bRapid) { local name FireAnim; if ( HasUDamage() && (Level.TimeSeconds - LastUDamageSoundTime > 0.25) ) { LastUDamageSoundTime = Level.TimeSeconds; PlaySound(UDamageSound, SLOT_None, 1.5*TransientSoundVolume,,700); } if (Physics == PHYS_Swimming) return; if (bHeavy) { if (bRapid) FireAnim = FireHeavyRapidAnim; else FireAnim = FireHeavyBurstAnim; } else { if (bRapid) FireAnim = FireRifleRapidAnim; else FireAnim = FireRifleBurstAnim; } AnimBlendParams(1, 1.0, 0.0, 0.2, FireRootBone); if (bRapid) { if (FireState != FS_Looping) { LoopAnim(FireAnim,, 0.0, 1); FireState = FS_Looping; } } else { PlayAnim(FireAnim,, 0.0, 1); FireState = FS_PlayOnce; } IdleTime = Level.TimeSeconds; } simulated function StopFiring() { if (FireState == FS_Looping) { FireState = FS_PlayOnce; } IdleTime = Level.TimeSeconds; } simulated function AnimEnd(int Channel) { if (Channel == 1) { if (FireState == FS_Ready) { AnimBlendToAlpha(1, 0.0, 0.12); FireState = FS_None; } else if (FireState == FS_PlayOnce) { PlayAnim(IdleWeaponAnim,, 0.2, 1); FireState = FS_Ready; IdleTime = Level.TimeSeconds; } else AnimBlendToAlpha(1, 0.0, 0.12); } else if ( bKeepTaunting && (Channel == 0) ) PlayVictoryAnimation(); } function PlayWeaponSwitch(Weapon NewWeapon) { SetAnimAction('Weapon_Switch'); } function PlayVictoryAnimation() { local int tauntNum; // First 4 taunts are 'order' anims. Don't pick them. tauntNum = Rand(TauntAnims.Length - 3); SetAnimAction(TauntAnims[3 + tauntNum]); } simulated function SetWeaponAttachment(xWeaponAttachment NewAtt) { WeaponAttachment = NewAtt; if (WeaponAttachment.bHeavy) IdleWeaponAnim = IdleHeavyAnim; else IdleWeaponAnim = IdleRifleAnim; } // Event called whenever ragdoll convulses event KSkelConvulse() { if(RagConvulseMaterial != None) SetOverlayMaterial(RagConvulseMaterial, 0.4, true); } simulated final function RandSpin(float spinRate) { DesiredRotation = RotRand(true); RotationRate.Yaw = spinRate * 2 *FRand() - spinRate; RotationRate.Pitch = spinRate * 2 *FRand() - spinRate; RotationRate.Roll = spinRate * 2 *FRand() - spinRate; bFixedRotationDir = true; bRotateToDesired = false; } simulated function PlayDying(class<DamageType> DamageType, vector HitLoc) { local float frame, rate; local name seq; local LavaDeath LD; local BodyEffect BE; AmbientSound = None; bCanTeleport = false; // sjs - fix karma going crazy when corpses land on teleporters bReplicateMovement = false; bTearOff = true; bPlayedDeath = true; if (CurrentCombo != None) CurrentCombo.Destroy(); HitDamageType = DamageType; // these are replicated to other clients TakeHitLocation = HitLoc; if ( DamageType != None ) { if ( DamageType.default.bSkeletize ) { SetOverlayMaterial(DamageType.Default.DamageOverlayMaterial, 4.0, true); if (!bSkeletized) { if ( (Level.NetMode != NM_DedicatedServer) && (SkeletonMesh != None) ) { if ( DamageType.default.bLeaveBodyEffect ) { BE = spawn(class'BodyEffect',self); if ( BE != None ) { BE.DamageType = DamageType; BE.HitLoc = HitLoc; bFrozenBody = true; } } GetAnimParams( 0, seq, frame, rate ); LinkMesh(SkeletonMesh, true); Skins.Length = 0; PlayAnim(seq, 0, 0); SetAnimFrame(frame); } if (Physics == PHYS_Walking) Velocity = Vect(0,0,0); TearOffMomentum *= 0.25; bSkeletized = true; if ( (Level.NetMode != NM_DedicatedServer) && (DamageType == class'FellLava') ) { LD = spawn(class'LavaDeath', , , Location + vect(0, 0, 10), Rotation ); if ( LD != None ) LD.SetBase(self); PlaySound( sound'WeaponSounds.BExplosion5', SLOT_None, 1.5*TransientSoundVolume ); } } } else if ( DamageType.Default.DeathOverlayMaterial != None ) SetOverlayMaterial(DamageType.Default.DeathOverlayMaterial, DamageType.default.DeathOverlayTime, true); else if ( (DamageType.Default.DamageOverlayMaterial != None) && (Level.DetailMode != DM_Low) && !Level.bDropDetail ) SetOverlayMaterial(DamageType.Default.DamageOverlayMaterial, 2*DamageType.default.DamageOverlayTime, true); } // stop shooting AnimBlendParams(1, 0.0); FireState = FS_None; LifeSpan = RagdollLifeSpan; GotoState('Dying'); if ( BE != None ) return; PlayDyingAnimation(DamageType, HitLoc); } function PlayDyingAnimation(class<DamageType> DamageType, vector HitLoc) { local vector shotDir, hitLocRel, deathAngVel, shotStrength; local float maxDim; local string RagSkelName; local KarmaParamsSkel skelParams; local bool PlayersRagdoll; local PlayerController pc; if ( Level.NetMode != NM_DedicatedServer ) { // Is this the local player's ragdoll? if(OldController != None) pc = PlayerController(OldController); if( pc != None && pc.ViewTarget == self ) PlayersRagdoll = true; // In low physics detail, if we were not just controlling this pawn, // and it has not been rendered in 3 seconds, just destroy it. if( (Level.PhysicsDetailLevel != PDL_High) && !PlayersRagdoll && (Level.TimeSeconds - LastRenderTime > 3) ) { Destroy(); return; } // Try and obtain a rag-doll setup. Use optional 'override' one out of player record first, then use the species one. if( RagdollOverride != "") RagSkelName = RagdollOverride; else if(Species != None) RagSkelName = Species.static.GetRagSkelName( GetMeshName() ); else Log("xPawn.PlayDying: No Species"); // If we managed to find a name, try and make a rag-doll slot availbale. if( RagSkelName != "" ) { KMakeRagdollAvailable(); } if( KIsRagdollAvailable() && RagSkelName != "" ) { skelParams = KarmaParamsSkel(KParams); skelParams.KSkeleton = RagSkelName; // Stop animation playing. StopAnimating(true); if( DamageType != None ) { if ( DamageType.default.bLeaveBodyEffect ) TearOffMomentum = vect(0,0,0); if( DamageType.default.bKUseOwnDeathVel ) { RagDeathVel = DamageType.default.KDeathVel; RagDeathUpKick = DamageType.default.KDeathUpKick; } } // Set the dude moving in direction he was shot in general shotDir = Normal(TearOffMomentum); shotStrength = RagDeathVel * shotDir; // Calculate angular velocity to impart, based on shot location. hitLocRel = TakeHitLocation - Location; // We scale the hit location out sideways a bit, to get more spin around Z. hitLocRel.X *= RagSpinScale; hitLocRel.Y *= RagSpinScale; // If the tear off momentum was very small for some reason, make up some angular velocity for the pawn if( VSize(TearOffMomentum) < 0.01 ) { //Log("TearOffMomentum magnitude of Zero"); deathAngVel = VRand() * 18000.0; } else { deathAngVel = RagInvInertia * (hitLocRel Cross shotStrength); } // Set initial angular and linear velocity for ragdoll. // Scale horizontal velocity for characters - they run really fast! if ( DamageType.Default.bRubbery ) skelParams.KStartLinVel = vect(0,0,0); if ( Damagetype.default.bKUseTearOffMomentum ) skelParams.KStartLinVel = TearOffMomentum + Velocity; else { skelParams.KStartLinVel.X = 0.6 * Velocity.X; skelParams.KStartLinVel.Y = 0.6 * Velocity.Y; skelParams.KStartLinVel.Z = 1.0 * Velocity.Z; skelParams.KStartLinVel += shotStrength; } // If not moving downwards - give extra upward kick if( !DamageType.default.bLeaveBodyEffect && !DamageType.Default.bRubbery && (Velocity.Z > -10) ) skelParams.KStartLinVel.Z += RagDeathUpKick; if ( DamageType.Default.bRubbery ) { Velocity = vect(0,0,0); skelParams.KStartAngVel = vect(0,0,0); } else { skelParams.KStartAngVel = deathAngVel; // Set up deferred shot-bone impulse maxDim = Max(CollisionRadius, CollisionHeight); skelParams.KShotStart = TakeHitLocation - (1 * shotDir); skelParams.KShotEnd = TakeHitLocation + (2*maxDim*shotDir); skelParams.KShotStrength = RagShootStrength; } // If this damage type causes convulsions, turn them on here. if(DamageType != None && DamageType.default.bCauseConvulsions) { RagConvulseMaterial=DamageType.default.DamageOverlayMaterial; skelParams.bKDoConvulsions = true; } // Turn on Karma collision for ragdoll. KSetBlockKarma(true); // Set physics mode to ragdoll. // This doesn't actaully start it straight away, it's deferred to the first tick. SetPhysics(PHYS_KarmaRagdoll); // If viewing this ragdoll, set the flag to indicate that it is 'important' if( PlayersRagdoll ) skelParams.bKImportantRagdoll = true; skelParams.bRubbery = DamageType.Default.bRubbery; bRubbery = DamageType.Default.bRubbery; skelParams.KActorGravScale = RagGravScale; return; } // jag } // non-ragdoll death fallback Velocity += TearOffMomentum; BaseEyeHeight = Default.BaseEyeHeight; SetTwistLook(0, 0); SetInvisibility(0.0); PlayDirectionalDeath(HitLoc); SetPhysics(PHYS_Falling); } simulated function SpawnGibs(Rotator HitRotation, float ChunkPerterbation) { bGibbed = true; PlayDyingSound(); if( GibCountTorso+GibCountHead+GibCountForearm+GibCountUpperArm > 3 ) { if ( class'GameInfo'.static.UseLowGore() ) { if ( !class'GameInfo'.static.NoBlood() ) Spawn( GibGroupClass.default.LowGoreBloodGibClass,,,Location ); } else Spawn( GibGroupClass.default.BloodGibClass,,,Location ); } if ( class'GameInfo'.static.UseLowGore() ) return; SpawnGiblet( GetGibClass(EGT_Torso), Location, HitRotation, ChunkPerterbation ); GibCountTorso--; while( GibCountTorso-- > 0 ) SpawnGiblet( GetGibClass(EGT_Torso), Location, HitRotation, ChunkPerterbation ); while( GibCountHead-- > 0 ) SpawnGiblet( GetGibClass(EGT_Head), Location, HitRotation, ChunkPerterbation ); while( GibCountForearm-- > 0 ) SpawnGiblet( GetGibClass(EGT_UpperArm), Location, HitRotation, ChunkPerterbation ); while( GibCountUpperArm-- > 0 ) SpawnGiblet( GetGibClass(EGT_Forearm), Location, HitRotation, ChunkPerterbation ); } function ClientDying(class<DamageType> DamageType, vector HitLocation) { } function PlayTakeHit(vector HitLocation, int Damage, class<DamageType> DamageType) { PlayDirectionalHit(HitLocation); if( Level.TimeSeconds - LastPainSound < MinTimeBetweenPainSounds ) return; LastPainSound = Level.TimeSeconds; if( HeadVolume.bWaterVolume ) { if( DamageType.IsA('Drowned') ) PlaySound( GetSound(EST_Drown), SLOT_Pain,1.5*TransientSoundVolume ); else PlaySound( GetSound(EST_HitUnderwater), SLOT_Pain,1.5*TransientSoundVolume ); return; } PlaySound(SoundGroupClass.static.GetHitSound(), SLOT_Pain,2*TransientSoundVolume,,200); } // jag // Called when in Ragdoll when we hit something over a certain threshold velocity // Used to play impact sounds. event KImpact(actor other, vector pos, vector impactVel, vector impactNorm) { local int numSounds, soundNum; numSounds = RagImpactSounds.Length; //log("ouch! iv:"$VSize(impactVel)); if(numSounds > 0 && Level.TimeSeconds > RagLastSoundTime + RagImpactSoundInterval) { soundNum = Rand(numSounds); //Log("Play Sound:"$soundNum); PlaySound(RagImpactSounds[soundNum], SLOT_Pain, RagImpactVolume); RagLastSoundTime = Level.TimeSeconds; } } //jag simulated function PlayDirectionalDeath(Vector HitLoc) { local Vector X,Y,Z, Dir; GetAxes(Rotation, X,Y,Z); HitLoc.Z = Location.Z; // random if ( VSize(Velocity) < 10.0 && VSize(Location - HitLoc) < 1.0 ) { Dir = VRand(); } // velocity based else if ( VSize(Velocity) > 0.0 ) { Dir = Normal(Velocity*Vect(1,1,0)); } // hit location based else { Dir = -Normal(Location - HitLoc); } if ( Dir Dot X > 0.7 || Dir == vect(0,0,0)) PlayAnim('DeathB',, 0.2); else if ( Dir Dot X < -0.7 ) PlayAnim('DeathF',, 0.2); else if ( Dir Dot Y > 0 ) PlayAnim('DeathL',, 0.2); else if ( HasAnim('DeathR') ) PlayAnim('DeathR',, 0.2); else PlayAnim('DeathF',, 0.2); } simulated function PlayDirectionalHit(Vector HitLoc) { local Vector X,Y,Z, Dir; if ( DrivenVehicle != None ) return; GetAxes(Rotation, X,Y,Z); HitLoc.Z = Location.Z; // random if ( VSize(Location - HitLoc) < 1.0 ) { Dir = VRand(); } // hit location based else { Dir = -Normal(Location - HitLoc); } if ( Dir Dot X > 0.7 || Dir == vect(0,0,0)) { PlayAnim('HitF',, 0.1); } else if ( Dir Dot X < -0.7 ) { PlayAnim('HitB',, 0.1); } else if ( Dir Dot Y > 0 ) { PlayAnim('HitR',, 0.1); } else { PlayAnim('HitL',, 0.1); } } simulated function FootStepping(int Side) { local int SurfaceNum, i; local actor A; local material FloorMat; local vector HL,HN,Start,End,HitLocation,HitNormal; SurfaceNum = 0; for ( i=0; i<Touching.Length; i++ ) if ( ((PhysicsVolume(Touching[i]) != None) && PhysicsVolume(Touching[i]).bWaterVolume) || (FluidSurfaceInfo(Touching[i]) != None) ) { if ( FRand() < 0.5 ) PlaySound(sound'PlayerSounds.FootStepWater2', SLOT_Interact, FootstepVolume ); else PlaySound(sound'PlayerSounds.FootStepWater1', SLOT_Interact, FootstepVolume ); if ( !Level.bDropDetail && (Level.DetailMode != DM_Low) && (Level.NetMode != NM_DedicatedServer) && !Touching[i].TraceThisActor(HitLocation, HitNormal,Location - CollisionHeight*vect(0,0,1.1), Location) ) Spawn(class'WaterRing',,,HitLocation,rot(16384,0,0)); return; } if ( bIsCrouched || bIsWalking ) return; if ( (Base!=None) && (!Base.IsA('LevelInfo')) && (Base.SurfaceType!=0) ) { SurfaceNum = Base.SurfaceType; } else { Start = Location - Vect(0,0,1)*CollisionHeight; End = Start - Vect(0,0,16); A = Trace(hl,hn,End,Start,false,,FloorMat); if (FloorMat !=None) SurfaceNum = FloorMat.SurfaceType; } PlaySound(SoundFootsteps[SurfaceNum], SLOT_Interact, FootstepVolume,,400 ); } simulated function PlayFootStepLeft() { PlayFootStep(-1); } simulated function PlayFootStepRight() { PlayFootStep(1); } // ----- shield control ----- // function float GetShieldStrengthMax() { return ShieldStrengthMax; } function float GetShieldStrength() { // could return max if it's active right now, which make it unable to be recharged while it's on... return ShieldStrength; } function int CanUseShield(int ShieldAmount) { ShieldStrength = Max(ShieldStrength,0); if ( ShieldStrength < ShieldStrengthMax ) { if ( ShieldAmount == 50 ) ShieldAmount = 50 - SmallShieldStrength; return (Min(ShieldStrengthMax, ShieldStrength + ShieldAmount) - ShieldStrength); } return 0; } function bool AddShieldStrength(int ShieldAmount) { local int OldShieldStrength; OldShieldStrength = ShieldStrength; ShieldStrength += CanUseShield(ShieldAmount); if ( ShieldAmount == 50 ) { SmallShieldStrength = 50; if ( ShieldStrength < 50 ) ShieldStrength = 50; } return (ShieldStrength != OldShieldStrength); } function bool InCurrentCombo() { return (CurrentCombo != None); } // used by bots doing combos function DoComboName( string ComboClassName ) { local class<Combo> ComboClass; ComboClass = class<Combo>( DynamicLoadObject( ComboClassName, class'Class' ) ); if ( ComboClass != None ) DoCombo( ComboClass ); else log("WARNING - Couldn't create combo "$ComboClassName); } function DoCombo( class<Combo> ComboClass ) { local int i; if ( ComboClass != None ) { if (CurrentCombo == None) { CurrentCombo = Spawn( ComboClass, self ); // Record stats for using the combo UnrealMPGameInfo(Level.Game).SpecialEvent(PlayerReplicationInfo,""$CurrentCombo.Class); if ( ComboClass.Name == 'ComboSpeed' ) i = 0; else if ( ComboClass.Name == 'ComboBerserk' ) i = 1; else if ( ComboClass.Name == 'ComboDefensive' ) i = 2; else if ( ComboClass.Name == 'ComboInvis' ) i = 3; else i = 4; TeamPlayerReplicationInfo(PlayerReplicationInfo).Combos[i] += 1; } } } simulated function bool HasUDamage() { return (UDamageTime > Level.TimeSeconds); } function ClientSetUDamageTime(float NewUDam) { UDamageTime = Level.TimeSeconds + NewUDam; } function EnableUDamage(float amount) { UDamageTime = FMax(UDamageTime, Level.TimeSeconds+amount); ClientSetUDamageTime(UDamageTime - Level.TimeSeconds); if ( UDamageTimer == None ) UDamageTimer = Spawn(class'UDamageTimer',self); UDamageTimer.SetTimer(UDamageTime - Level.TimeSeconds - 3,false); LightType = LT_Steady; bDynamicLight = true; SetWeaponOverlay(UDamageWeaponMaterial, UDamageTime - Level.TimeSeconds, false); } function DisableUDamage() { LightType = LT_None; bDynamicLight = false; UDamageTime = Level.TimeSeconds - 1; ClientSetUDamageTime(-1); SetWeaponOverlay(UDamageWeaponMaterial, UDamageTime - Level.TimeSeconds, false); } function SetWeaponOverlay(Material mat, float time, bool override) { if (Weapon != None) { Weapon.SetOverlayMaterial(mat, time, override); if (WeaponAttachment(Weapon.ThirdPersonActor) != None) WeaponAttachment(Weapon.ThirdPersonActor).SetOverlayMaterial(mat, time, override); } } function ChangedWeapon() { Super.ChangedWeapon(); if (Weapon != None && Role < ROLE_Authority) { if (bBerserk) Weapon.StartBerserk(); else if ( Weapon.bBerserk ) Weapon.StopBerserk(); } } function ServerChangedWeapon(Weapon OldWeapon, Weapon NewWeapon) { local float InvisTime; if ( bInvis ) { if ( (OldWeapon != None) && (OldWeapon.OverlayMaterial == InvisMaterial) ) InvisTime = OldWeapon.ClientOverlayCounter; else InvisTime = 20000; } if (HasUDamage() || bInvis) SetWeaponOverlay(None, 0.f, true); Super.ServerChangedWeapon(OldWeapon, NewWeapon); if (bInvis) SetWeaponOverlay(InvisMaterial, InvisTime, true); else if (HasUDamage()) SetWeaponOverlay(UDamageWeaponMaterial, UDamageTime - Level.TimeSeconds, false); if (bBerserk) Weapon.StartBerserk(); else if ( Weapon.bBerserk ) Weapon.StopBerserk(); } function SetInvisibility(float time) { bInvis = (time > 0.0); if (Role == ROLE_Authority) { if (bInvis) { if ( (time == 2000000.0) && Level.Game.IsA('xMutantGame') ) // for mutant game Visibility = Default.Visibility; else Visibility = 1; SetWeaponOverlay(InvisMaterial, time, true); } else { Visibility = Default.Visibility; if (HasUDamage()) SetWeaponOverlay(UDamageWeaponMaterial, UDamageTime - Level.TimeSeconds, true); else SetWeaponOverlay(None, 0.0, true); } } } /* BotDodge() returns appropriate vector for dodge in direction Dir (which should be normalized) */ function vector BotDodge(Vector Dir) { local vector Vel; Vel = DodgeSpeedFactor*GroundSpeed*Dir; Vel.Z = DodgeSpeedZ; return Vel; } function bool Dodge(eDoubleClickDir DoubleClickMove) { local vector X,Y,Z, TraceStart, TraceEnd, Dir, Cross, HitLocation, HitNormal; local Actor HitActor; local rotator TurnRot; if ( bIsCrouched || bWantsToCrouch || (Physics != PHYS_Walking && Physics != PHYS_Falling) ) return false; TurnRot.Yaw = Rotation.Yaw; GetAxes(TurnRot,X,Y,Z); if ( Physics == PHYS_Falling ) { if ( !bCanWallDodge ) return false; if (DoubleClickMove == DCLICK_Forward) TraceEnd = -X; else if (DoubleClickMove == DCLICK_Back) TraceEnd = X; else if (DoubleClickMove == DCLICK_Left) TraceEnd = Y; else if (DoubleClickMove == DCLICK_Right) TraceEnd = -Y; TraceStart = Location - CollisionHeight*Vect(0,0,1) + TraceEnd*CollisionRadius; TraceEnd = TraceStart + TraceEnd*32.0; HitActor = Trace(HitLocation, HitNormal, TraceEnd, TraceStart, false, vect(1,1,1)); if ( (HitActor == None) || (!HitActor.bWorldGeometry && (Mover(HitActor) == None)) ) return false; } if (DoubleClickMove == DCLICK_Forward) { Dir = X; Cross = Y; } else if (DoubleClickMove == DCLICK_Back) { Dir = -1 * X; Cross = Y; } else if (DoubleClickMove == DCLICK_Left) { Dir = -1 * Y; Cross = X; } else if (DoubleClickMove == DCLICK_Right) { Dir = Y; Cross = X; } if ( AIController(Controller) != None ) Cross = vect(0,0,0); return PerformDodge(DoubleClickMove, Dir,Cross); } function bool PerformDodge(eDoubleClickDir DoubleClickMove, vector Dir, vector Cross) { local float VelocityZ; local name Anim; if ( Physics == PHYS_Falling ) { if (DoubleClickMove == DCLICK_Forward) Anim = WallDodgeAnims[0]; else if (DoubleClickMove == DCLICK_Back) Anim = WallDodgeAnims[1]; else if (DoubleClickMove == DCLICK_Left) Anim = WallDodgeAnims[2]; else if (DoubleClickMove == DCLICK_Right) Anim = WallDodgeAnims[3]; if ( PlayAnim(Anim, 1.0, 0.1) ) bWaitForAnim = true; AnimAction = Anim; TakeFallingDamage(); if (Velocity.Z < -DodgeSpeedZ*0.5) Velocity.Z += DodgeSpeedZ*0.5; } VelocityZ = Velocity.Z; Velocity = DodgeSpeedFactor*GroundSpeed*Dir + (Velocity Dot Cross)*Cross; if ( !bCanDodgeDoubleJump ) MultiJumpRemaining = 0; if ( bCanBoostDodge || (Velocity.Z < -100) ) Velocity.Z = VelocityZ + DodgeSpeedZ; else Velocity.Z = DodgeSpeedZ; CurrentDir = DoubleClickMove; SetPhysics(PHYS_Falling); PlayOwnedSound(GetSound(EST_Dodge), SLOT_Pain, GruntVolume,,80); return true; } function DoDoubleJump( bool bUpdating ) { PlayDoubleJump(); if ( !bIsCrouched && !bWantsToCrouch ) { if ( !IsLocallyControlled() || (AIController(Controller) != None) ) MultiJumpRemaining -= 1; Velocity.Z = JumpZ + MultiJumpBoost; SetPhysics(PHYS_Falling); if ( !bUpdating ) PlayOwnedSound(GetSound(EST_DoubleJump), SLOT_Pain, GruntVolume,,80); } } function bool CanDoubleJump() { return ( (MultiJumpRemaining > 0) && (Physics == PHYS_Falling) ); } function bool CanMultiJump() { return ( MaxMultiJump > 0 ); } function bool DoJump( bool bUpdating ) { // This extra jump allows a jumping or dodging pawn to jump again mid-air // (via thrusters). The pawn must be within +/- 100 velocity units of the // apex of the jump to do this special move. if ( !bUpdating && CanDoubleJump()&& (Abs(Velocity.Z) < 100) && IsLocallyControlled() ) { if ( PlayerController(Controller) != None ) PlayerController(Controller).bDoubleJump = true; DoDoubleJump(bUpdating); MultiJumpRemaining -= 1; return true; } if ( Super.DoJump(bUpdating) ) { if ( !bUpdating ) PlayOwnedSound(GetSound(EST_Jump), SLOT_Pain, GruntVolume,,80); return true; } return false; } simulated function NotifyTeamChanged() { // my PRI now has a new team PostNetReceive(); } simulated event PostNetReceive() { if ( ForceDefaultCharacter() ) { Setup(class'xUtil'.static.FindPlayerRecord(GetDefaultCharacter())); bNetNotify = false; } else if ( PlayerReplicationInfo != None ) { Setup(class'xUtil'.static.FindPlayerRecord(PlayerReplicationInfo.CharacterName)); bNetNotify = false; } else if ( (DrivenVehicle != None) && (DrivenVehicle.PlayerReplicationInfo != None) ) { Setup(class'xUtil'.static.FindPlayerRecord(DrivenVehicle.PlayerReplicationInfo.CharacterName)); bNetNotify = false; } } simulated function ClientRestart() { Super.ClientRestart(); if ( Controller != None ) OldController = Controller; } simulated function bool CheckValidFemaleDefault() { return ( (PlacedFemaleCharacterName ~= "Tamika") || (PlacedFemaleCharacterName ~= "Sapphire") || (PlacedFemaleCharacterName ~= "Enigma") || (PlacedFemaleCharacterName ~= "Cathode") || (PlacedFemaleCharacterName ~= "Rylisa") || (PlacedFemaleCharacterName ~= "Ophelia") || (PlacedFemaleCharacterName ~= "Zarina") ); } simulated function bool CheckValidMaleDefault() { return ( (PlacedCharacterName ~= "Jakob") || (PlacedCharacterName ~= "Gorge") || (PlacedCharacterName ~= "Malcolm") || (PlacedCharacterName ~= "Xan") || (PlacedCharacterName ~= "Brock") || (PlacedCharacterName ~= "Gaargod") || (PlacedCharacterName ~= "Axon") ); } simulated function bool ForceDefaultCharacter() { local PlayerController P; if ( !class'DeathMatch'.default.bForceDefaultCharacter ) return false; // validate and use player's model for enemies of same sex P = Level.GetLocalPlayerController(); if ( (P != None) && (P.PlayerReplicationInfo != None) ) { if ( P.PlayerReplicationInfo.bIsFemale ) { PlacedFemaleCharacterName = P.PlayerReplicationInfo.CharacterName; if ( !CheckValidFemaleDefault() ) { PlacedFemaleCharacterName = "Tamika"; return false; } } else { PlacedCharacterName = P.PlayerReplicationInfo.CharacterName; if ( !CheckValidMaleDefault() ) { PlacedCharacterName = "Jakob"; return false; } } } return true; } simulated function string GetDefaultCharacter() { if ( Level.IsDemoBuild() ) { PlacedFemaleCharacterName = "Tamika"; PlacedCharacterName = "Jakob"; } else { // make sure picking from valid default characters if ( !CheckValidFemaleDefault() ) PlacedFemaleCharacterName = "Tamika"; if ( !CheckValidMaleDefault() ) PlacedCharacterName = "Jakob"; } // return appropriate character based on this pawn's sex if ( (PlayerReplicationInfo != None) && PlayerReplicationInfo.bIsFemale ) return PlacedFemaleCharacterName; else return PlacedCharacterName; } simulated function Setup(xUtil.PlayerRecord rec, optional bool bLoadNow) { if ( (rec.Species == None) || ForceDefaultCharacter() ) rec = class'xUtil'.static.FindPlayerRecord(GetDefaultCharacter()); Species = rec.Species; RagdollOverride = rec.Ragdoll; if ( !Species.static.Setup(self,rec) ) { rec = class'xUtil'.static.FindPlayerRecord(GetDefaultCharacter()); if ( !Species.static.Setup(self,rec) ) return; } ResetPhysicsBasedAnim(); } simulated function ResetPhysicsBasedAnim() { bIsIdle = false; bWaitForAnim = false; } function Sound GetSound(xPawnSoundGroup.ESoundType soundType) { return SoundGroupClass.static.GetSound(soundType); } function class<Gib> GetGibClass(xPawnGibGroup.EGibType gibType) { return GibGroupClass.static.GetGibClass(gibType); } simulated function DoDerezEffect() { Spawn(TeleportFXClass); } State Dying { simulated function AnimEnd( int Channel ) { ReduceCylinder(); } event FellOutOfWorld(eKillZType KillType) { local LavaDeath LD; // If we fall past a lava killz while dead- burn off skin. if( KillType == KILLZ_Lava ) { if ( !bSkeletized ) { if ( SkeletonMesh != None ) { LinkMesh(SkeletonMesh, true); Skins.Length = 0; } bSkeletized = true; LD = spawn(class'LavaDeath', , , Location + vect(0, 0, 10), Rotation ); if ( LD != None ) LD.SetBase(self); // This should destroy itself once its finished. PlaySound( sound'WeaponSounds.BExplosion5', SLOT_None, 1.5*TransientSoundVolume ); } return; } Super.FellOutOfWorld(KillType); } function LandThump() { // animation notify - play sound if actually landed, and animation also shows it if ( Physics == PHYS_None) { bThumped = true; PlaySound(GetSound(EST_CorpseLanded)); } } simulated function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType) { local Vector SelfToHit, SelfToInstigator, CrossPlaneNormal; local float W; local float YawDir; local Vector HitNormal, shotDir; local Vector PushLinVel, PushAngVel; local Name HitBone; local float HitBoneDist; local int MaxCorpseYawRate; if ( bFrozenBody || bRubbery ) return; if( Physics == PHYS_KarmaRagdoll ) { // Can't shoot corpses during de-res if( bDeRes || bRubbery ) return; // Throw the body if its a rocket explosion or shock combo if( damageType.Default.bThrowRagdoll ) { shotDir = Normal(Momentum); PushLinVel = (RagDeathVel * shotDir) + vect(0, 0, 250); PushAngVel = Normal(shotDir Cross vect(0, 0, 1)) * -18000; KSetSkelVel( PushLinVel, PushAngVel ); } else if( damageType.Default.bRagdollBullet ) { if ( Momentum == vect(0,0,0) ) Momentum = HitLocation - InstigatedBy.Location; if ( FRand() < 0.65 ) { if ( Velocity.Z <= 0 ) PushLinVel = vect(0,0,40); PushAngVel = Normal(Normal(Momentum) Cross vect(0, 0, 1)) * -8000 ; PushAngVel.X *= 0.5; PushAngVel.Y *= 0.5; PushAngVel.Z *= 4; KSetSkelVel( PushLinVel, PushAngVel ); } PushLinVel = RagShootStrength*Normal(Momentum); KAddImpulse(PushLinVel, HitLocation); if ( (LifeSpan > 0) && (LifeSpan < DeResTime + 2) ) LifeSpan += 0.2; } else { PushLinVel = RagShootStrength*Normal(Momentum); KAddImpulse(PushLinVel, HitLocation); } if ( (DamageType.Default.DamageOverlayMaterial != None) && (Level.DetailMode != DM_Low) && !Level.bDropDetail ) SetOverlayMaterial(DamageType.Default.DamageOverlayMaterial, DamageType.default.DamageOverlayTime, true); return; } if ( DamageType.default.bFastInstantHit && GetAnimSequence() == 'Death_Spasm' && RepeaterDeathCount < 6) { PlayAnim('Death_Spasm',, 0.2); RepeaterDeathCount++; } else if (Damage > 0) { if ( InstigatedBy != None ) { if ( InstigatedBy.IsA('xPawn') && xPawn(InstigatedBy).bBerserk ) Damage *= 2; // Figure out which direction to spin: if( InstigatedBy.Location != Location ) { SelfToInstigator = InstigatedBy.Location - Location; SelfToHit = HitLocation - Location; CrossPlaneNormal = Normal( SelfToInstigator cross Vect(0,0,1) ); W = CrossPlaneNormal dot Location; if( HitLocation dot CrossPlaneNormal < W ) YawDir = -1.0; else YawDir = 1.0; } } if( VSize(Momentum) < 10 ) { Momentum = - Normal(SelfToInstigator) * Damage * 1000.0; Momentum.Z = Abs( Momentum.Z ); } SetPhysics(PHYS_Falling); Momentum = Momentum / Mass; AddVelocity( Momentum ); bBounce = true; RotationRate.Pitch = 0; RotationRate.Yaw += VSize(Momentum) * YawDir; MaxCorpseYawRate = 150000; RotationRate.Yaw = Clamp( RotationRate.Yaw, -MaxCorpseYawRate, MaxCorpseYawRate ); RotationRate.Roll = 0; bFixedRotationDir = true; bRotateToDesired = false; Health -= Damage; CalcHitLoc( HitLocation, vect(0,0,0), HitBone, HitBoneDist ); if( InstigatedBy != None ) HitNormal = Normal( Normal(InstigatedBy.Location-HitLocation) + VRand() * 0.2 + vect(0,0,2.8) ); else HitNormal = Normal( Vect(0,0,1) + VRand() * 0.2 + vect(0,0,2.8) ); DoDamageFX( HitBone, Damage, DamageType, Rotator(HitNormal) ); } } simulated function BeginState() { Super.BeginState(); AmbientSound = None; } simulated function Timer() { local KarmaParamsSkel skelParams; if ( !PlayerCanSeeMe() ) { Destroy(); } // If we are running out of life, bute we still haven't come to rest, force the de-res. // unless pawn is the viewtarget of a player who used to own it else if ( LifeSpan <= DeResTime && bDeRes == false ) { skelParams = KarmaParamsSkel(KParams); // check not viewtarget if ( (PlayerController(OldController) != None) && (PlayerController(OldController).ViewTarget == self) && (Viewport(PlayerController(OldController).Player) != None) ) { skelParams.bKImportantRagdoll = true; LifeSpan = FMax(LifeSpan,DeResTime + 2.0); SetTimer(1.0, false); return; } else { skelParams.bKImportantRagdoll = false; } // spawn derez StartDeRes(); } else { SetTimer(1.0, false); } } // We shorten the lifetime when the guys comes to rest. event KVelDropBelow() { local float NewLifeSpan; if(bDeRes == false) { //Log("Low Vel - Reducing LifeSpan!"); NewLifeSpan = DeResTime + 3.5; if(NewLifeSpan < LifeSpan) LifeSpan = NewLifeSpan; } } } defaultproperties { bCanDodgeDoubleJump=True UDamageWeaponMaterial=Shader'XGameShaders.PlayerShaders.WeaponUDamageShader' UDamageSound=Sound'GameSounds.UDamageFire' InvisMaterial=FinalBlend'XEffectMat.Combos.InvisOverlayFB' ShieldStrengthMax=150.000000 ShieldHitMat=Shader'XGameShaders.PlayerShaders.PlayerShieldSh' ShieldHitMatTime=1.000000 Species=Class'XGame.SPECIES_Merc' GruntVolume=0.180000 FootstepVolume=0.150000 GibGroupClass=Class'XEffects.xPawnGibGroup' GibCountCalf=4 GibCountForearm=2 GibCountHead=2 GibCountTorso=2 GibCountUpperArm=2 MinTimeBetweenPainSounds=0.350000 SoundFootsteps(0)=SoundGroup'PlayerSounds.Final.FootstepDefault' SoundFootsteps(1)=SoundGroup'PlayerSounds.Final.FootstepRock' SoundFootsteps(2)=SoundGroup'PlayerSounds.Final.FootstepDirt' SoundFootsteps(3)=SoundGroup'PlayerSounds.Final.FootstepMetal' SoundFootsteps(4)=SoundGroup'PlayerSounds.Final.FootstepWood' SoundFootsteps(5)=SoundGroup'PlayerSounds.Final.FootstepPlant' SoundFootsteps(6)=SoundGroup'PlayerSounds.Final.FootstepFlesh' SoundFootsteps(7)=SoundGroup'PlayerSounds.Final.FootstepIce' SoundFootsteps(8)=SoundGroup'PlayerSounds.Final.FootstepSnow' SoundFootsteps(9)=SoundGroup'PlayerSounds.Final.FootstepWater' SoundFootsteps(10)=SoundGroup'PlayerSounds.Final.FootstepGlass' SoundGroupClass=Class'XGame.xMercMaleSoundGroup' TeleportFXClass=Class'XEffects.TransEffect' TransEffects(0)=Class'XEffects.NewTransEffect' TransEffects(1)=Class'XEffects.NewTransEffectBlue' MultiJumpRemaining=1 MaxMultiJump=1 MultiJumpBoost=25 WallDodgeAnims(0)="WallDodgeF" WallDodgeAnims(1)="WallDodgeB" WallDodgeAnims(2)="WallDodgeL" WallDodgeAnims(3)="WallDodgeR" IdleHeavyAnim="Idle_Biggun" IdleRifleAnim="Idle_Rifle" FireHeavyRapidAnim="Biggun_Burst" FireHeavyBurstAnim="Biggun_Aimed" FireRifleRapidAnim="Rifle_Burst" FireRifleBurstAnim="Rifle_Aimed" FireRootBone="bip01 Spine" DeResTime=6.000000 DeResMat0=FinalBlend'DeRez.Shaders.DeRezFinalBody' DeResMat1=FinalBlend'DeRez.Shaders.DeRezFinalHead' DeResLiftVel=(Points=(,(InVal=2.500000,OutVal=32.000000),(InVal=100.000000,OutVal=32.000000))) DeResLiftSoftness=(Points=((OutVal=0.300000),(InVal=2.500000,OutVal=0.050000),(InVal=100.000000,OutVal=0.050000))) DeResLateralFriction=0.300000 RagdollLifeSpan=13.000000 RagInvInertia=4.000000 RagDeathVel=200.000000 RagShootStrength=8000.000000 RagSpinScale=2.500000 RagDeathUpKick=150.000000 RagGravScale=1.000000 RagImpactSounds(0)=Sound'GeneralImpacts.Wet.Breakbone_01' RagImpactSounds(1)=Sound'GeneralImpacts.Wet.Breakbone_02' RagImpactSounds(2)=Sound'GeneralImpacts.Wet.Breakbone_03' RagImpactSoundInterval=0.500000 RagImpactVolume=2.500000 TransOutEffect(0)=Class'XEffects.NewTransDeresRed' TransOutEffect(1)=Class'XEffects.NewTransDeresBlue' PlacedCharacterName="Jakob" PlacedFemaleCharacterName="Tamika" RequiredEquipment(0)="XWeapons.AssaultRifle" RequiredEquipment(1)="XWeapons.ShieldGun" VoiceType="xGame.MercMaleVoice" bCanWallDodge=True GroundSpeed=440.000000 WaterSpeed=220.000000 AirSpeed=440.000000 JumpZ=340.000000 WalkingPct=0.400000 CrouchedPct=0.400000 BaseEyeHeight=38.000000 EyeHeight=38.000000 CrouchHeight=29.000000 CrouchRadius=25.000000 ControllerClass=Class'XGame.xBot' bPhysicsAnimUpdate=True bDoTorsoTwist=True MovementAnims(0)="RunF" MovementAnims(1)="RunB" MovementAnims(2)="RunL" MovementAnims(3)="RunR" TurnLeftAnim="TurnL" TurnRightAnim="TurnR" DodgeSpeedFactor=1.500000 DodgeSpeedZ=210.000000 SwimAnims(0)="SwimF" SwimAnims(1)="SwimB" SwimAnims(2)="SwimL" SwimAnims(3)="SwimR" CrouchAnims(0)="CrouchF" CrouchAnims(1)="CrouchB" CrouchAnims(2)="CrouchL" CrouchAnims(3)="CrouchR" WalkAnims(0)="WalkF" WalkAnims(1)="WalkB" WalkAnims(2)="WalkL" WalkAnims(3)="WalkR" AirAnims(0)="JumpF_Mid" AirAnims(1)="JumpB_Mid" AirAnims(2)="JumpL_Mid" AirAnims(3)="JumpR_Mid" TakeoffAnims(0)="JumpF_Takeoff" TakeoffAnims(1)="JumpB_Takeoff" TakeoffAnims(2)="JumpL_Takeoff" TakeoffAnims(3)="JumpR_Takeoff" LandAnims(0)="JumpF_Land" LandAnims(1)="JumpB_Land" LandAnims(2)="JumpL_Land" LandAnims(3)="JumpR_Land" DoubleJumpAnims(0)="DoubleJumpF" DoubleJumpAnims(1)="DoubleJumpB" DoubleJumpAnims(2)="DoubleJumpL" DoubleJumpAnims(3)="DoubleJumpR" DodgeAnims(0)="DodgeF" DodgeAnims(1)="DodgeB" DodgeAnims(2)="DodgeL" DodgeAnims(3)="DodgeR" AirStillAnim="Jump_Mid" TakeoffStillAnim="Jump_Takeoff" CrouchTurnRightAnim="Crouch_TurnR" CrouchTurnLeftAnim="Crouch_TurnL" IdleCrouchAnim="Crouch" IdleSwimAnim="Swim_Tread" IdleWeaponAnim="Idle_Rifle" IdleRestAnim="Idle_Rest" IdleChatAnim="idle_chat" RootBone="Bip01" HeadBone="Bip01 Head" SpineBone1="Bip01 Spine1" SpineBone2="bip01 Spine2" LightHue=204 LightSaturation=0 LightBrightness=255.000000 LightRadius=3.000000 bActorShadows=True bDramaticLighting=True Mesh=SkeletalMesh'ThunderCrash.JakobM' LODBias=1.800000 Texture=Texture'XEffects.RedMarker_t' PrePivot=(Z=-5.000000) Skins(0)=Texture'DemoPlayerSkins.Jakob_Body' Skins(1)=Texture'DemoPlayerSkins.Jakob_NewHead' MaxLights=8 CollisionRadius=25.000000 CollisionHeight=44.000000 bNetNotify=True RotationRate=(Pitch=3072) Begin Object Class=KarmaParamsSkel Name=PawnKParams KConvulseSpacing=(Max=2.200000) KLinearDamping=0.150000 KAngularDamping=0.050000 KBuoyancy=1.000000 KStartEnabled=True KVelDropBelowThreshold=50.000000 bHighDetailOnly=False KFriction=0.600000 KRestitution=0.300000 KImpactThreshold=500.000000 End Object KParams=KarmaParamsSkel'XGame.xPawn.PawnKParams' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |