Seite 160 von 162 ErsteErste ... 60110150156157158159160161162 LetzteLetzte
Ergebnis 2.386 bis 2.400 von 2421

Thema: BASE: SDK & Python Diskussion (Coder's Lair)

  1. #2386
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    Hab jetzt mal nach upgrade_optimization gesucht und rucivfan hat 23 Dateien verändert. Ist mir ehrlich gesagt zu mühsam rauszusuchen und ich stelle nicht alles zur Verfügung, sorry. Ist also eine sehr sehr große Codeänderung gewesen.
    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  2. #2387
    Moderator Avatar von Kathy
    Registriert seit
    11.10.07
    Beiträge
    16.920
    Okay, danke.
    Im Moment habe ich ohnehin ein anderes Problem mit meinem Code. Irgendwo habe ich eine Schleife eingebaut, durch die die KI ihre Runde nicht beendet. Damit werde ich eine Weile beschäftigt sein.
    That's why I am here: Mein Mod
    Mehr Technologien, mehr Einheiten, mehr Zivilisationen, mehr Gebäude

    Die aktuelle Story zum Mod:
    Die Vereinigten Staaten von Amerika

    Alte Stories zu alten Versionen:
    Alte Storys

  3. #2388
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    rucivfan ist da mitlerweile Profi drin sowas rauszufinden per Debug DLL.
    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  4. #2389
    Moderator Avatar von Kathy
    Registriert seit
    11.10.07
    Beiträge
    16.920
    Ich leider noch nicht. Im Moment läuft bei mir ein Debugversuch, aber das ist immer so arg langsam, und ich habe noch einmal eine Idee, wo ich suchen soll.
    That's why I am here: Mein Mod
    Mehr Technologien, mehr Einheiten, mehr Zivilisationen, mehr Gebäude

    Die aktuelle Story zum Mod:
    Die Vereinigten Staaten von Amerika

    Alte Stories zu alten Versionen:
    Alte Storys

  5. #2390
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    Naja die Debug DLL sollte sich bei der Schleife eigentlich melden.
    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  6. #2391
    Moderator Avatar von Kathy
    Registriert seit
    11.10.07
    Beiträge
    16.920
    Ich glaube nur dann, wenn man das vorher richtig programmiert hat, also einen Assert gesetzt hat - oder einen Haltepunkt. Jedenfalls passiert bei mir in der Schleife nichts.
    That's why I am here: Mein Mod
    Mehr Technologien, mehr Einheiten, mehr Zivilisationen, mehr Gebäude

    Die aktuelle Story zum Mod:
    Die Vereinigten Staaten von Amerika

    Alte Stories zu alten Versionen:
    Alte Storys

  7. #2392
    ε•ω=1 Avatar von Ramkhamhaeng
    Registriert seit
    19.07.10
    Ort
    Aralkum
    Beiträge
    9.896

  8. #2393
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    blub

    PHP-Code:
    int CvCity::growthThreshold(int iExtrabool bIgnoreSlavery) const
    {
    // Cybah: BASE für 6.3 - Wachstumsmalus für Sklaverei (erhöhte Grenze) [ siehe auch CvDLLWidgetData.cpp
        
    if (!bIgnoreSlavery)
        {
            
    int iAngerPercent getHurryPercentAnger();
            
    int iUnhappiness = ((iAngerPercent getPopulation()) / GC.getPERCENT_ANGER_DIVISOR());
            if (
    iUnhappiness 0)
            {
                return ((
    GET_PLAYER(getOwnerINLINE()).getGrowthThreshold(getPopulation() + iExtra)) * (100 + (iUnhappiness 25)) / 100);
            }
        }
    // Cybah: BASE für 6.3 - Wachstumsmalus für Sklaverei (erhöhte Grenze) ]
        
    return (GET_PLAYER(getOwnerINLINE()).getGrowthThreshold(getPopulation() + iExtra));

    Geändert von Cybah (21. Mai 2017 um 00:51 Uhr)
    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  9. #2394
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    PHP-Code:
        if (kMission.getRemoveCorporationsCostFactor() > 0)
        {
            if (
    pCity != NULL)
            {
                
    CorporationTypes eCorporation = (CorporationTypes)iExtraData;
                
                if (
    eCorporation == NO_CORPORATION)
                {
                    for (
    int iCorp 0iCorp GC.getNumCorporationInfos(); ++iCorp)
                    {
                        if (
    pCity->isActiveCorporation((CorporationTypes)iCorp) && GC.getGameINLINE().getHeadquarters((CorporationTypes)iCorp) != pCity)
                        {
                            if (
    eCorporation == NO_CORPORATION || (GC.getGameINLINE().getHeadquarters(eCorporation) != NULL &&
                                
    GC.getGameINLINE().getHeadquarters(eCorporation)->getOwnerINLINE() == eTargetPlayer &&
                                
    GC.getGameINLINE().getHeadquarters((CorporationTypes)iCorp)->getOwnerINLINE() != eTargetPlayer))
                            {
                                
    eCorporation = (CorporationTypes)iCorp;
                            }
                        }
                    }
                }
                            
                if (
    eCorporation != NO_CORPORATION)
                {
                    if (
    pCity->isActiveCorporation(eCorporation)&& GC.getGameINLINE().getHeadquarters(eCorporation) != pCity)
                    {
                        
    int iTempMissionCost = ((kMission.getRemoveCorporationsCostFactor() * pCity->getPopulation()) / 100);
                        
                        
    iTempMissionCost *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getAnarchyPercent();
                        
    iTempMissionCost /= 100;

                        if (
    GC.getGameINLINE().getHeadquarters(eCorporation) != NULL && GC.getGameINLINE().getHeadquarters(eCorporation)->getOwnerINLINE() == eTargetPlayer)
                        {
                            
    iTempMissionCost *= 2;
                        }

                        
    iMissionCost += iTempMissionCost;
                    }
                }
            }
        } 
    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  10. #2395
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    PHP-Code:
        if (kMission.getRemoveReligionsCostFactor() > 0)
        {
            if (
    pCity != NULL)
            {
                
    ReligionTypes eReligion = (ReligionTypes)iExtraData;
                
                if (
    eReligion == NO_RELIGION)
                {
                    for (
    int iReligion 0iReligion GC.getNumReligionInfos(); ++iReligion)
                    {
                        if (
    pCity->isHasReligion((ReligionTypes)iReligion) && !pCity->isHolyCity((ReligionTypes)iReligion))
                        {
                            if(    
    eReligion == NULL ||
                                (
    kTargetPlayer.getStateReligion() == eReligion &&
                                
    kTargetPlayer.getStateReligion() != (ReligionTypes)iReligion))
                            {
                                
    eReligion = (ReligionTypes)iReligion;
                            }
                        }
                    }
                }

                if (
    eReligion != NO_RELIGION)
                {
                    if (
    pCity->isHasReligion(eReligion))
                    {
                        if( !
    pCity->isHolyCity(eReligion))
                        {
                            
    int iTempMissionCost = ((kMission.getRemoveReligionsCostFactor() * pCity->getPopulation()) / 100);
                        
                            if (
    pCity->getNonHolyReligionCount() == 1)
                            {
                                
    iTempMissionCost *= 2;
                            }

                            
    iTempMissionCost *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getAnarchyPercent();
                            
    iTempMissionCost /= 100;

                            if (
    kTargetPlayer.getStateReligion() == eReligion)
                            {
                                
    iTempMissionCost *= 2;
                            }

                            
    iMissionCost += iTempMissionCost;
                        }
                    }
                }
            }
        } 
    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  11. #2396
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    PHP-Code:
        if (kMission.getRemoveReligionsCostFactor() > 0)
        {
            if(
    pCity == NULL)
            {
                return 
    false;
            }
            
            if(
    iExtraData > -1)
            {
                if (!
    pCity->isHasReligion((ReligionTypes)iExtraData))
                {
                    return 
    false;
                }
            }
            else
            {
                
    bool bHasReligion false;

                for (
    int iReligion 0iReligion GC.getNumReligionInfos(); ++iReligion)
                {
                    if (
    pCity->isHasReligion((ReligionTypes)iReligion) && !pCity->isHolyCity((ReligionTypes)iReligion))
                    {
                        
    bHasReligion true;
                        break;
                    }
                }

                if(!
    bHasReligion)
                {
                    return 
    false;
                }
            }
        }

        if (
    kMission.getRemoveCorporationsCostFactor() > 0)
        {

            if(
    pCity == NULL )
            {
                return 
    false;
            }
            
            if(
    iExtraData > -1)
            {
                if (!
    pCity->isHasCorporation((CorporationTypes)iExtraData))
                {
                    return 
    false;
                }
            }
            else
            {
                
    bool bHasCorporation false;

                for (
    int iCorporation 0iCorporation GC.getNumCorporationInfos(); ++iCorporation)
                {
                    if (
    pCity->isHasCorporation((CorporationTypes)iCorporation) && !pCity->isHeadquarters((CorporationTypes)iCorporation))
                    {
                        
    bHasCorporation true;
                        break;
                    }
                }

                if(!
    bHasCorporation)
                {
                    return 
    false;
                }
            }
        } 
    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  12. #2397
    Civ4 BASE Coder Avatar von rucivfan
    Registriert seit
    10.07.11
    Ort
    Antarktika
    Beiträge
    19.015
    Code:
        if (kMission.getRemoveCorporationsCostFactor() > 0)
        {
            if (pCity != NULL)
            {
                CorporationTypes eCorporation = (CorporationTypes)iExtraData;
    
                if (eCorporation == NO_CORPORATION) // Aktion möglich ohne konkretes Unternehmen
                {
                    for (int iCorpIt = 0; iCorpIt < GC.getNumCorporationInfos(); ++iCorpIt)
                    {
                        if (pCity->isActiveCorporation((CorporationTypes)iCorpIt))
                        {
                            CvCity* pCorpHQIt = GC.getGameINLINE().getHeadquarters((CorporationTypes)iCorpIt);
                            
                            if(pCorpHQIt == pCity) // HQ nicht entfernbar
                            {
                                continue;
                            }
                            
                            if(eCorporation == NO_CORPORATION) // wenn kein Unternehmen, das erst Beste ist ausreichend
                            {
                                eCorporation = (CorporationTypes)iCorpIt;
                                continue;
                            }
                            
                            CvCity* pCorpHQ = GC.getGameINLINE().getHeadquarters(eCorporation);
                            
                            if(pCorpHQ != NULL && pCorpHQIt != NULL)
                            {
                                if(pCorpHQ->getOwnerINLINE() == eTargetPlayer && pCorpHQIt->getOwnerINLINE() != eTargetPlayer)
                                {
                                    eCorporation = (CorporationTypes)iCorpIt;
                                    continue;
                                }
                            }
                        }
                    }
                }
                            
                if (eCorporation != NO_CORPORATION)
                {
                    if (pCity->isActiveCorporation(eCorporation) && GC.getGameINLINE().getHeadquarters(eCorporation) != pCity)
                    {
                        int iTempMissionCost = ((kMission.getRemoveCorporationsCostFactor() * pCity->getPopulation()) / 100);
                        
                        iTempMissionCost *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getAnarchyPercent();
                        iTempMissionCost /= 100;
    
                        CvCity* pCorpHQ = GC.getGameINLINE().getHeadquarters(eCorporation);
                        if(pCorpHQ != NULL)
                        {
                            if (pCorpHQ->getOwnerINLINE() == eTargetPlayer) // Kosten für HQ Besitzer
                            {
                                iTempMissionCost *= 2;
                            }
                        }
    
                        iMissionCost += iTempMissionCost;
                    }
                }
            }
        }

  13. #2398
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    PHP-Code:
    void CvUnit::doTurn()
    {
        
    PROFILE("CvUnit::doTurn()")

        
    FAssertMsg(!isDead(), "isDead did not return false as expected");
        
    FAssertMsg(getGroup() != NULL"getGroup() is not expected to be equal with NULL");

        
    //rucivfan_unit_generate_profit rugp[
        
    updateGenerateProfitChanges();
        
    //]rucivfan_unit_generate_profit rugp

        // rucivfan_bug_fix[
        // Populistisch Erfahrung -> Autobeförderung
        // testPromotionReady();
        // siehe unten
        // ]rucivfan_bug_fix

        
    if(getOriginalOwner() != NO_PLAYER)
        {
            if (!
    GET_PLAYER(getOriginalOwner()).isAlive())
            {
                
    m_eOriginalOwner NO_PLAYER;
            }
        }

        if (
    isBlockading())
        {
            
    collectBlockadeGold();
        }

        if (
    isSpy() && isIntruding() && !isCargo())
        {
            
    TeamTypes eTeam plot()->getTeam();
            if (
    NO_TEAM != eTeam)
            {
                
    // rucivfan_espionage_bug_fix rebf[
                // old code[
                //if (GET_TEAM(getTeam()).isOpenBorders(eTeam))
                //{
                //    testSpyIntercepted(plot()->getOwnerINLINE(), GC.getDefineINT("ESPIONAGE_SPY_NO_INTRUDE_INTERCEPT_MOD"));
                //}
                //else
                //{
                //    testSpyIntercepted(plot()->getOwnerINLINE(), GC.getDefineINT("ESPIONAGE_SPY_INTERCEPT_MOD"));
                //}
                // ]old code

                // new code[
                
    if (GET_TEAM(getTeam()).isOpenBorders(eTeam))
                {
                    
    testSpyIntercepted(plot()->getOwnerINLINE(), GC.getESPIONAGE_SPY_NO_INTRUDE_INTERCEPT_MOD());
                }
                else
                {
                    
    testSpyIntercepted(plot()->getOwnerINLINE(), GC.getESPIONAGE_SPY_INTERCEPT_MOD());
                }
                
    // ]new code
                // rucivfan_espionage_bug_fix rebf
            
    }
        }

        if (
    baseCombatStr() > 0)
        {
            
    FeatureTypes eFeature plot()->getFeatureType();
            if (
    NO_FEATURE != eFeature)
            {
                if (
    != GC.getFeatureInfo(eFeature).getTurnDamage())
                {
                    
    changeDamage(GC.getFeatureInfo(eFeature).getTurnDamage(), NO_PLAYER);
                }
            }
        }
        
    // Cybah - BASE für 6.1 E: ZE: Karthago - +10% allgemeine Heilung außerhalb kultureller Grenzen, auch nach Bewegung START
        
    if (getDamage() > 0)
        {
            
    CvPlotpPlot plot();
            if ((
    GET_PLAYER(getOwnerINLINE()).getCivilizationType() == BASE.getCIVILIZATION_CARTHAGE()) && (GET_TEAM(getTeam()).isHasTech((TechTypes)(BASE.getTECH_CARTHAGE()))) && (pPlot->getOwnerINLINE() != getOwnerINLINE()))
            {
                
    changeDamage(-10);
            }
    // Cybah - BASE für 6.2 D: Schützend - +20% allgemeine Heilung, auch nach Bewegung START // deaktiviert, jetzt Heilung nach siegreichen Kämpfen
            
    if (GET_PLAYER(getOwnerINLINE()).hasTrait((TraitTypes)BASE.getTRAIT_PROTECTIVE()) && getDamage() > 0)
            {
                
    changeDamage(-10);
            }
    // Cybah - BASE für 6.2 D: Schützend - +20% allgemeine Heilung, auch nach Bewegung END
        
    }
    // Cybah - BASE für 6.1 E: ZE: Karthago - +10% allgemeine Heilung außerhalb kultureller Grenzen, auch nach Bewegung END

        
    if (hasMoved())
        {
            
    // rucivfan_bug_fix rbf[
            
    if(isHurt())
            {
            
    // ]rucivfan_bug_fix rbf
    // Cybah: BASE für 5.6 - Tiere heilen sich auch in Bewegung START
    // Original Code
    //             if (isAlwaysHeal())
    //
                
    if (isAlwaysHeal() || isAnimal())
    // Cybah: BASE für 5.6 - Tiere heilen sich auch in Bewegung END
                
    {
                    
    doHeal();
                }
            
    // rucivfan_bug_fix rbf[
            
    }
            
    // ]rucivfan_bug_fix rbf
        
    }
        else
        {
            if (
    isHurt())
            {
                
    doHeal();
            }

            if (!
    isCargo())
            {
                
    // Cybah - BASE: ZE: Osmanen ehemals Tibet START
                // rucivfan_code_optimization rco[
                
    if ((GET_PLAYER(getOwnerINLINE()).getCivilizationType() == BASE.getCIVILIZATION_OTTOMAN()) && (GET_TEAM(getTeam()).isHasTech((TechTypes)(BASE.getTECH_OTTOMAN()))))
                
    // ]rucivfan_code_optimization rco
                
    {
                    
    setFortifyTurns(GC.getMAX_FORTIFY_TURNS());
    //Cybah: BASE für 6.1 F - Überlebenskünstler III START
                    
    if (isHasPromotion((PromotionTypes)BASE.getPROMOTION_SURVIVOR3()))
                    {
                        
    setFortifyTurns(GC.getMAX_FORTIFY_TURNS() + GC.getMAX_FORTIFY_TURNS());
                    }
    //Cybah: BASE für 6.1 F - Überlebenskünstler III END
                
    }
                else
                {
                    
    changeFortifyTurns(1);
                }
    // Cybah - BASE: ZE: Osmanen ehemals Tibet END
                
                // rucivfan_espionage_system_extended rese[
                
    if(canObservation())
                {
                    
    changeObservationTurns(1);
                }
                
    // rucivfan_espionage_system_extended rese
            
    }
        }

        
    changeImmobileTimer(-1);
            
        
    setMadeInterception(false);

        
    setReconPlot(NULL);
        
        
    // rucivfan_movement_system_extended rmse[
        // old code[
        //setMadeAttack(false);
        //setMoves(0);
        // ]old code

        // new code[
        
    setTempFlatMoves(0);
        
    setAttackCount(0);
        
    setMoves(0);
        
    setMoveDenominator(1);
        
    // ]new code
        // ]rucivfan_movement_system_extended rmse

        // rucivfan_bug_fix[
        // Populistisch Erfahrung -> Autobeförderung
        
    testPromotionReady();
        
    // ]rucivfan_bug_fix
        
    /************************************************************************************************/
    /* Afforess                      Start         08/20/10                                               */
    /*                                                                                              */
    /* Advanced Automations                                                                         */
    /************************************************************************************************/

        
    if (canDiscover(NULL))
        {
            if (
    getDesiredDiscoveryTech() == getDiscoveryTech())
            {
                
    getGroup()->setActivityType(ACTIVITY_AWAKE);
                
    setDesiredDiscoveryTech(NO_TECH);
                
    discover();
            }
        }
        
        if (
    isAutoUpgrading())
        {
            
    // rucivfan_code_optimization rco[
            
    if (plot()->isCity() || !GET_PLAYER(getOwnerINLINE()).AI_isAnyPlotDanger(plot(), 3))
            
    // ]rucivfan_code_optimization rco
            
    {
                
    AI_upgrade();
                
    //Could Delete Unit!!!
            
    }
        }
    /************************************************************************************************/
    /* Afforess                         END                                                            */
    /************************************************************************************************/

        // < M.A.D. Nukes Start >
        
    if (isMADEnabled())
        {
            if (
    isMADTargetSet())
            {
                if (
    getMADTargetPlot() != NULL)
                {
                    
    //If the owner of the target plot changed, set our target plot to NULL
                    
    if (getMADTargetPlot()->getOwner() != getMADTargetPlotOwner())
                    {
                        
    setMADTargetPlot(NULL);
                    }

                    
    //If we're no longer able to nuke the target plot,
                    //set our target plot to NULL
                    
    if (!canMADNukeAt(getMADTargetPlot()))
                    {
                        
    setMADTargetPlot(NULL);
                    }
                }
                
                
    // rucivfan_ai_auto_play raap[
                //if (isHuman())
                
    if (isHumanActive())
                
    // ]rucivfan_ai_auto_play raap
                
    {
                    
    //If finishMoves is called here for the AI, our AI handler AI_ICBMMove
                    //will not be reached.
                    
    finishMoves();
                }
            }
        }
        
    // < M.A.D. Nukes End   >

    // Cybah - BASE für 5.6: ZE: Persien START (siehe auch CvPlayer.cpp)
        
    if ((getDomainType() == DOMAIN_LAND) && (getCombatStr() > 0) && (GET_PLAYER(getOwnerINLINE()).isGoldenAge()) && (GET_PLAYER(getOwnerINLINE()).getCivilizationType() == BASE.getCIVILIZATION_PERSIA()) && (GET_TEAM(getTeam()).isHasTech((TechTypes)(BASE.getTECH_PERSIA()))))
        {
            
    changeTempFlatMoves(1);
        }
    // Cybah - BASE für 5.6: ZE: Persien END
    // Cybah - BASE für 6.1 E: ZE: Indien START - deaktiviert
        // if ((getUnitClassType() == GC.getUNITCLASS_WORKER()) && (GET_PLAYER(getOwnerINLINE()).isGoldenAge()) && (GET_PLAYER(getOwnerINLINE()).getCivilizationType() == GC.getCIVILIZATION_INDIA()) && (GET_TEAM(getTeam()).isHasTech((TechTypes)(GC.getTECH_INDIA()))))
        // {
            // changeTempFlatMoves(1);
        // }
    // Cybah - BASE für 6.1 E: ZE: Indien END
    // Cybah - BASE für 6.1 E: ZE: Nordreich START
        
    if ((getUnitCombatType() == (UnitCombatTypes)BASE.getUNITCOMBAT_NAVAL()) && (GET_PLAYER(getOwnerINLINE()).getCivilizationType() == BASE.getCIVILIZATION_VIKING()) && (GET_TEAM(getTeam()).isHasTech((TechTypes)(BASE.getTECH_VIKING()))))
        {
            
    changeTempFlatMoves(1);
        }
    // Cybah - BASE für 6.1 E: ZE: Nordreich END
    // Cybah - BASE für 5.6: Charismatisch START - DEAKTIVIERT
    //    if ((getUnitCombatType() == (UnitCombatTypes)GC.getUNITCOMBAT_WORKER()) && (GET_PLAYER(getOwnerINLINE()).hasTrait((TraitTypes)GC.getTRAIT_CHARISMATIC())))
    //    {
    //        changeTempFlatMoves(1);
    //     }
    // Cybah - BASE für 5.6: Charismatisch END

    // Cybah: BASE für 6.3 C - Schützend Trait START
        
    if (GET_PLAYER(getOwnerINLINE()).hasTrait((TraitTypes)BASE.getTRAIT_PROTECTIVE()))
        {
            if(!
    isReadyForUpgrade())
            {
                return;
            }
        
            
    int iRandomRange 10000;
            
            
    // Game Speed Skalierung
            
    iRandomRange *= (GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getTrainPercent() + GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getResearchPercent());
            
    iRandomRange /= 200;
            
            
    // Auswürfeln
            
    int iValue = (GC.getGameINLINE().getSorenRandNum(iRandomRange"Auto Upgrade Chance"));
            
            
    // 10% Wahrscheinlichkeit (times 100)
            
    int iBreakpoint 1000;
            
            
    // 2% Wahrscheinlichkeit pro Ära (times 100) (DEAKTIVIERT)
            // int iBreakpoint = (200 * (GET_PLAYER(getOwnerINLINE()).getCurrentEra() + 1));
            
            
    if (iValue iBreakpoint)
            {
                
    CvPlotpPlot plot();
                if (
    pPlot->isCity(truegetTeam()))
                {
                    
    CvCitypCity pPlot->getPlotCity();
                    if ((
    getOwnerINLINE() == pCity->getOwnerINLINE()) && (!pCity->isDisorder()))
                    {
                        
    UnitTypes eBestUnit;
                        
    std::vector<UnitTypesvctiUnitUpgrades;
                        if(
    getAvailableUpgrades(vctiUnitUpgradesgetUnitType()))
                        {
                            
    // Zufällige Wahl des Upgrade Typs
                            
    int iUnitUpgradeChosen GC.getGameINLINE().getSorenRandNum(vctiUnitUpgrades.size(), "Auto Upgrade UnitType");
                            
    eBestUnit = (UnitTypes)vctiUnitUpgrades[iUnitUpgradeChosen];
                            if (
    eBestUnit != NO_UNIT)
                            {
                                
    // upgrade(eBestUnit);
                                //--------------------------------------------------------------------------------------------------------------------
                                
    CvUnitpUpgradeUnit;

                                
    // Stadt muss Upgradetyp ausbilden können
                                
    if (!pCity->canTrain(eBestUnit))
                                {
                                    return;
                                }
                                
                                
    // // Stadt muss Hauptstadt sein oder verbunden zur Hauptstadt sein
                                // if ((!pCity->isConnectedToCapital()) && (!pCity->isCapital()))
                                // {
                                    // return;
                                // }

                                
    FAssertMsg(eBestUnit NO_UNIT"eBestUnit is not assigned a valid value");

                                
    //rucivfan_switch_promotion_button rspb[
                                
    for(int iI 0iI GC.getNumSwitchPromotionInfos(); ++iI)
                                {
                                    if(
    GC.getSwitchPromotionInfo((SwitchPromotionTypes)iI).isUnitUpgradeTurnSwitch() && isSwitchPromotionTurnValid((SwitchPromotionTypes)iI))
                                    {
                                        
    setHasSwitchPromotion((SwitchPromotionTypes)iIfalse);
                                    }
                                }
                                
    //]rucivfan_switch_promotion_button rspb

                                
    pUpgradeUnit GET_PLAYER(getOwnerINLINE()).initUnit(eBestUnitgetX_INLINE(), getY_INLINE(), AI_getUnitAIType());

                                
    FAssertMsg(pUpgradeUnit != NULL"UpgradeUnit is not assigned a valid value");
                                
                                
    // Nachricht vorbereiten
                                
    CvWString szBuffer;
                                if (
    m_szName.empty())
                                {
                                    
    szBuffer gDLL->getText("TXT_KEY_PROTECTIVE_UNIT_UPGRADED_NONAME"pUpgradeUnit->getNameKey(), getNameKey());
                                }
                                else
                                {
                                    
    szBuffer gDLL->getText("TXT_KEY_PROTECTIVE_UNIT_UPGRADED_NAME"pUpgradeUnit->getNameKey(), m_pUnitInfo->getDescription(), getNameKey());
                                }

                                
    pUpgradeUnit->joinGroup(getGroup());

                                
    pUpgradeUnit->convert(this);

                                
    pUpgradeUnit->finishMoves();

                                
    // Cybah - BASE für 6.1: Vollständige Heilung bei Modernisierung (erhöhte Kosten bei Schaden siehe oben) START
                                
    pUpgradeUnit->setDamage(0);
                                
    // Cybah - BASE für 6.1: Vollständige Heilung bei Modernisierung (erhöhte Kosten bei Schaden siehe oben) END

                                //rucivfan_code_optimization rco[
                                // Cybah: BASE Überläufer wird entfernt Start
                                
    if (pUpgradeUnit->isHasPromotion((PromotionTypes)BASE.getPROMOTION_DEFECTOR_LAND()))
                                {
                                    
    pUpgradeUnit->setHasPromotion((PromotionTypes)BASE.getPROMOTION_DEFECTOR_LAND(), false);
                                }
                                if (
    pUpgradeUnit->isHasPromotion((PromotionTypes)BASE.getPROMOTION_DEFECTOR_SEA()))
                                {
                                    
    pUpgradeUnit->setHasPromotion((PromotionTypes)BASE.getPROMOTION_DEFECTOR_SEA(), false);
                                }
                                
    // Cybah: BASE Überläufer wird entfernt End

                                // Cybah: BASE Rage / Raserei wird entfernt Start
                                
    if (pUpgradeUnit->isHasPromotion((PromotionTypes)BASE.getPROMOTION_RAGE()))
                                {
                                    
    pUpgradeUnit->setHasPromotion((PromotionTypes)BASE.getPROMOTION_RAGE(), false);
                                }
                                
    // Cybah: BASE Rage / Raserei wird entfernt End

                                // Cybah: BASE Generalsbeförderung reicht aus Start
                                //    if (pUpgradeUnit->getLeaderUnitType() == NO_UNIT)
                                
    if (!isHasPromotion((PromotionTypes)BASE.getPROMOTION_LEADER()))
                                
    // Cybah: BASE Generalsbeförderung reicht aus End
                                // ]rucivfan_code_optimization rco
                                
    {
                                
    // Cybah: BASE für 6.1 D - Organisiert Trait START
                                    //if (pUpgradeUnit->getExperience() > GC.getUNIT_UPGRADE_MAX_EXPERIENCE_AFTER_UPGRADE())
                                    
    if (!GET_PLAYER(getOwnerINLINE()).hasTrait((TraitTypes)BASE.getTRAIT_ORGANIZED()))
                                
    // Cybah: BASE für 6.1 D - Organisiert Trait END
                                    
    {
                                        
    // Cybah: BASE für 6.2 - Halbierte Erfahrung anstelle gekappter Erfahrung START
                                        // pUpgradeUnit->setExperience(GC.getUNIT_UPGRADE_MAX_EXPERIENCE_AFTER_UPGRADE());
                                        // Aufrunden, deshalb minus
                                        // int iXPLoss = (getExperience() / 2);
                                        
                                        // BASE für 6.3 (obiger Code wurde durch unteren Code ersetzt)
                                        
    int iXPLoss = (std::max(0getExperience() - 10) / 2);
                                        
                                        
    pUpgradeUnit->setExperience(getExperience() - iXPLoss);
                                        
    // Cybah: BASE für 6.2 - Halbierte Erfahrung anstelle gekappter Erfahrung END
                                    
    }
                                }

                                
    /************************************************************************************************/
                                /* BETTER_BTS_AI_MOD                      02/24/10                                jdog5000      */
                                /*                                                                                              */
                                /* AI Logging                                                                                   */
                                /************************************************************************************************/
                                
    if(GC.getLogging())
                                {
                                    if( 
    gUnitLogLevel )
                                    {
                                        
    CvWString szString;
                                        
    getUnitAIString(szStringAI_getUnitAIType());
                                        
    logBBAI("    %S spends %d to upgrade %S to %S, unit AI %S"GET_PLAYER(getOwnerINLINE()).getCivilizationDescription(0), upgradePrice(eBestUnit), getName(0).GetCString(), pUpgradeUnit->getName(0).GetCString(), szString.GetCString());
                                    }
                                }
                                
    /************************************************************************************************/
                                /* BETTER_BTS_AI_MOD                       END                                                  */
                                /************************************************************************************************/
                                //--------------------------------------------------------------------------------------------------------------------
                                
    gDLL->getInterfaceIFace()->addMessage(pUpgradeUnit->getOwnerINLINE(), falseGC.getEVENT_MESSAGE_TIME(), szBuffer"AS2D_UNITGIFTED"MESSAGE_TYPE_INFOpUpgradeUnit->getButton(), (ColorTypes)/*rucivfan_code_optimization rco[*/GC.getCOLOR_WHITE() /*] rucivfan_code_optimization rco*/,  pUpgradeUnit->getX_INLINE(),  pUpgradeUnit->getY_INLINE(), truetrue);

                                
    doDelayedDeath();
                                return;
                            }
                        }
                    }
                }
            }
        }
    // Cybah: BASE für 6.3 C - Schützend Trait END

    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  14. #2399
    Waddehaddedudeda Avatar von Cybah
    Registriert seit
    01.09.06
    Beiträge
    30.450
    Sag mal, ist getEspionageModifier hardcoded?

    Und:

    PHP-Code:
    iTempModifier std::max(0, ::getEspionageModifier(kPlayer.getTeam(), GET_PLAYER(eTargetPlayer).getTeam()))  - 100
    Was genau macht das :: an dieser Stelle? Hab ich in dieser Form noch nie gesehen. Frag mich, warum es kein ::getEspionageModifier im gesamten SDK gibt außer an dieser Stelle. Kann ich getEspionageModifier auch an anderer Stelle nutzen? (Z.B. für eine Veränderung der Techdiffusion, wenn die eigenen Spionagepunkte höher sind als die vom anderen Spieler).

    Wie findet die Berechnung genau statt, welchen Wert gibt mir die Funktion (ohne -100)? Wenn ich doppelt so viele Spiopunkte in Spieler X gesteckt habe als er in mich, gibt getEspionageModifier dann "200" raus oder was genau?
    Geändert von Cybah (11. Februar 2019 um 08:35 Uhr)
    Pucc's Lets Plays BASE 6.0: #1 #2 #3 #4 #5

    Download von BASE 6.4 [D]: HIER (klick mich!) (Stand: 08.07.2022)

  15. #2400
    ε•ω=1 Avatar von Ramkhamhaeng
    Registriert seit
    19.07.10
    Ort
    Aralkum
    Beiträge
    9.896
    Die Funktion ist in CvGameCoreUtils definiert und der Scope Resolution-Operator ohne Prefix schränkt die zulässigen Funktionnamen auf den unbenannten Namespace ein. Das ist genau dann interessant, wenn es lokal eine Funktion gleichen Namens geben könnte.
    So ist in folgendem Beispiel bei f() nicht gesichert, dass der Compiler es zum globalen f auflösen wird. Hat die Klasse eine Funktion gleichen Namens, wird diese ja bevorzugt.
    Code:
    #include <iostream>
    
    int f(){
      return 1;
    }
    
    class A {
      public:
        void test(){
          std::cout << f() << std::endl;
          std::cout << ::f() << std::endl;
        }
    
        int f(){
          return 0;
        }
    
    };
    
    
    int main(){
      A a = A();
      a.test();
      return 0;
    }


    Zu der von Dreifels per PM gestellten Anfrage: Da will ich nichts versprechen. Da die C2C-Leute ihre Features nie mit Code-Kommentaren auffindbar machen und ich das dumme SVN nicht so gut kenne, um diese MAF-relevanten Änderungen möglicherweise dort aufzuspüren, weiß man nie wie viele Codefragmente man da am Ende übernehmen muss.
    Interessant ist es aber, auch für PAE.
    Geändert von Ramkhamhaeng (11. Februar 2019 um 12:42 Uhr)

Seite 160 von 162 ErsteErste ... 60110150156157158159160161162 LetzteLetzte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •