public ConvergeSelector_AllOf(JSONArray template) { for (int Idx = 1; Idx < template.Length; ++Idx) { cases.Add(ConvergeSelector.New(template.getProperty(Idx))); } }
public ConvergeSelector_Battlefield(JSONArray template) { filters = new List <ConvergeSelector>(); for (int Idx = 1; Idx < template.Length; ++Idx) { filters.Add(ConvergeSelector.New(template.getProperty(Idx))); } }
public ConvergeTriggeredAbilitySpec(JSONTable template, ContentManager Content) { triggerType = (ConvergeTriggerType)Enum.Parse(typeof(ConvergeTriggerType), template.getString("trigger")); triggerPlayer = ConvergeSelector.New(template.getProperty("triggerPlayer", null)); triggerSubject = ConvergeSelector.New(template.getProperty("triggerSubject", null)); triggerTarget = ConvergeSelector.New(template.getProperty("triggerTarget", null)); condition = ConvergeSelector.New(template.getProperty("condition", null)); effect = ConvergeCommand.New(template.getArray("effect"), Content); }
public void Init(JSONTable template, ContentManager Content) { string artName = template.getString("art"); art = Content.Load <Texture2D>(artName); name = template.getString("name", artName); // for now text = template.getString("text", "").InsertLineBreaks(Game1.font, ConvergeUIObject.CardTooltipWidth - 15); textHeight = (int)Game1.font.MeasureString(text).Y; cardType = 0; foreach (string name in template.getArray("cardType").asStrings()) { cardType |= (ConvergeCardType)Enum.Parse(typeof(ConvergeCardType), name); } power = template.getInt("power", 0); toughness = template.getInt("toughness", 0); string producesTemplate = template.getString("produces", ""); if (producesTemplate != "") { produces = new ConvergeManaAmount(template.getString("produces")); } string costTemplate = template.getString("cost", ""); if (costTemplate != "") { cost = new ConvergeManaAmount(costTemplate); } keywords = 0; foreach (string name in template.getArray("keywords", JSONArray.empty).asStrings()) { keywords |= (ConvergeKeyword)Enum.Parse(typeof(ConvergeKeyword), name); } activatedAbilities = new List <ConvergeActivatedAbilitySpec>(); foreach (JSONTable abilityTemplate in template.getArray("activated", JSONArray.empty).asJSONTables()) { activatedAbilities.Add(new ConvergeActivatedAbilitySpec(abilityTemplate, Content)); } triggeredAbilities = new List <ConvergeTriggeredAbilitySpec>(); foreach (JSONTable abilityTemplate in template.getArray("triggered", JSONArray.empty).asJSONTables()) { triggeredAbilities.Add(new ConvergeTriggeredAbilitySpec(abilityTemplate, Content)); } if (template.hasKey("effect")) { actionEffect = ConvergeCommand.New(template.getArray("effect"), Content); } if (template.hasKey("target")) { actionTarget = ConvergeSelector.New(template.getProperty("target")); } }
public ConvergeSelector_Zone(JSONArray template) { whose = ConvergeSelector.New(template.getProperty(1)); zoneId = (ConvergeZoneId)Enum.Parse(typeof(ConvergeZoneId), template.getString(2)); filters = new List <ConvergeSelector>(); for (int Idx = 3; Idx < template.Length; ++Idx) { filters.Add(ConvergeSelector.New(template.getProperty(Idx))); } }
public ConvergeCommand_TakeControl(JSONArray template) { newControllerSelector = ConvergeSelector.New(template.getProperty(1)); victims = ConvergeSelector.New(template.getProperty(2)); if (template.Length == 4) { duration = (ConvergeDuration)Enum.Parse(typeof(ConvergeDuration), template.getString(3)); } else { duration = ConvergeDuration.Permanent; } }
public ConvergeActivatedAbilitySpec(JSONTable template, ContentManager Content) { frame = Content.Load <Texture2D>(template.getString("frame", "abilityFrame")); icon = Content.Load <Texture2D>(template.getString("icon")); text = template.getString("text", "").InsertLineBreaks(Game1.font, ConvergeUIAbility.AbilityTooltipWidth - 15); textHeight = (int)Game1.font.MeasureString(text).Y; effect = ConvergeCommand.New(template.getArray("effect"), Content); frameColor = template.getString("frameColor", "FFFFFF").toColor(); if (template.hasKey("attackEffect")) { attackEffect = ConvergeCommand.New(template.getArray("attackEffect"), Content); } if (template.hasKey("target")) { target = ConvergeSelector.New(template.getProperty("target")); } manacost = new ConvergeManaAmount(template.getString("manaCost", "")); uses = template.getInt("uses", 0); altCost = 0; foreach (string altcostString in template.getArray("altCost", JSONArray.empty).asStrings()) { altCost |= (ConvergeAltCost)Enum.Parse(typeof(ConvergeAltCost), altcostString); } JSONArray zoneTemplate = template.getArray("activeZones", null); if (zoneTemplate == null) { activeZones = ConvergeZoneId.Attack | ConvergeZoneId.Defense | ConvergeZoneId.Home; } else { activeZones = 0; foreach (string zoneName in zoneTemplate.asStrings()) { activeZones |= (ConvergeZoneId)Enum.Parse(typeof(ConvergeZoneId), zoneName); } } }
public ConvergeCommand_Upgrade(JSONArray template, ContentManager Content) { patients = ConvergeSelector.New(template.getProperty(1)); powerAmount = ConvergeCalculation.New(template.getProperty(2)); toughnessAmount = ConvergeCalculation.New(template.getProperty(3)); if (template.Length >= 5) { keywords = template.getArray(4).ToKeywords(); } if (template.Length >= 6) { duration = (ConvergeDuration)Enum.Parse(typeof(ConvergeDuration), template.getString(5)); } else { duration = ConvergeDuration.Permanent; } if (template.Length >= 7) { new_art = Content.Load <Texture2D>(template.getString(6)); } }
public ConvergeCommand_Heal(JSONArray template) { amount = ConvergeCalculation.New(template.getProperty(1)); patients = ConvergeSelector.New(template.getProperty(2)); }
public ConvergeCommand_Fight(JSONArray template) { sources = ConvergeSelector.New(template.getProperty(1)); victims = ConvergeSelector.New(template.getProperty(2)); }
public ConvergeSelector_Control(JSONArray template) { controller = ConvergeSelector.New(template.getProperty(1)); }
public ConvergeSelector_Except(JSONArray template) { excluded = ConvergeSelector.New(template.getProperty(1)); }
public ConvergeCommand_Spawn(JSONArray template, ContentManager Content) { players = ConvergeSelector.New(template.getProperty(1)); cardSpec = ConvergeCardSpec.allCards[template.getString(2)]; zoneId = (ConvergeZoneId)Enum.Parse(typeof(ConvergeZoneId), template.getString(3, "Defense")); }
public ConvergeCommand_GainLife(JSONArray template) { subjects = ConvergeSelector.New(template.getProperty(1)); amount = ConvergeCalculation.New(template.getProperty(2)); }
public ConvergeCommand_GrantTriggered(JSONArray template, ContentManager Content) { subjects = ConvergeSelector.New(template.getProperty(1)); duration = (ConvergeDuration)Enum.Parse(typeof(ConvergeDuration), template.getString(2)); abilitySpec = new ConvergeTriggeredAbilitySpec(template.getJSON(3), Content); }
public ConvergeCommand_Damage(JSONArray template) { sources = ConvergeSelector.New(template.getProperty(1)); amount = ConvergeCalculation.New(template.getProperty(2)); victims = ConvergeSelector.New(template.getProperty(3)); }
public ConvergeCommand_Untap(JSONArray template) { patients = ConvergeSelector.New(template.getProperty(1)); }
public ConvergeCommand_SkipMana(JSONArray template) { affected = ConvergeSelector.New(template.getProperty(1)); }
public ConvergeCommand_Retreat(JSONArray template) { subjects = ConvergeSelector.New(template.getProperty(1)); }
public ConvergeCommand_Sacrifice(JSONArray template) { victims = ConvergeSelector.New(template.getProperty(1)); }
public ConvergeCalculation_Toughness(JSONArray template) { select = ConvergeSelector.New(template.getProperty(1)); }