public ReligionParser AddReligion(String name, String orig=null)
        {
            if (name != "pagan")
            {
                String oname = name;
                name = StarNames.SafeName(name);
                LanguageManager.instance.Add(name, oname);
                orig = oname;
            }

       
            
            ScriptScope scope = new ScriptScope();
            scope.Name = name;
            Scope.Add(scope);
            ReligionParser r = new ReligionParser(scope);
            ReligionManager.instance.AllReligions.Add(r);
            if (orig != null)
            {
                r.LanguageName = orig;
            }
            Religions.Add(r);
            ReligionManager.instance.ReligionMap[name] = r;
            return r;
        }
示例#2
0
        public ReligionParser AddReligion(String name, String orig = null)
        {
            if (name != "pagan")
            {
                String oname = name;
                name = StarNames.SafeName(name);
                LanguageManager.instance.Add(name, oname);
                orig = oname;
            }



            ScriptScope scope = new ScriptScope();

            scope.Name = name;
            Scope.Add(scope);
            ReligionParser r = new ReligionParser(scope);

            ReligionManager.instance.AllReligions.Add(r);
            if (orig != null)
            {
                r.LanguageName = orig;
            }
            Religions.Add(r);
            ReligionManager.instance.ReligionMap[name] = r;
            return(r);
        }
