コード例 #1
0
ファイル: oprint.cpp プロジェクト: BG1/warzone2100
/** print out information about a droid and it's components
 *  \param psDroid the droid to print the info for
 */
void printDroidInfo(const DROID* psDroid)
{
	unsigned int i;
	BODY_STATS			*psBdyStats;
	PROPULSION_STATS	*psPropStats;
	ECM_STATS			*psECMStats;
	SENSOR_STATS		*psSensStats;
	CONSTRUCT_STATS		*psConstStats;
	REPAIR_STATS		*psRepairStats;

	printBaseObjInfo((BASE_OBJECT *)psDroid);

	CONPRINTF(ConsoleString,(ConsoleString,"   wt %d bSpeed %d sRng %d ECM %d bdy %d\n",
		psDroid->weight, psDroid->baseSpeed, droidSensorRange(psDroid), droidConcealment(psDroid), psDroid->body));

	if (psDroid->asWeaps[0].nStat > 0)
	{
		printWeaponInfo(asWeaponStats + psDroid->asWeaps[0].nStat);
	}

	for (i = 0; i < COMP_NUMCOMPONENTS; ++i)
	{
		switch (i)
		{
		case COMP_UNKNOWN:
			break;
		case COMP_BODY:
			if (psDroid->asBits[i].nStat > 0)
			{
				CONPRINTF(ConsoleString,(ConsoleString,"Body: "));
				psBdyStats = asBodyStats + psDroid->asBits[i].nStat;
				printComponentInfo((COMPONENT_STATS *)psBdyStats);
			}
			else
			{
				CONPRINTF(ConsoleString,(ConsoleString,"ZNULL BODY\n"));
			}
			break;
		case COMP_BRAIN:
			break;
		case COMP_PROPULSION:
			if (psDroid->asBits[i].nStat > 0)
			{
				CONPRINTF(ConsoleString,(ConsoleString,"Prop: "));
				psPropStats = asPropulsionStats + psDroid->asBits[i].nStat;
				printComponentInfo((COMPONENT_STATS *)psPropStats);
			}
			else
			{
				CONPRINTF(ConsoleString,(ConsoleString,"ZNULL PROPULSION\n"));
			}
			break;
		case COMP_ECM:
			if (psDroid->asBits[i].nStat > 0)
			{
				CONPRINTF(ConsoleString,(ConsoleString,"ECM: "));
				psECMStats = asECMStats + psDroid->asBits[i].nStat;
				printComponentInfo((COMPONENT_STATS *)psECMStats);
				CONPRINTF(ConsoleString,(ConsoleString,"   range %d loc %d imd %p\n",
					//psECMStats->power, psECMStats->location, psECMStats->pMountGraphic));
					ecmRange(psECMStats, psDroid->player), psECMStats->location,
					psECMStats->pMountGraphic));
			}
			else
			{
				CONPRINTF(ConsoleString,(ConsoleString,"ZNULL ECM\n"));
			}
			break;
		case COMP_SENSOR:
			if (psDroid->asBits[i].nStat > 0)
			{
				CONPRINTF(ConsoleString,(ConsoleString,"Sensor: "));
				psSensStats = asSensorStats + psDroid->asBits[i].nStat;
				printComponentInfo((COMPONENT_STATS *)psSensStats);
				CONPRINTF(ConsoleString,(ConsoleString,"   rng %d loc %d imd %p\n",
					sensorRange(psSensStats,psDroid->player),
					psSensStats->location, psSensStats->pMountGraphic));
			}
			else
			{
				CONPRINTF(ConsoleString,(ConsoleString,"ZNULL SENSOR\n"));
			}
			break;
		case COMP_CONSTRUCT:
			if (psDroid->asBits[i].nStat > 0)
			{
				CONPRINTF(ConsoleString,(ConsoleString,"Construct: "));
				psConstStats = asConstructStats + psDroid->asBits[i].nStat;
				printComponentInfo((COMPONENT_STATS *)psConstStats);
				CONPRINTF(ConsoleString,(ConsoleString,"   cPnts %d imd %p\n",
					//psConstStats->constructPoints, psConstStats->pMountGraphic));
					constructorPoints(psConstStats, psDroid->player),
					psConstStats->pMountGraphic));
			}
			break;
		case COMP_REPAIRUNIT:
			if (psDroid->asBits[i].nStat > 0)
			{
				CONPRINTF(ConsoleString,(ConsoleString,"Repair: "));
				psRepairStats = asRepairStats + psDroid->asBits[i].nStat;
				printComponentInfo((COMPONENT_STATS *)psRepairStats);
				CONPRINTF(ConsoleString,(ConsoleString,"   repPnts %d loc %d imd %p\n",
					//psRepairStats->repairPoints, psRepairStats->location,
					repairPoints(psRepairStats, psDroid->player),
					psRepairStats->location,
					psRepairStats->pMountGraphic));
			}
			break;
		case COMP_WEAPON:
		default:
			break;
		}
	}
}
コード例 #2
0
ファイル: oprint.cpp プロジェクト: BG1/warzone2100
/** print out weapon information
 *  \param psStats the weapon to print the info for
 */
