Example #1
0
        public void Initialize(Character character)
        {
            this.attributes = character.Entity.GetComponent <AttributesComponent>();
            this.attributes.AttributeChanged += OnAttributeChanged;

            this.properties = character.Entity.GetComponent <PropertiesComponent>();
            this.properties.PropertyChanged += OnPropertyChanged;

            this.experience = character.Entity.GetComponent <ExperienceComponent>();
            this.experience.Experience.Changed += OnExperienceChanged;
            OnExperienceChanged(this.experience.Experience);

            var actor = character.Entity.GetComponent <ActorComponent>();

            this.helmCheckbox.isOn = actor.IsHelmVisible;
            this.helmCheckbox.onValueChanged.AddListener(b => actor.SetHelmVisible(b));

            this.characterNameText.text = character.Name;

            this.dropdown.onValueChanged.AddListener(OnDropdownChanged);
            this.dropdown.options = new List <TMP_Dropdown.OptionData>
            {
                new TMP_Dropdown.OptionData(I18N.Instance.Get("ui_attributes")),
                new TMP_Dropdown.OptionData(I18N.Instance.Get("ui_skills")),
            };

            CreateAttributes(this.attributes);
            CreateProperties(this.properties);
            CreateSkillSlots(character.Entity.GetComponent <SpellbookComponent>().Slots);

            OnDropdownChanged(0);
        }
Example #2
0
        public void Initialize(PropertiesComponent properties)
        {
            Properties = properties;
            Properties.ApplyModifiers(this.propertyModifiers);

            OnChange();
        }
Example #3
0
        public void Initialize(GameObject owner)
        {
            Owner = owner;

            this.properties = Owner.GetComponent <PropertiesComponent>();
            this.attributes = Owner.GetComponent <AttributesComponent>();

            OnInitialize();

            Experience.LevelUp += OnLevelUp;
            OnLevelUp(Experience);
        }
Example #4
0
 private void OnPropertyChanged(PropertiesComponent properties, Property property)
 {
     this.requiresUpdate = true;
 }
Example #5
0
        private void CreateProperties(PropertiesComponent properties)
        {
            this.propertyRows = new Dictionary <PropertyType, CharacterInfoRow>();

            Instantiate(this.separatorPrefab, this.attributesContainer);

            CreatePropertyRow(properties.Get(PropertyType.AttackPower));
            CreatePropertyRow(properties.Get(PropertyType.SpellPower));
            CreatePropertyRow(properties.Get(PropertyType.CriticalHitChance));
            CreatePropertyRow(properties.Get(PropertyType.CriticalHitDamage));
            CreatePropertyRow(properties.Get(PropertyType.ArmorPenetration));
            CreatePropertyRow(properties.Get(PropertyType.MagicPenetration));
            CreatePropertyRow(properties.Get(PropertyType.Vampirism));

            Instantiate(this.separatorPrefab, this.attributesContainer);

            CreatePropertyRow(properties.Get(PropertyType.Health));
            CreatePropertyRow(properties.Get(PropertyType.HealthRegeneration));
            CreatePropertyRow(properties.Get(PropertyType.Thorns));
            CreatePropertyRow(properties.Get(PropertyType.IncomingHealingIncrease));
            CreatePropertyRow(properties.Get(PropertyType.BlockChance));
            CreatePropertyRow(properties.Get(PropertyType.BlockAmount));
            CreatePropertyRow(properties.Get(PropertyType.Dodge));
            CreatePropertyRow(properties.Get(PropertyType.DamageReflection));

            Instantiate(this.separatorPrefab, this.attributesContainer);

            CreatePropertyRow(properties.Get(PropertyType.HealingIncrease));
            CreatePropertyRow(properties.Get(PropertyType.DamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.PhysicalDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.MeleeDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.RangedDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.MagicalDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.CrushingDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.SlashingDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.PiercingDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.FireDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.ColdDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.LightningDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.ShadowDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.ArcaneDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.HolyDamageIncrease));
            CreatePropertyRow(properties.Get(PropertyType.PoisonDamageIncrease));

            Instantiate(this.separatorPrefab, this.attributesContainer);

            CreatePropertyRow(properties.Get(PropertyType.IncomingPhysicalDamageReduction));
            CreatePropertyRow(properties.Get(PropertyType.CrushingResistance));
            CreatePropertyRow(properties.Get(PropertyType.SlashingResistance));
            CreatePropertyRow(properties.Get(PropertyType.PiercingResistance));
            CreatePropertyRow(properties.Get(PropertyType.IncomingMagicalDamageReduction));
            CreatePropertyRow(properties.Get(PropertyType.FireResistance));
            CreatePropertyRow(properties.Get(PropertyType.ColdResistance));
            CreatePropertyRow(properties.Get(PropertyType.HolyResistance));
            CreatePropertyRow(properties.Get(PropertyType.ShadowResistance));
            CreatePropertyRow(properties.Get(PropertyType.ArcaneResistance));
            CreatePropertyRow(properties.Get(PropertyType.LightningResistance));
            CreatePropertyRow(properties.Get(PropertyType.PoisonResistance));

            Instantiate(this.separatorPrefab, this.attributesContainer);

            CreatePropertyRow(properties.Get(PropertyType.MinionDamage));
            CreatePropertyRow(properties.Get(PropertyType.MinionHealth));

            Instantiate(this.separatorPrefab, this.attributesContainer);

            CreatePropertyRow(properties.Get(PropertyType.Experience));
        }