예제 #1
0
void nobMilitary::Draw(int x, int y)
{
    // Gebäude an sich zeichnen
    DrawBaseBuilding(x, y);

    // (max 4) Besatzungs-Fähnchen zeichnen
    unsigned flags = min<unsigned>(troops.size() + this->leave_house.size(), 4);

    for(unsigned i = 0; i < flags; ++i)
        LOADER.GetMapPlayerImage(3162 + GAMECLIENT.GetGlobalAnimation(8, 2, 1, pos.x * pos.y * i))->Draw(x + TROOPS_FLAGS[nation][size][0], y + TROOPS_FLAGS[nation][size][1] + (i) * 3, 0, 0, 0, 0, 0, 0, COLOR_WHITE, gwg->GetPlayer(player).color);

    // Die Fahne, die anzeigt wie weit das Gebäude von der Grenze entfernt ist, zeichnen
    unsigned frontier_distance_tmp = frontier_distance;
    glArchivItem_Bitmap_Player* bitmap = NULL;
    unsigned int animationFrame = GAMECLIENT.GetGlobalAnimation(4, 1, 1, pos.x * pos.y * GetObjId());
    if(frontier_distance_tmp == 2)
    {
        // todo Hafenflagge
        bitmap = LOADER.GetPlayerImage("map_new", 3150 + animationFrame);
    }
    else
    {
        if(frontier_distance_tmp == 3) frontier_distance_tmp = 2;
        bitmap = LOADER.GetMapPlayerImage(3150 + frontier_distance_tmp * 4 + animationFrame);
    }
    if(bitmap)
        bitmap->Draw(x + BORDER_FLAGS[nation][size][0], y + BORDER_FLAGS[nation][size][1], 0, 0, 0, 0, 0, 0);

    // Wenn Goldzufuhr gestoppt ist, Schild außen am Gebäude zeichnen zeichnen
    if(coinsDisabledVirtual)
        LOADER.GetMapImageN(46)->Draw(x + BUILDING_SIGN_CONSTS[nation][type_].x, y + BUILDING_SIGN_CONSTS[nation][type_].y, 0, 0, 0, 0, 0, 0);
}
예제 #2
0
void nobHQ::Draw(int x, int y)
{
    if(isTent_)
        LOADER.building_cache[nation][BLD_HEADQUARTERS][1].draw(x, y);
    else
    {
        DrawBaseBuilding(x, y);

        // Draw at most 4 flags
        const unsigned numSoldiers = std::accumulate(reserve_soldiers_available.begin(), reserve_soldiers_available.end(), GetSoldiersCount());
        for(unsigned i = min<unsigned>(numSoldiers, 4); i; --i)
        {
            glArchivItem_Bitmap_Player* bitmap = LOADER.GetMapPlayerImage(3162 + GAMECLIENT.GetGlobalAnimation(8, 80, 40, GetX() * GetY() * i));
            if(bitmap)
                bitmap->Draw(x + TROOPS_FLAGS_HQ[nation][0], y + TROOPS_FLAGS_HQ[nation][1] + (i - 1) * 3, 0, 0, 0, 0, 0, 0, COLOR_WHITE, COLORS[GAMECLIENT.GetPlayer(player).color]);
        }
    }
}
예제 #3
0
void nobHQ::Draw(DrawPoint drawPt)
{
    if(isTent_)
        LOADER.building_cache[nation][BLD_HEADQUARTERS][1].draw(drawPt);
    else
    {
        DrawBaseBuilding(drawPt);

        // Draw at most 4 flags
        const unsigned numSoldiers = std::accumulate(reserve_soldiers_available.begin(), reserve_soldiers_available.end(), GetSoldiersCount());
        DrawPoint flagsPos = drawPt + TROOPS_FLAG_HQ_OFFSET[nation];
        for(unsigned i = min<unsigned>(numSoldiers, 4); i; --i)
        {
            glArchivItem_Bitmap_Player* bitmap = LOADER.GetMapPlayerImage(3162 + GAMECLIENT.GetGlobalAnimation(8, 80, 40, GetX() * GetY() * i));
            if(bitmap)
                bitmap->Draw(flagsPos + DrawPoint(0, (i - 1) * 3), 0, 0, 0, 0, 0, 0, COLOR_WHITE, gwg->GetPlayer(player).color);
        }
    }
}
예제 #4
0
/**
 *
 *
 *  @author OLiver
 */
