Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Identity.js
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | Identity.prototype.Schema = | ||||
"</optional>" + | "</optional>" + | ||||
"<optional>" + | "<optional>" + | ||||
"<element name='RequiredTechnology' a:help='Optional name of a technology which must be researched before the entity can be produced.'>" + | "<element name='RequiredTechnology' a:help='Optional name of a technology which must be researched before the entity can be produced.'>" + | ||||
"<text/>" + | "<text/>" + | ||||
"</element>" + | "</element>" + | ||||
"</optional>" + | "</optional>" + | ||||
"<element name='Undeletable' a:help='Prevent players from deleting this entity.'>" + | "<element name='Undeletable' a:help='Prevent players from deleting this entity.'>" + | ||||
"<data type='boolean'/>" + | "<data type='boolean'/>" + | ||||
"</element>"; | "</element>" + | ||||
"<optional>" + | |||||
"<element name='Composition' a:help='The data of which a group should exist. Or something...'>" + | |||||
"<interleave>" + | |||||
"<element name='MutuallyExclusive' a:help='When true only one of the entries below will be produced, using the chances provided.'>" + | |||||
"<data type='boolean'/>" + | |||||
"</element>" + | |||||
"<element name='Entries'>" + | |||||
"<oneOrMore>" + | |||||
"<element>" + | |||||
"<anyName/>" + | |||||
"<interleave>" + | |||||
"<element name='Template' a:help='The template that ought to be produced.'><text/></element>" + | |||||
"<optional>" + | |||||
"<element name='Amount' a:help='The amount of this template that ought to be produced. Defaults to 1.'><data type='positiveInteger'/></element>" + | |||||
"</optional>" + | |||||
"<optional>" + | |||||
"<element name='Chance' a:help='The chance that this template is produced when MutuallyExclusive is set to true. The chance is the part of this value of the summed chances. Defaults to 1.'><data type='positiveInteger'/></element>" + | |||||
"</optional>" + | |||||
"</interleave>" + | |||||
"</element>" + | |||||
"</oneOrMore>" + | |||||
"</element>" + | |||||
"</interleave>" + | |||||
"</element>" + | |||||
"</optional>"; | |||||
Identity.prototype.Init = function() | Identity.prototype.Init = function() | ||||
{ | { | ||||
this.classesList = GetIdentityClasses(this.template); | this.classesList = GetIdentityClasses(this.template); | ||||
this.visibleClassesList = GetVisibleIdentityClasses(this.template); | this.visibleClassesList = GetVisibleIdentityClasses(this.template); | ||||
if (this.template.Phenotype) | if (this.template.Phenotype) | ||||
this.phenotype = pickRandom(this.GetPossiblePhenotypes()); | this.phenotype = pickRandom(this.GetPossiblePhenotypes()); | ||||
else | else | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator