Exemplo n.º 1
0
        private void SetObjectData(AceCreatureObject aco)
        {
            PhysicsData.CurrentMotionState = new UniversalMotion(MotionStance.Standing);
            PhysicsData.MTableResourceId   = aco.MotionTableId;
            PhysicsData.Stable             = aco.SoundTableId;
            PhysicsData.CSetup             = aco.ModelTableId;
            PhysicsData.Petable            = aco.PhysicsTableId;
            PhysicsData.ObjScale           = aco.ObjectScale;

            // this should probably be determined based on the presence of data.
            PhysicsData.PhysicsDescriptionFlag = (PhysicsDescriptionFlag)aco.PhysicsBitField;
            PhysicsData.PhysicsState           = (PhysicsState)aco.PhysicsState;

            // game data min required flags;
            Icon = aco.IconId;

            GameData.ContainerCapacity = aco.ContainersCapacity;
            GameData.ItemCapacity      = aco.ItemsCapacity;
            GameData.Usable            = (Usable)aco.Usability;
            // intersting finding: the radar color is influenced over the weenieClassId and NOT the blipcolor
            // the blipcolor in DB is 0 whereas the enum suggests it should be 2
            GameData.RadarColour   = (RadarColor)aco.BlipColor;
            GameData.RadarBehavior = (RadarBehavior)aco.Radar;
            GameData.UseRadius     = aco.UseRadius;

            aco.WeenieAnimationOverrides.ForEach(ao => this.ModelData.AddModel(ao.Index, ao.AnimationId));
            aco.WeenieTextureMapOverrides.ForEach(to => this.ModelData.AddTexture(to.Index, to.OldId, to.NewId));
            aco.WeeniePaletteOverrides.ForEach(po => this.ModelData.AddPalette(po.SubPaletteId, po.Offset, po.Length));
            ModelData.PaletteGuid = aco.PaletteId;
        }
Exemplo n.º 2
0
        private void SetAbilities(AceCreatureObject aco)
        {
            Strength     = new CreatureAbility(Enum.Ability.Strength);
            Endurance    = new CreatureAbility(Enum.Ability.Endurance);
            Coordination = new CreatureAbility(Enum.Ability.Coordination);
            Quickness    = new CreatureAbility(Enum.Ability.Quickness);
            Focus        = new CreatureAbility(Enum.Ability.Focus);
            Self         = new CreatureAbility(Enum.Ability.Self);

            // TODO: Real regen rates?
            Health  = new CreatureVital(aco, Enum.Ability.Health, .5);
            Stamina = new CreatureVital(aco, Enum.Ability.Stamina, 1.0);
            Mana    = new CreatureVital(aco, Enum.Ability.Mana, .7);

            Strength.Base     = aco.Strength;
            Endurance.Base    = aco.Endurance;
            Coordination.Base = aco.Coordination;
            Quickness.Base    = aco.Quickness;
            Focus.Base        = aco.Focus;
            Self.Base         = aco.Self;

            // recalculate the base value as the abilities end/will have an influence on those
            Health.Base  = aco.Health - Health.UnbuffedValue;
            Stamina.Base = aco.Stamina - Stamina.UnbuffedValue;
            Mana.Base    = aco.Mana - Mana.UnbuffedValue;

            Health.Current  = Health.MaxValue;
            Stamina.Current = Stamina.MaxValue;
            Mana.Current    = Mana.MaxValue;

            abilities.Add(Enum.Ability.Strength, Strength);
            abilities.Add(Enum.Ability.Endurance, Endurance);
            abilities.Add(Enum.Ability.Coordination, Coordination);
            abilities.Add(Enum.Ability.Quickness, Quickness);
            abilities.Add(Enum.Ability.Focus, Focus);
            abilities.Add(Enum.Ability.Self, Self);

            abilities.Add(Enum.Ability.Health, Health);
            abilities.Add(Enum.Ability.Stamina, Stamina);
            abilities.Add(Enum.Ability.Mana, Mana);

            Abilities = new ReadOnlyDictionary <Enum.Ability, CreatureAbility>(abilities);

            IsAlive = true;
        }