static void printWeaponInfo(const WEAPON_STATS* psStats)
{
	const char *pWC, *pWSC, *pMM;

	switch (psStats->weaponClass)
	{
	case WC_KINETIC:		//bullets etc
		pWC = "WC_KINETIC";
		break;
	//case WC_EXPLOSIVE:	//rockets etc
	//	pWC = "WC_EXPLOSIVE";
	//	break;
	case WC_HEAT:		//laser etc
		pWC = "WC_HEAT";
		break;
	//case WC_MISC:		//others we haven't thought of!
	//	pWC = "WC_MISC";
	//	break;
	default:
		pWC = "UNKNOWN CLASS";
		break;
	}
	switch (psStats->weaponSubClass)
	{
	case WSC_MGUN:
		pWSC = "WSC_MGUN";
		break;
	case WSC_CANNON:
		pWSC = "WSC_CANNON";
		break;
	/*case WSC_ARTILLARY:
		pWSC = "WSC_ARTILLARY";
		break;*/
	case WSC_MORTARS:
		pWSC = "WSC_MORTARS";
		break;
	case WSC_MISSILE:
		pWSC = "WSC_MISSILE";
		break;
	case WSC_ROCKET:
		pWSC = "WSC_ROCKET";
		break;
	case WSC_ENERGY:
		pWSC = "WSC_ENERGY";
		break;
	case WSC_GAUSS:
		pWSC = "WSC_GAUSS";
		break;
	case WSC_FLAME:
		pWSC = "WSC_FLAME";
		break;
	/*case WSC_CLOSECOMBAT:
		pWSC = "WSC_CLOSECOMBAT";
		break;*/
	case WSC_HOWITZERS:
		pWSC = "WSC_HOWITZERS";
		break;
	case WSC_ELECTRONIC:
		pWSC = "WSC_ELECTRONIC";
		break;
	case WSC_AAGUN:
		pWSC = "WSC_AAGUN";
		break;
	case WSC_SLOWMISSILE:
		pWSC = "WSC_SLOWMISSILE";
		break;
	case WSC_SLOWROCKET:
		pWSC = "WSC_SLOWROCKET";
		break;
	case WSC_LAS_SAT:
		pWSC = "WSC_LAS_SAT";
		break;
	case WSC_BOMB:
		pWSC = "WSC_BOMB";
		break;
	case WSC_COMMAND:
		pWSC = "WSC_COMMAND";
		break;
	case WSC_EMP:
		pWSC = "WSC_EMP";
		break;
	default:
		pWSC = "UNKNOWN SUB CLASS";
		break;
	}
	switch (psStats->movementModel)
	{
	case MM_DIRECT:
		pMM = "MM_DIRECT";
		break;
	case MM_INDIRECT:
		pMM = "MM_INDIRECT";
		break;
	case MM_HOMINGDIRECT:
		pMM = "MM_HOMINGDIRECT";
		break;
	case MM_HOMINGINDIRECT:
		pMM = "MM_HOMINGINDIRECT";
		break;
	case MM_ERRATICDIRECT:
		pMM = "MM_ERRATICDIRECT";
		break;
	case MM_SWEEP:
		pMM = "MM_SWEEP";
		break;
	default:
		pMM = "UNKNOWN MOVE MODEL";
		break;
	}


	CONPRINTF(ConsoleString,(ConsoleString,"Weapon: "));
	printComponentInfo((COMPONENT_STATS *)psStats);
	CONPRINTF(ConsoleString,(ConsoleString,"   sRng %d lRng %d mRng %d %s\n"
			  "   sHt %d lHt %d pause %d dam %d\n",
				psStats->shortRange, proj_GetLongRange(psStats), psStats->minRange,
				proj_Direct(psStats) ? "direct" : "indirect",
				//psStats->shortHit, psStats->longHit, psStats->firePause, psStats->damage));
				weaponShortHit(psStats,(UBYTE)selectedPlayer), weaponLongHit(psStats,
				(UBYTE)selectedPlayer), weaponFirePause(psStats,(UBYTE)selectedPlayer),
				weaponDamage(psStats, (UBYTE)selectedPlayer)));
	CONPRINTF(ConsoleString,(ConsoleString,"   rad %d radHt %d radDam %d\n"
			  "   inTime %d inDam %d inRad %d\n",
				psStats->radius, psStats->radiusHit, psStats->radiusDamage,
				psStats->incenTime, psStats->incenDamage, psStats->incenRadius));
	CONPRINTF(ConsoleString,(ConsoleString,"   flSpd %d %s\n",
				psStats->flightSpeed, psStats->fireOnMove ? "fireOnMove" : "not fireOnMove"));
	CONPRINTF(ConsoleString,(ConsoleString,"   %s %s %s\n", pWC, pWSC, pMM));
	CONPRINTF(ConsoleString,(ConsoleString,"   %srotate recoil %d\n"
			  "   dLife %d radLife %d\n",
			  psStats->rotate ? "" : "not ",
			  psStats->recoilValue, psStats->directLife, psStats->radiusLife));
}
コード例 #3
0
ファイル: oprint.cpp プロジェクト: ik3210/warzone2100
/** print out weapon information
 *  \param psStats the weapon to print the info for
 */
