-
Notifications
You must be signed in to change notification settings - Fork 1
/
C4.h
83 lines (62 loc) · 2.17 KB
/
C4.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*************************************************************************
Crytek Source File.
Copyright (C), Crytek Studios, 2001-2004.
-------------------------------------------------------------------------
$Id$
$DateTime$
Description: C4 Implementation
-------------------------------------------------------------------------
History:
- 2:3:2006 16:05 : Created by Marcio Martins
*************************************************************************/
#ifndef __C4_H__
#define __C4_H__
#if _MSC_VER > 1000
# pragma once
#endif
#include <IItemSystem.h>
#include "Weapon.h"
class CC4 :
public CWeapon
{
public:
CC4();
virtual ~CC4();
virtual void OnAction(EntityId actorId, const ActionId& actionId, int activationMode, float value);
virtual void PickUp(EntityId pickerId, bool sound, bool select, bool keepHistory, const char *setup = NULL);
virtual bool CanSelect() const;
virtual void Select(bool select);
virtual void GetMemoryUsage(ICrySizer * s) const { s->Add(*this); CWeapon::GetMemoryUsage(s); }
virtual void Drop(float impulseScale, bool selectNext/* =true */, bool byDeath/* =false */);
struct SetProjectileIdParams
{
SetProjectileIdParams(): id(0), fmId(0) {};
SetProjectileIdParams(EntityId _id, int _fmId): id(_id), fmId(_fmId) {};
EntityId id;
int fmId;
void SerializeWith(TSerialize ser)
{
ser.Value("fmId", fmId, 'fmod');
ser.Value("projectileId", id, 'eid');
}
};
struct RequestTimeParams
{
RequestTimeParams(): time(0.0f), fmId(0) {};
RequestTimeParams(float _time, int _fmId): time(_time), fmId(_fmId) {};
float time;
int fmId;
void SerializeWith(TSerialize ser)
{
ser.Value("fmId", fmId, 'fmod');
ser.Value("time", time, 'fsec');
}
};
DECLARE_CLIENT_RMI_NOATTACH(ClSetProjectileId, SetProjectileIdParams, eNRT_ReliableUnordered);
DECLARE_SERVER_RMI_NOATTACH(SvRequestTime, RequestTimeParams, eNRT_ReliableUnordered);
private:
static TActionHandler<CC4> s_actionHandler;
bool OnActionSelectDetonator(EntityId actorId, const ActionId& actionId, int activationMode, float value);
void SelectDetonator();
};
#endif // __C4_H__