// Use this for initialization void Start() { // Harbek 17+1 16 16 12 15 13 // The following will be handled by Character Factory // Create new character with name, race, class, and alignment testHarbek = new CharacterSheet ("Harbek", new Dwarf (DwarfSub.Mountain), new Fighter (), new Alignment ("Neutral", "Good")); // Set stats (to be handled by GUI later) testHarbek.STR = new Stat ("str", 18 + testHarbek.Race.strBonus, testHarbek.Class.strProf); testHarbek.DEX = new Stat ("dex", 16 + testHarbek.Race.dexBonus, testHarbek.Class.dexProf); testHarbek.CON = new Stat ("cha", 16 + testHarbek.Race.conBonus, testHarbek.Class.conProf); testHarbek.INT = new Stat ("int", 12 + testHarbek.Race.intBonus, testHarbek.Class.intProf); testHarbek.WIS = new Stat ("wis", 15 + testHarbek.Race.wisBonus, testHarbek.Class.wisProf); testHarbek.CHA = new Stat ("cha", 13 + testHarbek.Race.chaBonus, testHarbek.Class.chaProf); // Level up for test purposes testHarbek.LevelUp (5); }
/// <summary> /// Levels up a single level /// </summary> /// <param name="character">Character to level up.</param> public void LevelUp(CharacterSheet character) { character.SetLevel(character.Level + 1); character.Offense.LevelUp(character.Class); character.Defense.LevelUpDefenseStats(character.Class); var level = character.Class.GetLevel(character.Level); character.Add(level); if (character.Level % 2 == 1) { character.Add(new FeatToken()); } // Special Level ups if (character.Level % 4 == 0) { character.Add(new AbilityScoreToken(1, string.Format("Level ({0})", character.Level))); } }
protected Simulator( IRandom random, AvatarState avatarState, List <Guid> foods, SimulatorSheets simulatorSheets ) { Random = random; MaterialItemSheet = simulatorSheets.MaterialItemSheet; SkillSheet = simulatorSheets.SkillSheet; SkillBuffSheet = simulatorSheets.SkillBuffSheet; BuffSheet = simulatorSheets.BuffSheet; CharacterSheet = simulatorSheets.CharacterSheet; CharacterLevelSheet = simulatorSheets.CharacterLevelSheet; EquipmentItemSetEffectSheet = simulatorSheets.EquipmentItemSetEffectSheet; Log = new BattleLog(); Player = new Player(avatarState, this); Player.Use(foods); Player.Stats.EqualizeCurrentHPWithHP(); }
/// <summary> /// Loads data from a character sheet into the character detail GUI components. /// </summary> /// <param name="character">CharacterSheet to load character data from</param> virtual public void loadFromCharactersheet(CharacterSheet character) { FirstName.Text = character.FirstName; LastName.Text = character.LastName; Age.Text = character.Age; Race.Text = character.Race; Gender.Text = character.Gender; Weight.Text = character.Weight; Height.Text = character.Height; Description.Text = character.Description; if (character.portrait != null) { portrait_pane.BackColor = Color.Transparent; portrait_pane.BackgroundImage = character.portrait; PortraitWindow.BackColor = Color.Transparent; PortraitWindow.BackgroundImage = character.portrait; } }
private bool NrOfSkillsLimitReached(Skill skill) { CharacterSheet character = SingletonComponent <CharsheetView> .Singleton.character; var abilityValue = character.GetAbilityValue(Skill.GetAbility(skill.skillType)); var nrOfIncreasedSkillsForAbility = 0; for (int i = 0; i < character.skills.Length; i++) { if (Skill.GetAbility(skill.skillType) == Skill.GetAbility(character.skills[i].skillType)) { var modifier = character.skills[i].GetModifierOfType(ModifierType.CHARACTER_CREATION); if (modifier != null && modifier.Amount > 1) { nrOfIncreasedSkillsForAbility++; } } } return(nrOfIncreasedSkillsForAbility >= abilityValue); }
public void SettingRaceCalculatesSize() { var gateway = new TestTraitGateway(); var sheet = new CharacterSheet(_testSkills); var smallGuy = new Race(); smallGuy.SizeSetting = CharacterSize.Small; smallGuy.HeightRange = DiceStrings.ParseDice("2d4+10"); smallGuy.WeightRange = DiceStrings.ParseDice("2d4+100"); var assign = new RaceSelector(new TestRacesGateway(), gateway); assign.SetRace(sheet, smallGuy); Assert.AreEqual(CharacterSize.Small, sheet.Size.Size); Assert.GreaterOrEqual(sheet.Size.Height, 12); Assert.GreaterOrEqual(sheet.Size.Weight, 102); }
public void CastSpell(CharacterSheet target, Spell spell) { string d = spell.DealDamage(this, target); string h = spell.DoHealing(this, target); string e = spell.ApplyEffect(this, target); if (d != "") { log.Log(d); } if (h != "") { log.Log(h); } if (e != "") { log.Log(e); } spells_left--; }
public override string ApplyEffect(CharacterSheet caster, CharacterSheet target) { int spell_dc = caster.GetSpellDC() + spellLvl; int will_save = Helpers.RollD20() + target.GetWill(); if (target.effects.ContainsKey(CombatEffects.CombatEffect.Blessed)) { will_save += 1; } if (will_save >= spell_dc) { return("Successful Will Save, spell effect is negated."); } else { target.AddCombatEffect(CombatEffects.CombatEffect.Shaken, 10); return("Target is shaken for 10 rounds."); } }
private void EditToView() { var sheet = CharacterSheetStorage.Instance.selectedCharacter; if (sheet == null) { return; } var bab = baseAttackBonus.GetRange(0, attacksCount); if ((currentAttack != sheet.currentAttack) || !CharacterSheet.IsEqual(bab, sheet.baseAttackBonus) || !currentAttacksCount.Equals(sheet.currentAttacksCount)) { sheet.baseAttackBonus = bab; sheet.currentAttack = currentAttack; sheet.currentAttacksCount.Fill(currentAttacksCount); CharacterSheetStorage.Instance.SaveCharacter(); } }
//Print the current skill in training. Use separate charID. //Uses libeveapi //Says to channel private static void PrintSkillTraining(User user, int characterID) { Character eveChar = mySession.CreateCriteria <Character>().Add(Restrictions.Eq("apiCharacterId", characterID)).UniqueResult <Character>(); UserApi api = eveChar.api; CharacterSheet character = EveApi.GetCharacterSheet(api.apiUserId, characterID, api.apiKeyId); SkillInTraining skillInTrain = EveApi.GetSkillInTraining(api.apiUserId, characterID, api.apiKeyId); if (skillInTrain.SkillCurrentlyInTraining) { DateTime dt = DateTime.SpecifyKind(Convert.ToDateTime(skillInTrain.TrainingEndTime), DateTimeKind.Utc); TimeSpan timeTillDone = dt - skillInTrain.CurrentTime; string timeTillDoneString = getTimeTillDoneString(ref timeTillDone); connection.privmsg(CHANNEL, String.Format("{0} is currently training {1} to level {2} which finishes at {3}. ({4})", character.Name, getSkillById(skillInTrain.TrainingTypeId).TypeName, skillInTrain.TrainingToLevel, dt.ToString(), timeTillDoneString)); } else { connection.privmsg(CHANNEL, String.Format("{0} isn't currently training anything", character.Name)); } }
public override void Awake() { base.Awake(); if (playerSheet == null) { playerSheet = PlayerController.Current.character.characterSheet; } if (stringBuilder == null) { Color getColor = sheetLeftText.color; getColor.a = defocusedAlpha; focusColorTag = string.Format("<color=#{0}>", ColorUtility.ToHtmlStringRGB(getColor)); defocusColorTag = string.Format("<color=#{0}>", ColorUtility.ToHtmlStringRGBA(getColor)); stringBuilder = new StringBuilder(); rightTextContent = new List <string>(sheetSectionLength); effectsContent = new List <string>(); } }
public void Init(CharacterSheet sheet, ItemType roll, List <ItemType> items, bool saveCharacter) { if (sheet == null) { return; } this.sheet = sheet; this.items = items; this.saveCharacter = saveCharacter; source = roll; if (roll == null) { this.roll = new ItemType(); } else { this.roll = roll.Clone as ItemType; } Delete.IsEnabled = items != null; UpdateView(); }
public void ExecuteStep(CharacterSheet character) { var validArmors = new ArmorType[] { ArmorType.None, ArmorType.Light, ArmorType.Medium, ArmorType.Heavy }; var armors = this.armorShop.GetInventory <IArmor>().Where(armor => validArmors.Any(x => x == armor.ArmorType) && character.Defense.IsProficient(armor) && character.Inventory.CoinPurse.CanAfford(armor) ); if (armors.HasChoices()) { var armor = armors.ChooseOne(); ShortLog.DebugFormat("Purchasing {0}", armor.Name); character.Inventory.Purchase(armor); } }
public void ExecuteStep(CharacterSheet character) { //TODO: Max prices should be specified by strategy //TODO: Very similiar to other purchasing routines just slightly different... var spend = System.Math.Min(20000, character.Inventory.CoinPurse.Value); while (spend > 0) { var items = gearGateway.Where(gear => character.Inventory.CoinPurse.CanAfford(gear)); if (items.HasChoices()) { var buy = items.ChooseOne(); character.Inventory.Purchase(buy); spend -= buy.Value; } else { spend = 0; } } }
public void AddTraitTriggersModifiedEvent() { bool called = false; CharacterSheet sheet = new CharacterSheet(_testSkills); sheet.Modified += (object sender, CharacterSheetEventArgs e) => { called = true; }; //Set up the trait var trait = new Trait(); trait.Name = "Elfy"; sheet.AddTrait(trait, true); //Make sure the event was called Assert.IsTrue(called); }
public void Show(CharacterSheet sheet) { diceTypeText.text = TextUtility.GetDiceValueString(1, CharacterUtility.GetDiceTypeByClass(sheet.Type)); SetHitDicesCount(sheet); okButton.onClick.AddListener(() => { OnOkPressed?.Invoke(); Destroy(this.gameObject); }); useDiceButton.onClick.AddListener(() => { OnUseDicePressed?.Invoke(); SetHitDicesCount(sheet); }); resetDicesButton.onClick.AddListener(() => { OnResetDicesPressed?.Invoke(); SetHitDicesCount(sheet); }); }
/// <summary> /// /// </summary> private static void CharacterSheet(XmlNode Element, CharacterSheet Receiver) { SheetConverter.CharacterSheetDetails(Element["Details"], Receiver); SheetConverter.CharacterAbilityScores(Element["AbilityScores"], Receiver); SheetConverter.CharacterStatBlock(Element["StatBlock"], Receiver); SheetConverter.CharacterRulesElementTally(Element["RulesElementTally"], Receiver); SheetConverter.CharacterPowerStats(Element["PowerStats"], Receiver); //Others Int32 Count = Element.ChildNodes.Count; String Name; for (Int32 I = 0; I < Count; I++) { Name = Element.ChildNodes[I].Name; if (Name == "AbilityScores") { } } }
public RankingSimulatorSheets( MaterialItemSheet materialItemSheet, SkillSheet skillSheet, SkillBuffSheet skillBuffSheet, BuffSheet buffSheet, CharacterSheet characterSheet, CharacterLevelSheet characterLevelSheet, EquipmentItemSetEffectSheet equipmentItemSetEffectSheet, WeeklyArenaRewardSheet weeklyArenaRewardSheet ) : base( materialItemSheet, skillSheet, skillBuffSheet, buffSheet, characterSheet, characterLevelSheet, equipmentItemSetEffectSheet ) { WeeklyArenaRewardSheet = weeklyArenaRewardSheet; }
static void Main(string[] args) { Console.WriteLine("CHARACTERFORGE - A D&D Character Generator"); Console.WriteLine("=========================================="); Console.WriteLine("This application currently only used as a"); Console.WriteLine("test driver application and will generate a"); Console.WriteLine("pre-defined character sheet"); ICharacter character = BuildCharacter(); CharacterSheetBuilder builder = new CharacterSheetBuilder(); CharacterSheet sheet = builder.Build(character); IRulebook rules = new Rulebook(new RulesFactory()); IEnumerable <IViolation> violations = rules.CheckRules(character); MarkdownGenerator generator = new MarkdownGenerator(); string output = generator.Generate(sheet, violations); File.WriteAllText("charactersheet.md", output); }
public void IfLevelUpDoesNotIncrementLevelThrowException() { var data = new MemoryStore(); data.SetValue("name", "Test One"); data.SetValue("type", "levelup"); //Does now steps that increment level var steps = new MemoryStore(); data.SetValue("steps", steps); var build = new CharacterStrategy(); build.TargetLevel = 5; var character = new CharacterSheet(build); var designer = new CharacterDesigner(data); Assert.Throws <System.InvalidOperationException>(() => designer.ExecuteStep(character)); }
public void FeatsEquipmentFinished() { CharacterSheet sheet = featController.sheet; bool teamsFull = gameManager.AddPlayerToTeam(sheet, team); if (gameManager.teamCombatants [team].Count < gameManager.maxTeamSize) { teamSetupPortraits [gameManager.teamCombatants [team].Count].SetPlusButtonMode(); teamSetupPortraits [gameManager.teamCombatants [team].Count].button.Select(); } else { // TODO: team completed animation if (teamsFull) { Invoke("LoadCombatScene", 1f); } } featController.gameObject.SetActive(false); }
public static CharacterSheet WithWizardCasting(this CharacterSheet character) { var spellcastingConfigurationYaml = @"--- list: " + character.Class.Name + @" spell-type: arcane casting-ability: intelligence spell-slots: 1: [3, 2] 2: [4, 3] 3: [4, 3, 2] "; var spellList = CreateGenericSpellList(character.Class.Name); var casting = new WizardCasting( spellcastingConfigurationYaml.ParseYaml(), EntityGateway <SpellList> .LoadWithSingleItem(spellList) ); character.Add(casting); return(character); }
public void Init(CharacterSheet sheet, CharacterSheet.ModifiersList <CharacterSheet.IntModifier, int, CharacterSheet.IntSum> modifiersList, CharacterSheet.IntModifier modifier, bool allowUseAbilities = true) { this.sheet = sheet; this.modifiersList = modifiersList; source = modifier; if (modifier != null) { this.modifier = modifier.Clone as CharacterSheet.IntModifier; } else { this.modifier = new CharacterSheet.IntModifier(); } InitControls(allowUseAbilities); IsActive.IsChecked = this.modifier.IsActive; ItemMustBeActive.IsChecked = this.modifier.mustBeActive; ModifierValue.Text = this.modifier.value.ToString(); ModifierName.Text = this.modifier.Name; Delete.IsEnabled = source != null; UpdateView(); }
public void CombineMultipleDescriptionsTogetherButDoNotRepeat() { var tattoo = new PhysicalFeature(); tattoo.AddDescriptor("color", new string[] { "green" }); tattoo.AddTemplate("Tattoo of a {{descriptor \"color\"}} dragon."); var scar = new PhysicalFeature(); scar.AddDescriptor("location", new string[] { "face" }); scar.AddTemplate("A scar on {{descriptor \"location\"}}."); var gateway = EntityGateway <PhysicalFeature> .LoadFromList(new PhysicalFeature[] { tattoo, scar }); var subject = new CreatePhysicalFeatures(gateway); var character = new CharacterSheet(CharacterStrategy.Default()); subject.ExecuteStep(character); Assert.Contains("Tattoo of a green dragon.", character.Appearance.PhysicalAppearance); Assert.Contains("A scar on face.", character.Appearance.PhysicalAppearance); }
/// <summary> /// Activates the one corresponding to the address of the current avatar state among the `ArenaInfo` included in the weekly arena state you are viewing. /// </summary> /// <param name="characterSheet"></param> /// <param name="addArenaInfoIfNotContained"></param> public static void AddWeeklyArenaInfoActivator( CharacterSheet characterSheet, bool addArenaInfoIfNotContained = true) { var avatarState = States.Instance.CurrentAvatarState; var avatarAddress = avatarState.address; var weeklyArenaState = States.Instance.WeeklyArenaState; var weeklyArenaAddress = weeklyArenaState.address; if (addArenaInfoIfNotContained && !weeklyArenaState.ContainsKey(avatarAddress)) { weeklyArenaState.Set(avatarState, characterSheet); } var modifier = new WeeklyArenaInfoActivator(avatarAddress); LocalLayer.Instance.Add(weeklyArenaAddress, modifier); weeklyArenaState = modifier.Modify(weeklyArenaState); WeeklyArenaStateSubject.WeeklyArenaState.OnNext(weeklyArenaState); }
public void Show(CharacterSheet sheet, OnValidateInput onValidate) { currentHitsInputField.text = sheet.CurrentHits.ToString(); maxHitsInputField.text = sheet.MaxHits.ToString(); int level = CharacterValuesUtility.CalculateLevel(sheet.ExpiriencePoints); int constitutionModificator = CharacterValuesUtility.GetCharacteristicModificator(sheet[CharacteristicType.Constitution]); bonusHitsText.text = TextUtility.GetSignedValueString(level * constitutionModificator); okButton.onClick.AddListener(() => { OnOkPressed?.Invoke(currentHitsInputField.text, maxHitsInputField.text); Destroy(this.gameObject); }); cancelButton.onClick.AddListener(() => { OnCancelPressed?.Invoke(currentHitsInputField.text, maxHitsInputField.text); Destroy(this.gameObject); }); }
private bool NrOfSkillPointsLimitReached(Skill skill) { CharacterSheet character = SingletonComponent <CharsheetView> .Singleton.character; var abilityValue = character.GetAbilityValue(Skill.GetAbility(skill.skillType)); var nrOfSkillPointsSpentForAbility = 0; int maxNrOfSkillPointsSpentForAbility = abilityValue * ((StartingSkillPoints - 1) / _startingAbilityPoints + 1); for (int i = 0; i < character.skills.Length; i++) { if (Skill.GetAbility(skill.skillType) == Skill.GetAbility(character.skills[i].skillType)) { var modifier = character.skills[i].GetModifierOfType(ModifierType.CHARACTER_CREATION); if (modifier != null && modifier.Amount > 1) { nrOfSkillPointsSpentForAbility += (modifier.Amount - 1); } } } return(nrOfSkillPointsSpentForAbility >= maxNrOfSkillPointsSpentForAbility); }
// Use this for initialization public virtual void Start() { this.logger = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>().GetLogger(); logger.Log(debug, " Non player character start"); sheet = new CharacterSheet(); sheet.inventory = new Inventory(); sheet.inventory.items = new List <Item>(); sheet.npcOracle = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>().GetNPCOracle(); logger.Log(debug, " calling where base city should be"); sheet.baseCity = sheet.npcOracle.WhereShouldBaseCityBe(transform); logger.Log(debug, "city:" + sheet.baseCity); sheet.health = 100; sheet.hunger = 100; sheet.energy = 100; //InvokeRepeating("TimePasses", 500, 500); }
public IActionResult SheetDetails(int?id) { if (id != null) { CharacterSheet characterSheet = RpgRepository.Get(id.Value); if (characterSheet == null) { Response.StatusCode = 404; return(View("CharacterSheetNotFound", id.Value)); } SheetDetailsViewModel sheetDetailsViewModel = new SheetDetailsViewModel() { characterSheet = characterSheet, pageTitle = "Character Sheet Details" }; return(View(sheetDetailsViewModel)); } return(RedirectToAction("SheetsList")); }
private History GenerateHistory(CharacterSheet character) { var history = new History(); //Homeland var homelandSelector = new HomelandSelector(new HomelandYamlGateway()); history.Homeland = homelandSelector.SelectHomelandByRace(character.Race.Name); // Family var familyHistory = new FamilyHistoryCreator(this.nameGenerator); history.FamilyTree = familyHistory.CreateFamilyTree(character.Race.Name); // Drawback var drawback = new CharacterDrawbackSelector(new DrawbackYamlGateway()); history.Drawback = drawback.SelectDrawback(); return(history); }
protected void mapCharacToActivity(CharacterSheet cs) { TextView TxtViewCharName = FindViewById <TextView>(Resource.Id.textViewCharName); TxtViewCharName.Text = cs.Nom; TextView TxtViewCharClass = FindViewById <TextView>(Resource.Id.textViewCharClass); TxtViewCharClass.Text = cs.ClasseActuelle; TextView TxtViewCharRace = FindViewById <TextView>(Resource.Id.textViewCharRace); TxtViewCharRace.Text = cs.Race; TextView TxtViewCharNiveau = FindViewById <TextView>(Resource.Id.textViewCharNiveau); TxtViewCharNiveau.Text = cs.NiveauGlobal.ToString(); GridView grdChar = FindViewById <GridView>(Resource.Id.gridViewCharac); ///grdChar. }
public void RollNewCharacter(CharacterSheet sheet, int level) { //foreach(OddsToStat row in DataManager.DM.characterClassDictionary[sheet.characterClass].levelUpStatOdds) //{ // Debug.Log(sheet.characterClass.ToString() +" "+row.stat.ToString() + " " + row.range.x.ToString() + " " + row.range.y.ToString()); //} sheet.stats = new CharacterStats(); sheet.level = 1- GameSettings.LevelOneStartingStats_NumberOfLevelsFromZeros; sheet.characterClass = "Junker"; sheet.actions_FrontRow = DataManager.DM.characterClassDictionary[sheet.characterClass].forwardActions; sheet.actions_BackRow = DataManager.DM.characterClassDictionary[sheet.characterClass].rearActions; sheet.actions_Activated = DataManager.DM.characterClassDictionary[sheet.characterClass].activatedActions; for (int i =0; i< GameSettings.LevelOneStartingStats_NumberOfLevelsFromZeros + level - 1; i++) { LevelUp(sheet); } sheet.stats.maxHealth = sheet.stats.health; sheet.stats.maxArmor = sheet.stats.armor; sheet.stats.maxShield = sheet.stats.shield; }
// Use this for initialization public Character(CharacterSheet _sheet, CharacterPiece _piece) { sheet = _sheet; piece = _piece; piece.transform.localPosition = new Vector3(1000f, 1000f, 1000f); }
public void LevelUp(CharacterSheet sheet) { sheet.level += 1; sheet.stats.health += Random.Range(GameSettings.hitPointsMinOnLevelUp, GameSettings.hitPointsMaxOnLevelUp+1); sheet.stats.armor += Random.Range(1, 6); sheet.stats.shield += Random.Range(1, 6); for(int i = 0; i < GameSettings.statPointsOnLevelUp; i++) { float roll = RollZeroToUnderOne(); foreach(OddsToStat row in DataManager.DM.characterClassDictionary[sheet.characterClass].levelUpStatOdds) { if(roll >= row.range.x && roll < row.range.y) { switch(row.stat) { case StatType.ATTACK: { sheet.stats.attack += 1; break; } case StatType.DEFENSE: { sheet.stats.defense += 1; sheet.stats.health += 1; break; } case StatType.AGILITY: { sheet.stats.agility += 1; break; } case StatType.MAGIC: { sheet.stats.magic += 1; break; } case StatType.SPIRIT: { sheet.stats.spirit += 1; sheet.stats.health += 1; break; } case StatType.MIND: { sheet.stats.mind += 1; break; } case StatType.CHARISMA: { sheet.stats.charisma += 1; break; } case StatType.RESOLVE: { sheet.stats.resolve += 1; sheet.stats.health += 1; break; } case StatType.SPEED: { sheet.stats.speed += 1; break; } case StatType.LUCK: { sheet.stats.luck += 1; break; } default: break; }//end switch to add point }//end if roll in range }//end foreach row in odds table }//end each stat point }
void MonsterKill(CharacterSheet monsterSheet) { int expReward = Mathf.Clamp((monsterSheet.level - level),-5,10) * 10 + 50; GameExperience (expReward); }
public void Initialize(CharacterSheet _sheet, int index) { sheet = _sheet; RectTransform trans; int squadindex; if(sheet.isPlayer) { allyDisplay = GameObject.Find("AllyDisplay"); characterDisplay = (GameObject)Instantiate(allyCharacterUI); characterDisplay.transform.SetParent(allyDisplay.transform); trans = characterDisplay.GetComponent<RectTransform>(); trans.anchorMin = Vector2.one; trans.anchorMax = Vector2.one; characterDisplay.transform.localPosition = new Vector3(110, -20 - (index*48f)); squadindex = sheet.squadLocX + (sheet.squadLocY * 5); } else { enemyDisplay = GameObject.Find("EnemyDisplay"); characterDisplay = (GameObject)Instantiate(enemyCharacterUI); characterDisplay.transform.SetParent(enemyDisplay.transform); trans = characterDisplay.GetComponent<RectTransform>(); trans.anchorMin = new Vector2(0,1f); trans.anchorMax = new Vector2(0,1f); characterDisplay.transform.localPosition = new Vector3(130, -20 - (index * 48f)); squadindex = (4- sheet.squadLocX) + (sheet.squadLocY * 5); } foreach(Transform child in trans) { if(child.name == "CharacterNameText") { characterName_Text = child.gameObject.GetComponent<UnityEngine.UI.Text>(); } else if(child.name == "HealthIconFill") { healthFill_Image = child.gameObject.GetComponent<UnityEngine.UI.Image>(); } else if(child.name == "ArmorIconFill") { armorFill_Image = child.gameObject.GetComponent<UnityEngine.UI.Image>(); } else if(child.name == "ShieldIconFill") { shieldFill_Image = child.gameObject.GetComponent<UnityEngine.UI.Image>(); } else if(child.name == "CharacterHeadImage") { characterHead_Image = child.gameObject.GetComponent<UnityEngine.UI.Image>(); } else if(child.name == "SquadLocationImage") { squadLocation_Image = child.gameObject.GetComponent<UnityEngine.UI.Image>(); } } characterName_Text.text = sheet.characterName + " - " + sheet.characterClass + " Lvl " + sheet.level; squadLocation_Image.sprite = DataManager.DM.grid_medium[squadindex]; characterHead_Image.sprite = DataManager.DM.character_heads[0]; UpdateUI(); }