From: <geo...@us...> - 2012-12-28 20:53:36
|
Revision: 5583 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=5583&view=rev Author: geoffthemedio Date: 2012-12-28 20:53:28 +0000 (Fri, 28 Dec 2012) Log Message: ----------- -Tweaked various species planet-specific effectsgroups to (seemingly) speed up effects processing, particularly for effects from species that attempt to act on ships. Might have broken a few macros in the process. -Removed error message that repeatedly occurs when trying to get diplomatic status with the client empire when the client's player is an observer (so has no empire). Modified Paths: -------------- trunk/FreeOrion/Empire/EmpireManager.cpp trunk/FreeOrion/default/species.txt Modified: trunk/FreeOrion/Empire/EmpireManager.cpp =================================================================== --- trunk/FreeOrion/Empire/EmpireManager.cpp 2012-12-28 17:24:31 UTC (rev 5582) +++ trunk/FreeOrion/Empire/EmpireManager.cpp 2012-12-28 20:53:28 UTC (rev 5583) @@ -128,10 +128,8 @@ } DiplomaticStatus EmpireManager::GetDiplomaticStatus(int empire1, int empire2) const { - if (empire1 == ALL_EMPIRES || empire2 == ALL_EMPIRES) { - Logger().errorStream() << "EmpireManager::GetDiplomaticStatus passed invalid empire id"; + if (empire1 == ALL_EMPIRES || empire2 == ALL_EMPIRES) return INVALID_DIPLOMATIC_STATUS; - } std::map<std::pair<int, int>, DiplomaticStatus>::const_iterator it = m_empire_diplomatic_statuses.find(DiploKey(empire1, empire2)); Modified: trunk/FreeOrion/default/species.txt =================================================================== --- trunk/FreeOrion/default/species.txt 2012-12-28 17:24:31 UTC (rev 5582) +++ trunk/FreeOrion/default/species.txt 2012-12-28 20:53:28 UTC (rev 5583) @@ -1958,13 +1958,13 @@ STANDARD_CONSTRUCTION ''' EffectsGroup scope = Source - activation = Source + activation = Planet accountinglabel = "STANDARD_CONSTRUCTION_LABEL" effects = SetTargetConstruction Value + 20 EffectsGroup scope = Source - activation = Source + activation = Planet accountinglabel = "STANDARD_COLONY_SUPPLY_LABEL" effects = SetSupply Value + 1 @@ -1978,7 +1978,10 @@ Source Homeworld name = Source.Species ] - activation = NOT HasTag "SELF_SUSTAINING" + activation = And [ + Planet + NOT HasTag "SELF_SUSTAINING" + ] stackinggroup = "HOMEWORLD_STACK" accountinglabel = "HOMEWORLD_BONUS" effects = SetTargetPopulation Value + 1 * Target.SizeAsDouble @@ -1988,7 +1991,10 @@ Source Homeworld name = Source.Species ] - activation = HasTag "SELF_SUSTAINING" + activation = And [ + Planet + HasTag "SELF_SUSTAINING" + ] stackinggroup = "HOMEWORLD_STACK" accountinglabel = "HOMEWORLD_BONUS" effects = SetTargetPopulation Value + 2 * Source.SizeAsDouble // Get double the homeworld bonus @@ -2007,7 +2013,10 @@ Homeworld name = RootCandidate.Species ] ] - activation = Focus "FOCUS_GROWTH" + activation = And [ + Planet + Focus "FOCUS_GROWTH" + ] stackinggroup = "HOMEWORLD_STACK" accountinglabel = "HOMEWORLD_SUPPLY" effects = SetTargetPopulation Value + 1 * Target.SizeAsDouble @@ -2040,6 +2049,7 @@ EffectsGroup scope = Source activation = AND [ + Planet HasTag "PHOTOTROPHIC" Star type = [Blue] ] @@ -2049,6 +2059,7 @@ EffectsGroup scope = Source activation = AND [ + Planet HasTag "PHOTOTROPHIC" Star type = [White] ] @@ -2058,6 +2069,7 @@ EffectsGroup scope = Source activation = AND [ + Planet HasTag "PHOTOTROPHIC" Star type = [Red Neutron] ] @@ -2067,6 +2079,7 @@ EffectsGroup scope = Source activation = AND [ + Planet HasTag "PHOTOTROPHIC" Star type = [BlackHole NoStar] ] @@ -2079,6 +2092,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "BAD_POPULATION_LABEL" effects = SetTargetPopulation Value*.75 // doesn't matter if these modifiers don't match ther other 'bad' modifiers. @@ -2099,6 +2113,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "GOOD_POPULATION_LABEL" effects = SetTargetPopulation Value*1.25 // doesn't matter if these modifiers don't match ther other 'good' modifiers. @@ -2112,6 +2127,7 @@ '''EffectsGroup scope = Source activation = And [ + Planet Or [ HasSpecial "TUNNELS_SPECIAL" OwnerHasTech "GRO_SUBTER_HAB" @@ -2126,6 +2142,7 @@ '''EffectsGroup scope = Source activation = AND [ + Planet OwnerHasTech "CON_NDIM_STRC" TargetPopulation low = 0 high = 9999 ] @@ -2135,6 +2152,7 @@ EffectsGroup scope = Source activation = AND [ + Planet OwnerHasTech "CON_ORBITAL_HAB" TargetPopulation low = 0 high = 9999 ] @@ -2151,19 +2169,28 @@ ENVIRONMENT_MODIFIER ''' EffectsGroup scope = Source - activation = Planet environment = Hostile + activation = And [ + Planet + Planet environment = Hostile + ] accountinglabel = "HOSTILE_ENVIRONMENT_LABEL" effects = SetTargetPopulation Value - 3 * Source.SizeAsDouble EffectsGroup scope = Source - activation = Planet environment = Poor + activation = And [ + Planet + Planet environment = Poor + ] accountinglabel = "POOR_ENVIRONMENT_LABEL" effects = SetTargetPopulation Value - 1 * Source.SizeAsDouble EffectsGroup scope = Source - activation = Planet environment = Adequate + activation = And [ + Planet + Planet environment = Adequate + ] accountinglabel = "ADEQUATE_ENVIRONMENT_LABEL" effects = SetTargetPopulation Value + 0 * Source.SizeAsDouble @@ -2172,6 +2199,7 @@ EffectsGroup scope = Source activation = And [ + Planet Planet environment = [ Adequate Poor Hostile ] OwnerHasTech "GRO_SYMBIOTIC_BIO" ] @@ -2181,6 +2209,7 @@ EffectsGroup scope = Source activation = And [ + Planet Planet environment = [ Good Adequate Poor Hostile ] OwnerHasTech "GRO_XENO_GENETICS" ] @@ -2190,6 +2219,7 @@ EffectsGroup scope = Source activation = And [ + Planet Planet environment = [ Adequate Poor Hostile ] OwnerHasTech "GRO_XENO_HYBRIDS" ] @@ -2199,6 +2229,7 @@ EffectsGroup scope = Source activation = And [ + Planet Planet environment = [ Adequate Poor Hostile ] OwnerHasTech "GRO_CYBORG" ] @@ -2211,12 +2242,15 @@ ADVANCED_FOCUS_EFFECTS ''' EffectsGroup scope = Source - activation = Focus "FOCUS_STEALTH" + activation = And [ + Planet + Focus "FOCUS_STEALTH" + ] effects = SetStealth Value + 15 EffectsGroup scope = And [ - PopulationCenter + Planet OwnedBy EnemyOf Source.Owner WithinStarlaneJumps 4 Source Not Number low = 1 And [ @@ -2233,11 +2267,15 @@ Fleet ] activation = And [ - ContainedBy Contains And [ - Building "BLD_STARGATE_ACTIVATOR" - OwnedBy TheEmpire Source.Owner + Planet + Focus "FOCUS_STARGATE" + ContainedBy And [ + System + Contains And [ + Building "BLD_STARGATE_ACTIVATOR" + OwnedBy TheEmpire Source.Owner + ] ] - Focus "FOCUS_STARGATE" ] effects = MoveTo And [ Focus "FOCUS_STARGATE" @@ -2250,8 +2288,9 @@ EffectsGroup scope = Source activation = And [ + Planet + Focus "FOCUS_PLANET_DRIVE" WithinStarlaneJumps 1 Building name = "BLD_PLANET_BEACON" - Focus "FOCUS_PLANET_DRIVE" ] effects = [ MoveTo And [ @@ -2268,26 +2307,30 @@ EffectsGroup scope = Source activation = And [ + Planet + Focus "FOCUS_PLANET_DRIVE" + Random probability = 0.5 WithinStarlaneJumps 1 Building name = "BLD_PLANET_BEACON" Not WithinDistance 200 Building name = "BLD_LIGHTHOUSE" - Random probability = 0.5 - Focus "FOCUS_PLANET_DRIVE" ] effects = Destroy EffectsGroup scope = And [ - WithinStarlaneJumps 1 Source - Not WithinDistance 0 Source Fleet Not Stationary OwnedBy EnemyOf Source.Owner + WithinStarlaneJumps 1 Source + Not WithinDistance 0 Source ] - activation = Focus "FOCUS_DISTORTION" + activation = And [ + Planet + Focus "FOCUS_DISTORTION" + ] effects = MoveTo And [ + System WithinStarlaneJumps 1 Source Not WithinDistance 0 Source - System ] EffectsGroup @@ -2307,6 +2350,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "BAD_INDUSTRY_LABEL" effects = SetTargetIndustry Value*[[BAD_MULTIPLIER]] ''' @@ -2315,6 +2359,7 @@ '''EffectsGroup scope = Source activation = And [ + Planet Focus type = "FOCUS_INDUSTRY" [[STANDARD_CONDITION_INFRA]] ] @@ -2324,6 +2369,7 @@ EffectsGroup scope = Source activation = And [ + Planet Focus type = "FOCUS_INDUSTRY" [[STANDARD_CONDITION_POP]] ] @@ -2332,7 +2378,10 @@ EffectsGroup // removes residual production from a dead planet scope = Source - activation = TargetPopulation low = 0 high =0 + activation = And [ + Planet + TargetPopulation low = 0 high = 0 + ] effects = SetIndustry Value = 0 ''' @@ -2341,6 +2390,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "GOOD_INDUSTRY_LABEL" effects = SetTargetIndustry Value*[[GOOD_MULTIPLIER]] ''' @@ -2350,6 +2400,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "GREAT_INDUSTRY_LABEL" effects = SetTargetIndustry Value*[[GREAT_MULTIPLIER]] ''' @@ -2359,6 +2410,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "ULTIMATE_INDUSTRY_LABEL" effects = SetTargetIndustry Value*[[ULTIMATE_MULTIPLIER]] ''' @@ -2374,6 +2426,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "BAD_RESEARCH_LABEL" effects = SetTargetResearch Value*[[BAD_MULTIPLIER]] ''' @@ -2382,6 +2435,7 @@ '''EffectsGroup scope = Source activation = And [ + Planet Focus type = "FOCUS_RESEARCH" [[STANDARD_CONDITION_INFRA]] ] @@ -2391,6 +2445,7 @@ EffectsGroup scope = Source activation = And [ + Planet Focus type = "FOCUS_RESEARCH" [[STANDARD_CONDITION_POP]] ] @@ -2399,7 +2454,10 @@ EffectsGroup // removes residual production from a dead planet scope = Source - activation = TargetPopulation low = 0 high =0 + activation = And [ + Planet + TargetPopulation low = 0 high = 0 + ] effects = SetResearch Value = 0 ''' @@ -2408,6 +2466,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "GOOD_RESEARCH_LABEL" effects = SetTargetResearch Value*[[GOOD_MULTIPLIER]] ''' @@ -2417,6 +2476,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "GREAT_RESEARCH_LABEL" effects = SetTargetResearch Value*[[GREAT_MULTIPLIER]] ''' @@ -2426,6 +2486,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "ULTIMATE_RESEARCH_LABEL" effects = SetTargetResearch Value*[[ULTIMATE_MULTIPLIER]] ''' @@ -2440,6 +2501,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "BAD_TROOPS_LABEL" effects = SetMaxTroops Value * .5 @@ -2451,6 +2513,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "AVERAGE_TROOPS_LABEL" effects = SetMaxTroops Value * 1 @@ -2462,6 +2525,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "GOOD_TROOPS_LABEL" effects = SetMaxTroops Value * 1.5 @@ -2473,6 +2537,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "GREAT_TROOPS_LABEL" effects = SetMaxTroops Value * 2 @@ -2484,6 +2549,7 @@ EffectsGroup scope = Source + activation = Planet accountinglabel = "ULTIMATE_TROOPS_LABEL" effects = SetMaxTroops Value * 3 @@ -2493,7 +2559,10 @@ BASIC_GROUND_TROOPS '''EffectsGroup scope = OwnedBy TheEmpire Source.Owner - activation = NOT OwnerHasTech "DEF_GARRISON_1" + activation = And [ + Planet + NOT OwnerHasTech "DEF_GARRISON_1" + ] stackinggroup = "BASIC_TROOPS_STACK" accountinglabel = "DEF_ROOT_DEFENSE" effects = SetMaxTroops Value + 2 @@ -2501,6 +2570,7 @@ EffectsGroup scope = OwnedBy TheEmpire Source.Owner activation = AND [ + Planet OwnerHasTech "DEF_GARRISON_1" NOT OwnerHasTech "DEF_GARRISON_2" ] @@ -2511,6 +2581,7 @@ EffectsGroup scope = OwnedBy TheEmpire Source.Owner activation = AND [ + Planet OwnerHasTech "DEF_GARRISON_2" NOT OwnerHasTech "DEF_GARRISON_3" ] @@ -2521,6 +2592,7 @@ EffectsGroup scope = OwnedBy TheEmpire Source.Owner activation = AND [ + Planet OwnerHasTech "DEF_GARRISON_3" NOT OwnerHasTech "DEF_GARRISON_4" ] @@ -2530,13 +2602,17 @@ EffectsGroup scope = OwnedBy TheEmpire Source.Owner - activation = OwnerHasTech "DEF_GARRISON_4" + activation = And [ + Planet + OwnerHasTech "DEF_GARRISON_4" + ] stackinggroup = "BASIC_TROOPS_STACK" accountinglabel = "DEF_GARRISON_4" effects = SetMaxTroops Value + 20 EffectsGroup scope = AND [ + Planet OwnedBy TheEmpire Source.Owner Planet Population high = 0 ] @@ -2546,10 +2622,14 @@ EffectsGroup scope = And [ + Planet + OwnedBy TheEmpire Source.Owner Contains Building name = "BLD_IMPERIAL_PALACE" - OwnedBy TheEmpire Source.Owner ] - activation = OwnerHasTech "DEF_ROOT_DEFENSE" + activation = And [ + Planet + OwnerHasTech "DEF_ROOT_DEFENSE" + ] stackinggroup = "PALACE_TROOPS_STACK" accountinglabel = "BLD_IMPERIAL_PALACE" effects = SetMaxTroops Value + 3 @@ -2560,13 +2640,17 @@ Homeworld name = Source.Species OwnedBy TheEmpire Source.Owner ] + activation = Planet stackinggroup = "HOMEWORLD_TROOPS_STACK" accountinglabel = "HOMEWORLD_LABEL" effects = SetMaxTroops Value + 2 EffectsGroup scope = Source - activation = Not OwnedBy AnyEmpire + activation = And [ + Planet + Not OwnedBy AnyEmpire + ] stackinggroup = "BASIC_TROOPS_STACK" accountinglabel = "INDEPENDENT_TROOP_LABEL" effects = SetMaxTroops Value + 8 @@ -2576,7 +2660,10 @@ PROTECTION_FOCUS ''' EffectsGroup scope = Source - activation = Focus "FOCUS_PROTECTION" + activation = And [ + Planet + Focus "FOCUS_PROTECTION" + ] accountinglabel = "FOCUS_PROTECTION_LABEL" effects = [ SetMaxTroops Value * 2 @@ -2590,28 +2677,24 @@ BAD_DETECTION '''EffectsGroup scope = Source - activation = Source effects = SetDetection Value -20 ''' GOOD_DETECTION '''EffectsGroup scope = Source - activation = Source effects = SetDetection Value + 25 ''' GREAT_DETECTION ''' EffectsGroup scope = Source - activation = Source effects = SetDetection Value + 50 ''' ULTIMATE_DETECTION ''' EffectsGroup scope = Source - activation = Source effects = SetDetection Value + 100 ''' @@ -2620,40 +2703,32 @@ BAD_STEALTH '''EffectsGroup - scope = AND [ - Source - Planet - ] + scope = Source + activation = Planet stackinggroup = "SPECIES_STEALTH_STACK" effects = SetStealth Value - 15 ''' GOOD_STEALTH '''EffectsGroup - scope = AND [ - Source - Planet - ] + scope = Source + activation = Planet stackinggroup = "SPECIES_STEALTH_STACK" effects = SetStealth Value + 15 ''' GREAT_STEALTH '''EffectsGroup - scope = AND [ - Source - Planet - ] + scope = Source + activation = Planet stackinggroup = "SPECIES_STEALTH_STACK" effects = SetStealth Value + 40 ''' ULTIMATE_STEALTH '''EffectsGroup - scope = AND [ - Source - Planet - ] + scope = Source + activation = Planet stackinggroup = "SPECIES_STEALTH_STACK" effects = SetStealth Value + 60 ''' @@ -2723,28 +2798,40 @@ HUGE_PLANET '''EffectsGroup scope = Source - activation = Turn high = 0 + activation = And [ + Planet + Turn high = 0 + ] effects = SetPlanetSize Huge ''' LARGE_PLANET '''EffectsGroup scope = Source - activation = Turn high = 0 + activation = And [ + Planet + Turn high = 0 + ] effects = SetPlanetSize Large ''' MEDIUM_PLANET '''EffectsGroup scope = Source - activation = Turn high = 0 + activation = And [ + Planet + Turn high = 0 + ] effects = SetPlanetSize Medium ''' SMALL_PLANET '''EffectsGroup scope = Source - activation = Turn high = 0 + activation = And [ + Planet + Turn high = 0 + ] effects = SetPlanetSize Small ''' @@ -2752,6 +2839,7 @@ '''EffectsGroup scope = Source activation = AND [ + Planet Turn high = 0 Planet Size = Huge ] @@ -2763,7 +2851,10 @@ TUNNELS_SPECIAL '''EffectsGroup scope = Source - activation = Turn high = 0 + activation = And [ + Planet + Turn high = 0 + ] effects = AddSpecial name = "TUNNELS_SPECIAL" ''' |