Esempio n. 1
0
DROID_TEMPLATE::DROID_TEMPLATE(LineView line)
	: BASE_STATS(REF_TEMPLATE_START + line.line())
	//, aName
	//, asParts
	, buildPoints(0)
	, powerPoints(0)
	, storeCount(0)
	, numWeaps(line.i(11, 0, DROID_MAXWEAPS))
	//, asWeaps
	, droidType(line.e(9, map_DROID_TYPE))
	, multiPlayerID(line.u32(1))
	, psNext(NULL)
	, prefab(false)
	, stored(false)
	// Ignored columns: 6 - but used later to decide whether the template is for human players.
{
	std::string name = line.s(0);
	sstrcpy(aName, name.c_str());

	asParts[COMP_UNKNOWN]    = 0;  // Is this one useful for anything at all?
	asParts[COMP_BODY]       = line.stats( 2, asBodyStats,       numBodyStats)       - asBodyStats;
	asParts[COMP_BRAIN]      = line.stats( 3, asBrainStats,      numBrainStats)      - asBrainStats;
	asParts[COMP_CONSTRUCT]  = line.stats( 4, asConstructStats,  numConstructStats)  - asConstructStats;
	asParts[COMP_ECM]        = line.stats( 5, asECMStats,        numECMStats)        - asECMStats;
	asParts[COMP_PROPULSION] = line.stats( 7, asPropulsionStats, numPropulsionStats) - asPropulsionStats;
	asParts[COMP_REPAIRUNIT] = line.stats( 8, asRepairStats,     numRepairStats)     - asRepairStats;
	asParts[COMP_SENSOR]     = line.stats(10, asSensorStats,     numSensorStats)     - asSensorStats;

	std::fill_n(asWeaps, DROID_MAXWEAPS, 0);
}
Esempio n. 2
0
FEATURE_STATS::FEATURE_STATS(LineView line)
	: BASE_STATS(REF_FEATURE_START + line.line(), line.s(0))
	, subType(line.e(7, map_FEATURE_TYPE))
	, psImd(line.imdShape(6))
	, baseWidth(line.u16(1))
	, baseBreadth(line.u16(2))
	, tileDraw(line.b(8))
	, allowLOS(line.b(9))
	, visibleAtStart(line.b(10))
	, damageable(line.b(3))
	, body(line.u32(5))
	, armourValue(line.u32(4))
{
	if (damageable && body == 0)
	{
		debug(LOG_ERROR, "The feature \"%s\", ref %d is damageable, but has no body points!  The files need to be updated / fixed.  Assigning 1 body point to feature.", pName, ref);
		body = 1;
	}
}