Cube  Diff

Differences From Artifact [d7a9ce79c2]:

To Artifact [a4ab4f9d09]:


1
2
3
4

5
6
7
8
9
10
11
// weapon.cpp: all shooting and effects code

#include "cube.h"


#import "DynamicEntity.h"
#import "Monster.h"
#import "OFString+Cube.h"
#import "Projectile.h"

static const int MONSTERDAMAGEFACTOR = 4;
#define SGRAYS 20




>







1
2
3
4
5
6
7
8
9
10
11
12
// weapon.cpp: all shooting and effects code

#include "cube.h"

#import "Command.h"
#import "DynamicEntity.h"
#import "Monster.h"
#import "OFString+Cube.h"
#import "Projectile.h"

static const int MONSTERDAMAGEFACTOR = 4;
#define SGRAYS 20
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

int
reloadtime(int gun)
{
	return guns[gun].attackdelay;
}

void
weapon(OFString *a1, OFString *a2, OFString *a3)
{
	selectgun((a1.length > 0 ? a1.cube_intValue : -1),
	    (a2.length > 0 ? a2.cube_intValue : -1),
	    (a3.length > 0 ? a3.cube_intValue : -1));
}
COMMAND(weapon, ARG_3STR)

// create random spread of rays for the shotgun
void
createrays(const OFVector3D *from, const OFVector3D *to)
{
	vdist(dist, dvec, *from, *to);
	float f = dist * SGSPREAD / 1000;







<
|
<



|
<







59
60
61
62
63
64
65

66

67
68
69
70

71
72
73
74
75
76
77

int
reloadtime(int gun)
{
	return guns[gun].attackdelay;
}


COMMAND(weapon, ARG_3STR, ^(OFString *a1, OFString *a2, OFString *a3) {

	selectgun((a1.length > 0 ? a1.cube_intValue : -1),
	    (a2.length > 0 ? a2.cube_intValue : -1),
	    (a3.length > 0 ? a3.cube_intValue : -1));
})


// create random spread of rays for the shotgun
void
createrays(const OFVector3D *from, const OFVector3D *to)
{
	vdist(dist, dvec, *from, *to);
	float f = dist * SGSPREAD / 1000;