Ejemplo n.º 1
0
std::pair<float, float> GameState::Coordinates(int player) {
  UpdateAddress(6 + 2 * (player - 1));
  //UpdateAddress(7 + 2 * (player - 1));
  float x = LongToFloat(raw_input[6 + 2 * (player - 1)]);
  float y = LongToFloat(raw_input[7 + 2 * (player - 1)]);
  return std::make_pair(x, y);
}
Ejemplo n.º 2
0
void CEi::Notify(PNETWORKDATA data)
{
	switch(data->p1)
	{
	case 1:	// Splat
		Splat();
		break;
	case 2: // Getroffen, Schaden abziehen
		{
			CBauer* b=(CBauer*)chain->Find(data->p2);
			if (b==NULL)return;
			b->life=*(float*)data->userdata;
			CChickenPlayer* c=(CChickenPlayer*)chain->Find(owner);
			if (c)c->hit+=LongToFloat(data->p3)*0.01f;

			// Bauer getötet
			if ((b->Hit(LongToFloat(data->p3)))&&(c))
				c->HasHit(b->id);
			
			Splat();
		}
		break;
	case 3:	// Objekt einfach entfernen
		Remove();
		break;
	}
}
Ejemplo n.º 3
0
void CEi::ReceiveData(PNETWORKDATA data)
{
	if (data->p1==1)
	{
		pos=*(D3DVECTOR*)data->userdata;
		owner=data->p2;
		ang.x=LongToFloat(data->p3);
	}
	if (data->p1==2)
	{
		speed=*(D3DVECTOR*)data->userdata;
		ang.y=LongToFloat(data->p2);
		ang.z=LongToFloat(data->p3);
	}
}
Ejemplo n.º 4
0
void CDrescher::ReceiveData(PNETWORKDATA data)
{
	if (data->p1==1)
	{
		pos=*(D3DVECTOR*)data->userdata;
		parent=game->chain->Find(data->p2);
		ang.y=LongToFloat(data->p3);
		UpdateBox();
	}
	DebugOut("CDrescher::ReceiveData();");
}
Ejemplo n.º 5
0
float GameState::P2ShieldSize() {
  UpdateAddress(17);
  return LongToFloat(raw_input[17]);
}  
Ejemplo n.º 6
0
int GameState::P2Hitlag() {
  UpdateAddress(15);
  return LongToFloat(raw_input[15]);
}
Ejemplo n.º 7
0
float GameState::P2VerticalVelocity() {
  UpdateAddress(13);
  return LongToFloat(raw_input[13]);
}
Ejemplo n.º 8
0
int GameState::P2Hitstun() {
  UpdateAddress(18);
  return LongToFloat(raw_input[18]);
}
Ejemplo n.º 9
0
void CServerPage::PerformCommand(int command,DWORD p1,int p2)
{
	switch(command)
	{
	case 1:Close(0);
		break;

	case 2:SpawnObject(IDChicken,NULL);
		break;
	case 3:RemoveObject(IDChicken);
		break;

	case 16:SpawnObject(IDBauer,NULL);
		break;
	case 17:RemoveObject(IDBauer);
		break;

	case 4:SpawnObject(IDStall,NULL);
		break;
	case 5:RemoveObject(IDStall);
		break;

	case 6:SpawnObject(IDTree,NULL);
		break;
	case 7:RemoveObject(IDTree);
		break;

	case 8:SpawnObject(IDGartenkralle,NULL);
		break;
	case 9:RemoveObject(IDGartenkralle);
		break;

	case 10:SpawnObject(IDGolfer,NULL);
		break;
	case 11:RemoveObject(IDGolfer);
		break;

	case 12:SpawnObject(IDDrescher,NULL);
		break;
	case 13:RemoveObject(IDDrescher);
		break;

	case 14:SpawnObject(IDPlasmaCannon,NULL);
		break;
	case 15:RemoveObject(IDPlasmaCannon);
		break;


	case 20:game->aircontrol=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 21:game->damage=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 22:game->gravity=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 23:game->jumpspeed=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 24:game->plasmarate=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 25:game->plasmaregeneration=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 26:game->replenishpower=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 27:game->sittime=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 28:game->takepower=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 29:game->throwtime=LongToFloat(p2);
		mustsend=TRUE;
		break;
	case 30:game->respawntime=LongToFloat(p2);
		mustsend=TRUE;
		break;

	case 50:Config.KI=p2;
		mustsend=TRUE;
		break;
	case 51:game->PlasmaBallPressure=p2;
		mustsend=TRUE;
		break;
	}
	InvalidateAll();
}