Ejemplo n.º 1
0
        private void player_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (StringComparer.CurrentCultureIgnoreCase.Compare(e.PropertyName, "Race") == 0)
            {
                if (playerRace != null)
                {
                    playerRace.PropertyChanged -= new PropertyChangedEventHandler(Race_PropertyChanged);
                }

                if (player.Race != null)
                {
                    player.Race.PropertyChanged += new PropertyChangedEventHandler(Race_PropertyChanged);
                }

                playerRace = player.Race;
                Notify("BaseSpeed");
                Notify("Value");
            }

            if (StringComparer.CurrentCultureIgnoreCase.Compare(e.PropertyName, "Armor") == 0)
            {
                Notify("ArmorAdjustment");
                Notify("Value");
            }
        }
Ejemplo n.º 2
0
        public SpeedValue(Player player)
        {
            this.player          = player;
            this.miscAdjustments = new BasicAdjustmentList();

            player.PropertyChanged += new PropertyChangedEventHandler(player_PropertyChanged);

            this.playerRace = player.Race;

            if (player.Race != null)
            {
                player.Race.PropertyChanged += new PropertyChangedEventHandler(Race_PropertyChanged);
            }

            miscAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(miscAdjustments_ContainedElementChanged);
            miscAdjustments.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(miscAdjustments_CollectionChanged);
        }
