Ejemplo n.º 1
0
        public Power(Player player)
        {
            this.player                 = player;
            this.name                   = "";
            this.powerType              = PowerType.AtWill;
            this.actionType             = PowerActionType.Standard;
            this.level                  = 1;
            this.description            = "";
            this.notes                  = "";
            this.attackType             = PowerAttackType.Weapon;
            this.attackWeapon           = WeaponSlot.MainWeapon;
            this.attackAttribute        = AttributeType.Strength;
            this.defenseType            = DefenseType.AC;
            this.weaponDamageMultiplier = 1;
            this.damageType             = "";
            this.bonusDamageAttribute   = null;
            this.attackModifiers        = new BasicAdjustmentList();
            this.damageModifiers        = new BasicAdjustmentList();

            player.PropertyChanged += new PropertyChangedEventHandler(player_PropertyChanged);

            playerWeapon = Weapon;

            if (playerWeapon != null)
            {
                playerWeapon.PropertyChanged += new PropertyChangedEventHandler(playerWeapon_PropertyChanged);
            }

            attackModifiers.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(attackModifiers_CollectionChanged);
            attackModifiers.ContainedElementChanged += new PropertyChangedEventHandler(attackModifiers_ContainedElementChanged);
            damageModifiers.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(damageModifiers_CollectionChanged);
            damageModifiers.ContainedElementChanged += new PropertyChangedEventHandler(damageModifiers_ContainedElementChanged);
        }
Ejemplo n.º 2
0
        public SkillValue(Player player, Skill skill, bool isTrained)
        {
            this.player          = player;
            this.skill           = skill;
            this.isTrained       = isTrained;
            this.miscAdjustments = new BasicAdjustmentList();

            player.PropertyChanged += new PropertyChangedEventHandler(player_PropertyChanged);

            if (player.Armor != null)
            {
                player.Armor.PropertyChanged += new PropertyChangedEventHandler(Armor_PropertyChanged);
            }

            playerArmor = player.Armor;

            if (player.Shield != null)
            {
                player.Shield.PropertyChanged += new PropertyChangedEventHandler(Shield_PropertyChanged);
            }

            playerShield = player.Shield;

            miscAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(miscAdjustments_ContainedElementChanged);
            miscAdjustments.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(miscAdjustments_CollectionChanged);
        }
Ejemplo n.º 3
0
        public WeaponSpecValue(Player player, WeaponSlot slot)
        {
            this.player            = player;
            this.slot              = slot;
            this.toHitAdjustments  = new BasicAdjustmentList();
            this.damageAdjustments = new BasicAdjustmentList();

            player.PropertyChanged += new PropertyChangedEventHandler(player_PropertyChanged);

            playerWeapon = Weapon;

            if (Weapon != null)
            {
                Weapon.PropertyChanged += new PropertyChangedEventHandler(Weapon_PropertyChanged);
            }

            if (Weapon != null)
            {
                weaponBonus = player.WeaponBonuses[Weapon];

                if (weaponBonus != null)
                {
                    weaponBonus.PropertyChanged += new PropertyChangedEventHandler(bonus_PropertyChanged);
                }
            }

            toHitAdjustments.ContainedElementChanged  += new PropertyChangedEventHandler(toHitAdjustments_ContainedElementChanged);
            toHitAdjustments.CollectionChanged        += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(toHitAdjustments_CollectionChanged);
            damageAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(damageAdjustments_ContainedElementChanged);
            damageAdjustments.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(damageAdjustments_CollectionChanged);
        }
Ejemplo n.º 4
0
        public InitiativeValue(Player player)
        {
            this.player          = player;
            this.miscAdjustments = new BasicAdjustmentList();

            player.PropertyChanged += new PropertyChangedEventHandler(player_PropertyChanged);
            miscAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(miscAdjustments_ContainedElementChanged);
            miscAdjustments.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(miscAdjustments_CollectionChanged);
        }
Ejemplo n.º 5
0
        public WeaponBonusValue(BasicAdjustmentList toHitAdjustments, BasicAdjustmentList damageAdjustments)
        {
            this.toHitAdjustments  = toHitAdjustments;
            this.damageAdjustments = damageAdjustments;

            toHitAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(toHitAdjustments_ContainedElementChanged);
            toHitAdjustments.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(toHitAdjustments_CollectionChanged);

            damageAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(damageAdjustments_ContainedElementChanged);
            damageAdjustments.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(damageAdjustments_CollectionChanged);
        }
Ejemplo n.º 6
0
        public HitPointsValue(Player player)
        {
            this.player          = player;
            this.miscAdjustments = new BasicAdjustmentList();

            this.playerClass = player.Class;

            if (player.Class != null)
            {
                player.Class.PropertyChanged += new PropertyChangedEventHandler(Class_PropertyChanged);
            }

            player.PropertyChanged += new PropertyChangedEventHandler(player_PropertyChanged);
            miscAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(miscAdjustments_ContainedElementChanged);
            miscAdjustments.CollectionChanged       += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(miscAdjustments_CollectionChanged);
        }
Ejemplo n.º 7
0
        public void CopyValues(BasicAdjustmentList toHitList, BasicAdjustmentList damageList)
        {
            toHitAdjustments.Clear();

            foreach (BasicAdjustment adjustment in toHitList)
            {
                toHitAdjustments.Add(new BasicAdjustment(adjustment.Modifier, adjustment.Note));
            }

            damageAdjustments.Clear();

            foreach (BasicAdjustment adjustment in damageList)
            {
                damageAdjustments.Add(new BasicAdjustment(adjustment.Modifier, adjustment.Note));
            }
        }
Ejemplo n.º 8
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.º 9
0
        public DefenseValue(Player player, DefenseType defenseType)
        {
            this.player          = player;
            this.defenseType     = defenseType;
            this.miscAdjustments = new BasicAdjustmentList();

            player.PropertyChanged += new PropertyChangedEventHandler(player_PropertyChanged);

            this.playerClass = player.Class;

            if (player.Class != null)
            {
                player.Class.PropertyChanged += new PropertyChangedEventHandler(Class_PropertyChanged);
            }

            miscAdjustments.ContainedElementChanged += new PropertyChangedEventHandler(miscAdjustments_ContainedElementChanged);
            miscAdjustments.CollectionChanged       += new NotifyCollectionChangedEventHandler(miscAdjustments_CollectionChanged);
        }