示例#3
0
        public void AddReligiousTraits(ReligionParser religion)
        {
            string relName     = religion.Name;
            string relLangName = religion.LanguageName;

            last.Do(@"

                sympathy_" + religion.Name + @" = {
        opposites =  {
	        zealous
        }    
           
        potential = {
	        NOT = { religion_group = "     + religion.Group.Name + @" }
        }

	        same_opinion_if_same_religion = 5

	        customizer = no
	        random = no

	        male_insult = INSULT_LOVER_OF_HEATHENS
	        female_insult = INSULT_LOVER_OF_HEATHENS
	        male_insult_adj = INSULT_UNPRINCIPLED
	        female_insult_adj = INSULT_UNPRINCIPLED
	        child_insult_adj = INSULT_STUPID"    );

            last.Do(@"

           secretly_" + religion.Name + @" = {
	                is_visible = {
		                OR = {
			                character = FROM
			                society_member_of = secret_religious_society_"             + religion.Name + @"
			                AND = {
				                is_close_relative = FROM
				                trait = secretly_"                 + religion.Name + @"
			                }
		                }
	                }

	                same_opinion = 15
	
	                random = no
	                customizer = no
	                ai_zeal = -50 
                }
            }"

                    );


            ScriptScope c  = (ScriptScope)last.Children[last.Children.Count - 1];
            var         op = new ScriptScope("opposites");

            c.Add(op);
            opposites.Add(op);
            AddTrait("secretly_" + relName, "bastard.dds");
            AddTrait("sympathy_" + relName, "bastard.dds");
        }
示例#4
0
 public void AddReligion(ReligionParser r)
 {
     if (r.Group != null)
     {
         r.Group.Scope.Remove(r.Scope);
     }
     Scope.Add(r.Scope);
     Religions.Add(r);
 }
示例#5
0
 public ReligionParser BranchReligion(String name)
 {
     ScriptScope scope = new ScriptScope();
     scope.Name = name;
     Group.Scope.Add(scope);
     ReligionParser r = new ReligionParser(scope);
     ReligionManager.instance.AllReligions.Add(r);
     return r;
 }
 public void AddReligion(ReligionParser r)
 {
     if (r.Group != null)
     {
         r.Group.Scope.Remove(r.Scope);
     }
     Scope.Add(r.Scope);
     Religions.Add(r);            
 }
示例#7
0
        public ReligionParser BranchReligion(String name)
        {
            ScriptScope scope = new ScriptScope();

            scope.Name = name;
            Group.Scope.Add(scope);
            ReligionParser r = new ReligionParser(scope);

            ReligionManager.instance.AllReligions.Add(r);
            return(r);
        }
示例#8
0
        public void AddTrigger(ReligionParser religion)
        {
            script.Root.Do($@"

                true_religion_{religion.Name}_trigger = {{
	                true_religion = {religion.Name}
                }}


");
        }
示例#9
0
        private int SortByBelieversReligion(ReligionParser x, ReligionParser y)
        {
            if (x.Provinces.Count > y.Provinces.Count)
            {
                return(-1);
            }
            if (x.Provinces.Count < y.Provinces.Count)
            {
                return(1);
            }

            return(0);
        }
示例#10
0
        public ReligionParser AddReligion(String name, String orig = null)
        {
            if (name != "urtru")
            {
                String oname = name;
                name = StarNames.SafeName(name);

                LanguageManager.instance.Add(name, oname);
                orig = oname;
            }

            ScriptScope scope = new ScriptScope
            {
                Name = name
            };

            Scope.Add(scope);

            ReligionParser r = new ReligionParser(scope);

            ReligionManager.instance.AllReligions.Add(r);

            if (orig != null)
            {
                r.LanguageName = orig;
            }

            r.Name  = r.Scope.Name;
            r.Group = this;

            var col = Col();

            r.r = col.R;
            r.g = col.G;
            r.b = col.B;

            Religions.Add(r);
            ReligionManager.instance.ReligionMap[name] = r;

            Console.Out.WriteLine(r.Name + " added");

            return(r);
        }
示例#11
0
        public void LoadVanilla()
        {
            SaveReligions = false;
            var files = ModManager.instance.GetFileKeys("common\\religions");

            foreach (var file in files)
            {
                Script s = ScriptLoader.instance.LoadKey(file);
                foreach (var rootChild in s.Root.Children)
                {
                    if ((rootChild as ScriptScope).Name == "secret_religion_visibility_trigger")
                    {
                        continue;
                    }

                    ReligionGroupParser p = new ReligionGroupParser(rootChild as ScriptScope);

                    AllReligionGroups.Add(p);
                    foreach (var scopeChild in p.Scope.Children)
                    {
                        if (scopeChild is ScriptScope)
                        {
                            var sc = scopeChild as ScriptScope;

                            if (sc.Name == "male_names" ||
                                sc.Name == "female_names")
                            {
                                continue;
                            }

                            ReligionParser r = new ReligionParser(sc);
                            AllReligions.Add(r);
                            ReligionMap[r.Name] = r;
                            p.Religions.Add(r);
                            r.Group        = p;
                            r.LanguageName = LanguageManager.instance.Get(r.Name);
                        }
                    }
                }
            }
        }
示例#12
0
        public void CreateSocietyForReligion(ReligionParser r, string c, ScriptScope scope, Template template)
        {
            var lang = StarNames.Generate(c);

            switch (Rand.Next(5))
            {
            case 0:
                lang = "The " + lang + " Order";
                break;

            case 1:
                lang = "Children of " + lang;
                break;

            case 2:
                lang = "Way of " + lang;
                break;

            case 3:
                lang = "Society of " + lang;
                break;

            case 4:
                lang = "Sons of " + lang;
                break;
            }

            var         name       = lang.AddSafe();
            ScriptScope newSociety = new ScriptScope(name);
            var         temp       = Societies[template.ToString()];

            Societies[name] = newSociety;
            contextName     = name;
            contextReligion = r;

            CreateAssassinTemplate(Scripts[0].Root, ScripterTriggerManager.instance.script.Root, name, r);

            (Scripts[0].Root.Children[Scripts[0].Root.Children.Count - 1] as ScriptScope).Tag1 = r;

            //   newSociety.FillFrom(temp, new ScriptScope.CopyDelegate(SocietyModify));
        }
示例#13
0
        public void CreateAssassinTemplate(ScriptScope parentSociety, ScriptScope parentScriptTrigger, String societyName, ReligionParser religion, ReligionGroupParser religiongroup = null)
        {
            if (religiongroup == null)
            {
                religiongroup = religion.Group;
            }

            parentSociety.Do($@"

{societyName} = {{
	primary_attribute = intrigue
	is_secret = yes
	devil_worshipper = no
	opinion_to_other_members = +10
	opinion_to_pretenders = -20			
	opinion_to_perceived_members = -20 
	opinion_per_rank_above = +10
	society_rank_up_decision = request_to_rank_up_within_society
	sound = assassins_interface
	society_ranks_gfx = generic_ranks
	
	active = {{
		has_dlc = ""Mystics""
	}}
	indestructible = yes

	can_join_society = {{
		hidden_trigger = {{
			NAND = {{
				ai = yes
				is_society_rank_full = {{ 
					society = {societyName}
					rank = 1
				}}
			}}
		}}
		has_{societyName}_prerequisites = yes
		hidden_trigger = {{
			NOT = {{ has_character_flag = society_join_block }}
		}}
	}}

	show_society = {{
		OR = {{
			religion = {religion.Name}
			secret_religion = {religion.Name}
		}}
		age = 16
		OR = {{
			is_female = no
			has_game_rule = {{
				name = gender
				value = all
			}}
		}}
	}}

	potential = {{
		OR = {{
			religion = {religion.Name}
			secret_religion = {religion.Name}
		}}
	}}

	society_rank = {{
		level = 1
		limit = 20 
		startup_limit = 10
		modifier = {{
			is_visible = {{
				OR = {{
					society_member_of = {societyName}
					FROM = {{ is_society_discovered = yes }}
				}}
			}}
			murder_plot_power_modifier = 0.1 # increased plotpower
		}}
		decisions = {{
			assassins_borrow_money
			assassins_donate
			assassins_drug_effect
		}}
	}}
	
	society_rank = {{
		level = 2
		limit = 15
		startup_limit = 6
		modifier = {{ 
			is_visible = {{
				OR = {{
					society_member_of = {societyName}
					FROM = {{ is_society_discovered = yes }}
				}}
			}}
			murder_plot_power_modifier = 0.2 # further increased plotpower
			defensive_plot_power_modifier = 0.1
			intrigue = 1 
			combat_rating = 1 # bonus to dueling
		}}
		decisions = {{
			assassins_scare_ruler #Available (targeted) Power: Can scare rulers to get a Favor (leave a dagger on their pillow, etc. 
		}}
	}}
	
	society_rank = {{
		level = 3
		limit = 5 
		startup_limit = 3
		modifier = {{
			is_visible = {{
				OR = {{
					society_member_of = {societyName}
					FROM = {{ is_society_discovered = yes }}
				}}
			}}
			murder_plot_power_modifier = 0.30 # further increased plotpower
			defensive_plot_power_modifier = 0.15
			intrigue = 2 # further increase
			combat_rating = 1 # bonus to dueling (left over)
			plot_discovery_chance = 0.1 # bonus to plot discovery chance
		}}
		decisions = {{
			assassins_raise_ships #Available Power: Can raise special fleet of Ships
		}}
	}}

	society_rank = {{
		level = 4
		limit = 1 
		startup_limit = 1
		modifier = {{
			is_visible = {{
				OR = {{
					society_member_of = {societyName}
					FROM = {{ is_society_discovered = yes }}
				}}
			}}
			murder_plot_power_modifier = 0.50 # further increased plotpower
			defensive_plot_power_modifier = 0.25
			intrigue = 3 # further increase
			combat_rating = 1 # bonus to dueling (left over)
			plot_discovery_chance = 0.2 # further bonus to plot discovery chance
		}}
		decisions = {{
			assassins_raise_troops
			assassins_mark_for_death 
		}}
		obedience_tooltip = obedience_tooltip 
		obedient = {{
			ROOT = {{
				always = yes
			}}
		}}
	}}

	monthly_currency_gain = {{
		name = currency_name_{societyName}
    
		per_attribute = {{
			name = intrigue 
			value = 0.5
		}}
		has_trait = {{
			trait = zealous
			value = 3
		}}
		has_trait = {{
			trait = erudite
			value = 3
		}}
		has_trait = {{
			trait = scholar
			value = 3
		}}
		has_trait = {{
			trait = theologian
			value = 3
		}}
		has_trait = {{
			trait = schemer
			value = 3
		}}
		has_trait = {{
			trait = strong
			value = 1
		}}
		has_trait = {{
			trait = robust
			value = 1
		}}
		has_trait = {{
			trait = genius
			value = 1
		}}
		has_trait = {{
			trait = quick
			value = 1
		}}
		has_trait = {{
			trait = shrewd
			value = 1
		}}
		has_trait = {{
			trait = diligent
			value = 1
		}}
		has_trait = {{
			trait = patient
			value = 1
		}}
		has_trait = {{
			trait = temperate
			value = 1
		}}
		has_trait = {{
			trait = charitable
			value = 1
		}}
		society_rank = {{
			rank = 4
			value = 10
		}}
	}}

	member_score_per_attribute = 3
	member_score_per_rank = 100

	member_score = {{
		value = 10


		modifier = {{
			trait = zealous
			factor = 1.3
		}}
		modifier = {{
			trait = erudite
			factor = 1.3
		}}
		modifier = {{
			trait = scholar
			factor = 1.3
		}}
		modifier = {{
			trait = theologian
			factor = 1.3
		}}
		modifier = {{
			trait = schemer
			factor = 1.3
		}}
		modifier = {{
			trait = strong
			factor = 1.1
		}}
		modifier = {{
			trait = robust
			factor = 1.1
		}}
		modifier = {{
			trait = genius
			factor = 1.1
		}}
		modifier = {{
			trait = quick
			factor = 1.1
		}}
		modifier = {{
			trait = shrewd
			factor = 1.1
		}}
		modifier = {{
			trait = diligent
			factor = 1.1
		}}
		modifier = {{
			trait = patient
			factor = 1.1
		}}
		modifier = {{
			trait = temperate
			factor = 1.1
		}}
		modifier = {{
			trait = charitable
			factor = 1.1
		}}	
	}}
	
	startup_populate = {{
	    trigger = {{
			ai = yes
	        controls_religion = no 
			religion = {religion.Name}
			age = 16
			OR = {{
				is_female = no
				has_game_rule = {{
					name = gender
					value = all
				}}
			}}
			NOT = {{ trait = decadent }}
			OR = {{
				trait = zealous
				trait = schemer
				trait = elusive_shadow
				trait = deceitful
				trait = ambitious
				intrigue = 18
			}}
			is_in_society = no
			NOT = {{ higher_tier_than = DUKE }}
			NOT = {{ mercenary = yes }}
		}}
	}}
}}
");

            parentScriptTrigger.Do($@"
            has_{societyName}_prerequisites = {{
                age = 16
	            true_religion_{religion.Name}_trigger = yes
	                OR = {{
		                is_female = no
		                has_game_rule = {{
			                name = gender
			                value = all
		                }}
	                }}
                }}
            ");


            secretSocieties.Add((parentSociety.Children[parentSociety.Children.Count - 1] as ScriptScope).Name);
        }
示例#14
0
        public void Mutate(ReligionParser rel, CultureParser culture, int nChanges)
        {
            this.dna = culture.dna;
            this.ai_convert_other_group = rel.ai_convert_other_group;

            this.max_consorts              = rel.max_consorts;
            this.max_wives                 = rel.max_wives;
            this.religious_clothing_head   = rel.religious_clothing_head;
            this.religious_clothing_priest = rel.religious_clothing_priest;
            this.allow_looting             = rel.allow_looting;
            this.allow_rivermovement       = rel.allow_rivermovement;
            this.allow_viking_invasion     = rel.allow_viking_invasion;
            this.autocephaly               = rel.autocephaly;
            this.bs_marriage               = rel.bs_marriage;
            this.can_call_crusade          = rel.can_call_crusade;
            this.can_excommunicate         = rel.can_excommunicate;
            this.can_grant_claim           = rel.can_grant_claim;
            this.can_grant_divorce         = rel.can_grant_divorce;
            this.can_have_antipopes        = rel.can_have_antipopes;
            this.can_hold_temples          = rel.can_hold_temples;
            this.can_retire_to_monastery   = rel.can_retire_to_monastery;
            this.divine_blood              = rel.divine_blood;
            this.female_temple_holders     = rel.female_temple_holders;
            this.hasLeader                 = rel.hasLeader;
            this.has_heir_designation      = rel.has_heir_designation;
            this.investiture               = rel.investiture;
            this.matrilineal_marriages     = rel.matrilineal_marriages;
            this.pacifist            = rel.pacifist;
            this.pc_marriage         = rel.pc_marriage;
            this.peace_prestige_loss = rel.peace_prestige_loss;
            this.polytheism          = rel.polytheism;
            this.priests_can_inherit = rel.priests_can_inherit;
            this.psc_marriage        = rel.psc_marriage;

            high_god_name = rel.high_god_name;
            devil         = rel.devil;
            priest        = rel.priest;

            gods.AddRange(rel.gods);


            int r = Rand.Next(255);
            int g = Rand.Next(255);
            int b = Rand.Next(255);

            r = rel.r;
            g = rel.g;
            b = rel.b;
            switch (Rand.Next(3))
            {
            case 0:
                r += Rand.Next(-45, 45);
                g += Rand.Next(-25, 25);
                b += Rand.Next(-15, 15);

                break;

            case 1:
                g += Rand.Next(-45, 45);
                r += Rand.Next(-25, 25);
                b += Rand.Next(-15, 15);

                break;

            case 2:
                b += Rand.Next(-45, 45);
                g += Rand.Next(-25, 25);
                r += Rand.Next(-15, 15);

                break;
            }
            if (r > 255)
            {
                r = 255;
            }
            if (g > 255)
            {
                g = 255;
            }
            if (b > 255)
            {
                b = 255;
            }

            if (r < 0)
            {
                r = 0;
            }
            if (g < 0)
            {
                g = 0;
            }
            if (b < 0)
            {
                b = 0;
            }

            for (int n = 0; n < nChanges; n++)
            {
                MakeChange();
            }

            DoReligionScope(high_god_name, devil, priest, scripture_name, crusade_name, culture.dna, r, g, b);
        }
示例#15
0
        public void Mutate(ReligionParser rel, CultureParser culture, int nChanges)
        {
            this.dna = culture.dna;
            this.ai_convert_other_group = rel.ai_convert_other_group;
            
            this.max_consorts = rel.max_consorts;
            this.max_wives = rel.max_wives;
            this.religious_clothing_head = rel.religious_clothing_head;
            this.religious_clothing_priest = rel.religious_clothing_priest;
            this.allow_looting = rel.allow_looting;
            this.allow_rivermovement = rel.allow_rivermovement;
            this.allow_viking_invasion = rel.allow_viking_invasion;
            this.autocephaly = rel.autocephaly;
            this.bs_marriage = rel.bs_marriage;
            this.can_call_crusade = rel.can_call_crusade;
            this.can_excommunicate = rel.can_excommunicate;
            this.can_grant_claim = rel.can_grant_claim;
            this.can_grant_divorce = rel.can_grant_divorce;
            this.can_have_antipopes = rel.can_have_antipopes;
            this.can_hold_temples = rel.can_hold_temples;
            this.can_retire_to_monastery = rel.can_retire_to_monastery;
            this.divine_blood = rel.divine_blood;
            this.female_temple_holders = rel.female_temple_holders;
            this.hasLeader = rel.hasLeader;
            this.has_heir_designation = rel.has_heir_designation;
            this.investiture = rel.investiture;
            this.matrilineal_marriages = rel.matrilineal_marriages;
            this.pacifist = rel.pacifist;
            this.pc_marriage = rel.pc_marriage;
            this.peace_prestige_loss = rel.peace_prestige_loss;
            this.polytheism = rel.polytheism;
            this.priests_can_inherit = rel.priests_can_inherit;
            this.psc_marriage = rel.psc_marriage;

            high_god_name = rel.high_god_name;
            devil = rel.devil;
            priest = rel.priest;

            gods.AddRange(rel.gods);


            int r = Rand.Next(255);
            int g = Rand.Next(255);
            int b = Rand.Next(255);

            r = rel.r;
            g = rel.g;
            b = rel.b;
            switch (Rand.Next(3))
            {
                case 0:
                    r += Rand.Next(-45, 45);
                    g += Rand.Next(-25, 25);
                    b += Rand.Next(-15, 15);

                    break;
                case 1:
                    g += Rand.Next(-45, 45);
                    r += Rand.Next(-25, 25);
                    b += Rand.Next(-15, 15);

                    break;
                case 2:
                    b += Rand.Next(-45, 45);
                    g += Rand.Next(-25, 25);
                    r += Rand.Next(-15, 15);

                    break;
            }
            if (r > 255)
                r = 255;
            if (g > 255)
                g = 255;
            if (b > 255)
                b = 255;

            if (r < 0)
                r = 0;
            if (g < 0)
                g = 0;
            if (b < 0)
                b = 0;

            for(int n=0;n<nChanges;n++)
                MakeChange();

            DoReligionScope(high_god_name, devil, priest, scripture_name, crusade_name, culture.dna, r, g, b);

        }