void nobUsual::Draw(int x, int y)
{
    // Gebäude an sich zeichnen
    DrawBaseBuilding(x, y);

    // Wenn Produktion gestoppt ist, Schild außen am Gebäude zeichnen zeichnen
    if(disable_production_virtual)
        LOADER.GetMapImageN(46)->Draw(x + BUILDING_SIGN_CONSTS[nation][type_].x, y + BUILDING_SIGN_CONSTS[nation][type_].y, 0, 0, 0, 0, 0, 0);

    // Rauch zeichnen

    // Raucht dieses Gebäude und ist es in Betrieb? (nur arbeitende Gebäude rauchen schließlich)
    if(BUILDING_SMOKE_CONSTS[nation][type_ - 10].type && is_working)
    {
        // Dann Qualm zeichnen (damit Qualm nicht synchron ist, x- und y- Koordinate als Unterscheidung
        LOADER.GetMapImageN(692 + BUILDING_SMOKE_CONSTS[nation][type_ - 10].type * 8 + GAMECLIENT.GetGlobalAnimation(8, 5, 2, (GetX() + GetY()) * 100))
        ->Draw(x + BUILDING_SMOKE_CONSTS[nation][type_ - 10].x, y + BUILDING_SMOKE_CONSTS[nation][type_ - 10].y, 0, 0, 0, 0, 0, 0, 0x99EEEEEE);
    }

    // TODO: zusätzliche Dinge wie Mühlenräder, Schweinchen etc bei bestimmten Gebäuden zeichnen

    // Bei Mühle, wenn sie nicht arbeitet, immer Mühlenräder (nichtdrehend) zeichnen
    if(type_ == BLD_MILL && !is_working)
    {
        // Flügel der Mühle
        LOADER.GetNationImage(nation, 250 + 5 * 49)->Draw(x, y);
        // Schatten der Flügel
        LOADER.GetNationImage(nation, 250 + 5 * 49 + 1)->Draw(x, y, 0, 0, 0, 0, 0, 0, COLOR_SHADOW);
    }
    // Esel in den Kammer bei Eselzucht zeichnen
    else if(type_ == BLD_DONKEYBREEDER)
    {
        // Für alle Völker jeweils
        // X-Position der Esel
        const int DONKEY_X[NAT_COUNT][3] = {{13, 26, 39}, {3, 16, 30}, {2, 15, 29}, {7, 18, 30}, {3, 16, 30}};
        // Y-Position
        const int DONKEY_Y[NAT_COUNT] = { -9, -17, -21, -17, -22};
        // Animations-IDS des Esels
        const unsigned char DONKEY_ANIMATION[] =
        { 0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 6, 5, 4, 4, 5, 6, 5, 7, 6, 5, 4, 3, 2, 1, 0 };

        // Die drei Esel zeichnen mithilfe von Globalanimation
        // Anzahl hängt von Produktivität der Eselzucht ab:
        // 0-29 - kein Esel
        // 30-60 - 1 Esel
        // 60-90 - 2 Esel
        // 90-100 - 3 Esel
        if(productivity >= 30) LOADER.GetMapImageN(2180 + DONKEY_ANIMATION[GAMECLIENT.GetGlobalAnimation(sizeof(DONKEY_ANIMATION), 5, 2, GetX() * (player + 2))])->Draw(x + DONKEY_X[nation][0], y + DONKEY_Y[nation]);
        if(productivity >= 60) LOADER.GetMapImageN(2180 + DONKEY_ANIMATION[GAMECLIENT.GetGlobalAnimation(sizeof(DONKEY_ANIMATION), 5, 2, GetY())])->Draw(x + DONKEY_X[nation][1], y + DONKEY_Y[nation]);
        if(productivity >= 90) LOADER.GetMapImageN(2180 + DONKEY_ANIMATION[GAMECLIENT.GetGlobalAnimation(sizeof(DONKEY_ANIMATION), 5, 2, GetX() + GetY() * (nation + 1))])->Draw(x + DONKEY_X[nation][2], y + DONKEY_Y[nation]);
    }
    // Bei Katapulthaus Katapult oben auf dem Dach zeichnen, falls er nicht "arbeitet"
    else if(type_ == BLD_CATAPULT && !is_working)
    {
        LOADER.GetPlayerImage("rom_bobs", 1776)->Draw(x - 7, y - 19, 0, 0, 0, 0, 0, 0, COLOR_WHITE, COLOR_WHITE);
    }

    // Bei Schweinefarm Schweinchen auf dem Hof zeichnen
    else if(type_ == BLD_PIGFARM && this->HasWorker())
    {
        // Position der 5 Schweinchen für alle 4 Völker (1. ist das große Schwein)
        const int PIG_POSITIONS[NAT_COUNT][5][2] =
        {
            //  gr. S. 1.klS 2. klS usw
            { {3, -8}, {17, 3}, { -12, 4}, { -2, 10}, { -22, 11} }, // Afrikaner
            { { -16, 0}, { -37, 0}, { -32, 8}, { -16, 10}, { -22, 18} }, // Japaner
            { { -15, 0}, { -4, 9}, { -22, 10}, {2, 19}, { -15, 20} }, // Römer
            { {5, -5}, {25, -12}, { -7, 7}, { -23, 11}, { -10, 14} }, // Wikinger
            { { -16, 5}, { -37, 5}, { -32, -1}, { -16, 15}, { -27, 18} } // Babylonier
        };


        /// Großes Schwein zeichnen
        LOADER.GetMapImageN(2160)->Draw(x + PIG_POSITIONS[nation][0][0], y + PIG_POSITIONS[nation][0][1], 0, 0, 0, 0, 0, 0, COLOR_SHADOW);
        LOADER.GetMapImageN(2100 + GAMECLIENT.GetGlobalAnimation(12, 3, 1, GetX() + GetY() + GetObjId()))->Draw(x + PIG_POSITIONS[nation][0][0], y + PIG_POSITIONS[nation][0][1]);

        // Die 4 kleinen Schweinchen, je nach Produktivität
        for(unsigned i = 1; i < min<unsigned>(unsigned(productivity) / 20 + 1, 5); ++i)
        {
            //A random (really, dice-rolled by hand:) ) order of the four possible pig animations, with eating three times as much as the others ones
            //To get random-looking, non synchronous, sweet little pigs
            const unsigned char smallpig_animations[63] =
            {
                0, 0, 3, 2, 0, 0, 1, 3, 0, 3, 1, 3, 2, 0, 0, 1,
                0, 0, 1, 3, 2, 0, 1, 1, 0, 0, 2, 1, 0, 1, 0, 2,
                2, 0, 0, 2, 2, 0, 1, 0, 3, 1, 2, 0, 1, 2, 2, 0,
                0, 0, 3, 0, 2, 0, 3, 0, 3, 0, 1, 1, 0, 3, 0
            };
            const unsigned short animpos = GAMECLIENT.GetGlobalAnimation(63 * 12, 63 * 4 - i * 5, 1, 183 * i + GetX() * GetObjId() + GetY() * i);
            LOADER.GetMapImageN(2160)->Draw(x + PIG_POSITIONS[nation][i][0], y + PIG_POSITIONS[nation][i][1], 0, 0, 0, 0, 0, 0, COLOR_SHADOW);
            LOADER.GetMapImageN(2112 + smallpig_animations[animpos / 12] * 12 + animpos % 12)->Draw(x + PIG_POSITIONS[nation][i][0], y + PIG_POSITIONS[nation][i][1]);
        }

        // Ggf. Sounds abspielen (oink oink), da soll sich der Schweinezüchter drum kümmen
        dynamic_cast<nofPigbreeder*>(worker)->MakePigSounds();
    }
    // Bei nubischen Bergwerken das Feuer vor dem Bergwerk zeichnen
    else if(IsMine() && worker && nation == NAT_AFRICANS)
        LOADER.GetMapPlayerImage(740 + GAMECLIENT.GetGlobalAnimation(8, 5, 2, GetObjId() + GetX() + GetY()))->
        Draw(x + NUBIAN_MINE_FIRE[type_ - BLD_GRANITEMINE][0], y + NUBIAN_MINE_FIRE[type_ - BLD_GRANITEMINE][1]);
}
예제 #5
0
void nobHarborBuilding::Draw(int x,int y)
{
	// Gebäude an sich zeichnen
	DrawBaseBuilding(x,y);

	// Hafenfeuer zeichnen // TODO auch für nicht-römer machen
	if (nation == NAT_ROMANS || nation == NAT_JAPANESES)
	{
		LOADER.GetNationImageN(nation, 500 + 5 * GameClient::inst().GetGlobalAnimation(8,2,1,obj_id+GetX()+GetY()))->Draw(x+FIRE_POS[nation].x,y+FIRE_POS[nation].y,0,0,0,0,0,0);
	}
	else if (nation == NAT_AFRICANS || nation == NAT_VIKINGS)
	{
		LOADER.GetMapImageN(740+GameClient::inst().GetGlobalAnimation(8,5,2,obj_id+GetX()+GetY()))->Draw(x+FIRE_POS[nation].x,y+FIRE_POS[nation].y);
	}

	if (nation == NAT_ROMANS)
	{
		// Zusätzliches Feuer
		LOADER.GetMapImageN(740+GameClient::inst().GetGlobalAnimation(8,5,2,obj_id+GetX()+GetY()))->Draw(x+EXTRAFIRE_POS[nation].x,y+EXTRAFIRE_POS[nation].y);
	}

	// Läuft gerade eine Expedition?
	if(expedition.active)
	{
		// Waren für die Expedition zeichnen

		// Bretter
		for(unsigned char i = 0;i<expedition.boards;++i)
			LOADER.GetMapImageN(2200+GD_BOARDS)->Draw(x+BOARDS_POS[nation].x-5,y+BOARDS_POS[nation].y-i*4,0,0,0,0,0,0);
		// Steine
		for(unsigned char i = 0;i<expedition.stones;++i)
			LOADER.GetMapImageN(2200+GD_STONES)->Draw(x+STONES_POS[nation].x+8,y+STONES_POS[nation].y-i*4,0,0,0,0,0,0);

		// Und den Bauarbeiter, falls er schon da ist
		if(expedition.builder)
		{
			unsigned id = GameClient::inst().GetGlobalAnimation(1000,7,1,GetX()+GetY());

			const int WALKING_DISTANCE = 30;

			// Wegstrecke, die er von einem Punkt vom anderen schon gelaufen ist
			int walking_distance = (id%500)*WALKING_DISTANCE/500;
			// Id vom laufen
			unsigned walking_id = (id/32)%8;

			int right_point = x - 20 + BUILDER_POS[nation].x;

			if(id < 500)
			{
				LOADER.GetBobN("jobs")->Draw(23,0,false,walking_id,right_point-walking_distance,
					y+BUILDER_POS[nation].y,COLORS[gwg->GetPlayer(player)->color]);
				//DrawShadow(right_point-walking_distance,y,walking_id,0);
			}
			else
			{
				LOADER.GetBobN("jobs")->Draw(23,3,false,walking_id,
					right_point-WALKING_DISTANCE+walking_distance,y+BUILDER_POS[nation].y,
					COLORS[gwg->GetPlayer(player)->color]);
				//DrawShadow(right_point-WALKING_DISTANCE+walking_distance,y,walking_id,0);
			}		
		}
			
	}
}
예제 #6
0
void nobStorehouse::Draw(int x,int y)
{
    // Gebäude an sich zeichnen
    DrawBaseBuilding(x,y);
}