Skip to content

Commit

Permalink
Add type localisation validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tboby committed Feb 9, 2019
1 parent 408fcf7 commit 7acf94a
Show file tree
Hide file tree
Showing 23 changed files with 292 additions and 86 deletions.
11 changes: 7 additions & 4 deletions config/common/00_small_types_consolidated.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ types = {
subtype[show_name] = {
show_name = yes
}
subtype[selectable] = {
selectable = yes
}
}
type[country_color] = {
path = "game/common/colors"
Expand Down Expand Up @@ -64,10 +67,10 @@ ambient_object = {
subtype[!show_name] = {
name = scalar
}
## cardinality = 0..1
description = localisation
## cardinality = 0..1
tooltip = localisation
subtype[selectable] = {
description = localisation
tooltip = localisation
}
entity = <model_entity>
selectable = bool
show_name = bool
Expand Down
15 changes: 12 additions & 3 deletions config/common/all_modifiers_consolidated.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ types = {
subtype[block_triggered] = {
block_triggered = yes
}

localisation = {
## required
Name = "$"
}

}
type[static_modifier] = {
path = "game/common/static_modifiers"
localisation = {
## required
Name = "$"
Description = "$_desc"
}
}
type[planet_modifier] = {
path = "game/common/planet_modifiers"
Expand Down Expand Up @@ -87,7 +96,7 @@ opinion_modifier = {
##cardinality = 0..1
months = int
}

subtype[block_triggered] = {
### stops modifier from automatically triggering when trigger evaluates to true
block_triggered = yes
Expand All @@ -98,7 +107,7 @@ opinion_modifier = {
###For use with accumulative if the base is positive
max = int[1...999]
}


subtype[triggered_opinion_modifier] = {
###root = country with the opinion, from = country it has the opinion of
Expand Down
4 changes: 4 additions & 0 deletions config/common/anomalies.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
types = {
type[anomaly_category] = {
path = "game/common/anomalies"
localisation = {
## required
Name = "$"
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions config/common/casus_belli_and_war_goals.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ types = {
}
type[war_goal] = {
path = "game/common/war_goals"
localisation = {
## required
Name = "war_goal_$"
## required
Desc = "war_goal_$_desc"
}
}
}

Expand Down
20 changes: 10 additions & 10 deletions config/common/diplo_phrases.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ types = {
diplo_phrase = {
subtype[greetings] = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -42,7 +42,7 @@ diplo_phrase = {
## cardinality = 0..inf
select = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -55,7 +55,7 @@ diplo_phrase = {
## cardinality = 0..inf
consider = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -68,7 +68,7 @@ diplo_phrase = {
## cardinality = 0..inf
propose = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -81,7 +81,7 @@ diplo_phrase = {
## cardinality = 0..inf
accept = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -94,7 +94,7 @@ diplo_phrase = {
## cardinality = 0..inf
refuse = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -107,7 +107,7 @@ diplo_phrase = {
## cardinality = 0..inf
propose_vote = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -123,7 +123,7 @@ diplo_phrase = {
## cardinality = 0..inf
propose = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -140,7 +140,7 @@ diplo_phrase = {
## cardinality = 0..inf
accept = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand All @@ -159,7 +159,7 @@ diplo_phrase = {
subtype[declare_war] = {
opinion = {
## cardinality = 0..inf
scalar = {
localisation = {
## replace_scope = { root = country this = country from = country }
trigger = { alias_name[trigger] = alias_match_left[trigger] }
## cardinality = 0..1
Expand Down
7 changes: 7 additions & 0 deletions config/common/edicts.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ types = {
subtype[edict_ambition] = {
is_ambition = yes
}

localisation = {
## required
Name = "edict_$"
## required
Description = "edict_$_desc"
}
}
}

Expand Down
130 changes: 66 additions & 64 deletions config/common/ethics.cwt
Original file line number Diff line number Diff line change
@@ -1,89 +1,91 @@

types = {
## type_key_filter <> ethic_categories
type[ethos] = {
path = "game/common/ethics"

## type_key_filter = ethic_categories
subtype[ethic_categories] = {
}

subtype[actual_ethics] = {
category_value = int
localisation = {
## required
Name = "$"
## required
Description = "$_desc"
}
}
## type_key_filter = ethic_categories
type[ethic_categories] = {
path = "game/common/ethics"
}
}

# TODO Confirm
# TODO Document
ethos = {
subtype[ethic_categories] = {
## cardinality = 0..100
scalar = {}
}
subtype[actual_ethics] = {
cost = int

#theoretically this should link to the ethic categories, not sure how to do that though (or whether it is worth it)
category = scalar
category_value = int[0..4]
ethic_categories = {
## cardinality = 0..100
scalar = {}
}
ethos = {
cost = int

## cardinality = 0..1
###Yes by default
use_for_pops = bool
#theoretically this should link to the ethic categories, not sure how to do that though (or whether it is worth it)
category = scalar
category_value = int[0..4]

## cardinality = 0..1
category_opposite = bool
## cardinality = 0..1
###Yes by default
use_for_pops = bool

## cardinality = 0..1
regular_variant = <ethos>
## cardinality = 0..1
category_opposite = bool

## cardinality = 0..1
fanatic_variant = <ethos>
## cardinality = 0..1
regular_variant = <ethos>

## cardinality = 0..1
###always = yes by default
playable = {
alias_name[trigger] = alias_match_left[trigger]
}
## cardinality = 0..1
fanatic_variant = <ethos>

## replace_scope = { this = country root = country }
country_modifier = {
alias_name[modifier] = alias_match_left[modifier]
}
## cardinality = 0..1
###always = yes by default
playable = {
alias_name[trigger] = alias_match_left[trigger]
}

tags = {
## cardinality = 0..inf
localisation
}
## replace_scope = { this = country root = country }
country_modifier = {
alias_name[modifier] = alias_match_left[modifier]
}

random_weight = {
value = int
alias_name[modifier_rule] = alias_match_left[modifier_rule]
}
tags = {
## cardinality = 0..inf
localisation
}

## cardinality = 0..100
pop_attraction_tag = {
desc = localisation
## replace_scope = { root = country this = country }
###Scope = country
trigger = {
alias_name[trigger] = alias_match_left[trigger]
}
}
random_weight = {
value = int
alias_name[modifier_rule] = alias_match_left[modifier_rule]
}

## cardinality = 0..1
###Root = country
## cardinality = 0..100
pop_attraction_tag = {
desc = localisation
## replace_scope = { root = country this = country }
country_attraction = {
value = float
alias_name[modifier_rule] = alias_match_left[modifier_rule]
}
## cardinality = 0..1
###Root = pop, from = planet
## replace_scope = { root = pop this = pop from = planet }
pop_attraction = {
value = float
alias_name[modifier_rule] = alias_match_left[modifier_rule]
###Scope = country
trigger = {
alias_name[trigger] = alias_match_left[trigger]
}
}

## cardinality = 0..1
###Root = country
## replace_scope = { root = country this = country }
country_attraction = {
value = float
alias_name[modifier_rule] = alias_match_left[modifier_rule]
}
## cardinality = 0..1
###Root = pop, from = planet
## replace_scope = { root = pop this = pop from = planet }
pop_attraction = {
value = float
alias_name[modifier_rule] = alias_match_left[modifier_rule]
}
}
13 changes: 13 additions & 0 deletions config/common/governments.cwt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,22 @@ types = {
type[government] = {
path = "game/common/governments"
path_strict = yes
localisation = {
## required
Name = "$"
## required
Description = "$_desc"
}
}
type[civic] = {
path = "game/common/governments/civics"
localisation = {
## required
Name = "$"
## required
Description = "$_desc"
}

}
}

Expand Down
10 changes: 10 additions & 0 deletions config/common/megastructures.cwt
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
types = {
type[megastructure] = {
path = "game/common/megastructures"
localisation = {
## required
Name = "$"
## required
Description = "$_DESC"
## required
Details = "$_MEGASTRUCTURE_DETAILS"
## required
"Delayed info" = "$_CONSTRUCTION_INFO_DELAYED"
}
}
}

Expand Down
Loading

0 comments on commit 7acf94a

Please sign in to comment.