////////////////////////////////////////////////////////////////////////// // // // Conquer Gives Advance code v1.0 // // by Pedrunn // // But thanks to J Bytheway solver of repetive lines creation prob // ////////////////////////////////////////////////////////////////////////// // // // With this code when you conquer a city there is 50% chance of // // getting an advance from the old owner of the city // // // ////////////////////////////////////////////////////////////////////////// int_f NewHasAdvance(int_t thePlayer , int_t theAdvance) { int_t tmpAdvance; int_t tmpPlayer; tmpPlayer = thePlayer; tmpAdvance = theAdvance; if(tmpAdvance == AdvanceDB(ADVANCE_ADV_INFANTRY_TACTICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ADV_INFANTRY_TACTICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ADV_NAVAL_TACTICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ADV_NAVAL_TACTICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ADV_URBAN_PLANNING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ADV_URBAN_PLANNING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ADVANCED_COMPOSITES)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ADVANCED_COMPOSITES)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_AERODYNAMICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_AERODYNAMICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_AGE_OF_REASON)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_AGE_OF_REASON)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_AGRICULTURAL_REVOLUTION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_AGRICULTURAL_REVOLUTION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_AGRICULTURE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_AGRICULTURE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_AI_SURVEILLANCE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_AI_SURVEILLANCE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ALCHEMY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ALCHEMY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ARCOLOGIES)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ARCOLOGIES)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_BALLISTICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_BALLISTICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_BANKING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_BANKING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_BRONZE_WORKING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_BRONZE_WORKING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_BUREAUCRACY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_BUREAUCRACY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CANNON_MAKING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CANNON_MAKING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CAVALRY_TACTICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CAVALRY_TACTICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CHAOS_THEORY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CHAOS_THEORY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CHEMISTRY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CHEMISTRY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CLASSICAL_EDUCATION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CLASSICAL_EDUCATION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_COMMUNISM)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_COMMUNISM)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_COMPUTER)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_COMPUTER)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CONCRETE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CONCRETE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CONSERVATION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CONSERVATION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CORPORATE_REPUBLIC)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CORPORATE_REPUBLIC)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CORPORATION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CORPORATION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CRIMINAL_CODE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CRIMINAL_CODE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_CYBERNETICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_CYBERNETICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_DEMOCRACY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_DEMOCRACY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_DIGITAL_ENCRYPTION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_DIGITAL_ENCRYPTION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_DRAMA)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_DRAMA)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ECONOMICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ECONOMICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ECOTOPIA)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ECOTOPIA)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ELECTRICITY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ELECTRICITY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_EUGENICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_EUGENICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_EXPLOSIVES)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_EXPLOSIVES)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_FASCISM)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_FASCISM)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_FEUDALISM)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_FEUDALISM)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_FUEL_CELLS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_FUEL_CELLS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_FUSION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_FUSION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GAIA_CONTROLLER)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GAIA_CONTROLLER)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GAIA_THEORY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GAIA_THEORY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GENETIC_TAILORING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GENETIC_TAILORING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GENETICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GENETICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GEOMETRY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GEOMETRY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GLOBAL_COMMUNICATIONS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GLOBAL_COMMUNICATIONS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GLOBAL_DEFENSE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GLOBAL_DEFENSE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GLOBAL_ECONOMICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GLOBAL_ECONOMICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GUIDED_WEAPON_SYSTEMS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GUIDED_WEAPON_SYSTEMS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_GUNPOWDER)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_GUNPOWDER)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_HORSE_RIDING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_HORSE_RIDING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_HT_SUPERCONDUCTOR)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_HT_SUPERCONDUCTOR)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_HULL_MAKING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_HULL_MAKING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_HUMAN_CLONING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_HUMAN_CLONING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_INDUSTRIAL_REVOLUTION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_INDUSTRIAL_REVOLUTION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_INTERNAL_COMBUSTION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_INTERNAL_COMBUSTION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_IRON_WORKING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_IRON_WORKING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_JET_PROPULSION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_JET_PROPULSION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_JURISPRUDENCE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_JURISPRUDENCE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_LIFE_EXTENSION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_LIFE_EXTENSION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_LIQUID_BREATHING_APPARATUS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_LIQUID_BREATHING_APPARATUS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_MASONRY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_MASONRY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_MASS_MEDIA)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_MASS_MEDIA)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_MASS_PRODUCTION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_MASS_PRODUCTION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_MASS_TRANSIT)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_MASS_TRANSIT)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_MEDICINE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_MEDICINE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_MODERN_METALLURGY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_MODERN_METALLURGY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_MONARCHY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_MONARCHY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NANO_ASSEMBLY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NANO_ASSEMBLY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NANO_MACHINES)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NANO_MACHINES)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NANO_WARFARE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NANO_WARFARE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NATIONALISM)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NATIONALISM)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NAVAL_AVIATION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NAVAL_AVIATION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NAVAL_TACTICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NAVAL_TACTICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NEURAL_INTERFACE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NEURAL_INTERFACE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NEURAL_REPROGRAMMING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NEURAL_REPROGRAMMING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_NUCLEAR_POWER)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_NUCLEAR_POWER)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_OCEAN_FARING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_OCEAN_FARING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_OIL_REFINING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_OIL_REFINING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_OPTICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_OPTICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_PHARMACEUTICALS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_PHARMACEUTICALS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_PHILOSOPHY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_PHILOSOPHY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_PHYSICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_PHYSICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_PLASMA_WEAPONRY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_PLASMA_WEAPONRY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_PRINTING_PRESS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_PRINTING_PRESS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_QUANTUM_MECHANICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_QUANTUM_MECHANICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_RADAR)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_RADAR)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_RAILROAD)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_RAILROAD)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_RELIGION)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_RELIGION)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ROBOTICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ROBOTICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_SHIP_BUILDING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_SHIP_BUILDING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_SLAVE_LABOR)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_SLAVE_LABOR)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_SMART_MATERIALS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_SMART_MATERIALS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_SPACE_FLIGHT)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_SPACE_FLIGHT)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_STONE_WORKING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_STONE_WORKING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_SUBNEURAL_ADS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_SUBNEURAL_ADS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_SUPERSONIC_FLIGHT)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_SUPERSONIC_FLIGHT)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_TANK_WARFARE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_TANK_WARFARE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_TECHNOCRACY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_TECHNOCRACY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_THEOLOGY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_THEOLOGY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_TOOLMAKING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_TOOLMAKING)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_TRADE)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_TRADE)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_ULTRAPRESSURE_MACHINERY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_ULTRAPRESSURE_MACHINERY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_UNIFIED_PHYSICS)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_UNIFIED_PHYSICS)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_VERTICAL_FLIGHT_AIRCRAFT)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_VERTICAL_FLIGHT_AIRCRAFT)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_VIRTUAL_DEMOCRACY)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_VIRTUAL_DEMOCRACY)) { return 1; } } if(tmpAdvance == AdvanceDB(ADVANCE_WRITING)) { if(HasAdvance(tmpPlayer, ID_ADVANCE_WRITING)) { return 1; } } return 0; } HandleEvent(CaptureCity) 'GiveThePlayerAdvanceFromCity' pre { int_t i; int_t sucess; int_t Conqueror; int_t conquered; Conqueror = player[0]; conquered = city[0].owner; while(sucess == 0 && i < 200) { if(!NewHasAdvance(Conqueror, i) == 1 && NewHasAdvance(conquered, i) == 1) { if(Random(4) == 0) { GrantAdvance(Conqueror, i); advance[0] = i; message(player[0], 'AdvanceFromCapturingCity'); } sucess = 1; } i = i + 1; } } messagebox 'AdvanceFromCapturingCity' { Show(); Text(ID_ADVANCE_FROM_CAPTURING_CITY); }