Ejemplo n.º 3
0
        public Player()
        {
            this.characterName     = "";
            this.playerName        = "";
            this.paragonPath       = "";
            this.epicDestiny       = "";
            this._class            = new PlayerClass("", 10, 4, 4);
            this.race              = new PlayerRace("", CreatureSize.Meduim, 6);
            this.deity             = "";
            this.isMale            = true;
            this.level             = 1;
            this.str               = 10;
            this.con               = 10;
            this.dex               = 10;
            this._int              = 10;
            this.wis               = 10;
            this.cha               = 10;
            this.hitPoints         = new HitPointsValue(this);
            this.surgeValue        = new SurgeValue(this);
            this.acrobatics        = new SkillValue(this, Skill.Acrobatics, false);
            this.arcana            = new SkillValue(this, Skill.Arcana, false);
            this.athletics         = new SkillValue(this, Skill.Athletics, false);
            this.bluff             = new SkillValue(this, Skill.Bluff, false);
            this.diplomacy         = new SkillValue(this, Skill.Diplomacy, false);
            this.dungeoneering     = new SkillValue(this, Skill.Dungeoneering, false);
            this.endurance         = new SkillValue(this, Skill.Endurance, false);
            this.heal              = new SkillValue(this, Skill.Heal, false);
            this.history           = new SkillValue(this, Skill.History, false);
            this.insight           = new SkillValue(this, Skill.Insight, false);
            this.intimidate        = new SkillValue(this, Skill.Intimidate, false);
            this.nature            = new SkillValue(this, Skill.Nature, false);
            this.perception        = new SkillValue(this, Skill.Perception, false);
            this.religion          = new SkillValue(this, Skill.Religion, false);
            this.stealth           = new SkillValue(this, Skill.Stealth, false);
            this.streetwise        = new SkillValue(this, Skill.Streetwise, false);
            this.thievery          = new SkillValue(this, Skill.Thievery, false);
            this.initiative        = new InitiativeValue(this);
            this.acDefense         = new DefenseValue(this, DefenseType.AC);
            this.fortDefense       = new DefenseValue(this, DefenseType.Fortitude);
            this.reflexDefense     = new DefenseValue(this, DefenseType.Reflex);
            this.willDefense       = new DefenseValue(this, DefenseType.Will);
            this.speed             = new SpeedValue(this);
            this.raceFeatures      = new ObservableCollectionEx <FeatureValue>();
            this.classFeatures     = new ObservableCollectionEx <FeatureValue>();
            this.paragonFeatures   = new ObservableCollectionEx <FeatureValue>();
            this.destinyFeatures   = new ObservableCollectionEx <FeatureValue>();
            this.feats             = new ObservableCollectionEx <FeatureValue>();
            this.resistances       = new ObservableCollectionEx <ResistanceValue>();
            this.inventory         = new ObservableCollectionEx <IInventoryItem>();
            this.powers            = new PowerCollection();
            this.weaponBonuses     = new WeaponBonusList();
            this.weaponSpec        = new WeaponSpecValue(this, WeaponSlot.MainWeapon);
            this.weaponOffhandSpec = new WeaponSpecValue(this, WeaponSlot.OffhandWeapon);
            this.rangedWeaponSpec  = new WeaponSpecValue(this, WeaponSlot.RangedWeapon);
            this.implementSpec     = new WeaponSpecValue(this, WeaponSlot.Implement);
            this.surgesPerDay      = new SurgesPerDayValue(this);

            hitPoints.PropertyChanged               += new PropertyChangedEventHandler(hitPoints_PropertyChanged);
            insight.PropertyChanged                 += new PropertyChangedEventHandler(insight_PropertyChanged);
            perception.PropertyChanged              += new PropertyChangedEventHandler(perception_PropertyChanged);
            raceFeatures.ContainedElementChanged    += new PropertyChangedEventHandler(raceFeatures_ContainedElementChanged);
            raceFeatures.CollectionChanged          += new NotifyCollectionChangedEventHandler(raceFeatures_CollectionChanged);
            classFeatures.ContainedElementChanged   += new PropertyChangedEventHandler(classFeatures_ContainedElementChanged);
            classFeatures.CollectionChanged         += new NotifyCollectionChangedEventHandler(classFeatures_CollectionChanged);
            paragonFeatures.ContainedElementChanged += new PropertyChangedEventHandler(paragonFeatures_ContainedElementChanged);
            paragonFeatures.CollectionChanged       += new NotifyCollectionChangedEventHandler(paragonFeatures_CollectionChanged);
            destinyFeatures.ContainedElementChanged += new PropertyChangedEventHandler(destinyFeatures_ContainedElementChanged);
            destinyFeatures.CollectionChanged       += new NotifyCollectionChangedEventHandler(destinyFeatures_CollectionChanged);
            feats.ContainedElementChanged           += new PropertyChangedEventHandler(feats_ContainedElementChanged);
            feats.CollectionChanged                 += new NotifyCollectionChangedEventHandler(feats_CollectionChanged);
            resistances.ContainedElementChanged     += new PropertyChangedEventHandler(resistances_ContainedElementChanged);
            resistances.CollectionChanged           += new NotifyCollectionChangedEventHandler(resistances_CollectionChanged);
            inventory.ContainedElementChanged       += new PropertyChangedEventHandler(inventory_ContainedElementChanged);
            inventory.CollectionChanged             += new NotifyCollectionChangedEventHandler(inventory_CollectionChanged);
            powers.ContainedElementChanged          += new PropertyChangedEventHandler(powers_ContainedElementChanged);
            powers.CollectionChanged                += new NotifyCollectionChangedEventHandler(powers_CollectionChanged);
            weaponBonuses.ContainedElementChanged   += new PropertyChangedEventHandler(weaponBonuses_ContainedElementChanged);
            weaponBonuses.CollectionChanged         += new NotifyCollectionChangedEventHandler(weaponBonuses_CollectionChanged);
            weaponSpec.PropertyChanged              += new PropertyChangedEventHandler(weaponSpec_PropertyChanged);
            weaponOffhandSpec.PropertyChanged       += new PropertyChangedEventHandler(weaponOffhandSpec_PropertyChanged);
            rangedWeaponSpec.PropertyChanged        += new PropertyChangedEventHandler(rangedWeaponSpec_PropertyChanged);
            implementSpec.PropertyChanged           += new PropertyChangedEventHandler(implementSpec_PropertyChanged);
            surgesPerDay.PropertyChanged            += new PropertyChangedEventHandler(surgesPerDay_PropertyChanged);
        }
Ejemplo n.º 4
0
 public void CopyValues(PlayerRace playerRace)
 {
     this.Name      = playerRace.Name;
     this.Size      = playerRace.Size;
     this.BaseSpeed = playerRace.BaseSpeed;
 }