7 =============================================================================
\r
11 =============================================================================
\r
14 #define PROJECTILESIZE 0xc000l
\r
16 #define BJRUNSPEED 2048
\r
17 #define BJJUMPSPEED 680
\r
21 =============================================================================
\r
25 =============================================================================
\r
31 =============================================================================
\r
35 =============================================================================
\r
39 dirtype dirtable[9] = {northwest,north,northeast,west,nodir,east,
\r
40 southwest,south,southeast};
\r
42 int starthitpoints[4][NUMENEMIES] =
\r
54 800, // mecha hitler
\r
72 // DON'T HURT ME MODE
\r
81 950, // mecha hitler
\r
99 // BRING 'EM ON MODE
\r
108 400, // fake hitler
\r
109 1050, // mecha hitler
\r
128 // DEATH INCARNATE MODE
\r
137 500, // fake hitler
\r
138 1200, // mecha hitler
\r
158 void A_StartDeathCam (objtype *ob);
\r
161 void T_Path (objtype *ob);
\r
162 void T_Shoot (objtype *ob);
\r
163 void T_Bite (objtype *ob);
\r
164 void T_DogChase (objtype *ob);
\r
165 void T_Chase (objtype *ob);
\r
166 void T_Projectile (objtype *ob);
\r
167 void T_Stand (objtype *ob);
\r
169 void A_DeathScream (objtype *ob);
\r
171 extern statetype s_rocket;
\r
172 extern statetype s_smoke1;
\r
173 extern statetype s_smoke2;
\r
174 extern statetype s_smoke3;
\r
175 extern statetype s_smoke4;
\r
176 extern statetype s_boom2;
\r
177 extern statetype s_boom3;
\r
179 void A_Smoke (objtype *ob);
\r
181 statetype s_rocket = {true,SPR_ROCKET_1,3,T_Projectile,A_Smoke,&s_rocket};
\r
182 statetype s_smoke1 = {false,SPR_SMOKE_1,3,NULL,NULL,&s_smoke2};
\r
183 statetype s_smoke2 = {false,SPR_SMOKE_2,3,NULL,NULL,&s_smoke3};
\r
184 statetype s_smoke3 = {false,SPR_SMOKE_3,3,NULL,NULL,&s_smoke4};
\r
185 statetype s_smoke4 = {false,SPR_SMOKE_4,3,NULL,NULL,NULL};
\r
187 statetype s_boom1 = {false,SPR_BOOM_1,6,NULL,NULL,&s_boom2};
\r
188 statetype s_boom2 = {false,SPR_BOOM_2,6,NULL,NULL,&s_boom3};
\r
189 statetype s_boom3 = {false,SPR_BOOM_3,6,NULL,NULL,NULL};
\r
193 extern statetype s_hrocket;
\r
194 extern statetype s_hsmoke1;
\r
195 extern statetype s_hsmoke2;
\r
196 extern statetype s_hsmoke3;
\r
197 extern statetype s_hsmoke4;
\r
198 extern statetype s_hboom2;
\r
199 extern statetype s_hboom3;
\r
201 void A_Smoke (objtype *ob);
\r
203 statetype s_hrocket = {true,SPR_HROCKET_1,3,T_Projectile,A_Smoke,&s_hrocket};
\r
204 statetype s_hsmoke1 = {false,SPR_HSMOKE_1,3,NULL,NULL,&s_hsmoke2};
\r
205 statetype s_hsmoke2 = {false,SPR_HSMOKE_2,3,NULL,NULL,&s_hsmoke3};
\r
206 statetype s_hsmoke3 = {false,SPR_HSMOKE_3,3,NULL,NULL,&s_hsmoke4};
\r
207 statetype s_hsmoke4 = {false,SPR_HSMOKE_4,3,NULL,NULL,NULL};
\r
209 statetype s_hboom1 = {false,SPR_HBOOM_1,6,NULL,NULL,&s_hboom2};
\r
210 statetype s_hboom2 = {false,SPR_HBOOM_2,6,NULL,NULL,&s_hboom3};
\r
211 statetype s_hboom3 = {false,SPR_HBOOM_3,6,NULL,NULL,NULL};
\r
215 void T_Schabb (objtype *ob);
\r
216 void T_SchabbThrow (objtype *ob);
\r
217 void T_Fake (objtype *ob);
\r
218 void T_FakeFire (objtype *ob);
\r
219 void T_Ghosts (objtype *ob);
\r
221 void A_Slurpie (objtype *ob);
\r
222 void A_HitlerMorph (objtype *ob);
\r
223 void A_MechaSound (objtype *ob);
\r
233 void A_Smoke (objtype *ob)
\r
237 if (ob->obclass == hrocketobj)
\r
238 new->state = &s_hsmoke1;
\r
241 new->state = &s_smoke1;
\r
244 new->tilex = ob->tilex;
\r
245 new->tiley = ob->tiley;
\r
248 new->obclass = inertobj;
\r
249 new->active = true;
\r
251 new->flags = FL_NEVERMARK;
\r
256 ===================
\r
258 = ProjectileTryMove
\r
260 = returns true if move ok
\r
261 ===================
\r
264 #define PROJSIZE 0x2000
\r
266 boolean ProjectileTryMove (objtype *ob)
\r
268 int xl,yl,xh,yh,x,y;
\r
270 long deltax,deltay;
\r
272 xl = (ob->x-PROJSIZE) >>TILESHIFT;
\r
273 yl = (ob->y-PROJSIZE) >>TILESHIFT;
\r
275 xh = (ob->x+PROJSIZE) >>TILESHIFT;
\r
276 yh = (ob->y+PROJSIZE) >>TILESHIFT;
\r
279 // check for solid walls
\r
281 for (y=yl;y<=yh;y++)
\r
282 for (x=xl;x<=xh;x++)
\r
284 check = actorat[x][y];
\r
285 if (check && check<objlist)
\r
302 void T_Projectile (objtype *ob)
\r
304 long deltax,deltay;
\r
308 speed = (long)ob->speed*tics;
\r
310 deltax = FixedByFrac(speed,costable[ob->angle]);
\r
311 deltay = -FixedByFrac(speed,sintable[ob->angle]);
\r
313 if (deltax>0x10000l)
\r
315 if (deltay>0x10000l)
\r
321 deltax = LABS(ob->x - player->x);
\r
322 deltay = LABS(ob->y - player->y);
\r
324 if (!ProjectileTryMove (ob))
\r
326 if (ob->obclass == rocketobj)
\r
328 PlaySoundLocActor(MISSILEHITSND,ob);
\r
329 ob->state = &s_boom1;
\r
332 else if (ob->obclass == hrocketobj)
\r
334 PlaySoundLocActor(MISSILEHITSND,ob);
\r
335 ob->state = &s_hboom1;
\r
339 ob->state = NULL; // mark for removal
\r
344 if (deltax < PROJECTILESIZE && deltay < PROJECTILESIZE)
\r
345 { // hit the player
\r
346 switch (ob->obclass)
\r
349 damage = (US_RndT() >>3) + 20;
\r
354 damage = (US_RndT() >>3) + 30;
\r
357 damage = (US_RndT() >>3);
\r
361 TakeDamage (damage,ob);
\r
362 ob->state = NULL; // mark for removal
\r
366 ob->tilex = ob->x >> TILESHIFT;
\r
367 ob->tiley = ob->y >> TILESHIFT;
\r
375 =============================================================================
\r
379 =============================================================================
\r
386 extern statetype s_grdstand;
\r
388 extern statetype s_grdpath1;
\r
389 extern statetype s_grdpath1s;
\r
390 extern statetype s_grdpath2;
\r
391 extern statetype s_grdpath3;
\r
392 extern statetype s_grdpath3s;
\r
393 extern statetype s_grdpath4;
\r
395 extern statetype s_grdpain;
\r
396 extern statetype s_grdpain1;
\r
398 extern statetype s_grdgiveup;
\r
400 extern statetype s_grdshoot1;
\r
401 extern statetype s_grdshoot2;
\r
402 extern statetype s_grdshoot3;
\r
403 extern statetype s_grdshoot4;
\r
405 extern statetype s_grdchase1;
\r
406 extern statetype s_grdchase1s;
\r
407 extern statetype s_grdchase2;
\r
408 extern statetype s_grdchase3;
\r
409 extern statetype s_grdchase3s;
\r
410 extern statetype s_grdchase4;
\r
412 extern statetype s_grddie1;
\r
413 extern statetype s_grddie1d;
\r
414 extern statetype s_grddie2;
\r
415 extern statetype s_grddie3;
\r
416 extern statetype s_grddie4;
\r
418 statetype s_grdstand = {true,SPR_GRD_S_1,0,T_Stand,NULL,&s_grdstand};
\r
420 statetype s_grdpath1 = {true,SPR_GRD_W1_1,20,T_Path,NULL,&s_grdpath1s};
\r
421 statetype s_grdpath1s = {true,SPR_GRD_W1_1,5,NULL,NULL,&s_grdpath2};
\r
422 statetype s_grdpath2 = {true,SPR_GRD_W2_1,15,T_Path,NULL,&s_grdpath3};
\r
423 statetype s_grdpath3 = {true,SPR_GRD_W3_1,20,T_Path,NULL,&s_grdpath3s};
\r
424 statetype s_grdpath3s = {true,SPR_GRD_W3_1,5,NULL,NULL,&s_grdpath4};
\r
425 statetype s_grdpath4 = {true,SPR_GRD_W4_1,15,T_Path,NULL,&s_grdpath1};
\r
427 statetype s_grdpain = {2,SPR_GRD_PAIN_1,10,NULL,NULL,&s_grdchase1};
\r
428 statetype s_grdpain1 = {2,SPR_GRD_PAIN_2,10,NULL,NULL,&s_grdchase1};
\r
430 statetype s_grdshoot1 = {false,SPR_GRD_SHOOT1,20,NULL,NULL,&s_grdshoot2};
\r
431 statetype s_grdshoot2 = {false,SPR_GRD_SHOOT2,20,NULL,T_Shoot,&s_grdshoot3};
\r
432 statetype s_grdshoot3 = {false,SPR_GRD_SHOOT3,20,NULL,NULL,&s_grdchase1};
\r
434 statetype s_grdchase1 = {true,SPR_GRD_W1_1,10,T_Chase,NULL,&s_grdchase1s};
\r
435 statetype s_grdchase1s = {true,SPR_GRD_W1_1,3,NULL,NULL,&s_grdchase2};
\r
436 statetype s_grdchase2 = {true,SPR_GRD_W2_1,8,T_Chase,NULL,&s_grdchase3};
\r
437 statetype s_grdchase3 = {true,SPR_GRD_W3_1,10,T_Chase,NULL,&s_grdchase3s};
\r
438 statetype s_grdchase3s = {true,SPR_GRD_W3_1,3,NULL,NULL,&s_grdchase4};
\r
439 statetype s_grdchase4 = {true,SPR_GRD_W4_1,8,T_Chase,NULL,&s_grdchase1};
\r
441 statetype s_grddie1 = {false,SPR_GRD_DIE_1,15,NULL,A_DeathScream,&s_grddie2};
\r
442 statetype s_grddie2 = {false,SPR_GRD_DIE_2,15,NULL,NULL,&s_grddie3};
\r
443 statetype s_grddie3 = {false,SPR_GRD_DIE_3,15,NULL,NULL,&s_grddie4};
\r
444 statetype s_grddie4 = {false,SPR_GRD_DEAD,0,NULL,NULL,&s_grddie4};
\r
451 extern statetype s_blinkychase1;
\r
452 extern statetype s_blinkychase2;
\r
453 extern statetype s_inkychase1;
\r
454 extern statetype s_inkychase2;
\r
455 extern statetype s_pinkychase1;
\r
456 extern statetype s_pinkychase2;
\r
457 extern statetype s_clydechase1;
\r
458 extern statetype s_clydechase2;
\r
460 statetype s_blinkychase1 = {false,SPR_BLINKY_W1,10,T_Ghosts,NULL,&s_blinkychase2};
\r
461 statetype s_blinkychase2 = {false,SPR_BLINKY_W2,10,T_Ghosts,NULL,&s_blinkychase1};
\r
463 statetype s_inkychase1 = {false,SPR_INKY_W1,10,T_Ghosts,NULL,&s_inkychase2};
\r
464 statetype s_inkychase2 = {false,SPR_INKY_W2,10,T_Ghosts,NULL,&s_inkychase1};
\r
466 statetype s_pinkychase1 = {false,SPR_PINKY_W1,10,T_Ghosts,NULL,&s_pinkychase2};
\r
467 statetype s_pinkychase2 = {false,SPR_PINKY_W2,10,T_Ghosts,NULL,&s_pinkychase1};
\r
469 statetype s_clydechase1 = {false,SPR_CLYDE_W1,10,T_Ghosts,NULL,&s_clydechase2};
\r
470 statetype s_clydechase2 = {false,SPR_CLYDE_W2,10,T_Ghosts,NULL,&s_clydechase1};
\r
477 extern statetype s_dogpath1;
\r
478 extern statetype s_dogpath1s;
\r
479 extern statetype s_dogpath2;
\r
480 extern statetype s_dogpath3;
\r
481 extern statetype s_dogpath3s;
\r
482 extern statetype s_dogpath4;
\r
484 extern statetype s_dogjump1;
\r
485 extern statetype s_dogjump2;
\r
486 extern statetype s_dogjump3;
\r
487 extern statetype s_dogjump4;
\r
488 extern statetype s_dogjump5;
\r
490 extern statetype s_dogchase1;
\r
491 extern statetype s_dogchase1s;
\r
492 extern statetype s_dogchase2;
\r
493 extern statetype s_dogchase3;
\r
494 extern statetype s_dogchase3s;
\r
495 extern statetype s_dogchase4;
\r
497 extern statetype s_dogdie1;
\r
498 extern statetype s_dogdie1d;
\r
499 extern statetype s_dogdie2;
\r
500 extern statetype s_dogdie3;
\r
501 extern statetype s_dogdead;
\r
503 statetype s_dogpath1 = {true,SPR_DOG_W1_1,20,T_Path,NULL,&s_dogpath1s};
\r
504 statetype s_dogpath1s = {true,SPR_DOG_W1_1,5,NULL,NULL,&s_dogpath2};
\r
505 statetype s_dogpath2 = {true,SPR_DOG_W2_1,15,T_Path,NULL,&s_dogpath3};
\r
506 statetype s_dogpath3 = {true,SPR_DOG_W3_1,20,T_Path,NULL,&s_dogpath3s};
\r
507 statetype s_dogpath3s = {true,SPR_DOG_W3_1,5,NULL,NULL,&s_dogpath4};
\r
508 statetype s_dogpath4 = {true,SPR_DOG_W4_1,15,T_Path,NULL,&s_dogpath1};
\r
510 statetype s_dogjump1 = {false,SPR_DOG_JUMP1,10,NULL,NULL,&s_dogjump2};
\r
511 statetype s_dogjump2 = {false,SPR_DOG_JUMP2,10,NULL,T_Bite,&s_dogjump3};
\r
512 statetype s_dogjump3 = {false,SPR_DOG_JUMP3,10,NULL,NULL,&s_dogjump4};
\r
513 statetype s_dogjump4 = {false,SPR_DOG_JUMP1,10,NULL,NULL,&s_dogjump5};
\r
514 statetype s_dogjump5 = {false,SPR_DOG_W1_1,10,NULL,NULL,&s_dogchase1};
\r
516 statetype s_dogchase1 = {true,SPR_DOG_W1_1,10,T_DogChase,NULL,&s_dogchase1s};
\r
517 statetype s_dogchase1s = {true,SPR_DOG_W1_1,3,NULL,NULL,&s_dogchase2};
\r
518 statetype s_dogchase2 = {true,SPR_DOG_W2_1,8,T_DogChase,NULL,&s_dogchase3};
\r
519 statetype s_dogchase3 = {true,SPR_DOG_W3_1,10,T_DogChase,NULL,&s_dogchase3s};
\r
520 statetype s_dogchase3s = {true,SPR_DOG_W3_1,3,NULL,NULL,&s_dogchase4};
\r
521 statetype s_dogchase4 = {true,SPR_DOG_W4_1,8,T_DogChase,NULL,&s_dogchase1};
\r
523 statetype s_dogdie1 = {false,SPR_DOG_DIE_1,15,NULL,A_DeathScream,&s_dogdie2};
\r
524 statetype s_dogdie2 = {false,SPR_DOG_DIE_2,15,NULL,NULL,&s_dogdie3};
\r
525 statetype s_dogdie3 = {false,SPR_DOG_DIE_3,15,NULL,NULL,&s_dogdead};
\r
526 statetype s_dogdead = {false,SPR_DOG_DEAD,15,NULL,NULL,&s_dogdead};
\r
533 extern statetype s_ofcstand;
\r
535 extern statetype s_ofcpath1;
\r
536 extern statetype s_ofcpath1s;
\r
537 extern statetype s_ofcpath2;
\r
538 extern statetype s_ofcpath3;
\r
539 extern statetype s_ofcpath3s;
\r
540 extern statetype s_ofcpath4;
\r
542 extern statetype s_ofcpain;
\r
543 extern statetype s_ofcpain1;
\r
545 extern statetype s_ofcgiveup;
\r
547 extern statetype s_ofcshoot1;
\r
548 extern statetype s_ofcshoot2;
\r
549 extern statetype s_ofcshoot3;
\r
550 extern statetype s_ofcshoot4;
\r
552 extern statetype s_ofcchase1;
\r
553 extern statetype s_ofcchase1s;
\r
554 extern statetype s_ofcchase2;
\r
555 extern statetype s_ofcchase3;
\r
556 extern statetype s_ofcchase3s;
\r
557 extern statetype s_ofcchase4;
\r
559 extern statetype s_ofcdie1;
\r
560 extern statetype s_ofcdie2;
\r
561 extern statetype s_ofcdie3;
\r
562 extern statetype s_ofcdie4;
\r
563 extern statetype s_ofcdie5;
\r
565 statetype s_ofcstand = {true,SPR_OFC_S_1,0,T_Stand,NULL,&s_ofcstand};
\r
567 statetype s_ofcpath1 = {true,SPR_OFC_W1_1,20,T_Path,NULL,&s_ofcpath1s};
\r
568 statetype s_ofcpath1s = {true,SPR_OFC_W1_1,5,NULL,NULL,&s_ofcpath2};
\r
569 statetype s_ofcpath2 = {true,SPR_OFC_W2_1,15,T_Path,NULL,&s_ofcpath3};
\r
570 statetype s_ofcpath3 = {true,SPR_OFC_W3_1,20,T_Path,NULL,&s_ofcpath3s};
\r
571 statetype s_ofcpath3s = {true,SPR_OFC_W3_1,5,NULL,NULL,&s_ofcpath4};
\r
572 statetype s_ofcpath4 = {true,SPR_OFC_W4_1,15,T_Path,NULL,&s_ofcpath1};
\r
574 statetype s_ofcpain = {2,SPR_OFC_PAIN_1,10,NULL,NULL,&s_ofcchase1};
\r
575 statetype s_ofcpain1 = {2,SPR_OFC_PAIN_2,10,NULL,NULL,&s_ofcchase1};
\r
577 statetype s_ofcshoot1 = {false,SPR_OFC_SHOOT1,6,NULL,NULL,&s_ofcshoot2};
\r
578 statetype s_ofcshoot2 = {false,SPR_OFC_SHOOT2,20,NULL,T_Shoot,&s_ofcshoot3};
\r
579 statetype s_ofcshoot3 = {false,SPR_OFC_SHOOT3,10,NULL,NULL,&s_ofcchase1};
\r
581 statetype s_ofcchase1 = {true,SPR_OFC_W1_1,10,T_Chase,NULL,&s_ofcchase1s};
\r
582 statetype s_ofcchase1s = {true,SPR_OFC_W1_1,3,NULL,NULL,&s_ofcchase2};
\r
583 statetype s_ofcchase2 = {true,SPR_OFC_W2_1,8,T_Chase,NULL,&s_ofcchase3};
\r
584 statetype s_ofcchase3 = {true,SPR_OFC_W3_1,10,T_Chase,NULL,&s_ofcchase3s};
\r
585 statetype s_ofcchase3s = {true,SPR_OFC_W3_1,3,NULL,NULL,&s_ofcchase4};
\r
586 statetype s_ofcchase4 = {true,SPR_OFC_W4_1,8,T_Chase,NULL,&s_ofcchase1};
\r
588 statetype s_ofcdie1 = {false,SPR_OFC_DIE_1,11,NULL,A_DeathScream,&s_ofcdie2};
\r
589 statetype s_ofcdie2 = {false,SPR_OFC_DIE_2,11,NULL,NULL,&s_ofcdie3};
\r
590 statetype s_ofcdie3 = {false,SPR_OFC_DIE_3,11,NULL,NULL,&s_ofcdie4};
\r
591 statetype s_ofcdie4 = {false,SPR_OFC_DIE_4,11,NULL,NULL,&s_ofcdie5};
\r
592 statetype s_ofcdie5 = {false,SPR_OFC_DEAD,0,NULL,NULL,&s_ofcdie5};
\r
599 extern statetype s_mutstand;
\r
601 extern statetype s_mutpath1;
\r
602 extern statetype s_mutpath1s;
\r
603 extern statetype s_mutpath2;
\r
604 extern statetype s_mutpath3;
\r
605 extern statetype s_mutpath3s;
\r
606 extern statetype s_mutpath4;
\r
608 extern statetype s_mutpain;
\r
609 extern statetype s_mutpain1;
\r
611 extern statetype s_mutgiveup;
\r
613 extern statetype s_mutshoot1;
\r
614 extern statetype s_mutshoot2;
\r
615 extern statetype s_mutshoot3;
\r
616 extern statetype s_mutshoot4;
\r
618 extern statetype s_mutchase1;
\r
619 extern statetype s_mutchase1s;
\r
620 extern statetype s_mutchase2;
\r
621 extern statetype s_mutchase3;
\r
622 extern statetype s_mutchase3s;
\r
623 extern statetype s_mutchase4;
\r
625 extern statetype s_mutdie1;
\r
626 extern statetype s_mutdie2;
\r
627 extern statetype s_mutdie3;
\r
628 extern statetype s_mutdie4;
\r
629 extern statetype s_mutdie5;
\r
631 statetype s_mutstand = {true,SPR_MUT_S_1,0,T_Stand,NULL,&s_mutstand};
\r
633 statetype s_mutpath1 = {true,SPR_MUT_W1_1,20,T_Path,NULL,&s_mutpath1s};
\r
634 statetype s_mutpath1s = {true,SPR_MUT_W1_1,5,NULL,NULL,&s_mutpath2};
\r
635 statetype s_mutpath2 = {true,SPR_MUT_W2_1,15,T_Path,NULL,&s_mutpath3};
\r
636 statetype s_mutpath3 = {true,SPR_MUT_W3_1,20,T_Path,NULL,&s_mutpath3s};
\r
637 statetype s_mutpath3s = {true,SPR_MUT_W3_1,5,NULL,NULL,&s_mutpath4};
\r
638 statetype s_mutpath4 = {true,SPR_MUT_W4_1,15,T_Path,NULL,&s_mutpath1};
\r
640 statetype s_mutpain = {2,SPR_MUT_PAIN_1,10,NULL,NULL,&s_mutchase1};
\r
641 statetype s_mutpain1 = {2,SPR_MUT_PAIN_2,10,NULL,NULL,&s_mutchase1};
\r
643 statetype s_mutshoot1 = {false,SPR_MUT_SHOOT1,6,NULL,T_Shoot,&s_mutshoot2};
\r
644 statetype s_mutshoot2 = {false,SPR_MUT_SHOOT2,20,NULL,NULL,&s_mutshoot3};
\r
645 statetype s_mutshoot3 = {false,SPR_MUT_SHOOT3,10,NULL,T_Shoot,&s_mutshoot4};
\r
646 statetype s_mutshoot4 = {false,SPR_MUT_SHOOT4,20,NULL,NULL,&s_mutchase1};
\r
648 statetype s_mutchase1 = {true,SPR_MUT_W1_1,10,T_Chase,NULL,&s_mutchase1s};
\r
649 statetype s_mutchase1s = {true,SPR_MUT_W1_1,3,NULL,NULL,&s_mutchase2};
\r
650 statetype s_mutchase2 = {true,SPR_MUT_W2_1,8,T_Chase,NULL,&s_mutchase3};
\r
651 statetype s_mutchase3 = {true,SPR_MUT_W3_1,10,T_Chase,NULL,&s_mutchase3s};
\r
652 statetype s_mutchase3s = {true,SPR_MUT_W3_1,3,NULL,NULL,&s_mutchase4};
\r
653 statetype s_mutchase4 = {true,SPR_MUT_W4_1,8,T_Chase,NULL,&s_mutchase1};
\r
655 statetype s_mutdie1 = {false,SPR_MUT_DIE_1,7,NULL,A_DeathScream,&s_mutdie2};
\r
656 statetype s_mutdie2 = {false,SPR_MUT_DIE_2,7,NULL,NULL,&s_mutdie3};
\r
657 statetype s_mutdie3 = {false,SPR_MUT_DIE_3,7,NULL,NULL,&s_mutdie4};
\r
658 statetype s_mutdie4 = {false,SPR_MUT_DIE_4,7,NULL,NULL,&s_mutdie5};
\r
659 statetype s_mutdie5 = {false,SPR_MUT_DEAD,0,NULL,NULL,&s_mutdie5};
\r
666 extern statetype s_ssstand;
\r
668 extern statetype s_sspath1;
\r
669 extern statetype s_sspath1s;
\r
670 extern statetype s_sspath2;
\r
671 extern statetype s_sspath3;
\r
672 extern statetype s_sspath3s;
\r
673 extern statetype s_sspath4;
\r
675 extern statetype s_sspain;
\r
676 extern statetype s_sspain1;
\r
678 extern statetype s_ssshoot1;
\r
679 extern statetype s_ssshoot2;
\r
680 extern statetype s_ssshoot3;
\r
681 extern statetype s_ssshoot4;
\r
682 extern statetype s_ssshoot5;
\r
683 extern statetype s_ssshoot6;
\r
684 extern statetype s_ssshoot7;
\r
685 extern statetype s_ssshoot8;
\r
686 extern statetype s_ssshoot9;
\r
688 extern statetype s_sschase1;
\r
689 extern statetype s_sschase1s;
\r
690 extern statetype s_sschase2;
\r
691 extern statetype s_sschase3;
\r
692 extern statetype s_sschase3s;
\r
693 extern statetype s_sschase4;
\r
695 extern statetype s_ssdie1;
\r
696 extern statetype s_ssdie2;
\r
697 extern statetype s_ssdie3;
\r
698 extern statetype s_ssdie4;
\r
700 statetype s_ssstand = {true,SPR_SS_S_1,0,T_Stand,NULL,&s_ssstand};
\r
702 statetype s_sspath1 = {true,SPR_SS_W1_1,20,T_Path,NULL,&s_sspath1s};
\r
703 statetype s_sspath1s = {true,SPR_SS_W1_1,5,NULL,NULL,&s_sspath2};
\r
704 statetype s_sspath2 = {true,SPR_SS_W2_1,15,T_Path,NULL,&s_sspath3};
\r
705 statetype s_sspath3 = {true,SPR_SS_W3_1,20,T_Path,NULL,&s_sspath3s};
\r
706 statetype s_sspath3s = {true,SPR_SS_W3_1,5,NULL,NULL,&s_sspath4};
\r
707 statetype s_sspath4 = {true,SPR_SS_W4_1,15,T_Path,NULL,&s_sspath1};
\r
709 statetype s_sspain = {2,SPR_SS_PAIN_1,10,NULL,NULL,&s_sschase1};
\r
710 statetype s_sspain1 = {2,SPR_SS_PAIN_2,10,NULL,NULL,&s_sschase1};
\r
712 statetype s_ssshoot1 = {false,SPR_SS_SHOOT1,20,NULL,NULL,&s_ssshoot2};
\r
713 statetype s_ssshoot2 = {false,SPR_SS_SHOOT2,20,NULL,T_Shoot,&s_ssshoot3};
\r
714 statetype s_ssshoot3 = {false,SPR_SS_SHOOT3,10,NULL,NULL,&s_ssshoot4};
\r
715 statetype s_ssshoot4 = {false,SPR_SS_SHOOT2,10,NULL,T_Shoot,&s_ssshoot5};
\r
716 statetype s_ssshoot5 = {false,SPR_SS_SHOOT3,10,NULL,NULL,&s_ssshoot6};
\r
717 statetype s_ssshoot6 = {false,SPR_SS_SHOOT2,10,NULL,T_Shoot,&s_ssshoot7};
\r
718 statetype s_ssshoot7 = {false,SPR_SS_SHOOT3,10,NULL,NULL,&s_ssshoot8};
\r
719 statetype s_ssshoot8 = {false,SPR_SS_SHOOT2,10,NULL,T_Shoot,&s_ssshoot9};
\r
720 statetype s_ssshoot9 = {false,SPR_SS_SHOOT3,10,NULL,NULL,&s_sschase1};
\r
722 statetype s_sschase1 = {true,SPR_SS_W1_1,10,T_Chase,NULL,&s_sschase1s};
\r
723 statetype s_sschase1s = {true,SPR_SS_W1_1,3,NULL,NULL,&s_sschase2};
\r
724 statetype s_sschase2 = {true,SPR_SS_W2_1,8,T_Chase,NULL,&s_sschase3};
\r
725 statetype s_sschase3 = {true,SPR_SS_W3_1,10,T_Chase,NULL,&s_sschase3s};
\r
726 statetype s_sschase3s = {true,SPR_SS_W3_1,3,NULL,NULL,&s_sschase4};
\r
727 statetype s_sschase4 = {true,SPR_SS_W4_1,8,T_Chase,NULL,&s_sschase1};
\r
729 statetype s_ssdie1 = {false,SPR_SS_DIE_1,15,NULL,A_DeathScream,&s_ssdie2};
\r
730 statetype s_ssdie2 = {false,SPR_SS_DIE_2,15,NULL,NULL,&s_ssdie3};
\r
731 statetype s_ssdie3 = {false,SPR_SS_DIE_3,15,NULL,NULL,&s_ssdie4};
\r
732 statetype s_ssdie4 = {false,SPR_SS_DEAD,0,NULL,NULL,&s_ssdie4};
\r
739 extern statetype s_bossstand;
\r
741 extern statetype s_bosschase1;
\r
742 extern statetype s_bosschase1s;
\r
743 extern statetype s_bosschase2;
\r
744 extern statetype s_bosschase3;
\r
745 extern statetype s_bosschase3s;
\r
746 extern statetype s_bosschase4;
\r
748 extern statetype s_bossdie1;
\r
749 extern statetype s_bossdie2;
\r
750 extern statetype s_bossdie3;
\r
751 extern statetype s_bossdie4;
\r
753 extern statetype s_bossshoot1;
\r
754 extern statetype s_bossshoot2;
\r
755 extern statetype s_bossshoot3;
\r
756 extern statetype s_bossshoot4;
\r
757 extern statetype s_bossshoot5;
\r
758 extern statetype s_bossshoot6;
\r
759 extern statetype s_bossshoot7;
\r
760 extern statetype s_bossshoot8;
\r
763 statetype s_bossstand = {false,SPR_BOSS_W1,0,T_Stand,NULL,&s_bossstand};
\r
765 statetype s_bosschase1 = {false,SPR_BOSS_W1,10,T_Chase,NULL,&s_bosschase1s};
\r
766 statetype s_bosschase1s = {false,SPR_BOSS_W1,3,NULL,NULL,&s_bosschase2};
\r
767 statetype s_bosschase2 = {false,SPR_BOSS_W2,8,T_Chase,NULL,&s_bosschase3};
\r
768 statetype s_bosschase3 = {false,SPR_BOSS_W3,10,T_Chase,NULL,&s_bosschase3s};
\r
769 statetype s_bosschase3s = {false,SPR_BOSS_W3,3,NULL,NULL,&s_bosschase4};
\r
770 statetype s_bosschase4 = {false,SPR_BOSS_W4,8,T_Chase,NULL,&s_bosschase1};
\r
772 statetype s_bossdie1 = {false,SPR_BOSS_DIE1,15,NULL,A_DeathScream,&s_bossdie2};
\r
773 statetype s_bossdie2 = {false,SPR_BOSS_DIE2,15,NULL,NULL,&s_bossdie3};
\r
774 statetype s_bossdie3 = {false,SPR_BOSS_DIE3,15,NULL,NULL,&s_bossdie4};
\r
775 statetype s_bossdie4 = {false,SPR_BOSS_DEAD,0,NULL,NULL,&s_bossdie4};
\r
777 statetype s_bossshoot1 = {false,SPR_BOSS_SHOOT1,30,NULL,NULL,&s_bossshoot2};
\r
778 statetype s_bossshoot2 = {false,SPR_BOSS_SHOOT2,10,NULL,T_Shoot,&s_bossshoot3};
\r
779 statetype s_bossshoot3 = {false,SPR_BOSS_SHOOT3,10,NULL,T_Shoot,&s_bossshoot4};
\r
780 statetype s_bossshoot4 = {false,SPR_BOSS_SHOOT2,10,NULL,T_Shoot,&s_bossshoot5};
\r
781 statetype s_bossshoot5 = {false,SPR_BOSS_SHOOT3,10,NULL,T_Shoot,&s_bossshoot6};
\r
782 statetype s_bossshoot6 = {false,SPR_BOSS_SHOOT2,10,NULL,T_Shoot,&s_bossshoot7};
\r
783 statetype s_bossshoot7 = {false,SPR_BOSS_SHOOT3,10,NULL,T_Shoot,&s_bossshoot8};
\r
784 statetype s_bossshoot8 = {false,SPR_BOSS_SHOOT1,10,NULL,NULL,&s_bosschase1};
\r
790 extern statetype s_gretelstand;
\r
792 extern statetype s_gretelchase1;
\r
793 extern statetype s_gretelchase1s;
\r
794 extern statetype s_gretelchase2;
\r
795 extern statetype s_gretelchase3;
\r
796 extern statetype s_gretelchase3s;
\r
797 extern statetype s_gretelchase4;
\r
799 extern statetype s_greteldie1;
\r
800 extern statetype s_greteldie2;
\r
801 extern statetype s_greteldie3;
\r
802 extern statetype s_greteldie4;
\r
804 extern statetype s_gretelshoot1;
\r
805 extern statetype s_gretelshoot2;
\r
806 extern statetype s_gretelshoot3;
\r
807 extern statetype s_gretelshoot4;
\r
808 extern statetype s_gretelshoot5;
\r
809 extern statetype s_gretelshoot6;
\r
810 extern statetype s_gretelshoot7;
\r
811 extern statetype s_gretelshoot8;
\r
814 statetype s_gretelstand = {false,SPR_GRETEL_W1,0,T_Stand,NULL,&s_gretelstand};
\r
816 statetype s_gretelchase1 = {false,SPR_GRETEL_W1,10,T_Chase,NULL,&s_gretelchase1s};
\r
817 statetype s_gretelchase1s = {false,SPR_GRETEL_W1,3,NULL,NULL,&s_gretelchase2};
\r
818 statetype s_gretelchase2 = {false,SPR_GRETEL_W2,8,T_Chase,NULL,&s_gretelchase3};
\r
819 statetype s_gretelchase3 = {false,SPR_GRETEL_W3,10,T_Chase,NULL,&s_gretelchase3s};
\r
820 statetype s_gretelchase3s = {false,SPR_GRETEL_W3,3,NULL,NULL,&s_gretelchase4};
\r
821 statetype s_gretelchase4 = {false,SPR_GRETEL_W4,8,T_Chase,NULL,&s_gretelchase1};
\r
823 statetype s_greteldie1 = {false,SPR_GRETEL_DIE1,15,NULL,A_DeathScream,&s_greteldie2};
\r
824 statetype s_greteldie2 = {false,SPR_GRETEL_DIE2,15,NULL,NULL,&s_greteldie3};
\r
825 statetype s_greteldie3 = {false,SPR_GRETEL_DIE3,15,NULL,NULL,&s_greteldie4};
\r
826 statetype s_greteldie4 = {false,SPR_GRETEL_DEAD,0,NULL,NULL,&s_greteldie4};
\r
828 statetype s_gretelshoot1 = {false,SPR_GRETEL_SHOOT1,30,NULL,NULL,&s_gretelshoot2};
\r
829 statetype s_gretelshoot2 = {false,SPR_GRETEL_SHOOT2,10,NULL,T_Shoot,&s_gretelshoot3};
\r
830 statetype s_gretelshoot3 = {false,SPR_GRETEL_SHOOT3,10,NULL,T_Shoot,&s_gretelshoot4};
\r
831 statetype s_gretelshoot4 = {false,SPR_GRETEL_SHOOT2,10,NULL,T_Shoot,&s_gretelshoot5};
\r
832 statetype s_gretelshoot5 = {false,SPR_GRETEL_SHOOT3,10,NULL,T_Shoot,&s_gretelshoot6};
\r
833 statetype s_gretelshoot6 = {false,SPR_GRETEL_SHOOT2,10,NULL,T_Shoot,&s_gretelshoot7};
\r
834 statetype s_gretelshoot7 = {false,SPR_GRETEL_SHOOT3,10,NULL,T_Shoot,&s_gretelshoot8};
\r
835 statetype s_gretelshoot8 = {false,SPR_GRETEL_SHOOT1,10,NULL,NULL,&s_gretelchase1};
\r
847 void SpawnStand (enemy_t which, int tilex, int tiley, int dir)
\r
849 unsigned far *map,tile;
\r
854 SpawnNewObj (tilex,tiley,&s_grdstand);
\r
855 new->speed = SPDPATROL;
\r
857 gamestate.killtotal++;
\r
861 SpawnNewObj (tilex,tiley,&s_ofcstand);
\r
862 new->speed = SPDPATROL;
\r
864 gamestate.killtotal++;
\r
868 SpawnNewObj (tilex,tiley,&s_mutstand);
\r
869 new->speed = SPDPATROL;
\r
871 gamestate.killtotal++;
\r
875 SpawnNewObj (tilex,tiley,&s_ssstand);
\r
876 new->speed = SPDPATROL;
\r
878 gamestate.killtotal++;
\r
883 map = mapsegs[0]+farmapylookup[tiley]+tilex;
\r
884 if (*map == AMBUSHTILE)
\r
886 tilemap[tilex][tiley] = 0;
\r
888 if (*(map+1) >= AREATILE)
\r
890 if (*(map-mapwidth) >= AREATILE)
\r
891 tile = *(map-mapwidth);
\r
892 if (*(map+mapwidth) >= AREATILE)
\r
893 tile = *(map+mapwidth);
\r
894 if ( *(map-1) >= AREATILE)
\r
898 new->areanumber = tile-AREATILE;
\r
900 new->flags |= FL_AMBUSH;
\r
903 new->obclass = guardobj+which;
\r
904 new->hitpoints = starthitpoints[gamestate.difficulty][which];
\r
906 new->flags |= FL_SHOOTABLE;
\r
919 void SpawnDeadGuard (int tilex, int tiley)
\r
921 SpawnNewObj (tilex,tiley,&s_grddie4);
\r
922 new->obclass = inertobj;
\r
936 void SpawnBoss (int tilex, int tiley)
\r
938 unsigned far *map,tile;
\r
940 SpawnNewObj (tilex,tiley,&s_bossstand);
\r
941 new->speed = SPDPATROL;
\r
943 new->obclass = bossobj;
\r
944 new->hitpoints = starthitpoints[gamestate.difficulty][en_boss];
\r
946 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
948 gamestate.killtotal++;
\r
959 void SpawnGretel (int tilex, int tiley)
\r
961 unsigned far *map,tile;
\r
963 SpawnNewObj (tilex,tiley,&s_gretelstand);
\r
964 new->speed = SPDPATROL;
\r
966 new->obclass = gretelobj;
\r
967 new->hitpoints = starthitpoints[gamestate.difficulty][en_gretel];
\r
969 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
971 gamestate.killtotal++;
\r
983 void SpawnPatrol (enemy_t which, int tilex, int tiley, int dir)
\r
988 SpawnNewObj (tilex,tiley,&s_grdpath1);
\r
989 new->speed = SPDPATROL;
\r
991 gamestate.killtotal++;
\r
995 SpawnNewObj (tilex,tiley,&s_ofcpath1);
\r
996 new->speed = SPDPATROL;
\r
998 gamestate.killtotal++;
\r
1002 SpawnNewObj (tilex,tiley,&s_sspath1);
\r
1003 new->speed = SPDPATROL;
\r
1005 gamestate.killtotal++;
\r
1009 SpawnNewObj (tilex,tiley,&s_mutpath1);
\r
1010 new->speed = SPDPATROL;
\r
1012 gamestate.killtotal++;
\r
1016 SpawnNewObj (tilex,tiley,&s_dogpath1);
\r
1017 new->speed = SPDDOG;
\r
1019 gamestate.killtotal++;
\r
1023 new->obclass = guardobj+which;
\r
1025 new->hitpoints = starthitpoints[gamestate.difficulty][which];
\r
1026 new->distance = tileglobal;
\r
1027 new->flags |= FL_SHOOTABLE;
\r
1028 new->active = true;
\r
1030 actorat[new->tilex][new->tiley] = NULL; // don't use original spot
\r
1048 actorat[new->tilex][new->tiley] = new;
\r
1054 ==================
\r
1058 ==================
\r
1061 void A_DeathScream (objtype *ob)
\r
1065 if (mapon==9 && !US_RndT())
\r
1067 if ((mapon==18 || mapon==19) && !US_RndT())
\r
1070 switch(ob->obclass)
\r
1077 PlaySoundLocActor(DEATHSCREAM6SND,ob);
\r
1083 switch (ob->obclass)
\r
1086 PlaySoundLocActor(AHHHGSND,ob);
\r
1091 int sounds[9]={ DEATHSCREAM1SND,
\r
1102 PlaySoundLocActor(sounds[US_RndT()%8],ob);
\r
1104 PlaySoundLocActor(sounds[US_RndT()%2],ob);
\r
1109 PlaySoundLocActor(NEINSOVASSND,ob);
\r
1112 PlaySoundLocActor(LEBENSND,ob); // JAB
\r
1115 PlaySoundLocActor(DOGDEATHSND,ob); // JAB
\r
1119 SD_PlaySound(MUTTISND); // JAB
\r
1122 SD_PlaySound(MEINGOTTSND);
\r
1125 SD_PlaySound(HITLERHASND);
\r
1127 case mechahitlerobj:
\r
1128 SD_PlaySound(SCHEISTSND);
\r
1130 case realhitlerobj:
\r
1131 SD_PlaySound(EVASND);
\r
1134 SD_PlaySound(MEINSND);
\r
1137 SD_PlaySound(DONNERSND);
\r
1140 SD_PlaySound(ROSESND);
\r
1144 SD_PlaySound(GHOSTFADESND);
\r
1147 SD_PlaySound(ANGELDEATHSND);
\r
1150 SD_PlaySound(TRANSDEATHSND);
\r
1153 SD_PlaySound(UBERDEATHSND);
\r
1156 SD_PlaySound(WILHELMDEATHSND);
\r
1159 SD_PlaySound(KNIGHTDEATHSND);
\r
1167 =============================================================================
\r
1171 =============================================================================
\r
1176 void T_Launch (objtype *ob);
\r
1177 void T_Will (objtype *ob);
\r
1179 extern statetype s_angelshoot1;
\r
1180 extern statetype s_deathshoot1;
\r
1181 extern statetype s_spark1;
\r
1186 extern statetype s_transstand;
\r
1188 extern statetype s_transchase1;
\r
1189 extern statetype s_transchase1s;
\r
1190 extern statetype s_transchase2;
\r
1191 extern statetype s_transchase3;
\r
1192 extern statetype s_transchase3s;
\r
1193 extern statetype s_transchase4;
\r
1195 extern statetype s_transdie0;
\r
1196 extern statetype s_transdie01;
\r
1197 extern statetype s_transdie1;
\r
1198 extern statetype s_transdie2;
\r
1199 extern statetype s_transdie3;
\r
1200 extern statetype s_transdie4;
\r
1202 extern statetype s_transshoot1;
\r
1203 extern statetype s_transshoot2;
\r
1204 extern statetype s_transshoot3;
\r
1205 extern statetype s_transshoot4;
\r
1206 extern statetype s_transshoot5;
\r
1207 extern statetype s_transshoot6;
\r
1208 extern statetype s_transshoot7;
\r
1209 extern statetype s_transshoot8;
\r
1212 statetype s_transstand = {false,SPR_TRANS_W1,0,T_Stand,NULL,&s_transstand};
\r
1214 statetype s_transchase1 = {false,SPR_TRANS_W1,10,T_Chase,NULL,&s_transchase1s};
\r
1215 statetype s_transchase1s = {false,SPR_TRANS_W1,3,NULL,NULL,&s_transchase2};
\r
1216 statetype s_transchase2 = {false,SPR_TRANS_W2,8,T_Chase,NULL,&s_transchase3};
\r
1217 statetype s_transchase3 = {false,SPR_TRANS_W3,10,T_Chase,NULL,&s_transchase3s};
\r
1218 statetype s_transchase3s = {false,SPR_TRANS_W3,3,NULL,NULL,&s_transchase4};
\r
1219 statetype s_transchase4 = {false,SPR_TRANS_W4,8,T_Chase,NULL,&s_transchase1};
\r
1221 statetype s_transdie0 = {false,SPR_TRANS_W1,1,NULL,A_DeathScream,&s_transdie01};
\r
1222 statetype s_transdie01 = {false,SPR_TRANS_W1,1,NULL,NULL,&s_transdie1};
\r
1223 statetype s_transdie1 = {false,SPR_TRANS_DIE1,15,NULL,NULL,&s_transdie2};
\r
1224 statetype s_transdie2 = {false,SPR_TRANS_DIE2,15,NULL,NULL,&s_transdie3};
\r
1225 statetype s_transdie3 = {false,SPR_TRANS_DIE3,15,NULL,NULL,&s_transdie4};
\r
1226 statetype s_transdie4 = {false,SPR_TRANS_DEAD,0,NULL,NULL,&s_transdie4};
\r
1228 statetype s_transshoot1 = {false,SPR_TRANS_SHOOT1,30,NULL,NULL,&s_transshoot2};
\r
1229 statetype s_transshoot2 = {false,SPR_TRANS_SHOOT2,10,NULL,T_Shoot,&s_transshoot3};
\r
1230 statetype s_transshoot3 = {false,SPR_TRANS_SHOOT3,10,NULL,T_Shoot,&s_transshoot4};
\r
1231 statetype s_transshoot4 = {false,SPR_TRANS_SHOOT2,10,NULL,T_Shoot,&s_transshoot5};
\r
1232 statetype s_transshoot5 = {false,SPR_TRANS_SHOOT3,10,NULL,T_Shoot,&s_transshoot6};
\r
1233 statetype s_transshoot6 = {false,SPR_TRANS_SHOOT2,10,NULL,T_Shoot,&s_transshoot7};
\r
1234 statetype s_transshoot7 = {false,SPR_TRANS_SHOOT3,10,NULL,T_Shoot,&s_transshoot8};
\r
1235 statetype s_transshoot8 = {false,SPR_TRANS_SHOOT1,10,NULL,NULL,&s_transchase1};
\r
1246 void SpawnTrans (int tilex, int tiley)
\r
1248 unsigned far *map,tile;
\r
1250 if (SoundBlasterPresent && DigiMode != sds_Off)
\r
1251 s_transdie01.tictime = 105;
\r
1253 SpawnNewObj (tilex,tiley,&s_transstand);
\r
1254 new->obclass = transobj;
\r
1255 new->hitpoints = starthitpoints[gamestate.difficulty][en_trans];
\r
1256 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
1258 gamestate.killtotal++;
\r
1265 void T_UShoot (objtype *ob);
\r
1267 extern statetype s_uberstand;
\r
1269 extern statetype s_uberchase1;
\r
1270 extern statetype s_uberchase1s;
\r
1271 extern statetype s_uberchase2;
\r
1272 extern statetype s_uberchase3;
\r
1273 extern statetype s_uberchase3s;
\r
1274 extern statetype s_uberchase4;
\r
1276 extern statetype s_uberdie0;
\r
1277 extern statetype s_uberdie01;
\r
1278 extern statetype s_uberdie1;
\r
1279 extern statetype s_uberdie2;
\r
1280 extern statetype s_uberdie3;
\r
1281 extern statetype s_uberdie4;
\r
1282 extern statetype s_uberdie5;
\r
1284 extern statetype s_ubershoot1;
\r
1285 extern statetype s_ubershoot2;
\r
1286 extern statetype s_ubershoot3;
\r
1287 extern statetype s_ubershoot4;
\r
1288 extern statetype s_ubershoot5;
\r
1289 extern statetype s_ubershoot6;
\r
1290 extern statetype s_ubershoot7;
\r
1293 statetype s_uberstand = {false,SPR_UBER_W1,0,T_Stand,NULL,&s_uberstand};
\r
1295 statetype s_uberchase1 = {false,SPR_UBER_W1,10,T_Chase,NULL,&s_uberchase1s};
\r
1296 statetype s_uberchase1s = {false,SPR_UBER_W1,3,NULL,NULL,&s_uberchase2};
\r
1297 statetype s_uberchase2 = {false,SPR_UBER_W2,8,T_Chase,NULL,&s_uberchase3};
\r
1298 statetype s_uberchase3 = {false,SPR_UBER_W3,10,T_Chase,NULL,&s_uberchase3s};
\r
1299 statetype s_uberchase3s = {false,SPR_UBER_W3,3,NULL,NULL,&s_uberchase4};
\r
1300 statetype s_uberchase4 = {false,SPR_UBER_W4,8,T_Chase,NULL,&s_uberchase1};
\r
1302 statetype s_uberdie0 = {false,SPR_UBER_W1,1,NULL,A_DeathScream,&s_uberdie01};
\r
1303 statetype s_uberdie01 = {false,SPR_UBER_W1,1,NULL,NULL,&s_uberdie1};
\r
1304 statetype s_uberdie1 = {false,SPR_UBER_DIE1,15,NULL,NULL,&s_uberdie2};
\r
1305 statetype s_uberdie2 = {false,SPR_UBER_DIE2,15,NULL,NULL,&s_uberdie3};
\r
1306 statetype s_uberdie3 = {false,SPR_UBER_DIE3,15,NULL,NULL,&s_uberdie4};
\r
1307 statetype s_uberdie4 = {false,SPR_UBER_DIE4,15,NULL,NULL,&s_uberdie5};
\r
1308 statetype s_uberdie5 = {false,SPR_UBER_DEAD,0,NULL,NULL,&s_uberdie5};
\r
1310 statetype s_ubershoot1 = {false,SPR_UBER_SHOOT1,30,NULL,NULL,&s_ubershoot2};
\r
1311 statetype s_ubershoot2 = {false,SPR_UBER_SHOOT2,12,NULL,T_UShoot,&s_ubershoot3};
\r
1312 statetype s_ubershoot3 = {false,SPR_UBER_SHOOT3,12,NULL,T_UShoot,&s_ubershoot4};
\r
1313 statetype s_ubershoot4 = {false,SPR_UBER_SHOOT4,12,NULL,T_UShoot,&s_ubershoot5};
\r
1314 statetype s_ubershoot5 = {false,SPR_UBER_SHOOT3,12,NULL,T_UShoot,&s_ubershoot6};
\r
1315 statetype s_ubershoot6 = {false,SPR_UBER_SHOOT2,12,NULL,T_UShoot,&s_ubershoot7};
\r
1316 statetype s_ubershoot7 = {false,SPR_UBER_SHOOT1,12,NULL,NULL,&s_uberchase1};
\r
1327 void SpawnUber (int tilex, int tiley)
\r
1329 unsigned far *map,tile;
\r
1331 if (SoundBlasterPresent && DigiMode != sds_Off)
\r
1332 s_uberdie01.tictime = 70;
\r
1334 SpawnNewObj (tilex,tiley,&s_uberstand);
\r
1335 new->obclass = uberobj;
\r
1336 new->hitpoints = starthitpoints[gamestate.difficulty][en_uber];
\r
1337 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
1339 gamestate.killtotal++;
\r
1351 void T_UShoot (objtype *ob)
\r
1357 dx = abs(ob->tilex - player->tilex);
\r
1358 dy = abs(ob->tiley - player->tiley);
\r
1359 dist = dx>dy ? dx : dy;
\r
1361 TakeDamage (10,ob);
\r
1368 extern statetype s_willstand;
\r
1370 extern statetype s_willchase1;
\r
1371 extern statetype s_willchase1s;
\r
1372 extern statetype s_willchase2;
\r
1373 extern statetype s_willchase3;
\r
1374 extern statetype s_willchase3s;
\r
1375 extern statetype s_willchase4;
\r
1377 extern statetype s_willdie1;
\r
1378 extern statetype s_willdie2;
\r
1379 extern statetype s_willdie3;
\r
1380 extern statetype s_willdie4;
\r
1381 extern statetype s_willdie5;
\r
1382 extern statetype s_willdie6;
\r
1384 extern statetype s_willshoot1;
\r
1385 extern statetype s_willshoot2;
\r
1386 extern statetype s_willshoot3;
\r
1387 extern statetype s_willshoot4;
\r
1388 extern statetype s_willshoot5;
\r
1389 extern statetype s_willshoot6;
\r
1392 statetype s_willstand = {false,SPR_WILL_W1,0,T_Stand,NULL,&s_willstand};
\r
1394 statetype s_willchase1 = {false,SPR_WILL_W1,10,T_Will,NULL,&s_willchase1s};
\r
1395 statetype s_willchase1s = {false,SPR_WILL_W1,3,NULL,NULL,&s_willchase2};
\r
1396 statetype s_willchase2 = {false,SPR_WILL_W2,8,T_Will,NULL,&s_willchase3};
\r
1397 statetype s_willchase3 = {false,SPR_WILL_W3,10,T_Will,NULL,&s_willchase3s};
\r
1398 statetype s_willchase3s = {false,SPR_WILL_W3,3,NULL,NULL,&s_willchase4};
\r
1399 statetype s_willchase4 = {false,SPR_WILL_W4,8,T_Will,NULL,&s_willchase1};
\r
1401 statetype s_willdeathcam = {false,SPR_WILL_W1,1,NULL,NULL,&s_willdie1};
\r
1403 statetype s_willdie1 = {false,SPR_WILL_W1,1,NULL,A_DeathScream,&s_willdie2};
\r
1404 statetype s_willdie2 = {false,SPR_WILL_W1,10,NULL,NULL,&s_willdie3};
\r
1405 statetype s_willdie3 = {false,SPR_WILL_DIE1,10,NULL,NULL,&s_willdie4};
\r
1406 statetype s_willdie4 = {false,SPR_WILL_DIE2,10,NULL,NULL,&s_willdie5};
\r
1407 statetype s_willdie5 = {false,SPR_WILL_DIE3,10,NULL,NULL,&s_willdie6};
\r
1408 statetype s_willdie6 = {false,SPR_WILL_DEAD,20,NULL,NULL,&s_willdie6};
\r
1410 statetype s_willshoot1 = {false,SPR_WILL_SHOOT1,30,NULL,NULL,&s_willshoot2};
\r
1411 statetype s_willshoot2 = {false,SPR_WILL_SHOOT2,10,NULL,T_Launch,&s_willshoot3};
\r
1412 statetype s_willshoot3 = {false,SPR_WILL_SHOOT3,10,NULL,T_Shoot,&s_willshoot4};
\r
1413 statetype s_willshoot4 = {false,SPR_WILL_SHOOT4,10,NULL,T_Shoot,&s_willshoot5};
\r
1414 statetype s_willshoot5 = {false,SPR_WILL_SHOOT3,10,NULL,T_Shoot,&s_willshoot6};
\r
1415 statetype s_willshoot6 = {false,SPR_WILL_SHOOT4,10,NULL,T_Shoot,&s_willchase1};
\r
1426 void SpawnWill (int tilex, int tiley)
\r
1428 unsigned far *map,tile;
\r
1430 if (SoundBlasterPresent && DigiMode != sds_Off)
\r
1431 s_willdie2.tictime = 70;
\r
1433 SpawnNewObj (tilex,tiley,&s_willstand);
\r
1434 new->obclass = willobj;
\r
1435 new->hitpoints = starthitpoints[gamestate.difficulty][en_will];
\r
1436 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
1438 gamestate.killtotal++;
\r
1450 void T_Will (objtype *ob)
\r
1457 dx = abs(ob->tilex - player->tilex);
\r
1458 dy = abs(ob->tiley - player->tiley);
\r
1459 dist = dx>dy ? dx : dy;
\r
1461 if (CheckLine(ob)) // got a shot at player?
\r
1463 if ( US_RndT() < (tics<<3) )
\r
1466 // go into attack frame
\r
1468 if (ob->obclass == willobj)
\r
1469 NewState (ob,&s_willshoot1);
\r
1470 else if (ob->obclass == angelobj)
\r
1471 NewState (ob,&s_angelshoot1);
\r
1473 NewState (ob,&s_deathshoot1);
\r
1479 if (ob->dir == nodir)
\r
1482 SelectDodgeDir (ob);
\r
1484 SelectChaseDir (ob);
\r
1485 if (ob->dir == nodir)
\r
1486 return; // object is blocked in
\r
1489 move = ob->speed*tics;
\r
1493 if (ob->distance < 0)
\r
1496 // waiting for a door to open
\r
1498 OpenDoor (-ob->distance-1);
\r
1499 if (doorobjlist[-ob->distance-1].action != dr_open)
\r
1501 ob->distance = TILEGLOBAL; // go ahead, the door is now opoen
\r
1504 if (move < ob->distance)
\r
1506 MoveObj (ob,move);
\r
1511 // reached goal tile, so select another one
\r
1515 // fix position to account for round off during moving
\r
1517 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
1518 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
1520 move -= ob->distance;
\r
1523 SelectRunDir (ob);
\r
1525 SelectDodgeDir (ob);
\r
1527 SelectChaseDir (ob);
\r
1529 if (ob->dir == nodir)
\r
1530 return; // object is blocked in
\r
1539 extern statetype s_deathstand;
\r
1541 extern statetype s_deathchase1;
\r
1542 extern statetype s_deathchase1s;
\r
1543 extern statetype s_deathchase2;
\r
1544 extern statetype s_deathchase3;
\r
1545 extern statetype s_deathchase3s;
\r
1546 extern statetype s_deathchase4;
\r
1548 extern statetype s_deathdie1;
\r
1549 extern statetype s_deathdie2;
\r
1550 extern statetype s_deathdie3;
\r
1551 extern statetype s_deathdie4;
\r
1552 extern statetype s_deathdie5;
\r
1553 extern statetype s_deathdie6;
\r
1554 extern statetype s_deathdie7;
\r
1555 extern statetype s_deathdie8;
\r
1556 extern statetype s_deathdie9;
\r
1558 extern statetype s_deathshoot1;
\r
1559 extern statetype s_deathshoot2;
\r
1560 extern statetype s_deathshoot3;
\r
1561 extern statetype s_deathshoot4;
\r
1562 extern statetype s_deathshoot5;
\r
1565 statetype s_deathstand = {false,SPR_DEATH_W1,0,T_Stand,NULL,&s_deathstand};
\r
1567 statetype s_deathchase1 = {false,SPR_DEATH_W1,10,T_Will,NULL,&s_deathchase1s};
\r
1568 statetype s_deathchase1s = {false,SPR_DEATH_W1,3,NULL,NULL,&s_deathchase2};
\r
1569 statetype s_deathchase2 = {false,SPR_DEATH_W2,8,T_Will,NULL,&s_deathchase3};
\r
1570 statetype s_deathchase3 = {false,SPR_DEATH_W3,10,T_Will,NULL,&s_deathchase3s};
\r
1571 statetype s_deathchase3s = {false,SPR_DEATH_W3,3,NULL,NULL,&s_deathchase4};
\r
1572 statetype s_deathchase4 = {false,SPR_DEATH_W4,8,T_Will,NULL,&s_deathchase1};
\r
1574 statetype s_deathdeathcam = {false,SPR_DEATH_W1,1,NULL,NULL,&s_deathdie1};
\r
1576 statetype s_deathdie1 = {false,SPR_DEATH_W1,1,NULL,A_DeathScream,&s_deathdie2};
\r
1577 statetype s_deathdie2 = {false,SPR_DEATH_W1,10,NULL,NULL,&s_deathdie3};
\r
1578 statetype s_deathdie3 = {false,SPR_DEATH_DIE1,10,NULL,NULL,&s_deathdie4};
\r
1579 statetype s_deathdie4 = {false,SPR_DEATH_DIE2,10,NULL,NULL,&s_deathdie5};
\r
1580 statetype s_deathdie5 = {false,SPR_DEATH_DIE3,10,NULL,NULL,&s_deathdie6};
\r
1581 statetype s_deathdie6 = {false,SPR_DEATH_DIE4,10,NULL,NULL,&s_deathdie7};
\r
1582 statetype s_deathdie7 = {false,SPR_DEATH_DIE5,10,NULL,NULL,&s_deathdie8};
\r
1583 statetype s_deathdie8 = {false,SPR_DEATH_DIE6,10,NULL,NULL,&s_deathdie9};
\r
1584 statetype s_deathdie9 = {false,SPR_DEATH_DEAD,0,NULL,NULL,&s_deathdie9};
\r
1586 statetype s_deathshoot1 = {false,SPR_DEATH_SHOOT1,30,NULL,NULL,&s_deathshoot2};
\r
1587 statetype s_deathshoot2 = {false,SPR_DEATH_SHOOT2,10,NULL,T_Launch,&s_deathshoot3};
\r
1588 statetype s_deathshoot3 = {false,SPR_DEATH_SHOOT4,10,NULL,T_Shoot,&s_deathshoot4};
\r
1589 statetype s_deathshoot4 = {false,SPR_DEATH_SHOOT3,10,NULL,T_Launch,&s_deathshoot5};
\r
1590 statetype s_deathshoot5 = {false,SPR_DEATH_SHOOT4,10,NULL,T_Shoot,&s_deathchase1};
\r
1601 void SpawnDeath (int tilex, int tiley)
\r
1603 unsigned far *map,tile;
\r
1605 if (SoundBlasterPresent && DigiMode != sds_Off)
\r
1606 s_deathdie2.tictime = 105;
\r
1608 SpawnNewObj (tilex,tiley,&s_deathstand);
\r
1609 new->obclass = deathobj;
\r
1610 new->hitpoints = starthitpoints[gamestate.difficulty][en_death];
\r
1611 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
1613 gamestate.killtotal++;
\r
1624 void T_Launch (objtype *ob)
\r
1626 long deltax,deltay;
\r
1630 deltax = player->x - ob->x;
\r
1631 deltay = ob->y - player->y;
\r
1632 angle = atan2 (deltay,deltax);
\r
1634 angle = M_PI*2+angle;
\r
1635 iangle = angle/(M_PI*2)*ANGLES;
\r
1636 if (ob->obclass == deathobj)
\r
1639 if (ob->state == &s_deathshoot2)
\r
1648 if (iangle>=ANGLES)
\r
1654 new->state = &s_rocket;
\r
1655 new->ticcount = 1;
\r
1657 new->tilex = ob->tilex;
\r
1658 new->tiley = ob->tiley;
\r
1661 new->obclass = rocketobj;
\r
1662 switch(ob->obclass)
\r
1665 new->state = &s_hrocket;
\r
1666 new->obclass = hrocketobj;
\r
1667 PlaySoundLocActor (KNIGHTMISSILESND,new);
\r
1670 new->state = &s_spark1;
\r
1671 new->obclass = sparkobj;
\r
1672 PlaySoundLocActor (ANGELFIRESND,new);
\r
1675 PlaySoundLocActor (MISSILEFIRESND,new);
\r
1679 new->angle = iangle;
\r
1680 new->speed = 0x2000l;
\r
1681 new->flags = FL_NONMARK;
\r
1682 new->active = true;
\r
1690 void A_Relaunch (objtype *ob);
\r
1691 void A_Victory (objtype *ob);
\r
1692 void A_StartAttack (objtype *ob);
\r
1693 void A_Breathing (objtype *ob);
\r
1695 extern statetype s_angelstand;
\r
1697 extern statetype s_angelchase1;
\r
1698 extern statetype s_angelchase1s;
\r
1699 extern statetype s_angelchase2;
\r
1700 extern statetype s_angelchase3;
\r
1701 extern statetype s_angelchase3s;
\r
1702 extern statetype s_angelchase4;
\r
1704 extern statetype s_angeldie1;
\r
1705 extern statetype s_angeldie11;
\r
1706 extern statetype s_angeldie2;
\r
1707 extern statetype s_angeldie3;
\r
1708 extern statetype s_angeldie4;
\r
1709 extern statetype s_angeldie5;
\r
1710 extern statetype s_angeldie6;
\r
1711 extern statetype s_angeldie7;
\r
1712 extern statetype s_angeldie8;
\r
1713 extern statetype s_angeldie9;
\r
1715 extern statetype s_angelshoot1;
\r
1716 extern statetype s_angelshoot2;
\r
1717 extern statetype s_angelshoot3;
\r
1718 extern statetype s_angelshoot4;
\r
1719 extern statetype s_angelshoot5;
\r
1720 extern statetype s_angelshoot6;
\r
1722 extern statetype s_angeltired;
\r
1723 extern statetype s_angeltired2;
\r
1724 extern statetype s_angeltired3;
\r
1725 extern statetype s_angeltired4;
\r
1726 extern statetype s_angeltired5;
\r
1727 extern statetype s_angeltired6;
\r
1728 extern statetype s_angeltired7;
\r
1730 extern statetype s_spark1;
\r
1731 extern statetype s_spark2;
\r
1732 extern statetype s_spark3;
\r
1733 extern statetype s_spark4;
\r
1736 statetype s_angelstand = {false,SPR_ANGEL_W1,0,T_Stand,NULL,&s_angelstand};
\r
1738 statetype s_angelchase1 = {false,SPR_ANGEL_W1,10,T_Will,NULL,&s_angelchase1s};
\r
1739 statetype s_angelchase1s = {false,SPR_ANGEL_W1,3,NULL,NULL,&s_angelchase2};
\r
1740 statetype s_angelchase2 = {false,SPR_ANGEL_W2,8,T_Will,NULL,&s_angelchase3};
\r
1741 statetype s_angelchase3 = {false,SPR_ANGEL_W3,10,T_Will,NULL,&s_angelchase3s};
\r
1742 statetype s_angelchase3s = {false,SPR_ANGEL_W3,3,NULL,NULL,&s_angelchase4};
\r
1743 statetype s_angelchase4 = {false,SPR_ANGEL_W4,8,T_Will,NULL,&s_angelchase1};
\r
1745 statetype s_angeldie1 = {false,SPR_ANGEL_W1,1,NULL,A_DeathScream,&s_angeldie11};
\r
1746 statetype s_angeldie11 = {false,SPR_ANGEL_W1,1,NULL,NULL,&s_angeldie2};
\r
1747 statetype s_angeldie2 = {false,SPR_ANGEL_DIE1,10,NULL,A_Slurpie,&s_angeldie3};
\r
1748 statetype s_angeldie3 = {false,SPR_ANGEL_DIE2,10,NULL,NULL,&s_angeldie4};
\r
1749 statetype s_angeldie4 = {false,SPR_ANGEL_DIE3,10,NULL,NULL,&s_angeldie5};
\r
1750 statetype s_angeldie5 = {false,SPR_ANGEL_DIE4,10,NULL,NULL,&s_angeldie6};
\r
1751 statetype s_angeldie6 = {false,SPR_ANGEL_DIE5,10,NULL,NULL,&s_angeldie7};
\r
1752 statetype s_angeldie7 = {false,SPR_ANGEL_DIE6,10,NULL,NULL,&s_angeldie8};
\r
1753 statetype s_angeldie8 = {false,SPR_ANGEL_DIE7,10,NULL,NULL,&s_angeldie9};
\r
1754 statetype s_angeldie9 = {false,SPR_ANGEL_DEAD,130,NULL,A_Victory,&s_angeldie9};
\r
1756 statetype s_angelshoot1 = {false,SPR_ANGEL_SHOOT1,10,NULL,A_StartAttack,&s_angelshoot2};
\r
1757 statetype s_angelshoot2 = {false,SPR_ANGEL_SHOOT2,20,NULL,T_Launch,&s_angelshoot3};
\r
1758 statetype s_angelshoot3 = {false,SPR_ANGEL_SHOOT1,10,NULL,A_Relaunch,&s_angelshoot2};
\r
1760 statetype s_angeltired = {false,SPR_ANGEL_TIRED1,40,NULL,A_Breathing,&s_angeltired2};
\r
1761 statetype s_angeltired2 = {false,SPR_ANGEL_TIRED2,40,NULL,NULL,&s_angeltired3};
\r
1762 statetype s_angeltired3 = {false,SPR_ANGEL_TIRED1,40,NULL,A_Breathing,&s_angeltired4};
\r
1763 statetype s_angeltired4 = {false,SPR_ANGEL_TIRED2,40,NULL,NULL,&s_angeltired5};
\r
1764 statetype s_angeltired5 = {false,SPR_ANGEL_TIRED1,40,NULL,A_Breathing,&s_angeltired6};
\r
1765 statetype s_angeltired6 = {false,SPR_ANGEL_TIRED2,40,NULL,NULL,&s_angeltired7};
\r
1766 statetype s_angeltired7 = {false,SPR_ANGEL_TIRED1,40,NULL,A_Breathing,&s_angelchase1};
\r
1768 statetype s_spark1 = {false,SPR_SPARK1,6,T_Projectile,NULL,&s_spark2};
\r
1769 statetype s_spark2 = {false,SPR_SPARK2,6,T_Projectile,NULL,&s_spark3};
\r
1770 statetype s_spark3 = {false,SPR_SPARK3,6,T_Projectile,NULL,&s_spark4};
\r
1771 statetype s_spark4 = {false,SPR_SPARK4,6,T_Projectile,NULL,&s_spark1};
\r
1775 void A_Slurpie (objtype *ob)
\r
1777 SD_PlaySound(SLURPIESND);
\r
1781 void A_Breathing (objtype *ob)
\r
1783 SD_PlaySound(ANGELTIREDSND);
\r
1794 void SpawnAngel (int tilex, int tiley)
\r
1796 unsigned far *map,tile;
\r
1799 if (SoundBlasterPresent && DigiMode != sds_Off)
\r
1800 s_angeldie11.tictime = 105;
\r
1802 SpawnNewObj (tilex,tiley,&s_angelstand);
\r
1803 new->obclass = angelobj;
\r
1804 new->hitpoints = starthitpoints[gamestate.difficulty][en_angel];
\r
1805 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
1807 gamestate.killtotal++;
\r
1820 void A_Victory (objtype *ob)
\r
1822 playstate = ex_victorious;
\r
1834 void A_StartAttack (objtype *ob)
\r
1848 void A_Relaunch (objtype *ob)
\r
1850 if (++ob->temp1 == 3)
\r
1852 NewState (ob,&s_angeltired);
\r
1858 NewState (ob,&s_angelchase1);
\r
1869 void T_SpectreWait (objtype *ob);
\r
1870 void A_Dormant (objtype *ob);
\r
1872 extern statetype s_spectrewait1;
\r
1873 extern statetype s_spectrewait2;
\r
1874 extern statetype s_spectrewait3;
\r
1875 extern statetype s_spectrewait4;
\r
1877 extern statetype s_spectrechase1;
\r
1878 extern statetype s_spectrechase2;
\r
1879 extern statetype s_spectrechase3;
\r
1880 extern statetype s_spectrechase4;
\r
1882 extern statetype s_spectredie1;
\r
1883 extern statetype s_spectredie2;
\r
1884 extern statetype s_spectredie3;
\r
1885 extern statetype s_spectredie4;
\r
1887 extern statetype s_spectrewake;
\r
1889 statetype s_spectrewait1 = {false,SPR_SPECTRE_W1,10,T_Stand,NULL,&s_spectrewait2};
\r
1890 statetype s_spectrewait2 = {false,SPR_SPECTRE_W2,10,T_Stand,NULL,&s_spectrewait3};
\r
1891 statetype s_spectrewait3 = {false,SPR_SPECTRE_W3,10,T_Stand,NULL,&s_spectrewait4};
\r
1892 statetype s_spectrewait4 = {false,SPR_SPECTRE_W4,10,T_Stand,NULL,&s_spectrewait1};
\r
1894 statetype s_spectrechase1 = {false,SPR_SPECTRE_W1,10,T_Ghosts,NULL,&s_spectrechase2};
\r
1895 statetype s_spectrechase2 = {false,SPR_SPECTRE_W2,10,T_Ghosts,NULL,&s_spectrechase3};
\r
1896 statetype s_spectrechase3 = {false,SPR_SPECTRE_W3,10,T_Ghosts,NULL,&s_spectrechase4};
\r
1897 statetype s_spectrechase4 = {false,SPR_SPECTRE_W4,10,T_Ghosts,NULL,&s_spectrechase1};
\r
1899 statetype s_spectredie1 = {false,SPR_SPECTRE_F1,10,NULL,NULL,&s_spectredie2};
\r
1900 statetype s_spectredie2 = {false,SPR_SPECTRE_F2,10,NULL,NULL,&s_spectredie3};
\r
1901 statetype s_spectredie3 = {false,SPR_SPECTRE_F3,10,NULL,NULL,&s_spectredie4};
\r
1902 statetype s_spectredie4 = {false,SPR_SPECTRE_F4,300,NULL,NULL,&s_spectrewake};
\r
1903 statetype s_spectrewake = {false,SPR_SPECTRE_F4,10,NULL,A_Dormant,&s_spectrewake};
\r
1913 void SpawnSpectre (int tilex, int tiley)
\r
1915 unsigned far *map,tile;
\r
1917 SpawnNewObj (tilex,tiley,&s_spectrewait1);
\r
1918 new->obclass = spectreobj;
\r
1919 new->hitpoints = starthitpoints[gamestate.difficulty][en_spectre];
\r
1920 new->flags |= FL_SHOOTABLE|FL_AMBUSH; // |FL_NEVERMARK|FL_NONMARK;
\r
1922 gamestate.killtotal++;
\r
1934 void A_Dormant (objtype *ob)
\r
1936 long deltax,deltay;
\r
1941 deltax = ob->x - player->x;
\r
1942 if (deltax < -MINACTORDIST || deltax > MINACTORDIST)
\r
1944 deltay = ob->y - player->y;
\r
1945 if (deltay < -MINACTORDIST || deltay > MINACTORDIST)
\r
1951 xl = (ob->x-MINDIST) >> TILESHIFT;
\r
1952 xh = (ob->x+MINDIST) >> TILESHIFT;
\r
1953 yl = (ob->y-MINDIST) >> TILESHIFT;
\r
1954 yh = (ob->y+MINDIST) >> TILESHIFT;
\r
1956 for (y=yl ; y<=yh ; y++)
\r
1957 for (x=xl ; x<=xh ; x++)
\r
1959 tile = actorat[x][y];
\r
1962 if (tile && tile<objlist)
\r
1964 if (((objtype *)tile)->flags&FL_SHOOTABLE)
\r
1968 ob->flags |= FL_AMBUSH | FL_SHOOTABLE;
\r
1969 ob->flags &= ~FL_ATTACKMODE;
\r
1971 NewState (ob,&s_spectrewait1);
\r
1978 =============================================================================
\r
1980 SCHABBS / GIFT / FAT
\r
1982 =============================================================================
\r
1994 void SpawnGhosts (int which, int tilex, int tiley)
\r
1996 unsigned far *map,tile;
\r
2001 SpawnNewObj (tilex,tiley,&s_blinkychase1);
\r
2004 SpawnNewObj (tilex,tiley,&s_clydechase1);
\r
2007 SpawnNewObj (tilex,tiley,&s_pinkychase1);
\r
2010 SpawnNewObj (tilex,tiley,&s_inkychase1);
\r
2014 new->obclass = ghostobj;
\r
2015 new->speed = SPDDOG;
\r
2018 new->flags |= FL_AMBUSH;
\r
2020 gamestate.killtotal++;
\r
2025 void T_Gift (objtype *ob);
\r
2026 void T_GiftThrow (objtype *ob);
\r
2028 void T_Fat (objtype *ob);
\r
2029 void T_FatThrow (objtype *ob);
\r
2034 extern statetype s_schabbstand;
\r
2036 extern statetype s_schabbchase1;
\r
2037 extern statetype s_schabbchase1s;
\r
2038 extern statetype s_schabbchase2;
\r
2039 extern statetype s_schabbchase3;
\r
2040 extern statetype s_schabbchase3s;
\r
2041 extern statetype s_schabbchase4;
\r
2043 extern statetype s_schabbdie1;
\r
2044 extern statetype s_schabbdie2;
\r
2045 extern statetype s_schabbdie3;
\r
2046 extern statetype s_schabbdie4;
\r
2047 extern statetype s_schabbdie5;
\r
2048 extern statetype s_schabbdie6;
\r
2050 extern statetype s_schabbshoot1;
\r
2051 extern statetype s_schabbshoot2;
\r
2053 extern statetype s_needle1;
\r
2054 extern statetype s_needle2;
\r
2055 extern statetype s_needle3;
\r
2056 extern statetype s_needle4;
\r
2058 extern statetype s_schabbdeathcam;
\r
2061 statetype s_schabbstand = {false,SPR_SCHABB_W1,0,T_Stand,NULL,&s_schabbstand};
\r
2063 statetype s_schabbchase1 = {false,SPR_SCHABB_W1,10,T_Schabb,NULL,&s_schabbchase1s};
\r
2064 statetype s_schabbchase1s = {false,SPR_SCHABB_W1,3,NULL,NULL,&s_schabbchase2};
\r
2065 statetype s_schabbchase2 = {false,SPR_SCHABB_W2,8,T_Schabb,NULL,&s_schabbchase3};
\r
2066 statetype s_schabbchase3 = {false,SPR_SCHABB_W3,10,T_Schabb,NULL,&s_schabbchase3s};
\r
2067 statetype s_schabbchase3s = {false,SPR_SCHABB_W3,3,NULL,NULL,&s_schabbchase4};
\r
2068 statetype s_schabbchase4 = {false,SPR_SCHABB_W4,8,T_Schabb,NULL,&s_schabbchase1};
\r
2070 statetype s_schabbdeathcam = {false,SPR_SCHABB_W1,1,NULL,NULL,&s_schabbdie1};
\r
2072 statetype s_schabbdie1 = {false,SPR_SCHABB_W1,10,NULL,A_DeathScream,&s_schabbdie2};
\r
2073 statetype s_schabbdie2 = {false,SPR_SCHABB_W1,10,NULL,NULL,&s_schabbdie3};
\r
2074 statetype s_schabbdie3 = {false,SPR_SCHABB_DIE1,10,NULL,NULL,&s_schabbdie4};
\r
2075 statetype s_schabbdie4 = {false,SPR_SCHABB_DIE2,10,NULL,NULL,&s_schabbdie5};
\r
2076 statetype s_schabbdie5 = {false,SPR_SCHABB_DIE3,10,NULL,NULL,&s_schabbdie6};
\r
2077 statetype s_schabbdie6 = {false,SPR_SCHABB_DEAD,20,NULL,A_StartDeathCam,&s_schabbdie6};
\r
2079 statetype s_schabbshoot1 = {false,SPR_SCHABB_SHOOT1,30,NULL,NULL,&s_schabbshoot2};
\r
2080 statetype s_schabbshoot2 = {false,SPR_SCHABB_SHOOT2,10,NULL,T_SchabbThrow,&s_schabbchase1};
\r
2082 statetype s_needle1 = {false,SPR_HYPO1,6,T_Projectile,NULL,&s_needle2};
\r
2083 statetype s_needle2 = {false,SPR_HYPO2,6,T_Projectile,NULL,&s_needle3};
\r
2084 statetype s_needle3 = {false,SPR_HYPO3,6,T_Projectile,NULL,&s_needle4};
\r
2085 statetype s_needle4 = {false,SPR_HYPO4,6,T_Projectile,NULL,&s_needle1};
\r
2091 extern statetype s_giftstand;
\r
2093 extern statetype s_giftchase1;
\r
2094 extern statetype s_giftchase1s;
\r
2095 extern statetype s_giftchase2;
\r
2096 extern statetype s_giftchase3;
\r
2097 extern statetype s_giftchase3s;
\r
2098 extern statetype s_giftchase4;
\r
2100 extern statetype s_giftdie1;
\r
2101 extern statetype s_giftdie2;
\r
2102 extern statetype s_giftdie3;
\r
2103 extern statetype s_giftdie4;
\r
2104 extern statetype s_giftdie5;
\r
2105 extern statetype s_giftdie6;
\r
2107 extern statetype s_giftshoot1;
\r
2108 extern statetype s_giftshoot2;
\r
2110 extern statetype s_needle1;
\r
2111 extern statetype s_needle2;
\r
2112 extern statetype s_needle3;
\r
2113 extern statetype s_needle4;
\r
2115 extern statetype s_giftdeathcam;
\r
2117 extern statetype s_boom1;
\r
2118 extern statetype s_boom2;
\r
2119 extern statetype s_boom3;
\r
2122 statetype s_giftstand = {false,SPR_GIFT_W1,0,T_Stand,NULL,&s_giftstand};
\r
2124 statetype s_giftchase1 = {false,SPR_GIFT_W1,10,T_Gift,NULL,&s_giftchase1s};
\r
2125 statetype s_giftchase1s = {false,SPR_GIFT_W1,3,NULL,NULL,&s_giftchase2};
\r
2126 statetype s_giftchase2 = {false,SPR_GIFT_W2,8,T_Gift,NULL,&s_giftchase3};
\r
2127 statetype s_giftchase3 = {false,SPR_GIFT_W3,10,T_Gift,NULL,&s_giftchase3s};
\r
2128 statetype s_giftchase3s = {false,SPR_GIFT_W3,3,NULL,NULL,&s_giftchase4};
\r
2129 statetype s_giftchase4 = {false,SPR_GIFT_W4,8,T_Gift,NULL,&s_giftchase1};
\r
2131 statetype s_giftdeathcam = {false,SPR_GIFT_W1,1,NULL,NULL,&s_giftdie1};
\r
2133 statetype s_giftdie1 = {false,SPR_GIFT_W1,1,NULL,A_DeathScream,&s_giftdie2};
\r
2134 statetype s_giftdie2 = {false,SPR_GIFT_W1,10,NULL,NULL,&s_giftdie3};
\r
2135 statetype s_giftdie3 = {false,SPR_GIFT_DIE1,10,NULL,NULL,&s_giftdie4};
\r
2136 statetype s_giftdie4 = {false,SPR_GIFT_DIE2,10,NULL,NULL,&s_giftdie5};
\r
2137 statetype s_giftdie5 = {false,SPR_GIFT_DIE3,10,NULL,NULL,&s_giftdie6};
\r
2138 statetype s_giftdie6 = {false,SPR_GIFT_DEAD,20,NULL,A_StartDeathCam,&s_giftdie6};
\r
2140 statetype s_giftshoot1 = {false,SPR_GIFT_SHOOT1,30,NULL,NULL,&s_giftshoot2};
\r
2141 statetype s_giftshoot2 = {false,SPR_GIFT_SHOOT2,10,NULL,T_GiftThrow,&s_giftchase1};
\r
2147 extern statetype s_fatstand;
\r
2149 extern statetype s_fatchase1;
\r
2150 extern statetype s_fatchase1s;
\r
2151 extern statetype s_fatchase2;
\r
2152 extern statetype s_fatchase3;
\r
2153 extern statetype s_fatchase3s;
\r
2154 extern statetype s_fatchase4;
\r
2156 extern statetype s_fatdie1;
\r
2157 extern statetype s_fatdie2;
\r
2158 extern statetype s_fatdie3;
\r
2159 extern statetype s_fatdie4;
\r
2160 extern statetype s_fatdie5;
\r
2161 extern statetype s_fatdie6;
\r
2163 extern statetype s_fatshoot1;
\r
2164 extern statetype s_fatshoot2;
\r
2165 extern statetype s_fatshoot3;
\r
2166 extern statetype s_fatshoot4;
\r
2167 extern statetype s_fatshoot5;
\r
2168 extern statetype s_fatshoot6;
\r
2170 extern statetype s_needle1;
\r
2171 extern statetype s_needle2;
\r
2172 extern statetype s_needle3;
\r
2173 extern statetype s_needle4;
\r
2175 extern statetype s_fatdeathcam;
\r
2178 statetype s_fatstand = {false,SPR_FAT_W1,0,T_Stand,NULL,&s_fatstand};
\r
2180 statetype s_fatchase1 = {false,SPR_FAT_W1,10,T_Fat,NULL,&s_fatchase1s};
\r
2181 statetype s_fatchase1s = {false,SPR_FAT_W1,3,NULL,NULL,&s_fatchase2};
\r
2182 statetype s_fatchase2 = {false,SPR_FAT_W2,8,T_Fat,NULL,&s_fatchase3};
\r
2183 statetype s_fatchase3 = {false,SPR_FAT_W3,10,T_Fat,NULL,&s_fatchase3s};
\r
2184 statetype s_fatchase3s = {false,SPR_FAT_W3,3,NULL,NULL,&s_fatchase4};
\r
2185 statetype s_fatchase4 = {false,SPR_FAT_W4,8,T_Fat,NULL,&s_fatchase1};
\r
2187 statetype s_fatdeathcam = {false,SPR_FAT_W1,1,NULL,NULL,&s_fatdie1};
\r
2189 statetype s_fatdie1 = {false,SPR_FAT_W1,1,NULL,A_DeathScream,&s_fatdie2};
\r
2190 statetype s_fatdie2 = {false,SPR_FAT_W1,10,NULL,NULL,&s_fatdie3};
\r
2191 statetype s_fatdie3 = {false,SPR_FAT_DIE1,10,NULL,NULL,&s_fatdie4};
\r
2192 statetype s_fatdie4 = {false,SPR_FAT_DIE2,10,NULL,NULL,&s_fatdie5};
\r
2193 statetype s_fatdie5 = {false,SPR_FAT_DIE3,10,NULL,NULL,&s_fatdie6};
\r
2194 statetype s_fatdie6 = {false,SPR_FAT_DEAD,20,NULL,A_StartDeathCam,&s_fatdie6};
\r
2196 statetype s_fatshoot1 = {false,SPR_FAT_SHOOT1,30,NULL,NULL,&s_fatshoot2};
\r
2197 statetype s_fatshoot2 = {false,SPR_FAT_SHOOT2,10,NULL,T_GiftThrow,&s_fatshoot3};
\r
2198 statetype s_fatshoot3 = {false,SPR_FAT_SHOOT3,10,NULL,T_Shoot,&s_fatshoot4};
\r
2199 statetype s_fatshoot4 = {false,SPR_FAT_SHOOT4,10,NULL,T_Shoot,&s_fatshoot5};
\r
2200 statetype s_fatshoot5 = {false,SPR_FAT_SHOOT3,10,NULL,T_Shoot,&s_fatshoot6};
\r
2201 statetype s_fatshoot6 = {false,SPR_FAT_SHOOT4,10,NULL,T_Shoot,&s_fatchase1};
\r
2212 void SpawnSchabbs (int tilex, int tiley)
\r
2214 unsigned far *map,tile;
\r
2216 if (DigiMode != sds_Off)
\r
2217 s_schabbdie2.tictime = 140;
\r
2219 s_schabbdie2.tictime = 5;
\r
2221 SpawnNewObj (tilex,tiley,&s_schabbstand);
\r
2222 new->speed = SPDPATROL;
\r
2224 new->obclass = schabbobj;
\r
2225 new->hitpoints = starthitpoints[gamestate.difficulty][en_schabbs];
\r
2227 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
2229 gamestate.killtotal++;
\r
2241 void SpawnGift (int tilex, int tiley)
\r
2243 unsigned far *map,tile;
\r
2245 if (DigiMode != sds_Off)
\r
2246 s_giftdie2.tictime = 140;
\r
2248 s_giftdie2.tictime = 5;
\r
2250 SpawnNewObj (tilex,tiley,&s_giftstand);
\r
2251 new->speed = SPDPATROL;
\r
2253 new->obclass = giftobj;
\r
2254 new->hitpoints = starthitpoints[gamestate.difficulty][en_gift];
\r
2256 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
2258 gamestate.killtotal++;
\r
2270 void SpawnFat (int tilex, int tiley)
\r
2272 unsigned far *map,tile;
\r
2274 if (DigiMode != sds_Off)
\r
2275 s_fatdie2.tictime = 140;
\r
2277 s_fatdie2.tictime = 5;
\r
2279 SpawnNewObj (tilex,tiley,&s_fatstand);
\r
2280 new->speed = SPDPATROL;
\r
2282 new->obclass = fatobj;
\r
2283 new->hitpoints = starthitpoints[gamestate.difficulty][en_fat];
\r
2285 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
2287 gamestate.killtotal++;
\r
2299 void T_SchabbThrow (objtype *ob)
\r
2301 long deltax,deltay;
\r
2305 deltax = player->x - ob->x;
\r
2306 deltay = ob->y - player->y;
\r
2307 angle = atan2 (deltay,deltax);
\r
2309 angle = M_PI*2+angle;
\r
2310 iangle = angle/(M_PI*2)*ANGLES;
\r
2313 new->state = &s_needle1;
\r
2314 new->ticcount = 1;
\r
2316 new->tilex = ob->tilex;
\r
2317 new->tiley = ob->tiley;
\r
2320 new->obclass = needleobj;
\r
2322 new->angle = iangle;
\r
2323 new->speed = 0x2000l;
\r
2325 new->flags = FL_NONMARK;
\r
2326 new->active = true;
\r
2328 PlaySoundLocActor (SCHABBSTHROWSND,new);
\r
2339 void T_GiftThrow (objtype *ob)
\r
2341 long deltax,deltay;
\r
2345 deltax = player->x - ob->x;
\r
2346 deltay = ob->y - player->y;
\r
2347 angle = atan2 (deltay,deltax);
\r
2349 angle = M_PI*2+angle;
\r
2350 iangle = angle/(M_PI*2)*ANGLES;
\r
2353 new->state = &s_rocket;
\r
2354 new->ticcount = 1;
\r
2356 new->tilex = ob->tilex;
\r
2357 new->tiley = ob->tiley;
\r
2360 new->obclass = rocketobj;
\r
2362 new->angle = iangle;
\r
2363 new->speed = 0x2000l;
\r
2364 new->flags = FL_NONMARK;
\r
2365 new->active = true;
\r
2367 PlaySoundLocActor (MISSILEFIRESND,new);
\r
2380 void T_Schabb (objtype *ob)
\r
2387 dx = abs(ob->tilex - player->tilex);
\r
2388 dy = abs(ob->tiley - player->tiley);
\r
2389 dist = dx>dy ? dx : dy;
\r
2391 if (CheckLine(ob)) // got a shot at player?
\r
2394 if ( US_RndT() < (tics<<3) )
\r
2397 // go into attack frame
\r
2399 NewState (ob,&s_schabbshoot1);
\r
2405 if (ob->dir == nodir)
\r
2408 SelectDodgeDir (ob);
\r
2410 SelectChaseDir (ob);
\r
2411 if (ob->dir == nodir)
\r
2412 return; // object is blocked in
\r
2415 move = ob->speed*tics;
\r
2419 if (ob->distance < 0)
\r
2422 // waiting for a door to open
\r
2424 OpenDoor (-ob->distance-1);
\r
2425 if (doorobjlist[-ob->distance-1].action != dr_open)
\r
2427 ob->distance = TILEGLOBAL; // go ahead, the door is now opoen
\r
2430 if (move < ob->distance)
\r
2432 MoveObj (ob,move);
\r
2437 // reached goal tile, so select another one
\r
2441 // fix position to account for round off during moving
\r
2443 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
2444 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
2446 move -= ob->distance;
\r
2449 SelectRunDir (ob);
\r
2451 SelectDodgeDir (ob);
\r
2453 SelectChaseDir (ob);
\r
2455 if (ob->dir == nodir)
\r
2456 return; // object is blocked in
\r
2472 void T_Gift (objtype *ob)
\r
2479 dx = abs(ob->tilex - player->tilex);
\r
2480 dy = abs(ob->tiley - player->tiley);
\r
2481 dist = dx>dy ? dx : dy;
\r
2483 if (CheckLine(ob)) // got a shot at player?
\r
2486 if ( US_RndT() < (tics<<3) )
\r
2489 // go into attack frame
\r
2491 NewState (ob,&s_giftshoot1);
\r
2497 if (ob->dir == nodir)
\r
2500 SelectDodgeDir (ob);
\r
2502 SelectChaseDir (ob);
\r
2503 if (ob->dir == nodir)
\r
2504 return; // object is blocked in
\r
2507 move = ob->speed*tics;
\r
2511 if (ob->distance < 0)
\r
2514 // waiting for a door to open
\r
2516 OpenDoor (-ob->distance-1);
\r
2517 if (doorobjlist[-ob->distance-1].action != dr_open)
\r
2519 ob->distance = TILEGLOBAL; // go ahead, the door is now opoen
\r
2522 if (move < ob->distance)
\r
2524 MoveObj (ob,move);
\r
2529 // reached goal tile, so select another one
\r
2533 // fix position to account for round off during moving
\r
2535 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
2536 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
2538 move -= ob->distance;
\r
2541 SelectRunDir (ob);
\r
2543 SelectDodgeDir (ob);
\r
2545 SelectChaseDir (ob);
\r
2547 if (ob->dir == nodir)
\r
2548 return; // object is blocked in
\r
2564 void T_Fat (objtype *ob)
\r
2571 dx = abs(ob->tilex - player->tilex);
\r
2572 dy = abs(ob->tiley - player->tiley);
\r
2573 dist = dx>dy ? dx : dy;
\r
2575 if (CheckLine(ob)) // got a shot at player?
\r
2578 if ( US_RndT() < (tics<<3) )
\r
2581 // go into attack frame
\r
2583 NewState (ob,&s_fatshoot1);
\r
2589 if (ob->dir == nodir)
\r
2592 SelectDodgeDir (ob);
\r
2594 SelectChaseDir (ob);
\r
2595 if (ob->dir == nodir)
\r
2596 return; // object is blocked in
\r
2599 move = ob->speed*tics;
\r
2603 if (ob->distance < 0)
\r
2606 // waiting for a door to open
\r
2608 OpenDoor (-ob->distance-1);
\r
2609 if (doorobjlist[-ob->distance-1].action != dr_open)
\r
2611 ob->distance = TILEGLOBAL; // go ahead, the door is now opoen
\r
2614 if (move < ob->distance)
\r
2616 MoveObj (ob,move);
\r
2621 // reached goal tile, so select another one
\r
2625 // fix position to account for round off during moving
\r
2627 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
2628 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
2630 move -= ob->distance;
\r
2633 SelectRunDir (ob);
\r
2635 SelectDodgeDir (ob);
\r
2637 SelectChaseDir (ob);
\r
2639 if (ob->dir == nodir)
\r
2640 return; // object is blocked in
\r
2648 =============================================================================
\r
2652 =============================================================================
\r
2659 extern statetype s_fakestand;
\r
2661 extern statetype s_fakechase1;
\r
2662 extern statetype s_fakechase1s;
\r
2663 extern statetype s_fakechase2;
\r
2664 extern statetype s_fakechase3;
\r
2665 extern statetype s_fakechase3s;
\r
2666 extern statetype s_fakechase4;
\r
2668 extern statetype s_fakedie1;
\r
2669 extern statetype s_fakedie2;
\r
2670 extern statetype s_fakedie3;
\r
2671 extern statetype s_fakedie4;
\r
2672 extern statetype s_fakedie5;
\r
2673 extern statetype s_fakedie6;
\r
2675 extern statetype s_fakeshoot1;
\r
2676 extern statetype s_fakeshoot2;
\r
2677 extern statetype s_fakeshoot3;
\r
2678 extern statetype s_fakeshoot4;
\r
2679 extern statetype s_fakeshoot5;
\r
2680 extern statetype s_fakeshoot6;
\r
2681 extern statetype s_fakeshoot7;
\r
2682 extern statetype s_fakeshoot8;
\r
2683 extern statetype s_fakeshoot9;
\r
2685 extern statetype s_fire1;
\r
2686 extern statetype s_fire2;
\r
2688 statetype s_fakestand = {false,SPR_FAKE_W1,0,T_Stand,NULL,&s_fakestand};
\r
2690 statetype s_fakechase1 = {false,SPR_FAKE_W1,10,T_Fake,NULL,&s_fakechase1s};
\r
2691 statetype s_fakechase1s = {false,SPR_FAKE_W1,3,NULL,NULL,&s_fakechase2};
\r
2692 statetype s_fakechase2 = {false,SPR_FAKE_W2,8,T_Fake,NULL,&s_fakechase3};
\r
2693 statetype s_fakechase3 = {false,SPR_FAKE_W3,10,T_Fake,NULL,&s_fakechase3s};
\r
2694 statetype s_fakechase3s = {false,SPR_FAKE_W3,3,NULL,NULL,&s_fakechase4};
\r
2695 statetype s_fakechase4 = {false,SPR_FAKE_W4,8,T_Fake,NULL,&s_fakechase1};
\r
2697 statetype s_fakedie1 = {false,SPR_FAKE_DIE1,10,NULL,A_DeathScream,&s_fakedie2};
\r
2698 statetype s_fakedie2 = {false,SPR_FAKE_DIE2,10,NULL,NULL,&s_fakedie3};
\r
2699 statetype s_fakedie3 = {false,SPR_FAKE_DIE3,10,NULL,NULL,&s_fakedie4};
\r
2700 statetype s_fakedie4 = {false,SPR_FAKE_DIE4,10,NULL,NULL,&s_fakedie5};
\r
2701 statetype s_fakedie5 = {false,SPR_FAKE_DIE5,10,NULL,NULL,&s_fakedie6};
\r
2702 statetype s_fakedie6 = {false,SPR_FAKE_DEAD,0,NULL,NULL,&s_fakedie6};
\r
2704 statetype s_fakeshoot1 = {false,SPR_FAKE_SHOOT,8,NULL,T_FakeFire,&s_fakeshoot2};
\r
2705 statetype s_fakeshoot2 = {false,SPR_FAKE_SHOOT,8,NULL,T_FakeFire,&s_fakeshoot3};
\r
2706 statetype s_fakeshoot3 = {false,SPR_FAKE_SHOOT,8,NULL,T_FakeFire,&s_fakeshoot4};
\r
2707 statetype s_fakeshoot4 = {false,SPR_FAKE_SHOOT,8,NULL,T_FakeFire,&s_fakeshoot5};
\r
2708 statetype s_fakeshoot5 = {false,SPR_FAKE_SHOOT,8,NULL,T_FakeFire,&s_fakeshoot6};
\r
2709 statetype s_fakeshoot6 = {false,SPR_FAKE_SHOOT,8,NULL,T_FakeFire,&s_fakeshoot7};
\r
2710 statetype s_fakeshoot7 = {false,SPR_FAKE_SHOOT,8,NULL,T_FakeFire,&s_fakeshoot8};
\r
2711 statetype s_fakeshoot8 = {false,SPR_FAKE_SHOOT,8,NULL,T_FakeFire,&s_fakeshoot9};
\r
2712 statetype s_fakeshoot9 = {false,SPR_FAKE_SHOOT,8,NULL,NULL,&s_fakechase1};
\r
2714 statetype s_fire1 = {false,SPR_FIRE1,6,NULL,T_Projectile,&s_fire2};
\r
2715 statetype s_fire2 = {false,SPR_FIRE2,6,NULL,T_Projectile,&s_fire1};
\r
2720 extern statetype s_mechachase1;
\r
2721 extern statetype s_mechachase1s;
\r
2722 extern statetype s_mechachase2;
\r
2723 extern statetype s_mechachase3;
\r
2724 extern statetype s_mechachase3s;
\r
2725 extern statetype s_mechachase4;
\r
2727 extern statetype s_mechadie1;
\r
2728 extern statetype s_mechadie2;
\r
2729 extern statetype s_mechadie3;
\r
2730 extern statetype s_mechadie4;
\r
2732 extern statetype s_mechashoot1;
\r
2733 extern statetype s_mechashoot2;
\r
2734 extern statetype s_mechashoot3;
\r
2735 extern statetype s_mechashoot4;
\r
2736 extern statetype s_mechashoot5;
\r
2737 extern statetype s_mechashoot6;
\r
2740 extern statetype s_hitlerchase1;
\r
2741 extern statetype s_hitlerchase1s;
\r
2742 extern statetype s_hitlerchase2;
\r
2743 extern statetype s_hitlerchase3;
\r
2744 extern statetype s_hitlerchase3s;
\r
2745 extern statetype s_hitlerchase4;
\r
2747 extern statetype s_hitlerdie1;
\r
2748 extern statetype s_hitlerdie2;
\r
2749 extern statetype s_hitlerdie3;
\r
2750 extern statetype s_hitlerdie4;
\r
2751 extern statetype s_hitlerdie5;
\r
2752 extern statetype s_hitlerdie6;
\r
2753 extern statetype s_hitlerdie7;
\r
2754 extern statetype s_hitlerdie8;
\r
2755 extern statetype s_hitlerdie9;
\r
2756 extern statetype s_hitlerdie10;
\r
2758 extern statetype s_hitlershoot1;
\r
2759 extern statetype s_hitlershoot2;
\r
2760 extern statetype s_hitlershoot3;
\r
2761 extern statetype s_hitlershoot4;
\r
2762 extern statetype s_hitlershoot5;
\r
2763 extern statetype s_hitlershoot6;
\r
2765 extern statetype s_hitlerdeathcam;
\r
2767 statetype s_mechastand = {false,SPR_MECHA_W1,0,T_Stand,NULL,&s_mechastand};
\r
2769 statetype s_mechachase1 = {false,SPR_MECHA_W1,10,T_Chase,A_MechaSound,&s_mechachase1s};
\r
2770 statetype s_mechachase1s = {false,SPR_MECHA_W1,6,NULL,NULL,&s_mechachase2};
\r
2771 statetype s_mechachase2 = {false,SPR_MECHA_W2,8,T_Chase,NULL,&s_mechachase3};
\r
2772 statetype s_mechachase3 = {false,SPR_MECHA_W3,10,T_Chase,A_MechaSound,&s_mechachase3s};
\r
2773 statetype s_mechachase3s = {false,SPR_MECHA_W3,6,NULL,NULL,&s_mechachase4};
\r
2774 statetype s_mechachase4 = {false,SPR_MECHA_W4,8,T_Chase,NULL,&s_mechachase1};
\r
2776 statetype s_mechadie1 = {false,SPR_MECHA_DIE1,10,NULL,A_DeathScream,&s_mechadie2};
\r
2777 statetype s_mechadie2 = {false,SPR_MECHA_DIE2,10,NULL,NULL,&s_mechadie3};
\r
2778 statetype s_mechadie3 = {false,SPR_MECHA_DIE3,10,NULL,A_HitlerMorph,&s_mechadie4};
\r
2779 statetype s_mechadie4 = {false,SPR_MECHA_DEAD,0,NULL,NULL,&s_mechadie4};
\r
2781 statetype s_mechashoot1 = {false,SPR_MECHA_SHOOT1,30,NULL,NULL,&s_mechashoot2};
\r
2782 statetype s_mechashoot2 = {false,SPR_MECHA_SHOOT2,10,NULL,T_Shoot,&s_mechashoot3};
\r
2783 statetype s_mechashoot3 = {false,SPR_MECHA_SHOOT3,10,NULL,T_Shoot,&s_mechashoot4};
\r
2784 statetype s_mechashoot4 = {false,SPR_MECHA_SHOOT2,10,NULL,T_Shoot,&s_mechashoot5};
\r
2785 statetype s_mechashoot5 = {false,SPR_MECHA_SHOOT3,10,NULL,T_Shoot,&s_mechashoot6};
\r
2786 statetype s_mechashoot6 = {false,SPR_MECHA_SHOOT2,10,NULL,T_Shoot,&s_mechachase1};
\r
2789 statetype s_hitlerchase1 = {false,SPR_HITLER_W1,6,T_Chase,NULL,&s_hitlerchase1s};
\r
2790 statetype s_hitlerchase1s = {false,SPR_HITLER_W1,4,NULL,NULL,&s_hitlerchase2};
\r
2791 statetype s_hitlerchase2 = {false,SPR_HITLER_W2,2,T_Chase,NULL,&s_hitlerchase3};
\r
2792 statetype s_hitlerchase3 = {false,SPR_HITLER_W3,6,T_Chase,NULL,&s_hitlerchase3s};
\r
2793 statetype s_hitlerchase3s = {false,SPR_HITLER_W3,4,NULL,NULL,&s_hitlerchase4};
\r
2794 statetype s_hitlerchase4 = {false,SPR_HITLER_W4,2,T_Chase,NULL,&s_hitlerchase1};
\r
2796 statetype s_hitlerdeathcam = {false,SPR_HITLER_W1,10,NULL,NULL,&s_hitlerdie1};
\r
2798 statetype s_hitlerdie1 = {false,SPR_HITLER_W1,1,NULL,A_DeathScream,&s_hitlerdie2};
\r
2799 statetype s_hitlerdie2 = {false,SPR_HITLER_W1,10,NULL,NULL,&s_hitlerdie3};
\r
2800 statetype s_hitlerdie3 = {false,SPR_HITLER_DIE1,10,NULL,A_Slurpie,&s_hitlerdie4};
\r
2801 statetype s_hitlerdie4 = {false,SPR_HITLER_DIE2,10,NULL,NULL,&s_hitlerdie5};
\r
2802 statetype s_hitlerdie5 = {false,SPR_HITLER_DIE3,10,NULL,NULL,&s_hitlerdie6};
\r
2803 statetype s_hitlerdie6 = {false,SPR_HITLER_DIE4,10,NULL,NULL,&s_hitlerdie7};
\r
2804 statetype s_hitlerdie7 = {false,SPR_HITLER_DIE5,10,NULL,NULL,&s_hitlerdie8};
\r
2805 statetype s_hitlerdie8 = {false,SPR_HITLER_DIE6,10,NULL,NULL,&s_hitlerdie9};
\r
2806 statetype s_hitlerdie9 = {false,SPR_HITLER_DIE7,10,NULL,NULL,&s_hitlerdie10};
\r
2807 statetype s_hitlerdie10 = {false,SPR_HITLER_DEAD,20,NULL,A_StartDeathCam,&s_hitlerdie10};
\r
2809 statetype s_hitlershoot1 = {false,SPR_HITLER_SHOOT1,30,NULL,NULL,&s_hitlershoot2};
\r
2810 statetype s_hitlershoot2 = {false,SPR_HITLER_SHOOT2,10,NULL,T_Shoot,&s_hitlershoot3};
\r
2811 statetype s_hitlershoot3 = {false,SPR_HITLER_SHOOT3,10,NULL,T_Shoot,&s_hitlershoot4};
\r
2812 statetype s_hitlershoot4 = {false,SPR_HITLER_SHOOT2,10,NULL,T_Shoot,&s_hitlershoot5};
\r
2813 statetype s_hitlershoot5 = {false,SPR_HITLER_SHOOT3,10,NULL,T_Shoot,&s_hitlershoot6};
\r
2814 statetype s_hitlershoot6 = {false,SPR_HITLER_SHOOT2,10,NULL,T_Shoot,&s_hitlerchase1};
\r
2826 void SpawnFakeHitler (int tilex, int tiley)
\r
2828 unsigned far *map,tile;
\r
2831 if (DigiMode != sds_Off)
\r
2832 s_hitlerdie2.tictime = 140;
\r
2834 s_hitlerdie2.tictime = 5;
\r
2836 SpawnNewObj (tilex,tiley,&s_fakestand);
\r
2837 new->speed = SPDPATROL;
\r
2839 new->obclass = fakeobj;
\r
2840 new->hitpoints = starthitpoints[gamestate.difficulty][en_fake];
\r
2842 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
2844 gamestate.killtotal++;
\r
2856 void SpawnHitler (int tilex, int tiley)
\r
2858 unsigned far *map,tile;
\r
2860 if (DigiMode != sds_Off)
\r
2861 s_hitlerdie2.tictime = 140;
\r
2863 s_hitlerdie2.tictime = 5;
\r
2866 SpawnNewObj (tilex,tiley,&s_mechastand);
\r
2867 new->speed = SPDPATROL;
\r
2869 new->obclass = mechahitlerobj;
\r
2870 new->hitpoints = starthitpoints[gamestate.difficulty][en_hitler];
\r
2872 new->flags |= FL_SHOOTABLE|FL_AMBUSH;
\r
2874 gamestate.killtotal++;
\r
2886 void A_HitlerMorph (objtype *ob)
\r
2888 unsigned far *map,tile,hitpoints[4]={500,700,800,900};
\r
2891 SpawnNewObj (ob->tilex,ob->tiley,&s_hitlerchase1);
\r
2892 new->speed = SPDPATROL*5;
\r
2897 new->distance = ob->distance;
\r
2898 new->dir = ob->dir;
\r
2899 new->flags = ob->flags | FL_SHOOTABLE;
\r
2901 new->obclass = realhitlerobj;
\r
2902 new->hitpoints = hitpoints[gamestate.difficulty];
\r
2906 ////////////////////////////////////////////////////////
\r
2911 ////////////////////////////////////////////////////////
\r
2912 void A_MechaSound (objtype *ob)
\r
2914 if (areabyplayer[ob->areanumber])
\r
2915 PlaySoundLocActor (MECHSTEPSND,ob);
\r
2920 void A_Slurpie (objtype *ob)
\r
2922 SD_PlaySound(SLURPIESND);
\r
2933 void T_FakeFire (objtype *ob)
\r
2935 long deltax,deltay;
\r
2939 deltax = player->x - ob->x;
\r
2940 deltay = ob->y - player->y;
\r
2941 angle = atan2 (deltay,deltax);
\r
2943 angle = M_PI*2+angle;
\r
2944 iangle = angle/(M_PI*2)*ANGLES;
\r
2947 new->state = &s_fire1;
\r
2948 new->ticcount = 1;
\r
2950 new->tilex = ob->tilex;
\r
2951 new->tiley = ob->tiley;
\r
2955 new->angle = iangle;
\r
2956 new->obclass = fireobj;
\r
2957 new->speed = 0x1200l;
\r
2958 new->flags = FL_NEVERMARK;
\r
2959 new->active = true;
\r
2961 PlaySoundLocActor (FLAMETHROWERSND,new);
\r
2974 void T_Fake (objtype *ob)
\r
2980 if (CheckLine(ob)) // got a shot at player?
\r
2982 if ( US_RndT() < (tics<<1) )
\r
2985 // go into attack frame
\r
2987 NewState (ob,&s_fakeshoot1);
\r
2992 if (ob->dir == nodir)
\r
2994 SelectDodgeDir (ob);
\r
2995 if (ob->dir == nodir)
\r
2996 return; // object is blocked in
\r
2999 move = ob->speed*tics;
\r
3003 if (move < ob->distance)
\r
3005 MoveObj (ob,move);
\r
3010 // reached goal tile, so select another one
\r
3014 // fix position to account for round off during moving
\r
3016 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
3017 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
3019 move -= ob->distance;
\r
3021 SelectDodgeDir (ob);
\r
3023 if (ob->dir == nodir)
\r
3024 return; // object is blocked in
\r
3031 ============================================================================
\r
3035 ============================================================================
\r
3047 void T_Stand (objtype *ob)
\r
3054 ============================================================================
\r
3058 ============================================================================
\r
3069 void T_Chase (objtype *ob)
\r
3072 int dx,dy,dist,chance;
\r
3075 if (gamestate.victoryflag)
\r
3079 if (CheckLine(ob)) // got a shot at player?
\r
3081 dx = abs(ob->tilex - player->tilex);
\r
3082 dy = abs(ob->tiley - player->tiley);
\r
3083 dist = dx>dy ? dx : dy;
\r
3084 if (!dist || (dist==1 && ob->distance<0x4000) )
\r
3087 chance = (tics<<4)/dist;
\r
3089 if ( US_RndT()<chance)
\r
3092 // go into attack frame
\r
3094 switch (ob->obclass)
\r
3097 NewState (ob,&s_grdshoot1);
\r
3100 NewState (ob,&s_ofcshoot1);
\r
3103 NewState (ob,&s_mutshoot1);
\r
3106 NewState (ob,&s_ssshoot1);
\r
3110 NewState (ob,&s_bossshoot1);
\r
3113 NewState (ob,&s_gretelshoot1);
\r
3115 case mechahitlerobj:
\r
3116 NewState (ob,&s_mechashoot1);
\r
3118 case realhitlerobj:
\r
3119 NewState (ob,&s_hitlershoot1);
\r
3123 NewState (ob,&s_angelshoot1);
\r
3126 NewState (ob,&s_transshoot1);
\r
3129 NewState (ob,&s_ubershoot1);
\r
3132 NewState (ob,&s_willshoot1);
\r
3135 NewState (ob,&s_deathshoot1);
\r
3144 if (ob->dir == nodir)
\r
3147 SelectDodgeDir (ob);
\r
3149 SelectChaseDir (ob);
\r
3150 if (ob->dir == nodir)
\r
3151 return; // object is blocked in
\r
3154 move = ob->speed*tics;
\r
3158 if (ob->distance < 0)
\r
3161 // waiting for a door to open
\r
3163 OpenDoor (-ob->distance-1);
\r
3164 if (doorobjlist[-ob->distance-1].action != dr_open)
\r
3166 ob->distance = TILEGLOBAL; // go ahead, the door is now opoen
\r
3169 if (move < ob->distance)
\r
3171 MoveObj (ob,move);
\r
3176 // reached goal tile, so select another one
\r
3180 // fix position to account for round off during moving
\r
3182 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
3183 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
3185 move -= ob->distance;
\r
3188 SelectDodgeDir (ob);
\r
3190 SelectChaseDir (ob);
\r
3192 if (ob->dir == nodir)
\r
3193 return; // object is blocked in
\r
3207 void T_Ghosts (objtype *ob)
\r
3212 if (ob->dir == nodir)
\r
3214 SelectChaseDir (ob);
\r
3215 if (ob->dir == nodir)
\r
3216 return; // object is blocked in
\r
3219 move = ob->speed*tics;
\r
3223 if (move < ob->distance)
\r
3225 MoveObj (ob,move);
\r
3230 // reached goal tile, so select another one
\r
3234 // fix position to account for round off during moving
\r
3236 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
3237 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
3239 move -= ob->distance;
\r
3241 SelectChaseDir (ob);
\r
3243 if (ob->dir == nodir)
\r
3244 return; // object is blocked in
\r
3257 void T_DogChase (objtype *ob)
\r
3264 if (ob->dir == nodir)
\r
3266 SelectDodgeDir (ob);
\r
3267 if (ob->dir == nodir)
\r
3268 return; // object is blocked in
\r
3271 move = ob->speed*tics;
\r
3276 // check for byte range
\r
3278 dx = player->x - ob->x;
\r
3282 if (dx <= MINACTORDIST)
\r
3284 dy = player->y - ob->y;
\r
3288 if (dy <= MINACTORDIST)
\r
3290 NewState (ob,&s_dogjump1);
\r
3295 if (move < ob->distance)
\r
3297 MoveObj (ob,move);
\r
3302 // reached goal tile, so select another one
\r
3306 // fix position to account for round off during moving
\r
3308 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
3309 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
3311 move -= ob->distance;
\r
3313 SelectDodgeDir (ob);
\r
3315 if (ob->dir == nodir)
\r
3316 return; // object is blocked in
\r
3324 ============================================================================
\r
3328 ============================================================================
\r
3340 void SelectPathDir (objtype *ob)
\r
3344 spot = MAPSPOT(ob->tilex,ob->tiley,1)-ICONARROWS;
\r
3352 ob->distance = TILEGLOBAL;
\r
3354 if (!TryWalk (ob))
\r
3367 void T_Path (objtype *ob)
\r
3370 long deltax,deltay,size;
\r
3372 if (SightPlayer (ob))
\r
3375 if (ob->dir == nodir)
\r
3377 SelectPathDir (ob);
\r
3378 if (ob->dir == nodir)
\r
3379 return; // all movement is blocked
\r
3383 move = ob->speed*tics;
\r
3387 if (ob->distance < 0)
\r
3390 // waiting for a door to open
\r
3392 OpenDoor (-ob->distance-1);
\r
3393 if (doorobjlist[-ob->distance-1].action != dr_open)
\r
3395 ob->distance = TILEGLOBAL; // go ahead, the door is now opoen
\r
3398 if (move < ob->distance)
\r
3400 MoveObj (ob,move);
\r
3404 if (ob->tilex>MAPSIZE || ob->tiley>MAPSIZE)
\r
3406 sprintf (str,"T_Path hit a wall at %u,%u, dir %u"
\r
3407 ,ob->tilex,ob->tiley,ob->dir);
\r
3413 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
3414 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
3415 move -= ob->distance;
\r
3417 SelectPathDir (ob);
\r
3419 if (ob->dir == nodir)
\r
3420 return; // all movement is blocked
\r
3426 =============================================================================
\r
3430 =============================================================================
\r
3439 = Try to damage the player, based on skill level and player's speed
\r
3444 void T_Shoot (objtype *ob)
\r
3447 int hitchance,damage;
\r
3451 if (!areabyplayer[ob->areanumber])
\r
3454 if (!CheckLine (ob)) // player is behind a wall
\r
3457 dx = abs(ob->tilex - player->tilex);
\r
3458 dy = abs(ob->tiley - player->tiley);
\r
3459 dist = dx>dy ? dx:dy;
\r
3461 if (ob->obclass == ssobj || ob->obclass == bossobj)
\r
3462 dist = dist*2/3; // ss are better shots
\r
3464 if (thrustspeed >= RUNSPEED)
\r
3466 if (ob->flags&FL_VISABLE)
\r
3467 hitchance = 160-dist*16; // player can see to dodge
\r
3469 hitchance = 160-dist*8;
\r
3473 if (ob->flags&FL_VISABLE)
\r
3474 hitchance = 256-dist*16; // player can see to dodge
\r
3476 hitchance = 256-dist*8;
\r
3479 // see if the shot was a hit
\r
3481 if (US_RndT()<hitchance)
\r
3484 damage = US_RndT()>>2;
\r
3486 damage = US_RndT()>>3;
\r
3488 damage = US_RndT()>>4;
\r
3490 TakeDamage (damage,ob);
\r
3493 switch(ob->obclass)
\r
3496 PlaySoundLocActor(SSFIRESND,ob);
\r
3501 PlaySoundLocActor(MISSILEFIRESND,ob);
\r
3503 case mechahitlerobj:
\r
3504 case realhitlerobj:
\r
3506 PlaySoundLocActor(BOSSFIRESND,ob);
\r
3509 PlaySoundLocActor(SCHABBSTHROWSND,ob);
\r
3512 PlaySoundLocActor(FLAMETHROWERSND,ob);
\r
3516 PlaySoundLocActor(NAZIFIRESND,ob);
\r
3530 void T_Bite (objtype *ob)
\r
3533 int hitchance,damage;
\r
3536 PlaySoundLocActor(DOGATTACKSND,ob); // JAB
\r
3538 dx = player->x - ob->x;
\r
3542 if (dx <= MINACTORDIST)
\r
3544 dy = player->y - ob->y;
\r
3548 if (dy <= MINACTORDIST)
\r
3550 if (US_RndT()<180)
\r
3552 TakeDamage (US_RndT()>>4,ob);
\r
3564 ============================================================================
\r
3568 ============================================================================
\r
3576 void T_BJRun (objtype *ob);
\r
3577 void T_BJJump (objtype *ob);
\r
3578 void T_BJDone (objtype *ob);
\r
3579 void T_BJYell (objtype *ob);
\r
3581 void T_DeathCam (objtype *ob);
\r
3583 extern statetype s_bjrun1;
\r
3584 extern statetype s_bjrun1s;
\r
3585 extern statetype s_bjrun2;
\r
3586 extern statetype s_bjrun3;
\r
3587 extern statetype s_bjrun3s;
\r
3588 extern statetype s_bjrun4;
\r
3590 extern statetype s_bjjump1;
\r
3591 extern statetype s_bjjump2;
\r
3592 extern statetype s_bjjump3;
\r
3593 extern statetype s_bjjump4;
\r
3596 statetype s_bjrun1 = {false,SPR_BJ_W1,12,T_BJRun,NULL,&s_bjrun1s};
\r
3597 statetype s_bjrun1s = {false,SPR_BJ_W1,3, NULL,NULL,&s_bjrun2};
\r
3598 statetype s_bjrun2 = {false,SPR_BJ_W2,8,T_BJRun,NULL,&s_bjrun3};
\r
3599 statetype s_bjrun3 = {false,SPR_BJ_W3,12,T_BJRun,NULL,&s_bjrun3s};
\r
3600 statetype s_bjrun3s = {false,SPR_BJ_W3,3, NULL,NULL,&s_bjrun4};
\r
3601 statetype s_bjrun4 = {false,SPR_BJ_W4,8,T_BJRun,NULL,&s_bjrun1};
\r
3604 statetype s_bjjump1 = {false,SPR_BJ_JUMP1,14,T_BJJump,NULL,&s_bjjump2};
\r
3605 statetype s_bjjump2 = {false,SPR_BJ_JUMP2,14,T_BJJump,T_BJYell,&s_bjjump3};
\r
3606 statetype s_bjjump3 = {false,SPR_BJ_JUMP3,14,T_BJJump,NULL,&s_bjjump4};
\r
3607 statetype s_bjjump4 = {false,SPR_BJ_JUMP4,300,NULL,T_BJDone,&s_bjjump4};
\r
3610 statetype s_deathcam = {false,0,0,NULL,NULL,NULL};
\r
3621 void SpawnBJVictory (void)
\r
3623 unsigned far *map,tile;
\r
3625 SpawnNewObj (player->tilex,player->tiley+1,&s_bjrun1);
\r
3626 new->x = player->x;
\r
3627 new->y = player->y;
\r
3628 new->obclass = bjobj;
\r
3630 new->temp1 = 6; // tiles to run forward
\r
3643 void T_BJRun (objtype *ob)
\r
3647 move = BJRUNSPEED*tics;
\r
3651 if (move < ob->distance)
\r
3653 MoveObj (ob,move);
\r
3658 ob->x = ((long)ob->tilex<<TILESHIFT)+TILEGLOBAL/2;
\r
3659 ob->y = ((long)ob->tiley<<TILESHIFT)+TILEGLOBAL/2;
\r
3660 move -= ob->distance;
\r
3662 SelectPathDir (ob);
\r
3664 if ( !(--ob->temp1) )
\r
3666 NewState (ob,&s_bjjump1);
\r
3681 void T_BJJump (objtype *ob)
\r
3685 move = BJJUMPSPEED*tics;
\r
3686 MoveObj (ob,move);
\r
3698 void T_BJYell (objtype *ob)
\r
3700 PlaySoundLocActor(YEAHSND,ob); // JAB
\r
3713 void T_BJDone (objtype *ob)
\r
3715 playstate = ex_victorious; // exit castle tile
\r
3720 //===========================================================================
\r
3731 boolean CheckPosition (objtype *ob)
\r
3733 int x,y,xl,yl,xh,yh;
\r
3736 xl = (ob->x-PLAYERSIZE) >>TILESHIFT;
\r
3737 yl = (ob->y-PLAYERSIZE) >>TILESHIFT;
\r
3739 xh = (ob->x+PLAYERSIZE) >>TILESHIFT;
\r
3740 yh = (ob->y+PLAYERSIZE) >>TILESHIFT;
\r
3743 // check for solid walls
\r
3745 for (y=yl;y<=yh;y++)
\r
3746 for (x=xl;x<=xh;x++)
\r
3748 check = actorat[x][y];
\r
3749 if (check && check<objlist)
\r
3765 void A_StartDeathCam (objtype *ob)
\r
3773 FinishPaletteShifts ();
\r
3777 if (gamestate.victoryflag)
\r
3779 playstate = ex_victorious; // exit castle tile
\r
3783 gamestate.victoryflag = true;
\r
3784 VW_Bar (0,0,320,200-STATUSLINES,127);
\r
3785 FizzleFade(bufferofs,displayofs,320,200-STATUSLINES,70,false);
\r
3787 PM_UnlockMainMem ();
\r
3789 CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END);
\r
3792 CA_CacheScreen(C_LETSSEEPIC);
\r
3795 Write(0,7,STR_SEEAGAIN);
\r
3798 PM_CheckMainMem ();
\r
3800 VW_UpdateScreen ();
\r
3802 IN_UserInput(300);
\r
3805 // line angle up exactly
\r
3807 NewState (player,&s_deathcam);
\r
3809 player->x = gamestate.killx;
\r
3810 player->y = gamestate.killy;
\r
3812 dx = ob->x - player->x;
\r
3813 dy = player->y - ob->y;
\r
3815 fangle = atan2(dy,dx); // returns -pi to pi
\r
3817 fangle = M_PI*2+fangle;
\r
3819 player->angle = fangle/(M_PI*2)*ANGLES;
\r
3822 // try to position as close as possible without being in a wall
\r
3827 xmove = FixedByFrac(dist,costable[player->angle]);
\r
3828 ymove = -FixedByFrac(dist,sintable[player->angle]);
\r
3830 player->x = ob->x - xmove;
\r
3831 player->y = ob->y - ymove;
\r
3834 } while (!CheckPosition (player));
\r
3835 plux = player->x >> UNSIGNEDSHIFT; // scale to fit in unsigned
\r
3836 pluy = player->y >> UNSIGNEDSHIFT;
\r
3837 player->tilex = player->x >> TILESHIFT; // scale to tile values
\r
3838 player->tiley = player->y >> TILESHIFT;
\r
3841 // go back to the game
\r
3846 bufferofs = screenloc[i];
\r
3847 DrawPlayBorder ();
\r
3852 switch (ob->obclass)
\r
3856 NewState (ob,&s_schabbdeathcam);
\r
3858 case realhitlerobj:
\r
3859 NewState (ob,&s_hitlerdeathcam);
\r
3862 NewState (ob,&s_giftdeathcam);
\r
3865 NewState (ob,&s_fatdeathcam);
\r