Beispiel #1
0
Engine	engine_create_rand(unsigned level) {
	static int table_evasion[] = {
		10,
		15,
		25,
		40,
		50,
		60,
		70
	};

	Engine		e;
	//EngineType	et = rand_born(0, A_LAST);

	int	mark = rand_born(0, MAXMARK(level));

	e.evasionChance = table_evasion[mark];
	e.isVisible = true;

	e.speed = 0;
	e.type = 0;

	e.price = rand_float(2, 11) * ((mark + 1) * 10000);;

	strcpy(e.name, gTable_markName[mark]);

	return e;
}
Beispiel #2
0
Weapon	weapon_create_rand(unsigned level) {
	static float table_weapon[] = {
		1.f,
		1.2f,
		1.5f,
		1.8f,
		1.9f,
		2.3f,
		3.2f
	};

	static int table_damage[] = {
		10,
		2,
		30,
		20
	};

	static float table_penArmor[] = {
		5.0,
		3.0,
		7.0,
		15.0
	};

	static float table_castTime[] = {
		1.0f,
		0.1f,
		3.0f,
		2.0f
	};

	Weapon		w;
	WeaponType	wt = rand_born(0, W_LAST - 1);

	int			mark = rand_born(0, MAXMARK(level));

	float	offset = table_weapon[mark];
	float	critic = rand_float(5.f, 21.f);

	w.damage = (int)(table_damage[wt] * offset + rand_born(0, 4 + (offset / 1.5)));
	w.penArmor = table_penArmor[wt] * offset;
	w.criticalChance = critic + (9 * offset);

	w.castTime = table_castTime[wt] / (offset);

	w.isVisible = true;
	w.type = wt;

	w.price = rand_float(1, 10) * ((mark + 1) * 1000);

	strcpy(w.name, gTable_markName[mark]);

	return w;
}
Beispiel #3
0
Armor 	armor_create_rand(unsigned level) {
	static float table_armor[] = {
		10.0,
		15.0,
		25.0,
		40.0,
		50.0,
		60.0,
		70.0,
		90.0f
	};

	// A revoir
	static float table_armor_life[] = {
		100.0,
		400.0,
		800.0,
		1000.0,
		1500.0,
		2000.0,
		3000.0,
		5000.0
	};

	Armor		a;
	ArmorType	at = rand_born(0, A_LAST);

	int			mark = rand_born(0, MAXMARK(level));

	a.armor = table_armor[mark];
	a.life = table_armor_life[mark];

	a.isVisible = true;
	a.type = at;

	a.price = rand_float(1, 10) * ((mark + 1) * 1000);

	strcpy(a.name, gTable_markName[mark]);

	return a;
}
Beispiel #4
0
Armor 	armor_create_rand(unsigned level) {
	static float table_armor[] = {
		10,
		15,
		25,
		40,
		50,
		60,
		70,
		90
	};

	// A revoir
	static float table_armor_life[] = {
		100,
		400,
		800,
		1000,
		1500,
		2000,
		3000,
		5000
	};

	Armor		a;
	ArmorType	at = rand_born(0, A_LAST);

	int			mark = rand_born(0, MAXMARK(level));

	a.armor = table_armor[mark];
	a.life = table_armor_life[mark];

	a.isVisible = true;
	a.type = at;

	strcpy(a.name, gTable_markName[mark]);

	return a;
}