N64 C Repo
Jump to navigation
Jump to search
Chameleon Twist
#include<ultra64.h> #include"SUGI/demodata.h" ␀␀DEMO_KEY DemoData%s[] = { ␀␀ }; ␀␀␀␀#if fgDEMO == 1 ␀␀␀static int SIview_data = 0; ␀␀␀␀static int SIroll_data = 0; ␀␀␀␀static int SIeffe_data = 0; ␀␀␀␀VIEW_DATA view_data[mxVIEWCAT]; ␀␀␀␀ROLL_DATA roll_data[mxROLLCAT]={ ␀␀␀ {0,0 ,0,0,"EXECUTIVE PRODUCER","KATSUMI","KAWAMURA","","","",""}, ␀␀␀␀ {0,1 ,0,0," PRODUCER","TAEKO","NAGATA","","","",""}, ␀␀␀␀ {0,2 ,0,0,"GAME DESIGN","HIDEYUKI","NAKANISHI","","","",""}, ␀␀ {0,3 ,0,0," DIRECTOR","MASAKI","KIMURA","","","",""}, ␀␀ {0,4 ,0,0,"COMPUTER ARTS","TAKASHI","MAKINO","YUKI","TAMURA","HIROYUKI","MORIOKA"}, ␀␀␀␀ {0,5 ,0,0," PROGRAM","HIDEYUKI","NAKANISHI","MASATAKA","IMURA","TAKASHI","SUGIOKA"}, ␀␀␀␀ {0,6 ,0,0," PROGRAM","MASAKI","KIMURA","MASAOMI","ISHIMOTO","",""}, ␀␀ {0,7 ,0,0,"GRAPHIC ARTS","MITSUYASU","NOMOTO","HIDEKI","SHIBAGAKI", "",""}, ␀␀ {0,8 ,0,0,"MUSIC □ SOUND","TAKASHI","SUGIOKA","TAKASHI","MAKINO","YUUJI","NAKAO"}, ␀␀ {0,9 ,0,0,"MUSIC □ SOUND","NOBUTOSHI","ICHIMIYA","KOKI","TOCHIO","TSUTOMU","WASHIJIMA"}, ␀␀ {0,10,0,0,"MUSIC □ SOUND","HIROSHI","TAKAMI","FUMIHIKO","YAMADA","",""}, ␀␀ {0,11,0,0,"DEBUGGING TEAM","YUUSUKE","TABATA","SHINGO","MATSUMURA","MAKOTO","MAEHIRA"}, ␀␀␀␀ {0,12,0,0,"ORIGINAL CHAMELEON DESIGN","TADASHI","OHYA","","","",""}, ␀␀ {0,13,0,0," GAME DESIGN","HIDEYUKI","NAKANISHI","TAKASHI","MAKINO","YUKI","TAMURA"}, ␀␀␀␀ {0,14,0,0," GAME DESIGN","HIROYUKI","MORIOKA","MAKOTO","TANAKA","",""}, ␀␀ {0,15,0,0," GAME DESIGN","AI","NADATANI","AKIROT","","",""}, ␀␀␀␀ {0,16,0,0,"ASSISTANT PRODUCER","SHYOJI","OGAWA","","","",""}, ␀␀␀␀ {0,17,0,0,"PUBLIC INFORMATION","YUKAKO","OKADA","SACHIYO","NOGAMI", "",""}, ␀␀ {0,18,0,0,"SPECIAL THANKS TO","SUPER MARIO CLUB","","FAMIMAGA64","","",""}, ␀␀␀␀ {0,19,0,0,"PRESENTED BY C1996","JAPAN SYSTEM SUPPLY","","","","",""}, ␀␀␀␀}; ␀␀␀␀EFFE_DATA effe_data[mxEFFECAT]; ␀␀␀␀#else ␀␀/*----------------------------------------------------------------------------------*/ ␀/*----------------------------------------------------------------------------------*/ ␀/*----------------------------------------------------------------------------------*/ ␀static int SIview_data = %d; ␀␀␀static int SIroll_data = %d; ␀␀␀static int SIeffe_data = %d; ␀␀␀static VIEW_DATA view_data[mxVIEWCAT] = { ␀␀{ ␀␀ %d, ␀␀␀ %d, ␀␀␀ %d, ␀␀␀ { ␀%d,␀ },␀ { ␀%d,␀ },␀ { ␀%d,␀ }, ␀␀␀␀ %d, ␀␀␀}, ␀}; ␀static ROLL_DATA roll_data[mxROLLCAT] = { ␀␀{ ␀␀ %d, ␀␀ %d, ␀␀ %d, ␀␀ %d, ␀␀ "%s", ␀␀␀␀ "%s", ␀␀␀␀ "%s", ␀␀␀␀ "%s", ␀␀␀␀ "%s", ␀␀␀␀ "%s", ␀␀␀␀ "%s", ␀␀␀␀}, ␀}; ␀static EFFE_DATA effe_data[mxEFFECAT] = { ␀␀}; ␀#endif ␀ON␀␀␀␀STOP␀␀␀␀バッファがない ␀デ〖タ粕み哈み己窃 ␀ON␀␀␀␀STOP␀␀␀␀PAUSE␀␀#include<ultra64.h> ␀␀␀␀#include"SUGI/demodata.h" ␀␀DEMO_KEY endingData[] = { ␀␀ }; ␀␀␀␀バッファがない ␀デ〖タ粕み哈み己窃 ␀#include<ultra64.h> #include"SUGI/demodata.h"
Excite Bike 64
file "nes.bin" resource "NES-excite" incbin "excite.c1" incbin "excite.gfx" incbin "state.cpu" endresource endfile
extern int GID_smp_loop; extern int GID_smp_bar1a; extern int GID_smp_bar1as; extern int GID_smp_bar1b; extern int GID_smp_bar2a; extern int GID_smp_bar2as; extern int GID_smp_bar2b; extern int GID_smp_bar3a; extern int GID_smp_bar3as; extern int GID_smp_bar3b; extern int GID_smp_bar4b; extern int GID_smp_bar4balt; extern int GID_smp_stomp3; extern int GID_smp_stomp6; extern int GID_smp_lastbar2; extern int GID_smp_g3; extern int GID_smp_g4; extern int GID_smp_g7; extern int GID_smp_g8; extern int GID_smp_tik3; extern int GID_smp_yeahman2; extern int GID_smp_scrat2; extern int GID_smp_crunchfa; extern int GID_smp_midc23; extern int GID_smp_lastmid2; extern int GID_smp_roll; extern int GID_smp_jslide1; extern int GID_smp_dloop1; extern int GID_smp_dloop2; extern int GID_smp_distloo1; extern int GID_smp_distloo2; extern int GID_smp_loser; extern int GID_smp_2ndbit2; extern int GID_smp_2ndbitb2; extern int GID_smp_2ndbitc2; extern int GID_smp_3rdbit1a; extern int GID_smp_3rdbit1b; extern int GID_smp_3rdbit1c; extern int GID_smp_3rdbit1d; extern int GID_smp_gb1; extern int GID_smp_gb2; extern int GID_smp_gb3; extern int GID_smp_turd; extern int GID_smp_turd4; extern int GID_smp_elephant; extern int GID_smp_turd5; extern int GID_smp_turd9; extern int GID_smp_turd12; extern int GID_smp_turd17; extern int GID_smp_turd17b; extern int GID_smp_turd18; extern int GID_smp_turd20; extern int GID_smp_monkeya; extern int GID_smp_monkeyb; extern int GID_smp_monkeyc; extern int GID_smp_silent; extern int GID_smp_wound; extern int GID_smp_stomach; extern int GID_smp_duodenum; extern int GID_smp_sl4a; extern int GID_smp_sl4b; extern int GID_smp_sl3b; extern int GID_smp_sl2b; extern int GID_smp_sl2c; extern int GID_smp_ulcer3; extern int GID_smp_ebs01_01; extern int GID_smp_ebs01_03; extern int GID_smp_ebs01_05; extern int GID_smp_ebs01_07; extern int GID_smp_ebs01_08; extern int GID_smp_ebs01_09; extern int GID_smp_ebs01_10; extern int GID_smp_ebs01_11; extern int GID_smp_ebs01_12; extern int GID_smp_ebs01_14; extern int GID_smp_ebs01_15; extern int GID_smp_ebs02_01; extern int GID_smp_ebs02_02; extern int GID_smp_ebs02_03; extern int GID_smp_ebs02_04; extern int GID_smp_ebs02_05; extern int GID_smp_ebs02_07; extern int GID_smp_ebs02_08; extern int GID_smp_ebs02_09; extern int GID_smp_ebs07_01; extern int GID_smp_ebs07_02; extern int GID_smp_ebs07_03; extern int GID_smp_ebs07_04; extern int GID_smp_ebs07_05; extern int GID_smp_ebs07_06; extern int GID_smp_ebs07_07; extern int GID_smp_ebs07_08; extern int GID_smp_ebs07_09; extern int GID_smp_ebs07_10; extern int GID_smp_ebs07_12; extern int GID_smp_ebs07_13; extern int GID_smp_ebs07_14; extern int GID_smp_ebsnes01; extern int GID_smp_ebsnes02; extern int GID_smp_ebsnes03; extern int GID_smp_ebsnes04; extern int GID_smp_ebs07_11; extern int GID_smp_EBS02_06; extern int GID_smp_thunder1; extern int GID_smp_diesel; extern int GID_smp_22k_Crow; extern int GID_smp_train; extern int GID_smp_22_Start; extern int GID_smp_waterfal; extern int GID_smp_train2; extern int GID_smp_Cliff_Fa; extern int GID_smp_Are_Figh; extern int GID_smp_And_Batt; extern int GID_smp_Are_Batt; extern int GID_smp_Takes_Th; extern int GID_smp_With_The; extern int GID_smp_Crosses_; extern int GID_smp_Has_Set_; extern int GID_smp_Sets_A_N; extern int GID_smp_Drops; extern int GID_smp_Knocks_O; extern int GID_smp_Takes_Ou; extern int GID_smp_Is_Behin; extern int GID_smp_Lap_Four; extern int GID_smp_Lap_Thre; extern int GID_smp_Lap_Two; extern int GID_smp_Going_In; extern int GID_smp_Into_Lap; extern int GID_smp_Into_The; extern int GID_smp_At_The_E; extern int GID_smp_Coming_I; extern int GID_smp_Continue; extern int GID_smp_Has_The_; extern int GID_smp_Holds_Th; extern int GID_smp_Leads_Th; extern int GID_smp_Is_Holdi; extern int GID_smp_Is_Still; extern int GID_smp_Is_Up_In; extern int GID_smp_Last_Rac; extern int GID_smp_Starting; extern int GID_smp_Goal; extern int GID_smp_Overtake; extern int GID_smp_Moves_Up; extern int GID_smp_Drops_Ba; extern int GID_smp_Takes_Fi; extern int GID_smp_Fifth_Pl; extern int GID_smp_First_Pl; extern int GID_smp_Forth_Pl; extern int GID_smp_Third_Pl; extern int GID_smp_Second_P; extern int GID_smp_Last_Pla; extern int GID_smp_Vikki_St; extern int GID_smp_Vikki_Vi; extern int GID_smp_Sarah_Hi; extern int GID_smp_Sarah_Su; extern int GID_smp_Tricky_R; extern int GID_smp_Ricky_St; extern int GID_smp_Nigel_Th; extern int GID_smp_Nigel_Yo; extern int GID_smp_Jumping_; extern int GID_smp_Jim_Rive; extern int GID_smp_Bobby_Ma; extern int GID_smp_Bobby_Bi; extern int GID_smp_And_Its; extern int GID_smp_Its; extern int GID_smp_And; extern int GID_smp_And_Its_; extern int GID_smp_Is_In_v1; extern int GID_smp_Is_In_v2; extern int GID_smp_Whip; extern int GID_smp_Cordova; extern int GID_smp_Saran_Wr; extern int GID_smp_Rodeo; extern int GID_smp_Ski_Jump; extern int GID_smp_Superman; extern int GID_smp_No_Foot; extern int GID_smp_Nothing; extern int GID_smp_No_Hande; extern int GID_smp_Nac_Nac; extern int GID_smp_Double_C; extern int GID_smp_Fender_G; extern int GID_smp_Fender_K; extern int GID_smp_Barhop; extern int GID_smp_Cliff_Ha; extern int GID_smp_Lazy_Boy; extern int GID_smp_Back_Fli; extern int GID_smp_Pulls_A_; extern int GID_smp_Heel_Cli; extern int GID_smp_Wipes_Ou; extern int GID_smp_Hits_The; extern int GID_smp_Gets_A_S; extern int GID_smp_Hits_Har; extern int GID_smp_Eats_Dir; extern int GID_smp_Crashes_;
extern int GID_ArnGround; extern int GID_ArnScene; extern int GID_ArnWater; extern int GID_Drones; extern int GID_LightDef; extern int GID_Materials; extern int GID_Patches; extern int GID_PathSpline; extern int GID_PkgAlt; extern int GID_PkgAnim; extern int GID_PkgGround; extern int GID_PkgScene; extern int GID_PkgSky; extern int GID_PkgWater; extern int GID_VisInfo; extern int GID_WalCol; extern int GID_SpCam; extern int GID_null; extern int GID_Ambient; extern int GID_InstanceDef; extern int GID_ArnSky; extern int GID_hips; extern int GID_chest; extern int GID_head; extern int GID_lbicep; extern int GID_lforarm; extern int GID_lhand; extern int GID_rbicep; extern int GID_rforarm; extern int GID_rhand; extern int GID_lthigh; extern int GID_lshin; extern int GID_lfoot; extern int GID_rthigh; extern int GID_rshin; extern int GID_rfoot; extern int GID_bike; extern int GID_fronts; extern int GID_fronts01; extern int GID_frontw; extern int GID_rears; extern int GID_rearw; extern int GID_ArnStand; extern int GID_ArnStandLow; extern int GID_PkgStand; extern int GID_CamFlash; extern int GID_nodea; extern int GID_nodeb; extern int GID_nodec; extern int GID_cam1; extern int GID_box11; extern int GID_box03; extern int GID_box04; extern int GID_sphere01; extern int GID_sphere05; extern int GID_sphere04;
Fighting Force 64 (PAL)
++) make_exp_frag_ang(OD_SMFRAG1+(rand()&3),m->x,(-(rand()&0x7f) )<<16,m->z+( (-0x100+(rand()&0x1ff) )<<16),ang); ang^=0x400; for(i=0;i<4;i++)make_exp_frag_ang(OD_SMFRAG1+(rand()&3), m->x, (-(rand()&0x7f) )<<16,m->z+( (-0x100+(rand()&0x1ff) )<<16),ang); create_item_ang(OD_12MGATE3,m->x,m->y- (0x5c <<16),m->z-((0x60+0xc0)<<16) ,0 ); create_item_ang(OD_12MGATE2,m->x,m->y- (0x5c <<16),m->z- (0x60 <<16) ,0 ); create_item_ang(OD_12MGATE2,m->x,m->y- (0x5c <<16),m->z+ (0x60 <<16) ,0 ); create_item_ang(OD_12MGATE4,m->x,m->y- (0x5c <<16),m->z+((0x60+0xc0)<<16) ,0 ); create_item_ang(OD_12MGATE3,m->x,m->y-((0x5c+0xb8)<<16),m->z-((0x60+0xc0)<<16) ,0 ); create_item_ang(OD_12MGATE2,m->x,m->y-((0x5c+0xb8)<<16),m->z- (0x60 <<16) ,0 ); create_item_ang(OD_12MGATE2,m->x,m->y-((0x5c+0xb8)<<16),m->z+ (0x60 <<16) ,0 ); create_item_ang(OD_12MGATE4,m->x,m->y-((0x5c+0xb8)<<16),m->z+((0x60+0xc0)<<16) ,0 ); } return(2); //1); } int brk_handler_drink_machine(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i,t; int x,y,z; int x2,z2,y2; static int sodacnt=0; MOB *mp; //static short soda_xa[4]={0xc000+0x300,0xc000-0xf00,0xc000+0x1500,0xc000-0x1e00}; static short soda_xa[4]={0xc000+0x300,0xc000-0x00,0xc000+0x1500,0xc000+0x700}; int xa; if(manptr) xa=manptr->xa; else xa=0; t=m->type; if(t==OD_DRKMCH2D) return(2); if(t==OD_DRKF2EX2) return(2); m->cnt=16; //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); if(dp[3]) play_sfx(SMP_MP_FH ,192,0x1800); else play_sfx(SMP_HAWK_P1,255,0x1800); play_sfx(SMP_21SUSP,96,0x1800); player_rumble (manptr,RFX_CHUG); if(--brk->hp<0) { play_sfx(SMP_CAR_DAM2,160,0x1a00 + (rand() & 0x1ff)); m->type++; brk->hp+=2; if(t==OD_DRNKFNTN) brk->hp+=4-2; if(t==OD_INFOCNTR) { if (manptr) manptr->ndestruct++; m->type=OD_DRKMCH2D; for(i=0;i<2;i++) { make_exp_frag_ang(OD_SMFRAG1+(rand()&3),m->x,-0x40<<16,m->z,0x3000>>5); make_exp_frag_ang(OD_SMFRAG1+(rand()&3),m->x,-0x40<<16,m->z,0x5000>>5); } dual_rumble (RFX_EXP); i=create_weapon(OD_INFOSCRN,m->x,-0x70<<16,m->z,0xc000-0x1000+(rand()&0x1fff) ); mp=&items[i]; mp->spd=64+(rand()&15); mp->ysp=96+(rand()&15); m->aux=0x300+(rand()&0x3ff); mp->flg=1; // No-detect flag. // i=create_weapon(OD_IRONBAR1,m->x,-0x50<<16,m->z); // mp=&items[i]; // mp->spd=48; // mp->ysp=96; // mp->xa=0xc000-0x1000+(rand()&0x1fff); // mp->flg=1; // No-detect flag. } t=m->type; x=m->x; y=0; z=m->z; if(t==OD_DRKMCH2D) { if (manptr) manptr->ndestruct++; m->cnt=16; m->cnt=0; m->aux=30*8; for(i=0;i<2;i++) { make_exp_frag_ang(OD_SMFRAG1+(rand()&3),m->x,-0x40<<16,m->z,0x3000>>5); make_exp_frag_ang(OD_SMFRAG1+(rand()&3),m->x,-0x40<<16,m->z,0x5000>>5); } for(i=0;i<32;i++) { x2=(-0x40+(rand()&0x7f) ) <<16; z2=(-0x40+(rand()&0x7f) ) <<16; y2= -0x40+(rand()&0x7f); create_dust(OD_DUST,x+x2,(-0xa0-y2)<<16,z+z2 ,0,0,0); } i=create_weapon(OD_IRONBAR1,m->x,-0x50<<16,m->z, 0xc000-0x1000+(rand()&0x1fff) ); mp=&items[i]; mp->spd=70+(rand()&15); mp->ysp=96+(rand()&15); mp->flg=1; // No-detect flag. } else if(t==OD_DRKF2EX2) { if (manptr) manptr->ndestruct++; m->cnt=0; m->aux=30*8; for(i=0;i<2;i++) { make_exp_frag_ang(OD_SMFRAG1+(rand()&3),m->x,-0x40<<16,m->z,0x3000>>5); make_exp_frag_ang(OD_SMFRAG1+(rand()&3),m->x,-0x40<<16,m->z,0x5000>>5); } for(i=0;i<32;i++) { x2=(-0x40+(rand()&0x7f) ) <<16; z2=(-0x40+(rand()&0x7f) ) <<16; y2= -0x40+(rand()&0x7f); create_dust(OD_DUST,x+x2,(-0xa0-y2)<<16,z+z2 ,0,0,0); } i=create_weapon(OD_IRONBAR1,m->x,-0x50<<16,m->z, 0xc000-0x1000+(rand()&0x1fff) ); mp=&items[i]; mp->spd=70+(rand()&15); mp->ysp=96+(rand()&15); mp->flg=1; // No-detect flag. } el-(0x40<<15),z-(0x20<<15),0x00); make_glass2_frag(x ,y-(0x40<<15),z-(0x20<<15),0x00); make_glass2_frag(x+(0x30<<15),y-(0x40<<15),z-(0x20<<15),0x00); make_glass2_frag(x-(0x30<<15),y ,z-(0x20<<15),0x00); make_glass2_frag(x ,y ,z-(0x20<<15),0x00); make_glass2_frag(x+(0x30<<15),y ,z-(0x20<<15),0x00); make_glass2_frag(x-(0x30<<15),y+(0x40<<15),z-(0x20<<15),0x00); make_glass2_frag(x ,y+(0x40<<15),z-(0x20<<15),0x00); make_glass2_frag(x+(0x30<<15),y+(0x40<<15),z-(0x20<<15),0x00); } return(1); } int brk_handler_gate11(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { MOB *n; int i,x,z; spcbrk[1]=brk; // Need this for later, to reset det-box!! m->cnt=8; // shakes the gate. play_sfx(SMP_HIT_MSHT, 0xff, 0x1800); player_rumble (manptr,RFX_CHUG); if(sublev!=1) { brk->hp=4; create_hitspr(OD_BLOCK,dp[X],dp[Y],dp[Z]); return(1); } if(brk->hp<0) { brk->dtype=BRK_NULL; m->type=OD_STG1GTE2; x=m->x; z=m->z; play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP1,x,dp[Y],z); create_fx(OD_BLAST1,m->x,0,m->z); shaker=16; eflash=8; //16; i=create_item(OD_STG1GTE3,x,0,z); n=&items[i]; n->spd=0x1c0+(rand()&0x3f); n->xa=0xc00; i=create_item(OD_STG1GTE4,x,0,z); n=&items[i]; n->spd=0x200+(rand()&0x3f); n->xa=-0xc00; baddie_pause = 0; return(1); } //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); if(brk->hp>=3) m->type=OD_STG1GATE; else if(brk->hp>=2) m->type=OD_STG1GTE5; else if(brk->hp>=1) m->type=OD_STG1GTE6; else m->type=OD_STG1GTE7; if(--brk->hp<0) { brk->hp=0; brk->dtype=BRK_NULL; if (manptr) manptr->ndestruct++; m->type=OD_STG1GTE7f; m->cnt=0; m->aux=0; baddie_pause = 0; } return(1); } int brk_handler_gate12(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i; int x,y,z; int ang; m->cnt=8; // shakes the gate. if(sublev!=1) { brk->hp=4; //create_hitspr(OD_BLOCK,dp[X],-32<<16,dp[Z]); return(1); } //create_hitspr(OD_HIT,dp[X],-32<<16,dp[Z]); play_sfx(SMP_HIT_MSHT,255,0x1800); play_sfx(SMP_21SUSP,160,0x1800); player_rumble (manptr,RFX_CHUG); if(--brk->hp<0) { brk->hp=0; brk->dtype=BRK_NULL; x=m->x; y=m->y; z=m->z; m->type=OD_NULL; m->cnt=0; m->aux=0; if (manptr) manptr->ndestruct++; play_sfx(SMP_MET_SHUT,255,0x1800); play_sfx(SMP_EXPLO1,96,0x1800); shaker=8; eflash=4; dual_rumble (RFX_SHUDDER); ang=0x000>>5; for(i=0;i<8;i++) make_exp_frag_ang(OD_SMFRAG1+(rand()&3),x+( (-0x100+(rand()&0x1ff) )<<16),(-(rand()&0x7f) )<<16,z,ang); ang^=0x400; for(i=0;i<4;i++) make_exp_frag_ang(OD_SMFRAG1+(rand()&3),x+( (-0x100+(rand()&0x1ff) )<<16),(-(rand()&0x7f) )<<16,z,ang); create_item_ang(OD_12GATE6,x-((0x64+0xc8)<<16),- (0x5c <<16),z ,0 ); create_item_ang(OD_12GATE6,x- (0x64 <<16),- (0x5c <<16),z ,0 ); create_item_ang(OD_12GATE6,x+ (0x64 <<16),- (0x5c <<16),z ,0 ); create_item_ang(OD_12GATE6,x+((0x64+0xc8)<<16),- (0x5c <<16),z ,0 ); create_item_ang(OD_12GATE5,x-((0x64+0xc8)<<16),-((0x5c+0xb8)<<16),z ,0 ); create_item_ang(OD_12GATE5,x- (0x64 <<16),-((0x5c+0xb8)<<16),z ,0 ); create_item_ang(OD_12GATE5,x+ (0x64 <<16),-((0x5c+0xb8)<<16),z ,0 ); create_item_ang(OD_12GATE5,x+((0x64+0xc8)<<16),-((0x5c+0xb8)<<16),z ,0 ); } return(1); } int brk_handler_mgate12(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i; int ang; m->cnt=8; // shakes the gate. //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); play_sfx(SMP_HIT_MSHT,255,0x1800); play_sfx(SMP_21SUSP,160,0x1800); player_rumble (manptr,RFX_CHUG); if(--brk->hp<0) { brk->hp=0; brk->dtype=BRK_NULL; m->type=OD_12MGATE1d; m->cnt=0; m->aux=0; if (manptr) manptr->ndestruct++; play_sfx(SMP_MET_SHUT,255,0x1800); play_sfx(SMP_EXPLO1,96,0x1800); shaker=8; eflash=4; dual_rumble (RFX_SHUDDER); ang=0x4000>>5; if(m->x<0) ang^=0x400; for(i=0;i<8;iXP; if(t==OD_61TANK3) m->type=OD_11JEEPEXP; if(t==OD_BLAKHAWK) return(2); m->ysp=-128; m->cnt=1; // m->spd-=m->spd>>2; if (manptr) manptr->ndestruct++; play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP1,m->x,dp[Y],m->z); create_fx(OD_BLAST1,m->x,0,m->z); for(i=0;i<16;i++) make_exp_frag_ang(OD_WRECK1+(rand()&3),m->x,m->y,m->z,m->xa>>5); shaker=16; eflash=8; return(2); } //create_hitspr(OD_BLOCK,dp[X],dp[Y],dp[Z]); for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); if(dp[3]) play_sfx(SMP_MP_FH ,192,0x1800); else play_sfx(SMP_HAWK_P1,255,0x1800); return(2); } int brk_handler_11van(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i,t; int x,y,z,ang; int rockx,rockz; int dq[4]; int xa; if(manptr) xa=manptr->xa; else xa=0; player_rumble (manptr,RFX_CHUG); if(brk->hp<0) { if (manptr) manptr->ndestruct++; brk->dtype=BRK_SOLID; m->type=OD_VAN2EXP; m->ysp=-128; m->cnt=1; m++; m->type=OD_SCORCH; stop_sfx(m->sfx); play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP1,m->x,dp[Y],m->z); create_fx(OD_BLAST1,m->x,0,m->z); for(i=0;i<16;i++) make_exp_frag(OD_WRECK1+(rand()&3),m->x,m->y,m->z); shaker=16; eflash=8; //16; return(2); } //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); t=m->type; if(dp[3]) play_sfx(SMP_MP_FH ,192,0x1800); else play_sfx(SMP_HAWK_P1,255,0x1800); /* rockx=0x300; rockz=0x600; if(gaside==0) m->aux= rockx; if(gaside==1) m->cnt= rockz; if(gaside==2) m->aux=-rockx; if(gaside==3) m->cnt=-rockz; */ if(t==OD_VAN1BOD3) { gaside=4; brk->hp=1; } rockx=0x300/2; rockz=0x600/2; if(t==OD_VAN1BOD2) { rockx=0x300; rockz=0x600; } if(gaside==0) m->aux= rockx; if(gaside==1) m->cnt= rockz; if(gaside==2) m->aux=-rockx; if(gaside==3) m->cnt=-rockz; if(--brk->hp<0) { if(m->type==OD_VAN1BOD) m->type=OD_VAN1BOD2; else if(m->type==OD_VAN2BODb) m->type=OD_VAN1BOD2; else m->type=OD_VAN1BOD3; brk->hp+=4; ang=m->xa; if(m->type==OD_VAN1BOD2) { play_sfx(SMP_CAR_DAM2,255,0x1800); x=m->x; y=0; z=m->z; slPushMatrix(); slUnitMatrix(CURRENT); slRotX(0x8000); slRotY(ang); for(i=0;i<24;i++) { t=(rand()&0x1ff)-0x100; t+=(t>>2); slCalcPoint( (-0xa0-(rand()&0x1f))<<16, 0, t<<16,dp); create_dust(OD_DUST2,x+dp[X],(-0x90-(rand()&127))<<16,z+dp[Z] ,rand()&3,0,0); t=(rand()&0x1ff)-0x100; slCalcPoint( ( 0xa0+(rand()&0x1f))<<16, 0, t<<16,dp); create_dust(OD_DUST2,x+dp[X],(-0x90-(rand()&127))<<16,z+dp[Z] ,rand()&3,0,0); } slPopMatrix(); } if(m->type==OD_VAN1BOD3) { if (manptr) manptr->ndestruct++; play_sfx(SMP_CAR_DAM3,255,0x1800); m++; m->type=OD_NULL; //SCORCH; x=m->x; y=0; z=m->z; slPushMatrix(); slUnitMatrix(CURRENT); slRotX(0x8000); slRotY(ang); ang-=0x4000; slCalcPoint( 0xac<<16,0, 0x120<<16,dq); i=create_item_ang(OD_VAN1WHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; slCalcPoint( 0xac<<16,0,-0x110<<16,dq); i=create_item_ang(OD_VAN1WHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; ang+=0x8000; slCalcPoint(-0xac<<16,0, 0x120<<16,dq); i=create_item_ang(OD_VAN1WHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; slCalcPoint(-0xac<<16,0,-0x110<<16,dq); i=create_item_ang(OD_VAN1WHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; slPopMatrix(); } } return(2); } int brk_handler_firebox(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i; int x,y,z; //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); player_rumble (manptr,RFX_CHUG); if(--brk->hp<0) { if (manptr) manptr->ndestruct++; play_sfx(SMP_CAR_DAM1, 255, 0x1800); x=m->x; y=m->y; z=m->z; m->type++; i=create_weapon(OD_FIREAXE,x,y,z,0); m=&items[i]; m->spd=64; m->ysp=0; make_glass2_frag(x-(0x30<<15),y if(level==LEVEL_11) { if(m->type==OD_PCARBOD3) wtype = OD_BAZOOKA; else wtype = OD_SHOTGUN1; slCalcPoint(0,0,0x100<<16,dq); i = create_weapon(wtype, x+dq[X], -0x50<<16, z+dq[Z] ,ang - 0x4000); mp = &items[i]; mp->spd = 70; mp->ysp = 96; mp->flg = 1; // No-detect flag. } else if(level==LEVEL_33) { if(m->z < 0) wtype = OD_PISTOL6; else wtype = OD_SHOTGUN1; slCalcPoint(0,0,0x100<<16,dq); i = create_weapon(wtype, x+dq[X], -0x50<<16, z+dq[Z] ,ang - 0x4000); mp = &items[i]; mp->spd = 70; mp->ysp = 96; mp->flg = 1; // No-detect flag. } m++; m->type=OD_NULL; slPopMatrix(); } } return(2); } int brk_handler_merc(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i,t; int x,y,z,ang; int rockx,rockz; int dq[4]; int xa; player_rumble (manptr,RFX_CHUG); if(manptr) xa=manptr->xa; else xa=0; /* if(brk->hp<0) { if(m->sfx!=0) { stop_sfx(m->sfx-1); m->sfx=0; } brk->dtype=BRK_SOLID; m->type=OD_CAR1EXP1+1; //(rand()&1); m->ysp=-128; m->cnt=1; m++; m->type=OD_SCORCH; x=m->x; y=m->y; z=m->z; manptr->ndestruct++; play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP1,x,dp[Y],z); create_fx(OD_BLAST1,x,0,z); for(i=0;i<16;i++) make_exp_frag(OD_WRECK1+(rand()&3),m->x,m->y,m->z); shaker=16; eflash=8; //16; return(2); } */ //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); t=m->type; if(dp[3]) play_sfx(SMP_MP_FH ,192,0x1800); else play_sfx(SMP_HAWK_P1,255,0x1800); if(t==OD_MERCBOD3) { gaside=4; brk->hp=1; } rockx=0x300/2; rockz=0x600/2; if(t==OD_MERCBOD2) { rockx=0x300; rockz=0x600; } if(gaside==0) m->aux= rockx; if(gaside==1) m->cnt= rockz; if(gaside==2) m->aux=-rockx; if(gaside==3) m->cnt=-rockz; if(--brk->hp<0) { if (temp_samples[0] != 0) stop_sfx(temp_samples[0] - 1), temp_samples[0] = 0; m->type++; brk->hp+=4; ang=m->xa; if(m->type==OD_MERCBOD2) { play_sfx(SMP_CAR_DAM2,255,0x1800); x=m->x; y=0; z=m->z; slPushMatrix(); slUnitMatrix(CURRENT); slRotX(0x8000); slRotY(ang); for(i=0;i<24;i++) { t=rand()&0xff; t+=(t>>3); slCalcPoint( (-0x90+t)<<16, 0, (-0xfc-0x40+(rand()&0x7f))<<16,dp); create_dust(OD_DUST,x+dp[X],-0xa0<<16,z+dp[Z] ,0,0,0); } for(i=0;i<16;i++) { t=rand()&0xff; t+=(t>>3); slCalcPoint( (-0x90+t)<<16, 0, ( 0xd8+(rand()&0x7f))<<16,dp); create_dust(OD_DUST,x+dp[X],-0xa0<<16,z+dp[Z] ,0,0,0); } slPopMatrix(); } if(m->type==OD_MERCBOD3) { if (manptr) manptr->ndestruct++; play_sfx(SMP_CAR_DAM3,255,0x1800); m++; m->type=OD_NULL; x=m->x; y=0; z=m->z; slPushMatrix(); slUnitMatrix(CURRENT); slRotX(0x8000); slRotY(ang); ang-=0x4000; slCalcPoint( 0x90<<16,0, 0xe8<<16,dq); i=create_item_ang(OD_MERCWHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; slCalcPoint( 0x90<<16,0,-0xec<<16,dq); i=create_item_ang(OD_MERCWHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; ang+=0x8000; slCalcPoint(-0x90<<16,0, 0xe8<<16,dq); i=create_item_ang(OD_MERCWHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; slCalcPoint(-0x90<<16,0,-0xec<<16,dq); i=create_item_ang(OD_MERCWHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; slPopMatrix(); } } return(2); } int brk_handler_traffic(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i,t; int xa; if(manptr) xa=manptr->xa; else xa=0; t=m->type; if(brk->hp<0) { brk->dtype=BRK_SOLID; if(t==OD_11PICKUP) m->type=OD_11PICEXP; if(t==OD_11JEEP) m->type=OD_11JEEPEXP; if(t==OD_11BUS) m->type=OD_11BUSEXP; if(t==OD_11CARRED) m->type=OD_11CAREXP; if(t==OD_11CARBLUE) m->type=OD_11CAREXP; if(t==OD_11POLICAR) m->type=OD_11CAREXP; if(t==OD_11TAXI) m->type=OD_11CAREe==OD_61A10a) { i = create_weapon(OD_BGUN1, -312<<19, -0xf0<<16, -488<<19 ,0x4000); mp = &items[i]; mp->spd = 64; mp->ysp = 64; mp->flg = 1; m++; m->type = OD_NULL; } if(type==OD_61ARMYTRCK && trmob==m && m->aux) { m->aux = 0; baddie_pause = 0; } } } return(1); } int brk_handler_forklift(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i; int xa; if(manptr) xa=manptr->xa; else xa=0; //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); if(--brk->hp<0) { if (manptr) manptr->ndestruct++; brk->dtype=BRK_NULL; m->type=OD_NULL; play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP_M,m->x,-0x20<<16,m->z); shaker=16; eflash=4; for(i=0;i<8;i++) make_exp_frag(OD_WRECK1+(rand()&3),m->x,m->y,m->z); baddie_pause = 0; } for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); if(dp[3]) play_sfx(SMP_MP_FH ,192,0x1800); else play_sfx(SMP_HAWK_P1,255,0x1800); return(2); } int brk_handler_car(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i,t; int x,y,z,ang; int rockx,rockz; int wtype; int dq[4]; int xa; MOB *mp; player_rumble (manptr,RFX_CHUG); if(manptr) xa=manptr->xa; else xa=0; if(brk->hp<0) { if(m->sfx!=0) { stop_sfx(m->sfx-1); m->sfx=0; } brk->dtype=BRK_SOLID; m->type=OD_CAR1EXP1+1; //(rand()&1); m->ysp=-128; m->cnt=1; m++; m->type=OD_SCORCH; x=m->x; y=m->y; z=m->z; if (manptr) manptr->ndestruct++; play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP1,x,dp[Y],z); create_fx(OD_BLAST1,x,0,z); for(i=0;i<16;i++) make_exp_frag(OD_WRECK1+(rand()&3),m->x,m->y,m->z); shaker=16; eflash=8; //16; return(2); } //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); t=m->type; if(dp[3]) play_sfx(SMP_MP_FH ,192,0x1800); else play_sfx(SMP_HAWK_P1,255,0x1800); if(t==OD_CAR1BOD3 OR t==OD_PCARBOD3) { gaside=4; brk->hp=1; } else { if(level==LEVEL_11 OR level==LEVEL_31) { if(m->sfx==0) m->sfx=1+play_sfx(SMP_L_CARAL,255,0x1800); // do alarm for 10 secs. m->ysp=10*30; } } rockx=0x300/2; rockz=0x600/2; if(t==OD_CAR1BOD2 OR t==OD_PCARBOD2) { rockx=0x300; rockz=0x600; } if(gaside==0) m->aux= rockx; if(gaside==1) m->cnt= rockz; if(gaside==2) m->aux=-rockx; if(gaside==3) m->cnt=-rockz; if(--brk->hp<0) { m->type++; brk->hp+=4; ang=m->xa; if(m->type==OD_CAR1BOD2 OR m->type==OD_PCARBOD2) { play_sfx(SMP_CAR_DAM2,255,0x1800); x=m->x; y=0; z=m->z; slPushMatrix(); slUnitMatrix(CURRENT); slRotX(0x8000); slRotY(ang); for(i=0;i<24;i++) { t=rand()&0xff; t+=(t>>3); slCalcPoint( (-0x90+t)<<16, 0, (-0xfc-0x40+(rand()&0x7f))<<16,dp); create_dust(OD_DUST,x+dp[X],-0xa0<<16,z+dp[Z] ,0,0,0); } for(i=0;i<16;i++) { t=rand()&0xff; t+=(t>>3); slCalcPoint( (-0x90+t)<<16, 0, ( 0xd8+(rand()&0x7f))<<16,dp); create_dust(OD_DUST,x+dp[X],-0xa0<<16,z+dp[Z] ,0,0,0); } slPopMatrix(); } if(m->type==OD_CAR1BOD3 OR m->type==OD_PCARBOD3) { if (manptr) manptr->ndestruct++; play_sfx(SMP_CAR_DAM3,255,0x1800); x=m->x; y=0; z=m->z; slPushMatrix(); slUnitMatrix(CURRENT); slRotX(0x8000); slRotY(ang); slCalcPoint( 0,0,-0x108<<16,dq); i=create_item_ang(OD_CAR1ENG2,x+dq[X],0,z+dq[Z],ang); ang-=0x4000; slCalcPoint( 0x90<<16,0, 0xd8<<16,dq); i=create_item_ang(OD_CAR1WHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; slCalcPoint( 0x90<<16,0,-0xfc<<16,dq); i=create_item_ang(OD_CAR1WHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; ang+=0x8000; slCalcPoint(-0x90<<16,0, 0xd8<<16,dq); i=create_item_ang(OD_CAR1WHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; slCalcPoint(-0x90<<16,0,-0xfc<<16,dq); i=create_item_ang(OD_CAR1WHLf,x+dq[X],0,z+dq[Z],ang); items[i].ya=0x4000; type==OD_63PIPE2 OR type==OD_63PIPE3 OR type==OD_63PIPE4 OR type==OD_71PIPE1) { brk->dtype=BRK_SOLID; if (manptr) manptr->ndestruct++; play_sfx(SMP_EXPLO1,192,0x1800); y=-0x80-0x20; if(type==OD_63PIPE3 OR type==OD_63PIPE4 OR type==OD_71PIPE1) y = -0x100-0x20; create_fx(OD_EXP_S,m->x,y<<16,m->z); if(m->x > 0) ang = 0x200; else ang = 0x600; for(i=0;i<8;i++) make_exp_frag_ang(OD_WRECK1+(rand()&3),m->x,y<<15,m->z,ang); shaker=8; eflash=4; } } return(1); } int brk_handler_explode(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i; int x,y,z; int type; int xa; int exptyp; int va; MOB *mp; if(manptr) xa=manptr->xa; else xa=0; type = m->type; x = m->x; y = m->y; z = m->z; player_rumble (manptr,RFX_CHUG); //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); play_sfx(SMP_CAR_LAND,0xff,0x1800); for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); if(--brk->hp<0) { brk->dtype=BRK_NULL; m->type=OD_NULL; if (manptr) manptr->ndestruct++; play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP_M ,x ,-0x20<<16 ,z); shaker=16; eflash=4; dual_rumble (RFX_EXP); exptyp = 0; if (brk->xtflags & 8) { if (rand() & 1) va = OD_GRENADE; else va = OD_DYNAMITE; i=create_weapon(va,x,-0x50<<16,z, 0x4000-0x1000+(rand()&0x1fff) ); mp=&items[i]; mp->spd=50+(rand()&15); mp->ysp=60+(rand()&15); mp->flg=1; mp->cnt = 3*30; } else { if ( (difflevel == 0 && brk->xtflags & 1) || (difflevel == 1 && brk->xtflags & 2) || (difflevel == 2 && brk->xtflags & 4) ) { if(type == OD_CRATEhealth ) { create_weapon(OD_PUPhealth+(rand()%3) ,x ,0 ,z ,0); exptyp = 1; } if(type == OD_CRATEpistol ) { create_weapon(OD_PISTOL2 ,x ,0 ,z ,0); exptyp = 1; } if(type == OD_CRATEshotgun ) { create_weapon(OD_SHOTGUN1 ,x ,0 ,z ,0); exptyp = 1; } if(type == OD_CRATEgrenade ) { create_weapon(OD_GRENADE ,x ,0 ,z ,0); exptyp = 1; } if(type == OD_CRATEdynamite ) { create_weapon(OD_DYNAMITE ,x ,0 ,z ,0); exptyp = 1; } if(type == OD_CRATEflare ) { create_weapon(OD_FLAREGUN ,x ,0 ,z ,0); exptyp = 1; } if (type == OD_33BARRIER1) { exptyp = 1; } if (exptyp) { for(i=0;i<8;i++) make_exp_frag_blacksmoke (OD_SMFRAG1+(rand()&3), x, y, z); } else { for(i=0;i<8;i++) make_exp_frag(OD_WRECK1+(rand()&3), x, y, z); } } } } else { m->cnt=16; } return(1); } int brk_handler_damaged(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i,j; int type; int ang; MOB *mp; int xa; if(manptr) xa=manptr->xa; else xa=0; //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); play_sfx(SMP_CAR_LAND,0xff,0x1800); m->cnt=16; if(--brk->hp<0) { type=m->type; m->type++; if(type==OD_63PILDESK1 OR type==OD_63PILDESK2 OR type==OD_63PILDESK3 OR type==OD_63PILOTCHR) { brk->hp = 4; play_sfx(SMP_CAR_DAM2,255,0x1800); } else { brk->dtype=BRK_SOLID; if (manptr) manptr->ndestruct++; play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP_M,m->x,-0x40<<16,m->z); shaker=16; eflash=4; for(i=0;i<8;i++) make_exp_frag(OD_WRECK1+(rand()&3),m->x,m->y,m->z); m->cnt=0; m->aux=30*8; if(type==OD_31HDOGSTND) { for(j=0; j < 4; j++) { i=create_weapon(OD_PUPhotdog, m->x, -0x80<<16, m->z, rand() << 1); mp=&items[i]; mp->spd=50+(rand()&15); mp->ysp=60+(rand()&15); mp->flg=1; // No-detect flag. } } if(type==OD_64GUNSTND1 OR type==OD_64GUNSTND2) { if(m->x > 0) ang = -0x4000; else ang = 0x4000; i = create_weapon(OD_FLAREGUN, m->x, -0x100<<16, m->z ,ang); mp = &items[i]; mp->spd = 32; mp->flg = 1; } if(typrand()&0x1fff); } m->type=OD_NULL; return; } } } //**************************************************************************** //char err1[40], err2[40], err3[40]; void damage_player_sub(int hitter, int struck, int damage) { ANIM *phitter; ANIM *pstruck = ply + struck; int hm, dm; if(struck < 0 OR struck >= MAXCHARS) return; if (damage > 0) { phitter = ply + hitter; if ((hitter < FIRSTBAD) && (struck >= FIRSTBAD)) { hm = 256 + ((1 - difflevel) << 7); hm = (phitter->intelligence[phitter->intelligence_level].hit_mul * hm) >> 8; } else if ((hitter >= FIRSTBAD) && (struck < FIRSTBAD)) { hm = 256 - ((1 - difflevel) << 7); hm = (phitter->intelligence[phitter->intelligence_level].hit_mul * hm) >> 8; } else { hm = phitter->intelligence[phitter->intelligence_level].hit_mul; } if (hm < 1) hm = 1; damage = (damage * hm) >> 8; } else { damage = -damage; phitter = 0; } dm = pstruck->intelligence[pstruck->intelligence_level].damage_mul; damage = (damage * dm) >> 8; if(damage < 1) damage = 1; if(phitter) phitter->manhit = struck; pstruck->phitter = hitter; pstruck->damage += damage; if ((gametype == 2) OR (struck >= FIRSTBAD) OR !(cheattype & CHEAT_INVULNERABLE)) { pstruck->health -= damage; if (pstruck->health < 0) pstruck->health=0; } if (pstruck->plygrab != -1) { ply[(int)pstruck->plygrab].grabbed = -1; pstruck->plygrab = -1; } } void anim_damage_player(int hitter, int struck, int anum) { int damage; int n; if ((hitter < 0) OR (hitter > MAXCHARS) OR (struck < 0) OR (struck > MAXCHARS)) { return; } damage = animflag[anum]; n = ply[hitter].modnum; if (n == OD_HAWK ) damage = animflag_hw[anum]; else if (n == OD_MACE ) damage = animflag_mc[anum]; else if (n == OD_SMASHER ) damage = animflag_sm[anum]; else if (n == OD_ALANA ) damage = animflag_al[anum]; damage >>= 8; damage_player_sub(hitter, struck, damage); } void object_damage_player(int hitter, int struck, int object) { int damage=0; if (hitter < 0) return; if(object == OD_MISSILE1 OR object == OD_FLARE OR object == OD_BLAST2) { damage = 64; } else if ((object == OD_31CAFESEAT) || (object == OD_31CAFSEAT1) || (object == OD_31CAFSEAT2) || (object == OD_31CAFSEAT3) || (object == OD_71DSKCHAIR)) { damage = 32; } else if ((object < OD_WEAPSTART) OR (object > OD_WEAPEND) OR (hitter < 0) OR (hitter > MAXCHARS) OR (struck < 0) OR (struck > MAXCHARS)) { return; } else { damage = weapon_type[object - OD_WEAPSTART] >> 16; } if(damage < 0) damage = 0; damage_player_sub(hitter, struck, damage); } //**************************************************************************** int brk_handler_null(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { return(0); } int brk_handler_break(BRKOBJ *brk,MOB *m,int *dp,ANIM *manptr) { int i,y,ang; int type; int xa; if(manptr) xa=manptr->xa; else xa=0; type=m->type; m->cnt=16; //create_hitspr(OD_HIT,dp[X],dp[Y],dp[Z]); play_sfx(SMP_21SUSP,160,0x1800); player_rumble (manptr,RFX_CHUG); // for(i=0;i<8;i++) make_spark_fx(dp[X],dp[Y],dp[Z],xa); if(--brk->hp<0) { m->type++; if(type==OD_41ELECKART OR type==OD_41TRAILER1) { brk->dtype=BRK_SOLID; if (manptr) manptr->ndestruct++; play_sfx(SMP_EXPLO1,255,0x1800); create_fx(OD_EXP_M,m->x,-0x40<<16,m->z); shaker=16; eflash=4; for(i=0;i<8;i++) make_exp_frag(OD_WRECK1+(rand()&3),m->x,-0x40<<16,m->z); } if(type==OD_41TURNSTLE OR type==OD_41TURNSTLE2) { m->type=OD_41TURNSTLEx; if (manptr) manptr->ndestruct++; play_sfx(SMP_EXPLO1,192,0x1800); create_fx(OD_EXP_S,m->x,-0x80<<16,m->z); shaker=8; eflash=4; manptr->px += 4 << 19; // FRIG!! brk->x1 = brk->x2 = (m->x >> 16) + (4 << 3); brk->z1 = brk->z2 = m->z >> 16; is_breakable(brk,OD_41TURNSTLEx); nbrk--; } if(type==OD_63PIPE1 OR
ift_mode=0; } } } else { level_ended=1; spcbrk[0]->dtype=BRK_NULL; } } } if(lift_pos>0) { // baddie_pause=1; if(lift_spd<0x40) lift_spd++; } } else { if(lift_pos>0x800) if(lift_spd>1) lift_spd--; } lift_pos+=lift_spd; play_freq(temp_samples[0], 0x1400 + (lift_spd << 2)); if(lift_pos>=0x1000) { lift_pos-=0x1000; lift_floor++; } #ifndef SAT_VER j=( ( ( (lift_pos*0x600)/0x1000) -0x600*2) -0x210 ) <<15; for(i=0;i<4;i++,j+=0x600<<15) { mobs[wall_mob+i].y=j; mobs[wall_mob+i+4].y=j; } #endif set_door_13(); } else if(level==LEVEL_14) { if(sublev==1 && pz_gt(32<<16)) { play_sfx(SMP_EXPLO1,255,0x1800); play_sfx(SMP_L_ALARM1,255,0x1800); sublev=2; alarm_flag=1; alarm_cnt=0; create_fx(OD_EXP_M ,-96<<19,-0x180<<16 ,120<<19); create_fx(OD_EXP_M ,-96<<19,-0x100<<16 ,120<<19); create_fx(OD_EXP_M ,-96<<19,-0x080<<16 ,120<<19); create_fx(OD_BLAST1 ,-96<<19, 0 ,120<<19); create_fx(OD_EXP_M , 96<<19,-0x180<<16 ,120<<19); create_fx(OD_EXP_M , 96<<19,-0x100<<16 ,120<<19); create_fx(OD_EXP_M , 96<<19,-0x080<<16 ,120<<19); create_fx(OD_BLAST1 , 96<<19, 0 ,120<<19); shaker=16; eflash=4; dual_rumble (RFX_SHUDDER); play_sfx(SMP_EXPLO1,192,0x1300); for(i=0;i<16;i++) make_exp_frag_ang(OD_WRECK1+(rand()&3),-96<<19,-(rand()&255)<<16,120<<19, 0x600); for(i=0;i<16;i++) make_exp_frag_ang(OD_WRECK1+(rand()&3), 96<<19,-(rand()&255)<<16,120<<19, 0x200); play_sfx(SMP_EXPLO1,128,0x0e00); baddie_pause=0; } set_alarm_14(); set_door_14(); } else if(level==LEVEL_15) { level_logic_15(); } else if(level==LEVEL_21) { do_21_ambientsound(); } else if(level==LEVEL_22) { set_traffic_lights(); if(game_del > 30*2 && sublev && (game_del&7)==0 ) { for(j=0,k=0,m=&mobs[0];j<nmobs;j++,m++) { if(m->type==OD_22POLCEBAR OR m->type==OD_22POLCBAR2) { dual_rumble (RFX_EXP); play_sfx(SMP_EXPLO1,255,0x1800); shaker=16; eflash=4; for(i=0;i<4;i++) make_exp_frag(OD_WRECK1+(rand()&3), m->x, 0, m->z); m->type=OD_NULL; if(++k > 4) break; } } } } else if(level==LEVEL_31) { if (level_ended == 1) { if (door2_pos == 0x30) spcbrk[0]->dtype = BRK_NULL; else door2_pos += 2; } if (baddie_pause == 1) { if (sublev == 0) { if (door_pos) { if (++door_pos == 32) { spcbrk[1]->dtype = BRK_NULL; sublev = 1; } } else if ( pz_gt ( (-475<<19)+(LEV31_ZMOD<<16) ) ) { spcbrk[2]->dtype = BRK_SOLID; door_pos = 1; play_sfx(SMP_EDMOVE, 0xc0, 0x1600); } } else if (sublev == 1) { if ( pz_gt( (0xf628<<16)+(LEV31_ZMOD<<16) ) ) { spcbrk[1]->dtype = BRK_SOLID; door_pos = 0; baddie_pause = 0; sublev = 2; } } else if (sublev == 2) { if (door_pos) { if (++door_pos == 32) { spcbrk[5]->dtype = BRK_NULL; sublev = 3; } } else if (px_lt( (0x780 << 16) )) { spcbrk[6]->dtype = BRK_SOLID; play_sfx(SMP_EDMOVE, 0xc0, 0x1600); door_pos = 1; } } else if (sublev == 3) { if (px_lt(0x420 << 16)) { spcbrk[5]->dtype = BRK_SOLID; door_pos = 0; baddie_pause = 0; sublev = 4; } } else if (sublev == 4) { if (door_pos) { if (++door_pos == 32) { spcbrk[3]->dtype = BRK_NULL; sublev = 5; } } else if (px_lt(-390 << 19)) { spcbrk[4]->dtype = BRK_SOLID; play_sfx(SMP_EDMOVE, 0xc0, 0x1600); temp_samples[0] = play_sfx(SMP_L_MERC, 0x70, 0x1800) + 1; door_pos = 1; } } else if (sublev == 5) { if (px_lt(-465 << 19)) { spcbrk[3]->dtype = BRK_SOLID; door_pos = 0; baddie_pause = 0; sublev = 6; } } } } else if (level == LEVEL_33) { { if (baddie_pause) spcbrk[7]->dtype = BRK_NULL; if (pz_gt(0x07c1 << 16)) sublev++, baddie_pause = 0, spcbrk[4]->dtype = BRK_SOLID; } flag1=flag2=-2; for(i=0;i<MAXCHARS;i++) { if(ply[i].health>0) { j=ply[i].pz>>16; // if( (j>-0x1380 && j<-0x0f80) OR (j>0x0780 && j<0x0b80) ) flag1=2; // if( (j>-0x0600 && j<-0x0200) ) flag2=2; if( (j>-0x12ff && j<-0x0f80) OR (j>0x07c1 && j<0x0b80) ) flag1=2; if( (j>-0x059f && j<-0x0200) ) flag2=2; // if( (j>(-0x12ff-0x80) && j<(-0x0f80+0x80) ) OR (j>(0x07c1-0x80) && j<(0x0b80+0x80) ) ) flag1=2; // if( (j>(-0x059f-0x80) && j<(-0x0200+0x80) ) ) flag2=2; } } if(door_pos==0 && flag1>0) sfx_flag=2; if(door_pos==0x40 && flag1<0) sfx_flag=2; door_pos+=flag1; if(door_pos<0) door_pos=0; if(door_pos>0x40) door_pos=0x40; if(door2_pos==0 && flag2>0) sfx_flag=1; if(door2_pos==0x40 && flag2<0) sfx_flag=1; door2_pos+=flag2; if(door2_pos<0) door2_pos=0; if(door2_pos>0x40) door2_pos=0x40; if(sfx_flag) play_sfx(SMP_EDMOVE,255,0x1700); set_door_51(); if(door_pos==0x40) i = BRK_NULL; else i = BRK_SOLID; spcbrk[8]->dtype = spcbrk[10]->dtype = i; if(door2_pos==0x40) i = BRK_NULL; else i = BRK_SOLID; spcbrk[9]->dtype = i; } void level_logic_15(void) { int i,j; if(game_del==30*7) { snd_wind = play_sfx(SMP_L_WIND,128,0x1800); shaker=16; eflash=4; play_sfx(SMP_EXPLO1,255,0x1800); play_sfx(SMP_WINDOW1,255,0x1900); dual_rumble (RFX_EXP); mobs[0].type++; for(i=-168;i>=-168*5;i-=168*2) { create_item_ang(OD_15WINPANE1+(rand()&3),-80<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3),-48<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3),-16<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3), 16<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3), 48<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3), 80<<19, i<<16, 441<<19, 0); } for(i=0;i<96;i++) { j=-96+(rand()&127)+(rand()&63); make_gldot_fx( j<<19 ,( -(rand()&511)-(rand()&255) )<<16 ,441<<19 , (j)&0x7ff ); } for(i=0;i<16;i++) { create_item(OD_15PAPER1+(rand()%3),(-16+(rand()&31))<<19, -0x80<<16, (384+(rand()&15))<<19); } for(i=0;i<16;i++) { j=-96+(rand()&127)+(rand()&63); create_item(OD_15PAPER1+(rand()%3),j<<19,-(rand()&511)<<16, 256<<19); } } if(game_del>30*7) { if((rand()&31)==0) { create_item(OD_15PAPER1+(rand()%3),(-96+(rand()&127)+(rand()&63))<<19,-(rand()&511)<<16, 256<<19); play_sfx(SMP_PAPER1+(rand()&1),255,0x1700+(rand()&0x1ff) ); } } } void levels_logic() { int i,j,k; MOB *m; if(gen_time > 0) gen_time--; if(level==LEVEL_11) { set_11van2_door(); } else if(level==LEVEL_12) { set_door_12(); // update_monitor(); } else if(level==LEVEL_13) { #if DEBUG==1 // if((game_del&63)==0) make_fallglas_fx(0,-0x240<<16,0); #endif if((lift_floor&1)==0) { if(lift_pos==0) { if(lift_mode==0) { lift_spd=0; baddie_pause=1; if (door_pos == 0) play_sfx(SMP_EDMOVE, 0xff, 0x1700), play_sfx(SMP_LIFTBONG, 0xff, 0x1800); if(lift_floor&2) { door_pos++; if(door_pos==32) { baddie_pause=0; lift_mode=1; } } else if(game_del>30*2) { door_pos++; if(door_pos==32) { baddie_pause=0; lift_mode=1; } } } else if(lift_mode==1) { baddie_pause=0; if(baddies_left>0) lift_mode++; } else if(lift_mode==2 && game_del>30*2) { if (door_pos == 30) play_sfx(SMP_EDMOVE, 0xff, 0x1700); for(i=0;i<MAXCHARS;i++) { if(is_active(i)) continue; if(ply[i].pz > 64<<19) break; } if(elevator_flag==1) { if (i == MAXCHARS) { if (door_pos > 0) door_pos--; } if(baddie_pause==1) { if(door_pos>0) door_pos--; if(door_pos==0) { lift_pos++;
if (baddie_pause) { if ((sublev == 1) && pz_gt(0xe680 << 16)) baddie_pause = 0, sublev = 2; } } else if (level == LEVEL_33A) { if(baddie_pause && sublev==1 && pz_gt(240 << 19) ) { sublev = 2; baddie_pause = 0; spcbrk[2]->dtype = BRK_SOLID; } } else if(level==LEVEL_41 OR level==LEVEL_42) { if (level == LEVEL_42) { spcbrk[2]->dtype = BRK_SOLID; } if(baddie_pause) { if((sublev == 0) && pz_gt(0x0000 << 16)) { if (level == LEVEL_41) { spcbrk[2]->dtype = BRK_SOLID; baddie_pause = 0, sublev++; } } } set_41train_door(); } else if(level==LEVEL_51) { levels_logic_51(); } else if(level==LEVEL_63) { set_door_63(); } else if (level == LEVEL_66) { if (baddie_pause) { if (px_lt(570 << 19)) baddie_pause = 0, spcbrk[2]->dtype = BRK_SOLID; } } } //**************************************************************************** void handle_items() { int i; int type; MOB *m; m=(MOB*)&items; for(i=0;i<NITEMS;i++,m++) { if((type=m->type)==-1) continue; if(hand_items_jmp[type]==0) handle_movables(m); else (*hand_items_jmp[type])(m); } } //**************************************************************************** void handle_fxsprs() { int i; int type; MOB *m; m=(MOB*)&fxspr; for(i=0;i<NFXSPR;i++,m++) { if((type=m->type)==-1) continue; if(hand_fxspr_jmp[type]!=0) (*hand_fxspr_jmp[type])(m); } } //**************************************************************************** extern MTXTR_LINK *obj_free_tx_link; extern int scaletimer; void output_items() { int i,j; int type; MOB *m; char used[NITEMS]; if ( (can_pick[0] == -1) && (can_pick[1] == -1) ) { scaletimer = 0; } else { scaletimer ++; } set_memory(used,0,NITEMS); for(i=0;i<MAXCHARS;i++) { j=ply[i].lweap; if(j!=-1) used[j]=1; j=ply[i].rweap; if(j!=-1) used[j]=1; } slUnitMatrix (0); m=(MOB*)&items; for(i=0;i<NITEMS;i++,m++) { if((type=m->type)==-1) continue; if(used[i]) continue; if (type != 0x69) // ??? { j = 2; } if(outp_items_jmp[type]!=0) { (*outp_items_jmp[type])(m); } else { output_other_items(m); } } } //**************************************************************************** void output_fxsprs() { int i; int type; MOB *m; m=(MOB*)&fxspr; for(i=0;i<NFXSPR;i++,m++) { if((type=m->type)==-1) continue; //if (type == OD_SMOKE1 || type == OD_SMOKE2) continue; if(outp_fxspr_jmp[type]!=0) (*outp_fxspr_jmp[type])(m); else output_fxsprite(m); } } //**************************************************************************** void damage_mob(int i,MOB *w) { BRKOBJ *brk=&brktab[i]; MOB *m; int dp[4]; int type; m=brk->mp; type=w->type; if(type==OD_VAN2BODa) return; if(type==OD_BIKE) return; if( (type>=OD_PISTOL2 && type<=OD_PISTOL6) OR type==OD_SHOTGUN1) { } else { brk->hp=-1; } dp[X]=w->x; dp[Y]=w->y; dp[Z]=w->z; (*brkhandler[brk->dtype])(brk,m,dp,0); } //**************************************************************************** void knock_down_object(int pnum,int det) { int i; int x,z; int dp[4]; MOB *m,*mp; set_detect_point(pnum,det,dp); // make_hit_fx2(dp[X],dp[Y],dp[Z],0); // Detection frig. x=dp[X]>>16; z=dp[Z]>>16; for(i=0,m=&mobs[0];i<nmobs;i++,m++) { if(m->type!=OD_WALLTV1 && m->type!=OD_WALLTV2) continue; if(get_dist(x,z,m->x>>16,m->z>>16) < 0xc0) { if(m->type==OD_WALLTV1 OR m->type==OD_WALLTV2) { play_sfx(SMP_21SUSP,255,0x1800); // play_sfx(SMP_EXPLO1,128,0x1800); create_fx(OD_EXP_S,m->x,m->y,m->z); shaker=8; dual_rumble (RFX_EXP); i=create_weapon(OD_INFOSCRN,m->x,m->y,m->z,0); mp=&items[i]; mp->spd=64; mp->ysp=32; if(m->type==OD_WALLTV1) m->xa=0xc000; else m->xa=0x8000; mp->xa+=-0x1000+(