Subversion Repositories Games.Rick Dangerous

Rev

Rev 1 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * src/e_bonus.c
  3.  *
  4.  * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). All rights reserved.
  5.  *
  6.  * The use and distribution terms for this software are contained in the file
  7.  * named README, which can be found in the root of this distribution. By
  8.  * using this software in any fashion, you are agreeing to be bound by the
  9.  * terms of this license.
  10.  *
  11.  * You must not remove this notice, or any other, from this software.
  12.  */
  13.  
  14. #include "system.h"
  15. #include "game.h"
  16. #include "ents.h"
  17. #include "e_bonus.h"
  18.  
  19. #include "e_rick.h"
  20. #include "maps.h"
  21.  
  22.  
  23. /*
  24.  * Entity action
  25.  *
  26.  * ASM 242C
  27.  */
  28. #define seq c1
  29. void e_bonus_action (U8 e)
  30. {
  31.    if (E_RICK_STTST (E_RICK_STZOMBIE))
  32.       return; // don't pick up stuff when we're dead
  33.  
  34. #define seq c1
  35.  
  36.    if (ent_ents[e].seq == 0)
  37.    {
  38.       if (e_rick_boxtest (e))
  39.       {
  40.          game_score += 500;
  41.          syssnd_play (WAV_BONUS, 1);
  42.          map_marks[ent_ents[e].mark].ent |= MAP_MARK_NACT;
  43.          ent_ents[e].seq = 1;
  44.          ent_ents[e].sprite = 0xad; // flying number '500'
  45.          ent_ents[e].front = TRUE;
  46.          ent_ents[e].y -= 0x08;
  47.       }
  48.    }
  49.    else if ((ent_ents[e].seq > 0) && (ent_ents[e].seq < 10))
  50.    {
  51.       ent_ents[e].seq++;
  52.       ent_ents[e].y -= 2; // raise the floating number progressively during 10 frames
  53.    }
  54.    else
  55.       ent_ents[e].n = 0;
  56. }
  57.