static void printWeaponInfo(const WEAPON_STATS *psStats)
{
	const char *pWC, *pWSC, *pMM;

	switch (psStats->weaponClass)
	{
	case WC_KINETIC:		//bullets etc
		pWC = "WC_KINETIC";
		break;
	case WC_HEAT:		//laser etc
		pWC = "WC_HEAT";
		break;
	default:
		pWC = "UNKNOWN CLASS";
		break;
	}
	switch (psStats->weaponSubClass)
	{
	case WSC_MGUN:
		pWSC = "WSC_MGUN";
		break;
	case WSC_CANNON:
		pWSC = "WSC_CANNON";
		break;
	case WSC_MORTARS:
		pWSC = "WSC_MORTARS";
		break;
	case WSC_MISSILE:
		pWSC = "WSC_MISSILE";
		break;
	case WSC_ROCKET:
		pWSC = "WSC_ROCKET";
		break;
	case WSC_ENERGY:
		pWSC = "WSC_ENERGY";
		break;
	case WSC_GAUSS:
		pWSC = "WSC_GAUSS";
		break;
	case WSC_FLAME:
		pWSC = "WSC_FLAME";
		break;
	case WSC_HOWITZERS:
		pWSC = "WSC_HOWITZERS";
		break;
	case WSC_ELECTRONIC:
		pWSC = "WSC_ELECTRONIC";
		break;
	case WSC_AAGUN:
		pWSC = "WSC_AAGUN";
		break;
	case WSC_SLOWMISSILE:
		pWSC = "WSC_SLOWMISSILE";
		break;
	case WSC_SLOWROCKET:
		pWSC = "WSC_SLOWROCKET";
		break;
	case WSC_LAS_SAT:
		pWSC = "WSC_LAS_SAT";
		break;
	case WSC_BOMB:
		pWSC = "WSC_BOMB";
		break;
	case WSC_COMMAND:
		pWSC = "WSC_COMMAND";
		break;
	case WSC_EMP:
		pWSC = "WSC_EMP";
		break;
	default:
		pWSC = "UNKNOWN SUB CLASS";
		break;
	}
	switch (psStats->movementModel)
	{
	case MM_DIRECT:
		pMM = "MM_DIRECT";
		break;
	case MM_INDIRECT:
		pMM = "MM_INDIRECT";
		break;
	case MM_HOMINGDIRECT:
		pMM = "MM_HOMINGDIRECT";
		break;
	case MM_HOMINGINDIRECT:
		pMM = "MM_HOMINGINDIRECT";
		break;
	default:
		pMM = "UNKNOWN MOVE MODEL";
		break;
	}

	CONPRINTF(ConsoleString, (ConsoleString, "Weapon: "));
	printComponentInfo((COMPONENT_STATS *)psStats);
	CONPRINTF(ConsoleString, (ConsoleString, "   lRng %d mRng %d %s\n"
	                          "   lHt %d pause %d dam %d\n",
	                          proj_GetLongRange(psStats, selectedPlayer), psStats->upgrade[selectedPlayer].minRange,
	                          proj_Direct(psStats) ? "direct" : "indirect",
	                          weaponLongHit(psStats, selectedPlayer), weaponFirePause(psStats, selectedPlayer),
	                          weaponDamage(psStats, selectedPlayer)));
	CONPRINTF(ConsoleString, (ConsoleString, "   rad %d radDam %d\n"
	                          "   inTime %d inDam %d inRad %d\n",
	                          psStats->upgrade[selectedPlayer].radius, psStats->upgrade[selectedPlayer].radiusDamage,
	                          psStats->upgrade[selectedPlayer].periodicalDamageTime, psStats->upgrade[selectedPlayer].periodicalDamage, psStats->upgrade[selectedPlayer].periodicalDamageRadius));
	CONPRINTF(ConsoleString, (ConsoleString, "   flSpd %d %s\n",
	                          psStats->flightSpeed, psStats->fireOnMove ? "fireOnMove" : "not fireOnMove"));
	CONPRINTF(ConsoleString, (ConsoleString, "   %s %s %s\n", pWC, pWSC, pMM));
	CONPRINTF(ConsoleString, (ConsoleString, "   %srotate recoil %d\n"
	                          "   radLife %d\n",
	                          psStats->rotate ? "" : "not ",
	                          psStats->recoilValue, psStats->radiusLife));
}