Subversion Repositories Games.Rick Dangerous

Rev

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

Rev Author Line No. Line
1 pmbaty 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
 */
10 pmbaty 28
#define seq c1
1 pmbaty 29
void e_bonus_action (U8 e)
30
{
31
   if (E_RICK_STTST (E_RICK_STZOMBIE))
10 pmbaty 32
      return; // don't pick up stuff when we're dead
1 pmbaty 33
 
10 pmbaty 34
#define seq c1
35
 
36
   if (ent_ents[e].seq == 0)
1 pmbaty 37
   {
10 pmbaty 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
1 pmbaty 55
      ent_ents[e].n = 0;
56
}